From 3ca4a1c8448447206d1d898b77dafa4823834f23 Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:43:30 +0000 Subject: [PATCH 1/7] Update template.json --- template.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/template.json b/template.json index e3ad41c..36882a4 100644 --- a/template.json +++ b/template.json @@ -128,7 +128,6 @@ "defensephy": { "value": 0, "bonusmalus": 0, - "bouclierequipe": false, "max": 0, "label": "Défense Physique", "abbrev": "dp" @@ -330,6 +329,16 @@ "enc": 0, "valeur": 0, "description": "" + }, + "bouclier": { + "categorie": "", + "equipe": false, + "defensebonus": 0, + "enc": 0, + "enccomb": 0, + "solidite": 0, + "valeur": 0, + "description": "" }, "equipement": { "equipe": false, From 6ea56b85e66185d8e13b36e86454bbc7d5eb1c44 Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:47:35 +0000 Subject: [PATCH 2/7] sheet bouclier --- templates/item-bouclier-sheet.html | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/item-bouclier-sheet.html diff --git a/templates/item-bouclier-sheet.html b/templates/item-bouclier-sheet.html new file mode 100644 index 0000000..4ca82ef --- /dev/null +++ b/templates/item-bouclier-sheet.html @@ -0,0 +1,35 @@ +
+
+ +
+

+
+
+ + {{!-- Sheet Body --}} +
+ +
+
    +
  • + +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
+ + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
+ +
+
From 7f029f67f2bef084c72440632eb431f26c4be34c Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:51:38 +0000 Subject: [PATCH 3/7] Update modules/yggdrasill-actor.js --- modules/yggdrasill-actor.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/modules/yggdrasill-actor.js b/modules/yggdrasill-actor.js index 221598b..c2ae4d4 100644 --- a/modules/yggdrasill-actor.js +++ b/modules/yggdrasill-actor.js @@ -280,7 +280,7 @@ export class YggdrasillActor extends Actor { } /* -------------------------------------------- */ getToutEquipements() { - return this.data.items.filter( item => item.type == 'equipement' || item.type == 'armure' || item.type == 'armecc' || item.type == 'armedist'); + return this.data.items.filter( item => item.type == 'equipement' || item.type == 'armure' || item.type == 'armecc' || item.type == 'armedist' || item.type == 'bouclier'); } /* -------------------------------------------- */ getArmes() { @@ -289,6 +289,9 @@ export class YggdrasillActor extends Actor { /* -------------------------------------------- */ getArmures() { return this.data.items.filter( item => item.type == 'armure' && item.data.data.equipe ); + } + getBoucliers() { + return this.data.items.filter( item => item.type == 'bouclier' && item.data.data.equipe ); } getProuessesMartiales() { let prouesse = this.data.items.filter( item => item.type == 'prouesse' ); @@ -738,13 +741,19 @@ export class YggdrasillActor extends Actor { getEncTotal( ) { let encTotal = 0; for( let item of this.data.items) { - if (item.type == "equipement" || item.type == "armecc" - || item.type == "armedist" || item.type == "armure" || item.type == "monnaie") { - encTotal += item.data.data.enc; + if (item.type == "equipement" || item.type == "armecc" + || item.type == "armedist" || item.type == "armure" || item.type == "monnaie" || item.type == "bouclier") { + encTotal += (item.data.data.enc * item.data.data.quantite); + } + } + for( let item of this.data.items) { + if (item.type == "bouclier" && item.data.data.equipe) { + encTotal -= (item.data.data.enc * item.data.data.quantite); + encTotal += (item.data.data.enccomb * item.data.data.quantite); } } return encTotal; - } + } /* -------------------------------------------- */ getProtectionTotal( ) { @@ -756,6 +765,16 @@ export class YggdrasillActor extends Actor { } return protectionTotal; } + /* -------------------------------------------- */ + getDpBouclier( ) { + let dpBouclier = 0; + for( let item of this.data.items) { + if (item.type == "bouclier" && item.data.data.equipe) { + dpBouclier += Number(item.data.data.defensebonus); + } + } + return dpBouclier; + } /* -------------------------------------------- */ async incrementeQuantite( objetId ) { From d4a005fafb36b2a048a5de538dec286948ee099b Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:54:45 +0000 Subject: [PATCH 4/7] Update modules/yggdrasill-actor-sheet.js --- modules/yggdrasill-actor-sheet.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/yggdrasill-actor-sheet.js b/modules/yggdrasill-actor-sheet.js index ef30404..d51e311 100644 --- a/modules/yggdrasill-actor-sheet.js +++ b/modules/yggdrasill-actor-sheet.js @@ -48,12 +48,14 @@ export class YggdrasillActorSheet extends ActorSheet { blessures: this.actor.getBlessures(), armes: this.actor.getArmes(), armures: this.actor.getArmures(), + boucliers: this.actor.getBoucliers(), prouessesMartiales: this.actor.getProuessesMartiales(), equipements: this.actor.getToutEquipements(), effetsmagiques: this.actor.getEffetsMagiques(), effetsRunes: this.actor.getEffetsDeRunes(), encTotal: this.actor.getEncTotal(), protectionTotal: this.actor.getProtectionTotal(), + dpBouclier: this.actor.getDpBouclier(), monnaies: this.actor.getMonnaies(), sortsSejdr:this.actor.getSortsSejdr(), sortsGaldr:this.actor.getSortsGaldr(), From d3ffc93738fb83aab6ac21d08ec13285145a631a Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:57:10 +0000 Subject: [PATCH 5/7] Update modules/yggdrasill-actor-sheet.js --- modules/yggdrasill-actor-sheet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/yggdrasill-actor-sheet.js b/modules/yggdrasill-actor-sheet.js index d51e311..8c77380 100644 --- a/modules/yggdrasill-actor-sheet.js +++ b/modules/yggdrasill-actor-sheet.js @@ -83,10 +83,10 @@ export class YggdrasillActorSheet extends ActorSheet { dm.total = dm.max + Number(dm.bonusmalus); } /* -------------------------------------------- */ - updateDP( data ) { +updateDP( data ) { let dp = data.caracsecondaire.defensephy; dp.total = dp.max + Number(dp.bonusmalus); - dp.total += (dp.bouclierequipe) ? 3 : 0; + dp.total += this.actor.getDpBouclier(); } /* -------------------------------------------- */ From b67fffb26c92c7bab09f45181278d010a3f1dd5e Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 21:59:04 +0000 Subject: [PATCH 6/7] Update templates/actor-sheet.html --- templates/actor-sheet.html | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index daef49d..8ec4ffc 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -156,10 +156,6 @@ {{/select}} -
  • - Bouclier ? - -
  • Total : {{caracsec.total}}
  • @@ -372,6 +368,31 @@ {{/each}} + +

    Bouclier (Bonus de défense physique : {{dpBouclier}})

    + + From 9886ebc85bac0aa868279fe0e7326fb9db4f0994 Mon Sep 17 00:00:00 2001 From: Archonoir-dev Date: Mon, 21 Feb 2022 22:12:48 +0000 Subject: [PATCH 7/7] Update system.json --- system.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system.json b/system.json index f649687..2f4a8a6 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "fvtt-yggdrasill", "title": "Yggdrasill", "description": "Système non-officiel Yggdrasill (7ième Cercle) pour FoundryVTT", - "version": "1.2.0", + "version": "1.2.1", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "9", "compatibleCoreVersion": "9",