add resist roll to banish

This commit is contained in:
2024-05-13 19:56:38 -05:00
parent ae7295028d
commit 8f015bc05c
4 changed files with 229 additions and 188 deletions
+22
View File
@@ -1,4 +1,6 @@
import { PowerEffect } from './basePowers.js';
import { requestRollFromTokens } from '../helpers.js';
import { getPowerModifiers } from '../rollHelpers.js';
export class BanishEffect extends PowerEffect {
get name() {
@@ -31,6 +33,15 @@ export class BanishEffect extends PowerEffect {
get modifiers() {
const mods = super.modifiers;
mods.push({
type: 'number',
default: 4,
name: 'Opposed Target Number',
id: 'tn',
epic: false,
effect: false,
value: 0,
});
mods.push({
type: 'select',
default: 'none',
@@ -49,6 +60,17 @@ export class BanishEffect extends PowerEffect {
return mods;
}
async sideEffects() {
await super.sideEffects();
const rollOpts = {
title: 'Spirit roll to resist banishment',
flavor: 'Roll Spirit to resist banishment!',
modCallback: getPowerModifiers,
targetNumber: this.data.tn,
};
await requestRollFromTokens(this.targets, 'ability', 'spirit', rollOpts);
}
get description() {
return (
super.description +