diff --git a/modules/yggdrasill-actor.js b/modules/yggdrasill-actor.js
index 17593d8..10396c2 100644
--- a/modules/yggdrasill-actor.js
+++ b/modules/yggdrasill-actor.js
@@ -484,8 +484,8 @@ export class YggdrasillActor extends Actor {
/* -------------------------------------------- */
async rollAttribute( attrkey, subAttrKey = 'defaut') {
let attr = duplicate(this.data.data.attributs[attrkey]);
+ console.log("ATTR : ", attr, attrkey, subAttrKey);
let subAttr = duplicate(this.data.data.attributs[attrkey].values[subAttrKey] );
- console.log("ATTR : ", attr, subAttr);
if ( attr ) {
subAttr.label = subAttr.label || "";
let title = `Attribut : ${attr.label} ${subAttr.label} : ${subAttr.value}`;
diff --git a/modules/yggdrasill-utility.js b/modules/yggdrasill-utility.js
index 3705509..04f289e 100644
--- a/modules/yggdrasill-utility.js
+++ b/modules/yggdrasill-utility.js
@@ -114,18 +114,31 @@ export class YggdrasillUtility {
rollData.finalBM -= 3;
}
- let myRoll = new Roll("2d10+"+niveau+"+"+rollData.finalBM).roll( { async: false} );
- await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode") );
-
+ let rolls = []
+ rollData.rawDices = []
+ for (let i=0; i < 2; i++) {
+ rolls[i] = new Roll("1d10x10").roll( { async: false} );
+ rollData.rawDices.push({ 'result': rolls[i].total});
+ }
+ this.showDiceSoNice(rolls[0], game.settings.get("core", "rollMode") );
+ await this.showDiceSoNice(rolls[1], game.settings.get("core", "rollMode") );
+ rollData.bonus = niveau + rollData.finalBM
+
+ rollData.finalTotal = 0
+ for (let i=0; i< 2; i++) {
+ rollData.finalTotal = rolls[i].dice[0].results[0].result
+ }
+ rollData.finalTotal += rollData.bonus
+
// Compute total SR
rollData.srFinal = rollData.sr;
if ( rollData.srFinal > 0 ) {
- isCritical = myRoll.total >= rollData.srFinal*2;
- isSuccess = myRoll.total >= rollData.srFinal;
- marge = myRoll.total - rollData.srFinal;
+ isCritical = rollData.finalTotal >= rollData.srFinal*2;
+ isSuccess = rollData.finalTotal >= rollData.srFinal;
+ marge = rollData.finalTotal - rollData.srFinal;
}
- if (myRoll.dice[0].results[0].result == 1 && myRoll.dice[0].results[1].result == 1) {
+ if (rolls[0].dice[0].results[0].result == 1 && rolls[1].dice[0].results[0].result == 1) {
isFailure = true;
}
// Dégats
@@ -141,7 +154,7 @@ export class YggdrasillUtility {
rollData.isSuccess = isSuccess;
rollData.isCritical = isCritical;
rollData.marge = marge;
- rollData.roll = myRoll
+ rollData.rolls = rolls
console.log("ROLLLL ATTR!!!!", rollData);
diff --git a/system.json b/system.json
index bdb4803..c95c7c3 100644
--- a/system.json
+++ b/system.json
@@ -2,7 +2,7 @@
"name": "fvtt-yggdrasill",
"title": "Yggdrasill",
"description": "Système non-officiel Yggdrasill (7ièm Cercle) pour FoundryVTT",
- "version": "1.1.5",
+ "version": "1.1.6",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "9",
diff --git a/templates/figurant-sheet.html b/templates/figurant-sheet.html
index d52cd37..1b10fd6 100644
--- a/templates/figurant-sheet.html
+++ b/templates/figurant-sheet.html
@@ -43,7 +43,8 @@
{{#each attr.values as |value index|}}
{{#if value.label}}
- {{value.label}}
+
+ {{value.label}}
{{/if}}