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

Method setHp

code/main/QuestEntity.ts:590–599  ·  view source on GitHub ↗
(hp: number)

Source from the content-addressed store, hash-verified

588 }
589
590 public setHp(hp: number): void{
591 // BUGS
592 if(Bugs.getQuestBugLevel() >= 2)
593 hp *= Random.between(1, 5);
594
595 this.hp = hp;
596 if(this.hp > this.maxHp) this.hp = this.maxHp;
597 if(this.hp < 0) this.hp = 0;
598 this.tryToUpdateHealthBar();
599 }
600
601 public setIsASpell(isASpell: boolean): void{
602 this.isASpell = isASpell;

Callers 3

beginBerserkMethod · 0.95
healMethod · 0.95
inflictDamageMethod · 0.95

Calls 1

tryToUpdateHealthBarMethod · 0.95

Tested by

no test coverage detected