-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMod.cs
More file actions
92 lines (79 loc) · 3.25 KB
/
Mod.cs
File metadata and controls
92 lines (79 loc) · 3.25 KB
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
using AfflictionComponent.Components;
using AfflictionComponent.TestAfflictions;
using AfflictionComponent.Utilities;
using ComplexLogger;
namespace AfflictionComponent;
internal sealed class Mod : MelonMod
{
internal static AfflictionManager afflictionManager;
internal static ComplexLogger<Mod> Logger = new();
internal static SaveDataManager sdm = new();
internal static UIAtlas customAtlas;
internal static GameObject allCustomAtlas;
public override void OnSceneWasInitialized(int buildIndex, string sceneName)
{
if (sceneName.ToLowerInvariant().Contains("boot") || sceneName.ToLowerInvariant().Contains("empty")) return;
if (sceneName.ToLowerInvariant().Contains("menu"))
{
UnityEngine.Object.Destroy(GameObject.Find("AfflictionManager"));
afflictionManager = null;
return;
}
if (!sceneName.Contains("_SANDBOX") && !sceneName.Contains("_DLC") && !sceneName.Contains("_WILDLIFE"))
{
if (afflictionManager == null)
{
GameObject AfflictionManager = new() { name = "AfflictionManager", layer = vp_Layer.Default };
UnityEngine.Object.Instantiate(AfflictionManager, GameManager.GetVpFPSPlayer().transform);
UnityEngine.Object.DontDestroyOnLoad(AfflictionManager);
afflictionManager = AfflictionManager.AddComponent<AfflictionManager>();
allCustomAtlas = new() { name = "CustomAtlas's", layer = vp_Layer.Default };
UnityEngine.Object.Instantiate(allCustomAtlas, GameManager.GetVpFPSPlayer().transform);
UnityEngine.Object.DontDestroyOnLoad(allCustomAtlas);
}
}
}
public override void OnUpdate()
{
if (InputManager.GetKeyDown(InputManager.m_CurrentContext, KeyCode.Delete))
{
var testAffliction = new TestAffliction("Testing Affliction",
"Testing Cause",
"Testing Description",
null,
"AfflictionComponent.Resources.Lambda.png",
AfflictionBodyArea.Chest,
true)
{
AltRemedyItems = [],
RemedyItems = [Tuple.Create("GEAR_HeavyBandage", 1, 1)],
InstantHeal = true
};
//testAffliction.Start();
/*var testAfflictionRisk = new TestAffliction("GAMEPLAY_AfflictionTestingRisk",
"Testing Cause",
"Testing Risk Description",
null,
"ico_injury_majorBruising",
AfflictionBodyArea.Chest)
{
Risk = true,
InstantHeal = true
};
testAfflictionRisk.Start();*/
var testAfflictionBuff = new TestAffliction("Testing Buff 1",
"Testing Cause",
"Testing Buff Description 1",
null,
"AfflictionComponent.Resources.Aperture.png",
AfflictionBodyArea.Stomach,
true)
{
Buff = true,
Duration = 2f,
BuffCold = true
};
//testAfflictionBuff.Start();
}
}
}