diff --git a/src/module/powers/arcaneProtection.js b/src/module/powers/arcaneProtection.js index 46e7474..909bd83 100644 --- a/src/module/powers/arcaneProtection.js +++ b/src/module/powers/arcaneProtection.js @@ -5,6 +5,10 @@ export class ArcaneProtectionEffect extends PowerEffect { return 'Arcane Protection'; } + get basePowerPoints() { + return 1; + } + get duration() { return 5; } diff --git a/src/module/powers/fly.js b/src/module/powers/fly.js new file mode 100644 index 0000000..52f5690 --- /dev/null +++ b/src/module/powers/fly.js @@ -0,0 +1,76 @@ +import { moduleName } from '../globals.js'; +import { PowerEffect } from './basePowers.js'; + +export class FlyEffect extends PowerEffect { + get name() { + return 'Fly'; + } + + get duration() { + return 5; + } + + get basePowerPoints() { + return 3; + } + + get icon() { + return 'icons/creatures/birds/songbird-yellow-flying.webp'; + } + + get hasAdditionalRecipients() { + return true; + } + + get additionalRecipientCost() { + return 2; + } + + get isTargeted() { + return true; + } + + get usePrimaryEffect() { + return false; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + name: 'Swift Flight', + id: 'swift', + value: 2, + type: 'checkbox', + default: false, + epic: false, + effect: false, + }); + return mods; + } + + async createSecondaryEffects(maintId) { + const docs = await super.createSecondaryEffects(maintId); + const docLabel = 'SWADE.Flying'; + const docName = 'Flying'; + const doc = await PowerEffect.getStatus(docLabel, docName, false); + doc.description = this.description; + doc.flags = mergeObject(doc.flags ?? {}, { + [moduleName]: { + powerEffect: true, + maintId, + }, + }); + docs.push(doc); + return docs; + } + + get _pace() { + return (this.data.raise ? 24 : 12) + (this.data.swift ? 24 : 12); + } + + get description() { + let text = super.description; + text += `
Target may fly at pace ${this._pace}.
`; + return text; + } +} diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index 96571c9..4ea1fc1 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -27,6 +27,7 @@ import { EntangleEffect } from './entangle.js'; import { EnvironmentalProtectionEffect } from './environmentalProtection.js'; import { FarsightEffect } from './farsight.js'; import { FearEffect } from './fear.js'; +import { FlyEffect } from './fly.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -61,6 +62,7 @@ const PowerClasses = { 'environmental-protection': EnvironmentalProtectionEffect, farsight: FarsightEffect, fear: FearEffect, + fly: FlyEffect, 'lower-trait': BoostLowerTraitEffect, };