public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { this.info = info; var map = init.World.Map; // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains <ParentActorInit>(); var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { this.info = info; var map = init.World.Map; // Explore map-placed actors if the "Explore Map" option is enabled var exploredMap = !init.World.LobbyInfo.GlobalSettings.Shroud; startsRevealed = exploredMap && init.Contains <SpawnedByMapInit>() && !init.Contains <HiddenUnderFogInit>(); var footprintCells = FootprintUtils.FrozenUnderFogTiles(init.Self).ToList(); footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { this.info = info; var map = init.World.Map; // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains <ParentActorInit>(); var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); tooltip = Exts.Lazy(() => init.Self.TraitsImplementing <ITooltip>().FirstOrDefault()); health = Exts.Lazy(() => init.Self.TraitOrDefault <Health>()); }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains <ParentActorInit>(); var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); footprint = footprintCells.Select(cell => cell.ToMPos(init.World.Map)).ToArray(); footprintRegion = CellRegion.BoundingRegion(init.World.Map.TileShape, footprintCells); tooltip = Exts.Lazy(() => init.Self.TraitsImplementing <IToolTip>().FirstOrDefault()); health = Exts.Lazy(() => init.Self.TraitOrDefault <Health>()); frozen = new Dictionary <Player, FrozenActor>(); visible = init.World.Players.ToDictionary(p => p, p => false); }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { this.info = info; var map = init.World.Map; // Explore map-placed actors if the "Explore Map" option is enabled var shroudInfo = init.World.Map.Rules.Actors["player"].TraitInfo <ShroudInfo>(); var exploredMap = init.World.LobbyInfo.GlobalSettings.OptionOrDefault("explored", shroudInfo.ExploredMapCheckboxEnabled); startsRevealed = exploredMap && init.Contains <SpawnedByMapInit>() && !init.Contains <HiddenUnderFogInit>(); var buildingInfo = init.Self.Info.TraitInfoOrDefault <BuildingInfo>(); var footprintCells = buildingInfo != null?buildingInfo.FrozenUnderFogTiles(init.Self.Location).ToList() : new List <CPos>() { init.Self.Location }; footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); }