diff --git a/lang/fr.json b/lang/fr.json index 1ca978a..670e5bd 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -53,8 +53,8 @@ "BOL.ui.delete": "Supprimer", "BOL.ui.roll" : "Utiliser", "BOL.ui.equipment" : "Équipement", - "BOL.ui.equipmentProperties" : "Propiétés d'équipement", - "BOL.ui.weaponProperties" : "Propiétés offensives", + "BOL.ui.equipmentProperties" : "Propriétés d'équipement", + "BOL.ui.weaponProperties" : "Propriétés offensives", "BOL.ui.protectionProperties" : "Protection", "BOL.ui.magicalProperties" : "Propriétés magiques", "BOL.ui.capacityProperties" : "Propriétés de capacité", diff --git a/module/controllers/bol-rolls.js b/module/controllers/bol-rolls.js index b1ae5c6..91ee36f 100644 --- a/module/controllers/bol-rolls.js +++ b/module/controllers/bol-rolls.js @@ -323,8 +323,11 @@ export class BoLAttackRoll { async processResult( ) { if (this._isSuccess) { let attrDamage = this.attackDef.weapon.data.data.properties.damageAttribute; - let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage) + let weaponFormula = BoLUtility.getDamageFormula(this.attackDef.weapon.data.data.properties.damage, + this.attackDef.weapon.data.data.properties.damageModifiers, + this.attackDef.weapon.data.data.properties.damageMultiplier) let damageFormula = weaponFormula + "+" + this.attackDef.attacker.data.data.attributes[attrDamage].value; + console.log("Formula", damageFormula) this.damageRoll = new Roll(damageFormula); await this.damageRoll.roll({ "async": false }); await BoLUtility.showDiceSoNice(this.damageRoll); diff --git a/module/system/bol-utility.js b/module/system/bol-utility.js index fa364ac..6ff321a 100644 --- a/module/system/bol-utility.js +++ b/module/system/bol-utility.js @@ -381,8 +381,9 @@ export class BoLUtility { } /* -------------------------------------------- */ - static getDamageFormula(damageString) { + static getDamageFormula(damageString, modifier=0, multiplier = 1) { if (damageString[0] == 'd') { damageString = "1" + damageString } // Help parsing + if (modifier == null) modifier = 0; var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g'); let res = myReg.exec(damageString); let nbDice = parseInt(res[1]); @@ -400,7 +401,7 @@ export class BoLUtility { modIndex = 4; } } - let formula = nbDice + "d" + res[2] + postForm + ((res[modIndex]) ? res[modIndex] : ""); + let formula = "(" + nbDice + "d" + res[2] + postForm + "+" + modifier +") *" + multiplier; return formula; } /* -------------------------------------------- */ diff --git a/module/system/config.js b/module/system/config.js index 433a471..3b8fa90 100644 --- a/module/system/config.js +++ b/module/system/config.js @@ -17,6 +17,13 @@ BOL.damageValues = { "d6BB" : "d6B + dé bonus", } +BOL.damageMultiplier = { + "1": "x1", + "2": "x2", + "3": "x3", + "4": "x4", +} + BOL.equipmentSlots = { "none" : "BOL.equipmentSlots.none", "head" : "BOL.equipmentSlots.head", diff --git a/system.json b/system.json index f6fc827..ebedc65 100644 --- a/system.json +++ b/system.json @@ -7,7 +7,7 @@ "url": "https://github.com/ZigmundKreud/bol", "license": "LICENSE.txt", "flags": {}, - "version": "0.8.9.5", + "version": "0.8.9.6", "templateVersion": 14, "minimumCoreVersion": "0.8.6", "compatibleCoreVersion": "9", diff --git a/templates/item/parts/properties/item/weapon-properties.hbs b/templates/item/parts/properties/item/weapon-properties.hbs index 3c91ed8..c48f5a7 100644 --- a/templates/item/parts/properties/item/weapon-properties.hbs +++ b/templates/item/parts/properties/item/weapon-properties.hbs @@ -115,6 +115,18 @@ +