mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Updated Armor SRD
This commit is contained in:
parent
47b16392eb
commit
b9e3eec34c
42 changed files with 1520 additions and 23 deletions
|
|
@ -107,9 +107,10 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
|
|||
}
|
||||
|
||||
async updateArmorMax(newMax) {
|
||||
const { effect, ...baseChange } = this.armorChange;
|
||||
const newChanges = [
|
||||
{
|
||||
...this.armorChange,
|
||||
...baseChange,
|
||||
max: newMax,
|
||||
value: Math.min(this.armorChange.value, newMax)
|
||||
}
|
||||
|
|
@ -152,7 +153,7 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
|
|||
armorChange.key = 'system.armorScore';
|
||||
}
|
||||
|
||||
static getDefaultEffectData() {
|
||||
static getDefaultObject() {
|
||||
return {
|
||||
type: 'armor',
|
||||
name: game.i18n.localize('DAGGERHEART.EFFECTS.Armor.newArmorEffect'),
|
||||
|
|
@ -160,13 +161,6 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
|
|||
};
|
||||
}
|
||||
|
||||
async _preCreate(data, options, user) {
|
||||
const allowed = await super._preCreate(data, options, user);
|
||||
if (allowed === false) return;
|
||||
|
||||
await this.updateSource({ ...ArmorEffect.getDefaultEffectData(), data });
|
||||
}
|
||||
|
||||
async _preUpdate(changes, options, user) {
|
||||
const allowed = await super._preUpdate(changes, options, user);
|
||||
if (allowed === false) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue