mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
FEAT: formatting code
FIX: fix fields used FEAT: add jsdoc
This commit is contained in:
parent
6c147a5c00
commit
f3942280b6
13 changed files with 96 additions and 114 deletions
|
|
@ -24,7 +24,6 @@ export default class DHWeapon extends BaseDataItem {
|
|||
trait: new fields.StringField({ required: true, choices: SYSTEM.ACTOR.abilities, initial: 'agility' }),
|
||||
range: new fields.StringField({ required: true, choices: SYSTEM.GENERAL.range, initial: 'melee' }),
|
||||
burden: new fields.StringField({ required: true, choices: SYSTEM.GENERAL.burden, initial: 'oneHanded' }),
|
||||
|
||||
//DAMAGE
|
||||
damage: new fields.SchemaField({
|
||||
value: new FormulaField({ initial: 'd6' }),
|
||||
|
|
@ -38,31 +37,4 @@ export default class DHWeapon extends BaseDataItem {
|
|||
feature: new fields.StringField({ choices: SYSTEM.ITEM.weaponFeatures, blank: true }),
|
||||
};
|
||||
}
|
||||
|
||||
prepareDerivedData() {
|
||||
if (this.parent.parent) {
|
||||
this.applyEffects();
|
||||
}
|
||||
}
|
||||
|
||||
applyEffects() {
|
||||
const effects = this.parent.parent.system.effects;
|
||||
for (const key in effects) {
|
||||
console.log
|
||||
const effectType = effects[key];
|
||||
for (const effect of effectType) {
|
||||
switch (key) {
|
||||
case SYSTEM.EFFECTS.effectTypes.reach.id:
|
||||
if (
|
||||
SYSTEM.GENERAL.range[this.range].distance <
|
||||
SYSTEM.GENERAL.range[effect.valueData.value].distance
|
||||
) {
|
||||
this.range = effect.valueData.value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue