Sync effetcts + initiative

This commit is contained in:
sladecraven 2022-01-28 22:14:13 +01:00
parent c302163bef
commit 76b4e39e94
5 changed files with 66 additions and 50 deletions

View File

@ -47,6 +47,7 @@ export class PegasusActorSheet extends ActorSheet {
armors: this.actor.checkAndPrepareArmors( duplicate(this.actor.getArmors())),
shields: duplicate(this.actor.getShields()),
equipments: duplicate(this.actor.getEquipments()),
equipments: duplicate(this.actor.getEquipmentsOnly()),
perks: duplicate(this.actor.getPerks()),
abilities: duplicate(this.actor.getAbilities()),
activePerks: duplicate(this.actor.getActivePerks()),

View File

@ -729,30 +729,6 @@ export class PegasusActor extends Actor {
}
}
/* -------------------------------------------- */
async rollWeapon(weaponId, damage = false) {
let weapon = this.data.items.get(weaponId)
if (weapon) {
weapon = duplicate(weapon)
this.checkAndPrepareWeapon(weapon)
let rollData = this.getCommonRollData(weapon.data.statistic)
rollData.mode = "weapon"
rollData.weapon = weapon
rollData.title = `Weapon : ${weapon.name}`
if (damage) {
rollData.stat = this.getStat(weapon.data.damagestatistic)
rollData.isDamage = true;
rollData.otherDicesLevel = weapon.data.damage
}
this.startRoll(rollData);
} else {
ui.notifications.warn("Weapon not found !", weaponId);
}
}
/* -------------------------------------------- */
async rollPower(powerId) {
let power = this.data.items.get(powerId)

View File

@ -120,11 +120,17 @@ export class PegasusRollDialog extends Dialog {
manageWeapons( weaponIdx, toggled) {
let weapon = this.rollData.weaponsList[weaponIdx]
if (weapon) {
if (toggled) {
this.rollData.weaponName = weapon.weapon.name
} else {
this.rollData.weaponName = undefined
}
weapon.applied = toggled
if (weapon.type == 'damage' || weapon.type == 'enhanced' ) {
if (toggled) {
this.rollData.otherDicesLevel += Number(weapon.value)
} else {
this.rollData.weaponName = undefined
this.rollData.otherDicesLevel -= Number(weapon.value)
this.rollData.otherDicesLevel = (this.rollData.otherDicesLevel<0) ? 0 : this.rollData.otherDicesLevel
}

View File

@ -192,7 +192,7 @@
</ul>
<span class="generic-label">
<h3>Basic Actions</h3>
<h3>Combat Dice Pools</h3>
</span>
<ul class="stat-list alternate-list">
<li class="item stat flexrow list-item">
@ -202,7 +202,7 @@
</li>
<li class="item stat flexrow list-item">
<span class="generic-label"><a class="damage-melee"><button class="chat-card-button">Melee/Thrown Damage</button></a></span>
<span class="generic-label"><a class="defense-roll"><button class="chat-card-button">Defense</button></a></span>
<span class="generic-label"><a class="defense-roll"><button class="chat-card-button">Defence</button></a></span>
<span class="generic-label"><a class="damage-resistance"><button class="chat-card-button">Damage Resistance</button></a></span>
</li>
<li class="item stat flexrow list-item">
@ -326,15 +326,6 @@
<h4>Money</h4>
</div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item">
<span class="equipement-label">Name</span>
<span class="equipement-label">Quantity</span>
<div class="item-controls">
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
</div>
</li>
{{#each moneys as |money key|}}
<li class="item flexrow list-item" data-item-id="{{money._id}}">
<img class="sheet-competence-img" src="{{money.img}}" />
@ -351,27 +342,17 @@
{{/each}}
</ul>
<hr>
<div>
<h4>Equipment</h4>
</div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item">
<span class="equipement-label">Name</span>
<span class="equipement-label">Type</span>
<div class="item-controls">
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
</div>
</li>
{{#each equipments as |equip key|}}
<li class="item flexrow list-item" data-item-id="{{equip._id}}">
<img class="sheet-competence-img" src="{{equip.img}}" />
<span class="equipement-label">{{equip.name}}</span>
<span class="equipement-label">{{upperFirst equip.type}}</span>
{{#if (eq equip.type "equipment")}}
<span class="equipement-label">{{upperFirst equip.data.type}}</span>
<span class="generic-label">Qty {{equip.data.quantity}}</span>
{{/if}}
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if equip.data.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
@ -381,6 +362,57 @@
</li>
{{/each}}
</ul>
<hr>
<div>
<h4>Weapons</h4>
</div>
<ul class="item-list alternate-list">
{{#each weapons as |weapon key|}}
<li class="item flexrow list-item" data-item-id="{{weapon._id}}">
<img class="sheet-competence-img" src="{{weapon.img}}" />
<span class="equipement-label">{{weapon.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if weapon.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>
<hr>
<div>
<h4>Armors & Shields</h4>
</div>
<ul class="item-list alternate-list">
{{#each armors as |armor key|}}
<li class="item flexrow list-item" data-item-id="{{armor._id}}">
<img class="sheet-competence-img" src="{{armor.img}}" />
<span class="equipement-label">{{armor.name}}</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}}
{{#each shields as |shield key|}}
<li class="item flexrow list-item" data-item-id="{{shield._id}}">
<img class="sheet-competence-img" src="{{shield.img}}" />
<span class="equipement-label">{{shield.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if shield.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>
{{!-- Biography Tab --}}

View File

@ -18,9 +18,6 @@
<div>
<ul>
{{#if weapon}}
<li>Weapon : {{weapon.name}}</li>
{{/if}}
{{#if power}}
<li>Power : {{power.name}}</li>
{{/if}}
@ -37,6 +34,10 @@
<li>Specialisation : {{spec.name}}</li>
{{/if}}
{{#if weaponName}}
<li>Weapon : {{weaponName}}</li>
{{/if}}
{{#if isResistance}}
<li><strong>Defense Result : {{finalScore}}</strong>
{{else}}