Esempio n. 1
0
 static void Postfix(ref FloodUnfogResult __result)
 {
     if (Multiplayer.Client != null)
     {
         __result.allOnScreen = false;
     }
 }
Esempio n. 2
0
        private void FloodUnfogAdjacent(IntVec3 c, Map map)
        {
            map.fogGrid.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(map) && intVec.Fogged(map))
                {
                    Building edifice = intVec.GetEdifice(map);
                    if (edifice == null || !edifice.def.MakeFog)
                    {
                        flag             = true;
                        floodUnfogResult = FloodFillerFog.FloodUnfog(intVec, map);
                    }
                    else
                    {
                        map.fogGrid.Unfog(intVec);
                    }
                }
            }
            for (int j = 0; j < 8; j++)
            {
                IntVec3 c2 = c + GenAdj.AdjacentCells[j];
                if (c2.InBounds(map))
                {
                    Building edifice2 = c2.GetEdifice(map);
                    if (edifice2 != null && edifice2.def.MakeFog)
                    {
                        map.fogGrid.Unfog(c2);
                    }
                }
            }
            if (flag)
            {
                if (floodUnfogResult.mechanoidFound)
                {
                    Find.LetterStack.ReceiveLetter("LetterLabelAreaRevealed".Translate(), "AreaRevealedWithMechanoids".Translate(), LetterDefOf.ThreatBig, new TargetInfo(c, map, false), null, null, null, null);
                    return;
                }
                if (!floodUnfogResult.allOnScreen || floodUnfogResult.cellsUnfogged >= 600)
                {
                    Find.LetterStack.ReceiveLetter("LetterLabelAreaRevealed".Translate(), "AreaRevealed".Translate(), LetterDefOf.NeutralEvent, new TargetInfo(c, map, false), null, null, null, null);
                }
            }
        }
Esempio n. 3
0
        static bool Prefix(ref FogGrid __instance, ref Map ___map, IntVec3 c)
        {
            if (!(___map.Parent is City))
            {
                return(true);
            }
            __instance.Unfog(c);
            FloodUnfogResult floodUnfogResult = default(FloodUnfogResult);

            for (int i = 0; i < 4; i++)
            {
                IntVec3 intVec = c + GenAdj.CardinalDirections[i];
                if (intVec.InBounds(___map) && intVec.Fogged(___map))
                {
                    Building edifice = intVec.GetEdifice(___map);
                    if (edifice == null || !edifice.def.MakeFog)
                    {
                        floodUnfogResult = FloodFillerFog.FloodUnfog(intVec, ___map);
                    }
                    else
                    {
                        __instance.Unfog(intVec);
                    }
                }
            }
            for (int j = 0; j < 8; j++)
            {
                IntVec3 c2 = c + GenAdj.AdjacentCells[j];
                if (c2.InBounds(___map))
                {
                    Building edifice2 = c2.GetEdifice(___map);
                    if (edifice2 != null && edifice2.def.MakeFog)
                    {
                        __instance.Unfog(c2);
                    }
                }
            }
            return(false);
        }