add drain power points

This commit is contained in:
2024-05-18 15:52:26 -05:00
parent db471b0cb9
commit 2870b6b587
4 changed files with 90 additions and 3 deletions
-1
View File
@@ -65,7 +65,6 @@ export class BanishEffect extends PowerEffect {
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);
+83
View File
@@ -0,0 +1,83 @@
import { requestRollFromTokens } from '../helpers.js';
import { PowerEffect } from './basePowers.js';
export class DrainPowerPointsEffect extends PowerEffect {
get name() {
return 'Drain Power Points';
}
get icon() {
return 'icons/magic/control/debuff-energy-hold-teal-blue.webp';
}
get duration() {
return 0;
}
get basePowerPoints() {
return 2;
}
get usePrimaryEffect() {
return false;
}
get isTargeted() {
return true;
}
get isRaisable() {
return false;
}
get oneTarget() {
return true;
}
get modifiers() {
return [
...super.modifiers,
{
type: 'checkbox',
name: 'Power',
id: 'power',
epic: false,
effect: false,
value: 2,
},
{
type: 'number',
default: 4,
name: 'Opposed Target Number',
id: 'tn',
epic: false,
effect: false,
value: 0,
},
];
}
async sideEffects() {
await super.sideEffects();
const rollOpts = {
title: 'Resist Drain Power Points',
flavor: 'Resist the energy drain!',
mods: [{ label: 'Different Arcane Background', value: 2, ignore: true }],
targetNumber: this.data.tn,
};
await requestRollFromTokens(this.targets, 'ability', 'spirit', rollOpts);
}
get description() {
return (
super.description +
`
<p>An opposed roll of the caster's arcane activation roll vs the target's
Spirit. Caster's success means the victim loses
[[/r ${this.data.power ? '2' : '1'}d6]] power points. If the caster gets
a raise over the opponent, the stolen power points augment the caster's
own total.</p>
`
);
}
}
+2
View File
@@ -19,6 +19,7 @@ import { DetectConcealArcanaEffect } from './detectConcealArcana.js';
import { DisguiseEffect } from './disguise.js';
import { DispelEffect } from './dispel.js';
import { DivinationEffect } from './divination.js';
import { DrainPowerPointsEffect } from './drainPowerPoints.js';
const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect,
@@ -45,6 +46,7 @@ const PowerClasses = {
disguise: DisguiseEffect,
dispel: DispelEffect,
divination: DivinationEffect,
'drain-power-points': DrainPowerPointsEffect,
'lower-trait': BoostLowerTraitEffect,
};