Sync effetcts + initiative

This commit is contained in:
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
}