Beispiel #1
0
        public List <IntVec3> GetValidSkeletonCells()
        {
            Map map = base.SingleMap;

            return(map.AllCells.Where((IntVec3 c) => map.terrainGrid.TerrainAt(c).affordances.Contains(TerrainAffordanceDefOf.Diggable) &&
                                      map.glowGrid.GameGlowAt(c) < spawnThresh &&
                                      GridsUtility.UsesOutdoorTemperature(c, map) &&
                                      !GridsUtility.Fogged(c, map) &&
                                      c.Standable(map)
                                      ).ToList());
        }
        // Token: 0x0600003E RID: 62 RVA: 0x00004794 File Offset: 0x00002994
        internal static string GetCamoType(Pawn pawn)
        {
            string text = "notDefined";

            if (!(text != "notDefined") && GridsUtility.GetSnowDepth(pawn.Position, pawn.Map) >= 0.25f)
            {
                return("Arctic");
            }
            TerrainDef terrain = GridsUtility.GetTerrain(pawn.Position, pawn.Map);

            if (!(text != "notDefined") && terrain != null)
            {
                if ((terrain?.smoothedTerrain) != null || terrain.affordances.Contains(TerrainAffordanceDefOf.SmoothableStone))
                {
                    return("Stone");
                }
                if (CamoGearUtility.IsFluffyStuffed(terrain, out string text2))
                {
                    text = text2;
                }
                else
                {
                    text = CamoDefGet.GetCamoDefTerrain(terrain);
                }
                if (Prefs.DevMode && Controller.Settings.ShowTerrainLogs && Find.TickManager.TicksGame % 120 == 0)
                {
                    Log.Message("Terrain: " + terrain.defName + " : " + text, false);
                }
            }
            if (!(text != "notDefined") && !GridsUtility.UsesOutdoorTemperature(pawn.Position, pawn.Map))
            {
                return("Urban");
            }
            if (!(text != "notDefined"))
            {
                text = CamoDefGet.GetCamoDefBiome(pawn.Map.Biome);
            }
            return(text);
        }
    public static bool Patch_Zone_Growing_GetInspectString(ref Zone_Growing __instance, ref string __result)
    {
        ThingDef plantDefToGrow = __instance.GetPlantDefToGrow();

        if (plantDefToGrow.thingClass != typeof(FrostPlant))
        {
            return(true);
        }
        string text = "";

        if (!__instance.cells.NullOrEmpty())
        {
            IntVec3 val = __instance.cells.First();
            if (GridsUtility.UsesOutdoorTemperature(val, __instance.Map))
            {
                string text2 = text;
                text = text2 + Translator.Translate("OutdoorGrowingPeriod") + ": " + Zone_Growing.GrowingQuadrumsDescription(__instance.Map.Tile) + " (" + Translator.Translate("OrassansColdImmunePlants") + ")\n";
            }
            text = (__result = (!GrowthSeasonNowFrostPlant(val, __instance.Map) ? text + Translator.Translate("CannotGrowBadSeasonTemperature") : text + Translator.Translate("GrowSeasonHereNow")));
        }
        return(false);
    }