mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
direct damage (#873)
This commit is contained in:
parent
6e747e67ee
commit
06184773b9
9 changed files with 37 additions and 14 deletions
|
|
@ -517,7 +517,7 @@ export default class DhpActor extends Actor {
|
|||
return canUseArmor || canUseStress;
|
||||
}
|
||||
|
||||
async takeDamage(damages) {
|
||||
async takeDamage(damages, isDirect = false) {
|
||||
if (Hooks.call(`${CONFIG.DH.id}.preTakeDamage`, this, damages) === false) return null;
|
||||
|
||||
if (this.type === 'companion') {
|
||||
|
|
@ -548,6 +548,7 @@ export default class DhpActor extends Actor {
|
|||
hpDamage.value = this.convertDamageToThreshold(hpDamage.value);
|
||||
if (
|
||||
this.type === 'character' &&
|
||||
!isDirect &&
|
||||
this.system.armor &&
|
||||
this.#canReduceDamage(hpDamage.value, hpDamage.damageTypes)
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
|
||||
this.consumeOnSuccess();
|
||||
if (this.system.hasHealing) target.actor.takeHealing(damages);
|
||||
else target.actor.takeDamage(damages);
|
||||
else target.actor.takeDamage(damages, this.system.isDirect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue