diff --git a/lang/en.json b/lang/en.json index 9e0f45c..d4921bc 100644 --- a/lang/en.json +++ b/lang/en.json @@ -143,6 +143,7 @@ "rerolls": "Rerolls", "contact": "Contact", "reaction": "Reaction", + "reaction_bonus": "Reaction bonus", "pools": "Reserves", "gear": "Gear", "protection": "Protection", @@ -390,6 +391,9 @@ "die_adapted": "adapted", "die_successes": "successes", "total": "Total", + "stat": "Stat", + "adjustment": "Adjustment", + "adjustments": "Adjustments", "totem_dice": "Totem Dice", "totem_hint": "Check to use totem dice (double success possible)", "totem_neutral": "Neutral", diff --git a/lang/fr.json b/lang/fr.json index de13b68..33d033e 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -143,6 +143,7 @@ "rerolls": "Relances", "contact": "Contact", "reaction": "Réaction", + "reaction_bonus": "Bonus de Réaction", "pools": "Réserves", "gear": "Matériel", "gear_hindrance": "Handicap Matériel", @@ -371,6 +372,9 @@ "no_group": "Sans groupe", "include_in_phase": "Inclure dans cette phase", "total": "Total", + "stat": "Statistique", + "adjustment": "Ajustement", + "adjustments": "Ajustements", "bonuses": "Bonus", "handicap": "Handicap", "score": "Score", diff --git a/less/actor/creature.less b/less/actor/creature.less index e2a94aa..cf23beb 100644 --- a/less/actor/creature.less +++ b/less/actor/creature.less @@ -208,4 +208,31 @@ } } + // ── Ajustements manuels des valeurs calculées ──────────────────────── + .creature-adjustments { + width: 100%; + border-collapse: collapse; + margin-top: 4px; + + th, td { + padding: 2px 8px; + border-bottom: 1px solid @color-border-dark-3; + font-size: @font-size-12; + text-align: left; + } + + th { text-transform: uppercase; } + + td:nth-child(2) { + width: 80px; + + input { + width: 100%; + text-align: center; + } + } + + td:nth-child(3) { text-align: center; } + } + } diff --git a/module/models/creature.mjs b/module/models/creature.mjs index 72f867f..9056f3f 100644 --- a/module/models/creature.mjs +++ b/module/models/creature.mjs @@ -65,6 +65,22 @@ export default class VermineCreatureData extends foundry.abstract.TypeDataModel protection: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 1 }) }), + // Ajustements manuels des valeurs calculées : permettent les disparités + // entre créatures de même Gabarit/Taille (ex. un sanglier avec une + // Protection supérieure à celle d'un chien, un loup plus vigoureux). + // Base dérivée + ajustement = valeur finale (jamais négative). + adjustments: new fields.SchemaField({ + attack: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + damage: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + vigor: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + reaction: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + reactionBonus: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + pools: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + gear: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + gearHindrance: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }), + protection: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }) + }), + // Équipement equipment: equipmentSchema() } @@ -145,6 +161,18 @@ export default class VermineCreatureData extends foundry.abstract.TypeDataModel // Protection this.computed.protection = roleConfig.protection || 1 + + // Ajustements manuels (base + modificateur), plancher à 0. + const adj = this.adjustments ?? {} + this.computed.attack = Math.max(0, this.computed.attack + (adj.attack ?? 0)) + this.computed.damage = Math.max(0, this.computed.damage + (adj.damage ?? 0)) + this.computed.vigor = Math.max(0, this.computed.vigor + (adj.vigor ?? 0)) + this.computed.reaction = Math.max(0, this.computed.reaction + (adj.reaction ?? 0)) + this.computed.reactionBonus = Math.max(0, this.computed.reactionBonus + (adj.reactionBonus ?? 0)) + this.computed.pools = Math.max(0, this.computed.pools + (adj.pools ?? 0)) + this.computed.gear = Math.max(0, this.computed.gear + (adj.gear ?? 0)) + this.computed.gearHindrance = Math.max(0, this.computed.gearHindrance + (adj.gearHindrance ?? 0)) + this.computed.protection = Math.max(0, this.computed.protection + (adj.protection ?? 0)) } /** diff --git a/templates/actor/appv2/creature-stats.hbs b/templates/actor/appv2/creature-stats.hbs index 3355cc3..1a2b392 100644 --- a/templates/actor/appv2/creature-stats.hbs +++ b/templates/actor/appv2/creature-stats.hbs @@ -71,4 +71,68 @@ + + {{!-- Ajustements manuels des valeurs calculées (disparités entre créatures + de même gabarit : base dérivée + modificateur = valeur finale) --}} + {{#if @root.isEditMode}} +
+

{{ localize 'VERMINE.adjustments' }}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ localize 'VERMINE.stat' }}{{ localize 'VERMINE.adjustment' }}{{ localize 'VERMINE.total' }}
{{ localize 'VERMINE.total_attack' }}{{ system.computed.attack }}D
{{ localize 'ADVERSITY.damage' }}{{ system.computed.damage }}
{{ localize 'ADVERSITY.vigor' }}{{ system.computed.vigor }}D
{{ localize 'ADVERSITY.reaction' }}{{ system.computed.reaction }}D{{#ifgt system.computed.reactionBonus 0}}+{{system.computed.reactionBonus}}{{/ifgt}}
{{ localize 'ADVERSITY.reaction_bonus' }}{{ system.computed.reactionBonus }}
{{ localize 'ADVERSITY.pools' }}{{ system.computed.pools }}D
{{ localize 'ADVERSITY.gear' }}{{ system.computed.gear }}
{{ localize 'ADVERSITY.gear_hindrance' }}{{ system.computed.gearHindrance }}
{{ localize 'ADVERSITY.protection' }}{{ system.computed.protection }}
+
+ {{/if}}