link protection and smite to system effects

This commit is contained in:
Mike Bloy 2023-03-06 22:21:36 -06:00
parent c8a153d514
commit 9607e07fdc
4 changed files with 17 additions and 12 deletions

View File

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Confusion effect macro - Confusion effect macro
### Changed
- Protection and Smite macros now linked to swade system effects
## 0.9.0 ## 0.9.0
- Initial 'public' release - Initial 'public' release

View File

@ -38,6 +38,7 @@ async function createEffect (tokens, choice) {
for (const token of tokens) { for (const token of tokens) {
const mutate = swadeMBHelpers.createMutationWithEffect( const mutate = swadeMBHelpers.createMutationWithEffect(
baseEffect.icon, effectName, 5, changes) baseEffect.icon, effectName, 5, changes)
mutate.embedded.ActiveEffect[effectName].flags.core = { statusId: baseEffect.id }
const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName)
await warpgate.mutate(token.document, mutate, {}, mutateOptions) await warpgate.mutate(token.document, mutate, {}, mutateOptions)
} }

View File

@ -45,7 +45,6 @@ async function main (tokens) {
async function createEffect (tokens, tokenWeapons, choice, greater) { async function createEffect (tokens, tokenWeapons, choice, greater) {
const baseEffect = CONFIG.statusEffects.find(se => se.label === 'SWADE.Smite') const baseEffect = CONFIG.statusEffects.find(se => se.label === 'SWADE.Smite')
const effectIcon = baseEffect.icon const effectIcon = baseEffect.icon
const effectId = baseEffect.id
let changeValue = (choice === 'raise' ? '+4' : '+2') let changeValue = (choice === 'raise' ? '+4' : '+2')
if (greater) { if (greater) {
changeValue = (choice === 'raise' ? '+6' : '+4') changeValue = (choice === 'raise' ? '+6' : '+4')
@ -68,6 +67,7 @@ async function createEffect (tokens, tokenWeapons, choice, greater) {
] ]
const mutate = swadeMBHelpers.createMutationWithEffect( const mutate = swadeMBHelpers.createMutationWithEffect(
effectIcon, effectName, 5, changes) effectIcon, effectName, 5, changes)
mutate.embedded.ActiveEffect[effectName].flags.core = { statusId: baseEffect.id }
const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName)
await warpgate.mutate(token.document, mutate, {}, mutateOptions) await warpgate.mutate(token.document, mutate, {}, mutateOptions)
} }

File diff suppressed because one or more lines are too long