MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / resetPlayer

Method resetPlayer

code/main/Game.ts:324–335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322 }
323
324 public resetPlayer(): void{
325 // Save some important things
326 var hp: number = this.player.getHp();
327 var maxHp: number = this.player.getMaxHp();
328
329 // Re-create the player
330 this.player = new Player(this);
331
332 // Restore the important things saved
333 this.player.setHp(hp);
334 this.player.setMaxHp(maxHp);
335 }
336
337 public resetSpecialHotkeys(): void{
338 this.specialHotkeys = [];

Callers 1

constructorMethod · 0.80

Calls 4

getHpMethod · 0.45
getMaxHpMethod · 0.45
setHpMethod · 0.45
setMaxHpMethod · 0.45

Tested by

no test coverage detected