Actor/Crew rolls
This commit is contained in:
@ -118,6 +118,21 @@ export class PegasusRollDialog extends Dialog {
|
||||
PegasusUtility.updateDamageDicePool(this.rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
manageVehicleWeapon( weaponIdx, toggled) {
|
||||
let weapon = this.rollData.vehicleWeapons[weaponIdx]
|
||||
if (weapon) {
|
||||
this.rollData.weapon = duplicate(weapon)
|
||||
if (toggled) {
|
||||
this.rollData.weaponName = weapon.weapon.name
|
||||
} else {
|
||||
this.rollData.weaponName = undefined
|
||||
}
|
||||
weapon.applied = toggled
|
||||
}
|
||||
PegasusUtility.updateDamageDicePool(this.rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
manageEquip(equipIdx, toggled) {
|
||||
let equip = this.rollData.equipmentsList[equipIdx]
|
||||
@ -216,6 +231,12 @@ export class PegasusRollDialog extends Dialog {
|
||||
let equipIdx = $(event.currentTarget).data("equip-idx")
|
||||
this.manageEquip(equipIdx, toggled)
|
||||
})
|
||||
html.find('.vehicle-weapon-clicked').change((event) => {
|
||||
let toggled = event.currentTarget.checked
|
||||
let weaponIdx = $(event.currentTarget).data("vehicle-weapon-idx")
|
||||
this.manageVehicleWeapon(weaponIdx, toggled)
|
||||
this.refreshDialog()
|
||||
})
|
||||
|
||||
html.find('.pool-add-dice').click(async (event) => {
|
||||
let diceKey = $(event.currentTarget).data("dice-key")
|
||||
|
Reference in New Issue
Block a user