diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 8c01d7a..2da7f97 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1744,7 +1744,7 @@ export class PegasusActor extends Actor { let effects = this.items.filter(item => item.type == 'effect') for (let effect of effects) { effect = duplicate(effect) - if (!effect.system.hindrance && !effect.system.statdice + if (!effect.system.hindrance && !effect.system.statdice && !effect.system.reducedicevalue && (effect.system.stataffected != "notapplicable" || effect.system.specaffected.length > 0) && effect.system.stataffected != "special" && effect.system.stataffected != "powerroll" @@ -2214,19 +2214,28 @@ export class PegasusActor extends Actor { } /* -------------------------------------------- */ processVehicleStatEffects() { - let effects = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice) + let bonus = 0 + let effectsPlus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice) + let effectsMinus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "negative" && effect.system.reducedicevalue) for (let statKey in this.system.statistics) { let stat = duplicate(this.system.statistics[statKey]) - let bonus = 0 - for (let effect of effects) { + for (let effect of effectsPlus) { if (effect.system.stataffected == statKey) { bonus += Number(effect.system.effectlevel) } } + for (let effect of effectsMinus) { + if (effect.system.stataffected == statKey) { + bonus -= Number(effect.system.effectlevel) + } + } if (bonus != stat.bonuseffect) { stat.bonuseffect = bonus + if (stat.currentlevel > stat.bonuseffect+stat.level) { + stat.currentlevel = stat.bonuseffect+stat.level + } this.update({ [`system.statistics.${statKey}`]: stat }) - } + } } } diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 524ce71..4d1585b 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -544,7 +544,7 @@ export class PegasusUtility { /* -------------------------------------------- */ static getDiceFromLevel(level = 0) { - level = Number(level) + level = Math.max( Number(level), 0) return this.diceList[level]; } /* -------------------------------------------- */ diff --git a/system.json b/system.json index 60ba327..71fb0f3 100644 --- a/system.json +++ b/system.json @@ -253,7 +253,7 @@ ], "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "10.1.7", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.7.zip", + "version": "10.1.8", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.8.zip", "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" } \ No newline at end of file