114 lines
2.6 KiB
JavaScript

import { PowerEffect } from './basePowers.js';
export class IllusionEffect extends PowerEffect {
get name() {
return 'Illusion';
}
get icon() {
return 'icons/magic/defensive/illusion-evasion-echo-purple.webp';
}
get duration() {
return this.data.duration ? 50 : 5;
}
get isTargeted() {
return false;
}
get isRaisable() {
return true;
}
get usePrimaryEffect() {
return false;
}
get basePowerPoints() {
return 5;
}
get modifiers() {
return [
{
name: 'Area of Effect',
type: 'checkbox',
value: 1,
id: 'aoe',
epic: false,
effect: false,
},
{
name: 'Deadly Illusion',
type: 'checkbox',
value: 3,
id: 'deadly',
epic: true,
effect: false,
},
{
name: 'Duration',
type: 'checkbox',
value: 2,
id: 'duration',
epic: true,
effect: false,
},
{
name: 'Mobility',
type: 'select',
default: 'none',
id: 'mobility',
choices: {
none: 'None',
12: 'Move and fly at Pace 12',
24: 'Move and fly at Pace 24',
},
values: { none: 0, 12: 1, 24: 2 },
effects: { none: null, 12: null, 24: null },
epic: false,
},
{
name: 'Sound',
id: 'sound',
type: 'checkbox',
epic: false,
effect: false,
value: 1,
},
{
name: 'Strong',
id: 'strong',
type: 'checkbox',
epic: false,
effect: false,
value: 2,
},
];
}
get description() {
const size = this.data.aoe ? 'LBT' : 'MBT';
const penalty = (this.data.raise ? -2 : 0) + (this.data.strong ? -2 : 0);
const motion = this.data.mobility === 'none' ? '(stationary)' : `that can move at pace ${this.data.mobility}`;
let text =
super.description +
`<p>
Create an illusion ${motion} ${this.data.sound ? 'with sound' : ''}.
Its effects must remain within a sphere the size of a ${size}. </p>
<p>Creatures can actively disbelieve in the illusion with a Smarts roll
${penalty === 0 ? '' : `at ${penalty}`}.</p>
`;
if (this.data.deadly) {
text += `<p>The caster can 'attack' targets while the illusion is active
with an opposed roll of the caster's arcane skill versus the target's
Smarts${penalty === 0 ? '' : ` at ${penalty}`}. If the caster wins the
target is Shaken (cannot incapacitate). With a raise, the target suffers
a Wound.</p>.
`;
}
return text;
}
}