Minor fixes

This commit is contained in:
sladecraven 2022-07-26 22:38:04 +02:00
parent e7f5a17096
commit 40a8406761
8 changed files with 37 additions and 12 deletions

View File

@ -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 );

View File

@ -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
}

View File

@ -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;
}

View File

@ -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"
}

View File

@ -384,6 +384,7 @@
<span class="small-label padd-right packed-left">&nbsp;Current</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}"
data-dtype="Number" />
<a class="current-nrg-minus plus-minus-button">&nbsp;-</a>/<a class="current-nrg-plus plus-minus-button">+</a>
<span class="small-label padd-right packed-left">&nbsp;Mod</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}"
data-dtype="Number" />

View File

@ -30,8 +30,8 @@
{{#if stat}}
<li>Statistic : {{stat.label}}</li>
{{/if}}
{{#if spec}}
<li>Specialisation : {{spec.name}}</li>
{{#if specName}}
<li>Specialisation : {{specName}}</li>
{{/if}}
{{#if weaponName}}

View File

@ -0,0 +1,7 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<div>{{name}} has just activated the Perk: {{perk.name}}.</div>
</div>

View File

@ -3,5 +3,5 @@
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<div>{{name}} has Just Deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div>
<div>{{name}} has just deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div>
</div>