-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNonUIPatches.cs
44 lines (40 loc) · 1.33 KB
/
NonUIPatches.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
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Simulation;
using Il2CppAssets.Scripts.Simulation.Tracking;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
[HarmonyPatch(typeof(AnalyticsTrackerSimManager), nameof(AnalyticsTrackerSimManager.OnCashEarned))]
public class NoCash
{
[HarmonyPrefix]
public static bool Prefix(ref double cash,ref Simulation.CashSource source)
{
var c = cash;
if (Globals.GlobalVar.Class == "Necromancer")
{
if (source != Simulation.CashSource.CoopTransferedCash || source != Simulation.CashSource.TowerSold)
{
c *= .15f;
}
InGame.instance.AddCash(-c);
}
if (Globals.GlobalVar.Class == "Commander")
{
if (source != Simulation.CashSource.CoopTransferedCash || source != Simulation.CashSource.TowerSold)
{
c *= .05f;
c = -c;
}
InGame.instance.AddCash(c);
}
if (Globals.GlobalVar.Class == "Economist")
{
if (source != Simulation.CashSource.CoopTransferedCash || source != Simulation.CashSource.TowerSold)
{
c *= .2f;
}
InGame.instance.AddCash(c);
}
return true;
}
}