diff --git a/lang/fr.json b/lang/fr.json index cf1933b..72be8ef 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -86,5 +86,6 @@ "Extreme": "Extrême", "Maximum": "Maximale", "Defender": "Défenseur", - "Defense score": "Score de défense" + "Defense score": "Score de défense", + "Modifier": "Modificateur" } \ No newline at end of file diff --git a/module/actor/actor.js b/module/actor/actor.js index 0032cf6..d3aead6 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -126,6 +126,7 @@ export class BoLActor extends Actor { actorImg: this.img, weapon : weapon, target: target, + isRanged: BoLUtility.isRangedWeapon( weapon ), defender: objectDefender, boons : this.getBoons(), flaws : this.getFlaws(), diff --git a/module/system/bol-utility.js b/module/system/bol-utility.js index 5c4a449..521bc7f 100644 --- a/module/system/bol-utility.js +++ b/module/system/bol-utility.js @@ -116,7 +116,11 @@ export class BoLUtility { static createChatWithRollMode(name, chatOptions) { this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions); } - + /* -------------------------------------------- */ + static isRangedWeapon( weapon) { + return weapon.data.type == 'ranged' || weapon.data.thrown; + } + /* -------------------------------------------- */ static getTarget() { if (game.user.targets && game.user.targets.size == 1) { @@ -152,7 +156,7 @@ export class BoLUtility { modifier += rollData.attribute.value; } else if ( rollData.mode == 'weapon') { modifier += Number(rollData.attributes[rollData.rollAttribute].value) + Number(rollData.aptitude.value) + Number(rollData.rangeModifier); - modifier -= rollData.defender.aptitudes.def.value; + modifier -= rollData.defender.data.aptitudes.def.value; } let formula = nbDice+"d6"+mode+"+"+modifier; diff --git a/templates/roll/roll-dialog-weapon.hbs b/templates/roll/roll-dialog-weapon.hbs index a5ee471..aa188f1 100644 --- a/templates/roll/roll-dialog-weapon.hbs +++ b/templates/roll/roll-dialog-weapon.hbs @@ -44,6 +44,7 @@ + {{#if isRangedWeapon}}
- + {{/if}} +