Add shape change ability power effect

This commit is contained in:
2024-07-15 22:13:22 -05:00
parent 3a91311887
commit 969dab0a3e
60 changed files with 529 additions and 206 deletions
+3 -1
View File
@@ -52,7 +52,7 @@ import { ReliefEffect } from './relief.js';
import { ResurrectionEffect } from './resurrection.js';
import { SanctuaryEffect } from './sanctuary.js';
import { ScryingEffect } from './scrying.js';
import { ShapeChangeEffect } from './shapeChange.js';
import { ShapeChangeEffect, ShapeChangeAbilityEffect } from './shapeChange.js';
import { SlothSpeedEffect } from './slothSpeed.js';
import { SlumberEffect } from './slumber.js';
import { SmiteEffect } from './smite.js';
@@ -150,6 +150,8 @@ const PowerClasses = {
sanctuary: SanctuaryEffect,
scrying: ScryingEffect,
'shape-change': ShapeChangeEffect,
'shape-change-ability': ShapeChangeAbilityEffect,
'shape-change-action': ShapeChangeAbilityEffect,
shrink: GrowthShrinkEffect,
silence: SoundSilenceEffect,
slothspeed: SlothSpeedEffect,
+31
View File
@@ -216,6 +216,37 @@ export class ShapeChangeEffect extends ActorFolderEffect {
}
}
export class ShapeChangeAbilityEffect extends ShapeChangeEffect {
get name() {
return 'Shape Change Ability';
}
get duration() {
return 500;
}
get isTargeted() {
return false;
}
get isRaisable() {
return false;
}
actorValue(actor) {
return 0;
}
get modifiers() {
return super.modifiers.filter((m) => m.id === 'actorId');
}
async parseValues() {
this.targets = [this.source];
await super.parseValues();
}
}
export async function shapeChangeTokenDeleteHandler(token, options, userId) {
if (token.flags?.['multilevel-tokens']?.stoken) {
// if the deleted token is a dummy token from multilevel-tokens, ignore it