From e0cd1c640cd0ec5a453d62edc1591546aa89e319 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sat, 25 May 2024 23:18:51 -0500 Subject: [PATCH] add puppet --- src/module/powers/powers.js | 2 + src/module/powers/puppet.js | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 src/module/powers/puppet.js diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index 38aecb9..dd3c89e 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -43,6 +43,7 @@ import { ObjectReadingEffect } from './objectReading.js'; import { PlanarBindingEffect } from './planarBinding.js'; import { PlaneShiftEffect } from './planeShift.js'; import { ProtectionEffect } from './protection.js'; +import { PuppetEffect } from './puppet.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -99,6 +100,7 @@ const PowerClasses = { 'planar-binding': PlanarBindingEffect, 'plane-shift': PlaneShiftEffect, protection: ProtectionEffect, + puppet: PuppetEffect, shrink: GrowthShrinkEffect, }; diff --git a/src/module/powers/puppet.js b/src/module/powers/puppet.js new file mode 100644 index 0000000..c6e89ab --- /dev/null +++ b/src/module/powers/puppet.js @@ -0,0 +1,87 @@ +import { PowerEffect } from './basePowers.js'; + +export class PuppetEffect extends PowerEffect { + get name() { + return 'Puppet'; + } + + get duration() { + return 5; + } + + get icon() { + return 'icons/magic/control/control-influence-puppet.webp'; + } + + get hasAdditionalRecipients() { + return true; + } + + get additionalRecipientCost() { + return 2; + } + + get basePowerPoints() { + return 3; + } + + get isTargeted() { + return true; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + name: 'Strong', + type: 'checkbox', + id: 'strong', + value: 2, + epic: false, + effect: false, + }); + return mods; + } + + get isRaisable() { + return false; + } + + get primaryEffectButtons() { + const mods = []; + if (this.data.strong) { + mods.push({ label: 'Strong', value: -2 }); + } + return [ + ...super.primaryEffectButtons, + { + label: `Resist (Spirit${this.data.strong ? ' -2' : ''})`, + type: 'trait', + rollType: 'attribute', + rollDesc: 'Spirit', + flavor: 'Resist Puppet after unreasonable command', + mods, + }, + ]; + } + + get description() { + let text = + super.description + + ` +

+ Opposed roll vs the caster's Spirit. Success means the victim obeys + commands, but won't harm himself or those he cares about, including by + inaction. With a raise, the target will do so, but gets a free action + Spirit roll ${this.data.strong ? '(at -2)' : ''} to resist that + particular command, with a raise meaning he breaks the controller's hold + and the power ends. +

+ `; + if (this.data.strong) { + text += `

Spirit rolls to resist are at -2. The caster may also use + mind link on the target to extend controll to any distance, + even out of sight.

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