-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
186 lines (161 loc) · 5.67 KB
/
Main.cs
File metadata and controls
186 lines (161 loc) · 5.67 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
using BTD_Mod_Helper;
using FourthPath;
using MelonLoader;
using Main = FourthPath.Main;
using BTD_Mod_Helper.Api.ModOptions;
using Il2CppSystem.Collections.Specialized;
using UnityEngine;
using HarmonyLib;
using System;
using System.Reflection;
using BTD_Mod_Helper.Extensions;
using HarmonyPrefix = HarmonyLib.HarmonyPrefix;
using HarmonyPatch = HarmonyLib.HarmonyPatch;
using Il2CppAssets.Scripts.Unity.Display;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Il2CppAssets.Scripts.Simulation.Towers.Weapons;
using UnityEngine.Playables;
using Il2CppAssets.Scripts.Simulation.Towers;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Unity.UI_New.Coop;
using BTD_Mod_Helper.Api;
using PathsPlusPlus;
[assembly: MelonInfo(typeof(Main), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace FourthPath;
[HarmonyPatch(typeof(Factory.__c__DisplayClass21_0), "_CreateAsync_b__0")]
public class FactoryCreateAsync_Patch
{
// I referenced Onixiya's SC2Expansion mod for this code, used to change the texture of druid lightning
[HarmonyPrefix]
public static bool Prefix(ref Factory.__c__DisplayClass21_0 __instance, ref UnityDisplayNode prototype)
{
if (__instance.objectId.guidRef.Split('-')[0] == "RedLightning")
{
GameObject go = new GameObject(__instance.objectId.guidRef);
go.transform.position = new Vector3(-3000f, 0f, 0f);
SpriteRenderer sr = go.AddComponent<SpriteRenderer>();
sr.sprite = ModContent.GetSprite<Main>(__instance.objectId.guidRef.Split('-')[1]);
// These are just values from the original lightning
sr.sortingGroupID = 1048575;
sr.sortingLayerID = -4022049;
sr.renderingLayerMask = 4294967295;
go.AddComponent<UnityDisplayNode>();
prototype = go.GetComponent<UnityDisplayNode>();
__instance.__4__this.active.Add(prototype);
__instance.onComplete.Invoke(prototype);
return false;
}
return true;
}
}
public partial class Main : BloonsTD6Mod
{
public override void OnWeaponFire(Weapon weapon)
{
base.OnWeaponFire(weapon);
//MelonLogger.Msg(weapon.weaponModel.name);
}
private static readonly ModSettingCategory DOTEffects = new("Damage over time effects")
{
collapsed = true
};
private static readonly ModSettingCategory TowerRelated = new("Tower Related Stuff")
{
collapsed = true
};
private static readonly ModSettingCategory Costs = new("Cost Related Stuff")
{
collapsed = true
};
public static readonly ModSettingDouble DOTTicking = new(0.4d)
{
category = DOTEffects,
displayName = "Ticking (Default: 0.4)",
description = "Higher tiers use this value and multiplies it",
min = 0,
max = 3,
};
public static readonly ModSettingDouble DOTLength = new(4)
{
category = DOTEffects,
displayName = "Duration (Default: 4)",
description = "Higher tiers use this value and multiplies it",
min = DOTTicking,
max = DOTTicking * 50,
};
public static readonly ModSettingInt DOTDamage = new(1)
{
category = DOTEffects,
displayName = "Damage (Default: 1)",
description = "Higher tiers use this value and multiplies it",
min = 0,
max = 99999999,
};
public static readonly ModSettingBool PurpleImmun = new(true)
{
category = TowerRelated,
displayName = "Can Pop Purples",
description = "Can the bottom path pop purple bloons",
button = true,
};
public static readonly ModSettingBool LeadImmun = new(true)
{
category = TowerRelated,
displayName = "Can Pop Lead",
description = "Can the bottom path pop lead/metal bloons",
button = true,
};
public static readonly ModSettingInt ProjCount = new(5)
{
category = TowerRelated,
displayName = "Projectile Count (Default: 5)",
description = "Amount of Projectiles",
min = 1,
max = 16,
slider = true,
};
public static readonly ModSettingInt Tier1Cost = new(600)
{
category = Costs,
displayName = "Tier 1 Cost: (Default: 600)",
description = "Changes the cost of the tier 1",
min = 0,
max = 9999999,
};
public static readonly ModSettingInt Tier2Cost = new(1100)
{
category = Costs,
displayName = "Tier 2 Cost: (Default: 1100)",
description = "Changes the cost of the tier 2",
min = 0,
max = 9999999,
};
public static readonly ModSettingInt Tier3Cost = new(5400)
{
category = Costs,
displayName = "Tier 3 Cost: (Default: 5400)",
description = "Changes the cost of the tier 3",
min = 0,
max = 9999999,
};
public static readonly ModSettingInt Tier4Cost = new(24000)
{
category = Costs,
displayName = "Tier 4 Cost: (Default: 24000)",
description = "Changes the cost of the tier 4",
min = 0,
max = 9999999,
};
public static readonly ModSettingInt Tier5Cost = new(60000)
{
category = Costs,
displayName = "Tier 5 Cost: (Default: 60000)",
description = "Changes the cost of the tier 5",
min = 0,
max = 9999999,
};
}