2024-06-04 23:30:25 -05:00

98 lines
2.4 KiB
JavaScript

import { PowerEffect } from './basePowers.js';
export class TelekinesisEffect extends PowerEffect {
get name() {
return 'Telekinesis';
}
get duration() {
return 5;
}
get icon() {
return 'icons/magic/movement/trail-streak-zigzag-yellow.webp';
}
get basePowerPoints() {
return 5;
}
get isTargeted() {
return false;
}
get usePrimaryEffect() {
return false;
}
get modifiers() {
const mods = super.modifiers;
mods.push({
name: 'Power',
type: 'checkbox',
id: 'power',
value: 3,
epic: false,
effect: false,
});
return mods;
}
get effectName() {
return `${this.data.raise ? 'major' : 'minor'} ${this.name} ${this.data.power ? '[Power] ' : ''}`;
}
get description() {
let desc = super.description;
let str = 'd10';
if (this.data.power && this.data.raise) {
str = 'd12+2';
} else if (this.data.power || this.data.raise) {
str = 'd12';
}
desc += `<p>Move objects with will alone. The power has a Strength of ${str}.
Resisted by an opposed arcane roll vs the target's Spirit when first targeted
and at the start of each of the target's turns thereafter.</p>
<h3>Uses:</h3>
<ul>
<li><strong>Bash</strong>: Bash the target into the floor, ceiling, or walls
for Str+d6 damage.</li>
<li><strong>Change Targets</strong>: Switch victim or tool as a free action.
Selecting an unwilling target is an action and is resisted as above.</li>
<li><strong>Manipulate</strong>: Use tool or weapon, using the caster's
arcane skill.</li>
<li><strong>Move</strong>: The target or tool may be moved up to the caster's
Smarts.</li>
</ul>`;
return desc;
}
get maintEffectButtons() {
let str = 'd10x';
if (this.data.power && this.data.raise) {
str = 'd12x+2';
} else if (this.data.power || this.data.raise) {
str = 'd12x';
}
let traitFormula = `1${str}[Strength]`;
if (this.source.actor.system.wildcard) {
traitFormula = `{${traitFormula},1d6x[Wild Die]}kh`;
}
return [
...super.primaryEffectButtons,
{
label: `Strength (${str.replace('x', '')})`,
type: 'roll',
formula: traitFormula,
flavor: 'Telekinesis Strength',
},
{
label: 'Damage (Str+d6)',
type: 'damage',
formula: `1${str}[Strength]+1d6x`,
flavor: 'Telekinesis Bash Damage',
},
];
}
}