From 41e1ade442139988019f202254a3a6aad45ae36a Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 1 Oct 2023 11:48:49 -0500 Subject: [PATCH] add burrow and darksight --- scripts/powerEffects.js | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/scripts/powerEffects.js b/scripts/powerEffects.js index e57ef05..ee147ea 100644 --- a/scripts/powerEffects.js +++ b/scripts/powerEffects.js @@ -61,6 +61,9 @@ class PowerEffect { } } + async prepMenu () { + } + async prepResult () { } @@ -241,6 +244,23 @@ class BlindEffect extends TargetedPowerEffect { } } +class BurrowEffect extends TargetedPowerEffect { + get name () { return 'Burrow' } + get baseDurationRounds () { return 5 } + + async prepResult () { + const raise = (this.buttons === 'raise') + const icon = 'icons/magic/earth/projectile-stone-landslide.webp' + this.effectDocs.push( + shim.createEffectDocument( + icon, + `${raise ? 'major' : 'minor'} ${this.name}`, + this.durationRounds, + []) + ) + } +} + class BoltEffect extends LingeringDamagePowerEffect { get name () { return 'Bolt' @@ -382,6 +402,28 @@ class ConfusionEffect extends TargetedPowerEffect { } } +class DarksightEffect extends TargetedPowerEffect { + get name () { return 'Darksight' } + get baseDurationRounds () { return 600 } + async prepMenu () { + this.menuData.inputs.push( + { type: 'checkbox', label: '⭐ Greater (+2)', options: false }) + } + + async prepResult () { + const raise = this.buttons === 'raise' + const greater = !!this.inputs[this.inputIndex] + const icon = 'icons/magic/perception/eye-ringed-glow-angry-small-teal.webp' + this.effectDocs.push( + shim.createEffectDocument( + icon, + `${raise ? 'major' : 'minor'} ${this.name}${greater ? ' (greater)' : ''}`, + this.durationRounds, + []) + ) + } +} + class DeflectionEffect extends TargetedPowerEffect { get name () { return 'Deflection' @@ -1246,8 +1288,10 @@ const PowerClasses = { bolt: BoltEffect, 'boost/lower trait': BoostLowerTraitEffect, 'boost trait': BoostLowerTraitEffect, + burrow: BurrowEffect, burst: BurstEffect, confusion: ConfusionEffect, + darksight: DarksightEffect, deflection: DeflectionEffect, entangle: EntangleEffect, intangibility: IntangibilityEffect,