add relief

This commit is contained in:
Mike Bloy 2024-05-26 16:55:47 -05:00
parent e0cd1c640c
commit 7c28c43bd9
3 changed files with 107 additions and 1 deletions

View File

@ -22,7 +22,7 @@ export class HealingEffect extends PowerEffect {
} }
get isDamaging() { get isDamaging() {
return true; return false;
} }
get basePowerPoints() { get basePowerPoints() {

View File

@ -44,6 +44,7 @@ import { PlanarBindingEffect } from './planarBinding.js';
import { PlaneShiftEffect } from './planeShift.js'; import { PlaneShiftEffect } from './planeShift.js';
import { ProtectionEffect } from './protection.js'; import { ProtectionEffect } from './protection.js';
import { PuppetEffect } from './puppet.js'; import { PuppetEffect } from './puppet.js';
import { ReliefEffect } from './relief.js';
const PowerClasses = { const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect, 'arcane-protection': ArcaneProtectionEffect,
@ -101,6 +102,7 @@ const PowerClasses = {
'plane-shift': PlaneShiftEffect, 'plane-shift': PlaneShiftEffect,
protection: ProtectionEffect, protection: ProtectionEffect,
puppet: PuppetEffect, puppet: PuppetEffect,
relief: ReliefEffect,
shrink: GrowthShrinkEffect, shrink: GrowthShrinkEffect,
}; };

104
src/module/powers/relief.js Normal file
View File

@ -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 += `<p><strong>Recover</strong>: 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).
</p>`;
} else {
text += `<p><strong>Numb</strong>: Reduce the penalty from Wounds or
Fatigue by ${this.data.raise ? 2 : 1}.</p>`;
}
return text;
}
}