Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jul 27, 2021
1 parent 8b444af commit cab9106
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packs/macros.db
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{"name":"Set custom BloodSheet","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/tools/hand/brush-paint-pink.webp","scope":"global","command":"const BloodSheetData = {\n aberration: \"#b527d5d5\",\n beast: \"#a51414d8\",\n celestial: \"#55a6cdd5\",\n construct: \"#5f4d39d5\",\n dragon: \"#6a0e0ed8\",\n elemental: \"#737373b1\",\n fey: \"#afea44d8\",\n fiend: \"#b71e46d8\",\n giant: \"#541e1ed8\",\n humanoid: \"#a51414d8\",\n monstrosity: \"#810808d8\",\n ooze: \"#f3900fd8\",\n plant: \"#195d09d8\",\n undead: \"#440707d8\",\n};\n\ngame.settings.set(\"splatter\", \"BloodSheetData\", BloodSheetData);","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.NTw7izfO3KH3JDkd"}},"_id":"0xkDU2f2dzJFeVj3"}
{"name":"Splat Token","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/death/skull-weapon-staff-glow-pink.webp","scope":"global","command":"if(!_token) return;\nBloodSplatter.socketSplat(_token)","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.6wMaAHw0mY06Jc54"}},"_id":"WJH8Q05u2z5lBW6m"}
{"name":"Clear Blood for all clients","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/skills/wounds/injury-stitched-flesh-red.webp","scope":"global","command":"BloodSplatterSocket.executeForEveryone(\"ClearAll\");","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.nM8xo3bDcLYJMJQ7"}},"_id":"31E1phBqnoeb7YCm"}
7 changes: 7 additions & 0 deletions scripts/BloodSplatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ class BloodSplatter {
BloodSplatterSocket.executeForEveryone("Splat", tokenIds);
}

static clearAll(){
if (canvas.background.BloodSplatter) {
canvas.background.BloodSplatter.Destroy();
}
}

static belowTreshold(actor) {
if (!actor) return false;
const hpMax = BloodSplatter.getHpMax(actor.data);
Expand Down Expand Up @@ -245,6 +251,7 @@ let BloodSplatterSocket;
Hooks.once("socketlib.ready", () => {
BloodSplatterSocket = socketlib.registerModule("splatter");
BloodSplatterSocket.register("Splat", BloodSplatter.socketSplatFn);
BloodSplatterSocket.register("ClearAll", BloodSplatter.clearAll);
});

Hooks.on("preUpdateActor", function (actor, updates) {
Expand Down

0 comments on commit cab9106

Please sign in to comment.