daggerheart/module/data/fields/action/saveField.mjs
Dapoulp 31238113c9
Fix/1116 fix action nullable fields (#1117)
* Temp ActionField attack type missing

* Move missing attack type to getModel

* Damage/Healing fields nullable fix

* Fix TargetField null value

* Other fixes

* Fix Action type to be not nullable
2025-08-30 11:44:16 -04:00

21 lines
765 B
JavaScript

const fields = foundry.data.fields;
export default class SaveField extends fields.SchemaField {
constructor(options = {}, context = {}) {
const saveFields = {
trait: new fields.StringField({
nullable: true,
initial: null,
choices: CONFIG.DH.ACTOR.abilities
}),
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
damageMod: new fields.StringField({
initial: CONFIG.DH.ACTIONS.damageOnSave.none.id,
choices: CONFIG.DH.ACTIONS.damageOnSave,
nullable: false,
required: true
})
};
super(saveFields, options, context);
}
}