add light/darkness

This commit is contained in:
Mike Bloy 2024-05-22 22:43:17 -05:00
parent 3d6a561929
commit d7f6582d41
2 changed files with 103 additions and 0 deletions

View File

@ -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 += `<p>Bright illumination ${size}.
${this.data.raise ? 'Optionally with a raise, light is focused into a 5" beam.' : ''}`;
} else {
text += `<p>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 += '</p>';
return text;
}
}

View File

@ -34,6 +34,7 @@ import { HealingEffect } from './healing.js';
import { IllusionEffect } from './illusion.js'; import { IllusionEffect } from './illusion.js';
import { IntangibilityEffect } from './intangibility.js'; import { IntangibilityEffect } from './intangibility.js';
import { InvisibliltyEffect } from './invisibility.js'; import { InvisibliltyEffect } from './invisibility.js';
import { LightDarknessEffect } from './lightdarkness.js';
const PowerClasses = { const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect, 'arcane-protection': ArcaneProtectionEffect,
@ -53,6 +54,7 @@ const PowerClasses = {
'conjure-item': ConjureItemEffect, 'conjure-item': ConjureItemEffect,
curse: CurseEffect, curse: CurseEffect,
'damage-field': DamageFieldEffect, 'damage-field': DamageFieldEffect,
darkness: LightDarknessEffect,
darksight: DarksightEffect, darksight: DarksightEffect,
deflection: DeflectionEffect, deflection: DeflectionEffect,
'detect-arcana': DetectConcealArcanaEffect, 'detect-arcana': DetectConcealArcanaEffect,
@ -77,6 +79,9 @@ const PowerClasses = {
illusion: IllusionEffect, illusion: IllusionEffect,
intangibility: IntangibilityEffect, intangibility: IntangibilityEffect,
invisibility: InvisibliltyEffect, invisibility: InvisibliltyEffect,
'light-darkness': LightDarknessEffect,
lightdarkness: LightDarknessEffect,
light: LightDarknessEffect,
'lower-trait': BoostLowerTraitEffect, 'lower-trait': BoostLowerTraitEffect,
shrink: GrowthShrinkEffect, shrink: GrowthShrinkEffect,
}; };