diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index dfc142f..2924207 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1344,6 +1344,7 @@ export class PegasusActor extends Actor { this.getTraumaState() this.cleanupPerksIfTrauma() this.parseStatEffects() + this.parseStatusEffects() } } @@ -1365,6 +1366,37 @@ export class PegasusActor extends Actor { } } + /* -------------------------------------------- */ + parseStatusEffects() { + let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && (Number(effect.system.effectlevel) > 0) ) + for (let statusKey in this.system.secondary) { + let status = duplicate(this.system.secondary[statusKey]) + let bonus = 0 + for (let effect of effects) { + if ( effect.system.affectedstatus && effect.system.affectedstatus == statusKey) { + bonus += Number(effect.system.effectlevel) + } + } + if ( bonus != status.bonus) { + status.bonus = bonus + this.update( { [`system.secondary.${statusKey}`]: status} ) + } + } + + let nrg = duplicate(this.system.nrg) + let bonus = 0 + for (let effect of effects) { + if ( effect.system.affectedstatus && effect.system.affectedstatus == "nrg") { + bonus += Number(effect.system.effectlevel) + } + } + if ( bonus != nrg.mod) { + nrg.mod = bonus + this.update( { [`system.nrg`]: nrg} ) + } + + } + /* -------------------------------------------- */ async modStat(key, inc = 1) { let stat = duplicate(this.system.statistics[key]) diff --git a/system.json b/system.json index 5dba0e4..a94ae06 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.26", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.26.zip", + "version": "10.0.28", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.28.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 55011ee..14390af 100644 --- a/template.json +++ b/template.json @@ -413,6 +413,9 @@ "physicalimmunity": false, "nobonusdice": false, "noperksallowed": false, + "affectstatus": false, + "affectedstatus": "", + "locked": false, "description": "" }, "race": { diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 796b1b1..4c1ac27 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -302,18 +302,30 @@ {{#each effects as |effect key|}} -
  • - +
  • + {{#if effect.system.locked}} + {{#if @root.isGM}} + + {{else}} + + {{/if}} + {{else}} + + {{/if}} {{effect.name}} {{effect.system.effectlevel}} {{upperFirst effect.system.type}} - {{upperFirst effect.datsystema.genre}} + {{upperFirst effect.system.genre}} {{upper effect.system.stataffected}}
     
    - + {{#if effect.system.locked}} + {{#if @root.isGM}} + + {{/if}} + {{else}} + + {{/if}}
  • {{/each}} diff --git a/templates/item-effect-sheet.html b/templates/item-effect-sheet.html index 46a471d..e923e66 100644 --- a/templates/item-effect-sheet.html +++ b/templates/item-effect-sheet.html @@ -61,11 +61,13 @@
  • +
  • + +
  • - {{#if data.effectstatlevel}}
  • {{/if}} - + +
  • + +
  • + {{#if data.affectstatus}} +
  • + +
  • + {{/if}} +