diff --git a/CHANGELOG.md b/CHANGELOG.md index 63199d3..8609731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.5] 2025-01-27 + +### Changed + + - Added flying pace support to Fly power + - Added burrowing pace support to Burrow power + ## [3.1.4] 2025-01-26 ### Fixed diff --git a/src/module/powers/burrow.js b/src/module/powers/burrow.js index 762402f..4bfebc0 100644 --- a/src/module/powers/burrow.js +++ b/src/module/powers/burrow.js @@ -42,6 +42,26 @@ export class BurrowEffect extends PowerEffect { return mods; } + getPrimaryEffectChanges() { + return [ + ...super.getPrimaryEffectChanges(), + { + key: 'system.pace.burrow', + value: 6, + mode: CONST.ACTIVE_EFFECT_MODES.OVERRIDE, + priority: 0, + }, + ]; + } + + async primaryDocForTarget(doc, target) { + const newDoc = await super.primaryDocForTarget(doc, target); + var pace = target.actor.system.pace[target.actor.system.pace.base]; + pace = this.data.raise ? pace : pace / 2; + newDoc.changes[newDoc.changes.length - 1].value = pace; + return newDoc; + } + get effectName() { return `${this.name} ${this.data.power ? '[Power] ' : ''}` + `(${this.data.raise ? 'full' : 'half'} pace)`; } diff --git a/src/module/powers/fly.js b/src/module/powers/fly.js index 167f9b4..74dce52 100644 --- a/src/module/powers/fly.js +++ b/src/module/powers/fly.js @@ -46,16 +46,24 @@ export class FlyEffect extends PowerEffect { async parseValues() { await super.parseValues(); - const docLabel = 'SWADE.Flying'; - const docName = 'Flying'; - const doc = await PowerEffect.getStatus(docLabel, docName, false); - doc.description = `
From ${this.source.name} casting ${this.name}
`; - doc.flags = foundry.utils.mergeObject(doc.flags ?? {}, { [moduleName]: { powerEffect: true } }); - this.baseEffectDoc = doc; + } + + getPrimaryEffectChanges() { + return [ + ...super.getPrimaryEffectChanges(), + { + key: 'system.pace.fly', + value: this._pace, + mode: CONST.ACTIVE_EFFECT_MODES.OVERRIDE, + priority: 0, + }, + ]; } get basePrimaryEffect() { - return this.baseEffectDoc; + const doc = super.basePrimaryEffect; + doc.statuses = ['flying']; + return doc; } get _pace() {