コード例 #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);
 }
コード例 #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;
 }
コード例 #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);
                }
            }
        }