mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
add reloading feature
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
This commit is contained in:
parent
e9e8d2bd59
commit
9e4d8d637a
8 changed files with 91 additions and 16 deletions
|
|
@ -45,9 +45,10 @@ export default class DamageField extends fields.SchemaField {
|
|||
return;
|
||||
|
||||
let formulas = this.damage.parts.map(p => ({
|
||||
formula: DamageField.getFormulaValue.call(this, p, config).getFormula(this.actor),
|
||||
formula: p.fullRestore ? '0' : DamageField.getFormulaValue.call(this, p, config).getFormula(this.actor),
|
||||
damageTypes: p.applyTo === 'hitPoints' && !p.type.size ? new Set(['physical']) : p.type,
|
||||
applyTo: p.applyTo
|
||||
applyTo: p.applyTo,
|
||||
fullRestore: p.fullRestore
|
||||
}));
|
||||
|
||||
if (!formulas.length) return false;
|
||||
|
|
@ -67,6 +68,7 @@ export default class DamageField extends fields.SchemaField {
|
|||
|
||||
if (DamageField.getAutomation() === CONFIG.DH.SETTINGS.actionAutomationChoices.always.id)
|
||||
damageConfig.dialog.configure = false;
|
||||
if (formulas.every(f => f.fullRestore)) damageConfig.dialog.configure = false;
|
||||
if (config.hasSave) config.onSave = damageConfig.onSave = this.save.damageMod;
|
||||
|
||||
damageConfig.source.message = messageId;
|
||||
|
|
@ -297,6 +299,10 @@ export class DHResourceData extends foundry.abstract.DataModel {
|
|||
initial: false,
|
||||
label: 'DAGGERHEART.ACTIONS.Settings.resultBased.label'
|
||||
}),
|
||||
fullRestore: new fields.BooleanField({
|
||||
initial: false,
|
||||
label: 'DAGGERHEART.ACTIONS.Settings.fullRestore.label'
|
||||
}),
|
||||
value: new fields.EmbeddedDataField(DHActionDiceData),
|
||||
valueAlt: new fields.EmbeddedDataField(DHActionDiceData)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue