diff --git a/module/applications/sheets/creature-sheet.mjs b/module/applications/sheets/creature-sheet.mjs index f1c1c4e..d1b9862 100644 --- a/module/applications/sheets/creature-sheet.mjs +++ b/module/applications/sheets/creature-sheet.mjs @@ -84,6 +84,9 @@ export default class VermineCreatureSheetV2 extends VermineBaseActorSheet { break case "combat": context.tab = context.tabs.combat + context.weapons = doc.itemTypes.weapon + context.equippedWeapons = doc.itemTypes.weapon.filter(i => i.system.equipped) + context.equippedDefenses = doc.itemTypes.defense.filter(i => i.system.equipped) break case "effects": context.tab = context.tabs.effects diff --git a/module/system/exchange.mjs b/module/system/exchange.mjs index 2acccba..17b94c8 100644 --- a/module/system/exchange.mjs +++ b/module/system/exchange.mjs @@ -113,7 +113,8 @@ export class VermineExchange { /** * Dégâts de base de l'arme (hors réussites de l'attaque). * Le trait "Vigueur+" ajoute la vigueur de l'attaquant. - * PNJ sans arme et créatures utilisent leurs dégâts propres. + * PNJ sans arme et créatures utilisent leurs dégâts propres. Une créature + * équipée d'une arme (morsure, griffes…) utilise les dégâts de celle-ci. * @param {Actor} actor L'attaquant * @param {Item|null} weapon * @returns {number} @@ -121,6 +122,11 @@ export class VermineExchange { static baseDamage(actor, weapon) { const type = actor.type if (type === 'creature') { + if (weapon?.system?.damage) { + let base = weapon.system.damage.value || 0 + if (weapon.system.damage.addVigor) base += actor.system?.computed?.vigor || 0 + return base + } return actor.system?.computed?.damage || 0 } if (weapon?.system?.damage) { diff --git a/templates/actor/appv2/creature-combat.hbs b/templates/actor/appv2/creature-combat.hbs index 63aad8f..210906f 100644 --- a/templates/actor/appv2/creature-combat.hbs +++ b/templates/actor/appv2/creature-combat.hbs @@ -1,4 +1,6 @@
+ {{> "systems/vermine2047/templates/actor/parts/actor-equipped-gear.hbs"}} +
{{!-- Computed Values --}}
@@ -67,6 +69,12 @@
+ {{!-- Armes --}} +
+

{{ localize 'ITEMS.weapons' }}

+ {{> "systems/vermine2047/templates/actor/parts/actor-weapons.hbs"}} +
+ {{!-- Equipment --}}

{{ localize 'VERMINE.gear' }}

diff --git a/templates/actor/parts/actor-equipped-gear.hbs b/templates/actor/parts/actor-equipped-gear.hbs index 695facf..0450008 100644 --- a/templates/actor/parts/actor-equipped-gear.hbs +++ b/templates/actor/parts/actor-equipped-gear.hbs @@ -21,7 +21,7 @@
{{#if item.system.damage.addVigor}} - {{localize 'VERMINE.vigor'}}+ + {{localize 'ADVERSITY.vigor'}}+ {{/if}} {{item.system.damage.value}} ({{item.system.damage.type}}) diff --git a/templates/dialogs/combat-dialog.hbs b/templates/dialogs/combat-dialog.hbs index 8b341b9..b4ed2d0 100644 --- a/templates/dialogs/combat-dialog.hbs +++ b/templates/dialogs/combat-dialog.hbs @@ -12,7 +12,7 @@
{{localize "VERMINE.damages"}}: - {{#if weapon.system.damage.addVigor}}{{localize "VERMINE.vigor"}}+ {{/if}} + {{#if weapon.system.damage.addVigor}}{{localize "ADVERSITY.vigor"}}+ {{/if}} {{ weapon.system.damage.value }} ({{ weapon.system.damage.type }}) diff --git a/templates/roll-message.hbs b/templates/roll-message.hbs index 12997c6..b0d0913 100644 --- a/templates/roll-message.hbs +++ b/templates/roll-message.hbs @@ -24,7 +24,7 @@
{{localize "VERMINE.damages"}}: - {{#if param.weapon.system.damage.addVigor}}{{localize "VERMINE.vigor"}}+ {{/if}} + {{#if param.weapon.system.damage.addVigor}}{{localize "ADVERSITY.vigor"}}+ {{/if}} {{param.weapon.system.damage.value}} ({{param.weapon.system.damage.type}})