Minor fixes
This commit is contained in:
parent
44707a6397
commit
dd0d40efc8
@ -488,16 +488,16 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getShieldDice() {
|
getShieldDice() {
|
||||||
let shields = this.data.items.filter( item => item.type == "shield" && item.data.data.equipped)
|
let shields = this.data.items.filter(item => item.type == "shield" && item.data.data.equipped)
|
||||||
let def = 0
|
let def = 0
|
||||||
for ( let sh of shields) {
|
for (let sh of shields) {
|
||||||
def += sh.data.data.level
|
def += sh.data.data.level
|
||||||
}
|
}
|
||||||
return def
|
return def
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
rollPool(statKey, useShield=false) {
|
rollPool(statKey, useShield = false) {
|
||||||
let stat = this.getStat(statKey);
|
let stat = this.getStat(statKey);
|
||||||
if (stat) {
|
if (stat) {
|
||||||
let rollData = this.getCommonRollData()
|
let rollData = this.getCommonRollData()
|
||||||
@ -596,7 +596,7 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async computeNRGHealth() {
|
async computeNRGHealth() {
|
||||||
if ( this.isOwner || game.user.isGM) {
|
if (this.isOwner || game.user.isGM) {
|
||||||
let updates = {}
|
let updates = {}
|
||||||
let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod;
|
let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod;
|
||||||
if (phyDiceValue != this.data.data.secondary.health.max) {
|
if (phyDiceValue != this.data.data.secondary.health.max) {
|
||||||
@ -632,16 +632,22 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
let momentum = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod
|
let momentum = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod
|
||||||
if (momentum != this.data.data.momentum.max) {
|
if (momentum != this.data.data.momentum.max) {
|
||||||
updates['data.momentum.value'] = momentum
|
updates['data.momentum.value'] = 0
|
||||||
updates['data.momentum.max'] = momentum
|
updates['data.momentum.max'] = momentum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mrLevel = (this.data.data.statistics.agi.value + this.data.data.statistics.str.value) - this.data.data.statistics.phy.value
|
||||||
|
mrLevel = (mrLevel < 1) ? 1 : mrLevel;
|
||||||
|
if (mrLevel != this.data.data.mr.value) {
|
||||||
|
updates['data.mr.value'] = mrLevel
|
||||||
|
}
|
||||||
|
|
||||||
let race = this.getRace()
|
let race = this.getRace()
|
||||||
if ( race && race.name && (race.name != this.data.data.biodata.racename) ) {
|
if (race && race.name && (race.name != this.data.data.biodata.racename)) {
|
||||||
updates['data.biodata.racename'] = race.name
|
updates['data.biodata.racename'] = race.name
|
||||||
}
|
}
|
||||||
let role = this.getRole()
|
let role = this.getRole()
|
||||||
if ( role && role.name && (role.name != this.data.data.biodata.rolename)) {
|
if (role && role.name && (role.name != this.data.data.biodata.rolename)) {
|
||||||
updates['data.biodata.rolename'] = role.name
|
updates['data.biodata.rolename'] = role.name
|
||||||
}
|
}
|
||||||
//console.log("UPD", updates, this.data.data.biodata)
|
//console.log("UPD", updates, this.data.data.biodata)
|
||||||
|
@ -41,7 +41,6 @@ export class PegasusRollDialog extends Dialog {
|
|||||||
label: "Cancel",
|
label: "Cancel",
|
||||||
callback: () => { this.close() }
|
callback: () => { this.close() }
|
||||||
} },
|
} },
|
||||||
default: "roll",
|
|
||||||
close: close
|
close: close
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +163,6 @@
|
|||||||
"templateVersion": 63,
|
"templateVersion": 63,
|
||||||
"title": "Pegasus RPG",
|
"title": "Pegasus RPG",
|
||||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||||
"version": "0.1.12",
|
"version": "0.1.13",
|
||||||
"background" : "./images/ui/pegasus_welcome_page.webp"
|
"background" : "./images/ui/pegasus_welcome_page.webp"
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
<li class="item flexrow list-item" data-key="nrg">
|
<li class="item flexrow list-item" data-key="nrg">
|
||||||
<span class="stat-label flexrow" name="nrg"> <h4>{{data.nrg.label}}</h4> </span>
|
<span class="stat-label flexrow" name="nrg"> <h4>{{data.nrg.label}}</h4> </span>
|
||||||
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right" name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right" name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Val</span><input type="text" class="padd-right" name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Cur</span><input type="text" class="padd-right" name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right" name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right" name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right" name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right" name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
@ -169,7 +169,7 @@
|
|||||||
<li class="item flexrow list-item" data-key="nrg">
|
<li class="item flexrow list-item" data-key="nrg">
|
||||||
<span class="stat-label flexrow" name="nrg"><h4>{{data.nrg.label}}</h4> </span>
|
<span class="stat-label flexrow" name="nrg"><h4>{{data.nrg.label}}</h4> </span>
|
||||||
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Val</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<span class="stat-label flexrow" name="{{key}}">
|
<span class="stat-label flexrow" name="{{key}}">
|
||||||
<h4>{{stat2.label}}</h4>
|
<h4>{{stat2.label}}</h4>
|
||||||
</span>
|
</span>
|
||||||
<span class="small-label padd-right packed-left">Val</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Bonus</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Bonus</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
@ -187,7 +187,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
<li class="item flexrow list-item" data-key="momentum">
|
<li class="item flexrow list-item" data-key="momentum">
|
||||||
<span class="stat-label flexrow" name="momentum"><h4>{{data.momentum.label}}</h4></span>
|
<span class="stat-label flexrow" name="momentum"><h4>{{data.momentum.label}}</h4></span>
|
||||||
<span class="small-label padd-right packed-left">Val</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.value" value="{{data.momentum.value}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.value" value="{{data.momentum.value}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.max" value="{{data.momentum.max}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.max" value="{{data.momentum.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -326,7 +326,7 @@
|
|||||||
<li class="item flexrow list-item" data-key="nrg">
|
<li class="item flexrow list-item" data-key="nrg">
|
||||||
<span class="stat-label flexrow" name="nrg"><h4>{{data.nrg.label}}</h4> </span>
|
<span class="stat-label flexrow" name="nrg"><h4>{{data.nrg.label}}</h4> </span>
|
||||||
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left">Act</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Val</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Cur</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Mod</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
||||||
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
<span class="small-label padd-right packed-left"> Max</span><input type="text" class="padd-right update-field" data-field-name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user