diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index f44dbfe..00e669f 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -640,10 +640,10 @@ export class CrucibleActor extends Actor { if ( !rollData.forceDisadvantage) { // This is an attack, check if disadvantaged rollData.forceDisadvantage = this.isAttackDisadvantage() } - if (rollData.weapon.system.isranged && rollData.tokensDistance > CrucibleUtility.getWeaponMaxRange(rollData.weapon) ) { + /*if (rollData.weapon.system.isranged && rollData.tokensDistance > CrucibleUtility.getWeaponMaxRange(rollData.weapon) ) { ui.notifications.warn(`Your target is out of range of your weapon (max: ${CrucibleUtility.getWeaponMaxRange(rollData.weapon)} - current : ${rollData.tokensDistance})` ) return - } + }*/ this.startRoll(rollData) } else { ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name) @@ -691,7 +691,7 @@ export class CrucibleActor extends Actor { rollData.sizeDice = CrucibleUtility.getSizeDice( this.system.biodata.size ) rollData.effectiveRange = CrucibleUtility.getWeaponRange(attackRollData.weapon) rollData.tokensDistance = attackRollData.tokensDistance // QoL copy - rollData.distanceBonusDice = Math.max(0, Math.floor((rollData.tokensDistance - rollData.effectiveRange) + 0.5)) + rollData.distanceBonusDice = 0 //Math.max(0, Math.floor((rollData.tokensDistance - rollData.effectiveRange) + 0.5)) rollData.hasCover = "none" rollData.situational = "none" rollData.useshield = false @@ -770,7 +770,7 @@ export class CrucibleActor extends Actor { ChatMessage.create( { content: "Armor result : " + armorValue } ) } messages.push( "Armor result : " + armorValue) - return { armorIgnored: false, nbSuccess: armorValue, messages: messages } + return { armorIgnored: false, nbSuccess: armorValue, rawArmor: armorResult.text, messages: messages } } return { armorIgnored: true, nbSuccess: 0, messages: ["No armor equipped."] } } diff --git a/modules/crucible-roll-dialog.js b/modules/crucible-roll-dialog.js index 34025a6..c2ed025 100644 --- a/modules/crucible-roll-dialog.js +++ b/modules/crucible-roll-dialog.js @@ -76,6 +76,9 @@ export class CrucibleRollDialog extends Dialog { html.find('#situational').change((event) => { this.rollData.situational = event.currentTarget.value }) + html.find('#distanceBonusDice').change((event) => { + this.rollData.distanceBonusDice = Number(event.currentTarget.value) + }) } } \ No newline at end of file diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 8b70f62..8a5381a 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -338,10 +338,18 @@ export class CrucibleUtility { /* -------------------------------------------- */ static getSuccessResult(rollData) { if (rollData.sumSuccess <= -3) { - return { result: "miss", fumble: true, attackerHPLoss: "2d3", hpLossType: "melee" } + if (rollData.attackRollData.weapon.system.isranged ) { + return { result: "miss", fumble: true, hpLossType: "melee" } + } else { + return { result: "miss", fumble: true, attackerHPLoss: "2d3", hpLossType: "melee" } + } } if (rollData.sumSuccess == -2) { - return { result: "miss", dangerous_fumble: true, attackerHPLoss: "1d3", hpLossType: "melee" } + if (rollData.attackRollData.weapon.system.isranged ) { + return { result: "miss", dangerous_fumble: true } + } else { + return { result: "miss", dangerous_fumble: true, attackerHPLoss: "1d3", hpLossType: "melee" } + } } if (rollData.sumSuccess == -1) { return { result: "miss" } diff --git a/system.json b/system.json index 8f6441b..f6acf3a 100644 --- a/system.json +++ b/system.json @@ -199,7 +199,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.5", + "version": "10.0.6", "compatibility": { "minimum": "10", "verified": "10.278", @@ -207,7 +207,7 @@ }, "title": "Crucible RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/raw/master/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v10.0.5.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v10.0.6.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg", "background": "images/ui/crucible_welcome_page.webp", "id": "fvtt-crucible-rpg" diff --git a/templates/chat-attack-defense-result.html b/templates/chat-attack-defense-result.html index 73bc1db..4367f4b 100644 --- a/templates/chat-attack-defense-result.html +++ b/templates/chat-attack-defense-result.html @@ -23,7 +23,9 @@