add deflection to supported powers
This commit is contained in:
parent
e4cf396b43
commit
da25549c09
@ -190,6 +190,21 @@ const PowerMenus = {
|
||||
{ label: 'Cancel', value: 'cancel' }
|
||||
]
|
||||
return { menuOptions, menuData, extra: {} }
|
||||
},
|
||||
|
||||
deflection: function (token, targets) {
|
||||
if (targets.length < 1) {
|
||||
shim.notifications.error('No target selected for Deflection')
|
||||
return null
|
||||
}
|
||||
const { menuOptions, menuData } = baseMenu('Deflection', targets)
|
||||
menuData.buttons = [
|
||||
{ label: 'Melee', value: 'melee' },
|
||||
{ label: 'Ranged', value: 'ranged' },
|
||||
{ label: 'Raise (both)', value: 'raise' },
|
||||
{ label: 'Cancel', value: 'cancel' }
|
||||
]
|
||||
return { menuOptions, menuData, extra: {} }
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,6 +296,16 @@ const PowerHandlers = {
|
||||
for (const target of targets) {
|
||||
shim.applyActiveEffects(target, effectDocs)
|
||||
}
|
||||
},
|
||||
|
||||
deflection: async function (token, targets, buttons, inputs, extra) {
|
||||
const { effectDocs } = globalModifierEffects(inputs, 'Confusion', 1)
|
||||
const effectName = `Deflection (${buttons === 'raise' ? 'all' : buttons})`
|
||||
const icon = 'icons/magic/defensive/shield-barrier-deflect-teal.webp'
|
||||
effectDocs.push(shim.createEffectDocument(icon, effectName, 5))
|
||||
for (const target of targets) {
|
||||
shim.applyActiveEffects(target, effectDocs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user