[TheWitcher] fix displayed value of fumble die

This commit is contained in:
Stexinator
2021-09-05 12:54:19 +02:00
parent 6d8f995058
commit 178d4dbc81
+5 -5
View File
@@ -3982,7 +3982,7 @@ function repeatingSum (destination, section, fieldsum, fieldmult, totalmult){
}
on('clicked:roll', (event) => {
startRoll(event.htmlAttributes.value + "{{fumble=[[1d10!+1]]}} {{fumble2=[[1d10!+1]]}}", (results) => {
startRoll(event.htmlAttributes.value + "{{fumble=[[1d10!]]}} {{fumble2=[[1d10!]]}}", (results) => {
var rollComputed = results.results.roll.result;
var roll2Computed = 0;
@@ -3990,7 +3990,7 @@ on('clicked:roll', (event) => {
if(results.results.roll.dice[0] == 1) // We check if the first die is a fumble.
{
rollComputed = results.results.roll.result - results.results.fumble.result;
rollComputed = results.results.roll.result - results.results.fumble.result-1;
}
if(results.results.roll2 != null) {
@@ -3999,7 +3999,7 @@ on('clicked:roll', (event) => {
if( results.results.roll2.dice[0] == 1) // We check if the first die is a fumble.
{
roll2Computed = results.results.roll2.result - results.results.fumble2.result;
roll2Computed = results.results.roll2.result - results.results.fumble2.result-1;
}
}
@@ -4022,12 +4022,12 @@ on('clicked:repeating_finearts:roll clicked:repeating_performance:roll clicked:r
let rollPart = event.htmlAttributes.value.replaceAll('prefix-', `${prefix}`);
startRoll(rollPart + "{{fumble=[[1d10!+1]]}}", (results) => {
startRoll(rollPart + "{{fumble=[[1d10!]]}}", (results) => {
var rollComputed = results.results.roll.result;
if(results.results.roll.dice[0] == 1) // We check if the first die is a fumble.
{
rollComputed = results.results.roll.result - results.results.fumble.result;
rollComputed = results.results.roll.result - results.results.fumble.result-1;
}
finishRoll(