diff --git a/module/actor/base-actor-reve.js b/module/actor/base-actor-reve.js index 5395161d..d6f5988f 100644 --- a/module/actor/base-actor-reve.js +++ b/module/actor/base-actor-reve.js @@ -362,6 +362,10 @@ export class RdDBaseActorReve extends RdDBaseActor { */ rollArme(arme, categorieArme = "competence") { let compToUse = this.$getCompetenceArme(arme, categorieArme) + if (!RdDItemArme.isArmeUtilisable(arme)) { + ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`) + return + } if (!Targets.hasTargets()) { RdDConfirm.confirmer({ settingConfirmer: "confirmer-combat-sans-cible", @@ -374,17 +378,16 @@ export class RdDBaseActorReve extends RdDBaseActor { this.rollCompetence(compToUse, { tryTarget: false }) } }); - return; + return } Targets.selectOneToken(target => { if (Targets.isTargetEntite(target)) { ui.notifications.warn(`Vous ne pouvez pas attaquer une entité non incarnée avec votre ${arme.name}!!!!`); - return; + return } const competence = this.getCompetence(compToUse) - //console.log("RollArme", competence, arme) if (competence.isCompetencePossession()) { return RdDPossession.onAttaquePossession(target, this, competence); } diff --git a/module/rdd-combat.js b/module/rdd-combat.js index b8dbb066..1458a16c 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -754,11 +754,11 @@ export class RdDCombat { /* -------------------------------------------- */ async attaque(competence, arme) { if (!await this.attacker.accorder(this.defender, 'avant-attaque')) { - return; + return } if (arme.system.cac == 'empoignade') { RdDEmpoignade.onAttaqueEmpoignade(this.attacker, this.defender) - return; + return } RdDEmpoignade.checkEmpoignadeEnCours(this.attacker) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 362744b9..d2a71c6b 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -174,6 +174,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs', 'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs', 'systems/foundryvtt-reve-de-dragon/templates/item/boutons-comestible.html', + 'systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs', 'systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs', 'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html', 'systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.html', diff --git a/styles/img/ui/broken.svg b/styles/img/ui/broken.svg new file mode 100644 index 00000000..ae4ffc5c --- /dev/null +++ b/styles/img/ui/broken.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/styles/img/ui/icone_parchement_vierge.webp b/styles/img/ui/icone_parchement_vierge.webp new file mode 100644 index 00000000..63d17b66 Binary files /dev/null and b/styles/img/ui/icone_parchement_vierge.webp differ diff --git a/styles/simple.css b/styles/simple.css index a5f8122d..608e94c5 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -211,6 +211,13 @@ i:is(.fas, .far) { margin-right: 5px; object-position: 50% 0; } +.system-foundryvtt-reve-de-dragon img.equipement-inutilisable { + vertical-align: bottom ; + max-width: 1.4rem; + max-height: 1.4rem; + border: 1px; + background: center / contain no-repeat url('img/ui/icone_parchement_vierge.webp'); +} .system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs { width: calc(60% - 110px - 1rem); diff --git a/templates/actor/combat.html b/templates/actor/combat.html index 90fd7b2f..f41ee329 100644 --- a/templates/actor/combat.html +++ b/templates/actor/combat.html @@ -19,6 +19,7 @@ {{arme.name}} ({{arme.system.competence}}) + {{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs" arme}} {{plusMoins arme.system.niveau}} {{plusMoins arme.system.dommagesReels}} diff --git a/templates/actor/inventaire-item.html b/templates/actor/inventaire-item.html index 79ba1eaf..7e0e75da 100644 --- a/templates/actor/inventaire-item.html +++ b/templates/actor/inventaire-item.html @@ -8,11 +8,16 @@ {{else if ouvert}}far fa-minus-square {{else}}far fa-plus-square {{/if~}}"> - {{/if}} - - {{item.name}} - {{#if (eq item.type 'conteneur')}} + + {{item.name}} + {{else}} + + {{item.name}} + {{#if (eq item.type 'arme')}} + {{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs" item}} + {{/if}} + {{/if}} diff --git a/templates/item-arme-sheet.html b/templates/item-arme-sheet.html index fa911035..74e0c45c 100644 --- a/templates/item-arme-sheet.html +++ b/templates/item-arme-sheet.html @@ -46,7 +46,8 @@
- + + {{>"systems/foundryvtt-reve-de-dragon/templates/item/icon-arme-broken.hbs"}}
diff --git a/templates/item/icon-arme-broken.hbs b/templates/item/icon-arme-broken.hbs new file mode 100644 index 00000000..bfc3409e --- /dev/null +++ b/templates/item/icon-arme-broken.hbs @@ -0,0 +1,3 @@ +{{#if (lte system.resistance 0)}} + +{{/if}}