mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04:31:07 +01:00
Fixed so @ strings can be parsed as active effect values
This commit is contained in:
parent
b8482da848
commit
3c33158d11
7 changed files with 26 additions and 183 deletions
|
|
@ -187,112 +187,16 @@ export const armorFeatures = {
|
|||
};
|
||||
|
||||
export const weaponFeatures = {
|
||||
barrier1: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier1.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier1.Description',
|
||||
barrier: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.evasion.bonus',
|
||||
mode: 2,
|
||||
value: '-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
barrier2: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier2.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier2.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '2'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.evasion.bonus',
|
||||
mode: 2,
|
||||
value: '-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
barrier3: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier3.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier3.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '3'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.evasion.bonus',
|
||||
mode: 2,
|
||||
value: '-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
barrier4: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier4.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier4.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '4'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.evasion.bonus',
|
||||
mode: 2,
|
||||
value: '-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
barrier5: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Barrier5.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Barrier5.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '5'
|
||||
value: '@system.tier + 1'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -520,61 +424,16 @@ export const weaponFeatures = {
|
|||
label: 'DAGGERHEART.WeaponFeature.Powerful.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Powerful.Description'
|
||||
},
|
||||
protective1: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Protective1.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Protective1.Description',
|
||||
protective: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Protective.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Protective.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
protective2: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Protective2.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Protective2.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '2'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
protective3: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Protective3.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Protective3.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '3'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
protective4: {
|
||||
label: 'DAGGERHEART.WeaponFeature.Protective4.Name',
|
||||
description: 'DAGGERHEART.WeaponFeature.Protective4.Description',
|
||||
effects: [
|
||||
{
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.armorScore',
|
||||
mode: 2,
|
||||
value: '4'
|
||||
value: '@system.tier'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export default class DHArmor extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
tier: new fields.NumberField({ required: true, integer: true, initial: 1 }),
|
||||
equipped: new fields.BooleanField({ initial: false }),
|
||||
baseScore: new fields.NumberField({ integer: true, initial: 0 }),
|
||||
features: new fields.ArrayField(
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export default class DHWeapon extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
tier: new fields.NumberField({ required: true, integer: true, initial: 1 }),
|
||||
equipped: new fields.BooleanField({ initial: false }),
|
||||
|
||||
//SETTINGS
|
||||
|
|
|
|||
|
|
@ -19,4 +19,9 @@ export default class DhActiveEffect extends ActiveEffect {
|
|||
|
||||
await super._preCreate(data, options, user);
|
||||
}
|
||||
|
||||
static applyField(model, change, field) {
|
||||
change.value = Roll.safeEval(Roll.replaceFormulaData(change.value, change.effect.parent));
|
||||
super.applyField(model, change, field);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue