-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRoomTypesPatches.cs
34 lines (33 loc) · 1.04 KB
/
RoomTypesPatches.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
using HarmonyLib;
using Database;
class RoomTypesPatches
{
// intercept the constructor arguments for just the great hall
// it's not possible to edit Database.RoomTypes.GreatHall after the fact since the constraints are private set
[HarmonyPatch(typeof(RoomType), MethodType.Constructor, new[] {
typeof(string),
typeof(string),
typeof(string),
typeof(string),
typeof(RoomTypeCategory),
typeof(RoomConstraints.Constraint),
typeof(RoomConstraints.Constraint[]),
typeof(RoomDetails.Detail[]),
typeof(int),
typeof(RoomType[]),
typeof(bool),
typeof(bool),
typeof(string[]),
typeof(int)
})]
class RoomTypes_Constructor_Patch
{
public static void Prefix(string id, ref RoomConstraints.Constraint[] additional_constraints)
{
if (id == nameof(RoomTypes.GreatHall))
{
additional_constraints = additional_constraints.AddToArray(RoomConstraints.LIGHT);
}
}
}
}