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

Method hit

code/main/Player.ts:164–179  ·  view source on GitHub ↗
(questEntity: QuestEntity, damage: number, reason: QuestEntityDamageReason)

Source from the content-addressed store, hash-verified

162 }
163
164 public hit(questEntity: QuestEntity, damage: number, reason: QuestEntityDamageReason): void{
165 for(var savingName in this.game.getSelectedEqItems()){
166 damage = this.game.getSelectedEqItems()[savingName].hit(this, this.getQuest(), questEntity, damage, reason);
167 }
168
169 for(var savingName in this.game.getGridItems()){
170 if(Saving.loadBool(savingName)) damage = this.game.getGridItems()[savingName].hit(this, this.getQuest(), questEntity, damage, reason);
171 }
172
173 // Gift of power
174 if(Saving.loadNumber("gameGiftPower") > 0){
175 damage = Math.ceil(damage + damage * (Saving.loadNumber("gameGiftPower")/5));
176 }
177
178 super.hit(questEntity, damage, reason);
179 }
180
181 public inflictDamage(damage: number, reason: QuestEntityDamageReason): void{
182 for(var savingName in this.game.getSelectedEqItems()){

Callers

nothing calls this directly

Calls 3

getSelectedEqItemsMethod · 0.80
getQuestMethod · 0.80
getGridItemsMethod · 0.80

Tested by

no test coverage detected