public void Tick(World world, Shroud shroud) { Visible = !Footprint.Any(shroud.IsVisibleTest(FootprintRegion)); if (flashTicks > 0) { flashTicks--; } }
public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud) { actor = self; isVisibleTest = shroud.IsVisibleTest(footprintRegion); Footprint = footprint; CenterPosition = self.CenterPosition; Bounds = self.Bounds; UpdateVisibility(); }
void UpdateShroud(Shroud shroud) { var visibleUnderShroud = shroud.IsExploredTest(updatedRegion); var visibleUnderFog = shroud.IsVisibleTest(updatedRegion); foreach (var cell in updatedRegion) { var shrouded = GetEdges(cell, visibleUnderShroud); var fogged = GetEdges(cell, visibleUnderFog); var shroudTile = tiles[cell]; var variant = shroudTile.Variant; shroudTile.Shroud = GetTile(shroudSprites, shrouded, variant); shroudTile.Fog = GetTile(fogSprites, fogged, variant); tiles[cell] = shroudTile; } }