-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMovableHeatMod.cs
113 lines (98 loc) · 3.54 KB
/
MovableHeatMod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Harmony;
using JetBrains.Annotations;
using STRINGS;
using TUNING;
using UnityEngine;
public static class MovableHeatMod
{
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
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(LiquidMiniPumpConfig), nameof(LiquidMiniPumpConfig.CreateBuildingDef))]
public static class LiquidMiniPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(GasPumpConfig), nameof(GasPumpConfig.CreateBuildingDef))]
public static class GasPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(GasMiniPumpConfig), nameof(GasMiniPumpConfig.CreateBuildingDef))]
public static class GasMiniPumpConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
[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)
{
SpaceHeater spaceHeater = go.AddOrGet<SpaceHeater>();
spaceHeater.targetTemperature = HEATER_TARGET_TEMP;
}
}
[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)
{
SpaceHeater spaceHeater = go.AddOrGet<SpaceHeater>();
spaceHeater.targetTemperature = HEATER_TARGET_TEMP;
}
}
[HarmonyPatch(typeof(AirConditionerConfig), nameof(AirConditionerConfig.CreateBuildingDef))]
public static class AirConditionerConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
[HarmonyPatch(typeof(LiquidConditionerConfig), nameof(LiquidConditionerConfig.CreateBuildingDef))]
public static class LiquidConditionerConfigPatch
{
public static void Postfix([NotNull] ref BuildingDef __result)
{
__result.OverheatTemperature = OVERHEAT_TEMP;
}
}
}