add light/darkness
This commit is contained in:
parent
3d6a561929
commit
d7f6582d41
98
src/module/powers/lightdarkness.js
Normal file
98
src/module/powers/lightdarkness.js
Normal 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;
|
||||
}
|
||||
}
|
||||
@ -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,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user