Skip to content

Commit 07f29b6

Browse files
authored
Merge branch 'master' into master
2 parents 7dbc3e9 + 8f82bef commit 07f29b6

File tree

16 files changed

+1744
-1284
lines changed

16 files changed

+1744
-1284
lines changed

cheatGUI/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cheatGUI/src/hacks/battle.ts

Lines changed: 86 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,82 +6,109 @@
66
import { Toast, NumberInput } from "../utils/swal"; // Import Toast and NumberInput from swal
77
import { Hack, category, Toggler } from "../index"; // Import the Cheat GUI bases.
88
import { _, prodigy, game, VERY_LARGE_NUMBER } from "../utils/util"; // Import prodigy typings
9+
import { BattleInfo } from "../utils/log"; // Import Battle logging functions
910
// END IMPORTS
1011

1112

1213

1314
// BEGIN BATTLE HACKS
1415

16+
17+
1518
// Begin Disable Math
1619
new Toggler(category.battle, "Disable math [PvP, PvE]", "Disable math in PvP, PvE, anywhere! This doesn't work in the Floatling town.").setEnabled(async () => {
1720

18-
// Use Prodigy's debug stuff to set EDUCATION_ENABLED to false
19-
_.constants.constants["GameConstants.Debug.EDUCATION_ENABLED"] = false;
20-
return Toast.fire("Enabled!", "You will no longer do Math!", "success");
21+
// Use Prodigy's debug stuff to set EDUCATION_ENABLED to false
22+
_.constants.constants["GameConstants.Debug.EDUCATION_ENABLED"] = false;
23+
return Toast.fire("Enabled!", "You will no longer do Math!", "success");
2124

2225

2326
}).setDisabled(async () => {
2427

25-
// Use Prodigy's debug stuff to set EDUCATION_ENABLED to true
26-
_.constants.constants["GameConstants.Debug.EDUCATION_ENABLED"] = true;
27-
return Toast.fire("Disabled!", "You will now do Math!", "success");
28+
// Use Prodigy's debug stuff to set EDUCATION_ENABLED to true
29+
_.constants.constants["GameConstants.Debug.EDUCATION_ENABLED"] = true;
30+
return Toast.fire("Disabled!", "You will now do Math!", "success");
2831

2932
});
3033
// End Disable Math
3134

3235

3336

37+
38+
39+
3440
// Begin Instant Kill
3541
new Toggler(category.battle, "Instant Kill [PvE]", "Makes your spells do insane damage in PvE!").setEnabled(async () => {
36-
_.player.modifiers.damage = VERY_LARGE_NUMBER;
37-
return Toast.fire("Enabled!", "You will now do insane damage in PvE!", "success");
42+
_.player.modifiers.damage = VERY_LARGE_NUMBER;
43+
return Toast.fire("Enabled!", "You will now do insane damage in PvE!", "success");
3844

3945
}).setDisabled(() => {
40-
_.player.modifiers.damage = 1;
41-
return Toast.fire("Disabled!", "You will no longer do insane damage in PvE!", "success");
46+
_.player.modifiers.damage = 1;
47+
return Toast.fire("Disabled!", "You will no longer do insane damage in PvE!", "success");
4248
});
4349
// End Instant Kill
4450

4551

4652

53+
54+
55+
4756
// Begin PvP Health
4857
new Hack(category.battle, "PvP Health [PvP]", "Increases your HP in PvP by a hell ton.").setClick(async () => {
49-
_.player.pvpHP = VERY_LARGE_NUMBER;
50-
_.player.getMaxHearts = () => VERY_LARGE_NUMBER;
51-
return Toast.fire("Success!", "You now have lots of health!", "success");
58+
_.player.pvpHP = VERY_LARGE_NUMBER;
59+
_.player.getMaxHearts = () => VERY_LARGE_NUMBER;
60+
return Toast.fire("Success!", "You now have lots of health!", "success");
5261
});
5362
// End PvP Health
5463

5564

5665

66+
67+
68+
5769
// Begin Escape Battle
5870
new Hack(category.battle, "Escape Battle [PvP, PvE]", "Escape any battle, PvP or PvE!").setClick(async () => {
59-
const currentState = game.state.current;
60-
if (currentState === "PVP") Object.fromEntries(_.instance.game.state.states).PVP.endPVP();
61-
else if (currentState === "CoOp") prodigy.world.$(_.player.data.zone);
62-
else if (!["Battle", "SecureBattle"].includes(currentState)) {
63-
return Toast.fire(
64-
"Invalid State.",
65-
"You are currently not in a battle.",
66-
"error"
67-
);
68-
} else {
69-
Object.fromEntries(_.instance.game.state.states)[currentState].runAwayCallback();
70-
return Toast.fire(
71-
"Escaped!",
72-
"You have successfully escaped from the battle.",
73-
"success"
74-
);
75-
}
71+
const currentState = game.state.current;
72+
if (currentState === "PVP") {
73+
Object.fromEntries(_.instance.game.state.states).PVP.endPVP();
74+
return Toast.fire(
75+
"Escaped!",
76+
"You have successfully escaped from the PvP battle.",
77+
"success"
78+
);
79+
} else if (currentState === "CoOp") {
80+
prodigy.world.$(_.player.data.zone);
81+
return Toast.fire(
82+
"Escaped!",
83+
"You have successfully escaped from the battle.",
84+
"success"
85+
);
86+
} else if (!["Battle", "SecureBattle"].includes(currentState)) {
87+
return Toast.fire(
88+
"Invalid State.",
89+
"You are currently not in a battle.",
90+
"error"
91+
);
92+
} else {
93+
Object.fromEntries(_.instance.game.state.states)[currentState].runAwayCallback();
94+
return Toast.fire(
95+
"Escaped!",
96+
"You have successfully escaped from the PvE battle.",
97+
"success"
98+
);
99+
}
76100
});
77101
// End Escape Battle
78102

