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

Method magicHealthRegain

code/main/Player.ts:283–290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281 }
282
283 public magicHealthRegain(): void{
284 // If we're not questing
285 if(this.game.getWeAreQuesting() == false){
286 var hpBonus: number = Math.ceil((1-Math.exp(-this.game.getCandiesEaten().getCurrent()/400000000))*500);
287 if(hpBonus < 1) hpBonus = 1; // We need to gain at least one hp each second
288 this.setHp(this.getHp() + hpBonus);
289 }
290 }
291
292 public move(pos: Pos, force: boolean = false): boolean{
293 // Position

Callers 1

oneSecondMethodMethod · 0.80

Calls 5

setHpMethod · 0.95
getWeAreQuestingMethod · 0.80
getCurrentMethod · 0.80
getCandiesEatenMethod · 0.80
getHpMethod · 0.45

Tested by

no test coverage detected