mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/132 weapon armor features (#136)
* Added effects for Weapon and Armor traits * Fixed so @ strings can be parsed as active effect values * Added actions
This commit is contained in:
parent
6adbb4e49b
commit
5b94675db1
13 changed files with 598 additions and 48 deletions
|
|
@ -1,4 +1,12 @@
|
|||
export default class DhActiveEffect extends ActiveEffect {
|
||||
get isSuppressed() {
|
||||
if (['weapon', 'armor'].includes(this.parent.type)) {
|
||||
return !this.parent.system.equipped;
|
||||
}
|
||||
|
||||
return super.isSuppressed;
|
||||
}
|
||||
|
||||
async _preCreate(data, options, user) {
|
||||
const update = {};
|
||||
if (!data.img) {
|
||||
|
|
@ -11,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