From c577a8ec0f8eb0ed707704b19562017e813f5b22 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Fri, 8 Sep 2023 10:48:16 -0500 Subject: [PATCH] untested intangibility --- package-lock.json | 1 - scripts/powerEffects.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 27a52e0..f88b860 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,7 +4,6 @@ "requires": true, "packages": { "": { - "name": "swade-mb-helpers", "devDependencies": { "@league-of-foundry-developers/foundry-vtt-types": "^9.280.0", "eslint": "^8.48.0", diff --git a/scripts/powerEffects.js b/scripts/powerEffects.js index bc3a301..97fea85 100644 --- a/scripts/powerEffects.js +++ b/scripts/powerEffects.js @@ -376,6 +376,36 @@ class EntangleEffect extends TargetedPowerEffect { } } +class IntangibilityEffect extends TargetedPowerEffect { + get name () { + return 'Intangility' + } + + get durationRounds () { + if (!this.inputs) { + return 5 + } + if (this.inputs[this.inputs.length - 1]) { // Duration + return 50 + } + return 5 // no duration + } + + prepMenu () { + this.menuData.inputs.push({ type: 'checkbox', label: 'Duration', options: false }) + this.menuData.buttons = [ + { label: 'Apply', value: 'apply' }, + { label: 'Cancel', value: 'cancel' } + ] + } + + prepResult () { + const icon = 'icons/magic/control/debuff-energy-hold-levitate-blue-yellow.webp' + const effect = shim.createEffectDocument(icon, this.name, this.durationRounds, []) + this.effectDocs.push(effect) + } +} + const PowerClasses = { blind: BlindEffect, 'boost/lower trait': BoostLowerTraitEffect, @@ -383,6 +413,7 @@ const PowerClasses = { confusion: ConfusionEffect, deflection: DeflectionEffect, entangle: EntangleEffect, + inangibility: IntangibilityEffect, 'lower trait': BoostLowerTraitEffect }