Sync effetcts + initiative
This commit is contained in:
parent
c9261a713a
commit
a4ead72808
@ -350,6 +350,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeNRGHealth() {
|
||||
if ( this.isToken) return
|
||||
if (this.isOwner || game.user.isGM) {
|
||||
let updates = {}
|
||||
let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod;
|
||||
@ -521,15 +522,6 @@ export class PegasusActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', newItems)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getShieldValue() {
|
||||
let shields = this.data.items.filter(item => item.type == "shield" && item.data.data.equipped)
|
||||
let def = 0
|
||||
for (let sh of shields) {
|
||||
def += sh.data.data.level
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addHindrancesList( effectsList ) {
|
||||
@ -562,15 +554,18 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
addArmorsShields( rollData, useShield = false) {
|
||||
let armors = this.getArmors()
|
||||
let armorLevel = 0
|
||||
for (let armor of armors) {
|
||||
armorLevel += armor.data.resistance
|
||||
addArmorsShields( rollData, statKey = "none", useShield = false) {
|
||||
if (statKey == 'phy') {
|
||||
let armors = this.getArmors()
|
||||
for (let armor of armors) {
|
||||
rollData.armorsList.push( {label: `Armor ${armor.name}`, type: "other", applied: false, value: armor.data.resistance } )
|
||||
}
|
||||
}
|
||||
rollData.armorsList.push( {label: 'Total armor level', type: "other", applied: false, value: armorLevel } )
|
||||
if (useShield ) {
|
||||
rollData.armorsList.push( {label: 'Shield level', type: "other", applied: false, value: this.getShieldValue() } )
|
||||
let shields = this.data.items.filter(item => item.type == "shield" && item.data.data.equipped)
|
||||
for (let sh of shields) {
|
||||
rollData.armorsList.push( {label: `Shield ${sh.name}`, type: "other", applied: false, value: sh.data.data.level } )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -593,7 +588,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
|
||||
this.addEffects( rollData)
|
||||
this.addArmorsShields(rollData, useShield)
|
||||
this.addArmorsShields(rollData, statKey, useShield)
|
||||
|
||||
return rollData
|
||||
}
|
||||
|
@ -183,6 +183,6 @@
|
||||
"templateVersion": 63,
|
||||
"title": "Pegasus RPG",
|
||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.3",
|
||||
"background" : "./images/ui/pegasus_welcome_page.webp"
|
||||
}
|
||||
|
@ -295,24 +295,6 @@
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<span class="generic-label">
|
||||
<h3>Armor</h3>
|
||||
</span>
|
||||
<ul class="item-list alternate-list">
|
||||
{{#each armors as |armor key|}}
|
||||
<li class="item stat flexrow list-item" data-item-id="{{armor._id}}">
|
||||
<img class="sheet-competence-img" src="{{armor.img}}" />
|
||||
<span class="stat-label outfit-label"><a class="armor-roll">{{armor.name}}</a></span>
|
||||
<span class="stat-label outfit-label">Res. {{armor.data.resistanceDice}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-equip" title="Worn">{{#if armor.data.equipped}}<i
|
||||
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,40 +1,40 @@
|
||||
<ul>
|
||||
{{#each effectsList as |effect idx|}}
|
||||
|
||||
{{#if (eq effect.effect.data.stataffected "all")}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
{{#if effect.effect}}
|
||||
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
|
||||
{{else}}
|
||||
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq @root.statKey effect.effect.data.stataffected)}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
{{#if effect.effect}}
|
||||
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
|
||||
{{else}}
|
||||
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if effect.effect.data.hindrance}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
<label class="generic-label">Target Hindrance : {{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq type "hindrance")}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
<label class="generic-label">Target Hindrance : {{effect.label}} ({{effect.value}})</label>
|
||||
</li>
|
||||
{{else}}
|
||||
{{#if (eq type "hindrance")}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
<label class="generic-label">Target Hindrance : {{effect.label}} ({{effect.value}})</label>
|
||||
</li>
|
||||
{{else}}
|
||||
{{#if (eq @root.statKey effect.effect.data.stataffected)}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
{{#if effect.effect}}
|
||||
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
|
||||
{{else}}
|
||||
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{else}}
|
||||
{{#if (eq effect.effect.data.stataffected "all")}}
|
||||
<li class="flex-group-left">
|
||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||
{{#if effect.effect}}
|
||||
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
|
||||
{{else}}
|
||||
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{/each}}
|
||||
|
Loading…
Reference in New Issue
Block a user