diff --git a/module/actor/actor.js b/module/actor/actor.js index 8c0828b..df81353 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -362,10 +362,9 @@ export class BoLActor extends Actor { rollWeaponDamage( itemId) { let weapon = this.data.items.get(itemId ) if ( weapon ) { - console.log("WE", weapon) let r = new BoLDefaultRoll( { id: randomID(16), isSuccess: true, mode: "weapon", weapon: weapon, actor: this} ) r.setSuccess(true) - r.processResult() + r.rollDamage() } } diff --git a/module/controllers/bol-rolls.js b/module/controllers/bol-rolls.js index a38bc1a..171fe13 100644 --- a/module/controllers/bol-rolls.js +++ b/module/controllers/bol-rolls.js @@ -344,6 +344,17 @@ export class BoLDefaultRoll { }); } + getDamageAttributeValue( attrDamage) { + let attrDamageValue = 0 + if ( attrDamage.includes("vigor") ) { + attrDamageValue = this.rollData.actor.data.data.attributes.vigor.value + if (attrDamage.includes("half")) { + attrDamageValue = Math.floor(attrDamageValue / 2) + } + } + return attrDamageValue + } + async rollDamage() { if (this.rollData.mode != "weapon") { // Only specific process in Weapon mode return; @@ -358,12 +369,12 @@ export class BoLDefaultRoll { if ( this.rollData.damageMode == 'damage-plus-12') { bonusDmg = 12 } - console.log("DAMAGE !!!") - let attrDamage = this.rollData.weapon.data.data.properties.damageAttribute; + let attrDamageValue = this.getDamageAttributeValue(this.rollData.weapon.data.data.properties.damageAttribute) let weaponFormula = BoLUtility.getDamageFormula(this.rollData.weapon.data.data.properties.damage, - this.rollData.weapon.data.data.properties.damageModifiers, - this.rollData.weapon.data.data.properties.damageMultiplier) - let damageFormula = weaponFormula + "+" + bonusDmg + ((attrDamage) ? "+" + this.rollData.actor.data.data.attributes[attrDamage].value : "+0"); + this.rollData.weapon.data.data.properties.damageModifiers, + this.rollData.weapon.data.data.properties.damageMultiplier) + let damageFormula = weaponFormula + "+" + bonusDmg + "+" + attrDamageValue + console.log("DAMAGE !!!", damageFormula, attrDamageValue) //console.log("Formula", weaponFormula, damageFormula, this.rollData.weapon.data.data.properties.damage) this.rollData.damageFormula = damageFormula diff --git a/system.json b/system.json index 6b9cf76..c03f6d9 100644 --- a/system.json +++ b/system.json @@ -7,7 +7,7 @@ "url": "https://github.com/ZigmundKreud/bol", "license": "LICENSE.txt", "flags": {}, - "version": "0.9.1.2", + "version": "0.9.1.3", "templateVersion": 18, "minimumCoreVersion": "0.8.6", "compatibleCoreVersion": "9",