From 7d6408f6b76075c6c54bb01207e6a712bed15bf8 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Mon, 18 Sep 2023 18:03:00 +0200 Subject: [PATCH] MDL/ADRL fixes + MR fixes --- modules/pegasus-actor.js | 15 +++++++++------ system.json | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 5a06e9a..9e4c2c9 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1467,7 +1467,7 @@ export class PegasusActor extends Actor { updates['system.momentum.max'] = momentum } - let mrLevel = (this.system.statistics.agi.value + + this.system.statistics.agi.mod + this.system.statistics.str.value + this.system.statistics.str.mod) - (this.system.statistics.phy.value+this.system.statistics.phy.mod) + let mrLevel = (this.system.statistics.agi.value + this.system.statistics.agi.mod + this.system.statistics.str.value + this.system.statistics.str.mod) - (this.system.statistics.phy.value+this.system.statistics.phy.mod) mrLevel = (mrLevel < 1) ? 1 : mrLevel; if (mrLevel != this.system.mr.value) { updates['system.mr.value'] = mrLevel @@ -1573,10 +1573,11 @@ export class PegasusActor extends Actor { for (let e of effects) { meleeBonus += Number(e.system.effectlevel) } - this.baseMDL = this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + this.system.statistics.str.bonuseffect + meleeBonus + this.baseMDL = this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + + this.system.statistics.str.mod + this.system.statistics.str.bonuseffect + meleeBonus let weaponsMelee = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "str") for (let w of weaponsMelee) { - let damage = Number(w.system.damage) + this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + this.system.statistics.str.bonuseffect + meleeBonus + let damage = this.baseMDL + Number(w.system.damage) if (damage != w.system.mdl) { updates.push({ _id: w.id, "system.mdl": damage }) } @@ -1590,9 +1591,10 @@ export class PegasusActor extends Actor { if (role?.name?.toLowerCase() == "ranged") { // Add ranged bonus to ADRL roleBonus = this.getRoleLevel() } + this.baseRDL = roleBonus + rangedBonus let weaponsRanged = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "pre") for (let w of weaponsRanged) { - let damage = roleBonus + Number(w.system.damage) + rangedBonus + let damage = this.baseRDL + Number(w.system.damage) if (damage != w.system.rdl) { updates.push({ _id: w.id, "system.rdl": damage }) } @@ -1607,10 +1609,11 @@ export class PegasusActor extends Actor { if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL roleBonus = this.getRoleLevel() } - this.baseADRL = roleBonus + this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus + this.baseADRL = roleBonus + armorBonus + this.system.statistics.phy.value + this.system.statistics.phy.mod + + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus let armors = this.items.filter(it => it.type == "armor") for (let a of armors) { - let adrl = roleBonus + this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus + a.system.resistance + armorBonus + let adrl = this.baseADRL + a.system.resistance if (adrl != a.system.adrl) { updates.push({ _id: a.id, "system.adrl": adrl }) } diff --git a/system.json b/system.json index 6f9365c..3f9b0d8 100644 --- a/system.json +++ b/system.json @@ -252,7 +252,7 @@ ], "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "11.0.17", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.17.zip", + "version": "11.0.18", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.18.zip", "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" } \ No newline at end of file