Fix numbering

This commit is contained in:
sladecraven 2022-01-29 18:22:27 +01:00
parent 98fbc92e9b
commit 9974c5365a
2 changed files with 17 additions and 17 deletions

View File

@ -76,26 +76,26 @@ export class PegasusRollDialog extends Dialog {
console.log("Ongoing", newLevel, toggled, idVal )
if (toggled) {
if ( genre == 'positive') {
newLevel += level
newLevel += Number(level)
}else {
newLevel -= level
newLevel -= Number(level)
}
}else {
if ( genre == 'positive') {
newLevel -= level
newLevel -= Number(level)
}else {
newLevel += level
newLevel += Number(level)
}
}
newLevel = (newLevel<0) ? 0 : newLevel
$(idVal).val(newLevel)
}
//console.log("Effect", effect, toggled)
this.rollData.statDicesLevel = $('#statDicesLevel').val()
this.rollData.specDicesLevel = $('#specDicesLevel').val()
this.rollData.bonusDicesLevel = $('#bonusDicesLevel').val()
this.rollData.hindranceDicesLevel = $('#hindranceDicesLevel').val()
this.rollData.otherDicesLevel = $('#otherDicesLevel').val()
this.rollData.statDicesLevel = Number($('#statDicesLevel').val())
this.rollData.specDicesLevel = Number($('#specDicesLevel').val())
this.rollData.bonusDicesLevel = Number($('#bonusDicesLevel').val())
this.rollData.hindranceDicesLevel = Number($('#hindranceDicesLevel').val())
this.rollData.otherDicesLevel = Number($('#otherDicesLevel').val())
}
/* -------------------------------------------- */
@ -105,9 +105,9 @@ export class PegasusRollDialog extends Dialog {
armor.applied = toggled
if (armor.type == 'other' ) {
if (toggled) {
this.rollData.otherDicesLevel += armor.value
this.rollData.otherDicesLevel += Number(armor.value)
} else {
this.rollData.otherDicesLevel -= armor.value
this.rollData.otherDicesLevel -= Number(armor.value)
this.rollData.otherDicesLevel = (this.rollData.otherDicesLevel<0) ? 0 : this.rollData.otherDicesLevel
}
$("#otherDicesLevel").val(this.rollData.otherDicesLevel)
@ -164,11 +164,11 @@ export class PegasusRollDialog extends Dialog {
newLevel = (newLevel <0) ? 0 : newLevel
$(idVal).val(newLevel)
// Then refresh
this.rollData.statDicesLevel = $('#statDicesLevel').val()
this.rollData.specDicesLevel = $('#specDicesLevel').val()
this.rollData.bonusDicesLevel = $('#bonusDicesLevel').val()
this.rollData.hindranceDicesLevel = $('#hindranceDicesLevel').val()
this.rollData.otherDicesLevel = $('#otherDicesLevel').val()
this.rollData.statDicesLevel = Number($('#statDicesLevel').val())
this.rollData.specDicesLevel = Number($('#specDicesLevel').val())
this.rollData.bonusDicesLevel = Number($('#bonusDicesLevel').val())
this.rollData.hindranceDicesLevel = Number($('#hindranceDicesLevel').val())
this.rollData.otherDicesLevel = Number($('#otherDicesLevel').val())
}
}

View File

@ -183,6 +183,6 @@
"templateVersion": 64,
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.2.6",
"version": "0.2.7",
"background" : "./images/ui/pegasus_welcome_page.webp"
}