diff --git a/src/module/powers/lightdarkness.js b/src/module/powers/lightdarkness.js new file mode 100644 index 0000000..f5a7463 --- /dev/null +++ b/src/module/powers/lightdarkness.js @@ -0,0 +1,98 @@ +import { PowerEffect } from './basePowers.js'; + +export class LightDarknessEffect extends PowerEffect { + get name() { + return 'Light/Darkness'; + } + + get duration() { + return 100; + } + + get icon() { + return this?.data?.direction === 'Darkness' + ? 'icons/commodities/gems/pearl-purple-dark.webp' + : 'icons/magic/light/light-lantern-lit-white.webp'; + } + + get isTargeted() { + return false; + } + + get basePowerPoints() { + return 2; + } + + get usePrimaryEffect() { + return false; + } + + get modifiers() { + return [ + ...super.modifiers, + { + sortOrder: -2, + name: 'Light or Darkness?', + id: 'direction', + type: 'radio', + default: 'Light', + epic: false, + choices: { Light: 'Light', Darkness: 'Darkness' }, + effects: { Light: null, Darkness: null }, + values: { Light: 0, Darkness: 0 }, + }, + { + name: 'Area Effect (Light only)', + id: 'area', + type: 'checkbox', + default: false, + value: 2, + epic: true, + effect: false, + }, + { + name: 'True Darkness (Darkness only)', + id: 'truedark', + type: 'checkbox', + default: false, + value: 2, + epic: true, + effect: false, + }, + { + name: 'Mobile', + id: 'mobile', + type: 'checkbox', + default: false, + value: 1, + epic: false, + effect: false, + }, + ]; + } + + get effectName() { + return this.data.direction; + } + + get description() { + let text = super.description; + if (this.data.direction === 'Light') { + const size = this.data.area ? "with a radius of the caster's Smarts ×2" : 'in a LBT'; + text += `
Bright illumination ${size}. + ${this.data.raise ? 'Optionally with a raise, light is focused into a 5" beam.' : ''}`; + } else { + text += `
Block illumination + ${this.data.truedark ? ', Infravision, Low Light Vision, and Darkvision' : ''} + in an area the size of a LBT, making the area ${this.data.raise ? 'Pitch Dark' : 'Dark'}`; + } + if (this.data.mobile) { + text += ` The power can move as a limited free action at a pace of the + caster's arcane skill die. Alternately, it may be attached to an + inanimate object`; + } + text += '
'; + + return text; + } +} diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index 2b0a554..603af0d 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -34,6 +34,7 @@ import { HealingEffect } from './healing.js'; import { IllusionEffect } from './illusion.js'; import { IntangibilityEffect } from './intangibility.js'; import { InvisibliltyEffect } from './invisibility.js'; +import { LightDarknessEffect } from './lightdarkness.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -53,6 +54,7 @@ const PowerClasses = { 'conjure-item': ConjureItemEffect, curse: CurseEffect, 'damage-field': DamageFieldEffect, + darkness: LightDarknessEffect, darksight: DarksightEffect, deflection: DeflectionEffect, 'detect-arcana': DetectConcealArcanaEffect, @@ -77,6 +79,9 @@ const PowerClasses = { illusion: IllusionEffect, intangibility: IntangibilityEffect, invisibility: InvisibliltyEffect, + 'light-darkness': LightDarknessEffect, + lightdarkness: LightDarknessEffect, + light: LightDarknessEffect, 'lower-trait': BoostLowerTraitEffect, shrink: GrowthShrinkEffect, };