From d6581e16d42b6ef8eaea62773ebea63bb120dad1 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 2 Jun 2024 00:16:41 -0500 Subject: [PATCH] add slumber --- src/module/powers/powers.js | 2 + src/module/powers/slumber.js | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/module/powers/slumber.js diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index 723b263..881bf54 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -50,6 +50,7 @@ import { SanctuaryEffect } from './sanctuary.js'; import { ScryingEffect } from './scrying.js'; import { ShapeChangeEffect } from './shapeChange.js'; import { SlothSpeedEffect } from './slothSpeed.js'; +import { SlumberEffect } from './slumber.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -117,6 +118,7 @@ const PowerClasses = { 'sloth-speed': SlothSpeedEffect, sloth: SlothSpeedEffect, speed: SlothSpeedEffect, + slumber: SlumberEffect, }; /* ---------------------------------------------------------------- */ diff --git a/src/module/powers/slumber.js b/src/module/powers/slumber.js new file mode 100644 index 0000000..4e34a04 --- /dev/null +++ b/src/module/powers/slumber.js @@ -0,0 +1,73 @@ +import { moduleName } from '../globals.js'; +import { PowerEffect } from './basePowers.js'; + +export class SlumberEffect extends PowerEffect { + get name() { + return 'Slumber'; + } + + get icon() { + return 'icons/magic/control/sleep-bubble-purple.webp'; + } + + get duration() { + return 600; + } + + get isTargeted() { + return true; + } + + get hasAoe() { + return true; + } + + get basePowerPoints() { + return 2; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + type: 'select', + default: 'none', + name: 'Area of Effect', + id: 'aoe', + epic: false, + 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 }, + }); + return mods; + } + + get description() { + return ( + super.description + + `

The subject(s) fall into a deep and restful sleep if they fail a + Spirit${this.data.raise ? ' -2' : ''} roll. Very loud noises or attempts + to physically wake a sleeper grant another roll.

` + ); + } + + get primaryEffectButtons() { + const buttons = super.primaryEffectButtons; + const mods = []; + if (this.data.raise) { + mods.push({ label: 'Raise on the arcane roll', value: -2 }); + } + buttons.push({ + label: `Shake off (Spirit${this.data.raise ? ' -2' : ''})`, + type: 'trait', + rollType: 'attribute', + rollDesc: 'Spirit', + flavor: 'Wake up if successful', + mods, + }); + return buttons; + } +}