diff --git a/.gitattributes b/.gitattributes index eab0ec5..0a3d77e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,8 @@ -packs/** binary -packs/**/_source text +packs/**/*.ldb binary +packs/**/MANIFEST-* binary +packs/**/CURRENT binary +packs/**/LOCK binary +packs/**/LOG* binary *.webp filter=lfs diff=lfs merge=lfs -text *.jpeg filter=lfs diff=lfs merge=lfs -text *.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb8b28..87b8abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- New Macro: Set token vision +- New Common Action: Illumination (for the darkness penalty effects) - New macro: Quick Damage Roll - New Vision mode: Low Light Vision - Power Effect for Zombie diff --git a/macros/setTokenVision.js b/macros/setTokenVision.js new file mode 100644 index 0000000..9d85961 --- /dev/null +++ b/macros/setTokenVision.js @@ -0,0 +1,115 @@ +const argBright = typeof args === 'undefined' ? null : args.length > 0 ? args[0] : null +// argument can be one of 'bright', 'dim', 'dark', 'pitchdark'. Other values +// will guess based on scene darkness +const BRIGHT_LEVELS = ['bright', 'dim', 'dark', 'pitchdark'] +const THRESHOLDS = { + dim: 0.4, + dark: 0.6, + pitchdark: 0.8 +} +const RANGES = { + basic: { + bright: 25, + dim: 25, + dark: 10, + pitchdark: 0 + }, + lowlight: { + bright: 25, + dim: 25, + dark: 10, + pitchdark: 0 + }, + darkvision: { + bright: 25, + dim: 25, + dark: 10, + pitchdark: 10 + }, + nightvision: { + bright: 200, + dim: 200, + dark: 200, + pitchdark: 200 + } +} +const SIGHT_NAMES = { + lowlight: 'low-light-vision', + darkvision: 'darkvision', + nightvision: 'night-vision' +} +const SIGHT_MODES = { + lowlight: 'lowlight', + darkvision: 'darkvision', + nightvision: 'darkvision', + basic: 'basic' +} + +function findAbility (token, swid) { + return token.actor.items.find(i => i.type === 'ability' && i.system.swid === swid) +} + +async function main () { + const scene = game.scenes.current + let sceneBright = BRIGHT_LEVELS[0] + if (scene.darkness > THRESHOLDS.pitchdark) { + sceneBright = BRIGHT_LEVELS[3] + } else if (scene.darkness > THRESHOLDS.dark) { + sceneBright = BRIGHT_LEVELS[2] + } else if (scene.darkness > THRESHOLDS.dim) { + sceneBright = BRIGHT_LEVELS[1] + } + let bright = sceneBright + if (argBright && BRIGHT_LEVELS.includes(argBright)) { + bright = argBright + } + const menuData = { + inputs: [ + { type: 'radio', label: 'Bright Light', options: ['bright', bright === BRIGHT_LEVELS[0]] }, + { type: 'radio', label: 'Dim Light', options: ['bright', bright === BRIGHT_LEVELS[1]] }, + { type: 'radio', label: 'Dark', options: ['bright', bright === BRIGHT_LEVELS[2]] }, + { type: 'radio', label: 'Pitch Dark', options: ['bright', bright === BRIGHT_LEVELS[3]] } + ], + buttons: [ + { label: 'Select Scene Brightness', value: 'ok', default: true }, + { label: 'Cancel', value: 'cancel' } + ] + } + const menuConfig = { title: 'Select scene brightness' } + const result = await warpgate.menu(menuData, menuConfig) + if (result.buttons !== 'ok') { return } + + for (let i = 0; i < 4; i++) { + if (result.inputs[i]) { bright = BRIGHT_LEVELS[i] } + } + + for (const tokenId of scene.tokens.map(t => t.id)) { + const token = scene.tokens.get(tokenId) + if (!token.sight.enabled) { + console.log(`Skipping ${token.name}, vision not enabled`) + continue + // don't set sight on a token where it's not enabled + } + let sightType = 'basic' + for (const sight in SIGHT_NAMES) { + if (findAbility(token, SIGHT_NAMES[sight])) { + sightType = sight + } + } + const range = RANGES[sightType][bright] + const sightMode = SIGHT_MODES[sightType] + const visionModeData = CONFIG.Canvas.visionModes[sightMode].vision.defaults + const data = { + 'sight.range': range, + 'sight.visionMode': sightMode, + 'sight.attenuation': visionModeData.attenuation, + 'sight.brightness': visionModeData.brightness, + 'sight.saturation': visionModeData.saturation, + 'sight.contrast': visionModeData.contrast + } + console.log(`Updating ${token.name}:`, sightType, bright, data) + await token.update(data) + } +} + +main() diff --git a/packs/common-actions/000005.ldb b/packs/common-actions/000005.ldb index 6c4315d..c15ed10 100644 Binary files a/packs/common-actions/000005.ldb and b/packs/common-actions/000005.ldb differ diff --git a/packs/common-actions/LOG b/packs/common-actions/LOG index dedeab7..cc909c1 100644 --- a/packs/common-actions/LOG +++ b/packs/common-actions/LOG @@ -1,5 +1,5 @@ -2023/12/18-15:37:09.644182 7f63a67bd700 Delete type=3 #1 -2023/12/18-15:37:09.646809 7f63a5542700 Level-0 table #5: started -2023/12/18-15:37:09.654066 7f63a5542700 Level-0 table #5: 11401 bytes OK -2023/12/18-15:37:09.663437 7f63a5542700 Delete type=0 #3 -2023/12/18-15:37:09.663538 7f63a5542700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items!xA7qKMmugJv7z6j1' @ 0 : 0; will stop at (end) +2023/12/18-23:38:01.173251 7fb80df3c700 Delete type=3 #1 +2023/12/18-23:38:01.175935 7fb80d481700 Level-0 table #5: started +2023/12/18-23:38:01.183313 7fb80d481700 Level-0 table #5: 12215 bytes OK +2023/12/18-23:38:01.192571 7fb80d481700 Delete type=0 #3 +2023/12/18-23:38:01.192679 7fb80d481700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW' @ 0 : 0; will stop at (end) diff --git a/packs/common-actions/MANIFEST-000002 b/packs/common-actions/MANIFEST-000002 index 8389ff4..0916a64 100644 Binary files a/packs/common-actions/MANIFEST-000002 and b/packs/common-actions/MANIFEST-000002 differ diff --git a/packs/common-actions/_source/Illumination_RC1Nz6iph8wPPK1B.json b/packs/common-actions/_source/Illumination_RC1Nz6iph8wPPK1B.json new file mode 100644 index 0000000..52b8b01 --- /dev/null +++ b/packs/common-actions/_source/Illumination_RC1Nz6iph8wPPK1B.json @@ -0,0 +1,156 @@ +{ + "folder": null, + "name": "Illumination", + "type": "action", + "img": "icons/magic/light/explosion-star-blue-large.webp", + "system": { + "description": "", + "notes": "", + "source": "", + "swid": "lighting", + "additionalStats": {}, + "favorite": false, + "category": "Savage Pathfinder", + "templates": { + "cone": false, + "stream": false, + "small": false, + "medium": false, + "large": false + }, + "actions": { + "trait": "", + "traitMod": "", + "dmgMod": "", + "additional": {} + } + }, + "effects": [ + { + "name": "Dim Lighting", + "icon": "icons/magic/light/light-lantern-lit-white.webp", + "changes": [ + { + "key": "system.stats.globalMods.trait", + "mode": 2, + "value": "-2", + "priority": null + } + ], + "transfer": true, + "_id": "fpSigRcCCADmisXP", + "disabled": true, + "duration": { + "startTime": 0, + "seconds": null, + "combat": "bLRI8G4dAxvCnqbC", + "rounds": null, + "turns": null, + "startRound": null, + "startTurn": null + }, + "description": "", + "origin": null, + "statuses": [], + "flags": { + "swade": { + "favorite": true, + "expiration": null, + "loseTurnOnHold": false + } + }, + "tint": null, + "_key": "!items.effects!RC1Nz6iph8wPPK1B.fpSigRcCCADmisXP" + }, + { + "name": "Dark Lighting", + "icon": "icons/magic/light/light-candles-lit-white.webp", + "changes": [ + { + "key": "system.stats.globalMods.trait", + "mode": 2, + "value": "-4", + "priority": null + } + ], + "transfer": true, + "_id": "g9W5hJisq3MsCpZW", + "disabled": true, + "duration": { + "startTime": 0, + "seconds": null, + "combat": "bLRI8G4dAxvCnqbC", + "rounds": null, + "turns": null, + "startRound": null, + "startTurn": null + }, + "description": "", + "origin": null, + "statuses": [], + "flags": { + "swade": { + "expiration": null, + "loseTurnOnHold": false, + "favorite": true + } + }, + "tint": null, + "_key": "!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW" + }, + { + "name": "Pitch Darkness", + "icon": "icons/magic/unholy/barrier-shield-glowing-pink.webp", + "changes": [ + { + "key": "system.stats.globalMods.trait", + "mode": 2, + "value": "-6", + "priority": null + } + ], + "transfer": true, + "_id": "NI4hfxplfJ5pqImL", + "disabled": true, + "duration": { + "startTime": 0, + "seconds": null, + "combat": "bLRI8G4dAxvCnqbC", + "rounds": null, + "turns": null, + "startRound": null, + "startTurn": null + }, + "description": "", + "origin": null, + "statuses": [], + "flags": { + "swade": { + "expiration": null, + "loseTurnOnHold": false, + "favorite": true + } + }, + "tint": null, + "_key": "!items.effects!RC1Nz6iph8wPPK1B.NI4hfxplfJ5pqImL" + } + ], + "ownership": { + "default": 0, + "sVoCvBU1knmXzoYe": 3 + }, + "flags": { + "core": {} + }, + "_stats": { + "systemId": "swade", + "systemVersion": "3.2.5", + "coreVersion": "11.315", + "createdTime": 1702939897892, + "modifiedTime": 1702960438222, + "lastModifiedBy": "sVoCvBU1knmXzoYe" + }, + "_id": "RC1Nz6iph8wPPK1B", + "sort": 0, + "_key": "!items!RC1Nz6iph8wPPK1B" +} diff --git a/packs/gear/LOG b/packs/gear/LOG index fcf2940..00446c8 100644 --- a/packs/gear/LOG +++ b/packs/gear/LOG @@ -1,5 +1,5 @@ -2023/12/18-15:37:12.778941 7fed4efbf700 Delete type=3 #1 -2023/12/18-15:37:12.781115 7fed4cfbb700 Level-0 table #5: started -2023/12/18-15:37:12.803917 7fed4cfbb700 Level-0 table #5: 6787 bytes OK -2023/12/18-15:37:12.812861 7fed4cfbb700 Delete type=0 #3 -2023/12/18-15:37:12.812959 7fed4cfbb700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end) +2023/12/18-23:38:02.394612 7fa8daffd700 Delete type=3 #1 +2023/12/18-23:38:02.397080 7fa8d9d82700 Level-0 table #5: started +2023/12/18-23:38:02.404288 7fa8d9d82700 Level-0 table #5: 6787 bytes OK +2023/12/18-23:38:02.413227 7fa8d9d82700 Delete type=0 #3 +2023/12/18-23:38:02.413348 7fa8d9d82700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end) diff --git a/packs/helper-actors/LOG b/packs/helper-actors/LOG index 6b2cbd6..afa8223 100644 --- a/packs/helper-actors/LOG +++ b/packs/helper-actors/LOG @@ -1,5 +1,5 @@ -2023/12/18-15:37:14.322677 7f3e267fc700 Delete type=3 #1 -2023/12/18-15:37:14.324789 7f3e25ffb700 Level-0 table #5: started -2023/12/18-15:37:14.331866 7f3e25ffb700 Level-0 table #5: 1751 bytes OK -2023/12/18-15:37:14.340858 7f3e25ffb700 Delete type=0 #3 -2023/12/18-15:37:14.340981 7f3e25ffb700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end) +2023/12/18-23:38:03.189021 7f306ffff700 Delete type=3 #1 +2023/12/18-23:38:03.191864 7f306e7fc700 Level-0 table #5: started +2023/12/18-23:38:03.198720 7f306e7fc700 Level-0 table #5: 1751 bytes OK +2023/12/18-23:38:03.207506 7f306e7fc700 Delete type=0 #3 +2023/12/18-23:38:03.207610 7f306e7fc700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end) diff --git a/packs/helper-macros/000005.ldb b/packs/helper-macros/000005.ldb index 4738783..4f5464a 100644 Binary files a/packs/helper-macros/000005.ldb and b/packs/helper-macros/000005.ldb differ diff --git a/packs/helper-macros/LOG b/packs/helper-macros/LOG index fbe544e..1098a98 100644 --- a/packs/helper-macros/LOG +++ b/packs/helper-macros/LOG @@ -1,5 +1,5 @@ -2023/12/18-15:37:18.058346 7f04d3fff700 Delete type=3 #1 -2023/12/18-15:37:18.060818 7f04d1d82700 Level-0 table #5: started -2023/12/18-15:37:18.070119 7f04d1d82700 Level-0 table #5: 10218 bytes OK -2023/12/18-15:37:18.078948 7f04d1d82700 Delete type=0 #3 -2023/12/18-15:37:18.079042 7f04d1d82700 Manual compaction at level-0 from '!folders!hIbrWxg1nDutCSwt' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end) +2023/12/18-23:38:03.938107 7f566efbe700 Delete type=3 #1 +2023/12/18-23:38:03.940484 7f566d542700 Level-0 table #5: started +2023/12/18-23:38:03.948092 7f566d542700 Level-0 table #5: 12050 bytes OK +2023/12/18-23:38:03.956941 7f566d542700 Delete type=0 #3 +2023/12/18-23:38:03.957060 7f566d542700 Manual compaction at level-0 from '!folders!hIbrWxg1nDutCSwt' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end) diff --git a/packs/helper-macros/MANIFEST-000002 b/packs/helper-macros/MANIFEST-000002 index 73b8fc9..8562096 100644 Binary files a/packs/helper-macros/MANIFEST-000002 and b/packs/helper-macros/MANIFEST-000002 differ diff --git a/packs/helper-macros/_source/Gold_Totals_QMnx9cuyw81kRS2o.json b/packs/helper-macros/_source/Gold_Totals_QMnx9cuyw81kRS2o.json index ce0464d..0eaf491 100644 --- a/packs/helper-macros/_source/Gold_Totals_QMnx9cuyw81kRS2o.json +++ b/packs/helper-macros/_source/Gold_Totals_QMnx9cuyw81kRS2o.json @@ -26,14 +26,14 @@ }, "_stats": { "systemId": "swade", - "systemVersion": "3.2.2", + "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1680966567327, - "modifiedTime": 1700436589221, - "lastModifiedBy": "R9ZgY0IvWl8ovIuT" + "modifiedTime": 1702959790712, + "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "folder": null, - "sort": 300000, + "sort": 600000, "_id": "QMnx9cuyw81kRS2o", "_key": "!macros!QMnx9cuyw81kRS2o" } diff --git a/packs/helper-macros/_source/Power_Effects_Item_Action_AjuA11hQ48UJNwlH.json b/packs/helper-macros/_source/Power_Effects_Item_Action_AjuA11hQ48UJNwlH.json index 9a2a755..c10fbc6 100644 --- a/packs/helper-macros/_source/Power_Effects_Item_Action_AjuA11hQ48UJNwlH.json +++ b/packs/helper-macros/_source/Power_Effects_Item_Action_AjuA11hQ48UJNwlH.json @@ -15,13 +15,13 @@ }, "_stats": { "systemId": "swade", - "systemVersion": "3.2.2", + "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1693853383361, - "modifiedTime": 1700436589221, - "lastModifiedBy": "R9ZgY0IvWl8ovIuT" + "modifiedTime": 1702959790712, + "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "AjuA11hQ48UJNwlH", - "sort": 200000, + "sort": 500000, "_key": "!macros!AjuA11hQ48UJNwlH" } diff --git a/packs/helper-macros/_source/Quick_Damage_Roll_NANSnFATVJntUfL7.json b/packs/helper-macros/_source/Quick_Damage_Roll_NANSnFATVJntUfL7.json index ccfbc9a..2ad2639 100644 --- a/packs/helper-macros/_source/Quick_Damage_Roll_NANSnFATVJntUfL7.json +++ b/packs/helper-macros/_source/Quick_Damage_Roll_NANSnFATVJntUfL7.json @@ -18,10 +18,10 @@ "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1702933790652, - "modifiedTime": 1702934856387, + "modifiedTime": 1702959790712, "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "NANSnFATVJntUfL7", - "sort": 0, + "sort": 200000, "_key": "!macros!NANSnFATVJntUfL7" } diff --git a/packs/helper-macros/_source/Request_Notice_Roll_pnLnFrfTTJeodFRy.json b/packs/helper-macros/_source/Request_Notice_Roll_pnLnFrfTTJeodFRy.json index f8ecec8..56853b4 100644 --- a/packs/helper-macros/_source/Request_Notice_Roll_pnLnFrfTTJeodFRy.json +++ b/packs/helper-macros/_source/Request_Notice_Roll_pnLnFrfTTJeodFRy.json @@ -18,10 +18,10 @@ "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1700430548162, - "modifiedTime": 1702860052587, + "modifiedTime": 1702959790712, "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "pnLnFrfTTJeodFRy", - "sort": 0, + "sort": 300000, "_key": "!macros!pnLnFrfTTJeodFRy" } diff --git a/packs/helper-macros/_source/Request_Roll_G9ksuYJo1512PTo9.json b/packs/helper-macros/_source/Request_Roll_G9ksuYJo1512PTo9.json index d38b8b3..3cae153 100644 --- a/packs/helper-macros/_source/Request_Roll_G9ksuYJo1512PTo9.json +++ b/packs/helper-macros/_source/Request_Roll_G9ksuYJo1512PTo9.json @@ -15,13 +15,13 @@ }, "_stats": { "systemId": "swade", - "systemVersion": "3.2.2", + "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1700430548162, - "modifiedTime": 1700436589221, - "lastModifiedBy": "R9ZgY0IvWl8ovIuT" + "modifiedTime": 1702959790712, + "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "G9ksuYJo1512PTo9", - "sort": 100000, + "sort": 400000, "_key": "!macros!G9ksuYJo1512PTo9" } diff --git a/packs/helper-macros/_source/Set_Token_Vision_arjbjmgKMjyp9tWE.json b/packs/helper-macros/_source/Set_Token_Vision_arjbjmgKMjyp9tWE.json new file mode 100644 index 0000000..50abb5d --- /dev/null +++ b/packs/helper-macros/_source/Set_Token_Vision_arjbjmgKMjyp9tWE.json @@ -0,0 +1,27 @@ +{ + "name": "Set Token Vision", + "type": "script", + "author": "sVoCvBU1knmXzoYe", + "img": "icons/magic/perception/orb-crystal-ball-scrying-blue.webp", + "scope": "global", + "command": "const argBright = typeof args === 'undefined' ? null : args.length > 0 ? args[0] : null\n// argument can be one of 'bright', 'dim', 'dark', 'pitchdark'. Other values\n// will guess based on scene darkness\nconst BRIGHT_LEVELS = ['bright', 'dim', 'dark', 'pitchdark']\nconst THRESHOLDS = {\n dim: 0.4,\n dark: 0.6,\n pitchdark: 0.8\n}\nconst RANGES = {\n basic: {\n bright: 25,\n dim: 25,\n dark: 10,\n pitchdark: 0\n },\n lowlight: {\n bright: 25,\n dim: 25,\n dark: 10,\n pitchdark: 0\n },\n darkvision: {\n bright: 25,\n dim: 25,\n dark: 10,\n pitchdark: 10\n },\n nightvision: {\n bright: 200,\n dim: 200,\n dark: 200,\n pitchdark: 200\n }\n}\nconst SIGHT_NAMES = {\n lowlight: 'low-light-vision',\n darkvision: 'darkvision',\n nightvision: 'night-vision'\n}\nconst SIGHT_MODES = {\n lowlight: 'lowlight',\n darkvision: 'darkvision',\n nightvision: 'darkvision',\n basic: 'basic'\n}\n\nfunction findAbility (token, swid) {\n return token.actor.items.find(i => i.type === 'ability' && i.system.swid === swid)\n}\n\nasync function main () {\n const scene = game.scenes.current\n let sceneBright = BRIGHT_LEVELS[0]\n if (scene.darkness > THRESHOLDS.pitchdark) {\n sceneBright = BRIGHT_LEVELS[3]\n } else if (scene.darkness > THRESHOLDS.dark) {\n sceneBright = BRIGHT_LEVELS[2]\n } else if (scene.darkness > THRESHOLDS.dim) {\n sceneBright = BRIGHT_LEVELS[1]\n }\n let bright = sceneBright\n if (argBright && BRIGHT_LEVELS.includes(argBright)) {\n bright = argBright\n }\n const menuData = {\n inputs: [\n { type: 'radio', label: 'Bright Light', options: ['bright', bright === BRIGHT_LEVELS[0]] },\n { type: 'radio', label: 'Dim Light', options: ['bright', bright === BRIGHT_LEVELS[1]] },\n { type: 'radio', label: 'Dark', options: ['bright', bright === BRIGHT_LEVELS[2]] },\n { type: 'radio', label: 'Pitch Dark', options: ['bright', bright === BRIGHT_LEVELS[3]] }\n ],\n buttons: [\n { label: 'Select Scene Brightness', value: 'ok', default: true },\n { label: 'Cancel', value: 'cancel' }\n ]\n }\n const menuConfig = { title: 'Select scene brightness' }\n const result = await warpgate.menu(menuData, menuConfig)\n if (result.buttons !== 'ok') { return }\n\n for (let i = 0; i < 4; i++) {\n if (result.inputs[i]) { bright = BRIGHT_LEVELS[i] }\n }\n console.log(`Scene brightness is ${bright}`)\n\n for (const tokenId of scene.tokens.map(t => t.id)) {\n const token = scene.tokens.get(tokenId)\n if (!token.sight.enabled) {\n console.log(`Skipping ${token.name}, vision not enabled`)\n continue\n // don't set sight on a token where it's not enabled\n }\n let sightType = 'basic'\n for (const sight in SIGHT_NAMES) {\n console.log(`checking ${token} for ${SIGHT_NAMES[sight]}`)\n if (findAbility(token, SIGHT_NAMES[sight])) {\n sightType = sight\n console.log(`${token.name} has ${sightType}`)\n }\n }\n const range = RANGES[sightType][bright]\n const sightMode = SIGHT_MODES[sightType]\n const visionModeData = CONFIG.Canvas.visionModes[sightMode].vision.defaults\n const data = {\n 'sight.range': range,\n 'sight.visionMode': sightMode,\n 'sight.attenuation': visionModeData.attenuation,\n 'sight.brightness': visionModeData.brightness,\n 'sight.saturation': visionModeData.saturation,\n 'sight.contrast': visionModeData.contrast\n }\nconsole.log(`Updating ${token.name}:`, data)\n await token.update(data)\n }\n}\n\nmain()", + "folder": null, + "ownership": { + "default": 0, + "sVoCvBU1knmXzoYe": 3 + }, + "flags": { + "core": {} + }, + "_stats": { + "systemId": "swade", + "systemVersion": "3.2.5", + "coreVersion": "11.315", + "createdTime": 1702934878750, + "modifiedTime": 1702959790712, + "lastModifiedBy": "sVoCvBU1knmXzoYe" + }, + "_id": "arjbjmgKMjyp9tWE", + "sort": 100000, + "_key": "!macros!arjbjmgKMjyp9tWE" +} diff --git a/packs/module-docs/000005.ldb b/packs/module-docs/000005.ldb index f77efe9..360c3cd 100644 Binary files a/packs/module-docs/000005.ldb and b/packs/module-docs/000005.ldb differ diff --git a/packs/module-docs/LOG b/packs/module-docs/LOG index 5e600ee..6ac9446 100644 --- a/packs/module-docs/LOG +++ b/packs/module-docs/LOG @@ -1,5 +1,5 @@ -2023/12/18-15:37:20.266975 7f00037bf700 Delete type=3 #1 -2023/12/18-15:37:20.269045 7f0001542700 Level-0 table #5: started -2023/12/18-15:37:20.276064 7f0001542700 Level-0 table #5: 9796 bytes OK -2023/12/18-15:37:20.285028 7f0001542700 Delete type=0 #3 -2023/12/18-15:37:20.285119 7f0001542700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!YSuk1v59tLaL9XUK.BlDoYgdTxhyCBP3Y' @ 0 : 0; will stop at (end) +2023/12/18-23:38:04.812110 7f4d227be700 Delete type=3 #1 +2023/12/18-23:38:04.814586 7f4d20fbb700 Level-0 table #5: started +2023/12/18-23:38:04.821794 7f4d20fbb700 Level-0 table #5: 10624 bytes OK +2023/12/18-23:38:04.830506 7f4d20fbb700 Delete type=0 #3 +2023/12/18-23:38:04.830630 7f4d20fbb700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!YSuk1v59tLaL9XUK.BlDoYgdTxhyCBP3Y' @ 0 : 0; will stop at (end) diff --git a/packs/module-docs/MANIFEST-000002 b/packs/module-docs/MANIFEST-000002 index 1d10c0a..95cc457 100644 Binary files a/packs/module-docs/MANIFEST-000002 and b/packs/module-docs/MANIFEST-000002 differ diff --git a/packs/module-docs/_source/Common_Actions_HbtPlHNFO1L6RVj0.json b/packs/module-docs/_source/Common_Actions_HbtPlHNFO1L6RVj0.json index adb90db..c78d477 100644 --- a/packs/module-docs/_source/Common_Actions_HbtPlHNFO1L6RVj0.json +++ b/packs/module-docs/_source/Common_Actions_HbtPlHNFO1L6RVj0.json @@ -13,7 +13,7 @@ "image": {}, "text": { "format": 1, - "content": "

