diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 9fe29e1..dc590d5 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -121,6 +121,7 @@ export class PegasusActor extends Actor { this.system.encCapacity = this.getEncumbranceCapacity() this.buildContainerTree() this.updatePPP() + this.updateSize() } if (this.type == 'vehicle') { this.computeVehicleStats(); @@ -375,6 +376,18 @@ export class PegasusActor extends Actor { this.update({ 'system.ppp.spentPPP': ppp }) } } + /* -------------------------------------------- */ + updateSize() { + let sizeBonus = 0 + for(let effect of this.items) { + if (effect.type == "effect" && effect.system.effectlevel > 0 && effect.system.affectsize) { + sizeBonus += effect.system.effectlevel + } + } + if (sizeBonus != this.system.biodata.sizebonus) { + setTimeout(500, this.update( {'system.biodata.sizebonus': sizeBonus}) ) + } + } /* -------------------------------------------- */ async activatePower(itemId) { diff --git a/system.json b/system.json index 4b96e1e..2f80d9e 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.0.21", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.21.zip", + "version": "10.0.22", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.22.zip", "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index 82effbc..650fdae 100644 --- a/template.json +++ b/template.json @@ -11,6 +11,7 @@ "age": 0, "size": "", "sizenum": 0, + "sizebonus": 0, "weight": "", "hair": "", "sex": "", @@ -401,6 +402,7 @@ "recoveryrollspec": [], "effectstatlevel": false, "effectstat": "", + "affectsize": false, "oneuse": false, "ignorehealthpenalty": false, "isthispossible": "", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 2350b67..796b1b1 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -865,6 +865,8 @@ +