diff --git a/src/module/powers/basePowers.js b/src/module/powers/basePowers.js index a82bcc0..558bbf5 100644 --- a/src/module/powers/basePowers.js +++ b/src/module/powers/basePowers.js @@ -580,7 +580,11 @@ export class PowerEffect { doc.flags.swade.expiration = CONFIG.SWADE.CONST.STATUS_EFFECT_EXPIRATION.EndOfTurnPrompt; doc.flags.swade.loseTurnOnHold = true; doc.flags[moduleName].maintainingId = maintId; - doc.flags[moduleName].targetIds = this.targets.map((t) => t.id); + if (this.isTargeted) { + doc.flags[moduleName].targetIds = this.targets.map((t) => t.id); + } else { + doc.flags[moduleName].targetIds = [this.source.id]; + } doc.statuses = doc.statuses ?? []; doc.statuses.push('powerMaintainEffect'); const effectButtons = this.maintEffectButtons; @@ -617,6 +621,11 @@ export class PowerEffect { await this.applyActiveEffects(target, targetDocs); } } + } else { + const targetDocs = await this.secondaryDocsForTarget(secondaryDocs, this.source); + if (targetDocs.length > 0) { + await this.applyActiveEffects(this.source, targetDocs); + } } if (this.duration > 0) { await this.applyActiveEffects(this.source, [maintainDoc]); diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index ddb03f3..58f8574 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -57,6 +57,7 @@ import { SoundSilenceEffect } from './soundSilence.js'; import { SpeakLanguageEffect } from './speakLanguage.js'; import { StunEffect } from './stun.js'; import { SummonAllyEffect } from './summon.js'; +import { TelekinesisEffect } from './telekinesis.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -134,6 +135,7 @@ const PowerClasses = { 'speak-language': SpeakLanguageEffect, stun: StunEffect, 'summon-ally': SummonAllyEffect, + telekinesis: TelekinesisEffect, }; /* ---------------------------------------------------------------- */ diff --git a/src/module/powers/telekinesis.js b/src/module/powers/telekinesis.js new file mode 100644 index 0000000..66af9eb --- /dev/null +++ b/src/module/powers/telekinesis.js @@ -0,0 +1,97 @@ +import { PowerEffect } from './basePowers.js'; + +export class TelekinesisEffect extends PowerEffect { + get name() { + return 'Telekinesis'; + } + + get duration() { + return 5; + } + + get icon() { + return 'icons/magic/movement/trail-streak-zigzag-yellow.webp'; + } + + get basePowerPoints() { + return 5; + } + + get isTargeted() { + return false; + } + + get usePrimaryEffect() { + return false; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + name: 'Power', + type: 'checkbox', + id: 'power', + value: 3, + epic: false, + effect: false, + }); + return mods; + } + + get effectName() { + return `${this.data.raise ? 'major' : 'minor'} ${this.name} ${this.data.power ? '[Power] ' : ''}`; + } + + get description() { + let desc = super.description; + let str = 'd10'; + if (this.data.power && this.data.raise) { + str = 'd12+2'; + } else if (this.data.power || this.data.raise) { + str = 'd12'; + } + desc += `
Move objects with will alone. The power has a Strength of ${str}. + Resisted by an opposed arcane roll vs the target's Spirit when first targeted + and at the start of each of the target's turns thereafter.
+