public static void UpdateTileByBiomeModExts(Tile tile) { // Module replacement ModExt_Biome_Replacement extReplacement = tile.biome.GetModExtension <ModExt_Biome_Replacement>(); if (extReplacement != null) { // Replace elevation if (extReplacement.replaceElevation) { tile.elevation = Rand.RangeInclusive(extReplacement.elevationMin, extReplacement.elevationMax); } // Replace hilliness if (extReplacement.replaceHilliness != null) { tile.hilliness = (Hilliness)extReplacement.replaceHilliness; } } // Module temperature ModExt_Biome_Temperature extTemperature = tile.biome.GetModExtension <ModExt_Biome_Temperature>(); if (extTemperature != null) { // Adjust base temperature tile.temperature = tile.temperature * (1f - extTemperature.tempStableWeight) + extTemperature.tempStableValue * extTemperature.tempStableWeight + extTemperature.tempOffset; } }
public static void Postfix(ref float __result, int tile) { ModExt_Biome_Temperature extTemperature = Find.WorldGrid[tile].biome.GetModExtension <ModExt_Biome_Temperature>(); if (extTemperature == null) { return; } __result = __result * (1f - extTemperature.tempStableWeight) + extTemperature.tempStableValue * extTemperature.tempStableWeight + extTemperature.tempOffset; }
public static void Postfix(object __instance, ref float __result) { int tile = Traverse.Create(__instance).Field("tile").GetValue <int>(); ModExt_Biome_Temperature extTemperature = Find.WorldGrid[tile].biome.GetModExtension <ModExt_Biome_Temperature>(); if (extTemperature == null) { return; } __result = __result * (1f - extTemperature.tempStableWeight) + extTemperature.tempStableValue * extTemperature.tempStableWeight + extTemperature.tempOffset; }