add item to powers classes if present
This commit is contained in:
parent
7775932702
commit
0153896eeb
@ -172,9 +172,10 @@ export class PowerFormApplication extends HandlebarsApplicationMixin(Application
|
||||
}
|
||||
|
||||
export class PowerEffect {
|
||||
constructor(token, targets) {
|
||||
constructor(token, targets, item) {
|
||||
this.source = token;
|
||||
this.targets = targets;
|
||||
this.item = item;
|
||||
this.data = {};
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { moduleName, moduleHelpers } from '../globals.js';
|
||||
import { moduleName, moduleHelpers, log } from '../globals.js';
|
||||
import { firstOwner, deleteActiveEffectsFromToken, deleteToken, deleteItemsFromActor } from '../helpers.js';
|
||||
import { ArcaneProtectionEffect } from './arcaneProtection.js';
|
||||
import { BalefulPolymorphEffect } from './balefulPolymorph.js';
|
||||
@ -302,7 +302,8 @@ export async function powers(options = {}) {
|
||||
const swid = options?.name || item?.system.swid || null;
|
||||
|
||||
if (swid in PowerClasses) {
|
||||
const runner = new PowerClasses[swid](token, targets);
|
||||
const runner = new PowerClasses[swid](token, targets, item);
|
||||
log('initialized power class', runner);
|
||||
runner.render();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ export class SmiteEffect extends PowerEffect {
|
||||
}
|
||||
|
||||
async applySpiritualWeapon() {
|
||||
const runner = new SpiritualWeaponEffect(this.source, []);
|
||||
const runner = new SpiritualWeaponEffect(this.source, [], this.item);
|
||||
runner.render();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user