diff --git a/CHANGELOG.md b/CHANGELOG.md index 466fcdd..6bb8b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- New macro: Quick Damage Roll - New Vision mode: Low Light Vision - Power Effect for Zombie - Sample fixed request roll macro diff --git a/macros/blind.js b/macros/blind.js deleted file mode 100644 index 30ad41e..0000000 --- a/macros/blind.js +++ /dev/null @@ -1,45 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Blind', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Blind' }, - { type: 'info', label: `Apply Blind to ${tokenList}` }, - { type: 'checkbox', label: 'Strong', options: false } - ], - buttons: [ - { label: 'Apply', value: 'apply' }, - { label: 'Raise', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - if (buttons && buttons !== 'cancel') { - const options = { - raise: (buttons === 'raise'), - strong: (!!inputs[2]) - } - await createEffect(tokens, options) - } -} - -async function createEffect (tokens, options) { - const effectDetails = (options.raise ? '-4' : '-2') - const effectEnd = (options.strong ? 'Vigor -2' : 'Vigor') - const effectName = `Blind (${effectDetails}) ${effectEnd} ends` - const baseEffect = CONFIG.statusEffects.find(se => se.label === 'EFFECT.StatusBlind') - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(baseEffect.icon, effectName, 1, []) - mutate.embedded.ActiveEffect[effectName].flags.core = { statusId: baseEffect.id } - const mutateOptions = swadeMBHelpers.defaultMutationOptions('Blind') - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/boost-lower-trait.js b/macros/boost-lower-trait.js deleted file mode 100644 index 98c1643..0000000 --- a/macros/boost-lower-trait.js +++ /dev/null @@ -1,133 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - let traitOptions = [ - 'Agility', 'Smarts', 'Spirit', 'Strength', 'Vigor' - ] - const allSkills = [] - const traits = {} - for (const traitName of traitOptions) { - const lower = traitName.toLowerCase() - traits[traitName] = { - name: traitName, - type: 'attribute', - modkey: `system.attributes.${lower}.die.modifier`, - diekey: `system.attributes.${lower}.die.sides` - } - } - - const tokenList = tokens.map(t => t.name).join(', ') - for (const token of tokens) { - const skills = token.actor.items.filter(item => item.type === 'skill') - for (const skill of skills) { - const name = skill.name - traits[name] = { - type: 'skill', - name, - modkey: `@Skill{${name}}[system.die.modifier]`, - diekey: `@Skill{${name}}[system.die.sides]` - } - if (name !== 'Unskilled' && !allSkills.find(v => v === name)) { - allSkills.push(name) - } - } - } - traitOptions = traitOptions.concat(allSkills.sort()) - - const menuOptions = { - title: 'Boost/Lower Trait', - defaultButton: 'Cancel', - options: {} - } - const menuData = { - inputs: [ - { type: 'header', label: 'Boost/Lower Trait' }, - { type: 'info', label: `Affected Tokens ${tokenList}` }, - { type: 'select', label: 'Trait', options: traitOptions }, - { type: 'info', label: 'Boost or Lower?' }, - { type: 'radio', label: 'Boost', options: ['isBoost', true] }, - { type: 'radio', label: 'Lower', options: ['isBoost', false] }, - { type: 'checkbox', label: 'Greater', options: false }, - { type: 'checkbox', label: 'Strong (lower only)', options: false } - ], - buttons: [ - { label: 'Apply', value: 'apply' }, - { label: 'Apply with raise', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - if (buttons && buttons !== 'cancel') { - const options = { - action: buttons, - name: inputs[2], - trait: traits[inputs[2]], - direction: inputs[4] || inputs[5], - greater: inputs[6], - strong: inputs[7] - } - createEffect(tokens, options) - } -} - -const UPICON = 'icons/magic/life/cross-embers-glow-yellow-purple.webp' -const DOWNICON = 'icons/magic/movement/chevrons-down-yellow.webp' - -async function createEffect (tokens, options) { - const raise = (options.action === 'raise') - const icon = (options.direction === 'Boost' ? UPICON : DOWNICON) - let namePart = `${options.direction} ${options.trait.name}` - const mode = CONST.ACTIVE_EFFECT_MODES.ADD - const mods = [] - if (options.strong && options.direction === 'Lower') { - mods.push('strong') - } - if (options.greater) { - mods.push('greater') - } - if (mods.length > 0) { - namePart = `${namePart} (${mods.join(', ')})` - } - const minorEffect = swadeMBHelpers.createEffectDocument( - icon, `minor ${namePart}`, 5, [ - { - key: options.trait.diekey, - mode, - value: (options.direction === 'Boost' ? '+2' : '-2'), - priority: 0 - } - ] - ) - const majorEffect = swadeMBHelpers.createEffectDocument( - icon, `major ${namePart}`, 5, [ - { - key: options.trait.diekey, - mode, - value: (options.direction === 'Boost' ? '+2' : '-2'), - priority: 0 - } - ] - ) - if (options.direction === 'Lower' && options.greater === 'Greater') { - minorEffect.changes.push({ - key: options.trait.modkey, - mode, - value: '-2', - priority: 0 - }) - } - const mutate = { - embedded: { - ActiveEffect: { - } - } - } - mutate.embedded.ActiveEffect[minorEffect.id] = minorEffect - if (raise) { - mutate.embedded.ActiveEffect[majorEffect.id] = majorEffect - } - const mutateOptions = swadeMBHelpers.defaultMutationOptions(namePart) - for (const token of tokens) { - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/confusion.js b/macros/confusion.js deleted file mode 100644 index a60049c..0000000 --- a/macros/confusion.js +++ /dev/null @@ -1,62 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Confusion', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Confusion' }, - { type: 'info', label: `Apply Confusion to ${tokenList}` }, - { type: 'checkbox', label: 'Greater (adds shaken)', options: false } - ], - buttons: [ - { label: 'Distracted', value: 'distracted' }, - { label: 'Vulnerable', value: 'vulnerable' }, - { label: 'Raise (both)', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - const greater = (inputs[2] === 'Greater (adds shaken)') - if (buttons && buttons !== 'cancel') { - await createEffect(tokens, buttons, greater) - } -} - -function getStatus (label, name) { - const effect = JSON.parse(JSON.stringify( - CONFIG.statusEffects.find(se => se.label === label))) - effect.label = name - effect.flags.core = { statusId: effect.id } - effect.id = name - return effect -} - -async function createEffect (tokens, choice, greater) { - const effects = [] - if (choice === 'distracted' || choice === 'raise') { - effects.push(getStatus('SWADE.Distr', 'Distracted')) - } - if (choice === 'vulnerable' || choice === 'raise') { - effects.push(getStatus('SWADE.Vuln', 'Vulnerable')) - } - if (greater) { - effects.push(getStatus('SWADE.Shaken', 'Shaken')) - } - for (const token of tokens) { - const mutateOptions = swadeMBHelpers.defaultMutationOptions('Confusion') - const mutate = { - embedded: { ActiveEffect: {} } - } - for (const effect of effects) { - mutate.embedded.ActiveEffect[effect.id] = effect - } - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/deflection.js b/macros/deflection.js deleted file mode 100644 index 630ca28..0000000 --- a/macros/deflection.js +++ /dev/null @@ -1,37 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Deflection', - content: `Apply Deflection to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'Apply (melee)', value: 'melee' }, - { label: 'Apply (ranged)', value: 'ranged' }, - { label: 'Apply with raise (both)', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions) - - if (choice && choice !== 'cancel') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const icon = 'icons/magic/defensive/shield-barrier-deflect-teal.webp' - let effectName = 'Deflection' - if (choice === 'raise') { - effectName = `${effectName} (all)` - } else { - effectName = `${effectName} (${choice})` - } - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 5, []) - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/entangle.js b/macros/entangle.js deleted file mode 100644 index 0f47916..0000000 --- a/macros/entangle.js +++ /dev/null @@ -1,74 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Entangle', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Entangle' }, - { type: 'info', label: `Apply Entangle to ${tokenList}` }, - { type: 'radio', label: 'Not Damaging', options: ['dmg', true] }, - { type: 'radio', label: 'Damaging', options: ['dmg', false] }, - { type: 'radio', label: 'Deadly', options: ['dmg', false] }, - { type: 'checkbox', label: 'Tough', options: false } - ], - buttons: [ - { label: 'Entangled', value: 'apply' }, - { label: 'Bound (raise)', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - if (buttons && buttons !== 'cancel') { - const options = { - apply: (buttons === 'raise' ? 'bound' : 'entangled'), - damage: (inputs[3] ? '2d4' : (inputs[4] ? '2d6' : null)), - tough: (!!inputs[5]) - } - await createEffect(tokens, options) - } -} - -function getStatus (label, name) { - const effect = JSON.parse(JSON.stringify( - CONFIG.statusEffects.find(se => se.label === label))) - effect.label = name - if (!effect.flags) { - effect.flags = {} - } - effect.flags.core = { statusId: effect.id } - effect.id = name - return effect -} - -async function createEffect (tokens, options) { - const effectSearch = (options.apply === 'bound' ? 'SWADE.Bound' : 'SWADE.Entangled') - const effectName = (options.apply === 'bound' ? 'Bound' : 'Entangled') - const effect = getStatus(effectSearch, effectName) - const extraIcon = 'icons/magic/nature/root-vine-barrier-wall-brown.webp' - const extraEffect = swadeMBHelpers.createEffectDocument(extraIcon, 'Entangle Modifier', 1, []) - - if (options.damage) { - extraEffect.id = `${extraEffect.id} - ${options.damage} dmg` - extraEffect.label = `${extraEffect.label} - ${options.damage} dmg` - } - if (options.tough) { - extraEffect.id = `Tough ${extraEffect.id}` - extraEffect.label = `Tough ${extraEffect.label}` - } - for (const token of tokens) { - const mutateOptions = swadeMBHelpers.defaultMutationOptions('Entangle') - const mutate = { embedded: { ActiveEffect: {} } } - mutate.embedded.ActiveEffect[effect.id] = effect - if (options.damage || options.tough) { - mutate.embedded.ActiveEffect[extraEffect.id] = extraEffect - } - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/glow.js b/macros/glow.js deleted file mode 100644 index af28c53..0000000 --- a/macros/glow.js +++ /dev/null @@ -1,58 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Glow', - content: `Apply Glow to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'OK', value: 'ok' }, - { label: 'Mutate token lighting', value: 'mutate' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions) - - if (choice === 'ok' || choice === 'mutate') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const icon = 'icons/magic/light/explosion-star-blue-large.webp' - const effectName = 'Glow' - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 5, []) - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - if (choice === 'mutate') { - const mutate2 = { - token: { - light: { - alpha: 0.5, - angle: 360, - attenuation: 0.5, - animation: { - intensity: 5, - reverse: false, - speed: 5, - type: 'starlight' - }, - bright: 0, - color: '#0f3fff', - coloration: 1, - contrast: 0, - dim: 0.5, - luminosity: 0.5, - saturation: 0, - shadows: 0 - } - } - } - mutateOptions.permanent = false - await warpgate.mutate(token.document, mutate2, {}, mutateOptions) - } - } -} diff --git a/macros/hinder.js b/macros/hinder.js deleted file mode 100644 index 0c1df96..0000000 --- a/macros/hinder.js +++ /dev/null @@ -1,38 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Hinder', - content: `Apply Hinder to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'OK', value: 'ok' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions, 'column') - - if (choice === 'ok') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const icon = 'icons/magic/movement/abstract-ribbons-red-orange.webp' - const effectName = 'Hinder' - const changes = [ - { - key: 'system.stats.speed.value', - mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD, - value: -2, - priority: 0 - } - ] - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 5, changes) - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/hurry.js b/macros/hurry.js deleted file mode 100644 index 6c5811f..0000000 --- a/macros/hurry.js +++ /dev/null @@ -1,38 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Hurry', - content: `Apply Hurry to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'OK', value: 'ok' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions, 'column') - - if (choice === 'ok') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const icon = 'icons/skills/movement/feet-winged-boots-blue.webp' - const effectName = 'Hurry' - const changes = [ - { - key: 'system.stats.speed.value', - mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD, - value: 2, - priority: 0 - } - ] - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 5, changes) - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/intangibility.js b/macros/intangibility.js deleted file mode 100644 index 8407b13..0000000 --- a/macros/intangibility.js +++ /dev/null @@ -1,41 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Intangibility', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Intangibility' }, - { type: 'info', label: `Apply Intangibility to ${tokenList}` }, - { type: 'checkbox', label: 'Duration', options: false } - ], - buttons: [ - { label: 'Apply', value: 'apply' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - if (buttons && buttons !== 'cancel') { - const options = { - duration: (!!inputs[2]) - } - await createEffect(tokens, options) - } -} - -async function createEffect (tokens, options) { - const effectName = 'Intangibility' - const duration = (options.duration ? 5 * 6 * 60 : 5) - const icon = 'icons/magic/control/debuff-energy-hold-levitate-blue-yellow.webp' - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, duration, []) - const mutateOptions = swadeMBHelpers.defaultMutationOptions('Intangibility') - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/invisibility.js b/macros/invisibility.js deleted file mode 100644 index 9e007fb..0000000 --- a/macros/invisibility.js +++ /dev/null @@ -1,44 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Invisibility', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Invisibility' }, - { type: 'info', label: `Apply Invisibility to ${tokenList}` }, - { type: 'checkbox', label: 'Duration', options: false } - ], - buttons: [ - { label: 'Apply', value: 'apply' }, - { label: 'Raise', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const { buttons, inputs } = await warpgate.menu(menuData, menuOptions) - if (buttons && buttons !== 'cancel') { - const options = { - raise: (buttons === 'raise'), - duration: (!!inputs[2]) - } - await createEffect(tokens, options) - } -} - -async function createEffect (tokens, options) { - const effectName = `${options.raise ? 'major' : 'minor'} Invisibility` - const baseEffect = CONFIG.statusEffects.find(se => se.label === 'EFFECT.StatusInvisible') - const duration = (options.duration ? 5 * 6 * 60 : 5) - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(baseEffect.icon, effectName, duration, []) - mutate.embedded.ActiveEffect[effectName].flags.core = { statusId: baseEffect.id } - const mutateOptions = swadeMBHelpers.defaultMutationOptions('Invisibility') - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/lingering-damage.js b/macros/lingering-damage.js deleted file mode 100644 index 1d1e6c4..0000000 --- a/macros/lingering-damage.js +++ /dev/null @@ -1,32 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Lingering Damage', - content: `Apply Lingering Damage to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'Ok', value: 'ok' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions) - - if (choice === 'ok') { - await createEffect(tokens) - } -} - -async function createEffect (tokens) { - const icon = 'icons/magic/acid/dissolve-arm-flesh.webp' - const effectName = 'Lingering Damage' - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 1, []) - mutate.embedded.ActiveEffect['Lingering Damage'].flags.swade.expiration = - CONFIG.SWADE.CONST.STATUS_EFFECT_EXPIRATION.StartOfTurnPrompt - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/protection.js b/macros/protection.js deleted file mode 100644 index d35e5ad..0000000 --- a/macros/protection.js +++ /dev/null @@ -1,45 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Protection', - content: `Apply Protection to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'Apply (+2 armor)', value: 'apply' }, - { label: 'Apply with raise (+2 toughness)', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions) - - if (choice && choice !== 'cancel') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const baseEffect = CONFIG.statusEffects.find(se => se.label === 'SWADE.Protection') - const changes = [ - { - key: 'system.stats.toughness.armor', - mode: foundry.CONST.ACTIVE_EFFECT_MODES.UPGRADE, - value: 2, - priority: 0 - } - ] - let effectName = 'minor Protection' - if (choice === 'raise') { - changes[0].key = 'system.stats.toughness.value' - effectName = 'major Protection' - } - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect( - baseEffect.icon, effectName, 5, changes) - mutate.embedded.ActiveEffect[effectName].flags.core = { statusId: baseEffect.id } - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - } -} diff --git a/macros/quickDamage.js b/macros/quickDamage.js new file mode 100644 index 0000000..50b316c --- /dev/null +++ b/macros/quickDamage.js @@ -0,0 +1,39 @@ +new Dialog({ + title: 'Damage Roll Configuration', + content: ` +
+ `, + buttons: { + ok: { + label: 'Roll Damage', + callback: (html) => { + const damageRoll = html.find('input[name="damageRoll"]').val() + let flavor = html.find('input[name="flavor"]').val() + const ap = parseInt(html.find('input[name="ap"]').val()) || 0 + const options = {} + if (ap > 0) { + flavor = `${flavor ? flavor + ' - ' : ''}AP: ${ap}` + options.ap = ap + } + // Perform the damage roll and send the message + new CONFIG.Dice.DamageRoll(damageRoll, null, options).toMessage({ flavor }) + } + }, + cancel: { + label: 'Cancel' + } + } +}).render(true) diff --git a/macros/requestDialog.js b/macros/requestRoll.js similarity index 100% rename from macros/requestDialog.js rename to macros/requestRoll.js diff --git a/macros/shroud.js b/macros/shroud.js deleted file mode 100644 index 48ce381..0000000 --- a/macros/shroud.js +++ /dev/null @@ -1,58 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const dialogOptions = { - title: 'Shroud', - content: `Apply Shroud to ${tokenList}`, - default: 'cancel', - buttons: [ - { label: 'OK', value: 'ok' }, - { label: 'Mutate token lighting', value: 'mutate' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const choice = await warpgate.buttonDialog(dialogOptions) - - if (choice === 'ok' || choice === 'mutate') { - await createEffect(tokens, choice) - } -} - -async function createEffect (tokens, choice) { - const icon = 'icons/magic/perception/silhouette-stealth-shadow.webp' - const effectName = 'Shroud' - for (const token of tokens) { - const mutate = swadeMBHelpers.createMutationWithEffect(icon, effectName, 5, []) - const mutateOptions = swadeMBHelpers.defaultMutationOptions(effectName) - await warpgate.mutate(token.document, mutate, {}, mutateOptions) - if (choice === 'mutate') { - const mutate2 = { - token: { - light: { - alpha: 0.5, - angle: 360, - attenuation: 0.1, - animation: { - intensity: 5, - reverse: false, - speed: 5, - type: 'roiling' - }, - bright: 0, - color: null, - coloration: 0, - contrast: 0, - dim: 0.1, - luminosity: -0.15, - saturation: 0, - shadows: 0.25 - } - } - } - mutateOptions.permanent = false - await warpgate.mutate(token.document, mutate2, {}, mutateOptions) - } - } -} diff --git a/macros/smite.js b/macros/smite.js deleted file mode 100644 index 41402d0..0000000 --- a/macros/smite.js +++ /dev/null @@ -1,74 +0,0 @@ -swadeMBHelpers.runOnTargetOrSelectedTokens(main) - -async function main (tokens) { - const tokenList = tokens.map(t => t.name).join(', ') - const menuOptions = { - title: 'Smite', - defaultButton: 'Cancel', - options: {} - } - - const menuData = { - inputs: [ - { type: 'header', label: 'Smite' }, - { type: 'info', label: `Apply Smite to ${tokenList}` }, - { type: 'checkbox', label: 'Greater', options: false } - ], - buttons: [ - { label: 'Apply', value: 'apply' }, - { label: 'Apply with Raise', value: 'raise' }, - { label: 'Cancel', value: 'cancel' } - ] - } - - const tokenWeapons = {} - let index = 2 - for (const token of tokens) { - index += 2 - tokenWeapons[token.id] = index - menuData.inputs.push({ type: 'info', label: `The Quick Damage Roll macro will a dialog to configure a damage roll, with its chat card and Apply Damage button, for cases where it's not worth creating an actor, token, and action for a single roll.
" + }, + "video": { + "controls": true, + "volume": 0.5 + }, + "src": null, + "system": {}, + "ownership": { + "default": -1, + "sVoCvBU1knmXzoYe": 3 + }, + "flags": { + "core": { + "sourceId": "Compendium.swade-mb-helpers.module-docs.JournalEntry.Mw1g2Fx5dp4SoqVP.JournalEntryPage.8OcZYeZTJWqJpeBs" + } + }, + "_stats": { + "systemId": "swade", + "systemVersion": "3.2.5", + "coreVersion": "11.315", + "createdTime": 1702934117575, + "modifiedTime": 1702934796555, + "lastModifiedBy": "sVoCvBU1knmXzoYe" + }, + "_id": "ruuxf72hwlcRzymt", + "_key": "!journal.pages!Mw1g2Fx5dp4SoqVP.ruuxf72hwlcRzymt" } ], "flags": { @@ -187,7 +226,7 @@ "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1678169291843, - "modifiedTime": 1702859968781, + "modifiedTime": 1702934832358, "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "Mw1g2Fx5dp4SoqVP",