CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
ProdigyPNP

CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.

GitHub Repository: ProdigyPNP/ProdigyMathGameHacking
Path: blob/master/typings/player.d.ts
Views: 713
1
import { TODO } from "./util";
2
import { Game } from "./game";
3
import { Item } from "./item";
4
import { Backpack } from "./backpack";
5
import { Pet } from "./pet";
6
export declare type ItemType =
7
| "follow"
8
| "hat"
9
| "outfit"
10
| "spellRelic"
11
| "weapon"
12
| "boots";
13
export declare type Zones = "tower_town";
14
export declare class Player {
15
static ACCOUNT_RESET_ZONE_KEEPERS: Zones[];
16
static HP_BONUS: {
17
A: number;
18
"A+": number;
19
"A-": number;
20
B: number;
21
"B+": number;
22
"B-": number;
23
C: number;
24
"C+": number;
25
"C-": number;
26
};
27
static LEVEL_CURVE: { lvl: number, a: number }[]
28
static enemiesPerLevel(level: number): number;
29
static getAoeEvolutions(): number[];
30
static getAttacksFromCurve(prop0: unknown[], prop1: number, prop2: number): unknown[]
31
static getAttacksOfType(prop0: unknown, prop1: unknown): unknown[];
32
static getEvolutionsFromCurve(prop0: unknown[], prop1: number, prop2: number): unknown[]
33
static getHeartsFromCurve(prop0: unknown[], prop1: number, prop2: number): number
34
static getLevelPercent(stars: number): number;
35
static getSingleShotEvolutions(): number[];
36
static levelFromStars(stars: number): number;
37
static starsToLevel(stars: number): number
38
static MAX_HEARTS: number
39
achievements: TODO;
40
appearance: TODO;
41
backpack: Backpack;
42
daily: TODO;
43
dailyQuestions: TODO;
44
encounters: TODO;
45
equipment: TODO;
46
house: TODO;
47
kennel: {
48
addPet(id: number): unknown
49
data: Pet[];
50
petTeam: Pet[];
51
};
52
onHPChange: TODO;
53
quests: TODO;
54
state: TODO;
55
_remoteLogger: TODO;
56
tutorial: TODO;
57
game: Game;
58
immortal: boolean;
59
inPVP: boolean;
60
isClassCodeAttached: boolean;
61
readonly isFocusModeEnabled: boolean; // Getter
62
danceID?: unknown;
63
emoteID?: unknown;
64
appearanceChanged: boolean;
65
broadcastId: number;
66
catchAttempt: number;
67
chatID: number;
68
classIDs: number[];
69
coOpTeam?: unknown;
70
currentVideoSkillId?: unknown;
71
curriculumTreeID: number;
72
earlyBirdLastChance: boolean;
73
grade: number;
74
isOpponent: boolean;
75
hasUsedTicket: boolean;
76
/** Membership */
77
P: boolean;
78
justLeveled: boolean;
79
/** A date ISOString */
80
lastVisited: string;
81
locationSelectionType: string; // home
82
memberEndDate?: unknown; // possibly Date?
83
memberPrompt: boolean;
84
memberShareDate?: unknown; // possibly Date?
85
/** A date ISOString */
86
memberStartDate?: string;
87
modifiers: {
88
maxHearts: number;
89
damage: number;
90
miss: number;
91
ignoreElement: number;
92
potion?: unknown;
93
};
94
overrideClassSelect: boolean;
95
owners: {
96
id: number;
97
ownerID: number;
98
startDate: number;
99
}[];
100
parentEmail: string;
101
parentalLink: boolean;
102
password: string;
103
playerParents: unknown[];
104
playerTeachers: {
105
id: number;
106
type: string;
107
startDate: number;
108
}[];
109
pvpHP: number;
110
registerDate: Date;
111
readonly saveEnabled: boolean; // Getter
112
source?: unknown;
113
spellStreak: number;
114
starsEarned: number;
115
starsReward: number;
116
starsRewardBase: number;
117
starsToProcess: number;
118
data: PlayerData;
119
team?: unknown;
120
transformID?: unknown; // Possibly number?
121
tutorialCompletedThisSession: boolean;
122
type: string; // Possibly "A" | "B" | "C" | "D" | "F"
123
updated: boolean;
124
userID: number;
125
username: string;
126
world: {
127
id: number;
128
full: number;
129
name: string;
130
meta: unknown; // Seems to be {type: "hat", ID: 47} for me.
131
count: number;
132
};
133
_isFocusModeEnabled: false;
134
_saveEnabled: true;
135
name: PlayerName;
136
addAsset(asset: unknown): void;
137
addBattle(): void;
138
addBountyScore(bountyScore: number): void;
139
addLoss(): void;
140
addSpell(spell: number): void;
141
addStars(stars: number, prop1: boolean, prop2: boolean): boolean;
142
addWin(): void;
143
anyPetsAboveLevel(level: number): boolean;
144
canCatch(): boolean;
145
canSpin(): boolean;
146
castSpell(prop0: boolean): void;
147
changeCurrentHearts(prop0: number, prop1: number): void;
148
changeCurrentHeartsPercent(percent: number): void;
149
changeEnergy(energy: number): void;
150
changeGold(gold: number, prop1: boolean): void;
151
checkVersion(): void;
152
completeDaily(daily: keyof PlayerData, completed: boolean): void;
153
completeTower(tower: number): void;
154
constructor(prop0: unknown);
155
createDataClone(): Player;
156
createRandom(): void;
157
diffAttackSlots(level: number): void;
158
equip(id: number, type: ItemType): boolean;
159
evolve(unused0: never, unused1: never): never;
160
forceSaveCharacter(): void;
161
getAllAttacks(): number[];
162
getAllowsHouseVisitors(): boolean;
163
getArenaPoints(): number;
164
getAttacks(): number[];
165
getAvailableEvolutions(): unknown[]; // What does this return?
166
getBaseMaxHearts(): number;
167
getBattles(): number;
168
getBountyScore(): number;
169
getColiseum(): number;
170
getCurrentBamSpells(): number[];
171
getCurrentHearts(): number;
172
getDailyQuestions(): Player["dailyQuestions"];
173
getDamageBonus(): ReturnType<Player["equipment"]["getDamageBonuses"]>;
174
getDataAndClear(): Partial<Player>;
175
getElement(): "wizard";
176
getEnergy(): number;
177
getEquipmentSpell(): { ID: number; type: unknown; locked: boolean };
178
getFirstName(): string;
179
getGold(): number;
180
getHeartBonus(): number;
181
getID(): Player["userID"];
182
getLatestClassIDLegacy(): number;
183
getLevel(): number;
184
getLevelingCurve(level: number): unknown[];
185
getLosses(): number;
186
getMaxHearts(level: number): number;
187
getMaxTimeForCurrentMorphMarbleEffect(): number;
188
getName(): string;
189
getNameWithoutNickname(): string;
190
getNativeSpell(
191
prop0: unknown,
192
prop1: unknown[],
193
prop2: unknown,
194
prop3: unknown
195
): unknown;
196
getNumAttacks(): number;
197
getNumRelics(): number;
198
getPercentToLevel(): number;
199
getPlayerClass(): string;
200
getPlayerData(): PlayerData;
201
getRegisterDate(): Date | null;
202
getSettings(): PlayerData["settings"];
203
getSpellAssets(): unknown[];
204
getSpellStreak(): Player["spellStreak"];
205
getStarReward(): number;
206
getStarRewardByDamage(damage: number): number;
207
getStars(): number | null;
208
getStarsToLevel(): number;
209
getStatHealth(): number;
210
getStatPower(): number;
211
getTeamScore(): number;
212
getTowerProgress(): number;
213
getUpdatedData(prop0: unknown, prop1: unknown): unknown;
214
getWins(): number;
215
hasCompletedTowerTownTutorial(): boolean;
216
hasCompletedTutorial(): boolean;
217
hasHouseItem(item: Item): boolean;
218
hasMaxQuantityOfItem(type: unknown, item: unknown): boolean;
219
hasMembership(): Player["it"];
220
hasValidatedParentEmail(): boolean;
221
hasValidatedTeacherEmail(): boolean;
222
heal(): void;
223
healTeam(hearts: number): void;
224
healTeamMember(hearts: number, prop1: unknown, prop2: unknown): void;
225
init(prop0: unknown): unknown;
226
initFromProtobuf(prop0: unknown): void;
227
isBlockedByDarkTowerMemberGate(): boolean;
228
isItemOwned(item: Item): boolean;
229
isKnockedOut(): boolean;
230
isPlayerTransformed(): boolean;
231
onTutorialComplete(): void;
232
processDeserter(): void;
233
processStars(): void;
234
processTrialMembership(): void;
235
resetAccount(): void;
236
resetModifiers(): void;
237
rewardMembershipPrizes(prop0: unknown): void;
238
setAllowsHouseVisitors(allow: boolean): void;
239
setBGMVolume(volume: number): void;
240
setColiseum(coliseum: number): void;
241
setData(data: PlayerData): void;
242
setDefault(gender: "male" | "female"): void;
243
setEnergy(energy: number): void;
244
setMemberDebug(): void;
245
setMembership(player: Player, member: boolean): void;
246
setParentEmail(email: string): void;
247
setPlayerClass(playerClass: unknown): void;
248
setSFXVolume(volume: number): void;
249
setSpinDate(date: Date): void;
250
setVoiceVolume(volume: number): void;
251
setZone(zone: unknown): void;
252
spinWheel(wheel: 1 | 2): void;
253
swapSpells(prop0: unknown, prop1: unknown): unknown;
254
transformPlayer(prop0: unknown, prop1: unknown, prop2: number): void;
255
unequip(type: ItemType): boolean;
256
updateMembershipVideoAdData(): void;
257
updateModifier(type: "potion" | "barrier", modifier: number): void;
258
validateLevel(): void;
259
}
260
export declare interface PlayerName {
261
generateRandomName(): void;
262
data: {
263
firstName: number | null;
264
lastName: number | null;
265
middleName: number | null;
266
nickname: number | null;
267
};
268
gender: "male" | "female";
269
localizer: { dataSource: TODO };
270
}
271
export declare class PlayerData {
272
allowsHouseVisitors: boolean;
273
arena: number;
274
atHomeTimestamp: number;
275
atSchoolTimestamp: number;
276
battleCounter: number;
277
bountyScore: number;
278
daily: {
279
festivalName: string;
280
isComplete: boolean;
281
lastStarted: number;
282
location: string;
283
monsterID: number;
284
};
285
deserter: number;
286
dungeonRunsTimeStamps: {
287
dungeonName: string;
288
lastRunTimeStamp: number;
289
}[];
290
energy: number;
291
gold: number;
292
hp: number;
293
lastArchiveRun: number;
294
level: number;
295
memberStarsExpirationDate: number;
296
nm: number;
297
numSpins1: number;
298
numSpins2: number;
299
school: string;
300
settings: {
301
bgmVolume: number;
302
voiceVolume: number;
303
sfxVolume: number;
304
};
305
spellbook: number[];
306
spells: number[];
307
spinDate1: number;
308
spinDate2: number;
309
stars: number;
310
startDate: number;
311
storedMemberStars: number;
312
team: number;
313
titanID: number;
314
tower: number;
315
trialSkipAvailable: boolean;
316
trialStartDate: string;
317
versionID: number;
318
win: number;
319
zone: string;
320
}
321
// TODO: Get types for unknowns.
322
323