From 9e023d3f01889d092ffe9b17b96927c718ed9619 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Thu, 15 Feb 2024 11:47:15 +0100 Subject: [PATCH] Fix calcul defense --- modules/hawkmoon-actor.js | 5 +++-- modules/hawkmoon-utility.js | 9 ++++----- system.json | 4 ++-- templates/actor-sheet.html | 12 +++++++++++- templates/cellule-sheet.html | 4 ++++ templates/creature-sheet.html | 12 ++++++++++-- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/modules/hawkmoon-actor.js b/modules/hawkmoon-actor.js index 1153e5b..6a8bf16 100644 --- a/modules/hawkmoon-actor.js +++ b/modules/hawkmoon-actor.js @@ -76,6 +76,7 @@ export class HawkmoonActor extends Actor { arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense + console.log("Arme", arme.system.totalDefensif, combat, arme.system.competence.system.niveau, arme.system.seuildefense, bonusDefense) arme.system.isdefense = true arme.system.isMelee = true arme.system.isDistance = false @@ -175,7 +176,7 @@ export class HawkmoonActor extends Actor { /* -------------------------------------------- */ getDefenseBase() { - return Math.max(this.system.attributs.tre.value, this.system.attributs.pui.value) + return Math.max(this.system.attributs.tre.value, this.system.attributs.adr.value) } /* -------------------------------------------- */ @@ -185,7 +186,7 @@ export class HawkmoonActor extends Actor { /* -------------------------------------------- */ getProtection() { let equipProtection = 0 - for (let armor in this.items) { + for (let armor of this.items) { if (armor.type == "protection" && armor.system.equipped) { equipProtection += Number(armor.system.protection) } diff --git a/modules/hawkmoon-utility.js b/modules/hawkmoon-utility.js index e6f345d..3e49a93 100644 --- a/modules/hawkmoon-utility.js +++ b/modules/hawkmoon-utility.js @@ -716,11 +716,11 @@ export class HawkmoonUtility { /* -------------------------------------------- */ static async confirmDelete(actorSheet, li) { let itemId = li.data("item-id"); - let msgTxt = "

Are you sure to remove this Item ?"; + let msgTxt = "

Etes vous certain de vouloir supprimer cet item ?"; let buttons = { delete: { icon: '', - label: "Yes, remove it", + label: "Oui !", callback: () => { actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]); li.slideUp(200, () => actorSheet.render(false)); @@ -728,12 +728,12 @@ export class HawkmoonUtility { }, cancel: { icon: '', - label: "Cancel" + label: "Non" } } msgTxt += "

"; let d = new Dialog({ - title: "Confirm removal", + title: "Confirmer la suppression", content: msgTxt, buttons: buttons, default: "cancel" @@ -752,7 +752,6 @@ export class HawkmoonUtility { console.log(entryData) htmlTab += `@UUID[Compendium.${compName}.${entryData._id}]{${entryData.name}}` htmlTab += `${entryData.system.description}`; - //htmlTab += `${entryData.system.resumebonus}`; htmlTab += "\n"; } htmlTab += ""; diff --git a/system.json b/system.json index 4b36abf..01c1069 100644 --- a/system.json +++ b/system.json @@ -1,7 +1,7 @@ { "id": "fvtt-hawkmoon-cyd", "description": "Hawkmoon RPG for FoundryVTT (CYD system - French)", - "version": "11.1.0", + "version": "11.1.1", "authors": [ { "name": "Uberwald/LeRatierBretonnien", @@ -35,7 +35,7 @@ "gridUnits": "m", "license": "LICENSE.txt", "manifest": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-11.1.0.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-11.1.1.zip", "languages": [ { "lang": "fr", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 4b104ca..fffa456 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -134,6 +134,10 @@
 
+
+ +
{{#each talents as |talent key|}}
  • @@ -162,7 +166,11 @@
     
    -
  • +
    + +
    + {{#each talentsCell as |talent key|}}
  • @@ -346,6 +354,8 @@
     
    diff --git a/templates/cellule-sheet.html b/templates/cellule-sheet.html index 4a4e60a..a5f8b8e 100644 --- a/templates/cellule-sheet.html +++ b/templates/cellule-sheet.html @@ -81,6 +81,10 @@
     
    +
    + +
  • {{#each talents as |talent key|}}
  • diff --git a/templates/creature-sheet.html b/templates/creature-sheet.html index 5ca07fb..46fb43a 100644 --- a/templates/creature-sheet.html +++ b/templates/creature-sheet.html @@ -192,9 +192,13 @@
     
    +
    + +
  • {{#each talents as |talent key|}} -
  • +
  • {{talent.name}} {{talent.system.resumebonus}} @@ -221,9 +225,13 @@
     
    +
    + +
  • {{#each talentsCell as |talent key|}} -
  • +
  • {{talent.name}} {{talent.system.resumebonus}}