The Common Actions compendium contains helpful actions that may be dragged to character sheets or character sheet items to enhance their capability.

These come in several styles:

Power Actions and Oppose

Power Actions are intended to enhance specific powers with the relevant damage modifiers and useful oppositions. The Power Effect action is a macro action intended to be dragged to every power's action tab, and will run the correct power's effect based on the item name or swid.

Power Actions which share a name with a power are intended to be dragged to powers which share their name. They'll generally add all or most special power effects, opposed rolls, and damage.

Power Actions and Oppose actions named \"Oppose (trait)\" or \"Shake Off (trait)\" are intended to be dragged a la carte to any power or weapon that needs them. They generally add resistance rolls to the chat cart for the item.

Savage Pathfinder or SWADE

Actions in these categories are intended to be helpful rule references and dragged directly to a character sheet and used as an action. They'll add useful trait, damage, and resist rolls to the actions on a card, and the description text links to the premium module's documentation.

" + "content": "

The Common Actions compendium contains helpful actions that may be dragged to character sheets or character sheet items to enhance their capability.

These come in several styles:

Power Actions and Oppose

Power Actions are intended to enhance specific powers with the relevant damage modifiers and useful oppositions. The Power Effect action is a macro action intended to be dragged to every power's action tab, and will run the correct power's effect based on the item name or swid.

