From 444e52cb4907ecb11b7bf3a4d03046aedd1c946b Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 24 Nov 2024 00:59:35 +0100 Subject: [PATCH] Armes naturelles Corrections mineures sur l'affichage des armes naturelles --- module/item-arme.js | 2 +- module/item-competencecreature.js | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/module/item-arme.js b/module/item-arme.js index 6d9c7a17..0ce786e2 100644 --- a/module/item-arme.js +++ b/module/item-arme.js @@ -4,7 +4,7 @@ import { RdDCombatManager } from "./rdd-combat.js"; const nomCategorieParade = { "sans-armes": "Sans arme", - "armes-naturelles": "Sans arme", + "armes-naturelles": "Armes naturelles", "hast": "Armes d'hast", "batons": "Bâtons", "boucliers": "Boucliers", diff --git a/module/item-competencecreature.js b/module/item-competencecreature.js index 6828fd48..4fefb887 100644 --- a/module/item-competencecreature.js +++ b/module/item-competencecreature.js @@ -49,17 +49,7 @@ export class RdDItemCompetenceCreature extends Item { /* -------------------------------------------- */ static isAttaque(item) { - if (item.type == ITEM_TYPES.competencecreature) { - switch (item.system.categorie) { - case "melee": - case "tir": - case "lancer": - case "naturelle": - case "possession": - return true - } - } - return false + return RdDItemCompetenceCreature.getCategorieAttaque(item) != undefined } static getCategorieAttaque(item) { @@ -70,7 +60,6 @@ export class RdDItemCompetenceCreature extends Item { case "lancer": case "naturelle": case "possession": - case "parade": return item.system.categorie } } @@ -92,12 +81,7 @@ export class RdDItemCompetenceCreature extends Item { static isParade(item) { if (item.type == ITEM_TYPES.competencecreature) { - switch (item.system.categorie) { - case "melee": - case "naturelle": - case "parade": - return true - } + return armeData.system.categorie_parade || armeData.system.isparade } return false }