Skip to content

Commit

Permalink
Merge pull request #28 from cirrahn/feature/fxpass-tweaks-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Z3nner authored Jan 9, 2024
2 parents 3286786 + 416d06f commit 84309a0
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 72 deletions.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ The workflow for creating and editing macros is as follows:
- To edit an existing macro, edit the files in `packs_source/weaponfx.db/<macro name>.[js|json]`
- Then, compile the macro compendium with `npm run db:pack`

You can then copy the module files (or symlink the folder) into your Foundry modules directory to test in-game.
The `weaponfx` pack is the default. To create a macro in a different pack, use `--pack <packName>`, for example: `npm run new-effect "My Manual Name" -- --pack weaponfx_manual`

You can then copy the module files (or symlink the folder) into your Foundry modules directory to test in-game.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"db:unpack": "node tooling/unpack-macros.mjs",
"db:pack": "node tooling/pack-macros.mjs",
"new-effect": "node tooling/create-new-effect.mjs ",
"new-effect": "node tooling/create-new-effect.mjs",
"test": "npm run test:packs && npm run test:js",
"test:js": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test:packs": "npm run db:pack && git diff --no-patch --exit-code packs/weaponfx.db && echo 'Pack test passed!'"
Expand Down
2 changes: 0 additions & 2 deletions packs/weaponfx.db
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
{"_id":"ui1a07lCGBOk4Rp7","name":"Plasma Talons","type":"script","author":"LancerWeaponFX00","img":"modules/lancer-weapon-fx/icons/claw-slashes.png","scope":"global","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nlet sequence = new Sequence();\n\nfor (const target of targetTokens) {\n\n sequence.effect()\n .file(\"jb2a.claws.400px.red\")\n .tint(\"#720d87\")\n .scale(0.8)\n .zIndex(1)\n .opacity(0.6)\n .atLocation(target)\n .missed(targetsMissed.has(target.id));\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/Melee.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n .repeats(2, 250);\n if (!targetsMissed.has(target.id)) {\n sequence.effect()\n .file(\"jb2a.impact.blue.2\")\n .scale(1.0)\n .tint(\"#c91af9\")\n .atLocation(target, {randomOffset:0.1|true})\n .delay(200)\n .repeats(2, 250);\n }\n}\nsequence.play();"}
{"_id":"e5XwWrHsiRKrgh7S","name":"Plasma Thrower","type":"script","author":"LancerWeaponFX00","img":"modules/lancer-weapon-fx/icons/lightning-flame.png","scope":"global","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nconst target = game.modules.get(\"lancer-weapon-fx\").api.getTargetLocationsFromTokenGroup(targetTokens, 1)[0];\n\nlet sequence = new Sequence()\n\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/flamethrower_fire.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n sequence.effect()\n .file(\"jb2a.breath_weapons02.burst.cone.fire.orange.02\")\n .atLocation(sourceToken)\n\t.filter(\"ColorMatrix\", {hue: 270})\n .filter(\"Glow\", {distance: 3, color: 0xe99649, innerStrength: 2})\n .scale({x: 0.9})\n .playbackRate(1.6)\n .rotateTowards(target)\n .waitUntilFinished(-3500);\n\nfor (let i=0; i < targetTokens.length; i++) {\n let target = targetTokens[i];\n\n if (!targetsMissed.has(target.id)) {\n sequence.effect()\n .file(\"jb2a.flames.02.orange\")\n\t .filter(\"ColorMatrix\", {hue: 270})\n .filter(\"Glow\", {distance: 3, color: 0xe99649, innerStrength: 2})\n .opacity(0.7)\n .fadeIn(800)\n .fadeOut(800)\n .atLocation(target)\n\t .scaleToObject(1.2);\n }\n}\n sequence.play();"}
{"_id":"UL0licrIIu44WXnO","name":"Plasma Torch","type":"script","author":"LancerWeaponFX00","img":"modules/lancer-weapon-fx/icons/laserburn.png","scope":"global","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nconst target = targetTokens[0];\n\nlet sequence = new Sequence()\n .effect()\n .file(\"jb2a.fire_jet.orange\")\n .atLocation(sourceToken)\n .stretchTo(target)\n .sound()\n .file(\"modules/lancer-weapon-fx/soundfx/flamethrower_fire.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n .play();"}
{"_id":"7S31ONuehIUe8R0Q","name":"PlasmaProjector","img":"modules/JB2A_DnD5e/Library/6th_Level/Disintegrate/Disintegrate_01_Regular_Green01_Thumb.webp","type":"script","scope":"global","author":"LancerWeaponFX00","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nconst target = targetTokens[0];\n\nnew Sequence()\n\n .canvasPan()\n .duration(1000)\n .atLocation(sourceToken)\n .scale(0.25)\n .effect()\n .file(\"jb2a.disintegrate.green\")\n .delay(1000)\n .startTime(1)\n .scale(2)\n .playbackRate(0.6)\n .filter(\"Glow\", {distance: 3, color: 0x98ec5f, innerStrength: 2})\n .atLocation(sourceToken)\n .stretchTo(target)\n .waitUntilFinished(-3400)\n .canvasPan()\n\t.duration(2000)\n .atLocation(target)\n .scale(0.4)\n .waitUntilFinished(-500)\n .effect()\n .file(\"jb2a.impact.blue\")\n .filter(\"ColorMatrix\", {hue: 270})\n .scaleToObject()\n .atLocation(target, {randomOffset: 1.2, gridUnits: true})\n .repeats(10, 200, 700)\n .waitUntilFinished(-500)\n\t.effect(\"modules/lancer-weapon-fx/sprites/jetlancer_explosion_white_bg.png\")\n\t\t.fadeIn(100)\n\t\t.duration(6000)\n\t\t.fadeOut(3000)\n\t\t.screenSpace()\n\t.effect(\"modules/lancer-weapon-fx/sprites/shockwave.png\")\n\t\t.atLocation(target)\n .filter(\"ColorMatrix\", {hue: 090})\n\t\t.duration(7000)\n\t\t.scale(0.2)\n\t\t.scaleOut(12, 7000)\n\t\t.fadeOut(7000)\n\t\t.delay(3000)\n\t.sound(\"modules/lancer-weapon-fx/soundfx/pw_nuke.ogg\")\n\t\t.startTime(800)\n\t\t.delay(1000)\n\t.effect(\"modules/lancer-weapon-fx/video/pw_nuke_effect.webm\")\n .filter(\"ColorMatrix\", {hue: 090})\n\t\t.delay(1000)\n\t\t.atLocation(target)\n\t\t.aboveLighting()\n\t\t.xray()\n\t\t.scale(1)\n\t\t.zIndex(100)\n\t\t.thenDo(remainsAftermath)\n\t.canvasPan()\n\t\t.delay(1000)\n .atLocation(target)\n .scale(0.5)\n\t\t.shake({\n\t\t\tduration: 20000,\n\t\t\tstrength: 15,\n\t\t\tfadeOutDuration: 10000,\n\t\t\trotation: true\n\t\t})\n\n.play();\n\nfunction remainsAftermath() {\n\tconsole.log(\"AFTERMATH\");\n\ttargetTokens[0].document.update({hidden: true});\n}"}
{"_id":"oGArtZBtIRBcRHCh","name":"Power Knuckle","type":"script","author":"LancerWeaponFX00","img":"modules/lancer-weapon-fx/icons/thor-fist.png","scope":"global","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nlet sequence = new Sequence();\n\nfor (const target of targetTokens) {\n sequence.effect()\n .file(\"jb2a.unarmed_strike.physical.02.blue\")\n .scale(0.9)\n .atLocation(sourceToken)\n .moveTowards(target)\n .missed(targetsMissed.has(target.id));\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/knuckleswing.ogg\")\n .delay(300)\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.7));\n if (!targetsMissed.has(target.id)) {\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/knucklehit.ogg\")\n .delay(600)\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.8))\n .waitUntilFinished(-100);\n }\n}\nsequence.play();"}
{"_id":"LxQMeItXellYRt3b","name":"PPC","type":"script","author":"LancerWeaponFX00","img":"modules/JB2A_DnD5e/Library/6th_Level/Chain_Lightning/ChainLightning_01_Regular_Blue_Primary_Thumb.webp","scope":"global","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nlet sequence = new Sequence();\n\nfor (const target of targetTokens) {\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/PPC2.ogg\")\n .delay(400)\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5));\n sequence.effect()\n .file(\"jb2a.chain_lightning.primary.blue\")\n .scale(0.7)\n .atLocation(sourceToken)\n .stretchTo(target)\n .missed(targetsMissed.has(target.id));\n}\nsequence.play();"}
{"name":"Railgun","type":"script","author":"LancerWeaponFX00","img":"modules/lancer-weapon-fx/icons/supersonic-bullet.png","scope":"global","_id":"iOD860W9KokfR3Hy","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nconst findFarthestTargetOfGroup = function (targetTokens) {\n let farthestToken = null;\n let farthestTokenDistance = 0;\n targetTokens.forEach(t => {\n let distance = canvas.grid.measureDistance(sourceToken, t);\n if (distance > farthestTokenDistance) {\n farthestToken = t;\n farthestTokenDistance = distance;\n }\n });\n\n return farthestToken;\n};\n\nconst target = findFarthestTargetOfGroup(targetTokens);\n\nconst repeatImpactAnimationForEachTarget = function (sequence, targets) {\n targets.forEach(t => {\n if (!targetsMissed.has(t.id)) {\n sequence.effect()\n .file(\"jb2a.impact.orange.0\")\n .atLocation(t)\n .rotateTowards(sourceToken)\n .rotate(230)\n .center()\n }\n });\n return sequence;\n}\n\n\nlet sequence = new Sequence()\n\n .sound()\n .file(\"modules/lancer-weapon-fx/soundfx/Annihilator_Charge.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n .waitUntilFinished(-500);\n\n sequence.effect()\n .file(\"jb2a.bullet.Snipe.blue\")\n .atLocation(sourceToken)\n .stretchTo(target)\n\n .sound()\n .file(\"modules/lancer-weapon-fx/soundfx/AMR_Fire.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n \n .sound()\n .file(\"modules/lancer-weapon-fx/soundfx/AMR_Impact.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.5))\n ;\n\nsequence = repeatImpactAnimationForEachTarget(sequence, targetTokens);\n\nsequence.play();"}
{"name":"Retort Loop","type":"script","author":"LancerWeaponFX00","img":"modules/JB2A_DnD5e/Library/Generic/Energy/EnergyBeam_02_Regular_BluePink_Thumb.webp","scope":"global","_id":"NbTm6IW88EKyM6sN","command":"const {targetsMissed, targetTokens, sourceToken} = game.modules.get(\"lancer-weapon-fx\").api.getMacroVariables(typeof messageId === \"undefined\" ? null : messageId, actor);\n\nlet sequence = new Sequence();\n\nfor (const target of targetTokens) {\n sequence.sound()\n .file(\"modules/lancer-weapon-fx/soundfx/RetortLoop.ogg\")\n .volume(game.modules.get(\"lancer-weapon-fx\").api.getEffectVolume(0.8));\n sequence.effect()\n .file(\"jb2a.energy_beam.normal.bluepink.02\")\n .scale(0.7)\n .atLocation(sourceToken)\n .stretchTo(target)\n .missed(targetsMissed.has(target.id))\n .name(\"impact\")\n .delay(200);\n if (!targetsMissed.has(target.id)) {\n sequence.effect()\n .file(\"jb2a.impact.blue\")\n .scale(0.3)\n .atLocation(target, {randomOffset: 0.9})\n .repeats(8, 200)\n .delay(700);\n }\n else {\n sequence.effect()\n .file(\"jb2a.impact.blue\")\n .scale(0.3)\n .atLocation(\"impact\", {randomOffset: 0.9})\n .repeats(8, 200)\n .delay(700);\n }\n}\nsequence.play();"}
Expand Down
Loading

0 comments on commit 84309a0

Please sign in to comment.