diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index bf06954..e52fd42 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -203,12 +203,18 @@ export class PegasusActorSheet extends ActorSheet { html.find('.quantity-minus').click(event => { const li = $(event.currentTarget).parents(".item"); this.actor.incDecQuantity( li.data("item-id"), -1 ); - } ); + } ) html.find('.quantity-plus').click(event => { const li = $(event.currentTarget).parents(".item"); this.actor.incDecQuantity( li.data("item-id"), +1 ); - } ); - + } ) + html.find('.current-nrg-minus').click(event => { + this.actor.incDecNRG( -1 ); + } ) + html.find('.current-nrg-plus').click(event => { + this.actor.incDecNRG( 1 ); + } ) + html.find('.ammo-minus').click(event => { const li = $(event.currentTarget).parents(".item") this.actor.incDecAmmo( li.data("item-id"), -1 ); diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 1fa4ac9..34e2eab 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -820,6 +820,15 @@ export class PegasusActor extends Actor { } } + /* -------------------------------------------- */ + incDecNRG( value) { + let nrg = duplicate(this.data.data.nrg) + nrg.value += value + if (nrg.value >= 0 && nrg.value <= nrg.max) { + this.update({ 'data.nrg': nrg }) + } + } + /* -------------------------------------------- */ async updatePerkStatus(itemId, status) { let item = this.items.get(itemId) @@ -871,8 +880,7 @@ export class PegasusActor extends Actor { this.disableWeaverPerk(item) PegasusUtility.createChatWithRollMode(item.name, { content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: item }) - }); - + }) } if (status == "activated") { // Add effects linked to the perk @@ -916,6 +924,9 @@ export class PegasusActor extends Actor { nrg.max += Number(item.data.data.features.bonusnrg.value) || 0 await this.update({ 'data.nrg': nrg }) } + PegasusUtility.createChatWithRollMode(item.name, { + content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-activated.html`, { name: this.name, perk: item }) + }) this.enableWeaverPerk(item) } if (updateOK) { @@ -1029,8 +1040,7 @@ export class PegasusActor extends Actor { } - let moralitythreshold = Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod) - moralitythreshold = (moralitythreshold < 1) ? 1 : moralitythreshold; + let moralitythreshold = - (Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod) ) if (moralitythreshold != this.data.data.biodata.moralitythreshold) { updates['data.biodata.moralitythreshold'] = moralitythreshold } diff --git a/styles/simple.css b/styles/simple.css index aabbb79..f23384b 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1164,7 +1164,7 @@ ul, li { box-shadow: inset 0px 1px 0px 0px #a6827e; background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background-color: #7d5d3b00; - border-radius: 2px; + border-radius: 4px; border: 1px ridge #846109; display: inline-block; cursor: pointer; @@ -1174,6 +1174,7 @@ ul, li { text-decoration: none; text-shadow: 0px 1px 0px #4d3534; position: relative; + max-width:16px; margin:0px; } diff --git a/system.json b/system.json index 4d42eba..b20056b 100644 --- a/system.json +++ b/system.json @@ -183,6 +183,6 @@ "templateVersion": 96, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.6.3", + "version": "0.6.4", "background" : "./images/ui/pegasus_welcome_page.webp" } diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index c80920f..2e1bb88 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -384,6 +384,7 @@  Current +  -/+  Mod diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index ac0f288..655f2d1 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -30,8 +30,8 @@ {{#if stat}}
  • Statistic : {{stat.label}}
  • {{/if}} - {{#if spec}} -
  • Specialisation : {{spec.name}}
  • + {{#if specName}} +
  • Specialisation : {{specName}}
  • {{/if}} {{#if weaponName}} diff --git a/templates/chat-perk-activated.html b/templates/chat-perk-activated.html new file mode 100644 index 0000000..765275d --- /dev/null +++ b/templates/chat-perk-activated.html @@ -0,0 +1,7 @@ +
    +

    {{name}}

    + {{#if img}} + + {{/if}} +
    {{name}} has just activated the Perk: {{perk.name}}.
    +
    diff --git a/templates/chat-perk-ready.html b/templates/chat-perk-ready.html index 8925b2a..432481f 100644 --- a/templates/chat-perk-ready.html +++ b/templates/chat-perk-ready.html @@ -3,5 +3,5 @@ {{#if img}} {{/if}} -
    {{name}} has Just Deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.
    +
    {{name}} has just deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.