-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobalPatches.cs
68 lines (62 loc) · 1.93 KB
/
GlobalPatches.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
using HarmonyLib;
using System.Collections.Generic;
using Klei.AI;
using KMod;
class GlobalPatches : UserMod2
{
public override void OnLoad(Harmony harmony)
{
CookingPatches.TweakFoodValues();
base.OnLoad(harmony);
}
public static Dictionary<string, int> MoraleChanges = new Dictionary<string, int>()
{
{"Edible0", 2 },
{"Edible1", 4 },
{"Edible2", 7 },
{"Edible3", 10 },
{"RoomBedroom", 3 },
{"RoomMessHall", 2 },
{"RoomGreatHall", 3 },
{"RoomPark", 2 },
{"RoomNatureReserve", 4 },
{"SodaFountain", 2 },
{"Juicer", 3 },
{"Danced", 3 },
{"PlayedArcade", 4 },
{"Sauna", 3 },
};
[HarmonyPatch(typeof(Db), nameof(Db.Initialize))]
class Db_Initialize_Patch
{
static void Postfix()
{
// Tweak effect values as appropriate
Debug.Log("Tweaking Effects");
var effects = Db.Get().effects;
for (int i = 0; i < effects.Count; i++)
{
var effect = effects[i];
Debug.Log($"{effect.Id}: {effect.Name}");
if (MoraleChanges.ContainsKey(effect.Id))
{
bool found = false;
foreach (var modifier in effect.SelfModifiers)
{
if (modifier.AttributeId == "QualityOfLife")
{
modifier.SetValue(MoraleChanges[effect.Id]);
found = true;
break;
}
}
if (!found)
{
Debug.Log($"Could not tweak effect \"{effect.Name}\" to have morale of +{MoraleChanges[effect.Id]}");
}
}
}
CritterTrapsAndBaitPatches.TweakTrapTechs();
}
}
}