From 029c414f707f1760a3a4078064992b0d26cdf0ad Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:29:51 -0400 Subject: [PATCH 01/41] Update mod-list.html --- mod-list.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod-list.html b/mod-list.html index 7ce3c121..78b034c8 100644 --- a/mod-list.html +++ b/mod-list.html @@ -92,6 +92,7 @@ Official alchemy.jsStart with only 4 elements and unlock more by reacting them together. (Most are not possible)R74n classic_textures.jsUse textures from early versions of the gameR74n +color_everything.jsAllows every element to have a custom colorR74n devtests.jsExperimental features from the Sandboxels developer; Currently there is Earthquake in WeaponsR74n edible_everything.jsAllows every element to be mixed into Batter and DoughR74n fools.jsAdds back FOOLS ModeR74n @@ -103,6 +104,7 @@ Tools & Settings adjustablepixelsize.jsAllows you to set the pixelSize with a URL parameterAlice +betterModManager.jsImprovements to the Mod Managerggod betterSettings.jsAdds additional settings and functionalityggod betterStats.jsSeparate “real” and “set” TPS, meaning you can see what the TPS actually is, instead of only seeing what it’s set tomollthecoder change.jsAdds a tool that only replaces existing pixelsAlice @@ -173,6 +175,7 @@ life_eater.jsAdds Warhammer 40,000’s Life-Eater Virus and Virus BombsAlice liquid_void.jsAdds a liquid variant of VoidAlice more_breaking.jsAllows for breaking more elements in explosionsAlice +rays.jsAdds more Ray typesAlice Food & Cooking bananas.jsAdds bananas and banana plantsAlice @@ -228,6 +231,7 @@ Technical Libraries & Tests a_bundle_of_tests.jsSeveral test functionsAlice +betterMenuScreens.jsLibrary for mods to create their own menusggod changePixelDebug.jsMakes the changePixel() function abort and log to console when it tries to change to a non-existent elementAlice changeTempReactionParameter.jsAdds the changeTemp property to modded reactionsAlice code_library.jsAdds functions and variables common to some other modsAlice @@ -235,6 +239,7 @@ date_test.jsK-pop idol birthday testing stuffAlice drawPixels_change_test.jsA test of altering drawPixels(). Gives burning pixels a red overlay similar to the yellow overlay for charged pixelsAlice example_mod.jsAn example mod for new moddersR74n +explodeAtPlus.jsExtension of the explodeAt function with more optionsAlice fill_script.jsScript that fills an areaTealEgg#7646 generative_mods.jsModpack with optional mass element generationAlice generator_prompt.jsAdds a prompt to use generative_mods.js’s element generators after the game finishes loadingAlice From 9406ed6f83ea42542c7eac00eb1849e9129fc7c1 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:31:57 -0400 Subject: [PATCH 02/41] Update example_mod.js --- mods/example_mod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/example_mod.js b/mods/example_mod.js index 5dda9025..ddf36999 100644 --- a/mods/example_mod.js +++ b/mods/example_mod.js @@ -2,7 +2,7 @@ // Create a new Javascript file like this one. // Add the file to the mods folder on GitHub, or host it somewhere else. -// https://github.com/slweeb/sandboxels/tree/main/mods +// https://github.com/R74nCom/sandboxels/tree/main/mods // To add it in the Mod Loader: // If it is in the mods folder, you can just use the name of the file. From c4853f8a56bf0bf1d12b124bc5787f271d9bca07 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:20:08 -0400 Subject: [PATCH 03/41] Update mod-list.html --- mod-list.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod-list.html b/mod-list.html index 78b034c8..8e6894d6 100644 --- a/mod-list.html +++ b/mod-list.html @@ -97,6 +97,7 @@ edible_everything.jsAllows every element to be mixed into Batter and DoughR74n fools.jsAdds back FOOLS ModeR74n smooth_water.jsChanges water mechanics so that it flows in one direction until it bounces off of somethingR74n +spring.jsMany nature elements, like sakura trees, butterflies, beehives, and moreR74n velocity.jsBeta for explosion velocity, and later wind, which may come to the base game in the futureR74n @@ -197,6 +198,7 @@ nocancer.jsRemoves cancer from the game one tick after it is createdmollthecoder nocancer2.jsRemoves cancer from the game altogether. May be incompatible with other mods that spawn cancermollthecoder primordial_birthpool.jsA cross between Primordial Soup and Birthpool. Requires F&MAlice +spring.jsMany nature elements, like sakura trees, butterflies, beehives, and moreR74n toothpaste.jsTeeth and pasteAlice Fun & Games From cb80394d72b4e94a758d326e6a2db05ea7eb2cd6 Mon Sep 17 00:00:00 2001 From: Melecie <97272289+Melecie@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:35:19 +0800 Subject: [PATCH 04/41] hidden ground is weird with runafterautogen --- mods/hidden_ground.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mods/hidden_ground.js b/mods/hidden_ground.js index 94b8534e..0eb59ac1 100644 --- a/mods/hidden_ground.js +++ b/mods/hidden_ground.js @@ -4,13 +4,13 @@ runAfterLoad(function() { if (enabledMods.includes("mods/the_ground.js")) { let regexRocks = /(granite)|(rhyolite)|(pumice)|(obsidian)|(dacite)|(dacidian)|(andesite)|(diorite)|(scoria)|(andesidian)|(gabbro)|(basalt)|(basalidian)|(peridotite)|(komatiite)|(komatidian)/ - let regexType = /(_gravel)|(_sand)|(_dust)|(_shard)|(hot_)/ + let regexType = /(_gravel)|(_sand)|(_sandstone)|(_dust)|(_shard)|(hot_)/ let toHide = ["dry_permafrost", "hot_sand", "hot_dirt", "hot_rock", "hot_rock_wall", "hot_gravel", "hot_limestone", "hot_calcium_carbonate_dust", "sandy_water", "clay_water", "dry_clay_loam"] // hides all elements part of both rocks and type // false positives *can* be hit because this doesn't check if it comes from The Ground (it can't), but ideally none given how specific it is - for (elem in elements) { - if (regexRocks.test(elem)) { + for (let elem in elements) { + if (typeof(elements[elem]) == "object" && regexRocks.test(elem)) { // move wall to solids to not make land too big if (/_wall/.test(elem)) { elements[elem].category = "solids" @@ -23,12 +23,14 @@ runAfterLoad(function() { } // manual hiding - for (elem in toHide) { - elements[toHide[elem]].hidden = true; + for (let elem of toHide) { + if (typeof(elements[elem]) == "object") { + elements[elem].hidden = true; + } } // while i'm here, might as well fix Sandstone's color - elements.sandstone.color = "#dbbe80"; + //elements.sandstone.color = "#dbbe80"; } else { From 826395a5ac631dba515f74d998d40f471449bbe6 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:32:09 +0200 Subject: [PATCH 05/41] Create flipflop.js --- mods/flipflop.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 mods/flipflop.js diff --git a/mods/flipflop.js b/mods/flipflop.js new file mode 100644 index 00000000..c60957e7 --- /dev/null +++ b/mods/flipflop.js @@ -0,0 +1,26 @@ +elements.flipflop = { + name: "Flip Flop", + color: "#CF300D", + state: "solid", + category: "machines", + conduct: 1, + tick: function(pixel) { + doHeat(pixel) + doBurning(pixel) + doElectricity(pixel) + + let Powerstate + let Output = pixelMap[pixel.x+1][pixel.y] + let Input = pixelMap[pixel.x-1][pixel.y] + Output.charge = 0 + if (Powerstate == true && Input.charge > 0.9) { + Powerstate == false + pixel.color = "#CF300D" + Output.charge = 0 + } else if (Powerstate == false && Input.charge < 0.9) { + Powerstate == true + pixel.color = "#94CF0D" + Output.charge = 5 + } + } +}; From 7c55edc462a467214f8e48f2b5686c8c05cbb2be Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:38:08 +0200 Subject: [PATCH 06/41] Update flipflop.js --- mods/flipflop.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index c60957e7..7fe25bea 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,26 +1,27 @@ elements.flipflop = { + powerstate: "false", name: "Flip Flop", - color: "#CF300D", + color: "#CF300D", state: "solid", - category: "machines", + category: "machines", conduct: 1, tick: function(pixel) { doHeat(pixel) doBurning(pixel) doElectricity(pixel) - let Powerstate - let Output = pixelMap[pixel.x+1][pixel.y] - let Input = pixelMap[pixel.x-1][pixel.y] + let Powerstate = pixel.powerst + let Output = pixelMap[pixel.x+1][pixel.y] + let Input = pixelMap[pixel.x-1][pixel.y] Output.charge = 0 - if (Powerstate == true && Input.charge > 0.9) { - Powerstate == false - pixel.color = "#CF300D" - Output.charge = 0 + if (Powerstate == "true" && Input.charge > 0.9) { + Powerstate == "false" + pixel.color = "#CF300D" + Output.charge = 0 } else if (Powerstate == false && Input.charge < 0.9) { - Powerstate == true - pixel.color = "#94CF0D" - Output.charge = 5 - } + Powerstate == true + pixel.color = "#94CF0D" + Output.charge = 5 + } } }; From b90b6d90e535d299f96f686c90a72434af13f42e Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:05:49 +0200 Subject: [PATCH 07/41] Update flipflop.js --- mods/flipflop.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 7fe25bea..1efb30d4 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -13,15 +13,18 @@ elements.flipflop = { let Powerstate = pixel.powerst let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - Output.charge = 0 - if (Powerstate == "true" && Input.charge > 0.9) { - Powerstate == "false" - pixel.color = "#CF300D" - Output.charge = 0 - } else if (Powerstate == false && Input.charge < 0.9) { - Powerstate == true - pixel.color = "#94CF0D" - Output.charge = 5 - } + + if (isEmpty(Output.x,Output.y) == false && isEmpty(Input.x,Input.y)){ + Output.charge = 0 + if (Powerstate == "true" && Input.charge > 0.9) { + Powerstate == "false" + pixel.color = "#CF300D" + Output.charge = 0 + } else if (Powerstate == false && Input.charge < 0.9) { + Powerstate == true + pixel.color = "#94CF0D" + Output.charge = 5 + } + } } }; From a81c89c2d21a5898858dfcac22a771fd1afd5341 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:13:17 +0200 Subject: [PATCH 08/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 1efb30d4..639f02cb 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,7 +14,7 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - if (isEmpty(Output.x,Output.y) == false && isEmpty(Input.x,Input.y)){ + if (Output.x != undefined && Input.x != undefined)){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.9) { Powerstate == "false" From 03e5678682f6558d1e64165b926be245f19240fe Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:18:48 +0200 Subject: [PATCH 09/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 639f02cb..3e5acc6c 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,7 +14,7 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - if (Output.x != undefined && Input.x != undefined)){ + if (Output.x != undefined && Input.x != undefined){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.9) { Powerstate == "false" From fd984eddaa4c78e9903cfe22c1bbf06dd6d14033 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:25:52 +0200 Subject: [PATCH 10/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 3e5acc6c..0c826582 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,7 +14,7 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - if (Output.x != undefined && Input.x != undefined){ + if (typeof Output.x !== "undefined" && typeof Input.x !== "undefined"){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.9) { Powerstate == "false" From d5066e46b3a5517a75e2a2c878998f11bfb94f4a Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:29:04 +0200 Subject: [PATCH 11/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 0c826582..c5a9ef68 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -13,8 +13,8 @@ elements.flipflop = { let Powerstate = pixel.powerst let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - - if (typeof Output.x !== "undefined" && typeof Input.x !== "undefined"){ + console.log(Output) + if (typeof Output !== "null" && typeof Input !== "null"){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.9) { Powerstate == "false" From 04e1bcd2db3ba31b6ab672523833d535237ca6a8 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:32:36 +0200 Subject: [PATCH 12/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index c5a9ef68..18460574 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -13,8 +13,8 @@ elements.flipflop = { let Powerstate = pixel.powerst let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - console.log(Output) - if (typeof Output !== "null" && typeof Input !== "null"){ + console.log(typeof Output) + if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.9) { Powerstate == "false" From 46110d56cb2fa8d9542bb813aeb00cba2020648f Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:42:08 +0200 Subject: [PATCH 13/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 18460574..ece81fb6 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -16,11 +16,11 @@ elements.flipflop = { console.log(typeof Output) if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 - if (Powerstate == "true" && Input.charge > 0.9) { + if (Powerstate == "true" && Input.charge > 0.2) { Powerstate == "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (Powerstate == false && Input.charge < 0.9) { + } else if (Powerstate == false && Input.charge > 0.2) { Powerstate == true pixel.color = "#94CF0D" Output.charge = 5 From c9bea6dd89f642dbb2bf93911b01f679e03bb94d Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:44:41 +0200 Subject: [PATCH 14/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index ece81fb6..c00dc367 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -17,11 +17,11 @@ elements.flipflop = { if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 if (Powerstate == "true" && Input.charge > 0.2) { - Powerstate == "false" + Powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 } else if (Powerstate == false && Input.charge > 0.2) { - Powerstate == true + Powerstate = true pixel.color = "#94CF0D" Output.charge = 5 } From 92b23492d729ed3482b9fb4083e4859ee68af609 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:49:57 +0200 Subject: [PATCH 15/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index c00dc367..b9e29ae1 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -10,7 +10,7 @@ elements.flipflop = { doBurning(pixel) doElectricity(pixel) - let Powerstate = pixel.powerst + let Powerstate = pixel.powerstate let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] console.log(typeof Output) From ebffb3b65d9df9be4044d32d8c28cc62b3caf5f7 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:53:49 +0200 Subject: [PATCH 16/41] Update flipflop.js --- mods/flipflop.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index b9e29ae1..f111e2d8 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -10,18 +10,16 @@ elements.flipflop = { doBurning(pixel) doElectricity(pixel) - let Powerstate = pixel.powerstate let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - console.log(typeof Output) if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 - if (Powerstate == "true" && Input.charge > 0.2) { - Powerstate = "false" + if (pixel.powerstate == "true" && Input.charge > 0.2) { + pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (Powerstate == false && Input.charge > 0.2) { - Powerstate = true + } else if (pixel.powerstate == "false" && Input.charge > 0.2) { + pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 } From 53b47488de0112b99505dd578c82d4a2998ce79d Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:15:54 +0200 Subject: [PATCH 17/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index f111e2d8..a4a93ed6 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,11 +14,11 @@ elements.flipflop = { let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 - if (pixel.powerstate == "true" && Input.charge > 0.2) { + if (pixel.powerstate == "true" && pixel.charge > 0.2) { pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (pixel.powerstate == "false" && Input.charge > 0.2) { + } else if (pixel.powerstate == "false" && pixel.charge > 0.2) { pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 From a8999ba4dc92119b0c95f86bda045c4ad7967655 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:34:55 +0200 Subject: [PATCH 18/41] Update flipflop.js --- mods/flipflop.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index a4a93ed6..b96ae2cc 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,5 +1,7 @@ elements.flipflop = { - powerstate: "false", + properties: { + powerstate: "false", + }, name: "Flip Flop", color: "#CF300D", state: "solid", @@ -12,14 +14,17 @@ elements.flipflop = { 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"){ Output.charge = 0 if (pixel.powerstate == "true" && pixel.charge > 0.2) { pixel.powerstate = "false" pixel.color = "#CF300D" + console.log(pixel.powerstate+"y") Output.charge = 0 } else if (pixel.powerstate == "false" && pixel.charge > 0.2) { pixel.powerstate = "true" + console.log(pixel.powerstate+"n") pixel.color = "#94CF0D" Output.charge = 5 } From 0e9b52edc5be3a5f8fdfc2b42500c2c50c9bbd2d Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:39:19 +0200 Subject: [PATCH 19/41] Update flipflop.js --- mods/flipflop.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index b96ae2cc..6fef2f84 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -6,7 +6,6 @@ elements.flipflop = { color: "#CF300D", state: "solid", category: "machines", - conduct: 1, tick: function(pixel) { doHeat(pixel) doBurning(pixel) @@ -17,12 +16,12 @@ elements.flipflop = { console.log(pixel.powerstate) if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 - if (pixel.powerstate == "true" && pixel.charge > 0.2) { + if (pixel.powerstate == "true" && Input.charge > 0.2) { pixel.powerstate = "false" pixel.color = "#CF300D" console.log(pixel.powerstate+"y") Output.charge = 0 - } else if (pixel.powerstate == "false" && pixel.charge > 0.2) { + } else if (pixel.powerstate == "false" && Input.charge > 0.2) { pixel.powerstate = "true" console.log(pixel.powerstate+"n") pixel.color = "#94CF0D" From 89b75ae78ece04d8e4c68b1e1d127ea17e3f76f9 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:45:07 +0200 Subject: [PATCH 20/41] Update flipflop.js --- mods/flipflop.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/flipflop.js b/mods/flipflop.js index 6fef2f84..2f6f9041 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -17,11 +17,13 @@ elements.flipflop = { if (typeof Output !== "undefined" && typeof Input !== "undefined"){ Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2) { + Input.charge = 0 pixel.powerstate = "false" pixel.color = "#CF300D" console.log(pixel.powerstate+"y") Output.charge = 0 } else if (pixel.powerstate == "false" && Input.charge > 0.2) { + Input.chare = 0 pixel.powerstate = "true" console.log(pixel.powerstate+"n") pixel.color = "#94CF0D" 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 21/41] 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 From ba4cc950893df65fc9a5a6bc1d70a907077bcebb Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:12:32 +0200 Subject: [PATCH 22/41] Update flipflop.js --- mods/flipflop.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index e65b6265..10996d7f 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -15,23 +15,23 @@ elements.flipflop = { 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-- + Input.charge = 0 + pixel.cooldown-- + console.log(pixel.cooldown) } Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2) { Input.charge = 0 + pixel.cooldown = 3 pixel.powerstate = "false" pixel.color = "#CF300D" - console.log(pixel.powerstate+"y") Output.charge = 0 } else if (pixel.powerstate == "false" && Input.charge > 0.2) { Input.chare = 0 + pixel.cooldown = 3 pixel.powerstate = "true" - console.log(pixel.powerstate+"n") pixel.color = "#94CF0D" Output.charge = 5 } From 59077603327b813f4b6fd5ad95a015fa7e8ee4d9 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:22:44 +0200 Subject: [PATCH 23/41] Update flipflop.js --- mods/flipflop.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 10996d7f..d357e5e2 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,9 +1,8 @@ elements.flipflop = { properties: { powerstate: "false", - cooldown: "0" + cooldown: "0", }, - if (pixel.cooldown > 0) name: "Flip Flop", color: "#CF300D", state: "solid", From 3cb596cdd7709d957d8b5b49d388dab2bf31752d Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:25:48 +0200 Subject: [PATCH 24/41] Update flipflop.js --- mods/flipflop.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index d357e5e2..384ed391 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -16,18 +16,17 @@ elements.flipflop = { let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined"){ if (pixel.cooldown > 0){ - Input.charge = 0 pixel.cooldown-- console.log(pixel.cooldown) } Output.charge = 0 - if (pixel.powerstate == "true" && Input.charge > 0.2) { + if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown > 0) { Input.charge = 0 pixel.cooldown = 3 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (pixel.powerstate == "false" && Input.charge > 0.2) { + } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown > 0) { Input.chare = 0 pixel.cooldown = 3 pixel.powerstate = "true" From 6f592dc3ef446c25bff52b8b24f43e251aa731f8 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:28:13 +0200 Subject: [PATCH 25/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 384ed391..dedc60bb 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -20,13 +20,13 @@ elements.flipflop = { console.log(pixel.cooldown) } Output.charge = 0 - if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown > 0) { + if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.charge = 0 pixel.cooldown = 3 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown > 0) { + } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.chare = 0 pixel.cooldown = 3 pixel.powerstate = "true" From 024ababf3cd031efdd12edf9d81ca07aac12dc04 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:35:40 +0200 Subject: [PATCH 26/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index dedc60bb..a748121d 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -22,13 +22,13 @@ elements.flipflop = { Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.charge = 0 - pixel.cooldown = 3 + pixel.cooldown = 7 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.chare = 0 - pixel.cooldown = 3 + pixel.cooldown = 7 pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 From 3c3b20d33dcaf2bdba944462b048647450d310ca Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:42:03 +0200 Subject: [PATCH 27/41] Update flipflop.js --- mods/flipflop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index a748121d..d2cfde8e 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -22,13 +22,13 @@ elements.flipflop = { Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.charge = 0 - pixel.cooldown = 7 + pixel.cooldown = 5 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.chare = 0 - pixel.cooldown = 7 + pixel.cooldown = 5 pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 From 82c897e70e8c82cf951e13c013a48d9f9f1845fb Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:06:19 +0200 Subject: [PATCH 28/41] Update flipflop.js --- mods/flipflop.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index d2cfde8e..53bfbfee 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -17,7 +17,6 @@ elements.flipflop = { if (typeof Output !== "undefined" && typeof Input !== "undefined"){ if (pixel.cooldown > 0){ pixel.cooldown-- - console.log(pixel.cooldown) } Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { @@ -27,7 +26,7 @@ elements.flipflop = { pixel.color = "#CF300D" Output.charge = 0 } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown < 1) { - Input.chare = 0 + Input.charge = 0 pixel.cooldown = 5 pixel.powerstate = "true" pixel.color = "#94CF0D" From f42131ad3f1dbf14ce535315801e72c943bf6ac8 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:12:48 +0200 Subject: [PATCH 29/41] Update flipflop.js --- mods/flipflop.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 53bfbfee..4404d1f3 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -17,8 +17,6 @@ elements.flipflop = { if (typeof Output !== "undefined" && typeof Input !== "undefined"){ if (pixel.cooldown > 0){ pixel.cooldown-- - } - Output.charge = 0 if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { Input.charge = 0 pixel.cooldown = 5 From c21cf97a4202b92f44b4343017db556433dfd2dc Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:13:59 +0200 Subject: [PATCH 30/41] Update flipflop.js --- mods/flipflop.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 4404d1f3..431020da 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,7 +1,6 @@ elements.flipflop = { properties: { powerstate: "false", - cooldown: "0", }, name: "Flip Flop", color: "#CF300D", @@ -14,18 +13,14 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - if (typeof Output !== "undefined" && typeof Input !== "undefined"){ - if (pixel.cooldown > 0){ - pixel.cooldown-- - if (pixel.powerstate == "true" && Input.charge > 0.2 && pixel.cooldown < 1) { + if (typeof Output !== "undefined" && typeof Input !== "undefined") + if (pixel.powerstate == "true" && Input.charge > 0.2) { Input.charge = 0 - pixel.cooldown = 5 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else if (pixel.powerstate == "false" && Input.charge > 0.2 && pixel.cooldown < 1) { + } else if (pixel.powerstate == "false" && Input.charge > 0.2) { Input.charge = 0 - pixel.cooldown = 5 pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 From e168be81c886bb8ebc045df5bfa47eb5f174b31b Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:18:12 +0200 Subject: [PATCH 31/41] Update flipflop.js --- mods/flipflop.js | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 431020da..fac6e44a 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -24,7 +24,6 @@ elements.flipflop = { pixel.powerstate = "true" pixel.color = "#94CF0D" Output.charge = 5 - } } } }; From c8ea492073360d006b8933ecb6884f35392dca4a Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:00:30 +0200 Subject: [PATCH 32/41] Update flipflop.js --- mods/flipflop.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index fac6e44a..73ee93f6 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -13,17 +13,20 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] - if (typeof Output !== "undefined" && typeof Input !== "undefined") - if (pixel.powerstate == "true" && Input.charge > 0.2) { - Input.charge = 0 - pixel.powerstate = "false" - pixel.color = "#CF300D" - Output.charge = 0 - } else if (pixel.powerstate == "false" && Input.charge > 0.2) { - Input.charge = 0 - pixel.powerstate = "true" - pixel.color = "#94CF0D" - Output.charge = 5 + if (typeof Output !== "undefined" && typeof Input !== "undefined") { + if (Input.charge > 0.4) { + if (pixel.powerstate == "true") { + Input.charge = 0 + pixel.powerstate = "false" + pixel.color = "#CF300D" + Output.charge = 0 + } else { + Input.charge = 0 + pixel.powerstate = "true" + pixel.color = "#94CF0D" + Output.charge = 5 + } + } } } }; From 132dfa2a2e46fe5600a5d3af3f985d3910986962 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:03:19 +0200 Subject: [PATCH 33/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 73ee93f6..216ee166 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,7 +14,7 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined") { - if (Input.charge > 0.4) { + if (Input.charge > 0.7) { if (pixel.powerstate == "true") { Input.charge = 0 pixel.powerstate = "false" From 7608a825fa23a3922232aaefd68fedf748b5a030 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:05:35 +0200 Subject: [PATCH 34/41] Update flipflop.js --- mods/flipflop.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 216ee166..af4225f6 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -16,16 +16,16 @@ elements.flipflop = { if (typeof Output !== "undefined" && typeof Input !== "undefined") { if (Input.charge > 0.7) { if (pixel.powerstate == "true") { - Input.charge = 0 pixel.powerstate = "false" pixel.color = "#CF300D" Output.charge = 0 - } else { - Input.charge = 0 + } else if (pixel.powerstate == "true") { pixel.powerstate = "true" pixel.color = "#94CF0D" - Output.charge = 5 + Output.charge = 1 } + } else { + Output.charge = 0 } } } From bc7b828c7353fb8a5cb666c384e7317e9ff7b700 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:10:23 +0200 Subject: [PATCH 35/41] Update flipflop.js --- mods/flipflop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index af4225f6..37c4b14b 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -14,7 +14,7 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined") { - if (Input.charge > 0.7) { + if (Input.charge > 0.45) { if (pixel.powerstate == "true") { pixel.powerstate = "false" pixel.color = "#CF300D" From 94814ba92c83835a9a04efa86177c7a78098c3a8 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:27:39 +0200 Subject: [PATCH 36/41] Update flipflop.js --- mods/flipflop.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 37c4b14b..a3c8de52 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -10,19 +10,20 @@ elements.flipflop = { doHeat(pixel) doBurning(pixel) doElectricity(pixel) - + console.log(pixel.powerstate) let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined") { - if (Input.charge > 0.45) { + if (Inpput.charge == 0.75) { + conso le.log(Input.charge) if (pixel.powerstate == "true") { pixel.powerstate = "false" - pixel.color = "#CF300D" - Output.charge = 0 - } else if (pixel.powerstate == "true") { - pixel.powerstate = "true" - pixel.color = "#94CF0D" - Output.charge = 1 + pixel.color = "#CF300D" + Output.charge = 0 + } else if (pixel.powerstate == "false") { + pixel.powerstate = "true" + pixel.color = "#94CF0D" + Output.charge = 1 } } else { Output.charge = 0 From 8eb6cc7c30f64d52bb3461c05c6bc858c9a5d26e Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:40:09 +0200 Subject: [PATCH 37/41] Update flipflop.js --- mods/flipflop.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index a3c8de52..025d727a 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -1,29 +1,33 @@ elements.flipflop = { properties: { powerstate: "false", + cooldown: 0, }, name: "Flip Flop", color: "#CF300D", state: "solid", category: "machines", tick: function(pixel) { - doHeat(pixel) - doBurning(pixel) - doElectricity(pixel) - console.log(pixel.powerstate) + doHeat(pixel) + doBurning(pixel) + doElectricity(pixel) + let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined") { - if (Inpput.charge == 0.75) { - conso le.log(Input.charge) + console.log(pixel.cooldown) + if (Input.charge == 0 && pixel.cooldown == 1) { + pixel.cooldown = 0 + } + if (Input.charge > 0.5 && pixel.cooldown == 0) { + pixel.cooldown = 1 if (pixel.powerstate == "true") { pixel.powerstate = "false" - pixel.color = "#CF300D" - Output.charge = 0 + pixel.color = "#CF300D" } else if (pixel.powerstate == "false") { - pixel.powerstate = "true" - pixel.color = "#94CF0D" - Output.charge = 1 + pixel.powerstate = "true" + pixel.color = "#94CF0D" + Output.charge = 1 } } else { Output.charge = 0 From f720f4eaa692d35ffa7b2cb85171bf823a01b49f Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:52:10 +0200 Subject: [PATCH 38/41] Update flipflop.js --- mods/flipflop.js | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 025d727a..8fd63d85 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -15,11 +15,10 @@ elements.flipflop = { let Output = pixelMap[pixel.x+1][pixel.y] let Input = pixelMap[pixel.x-1][pixel.y] if (typeof Output !== "undefined" && typeof Input !== "undefined") { - console.log(pixel.cooldown) - if (Input.charge == 0 && pixel.cooldown == 1) { + if (Input.charge == undefined && pixel.cooldown == 1) { pixel.cooldown = 0 } - if (Input.charge > 0.5 && pixel.cooldown == 0) { + if (Input.charge > 0 && pixel.cooldown == 0) { pixel.cooldown = 1 if (pixel.powerstate == "true") { pixel.powerstate = "false" @@ -29,8 +28,44 @@ elements.flipflop = { pixel.color = "#94CF0D" Output.charge = 1 } - } else { - Output.charge = 0 + } else if (cooldown == 0) { + Output.charge = undefined + } + } + } +}; +elements.flipflop = { + properties: { + powerstate: "false", + cooldown: 0, + }, + name: "Flip Flop", + color: "#CF300D", + state: "solid", + category: "machines", + tick: function(pixel) { + doHeat(pixel) + doBurning(pixel) + doElectricity(pixel) + + let Output = pixelMap[pixel.x+1][pixel.y] + let Input = pixelMap[pixel.x-1][pixel.y] + if (typeof Output !== "undefined" && typeof Input !== "undefined") { + if (Input.charge == undefined && pixel.cooldown == 1) { + pixel.cooldown = 0 + } + if (Input.charge > 0 && pixel.cooldown == 0) { + pixel.cooldown = 1 + if (pixel.powerstate == "true") { + pixel.powerstate = "false" + pixel.color = "#CF300D" + } else if (pixel.powerstate == "false") { + pixel.powerstate = "true" + pixel.color = "#94CF0D" + Output.charge = 1 + } + } else if (cooldown == 0) { + Output.charge = undefined } } } From 06bbf6d400efb3af3ac75aae0aa4bf7732498da8 Mon Sep 17 00:00:00 2001 From: felixs-alt <114471609+felixs-alt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:53:14 +0200 Subject: [PATCH 39/41] Update flipflop.js --- mods/flipflop.js | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/mods/flipflop.js b/mods/flipflop.js index 8fd63d85..352ea4d6 100644 --- a/mods/flipflop.js +++ b/mods/flipflop.js @@ -28,43 +28,7 @@ elements.flipflop = { pixel.color = "#94CF0D" Output.charge = 1 } - } else if (cooldown == 0) { - Output.charge = undefined - } - } - } -}; -elements.flipflop = { - properties: { - powerstate: "false", - cooldown: 0, - }, - name: "Flip Flop", - color: "#CF300D", - state: "solid", - category: "machines", - tick: function(pixel) { - doHeat(pixel) - doBurning(pixel) - doElectricity(pixel) - - let Output = pixelMap[pixel.x+1][pixel.y] - let Input = pixelMap[pixel.x-1][pixel.y] - if (typeof Output !== "undefined" && typeof Input !== "undefined") { - if (Input.charge == undefined && pixel.cooldown == 1) { - pixel.cooldown = 0 - } - if (Input.charge > 0 && pixel.cooldown == 0) { - pixel.cooldown = 1 - if (pixel.powerstate == "true") { - pixel.powerstate = "false" - pixel.color = "#CF300D" - } else if (pixel.powerstate == "false") { - pixel.powerstate = "true" - pixel.color = "#94CF0D" - Output.charge = 1 - } - } else if (cooldown == 0) { + } else if (pixel.cooldown == 0) { Output.charge = undefined } } From fc241b82cd161db5b36ada22bb8a5da732853346 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:06:35 -0400 Subject: [PATCH 40/41] . --- index.html | 5 +++-- mod-list.html | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b9b8c5ec..70cbe19e 100644 --- a/index.html +++ b/index.html @@ -13952,6 +13952,7 @@ Cancer, Landmine, Grenade, Smoke Grenade">?
+

Support development by subscribing on our Patreon! Many benefits!!

Want your ad here? Email us at contact@R74n.com!

@@ -13962,10 +13963,10 @@ Cancer, Landmine, Grenade, Smoke Grenade">? -

Sandboxels has many applications in education. With a hands-on experience, it can give students an understanding of emerging phenomena in many fields, such as biology, chemistry, ecology, geology, cooking, and even virology. There are countless aspects to discover.

+

Sandboxels has many applications in education. With a hands-on experience, it can give students an understanding of emerging phenomena in many fields, such as biology, chemistry, ecology, geology, cooking, and even virology. There are countless aspects to discover.

We have a thriving community on Discord! There you can post feedback or share your creations.

-

Business inquiries? Education stories? Help needed? Email us at contact@R74n.com!

+

Business inquiries? Education stories? Help needed? Email us at contact@R74n.com!

Thanks to: Serioustar, ggod, Trent, u2ce

Sandboxels is developed by R74n. Check out our other projects! Privacy Policy