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}} -
+
{{localize "DAGGERHEART.GENERAL.attack"}} +
{{formField systemFields.attack.fields.roll.fields.bonus value=document._source.system.attack.roll.bonus label="DAGGERHEART.ACTIONS.Settings.attackBonus" name="system.attack.roll.bonus" localize=true}} {{formField systemFields.attack.fields.range value=document._source.system.attack.range label="DAGGERHEART.GENERAL.range" name="system.attack.range" localize=true}} {{#if systemFields.attack.fields.target.fields}} @@ -18,6 +19,8 @@ {{ formField systemFields.attack.fields.target.fields.amount value=document._source.system.attack.target.amount label="DAGGERHEART.GENERAL.amount" name="system.attack.target.amount" localize=true}} {{/if}} {{/if}} +
+ {{formGroup systemFields.criticalThreshold value=document._source.system.criticalThreshold label="DAGGERHEART.ACTIONS.Settings.criticalThreshold" name="system.criticalThreshold" localize=true}}
{{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack." directField=systemFields.attack.fields.damage.fields.direct horde=(eq document._source.system.type 'horde')}} \ No newline at end of file diff --git a/templates/sheets/actors/adversary/sidebar.hbs b/templates/sheets/actors/adversary/sidebar.hbs index 38a5c11f..cf724e7d 100644 --- a/templates/sheets/actors/adversary/sidebar.hbs +++ b/templates/sheets/actors/adversary/sidebar.hbs @@ -34,6 +34,16 @@

{{localize "DAGGERHEART.GENERAL.attack"}}

+ {{#if (lt source.system.criticalThreshold 20)}} +
+
+

{{source.system.criticalThreshold}}+

+
+
+

{{localize "DAGGERHEART.GENERAL.criticalShort"}}

+
+
+ {{/if}}