Power Actions which share a name with a power are intended to be dragged to powers which share their name. They'll generally add all or most special power effects, opposed rolls, and damage.

Power Actions and Oppose actions named \"Oppose (trait)\" or \"Shake Off (trait)\" are intended to be dragged a la carte to any power or weapon that needs them. They generally add resistance rolls to the chat cart for the item.

Savage Pathfinder or SWADE

Actions in these categories are intended to be helpful rule references and dragged directly to a character sheet and used as an action. They'll add useful trait, damage, and resist rolls to the actions on a card, and the description text links to the premium module's documentation.

Illumination

The Illumination action exists to provide some easily toggled effects for Dim, Dark, and Pitch Dark illumination penalties. Drag it to a character sheet to get the effects in your quick bar.

" }, "video": { "controls": true, @@ -28,10 +28,10 @@ "flags": {}, "_stats": { "systemId": "swade", - "systemVersion": "3.1.4", - "coreVersion": "11.309", + "systemVersion": "3.2.5", + "coreVersion": "11.315", "createdTime": 1695618024231, - "modifiedTime": 1695618090235, + "modifiedTime": 1702960414116, "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_key": "!journal.pages!HbtPlHNFO1L6RVj0.Tkzn8n0GpCQNiRVc" @@ -47,11 +47,11 @@ }, "_stats": { "systemId": "swade", - "systemVersion": "3.2.2", + "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1695618001902, - "modifiedTime": 1700440473945, - "lastModifiedBy": "R9ZgY0IvWl8ovIuT" + "modifiedTime": 1702960414116, + "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "HbtPlHNFO1L6RVj0", "sort": 200000, diff --git a/packs/module-docs/_source/Macros_Mw1g2Fx5dp4SoqVP.json b/packs/module-docs/_source/Macros_Mw1g2Fx5dp4SoqVP.json index 8bc59a3..a01f5e5 100644 --- a/packs/module-docs/_source/Macros_Mw1g2Fx5dp4SoqVP.json +++ b/packs/module-docs/_source/Macros_Mw1g2Fx5dp4SoqVP.json @@ -214,6 +214,41 @@ }, "_id": "ruuxf72hwlcRzymt", "_key": "!journal.pages!Mw1g2Fx5dp4SoqVP.ruuxf72hwlcRzymt" + }, + { + "sort": 400000, + "name": "Set Token Vision", + "type": "text", + "_id": "mT3lMGUo9zvqQsOh", + "title": { + "show": true, + "level": 1 + }, + "image": {}, + "text": { + "format": 1, + "content": "

