91 lines
1.8 KiB
JavaScript

import { PowerEffect } from './basePowers.js';
export class BeastFriendEffect extends PowerEffect {
get name() {
return 'Beast Friend';
}
get duration() {
return (this.data.duration ? 30 : 10) * 6 * 60;
}
get icon() {
return 'icons/magic/nature/wolf-paw-glow-large-green.webp';
}
get isTargeted() {
return true;
}
get usePrimaryEffect() {
return true;
}
get modifiers() {
const mods = super.modifiers;
const ppDefault = Math.max(
this.targets.map((t) => Math.max(t.actor.system.stats.size, 1)).reduce((a, b) => a + b, 0),
1,
);
mods.push(
{
name: 'Bestiarium',
type: 'checkbox',
value: 2,
id: 'bestiarium',
epic: true,
effect: false,
},
{
name: 'Duration',
type: 'checkbox',
value: 1,
id: 'duration',
epic: false,
effect: false,
},
{
name: 'Mind Rider',
type: 'checkbox',
value: 1,
id: 'mindrider',
epic: false,
effect: false,
},
{
name: 'Base power points',
type: 'number',
value: 0,
default: ppDefault,
id: 'basePP',
epic: false,
effect: false,
},
);
return mods;
}
get basePowerPoints() {
return (
this.data.basePP ??
Math.max(
this.targets.map((t) => Math.max(t.actor.system.stats.size, 1)).reduce((a, b) => a + b, 0),
1,
)
);
}
get description() {
let text = super.description;
if (this.data.raise) {
text += '<p>Creatures will overcome instincts to follow orders.';
} else {
text += '<p>Creatures obey simple commands, subject to their insticts.';
}
if (this.data.bestiarium) {
text += ' The caster may even effect magical beasts.';
}
return text;
}
}