Skip to content

Commit

Permalink
Fix gas/liquid heaters: set target temp to 1k C, overheat to 1.2k C
Browse files Browse the repository at this point in the history
  • Loading branch information
n-epifanov committed May 26, 2018
1 parent ab1948b commit aee0f7d
Showing 1 changed file with 79 additions and 52 deletions.
131 changes: 79 additions & 52 deletions MovableHeatMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,109 @@
using Harmony;
using JetBrains.Annotations;

namespace Patches
using STRINGS;
using TUNING;
using UnityEngine;


public static class MovableHeatMod
{
public static class MovableHeatMod
{
private static float OVERHEAT_TEMP = 1273.15f;
private static float zeroC = 273.15f;
private static float OVERHEAT_TEMP = 1000 + zeroC;
private static float HEATER_TARGET_TEMP = 1000 + zeroC;
private static float HEATER_OVERHEAT_TEMP = 1200 + zeroC;

[HarmonyPatch(typeof(LiquidPumpConfig), nameof(LiquidPumpConfig.CreateBuildingDef))]
public static class LiquidPumpConfigPatch
[HarmonyPatch(typeof(LiquidPumpConfig), nameof(LiquidPumpConfig.CreateBuildingDef))]
public static class LiquidPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}

[HarmonyPatch(typeof(LiquidMiniPumpConfig), nameof(LiquidMiniPumpConfig.CreateBuildingDef))]
public static class LiquidMiniPumpConfigPatch
[HarmonyPatch(typeof(LiquidMiniPumpConfig), nameof(LiquidMiniPumpConfig.CreateBuildingDef))]
public static class LiquidMiniPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}

[HarmonyPatch(typeof(GasPumpConfig), nameof(GasPumpConfig.CreateBuildingDef))]
public static class GasPumpConfigPatch
[HarmonyPatch(typeof(GasPumpConfig), nameof(GasPumpConfig.CreateBuildingDef))]
public static class GasPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}

[HarmonyPatch(typeof(GasMiniPumpConfig), nameof(GasMiniPumpConfig.CreateBuildingDef))]
public static class GasMiniPumpConfigPatch
[HarmonyPatch(typeof(GasMiniPumpConfig), nameof(GasMiniPumpConfig.CreateBuildingDef))]
public static class GasMiniPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}

[HarmonyPatch(typeof(SpaceHeaterConfig), nameof(SpaceHeaterConfig.CreateBuildingDef))]
public static class SpaceHeaterConfigPatch
[HarmonyPatch(typeof(SpaceHeaterConfig), nameof(SpaceHeaterConfig.CreateBuildingDef))]
public static class SpaceHeaterConfigDefPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = HEATER_OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(SpaceHeaterConfig), nameof(SpaceHeaterConfig.ConfigureBuildingTemplate))]
public static class SpaceHeaterConfigTemplatePatch
{
public static void Postfix(GameObject go)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
SpaceHeater spaceHeater = go.AddOrGet<SpaceHeater>();
spaceHeater.targetTemperature = HEATER_TARGET_TEMP;
}
}

[HarmonyPatch(typeof(LiquidHeaterConfig), nameof(LiquidHeaterConfig.CreateBuildingDef))]
public static class LiquidHeaterConfigPatch
[HarmonyPatch(typeof(LiquidHeaterConfig), nameof(LiquidHeaterConfig.CreateBuildingDef))]
public static class LiquidHeaterConfigDefPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = HEATER_OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(LiquidHeaterConfig), nameof(LiquidHeaterConfig.ConfigureBuildingTemplate))]
public static class LiquidHeaterConfigTemplatePatch
{
public static void Postfix(GameObject go)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
SpaceHeater spaceHeater = go.AddOrGet<SpaceHeater>();
spaceHeater.targetTemperature = HEATER_TARGET_TEMP;
}
}

[HarmonyPatch(typeof(AirConditionerConfig), nameof(AirConditionerConfig.CreateBuildingDef))]
public static class AirConditionerConfigPatch




[HarmonyPatch(typeof(AirConditionerConfig), nameof(AirConditionerConfig.CreateBuildingDef))]
public static class AirConditionerConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}

[HarmonyPatch(typeof(LiquidConditionerConfig), nameof(LiquidConditionerConfig.CreateBuildingDef))]
public static class LiquidConditionerConfigPatch
[HarmonyPatch(typeof(LiquidConditionerConfig), nameof(LiquidConditionerConfig.CreateBuildingDef))]
public static class LiquidConditionerConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
}

0 comments on commit aee0f7d

Please sign in to comment.