The Set Token Vision macro can be called without arguments, or with (eg from MATT) a single argument of one of 'bright', 'dim', 'dark', 'pitchdark'. If called without an argument or with an invalid argument, it will attempt to guess the current scene's brightness level based on the darkness level defined on the scene.

It will pop up a dialog confirming the brightness level before trying to set, for all tokens with vision already enabled, vision range, vision type, and vision parameters to something appropriate based on the scene brightness, the vision related special abilities the token has, and some estimates to use savage worlds vision within a VTT. The macro as written assumes Savage Pathfinder vision rules.

For global illumination penalties one can apply, please see the Illumination action under the SWADE MB Common Actions compendium.

" + }, + "video": { + "controls": true, + "volume": 0.5 + }, + "src": null, + "system": {}, + "ownership": { + "default": -1, + "sVoCvBU1knmXzoYe": 3 + }, + "flags": {}, + "_stats": { + "systemId": "swade", + "systemVersion": "3.2.5", + "coreVersion": "11.315", + "createdTime": 1702959842685, + "modifiedTime": 1702960233927, + "lastModifiedBy": "sVoCvBU1knmXzoYe" + }, + "_key": "!journal.pages!Mw1g2Fx5dp4SoqVP.mT3lMGUo9zvqQsOh" } ], "flags": { @@ -226,7 +261,7 @@ "systemVersion": "3.2.5", "coreVersion": "11.315", "createdTime": 1678169291843, - "modifiedTime": 1702934832358, + "modifiedTime": 1702960233927, "lastModifiedBy": "sVoCvBU1knmXzoYe" }, "_id": "Mw1g2Fx5dp4SoqVP",