From 7c28c43bd9c4fcffeee9bdc92990b6ae2cccfda1 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 26 May 2024 16:55:47 -0500 Subject: [PATCH] add relief --- src/module/powers/healing.js | 2 +- src/module/powers/powers.js | 2 + src/module/powers/relief.js | 104 +++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 src/module/powers/relief.js diff --git a/src/module/powers/healing.js b/src/module/powers/healing.js index be6cf9c..5c5f8bc 100644 --- a/src/module/powers/healing.js +++ b/src/module/powers/healing.js @@ -22,7 +22,7 @@ export class HealingEffect extends PowerEffect { } get isDamaging() { - return true; + return false; } get basePowerPoints() { diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index dd3c89e..54e7cb5 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -44,6 +44,7 @@ import { PlanarBindingEffect } from './planarBinding.js'; import { PlaneShiftEffect } from './planeShift.js'; import { ProtectionEffect } from './protection.js'; import { PuppetEffect } from './puppet.js'; +import { ReliefEffect } from './relief.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -101,6 +102,7 @@ const PowerClasses = { 'plane-shift': PlaneShiftEffect, protection: ProtectionEffect, puppet: PuppetEffect, + relief: ReliefEffect, shrink: GrowthShrinkEffect, }; diff --git a/src/module/powers/relief.js b/src/module/powers/relief.js new file mode 100644 index 0000000..6a2b3f7 --- /dev/null +++ b/src/module/powers/relief.js @@ -0,0 +1,104 @@ +import { PowerEffect } from './basePowers.js'; + +export class ReliefEffect extends PowerEffect { + get name() { + return 'Relief'; + } + + get icon() { + return 'icons/magic/nature/root-vine-caduceus-healing.webp'; + } + + get duration() { + return this.data.effect === 'numb' ? 600 : 0; + } + + get isTargeted() { + return true; + } + + get usePrimaryEffect() { + return this.data.effect === 'numb'; + } + + get isDamaging() { + return false; + } + + get basePowerPoints() { + return 1; + } + + get hasAdditionalRecipients() { + return true; + } + + get additionalRecipientCost() { + return 1; + } + + get modifiers() { + return [ + ...super.modifiers, + { + name: 'Restoration', + id: 'restoration', + value: 3, + type: 'checkbox', + epic: false, + effect: false, + }, + { + name: 'Stunned', + id: 'stunned', + value: 1, + type: 'checkbox', + epic: false, + effect: false, + }, + { + name: 'Recover or Numb?', + id: 'effect', + type: 'radio', + epic: false, + default: 'recover', + choices: { recover: 'Recover', numb: 'Numb' }, + effects: { recover: null, numb: null }, + values: { recover: 0, numb: 0 }, + }, + ]; + } + + get effectName() { + return 'Numb'; + } + + getPrimaryEffectChanges() { + if (this.data.effect === 'recover') { + return super.getPrimaryEffectChanges(); + } + return [ + ...super.getPrimaryEffectChanges(), + { + key: 'system.woundsOrFatigue.ignored', + value: this.data.raise ? 2 : 1, + mode: CONST.ACTIVE_EFFECT_MODES.ADD, + priority: 0, + }, + ]; + } + + get description() { + let text = super.description; + if (this.data.effect === 'recover') { + text += `

Recover: Remove ${this.data.raise ? 'two' : 'one'} + of Shaken, ${this.data.stunned ? 'Stunned, ' : ''}Distracted, or Vulnerable + from each target (not caused by circumstance like Bound, Entangled, etc). +

`; + } else { + text += `

Numb: Reduce the penalty from Wounds or + Fatigue by ${this.data.raise ? 2 : 1}.

`; + } + return text; + } +}