Ejemplo n.º 1
0
 internal static void DebugRefogMap(Map map)
 {
     map.fogGrid.SetAllFogged();
     foreach (IntVec3 loc in map.AllCells)
     {
         map.mapDrawer.MapMeshDirty(loc, MapMeshFlag.FogOfWar);
     }
     FloodFillerFog.FloodUnfog(map.mapPawns.FreeColonistsSpawned.RandomElement <Pawn>().Position, map);
 }
Ejemplo n.º 2
0
 internal static void DebugFloodUnfog(IntVec3 root, Map map)
 {
     map.fogGrid.SetAllFogged();
     foreach (IntVec3 loc in map.AllCells)
     {
         map.mapDrawer.MapMeshDirty(loc, MapMeshFlag.FogOfWar);
     }
     FloodFillerFog.testMode = true;
     FloodFillerFog.FloodUnfog(root, map);
     FloodFillerFog.testMode = false;
 }
Ejemplo n.º 3
0
        private void FloodUnfogAdjacent(IntVec3 c)
        {
            this.Unfog(c);
            bool             flag             = false;
            FloodUnfogResult floodUnfogResult = default(FloodUnfogResult);

            for (int i = 0; i < 4; i++)
            {
                IntVec3 intVec = c + GenAdj.CardinalDirections[i];
                if (intVec.InBounds(this.map) && intVec.Fogged(this.map))
                {
                    Building edifice = intVec.GetEdifice(this.map);
                    if (edifice == null || !edifice.def.MakeFog)
                    {
                        flag             = true;
                        floodUnfogResult = FloodFillerFog.FloodUnfog(intVec, this.map);
                    }
                    else
                    {
                        this.Unfog(intVec);
                    }
                }
            }
            for (int j = 0; j < 8; j++)
            {
                IntVec3 c2 = c + GenAdj.AdjacentCells[j];
                if (c2.InBounds(this.map))
                {
                    Building edifice2 = c2.GetEdifice(this.map);
                    if (edifice2 != null && edifice2.def.MakeFog)
                    {
                        this.Unfog(c2);
                    }
                }
            }
            if (flag)
            {
                if (floodUnfogResult.mechanoidFound)
                {
                    Find.LetterStack.ReceiveLetter("LetterLabelAreaRevealed".Translate(), "AreaRevealedWithMechanoids".Translate(), LetterDefOf.ThreatBig, new TargetInfo(c, this.map, false), null);
                }
                else
                {
                    if (floodUnfogResult.allOnScreen && floodUnfogResult.cellsUnfogged < 600)
                    {
                        return;
                    }
                    Find.LetterStack.ReceiveLetter("LetterLabelAreaRevealed".Translate(), "AreaRevealed".Translate(), LetterDefOf.NeutralEvent, new TargetInfo(c, this.map, false), null);
                }
            }
        }
Ejemplo n.º 4
0
 private static void RefogMap()
 {
     FloodFillerFog.DebugRefogMap(Find.CurrentMap);
 }
Ejemplo n.º 5
0
 private static void TestFloodUnfog()
 {
     FloodFillerFog.DebugFloodUnfog(UI.MouseCell(), Find.CurrentMap);
 }