more checking rooms

This commit is contained in:
anton.gurov
2019-11-12 14:52:17 +03:00
parent 4bdb51d9e3
commit 7837051e80
13 changed files with 82 additions and 37 deletions

View File

@ -78,7 +78,7 @@ Pre-Computed Visiblity Trees on RogueBasin
Adam Milazzo's FOV Method Roundup where a similar method described as 'permissive' is detailed
*/
const MIN_LIT_TO_BE_VISIBLE = 1
const MIN_LIT_TO_BE_VISIBLE = 0
const MIN_WALL_LIT_TO_BE_VISIBLE = 4
var errNotFoundCell = errors.New("Cell not found")
@ -240,7 +240,8 @@ func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords
for _, angle := range cell.occludedAngles {
if level.GetTile(lc).BlocksSight && ps.LightWalls {
if (nextShade[angle] == 0 && currentShade[angle] == 0) {
//if (nextShade[angle] == 0 && currentShade[angle] == 0) {
if (nextShade[angle] == 0) {
level.GetTile(lc).Visible = true
level.GetTile(lc).Explored = true
}
@ -263,7 +264,8 @@ func (ps *precomputedShade) ComputeFov(level *gamemap.Level, initCoords types.Co
for _, cell := range ps.CellList {
//fmt.Printf("\n coords: %v, distance: %f, lit: %d", cell.Coords, cell.distance, cell.lit)
cs, err := ps.toLevelCoords(level, initCoords, cell.Coords)
if cell.lit > MIN_LIT_TO_BE_VISIBLE {
//if cell.lit > 0 && cell.lit > MIN_LIT_TO_BE_VISIBLE {
if cell.lit > 0 && cell.lit / (ps.MaxTorchRadius - int(cell.distance -1)) > MIN_LIT_TO_BE_VISIBLE {
if err != nil {
continue
}