diff --git a/lang/en.json b/lang/en.json index 99daf69b..c969ce15 100755 --- a/lang/en.json +++ b/lang/en.json @@ -103,6 +103,7 @@ "Settings": { "attackBonus": "Attack Bonus", "attackName": "Attack Name", + "criticalThreshold": "Critical Threshold", "includeBase": { "label": "Include Item Damage" }, "multiplier": "Multiplier", "saveHint": "Set a default Trait to enable Reaction Roll. It can be changed later in Reaction Roll Dialog.", diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index 5e25202c..7d9ac951 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -39,6 +39,7 @@ export default class DhpAdversary extends BaseDataActor { integer: true, label: 'DAGGERHEART.GENERAL.hordeHp' }), + criticalThreshold: new fields.NumberField({ required: true, integer: true, min: 1, max: 20, initial: 20 }), damageThresholds: new fields.SchemaField({ major: new fields.NumberField({ required: true, @@ -54,8 +55,20 @@ export default class DhpAdversary extends BaseDataActor { }) }), resources: new fields.SchemaField({ - hitPoints: resourceField(0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', true), - stress: resourceField(0, 0, 'DAGGERHEART.GENERAL.stress', true) + hitPoints: resourceField( + 0, + 0, + 'DAGGERHEART.GENERAL.HitPoints.plural', + true, + game.i18n.localize('DAGGERHEART.GENERAL.max') + ), + stress: resourceField( + 0, + 0, + 'DAGGERHEART.GENERAL.stress', + true, + game.i18n.localize('DAGGERHEART.GENERAL.max') + ) }), rules: new fields.SchemaField({ conditionImmunities: new fields.SchemaField({ diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index f0660106..387123c4 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -13,8 +13,6 @@ export default class D20Roll extends DHRoll { DISADVANTAGE: -1 }; - static CRITICAL_TRESHOLD = 20; - static DefaultDialog = D20RollDialog; get title() { @@ -37,7 +35,7 @@ export default class D20Roll extends DHRoll { get isCritical() { if (!this.d20._evaluated) return; - return this.d20.total >= this.constructor.CRITICAL_TRESHOLD; + return this.d20.total >= this.data.system.criticalThreshold; } get hasAdvantage() { diff --git a/templates/sheets-settings/adversary-settings/attack.hbs b/templates/sheets-settings/adversary-settings/attack.hbs index 12bafca8..c3ee21f6 100644 --- a/templates/sheets-settings/adversary-settings/attack.hbs +++ b/templates/sheets-settings/adversary-settings/attack.hbs @@ -8,8 +8,9 @@ {{formGroup systemFields.attack.fields.img value=document._source.system.attack.img label="DAGGERHEART.GENERAL.imagePath" name="system.attack.img" localize=true}} {{formGroup systemFields.attack.fields.name value=document._source.system.attack.name label="DAGGERHEART.ACTIONS.Settings.attackName" name="system.attack.name" localize=true}} -