From 2e07fc1e04692935a8f40676fb7a6707c546c5b7 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Sat, 12 Feb 2022 19:17:04 -0500 Subject: [PATCH] cursed shock tool --- mods/igniter.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mods/igniter.js b/mods/igniter.js index 1cc04e76..aff8cdd3 100644 --- a/mods/igniter.js +++ b/mods/igniter.js @@ -17,3 +17,37 @@ elements.extinguisher = { category: "tools", excludeRandom: true, }; + +elements.cursed_shock = { + color: ["#ffff00", "#00ff00", "#ffff00", "#00ff00", "#ffff00", "#00ff00", "#ffff00", "#00ff00"], + tool: function(pixel) { + var con = elements[pixel.element].conduct; + if (con == undefined) {con = 0} + if (Math.random() < con || con == 0) { // If random number is less than conductivity, or anyway + if (!pixel.charge && !pixel.chargeCD) { + pixel.charge = 1; + if (elements[pixel.element].colorOn) { + pixel.color = pixelColorPick(pixel); + } + } + } + if(Math.random() > con) { + if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation) + pixel.temp += 0.25; + pixelTempCheck(pixel); + } + } + }, + category: "tools", + excludeRandom: true, +}; + +elements.extinguisher = { + color: "#bad1e3", + tool: function(pixel) { + if(pixel.burnStart) { delete pixel.burnStart } + pixel.burning = false; + }, + category: "tools", + excludeRandom: true, +};