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

Method hit

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

Source from the content-addressed store, hash-verified

268 }
269
270 public hit(questEntity: QuestEntity, damage: number, reason: QuestEntityDamageReason): void{
271 // BUGS
272 if(Bugs.getQuestBugLevel() >= 1)
273 damage *= Random.between(1, 3);
274
275 if(this.berserk == false)
276 questEntity.inflictDamage(damage, reason);
277 else
278 questEntity.inflictDamage(damage*2, reason);
279 }
280
281 public inflictDamage(damage: number, reason: QuestEntityDamageReason): void{
282 // We save the damage reason

Callers

nothing calls this directly

Calls 1

inflictDamageMethod · 0.45

Tested by

no test coverage detected