add different movement modes for fly and burrow powers
This commit is contained in:
parent
1352d62c4f
commit
d8b9f554ed
@ -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/),
|
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).
|
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
|
## [3.1.4] 2025-01-26
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@ -42,6 +42,26 @@ export class BurrowEffect extends PowerEffect {
|
|||||||
return mods;
|
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() {
|
get effectName() {
|
||||||
return `${this.name} ${this.data.power ? '[Power] ' : ''}` + `(${this.data.raise ? 'full' : 'half'} pace)`;
|
return `${this.name} ${this.data.power ? '[Power] ' : ''}` + `(${this.data.raise ? 'full' : 'half'} pace)`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,16 +46,24 @@ export class FlyEffect extends PowerEffect {
|
|||||||
|
|
||||||
async parseValues() {
|
async parseValues() {
|
||||||
await super.parseValues();
|
await super.parseValues();
|
||||||
const docLabel = 'SWADE.Flying';
|
}
|
||||||
const docName = 'Flying';
|
|
||||||
const doc = await PowerEffect.getStatus(docLabel, docName, false);
|
getPrimaryEffectChanges() {
|
||||||
doc.description = `<p>From <strong>${this.source.name}</strong> casting <em>${this.name}</em></p>`;
|
return [
|
||||||
doc.flags = foundry.utils.mergeObject(doc.flags ?? {}, { [moduleName]: { powerEffect: true } });
|
...super.getPrimaryEffectChanges(),
|
||||||
this.baseEffectDoc = doc;
|
{
|
||||||
|
key: 'system.pace.fly',
|
||||||
|
value: this._pace,
|
||||||
|
mode: CONST.ACTIVE_EFFECT_MODES.OVERRIDE,
|
||||||
|
priority: 0,
|
||||||
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
get basePrimaryEffect() {
|
get basePrimaryEffect() {
|
||||||
return this.baseEffectDoc;
|
const doc = super.basePrimaryEffect;
|
||||||
|
doc.statuses = ['flying'];
|
||||||
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
get _pace() {
|
get _pace() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user