-
Notifications
You must be signed in to change notification settings - Fork 528
/
Copy pathMain.cs
149 lines (114 loc) · 4.69 KB
/
Main.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
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
using MelonLoader;
using Harmony;
using Il2CppAssets.Scripts.Unity.UI_New.InGame.Races;
using Il2CppAssets.Scripts.Simulation.Towers.Weapons;
using Il2CppAssets.Scripts.Simulation;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
using Il2CppAssets.Scripts.Unity.UI_New.Main;
using Il2CppAssets.Scripts.Simulation.Bloons;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Unity;
using Il2CppTMPro;
using Il2CppAssets.Scripts.Simulation.Towers;
using Il2CppAssets.Scripts.Utils;
using Il2CppSystem.Collections;
using Il2CppAssets.Scripts.Unity.UI_New.Popups;
using Il2CppAssets.Scripts.Unity.Bridge;
using Il2CppAssets.Scripts.Models.Towers.Behaviors;
using Il2CppAssets.Scripts.Simulation.Objects;
using Il2CppAssets.Scripts.Models;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack;
using System;
using UnityEngine;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions;
using Il2CppAssets.Scripts.Unity.Scenes;
using System.Linq;
using BTD_Mod_Helper;
using System.Text.RegularExpressions;
using System.Reflection;
using System.Collections.Generic;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppAssets.Scripts.Unity.UI_New.ChallengeEditor;
using UnityEngine.UI;
using static Il2CppTMPro.TMP_InputField;
[assembly: MelonInfo(typeof(nolimitseditor.Main), nolimitseditor.ModHelperData.Name, nolimitseditor.ModHelperData.Version, nolimitseditor.ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace nolimitseditor
{
public class Main : BloonsTD6Mod
{
public override void OnApplicationStart()
{
base.OnApplicationStart();
Console.WriteLine("nolimitseditor loaded");
}
static ChallengeEditor ce;
[HarmonyPatch(typeof(ChallengeEditor), "SetupUI")]
public class ChallengeEditor_Patch
{
[HarmonyPostfix]
public static void Postfix(ChallengeEditor __instance)
{
ce = __instance;
TMP_InputField cash = __instance.cash;
TMP_InputField lives = __instance.lives;
TMP_InputField maxLives = __instance.maxLives;
TMP_InputField round = __instance.round;
__instance.endRound.characterLimit = 9999;
round.characterLimit = 9999;
maxLives.characterLimit = 9999;
lives.characterLimit = 9999;
cash.characterLimit = 9999;
Slider bloonSpeed = __instance.bloonSpeed;
Slider regrowSpeed = __instance.regrowSpeed;
Slider moabSpeed = __instance.moabSpeed;
Slider ceramicHealth = __instance.ceramicHealth;
Slider moabHealth = __instance.moabHealth;
Slider abilityCooldownReduction = __instance.abilityCooldownReduction;
moabHealth.maxValue = 9999;
ceramicHealth.maxValue = 9999;
moabSpeed.maxValue = 9999;
regrowSpeed.maxValue = 9999;
bloonSpeed.maxValue = 9999;
abilityCooldownReduction.maxValue = 9999;
moabHealth.minValue = 0.000001f;
ceramicHealth.minValue = 0.000001f;
moabSpeed.minValue = 0.0001f;
regrowSpeed.minValue = 0.0001f;
bloonSpeed.minValue = 0.0001f;
abilityCooldownReduction.minValue = 0.0001f;
moabHealth.wholeNumbers = false;
ceramicHealth.wholeNumbers = false;
moabSpeed.wholeNumbers = false;
regrowSpeed.wholeNumbers = false;
bloonSpeed.wholeNumbers = false;
abilityCooldownReduction.wholeNumbers = false;
((TMP_InputField)__instance.chalName).characterLimit = 9999;
((TMP_InputField)__instance.chalName).characterValidation = (CharacterValidation)0;
}
}
public override void OnUpdate()
{
base.OnUpdate();
bool inAGame = InGame.instance != null && InGame.instance.bridge != null;
if (inAGame)
{
if (InGame.instance.bridge.GetEndRound() > 295)
{
InGame.instance.bridge.SetEndRound(99999);
}
}
//if (ce != null)
//{
// ce.SetEndRound("999999");
// ce.endRound.text = "999999";
//}
}
public override void OnTitleScreen()
{
}
}
}