79103

80104

105+
106+
81107
// Begin Win Battle
82108
new Hack(category.battle, "Win Battle [PvE]", "Instantly win a battle in PvE.").setClick(async () => {
109+
83110
const currentState = game.state.current;
84-
console.log("Current State: " + currentState);
111+
BattleInfo("Current State: " + currentState);
85112

86113
switch (currentState) {
87114
case "PVP":
@@ -113,56 +140,64 @@ new Hack(category.battle, "Win Battle [PvE]", "Instantly win a battle in PvE.").
113140
);
114141
}
115142

143+
116144
});
117145
// End Win Battle
118146

119147

120148

121149

150+
151+
122152
// Begin Set Battle Hearts
123153
new Hack(category.battle, "Set Battle Hearts [PvP, PvE]", "Sets your hearts in battle, automatically raise your max hearts in PvP or PvE.").setClick(async () => {
124-
const hp = await NumberInput.fire("Health Amount", "How much HP do you want?", "question");
125-
if (hp.value === undefined) return;
126-
_.player.getMaxHearts = () => +hp.value;
127-
_.player.pvpHP = +hp.value;
128-
_.player.data.hp = +hp.value;
129-
return Toast.fire("Success!", "Your hearts have been set.", "success");
154+
const hp = await NumberInput.fire("Health Amount", "How much HP do you want?", "question");
155+
if (hp.value === undefined) return;
156+
_.player.getMaxHearts = () => +hp.value;
157+
_.player.pvpHP = +hp.value;
158+
_.player.data.hp = +hp.value;
159+
return Toast.fire("Success!", "Your hearts have been set.", "success");
130160
});
131161
// End Set Battle Hearts
132162

133163

134164

165+
166+
135167
// Begin Fill Battle Energy
136168
new Hack(category.battle, "Fill Battle Energy [PvP, PvE]", "Fills up your battle energy, if you are in PvP or PvE.").setClick(async () => {
137-
const state = game.state.getCurrentState();
138-
if (!("teams" in state)) return Toast.fire("Error", "You are currently not in a battle.", "error");
139-
state.teams[0].setEnergy(99);
140-
return Toast.fire("Success!", "Your battle energy has been filled.", "success");
169+
const state = game.state.getCurrentState();
170+
if (!("teams" in state)) return Toast.fire("Error", "You are currently not in a battle.", "error");
171+
state.teams[0].setEnergy(99);
172+
return Toast.fire("Success!", "Your battle energy has been filled.", "success");
141173
});
142174
// End Fill Battle Energy
143175

144176

145177

146178

179+
180+
147181
// Begin Heal Team
148182
new Hack(category.battle, "Heal Team [PvE]", "Instantly heals you and your pets, if you are in PvE.").setClick(async () => {
149183

150184

151-
const currentState : string = game.state.current;
185+
const currentState: string = game.state.current;
152186

153187

154-
if (currentState === "PVP" || currentState === "CoOp") {
188+
if (currentState === "PVP" || currentState === "CoOp") {
155189

156-
return Toast.fire("Invalid State.", "PvP is not supported for this hack.", "error");
190+
return Toast.fire("Invalid State.", "PvP is not supported for this hack.", "error");
157191

158-
} else if (["Battle", "SecureBattle"].includes(currentState)) {
159-
_.player.heal();
160-
return Toast.fire("Success!", "Your team has been healed successfully!", "success");
161-
} else {
162-
return Toast.fire("Invalid State.", "Your are currently not in a battle.", "error");
163-
}
192+
} else if (["Battle", "SecureBattle"].includes(currentState)) {
193+
_.player.heal();
194+
return Toast.fire("Success!", "Your team has been healed successfully!", "success");
195+
} else {
196+
return Toast.fire("Invalid State.", "Your are currently not in a battle.", "error");
197+
}
164198
});
165199
// End Heal Team
166200

167201

168-
// END BATTLE HACKS
202+
203+
// END BATTLE HACKS

0 commit comments

Comments
 (0)