Skip to content

Commit

Permalink
Update macros.db
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs authored Apr 9, 2023
1 parent f6f2525 commit f97c9fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packs/macros.db
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
{"name":"Add Effect","type":"script","scope":"global","author":"SCUQoZ7lvePPTab6","img":"icons/svg/daze.svg","command":"pf2eAnimations.debug(\"Add Effect Macro\", args)\n\nlet effect;\nlet deleteTemplate = false;\n\nif (args[2].on) effect = args[2].on;\nif (args[2].on && args[2].deleteTemplate === \"on\") deleteTemplate = true;\n\nif (args[2].off && args[0] === \"off\") effect = args[2].off;\nif (args[2].off && args[2].deleteTemplate === \"off\") deleteTemplate = true;\n\n\nasync function ask(source, deleteTemplate) {\n\n\tasync function add() {\n\t\tconst find = args[1].sourceToken.actor.items.find(x => x?.flags?.core?.sourceId === source.flags.core.sourceId)\n\t\tif (find) {\n\t\t\tconsole.log(find.update({\"system.badge.value\": find.system.badge.value += 1}))\n\t\t} else {\n\t\t\tawait args[1].sourceToken.actor.createEmbeddedDocuments(\"Item\", [source]);\n\t\t}\n\t\tif (deleteTemplate && args[0].documentName === \"MeasuredTemplate\") args[0].delete();\n\t}\n\n\tif (!args[2].ask || game.settings.get(\"pf2e-jb2a-macros\", \"autoAccept\")) {\n\t\tadd();\n\t\treturn;\n\t} else {\n\t\tawait Dialog.wait({\n\t\t\ttitle: \"Add Effect?\",\n\t\t\tcontent: `\n\t\t\t<p>Do you want to add <b>\"${source.name}\"</b> to your character, <b>${args[1].sourceToken.actor.name}</b>?</p>\n\t\t\t<p><i>You can automatically accept these in PF2e Animations settings.</i></p>\n\t\t\t\t\t`,\n\t\t\tbuttons: {\n\t\t\t\tbutton1: {\n\t\t\t\t\tlabel: \"Accept\",\n\t\t\t\t\tcallback: async () => {\n\t\t\t\t\t\tadd();\n\t\t\t\t\t},\n\t\t\t\t\ticon: `<i class=\"fas fa-check\"></i>`\n\t\t\t\t},\n\t\t\t\tbutton2: {\n\t\t\t\t\tlabel: \"Decline\",\n\t\t\t\t\ticon: `<i class=\"fas fa-times\"></i>`\n\t\t\t\t}\n\t\t\t},\n\t\t}).render(true);\n\t}\n}\n\nif (!effect) return;\nconst ITEM_UUID = effect;\n\nlet source = await fromUuid(ITEM_UUID);\nif (!source) {\n\tif (args[2].deleteTemplate.includes(\"alt\")) {\n\t\tdeleteTemplate = true\n\t} else {\n\t\tdeleteTemplate = false\n\t}\n\tif ((args[2].altOff && effect === args[2].off) || (args[2].altOn && effect === args[2].on)) {\n\t\tsource = await fromUuid(effect === args[2].altOn ? args[2].altOn : args[2].altOff)\n\t} else {\n\t\treturn pf2eAnimations.debug(\"Add Effect - No Effect Found\", args)\n\t}\n}\n\nawait ask(source, deleteTemplate)","ownership":{"default":0,"SCUQoZ7lvePPTab6":3},"flags":{"advanced-macros":{"runAsGM":false,"runForEveryone":false,"runForSpecificUser":""},"core":{"sourceId":"Macro.US5tGmPkyimygfcx"},"cf":{"id":"temp_6gsujam4gp6"}},"_stats":{"systemId":"pf2e","systemVersion":"4.10.4","coreVersion":"10.291","createdTime":1665450793356,"modifiedTime":1680981242793,"lastModifiedBy":"SCUQoZ7lvePPTab6"},"folder":null,"sort":0,"_id":"x3ZaL34wkz4LljPo"}
{"name":"Add Effect","type":"script","scope":"global","author":"SCUQoZ7lvePPTab6","img":"icons/svg/daze.svg","command":"pf2eAnimations.debug(\"Add Effect Macro\", args)\n\nlet effect;\nlet deleteTemplate = false;\n\nif (args[2].on) effect = args[2].on;\nif (args[2].on && args[2].deleteTemplate === \"on\") deleteTemplate = true;\n\nif (args[2].off && args[0] === \"off\") effect = args[2].off;\nif (args[2].off && args[2].deleteTemplate === \"off\") deleteTemplate = true;\n\n\nasync function ask(source, deleteTemplate) {\n\n\tasync function add() {\n\t\tconst find = args[1].sourceToken.actor.items.find(x => x?.flags?.core?.sourceId === source.flags.core.sourceId)\n\t\tif (find) {\n\t\t\tfind.update({\"system.badge.value\": find.system.badge.value += 1})\n\t\t} else {\n\t\t\tawait args[1].sourceToken.actor.createEmbeddedDocuments(\"Item\", [source]);\n\t\t}\n\t\tif (deleteTemplate && args[0].documentName === \"MeasuredTemplate\") args[0].delete();\n\t}\n\n\tif (!args[2].ask || game.settings.get(\"pf2e-jb2a-macros\", \"autoAccept\")) {\n\t\tadd();\n\t\treturn;\n\t} else {\n\t\tawait Dialog.wait({\n\t\t\ttitle: \"Add Effect?\",\n\t\t\tcontent: `\n\t\t\t<p>Do you want to add <b>\"${source.name}\"</b> to your character, <b>${args[1].sourceToken.actor.name}</b>?</p>\n\t\t\t<p><i>You can automatically accept these in PF2e Animations settings.</i></p>\n\t\t\t\t\t`,\n\t\t\tbuttons: {\n\t\t\t\tbutton1: {\n\t\t\t\t\tlabel: \"Accept\",\n\t\t\t\t\tcallback: async () => {\n\t\t\t\t\t\tadd();\n\t\t\t\t\t},\n\t\t\t\t\ticon: `<i class=\"fas fa-check\"></i>`\n\t\t\t\t},\n\t\t\t\tbutton2: {\n\t\t\t\t\tlabel: \"Decline\",\n\t\t\t\t\ticon: `<i class=\"fas fa-times\"></i>`\n\t\t\t\t}\n\t\t\t},\n\t\t}).render(true);\n\t}\n}\n\nif (!effect) return;\nconst ITEM_UUID = effect;\n\nlet source = await fromUuid(ITEM_UUID);\nif (!source) {\n\tif (args[2].deleteTemplate.includes(\"alt\")) {\n\t\tdeleteTemplate = true\n\t} else {\n\t\tdeleteTemplate = false\n\t}\n\tif ((args[2].altOff && effect === args[2].off) || (args[2].altOn && effect === args[2].on)) {\n\t\tsource = await fromUuid(effect === args[2].altOn ? args[2].altOn : args[2].altOff)\n\t} else {\n\t\treturn pf2eAnimations.debug(\"Add Effect - No Effect Found\", args)\n\t}\n}\n\nawait ask(source, deleteTemplate)","ownership":{"default":0,"SCUQoZ7lvePPTab6":3},"flags":{"advanced-macros":{"runAsGM":false,"runForEveryone":false,"runForSpecificUser":""},"core":{"sourceId":"Macro.US5tGmPkyimygfcx"},"cf":{"id":"temp_6gsujam4gp6"}},"_stats":{"systemId":"pf2e","systemVersion":"4.10.4","coreVersion":"10.291","createdTime":1665450793356,"modifiedTime":1680981256108,"lastModifiedBy":"SCUQoZ7lvePPTab6"},"folder":null,"sort":0,"_id":"x3ZaL34wkz4LljPo"}
{"name":"Add Effect","type":"script","scope":"global","author":"SCUQoZ7lvePPTab6","img":"icons/svg/daze.svg","command":"pf2eAnimations.debug(\"Add Effect Macro\", args)\n\nlet effect;\nlet deleteTemplate = false;\n\nif (args[2].on) effect = args[2].on;\nif (args[2].on && args[2].deleteTemplate === \"on\") deleteTemplate = true;\n\nif (args[2].off && args[0] === \"off\") effect = args[2].off;\nif (args[2].off && args[2].deleteTemplate === \"off\") deleteTemplate = true;\n\n\nasync function ask(source, deleteTemplate) {\n\n\tasync function add() {\n\t\tconst find = args[1].sourceToken.actor.items.find(x => x?.flags?.core?.sourceId === source.flags.core.sourceId)\n\t\tif (find) {\n\t\t\tconsole.log(find)\n\t\t\tfind.update({\"system.badge.value\": find.system.badge.value += 1})\n\t\t} else {\n\t\t\tawait args[1].sourceToken.actor.createEmbeddedDocuments(\"Item\", [source]);\n\t\t}\n\t\tif (deleteTemplate && args[0].documentName === \"MeasuredTemplate\") args[0].delete();\n\t}\n\n\tif (!args[2].ask || game.settings.get(\"pf2e-jb2a-macros\", \"autoAccept\")) {\n\t\tadd();\n\t\treturn;\n\t} else {\n\t\tawait Dialog.wait({\n\t\t\ttitle: \"Add Effect?\",\n\t\t\tcontent: `\n\t\t\t<p>Do you want to add <b>\"${source.name}\"</b> to your character, <b>${args[1].sourceToken.actor.name}</b>?</p>\n\t\t\t<p><i>You can automatically accept these in PF2e Animations settings.</i></p>\n\t\t\t\t\t`,\n\t\t\tbuttons: {\n\t\t\t\tbutton1: {\n\t\t\t\t\tlabel: \"Accept\",\n\t\t\t\t\tcallback: async () => {\n\t\t\t\t\t\tadd();\n\t\t\t\t\t},\n\t\t\t\t\ticon: `<i class=\"fas fa-check\"></i>`\n\t\t\t\t},\n\t\t\t\tbutton2: {\n\t\t\t\t\tlabel: \"Decline\",\n\t\t\t\t\ticon: `<i class=\"fas fa-times\"></i>`\n\t\t\t\t}\n\t\t\t},\n\t\t}).render(true);\n\t}\n}\n\nif (!effect) return;\nconst ITEM_UUID = effect;\n\nlet source = await fromUuid(ITEM_UUID);\nif (!source) {\n\tif (args[2].deleteTemplate.includes(\"alt\")) {\n\t\tdeleteTemplate = true\n\t} else {\n\t\tdeleteTemplate = false\n\t}\n\tif ((args[2].altOff && effect === args[2].off) || (args[2].altOn && effect === args[2].on)) {\n\t\tsource = await fromUuid(effect === args[2].altOn ? args[2].altOn : args[2].altOff)\n\t} else {\n\t\treturn pf2eAnimations.debug(\"Add Effect - No Effect Found\", args)\n\t}\n}\n\nawait ask(source, deleteTemplate)","ownership":{"default":0,"SCUQoZ7lvePPTab6":3},"flags":{"advanced-macros":{"runAsGM":false,"runForEveryone":false,"runForSpecificUser":""},"core":{"sourceId":"Macro.US5tGmPkyimygfcx"},"cf":{"id":"temp_6gsujam4gp6"}},"_stats":{"systemId":"pf2e","systemVersion":"4.10.4","coreVersion":"10.291","createdTime":1665450793356,"modifiedTime":1680981348662,"lastModifiedBy":"SCUQoZ7lvePPTab6"},"folder":null,"sort":0,"_id":"x3ZaL34wkz4LljPo"}
{"name":"Add Effect","type":"script","scope":"global","author":"SCUQoZ7lvePPTab6","img":"icons/svg/daze.svg","command":"pf2eAnimations.debug(\"Add Effect Macro\", args)\n\nlet effect;\nlet deleteTemplate = false;\n\nif (args[2].on) effect = args[2].on;\nif (args[2].on && args[2].deleteTemplate === \"on\") deleteTemplate = true;\n\nif (args[2].off && args[0] === \"off\") effect = args[2].off;\nif (args[2].off && args[2].deleteTemplate === \"off\") deleteTemplate = true;\n\n\nasync function ask(source, deleteTemplate) {\n\n\tasync function add() {\n\t\tconst find = args[1].sourceToken.actor.items.find(x => x?.flags?.core?.sourceId === source.flags.core.sourceId)\n\t\tif (find.system.badge) {\n\t\t\tfind.update({\"system.badge.value\": find.system.badge.value += 1})\n\t\t} else {\n\t\t\tawait args[1].sourceToken.actor.createEmbeddedDocuments(\"Item\", [source]);\n\t\t}\n\t\tif (deleteTemplate && args[0].documentName === \"MeasuredTemplate\") args[0].delete();\n\t}\n\n\tif (!args[2].ask || game.settings.get(\"pf2e-jb2a-macros\", \"autoAccept\")) {\n\t\tadd();\n\t\treturn;\n\t} else {\n\t\tawait Dialog.wait({\n\t\t\ttitle: \"Add Effect?\",\n\t\t\tcontent: `\n\t\t\t<p>Do you want to add <b>\"${source.name}\"</b> to your character, <b>${args[1].sourceToken.actor.name}</b>?</p>\n\t\t\t<p><i>You can automatically accept these in PF2e Animations settings.</i></p>\n\t\t\t\t\t`,\n\t\t\tbuttons: {\n\t\t\t\tbutton1: {\n\t\t\t\t\tlabel: \"Accept\",\n\t\t\t\t\tcallback: async () => {\n\t\t\t\t\t\tadd();\n\t\t\t\t\t},\n\t\t\t\t\ticon: `<i class=\"fas fa-check\"></i>`\n\t\t\t\t},\n\t\t\t\tbutton2: {\n\t\t\t\t\tlabel: \"Decline\",\n\t\t\t\t\ticon: `<i class=\"fas fa-times\"></i>`\n\t\t\t\t}\n\t\t\t},\n\t\t}).render(true);\n\t}\n}\n\nif (!effect) return;\nconst ITEM_UUID = effect;\n\nlet source = await fromUuid(ITEM_UUID);\nif (!source) {\n\tif (args[2].deleteTemplate.includes(\"alt\")) {\n\t\tdeleteTemplate = true\n\t} else {\n\t\tdeleteTemplate = false\n\t}\n\tif ((args[2].altOff && effect === args[2].off) || (args[2].altOn && effect === args[2].on)) {\n\t\tsource = await fromUuid(effect === args[2].altOn ? args[2].altOn : args[2].altOff)\n\t} else {\n\t\treturn pf2eAnimations.debug(\"Add Effect - No Effect Found\", args)\n\t}\n}\n\nawait ask(source, deleteTemplate)","ownership":{"default":0,"SCUQoZ7lvePPTab6":3},"flags":{"advanced-macros":{"runAsGM":false,"runForEveryone":false,"runForSpecificUser":""},"core":{"sourceId":"Macro.US5tGmPkyimygfcx"},"cf":{"id":"temp_6gsujam4gp6"}},"_stats":{"systemId":"pf2e","systemVersion":"4.10.4","coreVersion":"10.291","createdTime":1665450793356,"modifiedTime":1680981366906,"lastModifiedBy":"SCUQoZ7lvePPTab6"},"folder":null,"sort":0,"_id":"x3ZaL34wkz4LljPo"}
{"name":"Add Effect","type":"script","scope":"global","author":"SCUQoZ7lvePPTab6","img":"icons/svg/daze.svg","command":"pf2eAnimations.debug(\"Add Effect Macro\", args)\n\nlet effect;\nlet deleteTemplate = false;\n\nif (args[2].on) effect = args[2].on;\nif (args[2].on && args[2].deleteTemplate === \"on\") deleteTemplate = true;\n\nif (args[2].off && args[0] === \"off\") effect = args[2].off;\nif (args[2].off && args[2].deleteTemplate === \"off\") deleteTemplate = true;\n\n\nasync function ask(source, deleteTemplate) {\n\n\tasync function add() {\n\t\tconst find = args[1].sourceToken.actor.items.find(x => x?.flags?.core?.sourceId === source.flags.core.sourceId)\n\t\tif (find?.system?.badge) {\n\t\t\tfind.update({\"system.badge.value\": find.system.badge.value += 1})\n\t\t} else {\n\t\t\tawait args[1].sourceToken.actor.createEmbeddedDocuments(\"Item\", [source]);\n\t\t}\n\t\tif (deleteTemplate && args[0].documentName === \"MeasuredTemplate\") args[0].delete();\n\t}\n\n\tif (!args[2].ask || game.settings.get(\"pf2e-jb2a-macros\", \"autoAccept\")) {\n\t\tadd();\n\t\treturn;\n\t} else {\n\t\tawait Dialog.wait({\n\t\t\ttitle: \"Add Effect?\",\n\t\t\tcontent: `\n\t\t\t<p>Do you want to add <b>\"${source.name}\"</b> to your character, <b>${args[1].sourceToken.actor.name}</b>?</p>\n\t\t\t<p><i>You can automatically accept these in PF2e Animations settings.</i></p>\n\t\t\t\t\t`,\n\t\t\tbuttons: {\n\t\t\t\tbutton1: {\n\t\t\t\t\tlabel: \"Accept\",\n\t\t\t\t\tcallback: async () => {\n\t\t\t\t\t\tadd();\n\t\t\t\t\t},\n\t\t\t\t\ticon: `<i class=\"fas fa-check\"></i>`\n\t\t\t\t},\n\t\t\t\tbutton2: {\n\t\t\t\t\tlabel: \"Decline\",\n\t\t\t\t\ticon: `<i class=\"fas fa-times\"></i>`\n\t\t\t\t}\n\t\t\t},\n\t\t}).render(true);\n\t}\n}\n\nif (!effect) return;\nconst ITEM_UUID = effect;\n\nlet source = await fromUuid(ITEM_UUID);\nif (!source) {\n\tif (args[2].deleteTemplate.includes(\"alt\")) {\n\t\tdeleteTemplate = true\n\t} else {\n\t\tdeleteTemplate = false\n\t}\n\tif ((args[2].altOff && effect === args[2].off) || (args[2].altOn && effect === args[2].on)) {\n\t\tsource = await fromUuid(effect === args[2].altOn ? args[2].altOn : args[2].altOff)\n\t} else {\n\t\treturn pf2eAnimations.debug(\"Add Effect - No Effect Found\", args)\n\t}\n}\n\nawait ask(source, deleteTemplate)","ownership":{"default":0,"SCUQoZ7lvePPTab6":3},"flags":{"advanced-macros":{"runAsGM":false,"runForEveryone":false,"runForSpecificUser":""},"core":{"sourceId":"Macro.US5tGmPkyimygfcx"},"cf":{"id":"temp_6gsujam4gp6"}},"_stats":{"systemId":"pf2e","systemVersion":"4.10.4","coreVersion":"10.291","createdTime":1665450793356,"modifiedTime":1680981366906,"lastModifiedBy":"SCUQoZ7lvePPTab6"},"folder":null,"sort":0,"_id":"x3ZaL34wkz4LljPo"}

0 comments on commit f97c9fd

Please sign in to comment.