From a9fb0f1918e4f92304a9939ebbb36ccd018c0563 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:00:57 +0200 Subject: [PATCH] Update flipflop.js --- mods/flipflop.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 2f6f9041..e65b6265 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,7 +1,9 @@ elements.flipflop = { properties: { powerstate: "false", + cooldown: "0" }, + if (pixel.cooldown > 0) name: "Flip Flop", color: "#CF300D", state: "solid", @@ -10,11 +12,15 @@ elements.flipflop = { doHeat(pixel) doBurning(pixel) doElectricity(pixel) - + let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] console.log(pixel.powerstate) if (typeof Output !== "undefined" && typeof Input !== "undefined"){ + if (pixel.cooldown > 0){ + Input.charge=0 + pixel.cooldown-- + } Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2) { Input.charge = 0