mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Merged in main
This commit is contained in:
commit
b3c0344b91
11 changed files with 16 additions and 24 deletions
|
|
@ -10,7 +10,7 @@ export default class DamageField extends fields.SchemaField {
|
|||
initial: false,
|
||||
label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label'
|
||||
}),
|
||||
direct: new fields.BooleanField({ initial: false, label: "DAGGERHEART.CONFIG.DamageType.direct.name" })
|
||||
direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' })
|
||||
};
|
||||
super(damageFields, options, context);
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ export class DHActionDiceData extends foundry.abstract.DataModel {
|
|||
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }),
|
||||
custom: new fields.SchemaField({
|
||||
enabled: new fields.BooleanField({ label: 'Custom Formula' }),
|
||||
formula: new FormulaField({ label: 'Formula' })
|
||||
formula: new FormulaField({ label: 'Formula', initial: '' })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ export class ActionsField extends MappingField {
|
|||
*/
|
||||
export class ActionField extends foundry.data.fields.ObjectField {
|
||||
getModel(value) {
|
||||
if (value && !value.type) value.type = 'attack';
|
||||
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +100,6 @@ export class ActionField extends foundry.data.fields.ObjectField {
|
|||
|
||||
/** @override */
|
||||
initialize(value, model, options = {}) {
|
||||
if (value && !value.type) value.type = 'attack';
|
||||
const cls = this.getModel(value);
|
||||
if (cls) return new cls(value, { parent: model, ...options });
|
||||
return foundry.utils.deepClone(value);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ const resourceField = (max = 0, initial = 0, label, reverse = false, maxLabel) =
|
|||
|
||||
const stressDamageReductionRule = localizationPath =>
|
||||
new fields.SchemaField({
|
||||
enabled: new fields.BooleanField({ required: true, initial: false }),
|
||||
cost: new fields.NumberField({
|
||||
integer: true,
|
||||
label: `${localizationPath}.label`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue