CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
ProdigyPNP

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: ProdigyPNP/ProdigyMathGameHacking
Path: blob/master/cheatGUI/src/hacks/pets.ts
Views: 723
1
// Pet Hacks
2
3
4
// BEGIN IMPORTS
5
import { Swal, Toast, NumberInput, Confirm } from "../utils/swal"; // Import Swal, Toast, Confirm, Input, and NumberInput from swal
6
import { category } from "../index"; // Import the Cheat GUI bases.
7
import Hack from "../class/Hack";
8
import { _, VERY_LARGE_NUMBER, player } from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER
9
import { getPet } from "../utils/hackify"; // Import getPet
10
// END IMPORTS
11
12
13
// BEGIN PET HACKS
14
15
16
// Begin Get All Pets
17
new Hack(category.pets, "Get All Pets").setClick(async () => {
18
19
20
if (!(await Confirm.fire("Would you like to add all pets to your pets?")).value) {
21
return console.log("Cancelled");
22
}
23
24
25
// add pets
26
// @ts-expect-error
27
_.gameData.pet.forEach(x => {
28
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
29
});
30
31
32
// add encounter info
33
player.kennel._encounterInfo._data.pets = [];
34
_.gameData.pet.map((pet: {
35
ID: number
36
}) => {
37
player.kennel._encounterInfo._data.pets.push({
38
firstSeenDate: Date.now(),
39
ID: pet.ID,
40
timesBattled: 1,
41
timesRescued: 1
42
});
43
});
44
// Fix broken pets
45
// @ts-expect-error
46
player.kennel.petTeam.forEach(v => {
47
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
48
});
49
50
return Toast.fire("Success!", "All pets have been added!", "success");
51
});
52
// End Get All Pets
53
54
55
56
57
// Begin Get ALl Legacy Epics
58
new Hack(category.pets, "Get All Legacy Epics").setClick(async () => {
59
60
61
if (!(await Confirm.fire("This may damage your account.", "Attempting to add legacy epics may damage your account. Would you still like to add all legacy epics to your team?", "warning")).value) {
62
return console.log("Cancelled");
63
}
64
65
// @ts-expect-error
66
const epics = _.gameData.pet.filter(x => [125, 126, 127, 128, 129, 130, 131, 132, 133].includes(x.ID));
67
// @ts-expect-error
68
epics.forEach(x => {
69
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
70
});
71
// Fix broken pets
72
// @ts-expect-error
73
player.kennel.petTeam.forEach(v => {
74
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
75
});
76
return Toast.fire("Success!", "All legacy epics have been added!", "success");
77
});
78
// End Get ALl Legacy Epics
79
80
81
82
83
84
// Begin Get All Mythical Epics
85
new Hack(category.pets, "Get All Mythical Epics").setClick(async () => {
86
87
if (!(await Confirm.fire("Would you like to add all mythical epics to your pets?")).value) {
88
return console.log("Cancelled");
89
}
90
91
92
// @ts-expect-error
93
const epics = _.gameData.pet.filter(x => [
94
158, // Magmayhem
95
164, // Blast Star
96
165, // Vegabloom
97
166, // Arcturion
98
167, // Aquadile
99
168, // Shiver & Scorch
100
169, // Riptide
101
170, // Lumanight
102
171, // Nebula
103
189, // B.F. Magmayhem
104
].includes(x.ID));
105
// @ts-expect-error
106
epics.forEach(x => {
107
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
108
});
109
// Fix broken pets
110
player.kennel.petTeam.forEach((v: any) => {
111
if (v && (v as any).assignRandomSpells) (v as any).assignRandomSpells();
112
});
113
return Toast.fire("Success!", "All mythical epics have been added!", "success");
114
}); // btw this hack was made by gemsvidø (afkvido on github)
115
// End Get ALl Mythical Epics
116
117
118
119
120
121
// Begin Clear Pets
122
new Hack(category.pets, "Clear Pets").setClick(async () => {
123
124
if (!(await Confirm.fire("Would you like to delete all of your pets?")).value) {
125
return console.log("Cancelled");
126
}
127
128
129
player.kennel.data.length = 0;
130
131
return Toast.fire("Success!", "Your pets have been cleared!", "success");
132
});
133
// End Clear Pets
134
135
136
137
138
139
// Begin Add Pet
140
new Hack(category.pets, "Add Pet", "Adds a pet from a list.").setClick(async () => {
141
// @ts-expect-error
142
const pet = await Swal.fire({
143
input: "select",
144
// @ts-expect-error
145
inputOptions: new Map(_.gameData.pet.map(x => [x.ID.toString(), `${x.ID}: ${x.data.name}`])),
146
title: "Choose Pet",
147
text: "Which pet do you want to obtain?"
148
});
149
if (pet.value === undefined) return;
150
player.kennel.addPet(pet.value);
151
// add encounter data
152
player.kennel._encounterInfo._data.pets.push({
153
firstSeenDate: Date.now(),
154
ID: pet.value,
155
timesBattled: 1,
156
timesRescued: 1
157
});
158
159
return Toast.fire("Success!", "Your chosen pet has been added to your pets!", "success");
160
});
161
// End Add Pet
162
163
164
165
166
167
// Begin Uncap pet level
168
new Hack(category.pets, "Uncap pet level [Client Side]", "Change your pet's level to anything, even over 100. This hack won't save when you reload Prodigy.").setClick(async () => {
169
const petTeam = player.kennel.petTeam.slice(0);
170
petTeam.shift();
171
// @ts-expect-error
172
const names = petTeam.map(pet => pet.getName());
173
const pet = await Swal.fire({
174
title: "Which pet would you like to edit?",
175
input: "select",
176
inputOptions: names,
177
inputPlaceholder: "Select...",
178
inputValidator: res => res ? "" : "Please select which you'd like to obtain.",
179
showCancelButton: true
180
});
181
const amt = await NumberInput.fire("Level", "What would you like to set your pet's level to? (Can be set over 100)", "question");
182
if (!amt.value) return;
183
const num = amt.value;
184
// sorry in advance
185
eval(`player.kennel.petTeam[parseInt(${pet.value})+1].getLevel = () => {return ${num}}`);
186
return Toast.fire("Updated!", "The level of your pet was successfully updated. Note: this hack is client-side.", "success");
187
});
188
// End Uncap pet level
189
190
191
192
193
194
// Begin Delete Pet
195
new Hack(category.pets, "Delete Pet", "Delete a pet.").setClick(async () => {
196
const pet = await getPet("Which pet do you wish to delete?");
197
if (pet === undefined) return;
198
player.kennel.data.splice(pet, 1);
199
return Toast.fire("Successfully deleted!", "The selected pet was deleted successfully.", "success");
200
});
201
// End Delete Pet
202
203
204
205
206
// END PET HACKS
207
208