From b4fd301a4f318373dc7d12b2e99a187d1b969e2b Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Tue, 21 May 2024 13:12:45 -0500 Subject: [PATCH] add healing --- src/module/powers/havoc.js | 1 + src/module/powers/healing.js | 105 +++++++++++++++++++++++++++++++++++ src/module/powers/powers.js | 2 + 3 files changed, 108 insertions(+) create mode 100644 src/module/powers/healing.js diff --git a/src/module/powers/havoc.js b/src/module/powers/havoc.js index 3eadae9..04912ba 100644 --- a/src/module/powers/havoc.js +++ b/src/module/powers/havoc.js @@ -56,6 +56,7 @@ export class HavocEffect extends PowerEffect { value: 2, id: 'greater', epic: true, + type: 'checkbox', effect: false, }, ); diff --git a/src/module/powers/healing.js b/src/module/powers/healing.js new file mode 100644 index 0000000..be6cf9c --- /dev/null +++ b/src/module/powers/healing.js @@ -0,0 +1,105 @@ +import { PowerEffect } from './basePowers.js'; + +export class HealingEffect extends PowerEffect { + get name() { + return 'Healing'; + } + + get icon() { + return 'icons/magic/life/heart-cross-strong-flame-purple-orange.webp'; + } + + get duration() { + return 0; + } + + get isTargeted() { + return true; + } + + get usePrimaryEffect() { + return false; + } + + get isDamaging() { + return true; + } + + get basePowerPoints() { + return 3; + } + + get hasAoe() { + return true; + } + + get modifiers() { + const mods = super.modifiers; + mods.push( + { + name: 'Area of Effect', + id: 'aoe', + type: 'select', + default: 'none', + choices: { + none: 'None', + mbt: '⭐ Medium Blast Template', + lbt: '⭐ Large Blast Template', + }, + effects: { none: null, mbt: null, lbt: null }, + values: { none: 0, mbt: 2, lbt: 3 }, + epic: false, + }, + { + name: 'Neutralize Poison or Disease', + value: 1, + id: 'poison', + epic: false, + type: 'checkbox', + effect: false, + }, + { + name: 'Crippling Injuries', + value: 15, + id: 'crippling', + epic: false, + type: 'checkbox', + effect: false, + }, + { + name: 'Greater Healing', + value: 10, + id: 'greater', + epic: false, + type: 'checkbox', + effect: false, + }, + ); + return mods; + } + + get description() { + const size = + this.data.aoe !== 'none' + ? `all allies within a ${this.data.aoe.toUpperCase()} centered on the caster` + : 'a single subject'; + let text = + super.description + + ` +

Heal ${size} of ${this.data.raise ? '2 Wounds' : '1 Wound'} + ${this.data.greater ? 'of any age' : 'sustained in the last hour'}. + `; + if (this.data.crippling) { + text += `This casting is the only one possible for this Crippling Injury by this + caster, and preparation took an hour. If successful, the subject is + Exhausted for 24 hours. + `; + } + if (this.data.poison) { + text += `Negate any poison or disease, taking into account the affects of + any penalty from the poison or disease on the arcane skill roll.`; + } + text += '

'; + return text; + } +} diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index c2055e4..8ffa365 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -30,6 +30,7 @@ import { FearEffect } from './fear.js'; import { FlyEffect } from './fly.js'; import { GrowthShrinkEffect } from './growthShrink.js'; import { HavocEffect } from './havoc.js'; +import { HealingEffect } from './healing.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -69,6 +70,7 @@ const PowerClasses = { 'growth-shrink': GrowthShrinkEffect, growthshrink: GrowthShrinkEffect, havoc: HavocEffect, + healing: HealingEffect, 'lower-trait': BoostLowerTraitEffect, shrink: GrowthShrinkEffect, };