Add exchangee stuff
This commit is contained in:
@ -554,6 +554,34 @@ export class CrucibleActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollDefenseMelee(attackRollData) {
|
||||
let weapon = this.data.items.get(attackRollData.defenseWeaponId)
|
||||
if (weapon) {
|
||||
weapon = duplicate(weapon)
|
||||
let skill = this.data.items.find(item => item.name.toLowerCase() == weapon.data.skill.toLowerCase())
|
||||
if (skill) {
|
||||
skill = duplicate(skill)
|
||||
CrucibleUtility.updateSkill(skill)
|
||||
let abilityKey = skill.data.ability
|
||||
let rollData = this.getCommonRollData(abilityKey)
|
||||
rollData.defenderTokenId = undefined // Cleanup
|
||||
rollData.mode = "weapondefense"
|
||||
rollData.shield = this.getEquippedShield()
|
||||
rollData.attackRollData = duplicate(attackRollData)
|
||||
rollData.skill = skill
|
||||
rollData.weapon = weapon
|
||||
rollData.img = weapon.img
|
||||
|
||||
this.startRoll(rollData)
|
||||
} else {
|
||||
ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name)
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Weapon not found ! ")
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollShieldDie() {
|
||||
let shield = this.getEquippedShield()
|
||||
|
Reference in New Issue
Block a user