From a6ad4826867497dfb13772dc5f1d2655f50f8a19 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 10 Mar 2024 15:26:35 -0500 Subject: [PATCH 01/19] Add files via upload --- mods/modM.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mods/modM.js diff --git a/mods/modM.js b/mods/modM.js new file mode 100644 index 00000000..aeb826cc --- /dev/null +++ b/mods/modM.js @@ -0,0 +1,19 @@ +console.log("run mod") +elements.turbine = { color: "#524945", + behavior: behaviors.WALL + category: "solids", + state: "solid", + density: 720, +}; +elements.coolant = { color: "#16c1db", + behavior: behaviors.WALL + category: "liquids", + state: "liquid", + density: 720, + tempHigh: 1000, +}; +elements.unstable_coolant = { color: "#16c1db", + behavior: behaviors.DGAS, + category: "gases", + state: "gas", +}; \ No newline at end of file From b83e410c627c793ce3b066006ae91ae1b77dcdbe Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 10 Mar 2024 15:51:49 -0500 Subject: [PATCH 02/19] modM.js --- mods/modM.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/modM.js b/mods/modM.js index aeb826cc..53601f84 100644 --- a/mods/modM.js +++ b/mods/modM.js @@ -16,4 +16,17 @@ elements.unstable_coolant = { color: "#16c1db", behavior: behaviors.DGAS, category: "gases", state: "gas", -}; \ No newline at end of file +}; +elements.hello_world = { + color: "#ff0000", + behavior: behaviors.WALL, + category: "land", + state: "solid", +}; + +elements.hello_world = { + color: "#ff0000", + behavior: behaviors.WALL, + category: "land", + state: "solid", +}; From 11b6a4cede4534d35aad8cf501b14d7de7897d4c Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:52:40 -0500 Subject: [PATCH 03/19] Update modM.js --- mods/modM.js | 172 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 149 insertions(+), 23 deletions(-) diff --git a/mods/modM.js b/mods/modM.js index 53601f84..f9d4cf7f 100644 --- a/mods/modM.js +++ b/mods/modM.js @@ -1,32 +1,158 @@ -console.log("run mod") -elements.turbine = { color: "#524945", - behavior: behaviors.WALL - category: "solids", - state: "solid", - density: 720, -}; -elements.coolant = { color: "#16c1db", - behavior: behaviors.WALL - category: "liquids", - state: "liquid", - density: 720, - tempHigh: 1000, -}; -elements.unstable_coolant = { color: "#16c1db", - behavior: behaviors.DGAS, - category: "gases", - state: "gas", -}; -elements.hello_world = { +elements.heatSensor = { color: "#ff0000", - behavior: behaviors.WALL, + conduct: 1, + category:"machines", + tick: function(pixel) { + if (pixel.temp > 430 ) { + pixel.charge = 5; + } + }, + conduct: 1, +}; +let itemA = "steam"; +elements.turbine = { + behavior: behaviors.WALL, + behavior: behaviors.DELETE, + color: "#826c6e", + tick: function(pixel) { + if(pixel.start == pixelTicks){ + pixel.clone = itemA; + } + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element == pixel.clone) { + pixel.charge = 5; + break; + } + } + } + doDefaults(pixel); + }, + conduct: 1, + movable: false, + category:"machines", + darkText: true, + hardness: 1, + + }; + + +elements.coal = { + color: "#3d3c39", + behavior: behaviors.POWDER, category: "land", state: "solid", + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:2500, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, }; -elements.hello_world = { - color: "#ff0000", +elements.solid_coal = { + color: "#3d3c39", behavior: behaviors.WALL, category: "land", state: "solid", + breakInto: "coal_dust" + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:3000, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, }; + + elements.coal_dust = { + color: "#3d3c39", + behavior: behaviors.POWDER, + category: "land", + state: "solid", + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:2000, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, +}; + + +elements.gas = { + color: "#c9c5b1", + behavior: behaviors.LIQUID, + tick: function(pixel) { + if (pixel.temp > 430 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + tempHigh:3000, + stateHigh: "fire", + viscosity: 0.56, + burn: 100, + burnTime: 10000, + fireColor: "#c9c5b1", + category: "liquids", + state: "liquid", + density: 792, + stain: -0.25, +} + +let itemB = "light"; +elements.solar_panel = { + behavior: behaviors.WALL, + behavior: behaviors.DELETE, + color: "#bebfa3", + tick: function(pixel) { + if(pixel.start == pixelTicks){ + pixel.clone = itemB; + } + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element == pixel.clone) { + pixel.charge = 5; + break; + } + } + } + doDefaults(pixel); + }, + conduct: 1, + movable: false, + category:"machines", + darkText: true, + hardness: 1, + + }; From 871d4c8f014d950d533e579a7ea3ee132b780917 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:16:11 -0500 Subject: [PATCH 04/19] Update modM.js --- mods/modM.js | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/mods/modM.js b/mods/modM.js index f9d4cf7f..d5576a1d 100644 --- a/mods/modM.js +++ b/mods/modM.js @@ -62,26 +62,6 @@ elements.coal = { burnTime: 3500, }; -elements.solid_coal = { - color: "#3d3c39", - behavior: behaviors.WALL, - category: "land", - state: "solid", - breakInto: "coal_dust" - - tick: function(pixel) { - if (pixel.temp > 900 && !pixel.burning) { - pixel.burning = true; - pixel.burnStart = pixelTicks; - } - }, - - tempHigh:3000, - stateHigh: "fire", - hardness: 0.85, - burn: 100, - burnTime: 3500, -}; elements.coal_dust = { color: "#3d3c39", @@ -156,3 +136,26 @@ elements.solar_panel = { hardness: 1, }; + +elements.titanium = { + conduct: 1, + color: "#a1ada5", + tempHigh:3000, + stateHigh: "molten_titanium", + category: "solids", + state: "soild", + hardness: 1, + density: 792, + behavior: behaviors.WALL, +}; + +elements.molten_titanium = { + conduct: 1, + color: "#d16e04", + tempLow:2999, + stateLow: "titanium", + category: "solids", + state: "soild", + density: 792, + behavior: behaviors.MOLTEN, +}; From 590d64c4fe4b141389d88578335b3bad736ccdb7 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:09:24 -0500 Subject: [PATCH 05/19] Update and rename mods/modM.js to ExtraMachines.js --- mods/modM.js => ExtraMachines.js | 42 +++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) rename mods/modM.js => ExtraMachines.js (80%) diff --git a/mods/modM.js b/ExtraMachines.js similarity index 80% rename from mods/modM.js rename to ExtraMachines.js index d5576a1d..056eaf69 100644 --- a/mods/modM.js +++ b/ExtraMachines.js @@ -12,7 +12,7 @@ elements.heatSensor = { let itemA = "steam"; elements.turbine = { behavior: behaviors.WALL, - behavior: behaviors.DELETE, + color: "#826c6e", tick: function(pixel) { if(pixel.start == pixelTicks){ @@ -26,6 +26,7 @@ elements.turbine = { if (!isEmpty(x,y,true)) { var sensed = pixelMap[x][y]; if (sensed.element == pixel.clone) { + deletePixel(x,y); pixel.charge = 5; break; } @@ -45,8 +46,10 @@ elements.turbine = { elements.coal = { color: "#3d3c39", behavior: behaviors.POWDER, - category: "land", + category: "powders", state: "solid", + density: 208, + conduct: 0.001 tick: function(pixel) { if (pixel.temp > 900 && !pixel.burning) { @@ -68,6 +71,9 @@ elements.coal = { behavior: behaviors.POWDER, category: "land", state: "solid", + stain: 1, + density: 190, + conduct: 0.001 tick: function(pixel) { if (pixel.temp > 900 && !pixel.burning) { @@ -78,7 +84,7 @@ elements.coal = { tempHigh:2000, stateHigh: "fire", - hardness: 0.85, + hardness: 0.3, burn: 100, burnTime: 3500, }; @@ -122,6 +128,7 @@ elements.solar_panel = { if (!isEmpty(x,y,true)) { var sensed = pixelMap[x][y]; if (sensed.element == pixel.clone) { + deletePixel(x,y); pixel.charge = 5; break; } @@ -138,7 +145,7 @@ elements.solar_panel = { }; elements.titanium = { - conduct: 1, + conduct: 0, color: "#a1ada5", tempHigh:3000, stateHigh: "molten_titanium", @@ -150,12 +157,35 @@ elements.titanium = { }; elements.molten_titanium = { - conduct: 1, + conduct: 0, color: "#d16e04", tempLow:2999, stateLow: "titanium", - category: "solids", + category: "states", state: "soild", density: 792, behavior: behaviors.MOLTEN, }; + +elements.solid_coal = { + color: "#3d3c39", + behavior: behaviors.WALL, + category: "land", + state: "solid", + breakInto: "coal_dust", + density: 380, + conduct: 0.001 + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:3000, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, +}; From 47841aef14e6913a07852e207724e58f340cc028 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:41:02 -0500 Subject: [PATCH 06/19] Update ExtraMachines.js --- ExtraMachines.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ExtraMachines.js b/ExtraMachines.js index 056eaf69..7cf06243 100644 --- a/ExtraMachines.js +++ b/ExtraMachines.js @@ -49,7 +49,7 @@ elements.coal = { category: "powders", state: "solid", density: 208, - conduct: 0.001 + conduct: 0.001, tick: function(pixel) { if (pixel.temp > 900 && !pixel.burning) { @@ -73,7 +73,7 @@ elements.coal = { state: "solid", stain: 1, density: 190, - conduct: 0.001 + conduct: 0.001, tick: function(pixel) { if (pixel.temp > 900 && !pixel.burning) { @@ -174,7 +174,7 @@ elements.solid_coal = { state: "solid", breakInto: "coal_dust", density: 380, - conduct: 0.001 + conduct: 0.001, tick: function(pixel) { if (pixel.temp > 900 && !pixel.burning) { From f6241a18bc124011fc48093025539a874459641c Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:43:55 -0500 Subject: [PATCH 07/19] Update ExtraMachines.js --- ExtraMachines.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ExtraMachines.js b/ExtraMachines.js index 7cf06243..14d2951e 100644 --- a/ExtraMachines.js +++ b/ExtraMachines.js @@ -114,7 +114,6 @@ elements.gas = { let itemB = "light"; elements.solar_panel = { behavior: behaviors.WALL, - behavior: behaviors.DELETE, color: "#bebfa3", tick: function(pixel) { if(pixel.start == pixelTicks){ From f5f75e067da8a3752c740edf0a20539d370c53aa Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:21:00 -0500 Subject: [PATCH 08/19] Add files via upload all the current elements --- sandboxels-screenshot (1).png | Bin 0 -> 17105 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sandboxels-screenshot (1).png diff --git a/sandboxels-screenshot (1).png b/sandboxels-screenshot (1).png new file mode 100644 index 0000000000000000000000000000000000000000..1dc044631119e1a997fb4783c9e871f3ae1f3e33 GIT binary patch literal 17105 zcmeHvd011~_N9p+lL$_rB7;&04uCTj2#KQN1VPaU0)i<;R3?>CAPE!#rKnitfQmqr z(uj->$V?PON)ddU`}OPZ^Dhba-jjRQS$plZ z_c?gR-p)oSw;%R@DI*^x6Q^$SvB)NPnx7R zY1^g^dqUiLn@>I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CNL6Kj#OMc>4=Zdc5`Qe%u1S zJuTK&aJ>+5aa_7R^U{6kmjvci&NfTGZq}W2GrvLKWmVs~oF)cFBJTtN%vDPhij$!S z9#U7&?6_#|`USFw8fP1Yo8^*cQfw929o9W&7^ryoSkfNLK=aV+CeSZd^G|g|kUx;>CHCg@ZUGbq$9IMMP{ep7}Ze1OSrMFVkjL}9g zLalZ Date: Mon, 11 Mar 2024 20:23:13 -0500 Subject: [PATCH 09/19] Update ExtraMachines.js --- ExtraMachines.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ExtraMachines.js b/ExtraMachines.js index 14d2951e..ee52974e 100644 --- a/ExtraMachines.js +++ b/ExtraMachines.js @@ -46,7 +46,7 @@ elements.turbine = { elements.coal = { color: "#3d3c39", behavior: behaviors.POWDER, - category: "powders", + category: "energy", state: "solid", density: 208, conduct: 0.001, @@ -69,7 +69,7 @@ elements.coal = { elements.coal_dust = { color: "#3d3c39", behavior: behaviors.POWDER, - category: "land", + category: "powders", state: "solid", stain: 1, density: 190, @@ -145,7 +145,7 @@ elements.solar_panel = { elements.titanium = { conduct: 0, - color: "#a1ada5", + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], tempHigh:3000, stateHigh: "molten_titanium", category: "solids", @@ -169,7 +169,7 @@ elements.molten_titanium = { elements.solid_coal = { color: "#3d3c39", behavior: behaviors.WALL, - category: "land", + category: "energy", state: "solid", breakInto: "coal_dust", density: 380, @@ -188,3 +188,13 @@ elements.solid_coal = { burn: 100, burnTime: 3500, }; + +elements.rubber = { + color: "#ffc0cb", + hardness: 0.5, + tempHigh:180, + state: "solid", + behavior: behaviors.WALL, + conduct: 0, + category: "solids", +}; From 76f13837cd4fabd73f1fc4fa541a1496afe42b6d Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:30:39 -0500 Subject: [PATCH 10/19] Update ExtraMachines.js --- ExtraMachines.js | 230 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 227 insertions(+), 3 deletions(-) diff --git a/ExtraMachines.js b/ExtraMachines.js index ee52974e..b34bf458 100644 --- a/ExtraMachines.js +++ b/ExtraMachines.js @@ -1,10 +1,11 @@ elements.heatSensor = { color: "#ff0000", conduct: 1, - category:"machines", + category:"test", + behavior: behaviors.WALL, tick: function(pixel) { if (pixel.temp > 430 ) { - pixel.charge = 5; + pixel.charge = 1; } }, conduct: 1, @@ -90,7 +91,7 @@ elements.coal = { }; -elements.gas = { +elements.gasoline = { color: "#c9c5b1", behavior: behaviors.LIQUID, tick: function(pixel) { @@ -198,3 +199,226 @@ elements.rubber = { conduct: 0, category: "solids", }; + +elements.coolant = { + color: "#71ded3", + state: "liquid", + behavior: behaviors.LIQUID, + behavior: [ + "XX|CO:2|XX", + "CO:2|XX|CO:2", + "XX|CO:2|XX", + ], + conduct: 0.5, + category: "test", + +}; + +elements.e_cooler = { + color: elements.cooler.color, + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + behaviorOn: [ + "XX|CO:2|XX", + "CO:2|XX|CO:2", + "XX|CO:2|XX", + ], + name: "E-Cooler", +}; + +elements.e_Freezer = { + color: elements.cooler.color, + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + behaviorOn: [ + "XX|CO:10|XX", + "CO:10|XX|CO:10", + "XX|CO:10|XX", + ], + name: "E-Freezer", +}; + +elements.e_heater = { + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + color: "#881111", + behaviorOn: [ + "XX|HT:4|XX", + "HT:4|XX|HT:4", + "XX|HT:4|XX", + ], + name: "E-Heater", +}; + +elements.e_SuperHeater = { + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + color: "#881111", + behaviorOn: [ + "XX|HT:12|XX", + "HT:12|XX|HT:12", + "XX|HT:12|XX", + ], + name: "E-SuperHeater", +}; + +elements.slow_Ecloner = { + color: "#888800", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|CF%10|XX", + "CF%10|XX|CF%10", + "XX|CF%10|XX", + ], + ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall","turbine","solar_panel"], + category:"machines", + insulate:true, + hardness: 1, + conduct: 1, + name: "E-SlowCloner", +}; + +elements.Android = { + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "life", + color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"], + category: "life", + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+1)) { + createPixel("AndroidBody", pixel.x, pixel.y+1); + pixel.element = "AndroidHead"; + } + else if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("AndroidHead", pixel.x, pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixel.color; + pixel.element = "AndroidBody"; + pixel.color = pixelColorPick(pixel) + } + else { + deletePixel(pixel.x, pixel.y); + } + }, + related: ["AndroidBody","AndroidHead"], + cooldown: defaultCooldown +}; + + +elements.AndroidBody = { + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "life", + breakInto: ["oil","metal_scrap","explosion"], + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "AndroidHead") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "AndroidHead") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create blood if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("oil", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + } +}; + +elements.AndroidHead = { + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "life", + density: 1080, + state: "solid", + conduct: .05, + temp: 69, + breakInto: ["oil","metal_scrap","explosion"], +}; + From a11d6837fda1f1b2465fc1e0071e9ad16383fddb Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 17 Mar 2024 14:57:10 -0500 Subject: [PATCH 11/19] Update ExtraMachines.js --- ExtraMachines.js | 832 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 820 insertions(+), 12 deletions(-) diff --git a/ExtraMachines.js b/ExtraMachines.js index b34bf458..20137987 100644 --- a/ExtraMachines.js +++ b/ExtraMachines.js @@ -1,19 +1,37 @@ +// this is a epic mod + +let heatSen = 0; elements.heatSensor = { + color: "#ff0000", conduct: 1, category:"test", behavior: behaviors.WALL, + + onSelect: function(pixel){ + setTemp = parseInt(prompt("Enter the temperature you want it to sense. zero will not work", (heatSen || undefined))); + + }, + + tick: function(pixel) { - if (pixel.temp > 430 ) { + if((pixel.start == pixelTicks) && !(heatSen == 0)){ + pixel.clone.temp = heatSen + } + + if (pixel.temp > pixel.clone ) { pixel.charge = 1; } - }, - conduct: 1, + + + }, + }; + let itemA = "steam"; -elements.turbine = { +elements.SteamTurbine = { behavior: behaviors.WALL, - + desc: "When steam touches it, it conducts electricity and the steam pixel is deleted", color: "#826c6e", tick: function(pixel) { if(pixel.start == pixelTicks){ @@ -45,6 +63,7 @@ elements.turbine = { elements.coal = { + desc: "A black powder that burns", color: "#3d3c39", behavior: behaviors.POWDER, category: "energy", @@ -68,6 +87,7 @@ elements.coal = { elements.coal_dust = { + desc: "A byproduct of smashed solid coal that burns like coal but for a shorter time", color: "#3d3c39", behavior: behaviors.POWDER, category: "powders", @@ -93,6 +113,7 @@ elements.coal = { elements.gasoline = { color: "#c9c5b1", + desc: "A liquid that burns and is used to power most cars", behavior: behaviors.LIQUID, tick: function(pixel) { if (pixel.temp > 430 && !pixel.burning) { @@ -115,6 +136,7 @@ elements.gasoline = { let itemB = "light"; elements.solar_panel = { behavior: behaviors.WALL, + desc: "When light touches it, it conducts electricity and the light pixel is deleted", color: "#bebfa3", tick: function(pixel) { if(pixel.start == pixelTicks){ @@ -145,6 +167,7 @@ elements.solar_panel = { }; elements.titanium = { + desc: "Another metal that does not erode nor conduct electricity", conduct: 0, color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], tempHigh:3000, @@ -157,6 +180,8 @@ elements.titanium = { }; elements.molten_titanium = { + desc: "Melted version of titanium", + temp : 3000, conduct: 0, color: "#d16e04", tempLow:2999, @@ -168,6 +193,7 @@ elements.molten_titanium = { }; elements.solid_coal = { + desc: "A solid version of coal", color: "#3d3c39", behavior: behaviors.WALL, category: "energy", @@ -191,6 +217,7 @@ elements.solid_coal = { }; elements.rubber = { + desc: "Not finnished", color: "#ffc0cb", hardness: 0.5, tempHigh:180, @@ -201,20 +228,36 @@ elements.rubber = { }; elements.coolant = { + desc: "Cools down pixels that touch it and is a liquid", color: "#71ded3", state: "liquid", + insulate: true, behavior: behaviors.LIQUID, - behavior: [ - "XX|CO:2|XX", - "CO:2|XX|CO:2", - "XX|CO:2|XX", - ], + tick: function(pixel) { + + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element && sensed.temp > 21 ) { + + sensed.temp -= 1; + break; + } + } + } + doDefaults(pixel); + }, conduct: 0.5, category: "test", }; elements.e_cooler = { + desc: "Works like the cooler but needs power to work", color: elements.cooler.color, hardness: 0.5, state: "solid", @@ -230,6 +273,7 @@ elements.e_cooler = { }; elements.e_Freezer = { + desc: "Works like the freezer but needs power to work", color: elements.cooler.color, hardness: 0.5, state: "solid", @@ -245,6 +289,7 @@ elements.e_Freezer = { }; elements.e_heater = { + desc: "Works like the heater but needs power to work", hardness: 0.5, state: "solid", behavior: behaviors.WALL, @@ -260,6 +305,7 @@ elements.e_heater = { }; elements.e_SuperHeater = { + desc: "Works like the Super Heater but needs power to work", hardness: 0.5, state: "solid", behavior: behaviors.WALL, @@ -275,6 +321,7 @@ elements.e_SuperHeater = { }; elements.slow_Ecloner = { + desc: "Works like the Slow Cloner but needs power to work", color: "#888800", behavior: behaviors.WALL, behaviorOn: [ @@ -282,7 +329,7 @@ elements.slow_Ecloner = { "CF%10|XX|CF%10", "XX|CF%10|XX", ], - ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall","turbine","solar_panel"], + ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall","SteamTurbine","solar_panel"], category:"machines", insulate:true, hardness: 1, @@ -291,7 +338,8 @@ elements.slow_Ecloner = { }; elements.Android = { - color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + desc: "A robot", + color: "#a1ada5", category: "life", color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"], category: "life", @@ -422,3 +470,763 @@ elements.AndroidHead = { breakInto: ["oil","metal_scrap","explosion"], }; +listPipes = "pipe" + + +//thx to morechem.js for the idea + +let setTemp = ""; +elements.ajustableHeater = { + desc: "Works like a heater but it can be set to a specific temp and needs power to work", + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "machines", + density: 1080, + state: "solid", + conduct: 1, + movable: false, + name: "Ajustable-E-Heater", + onSelect: function(pixel){ + setTemp = parseInt(prompt("Enter the temperature you want it set to.", (setTemp || undefined))); + + }, + tick: function(pixel) { + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { + sensed.temp += setTemp/6; + + break; + } + } + } + doDefaults(pixel); + }, + insulate:true +}; + +//old grinder +// elements.grinder = { + // color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + // category: "machines", + // density: 1080, + // state: "solid", + // conduct: 1, + // movable: false, + + // ignore: "grinder", + + // tick: function(pixel) { + // for (var i = 0; i < adjacentCoords.length; i++) { + // var coords = adjacentCoords[i]; + // var x = pixel.x + coords[0]; + // var y = pixel.y + coords[1]; + // if (!isEmpty(x,y,true)) { + // var sensed = pixelMap[x][y]; + // if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { + // breakPixel(sensed); + // } + // } + // } + // doDefaults(pixel); + // }, + // insulate:true + + + +// }; + + + +elements.dead_plant.conduct = 1; +// let compact = "dead_plant"; +// elements.compacter = { + // behavior: behaviors.WALL, + // color: "#bebfa3", + // tick: function(pixel) { + // if(pixel.start == pixelTicks){ + // pixel.clone = compact; + // } + + + // for (var i = 0; i < adjacentCoords.length; i++) { + // var coords = adjacentCoords[i]; + // var x = pixel.x + coords[0]; + // var y = pixel.y + coords[1]; + // if (!isEmpty(x,y,true)) { + // var sensed = pixelMap[x][y]; + // if (sensed.element == pixel.clone && pixel.charge > 0) { + // sensed.element = "coal" + // sensed.color = elements.coal.color + // break; + // } + // } + // } + // doDefaults(pixel); + // }, + // conduct: 1, + // movable: false, + // category:"machines", + // darkText: true, + // hardness: 1, +// } +compactPi = "dead_plant"; +compactPi2 = "coal"; +elements.compacter = { + color: "#4e524f", + desc: "Turns dead plants into coal and needs power", + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.CompactEl = compactPi + pixel.CompactEl2 = compactPi2 + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if ((newPixel.element == pixel.CompactEl) || (newPixel.element == pixel.CompactEl2) && pixel.charge > 0 ) { + + pixel.con = newPixel; + changePixel(newPixel, "coal") + newPixel.color = elements.coal.color + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +// thx to nousersthings mod for the filter +// only adding this bc my freind told me so +// im not good at javascript and coding so yeah + +filterTypeVar = 0; +elements.filter = { + color: "#599fc2", + desc: "A filter made by nouser", + onSelect: function() { + var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); + if (!answer4) { return } + filterTypeVar = answer4; + }, + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.filterType = filterTypeVar + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if (newPixel.element == pixel.filterType ) { + + pixel.con = newPixel; + + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +filterTypeVar2 = 0; +elements.Destructive_Filter = { + color: "#3c6c85", + desc: "A filter that destroys anything that isn't allowed to get through", + onSelect: function() { + var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); + if (!answer4) { return } + filterTypeVar2 = answer4; + }, + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.filterType = filterTypeVar2 + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if (newPixel.element == pixel.filterType) { + + pixel.con = newPixel; + + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + else if(!(newPixel.element == "filter") && !(newPixel.element == "Destructive_Filter") && !doNotEF.includes(newPixel.element) ) { + deletePixel(newPixel.x, newPixel.y); + break; + + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + + + +// going to fix the sucking up solids problem soon!! +doNotEF = ["e_grinder","grinder","filter", "battery", "wire", "cloner", "sensor", "heater","cooler", "Ajustable-E-Heater", "E-Cooler", "E-Freezer", "E-Heater", "E-SuperHeater", "E-SlowCloner", "ewall", "titanium", "tungsten", "steel", "insulation","SteamTurbine","solar_panel"]; + +elements.grinder = { + color: "#55565c", + ignore: ["e_grinder","grinder"], + desc: "Grinds things", + tick: function(pixel) { + + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con && !doNotEF.includes(newPixel.element) ) { //suck up pixel + // (!pixel.con && !(newPixel.element === "e_grinder") && pixel.charge > 0 && !(newPixel.element.movable)) + // (!pixel.con && !(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") && !(newPixel.element === "filter") && (newPixel.element.movable)) + //!(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") + pixel.con = newPixel; + breakPixel(pixel.con); + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +//elements.battery.movable: false + +elements.e_grinder = { + color: "#55565c", + ignore: ["e_grinder","grinder"], + conduct: 1, + desc: "Grinds things,needs power to work", + tick: function(pixel) { + + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con && !doNotEF.includes(newPixel.element) && pixel.charge > 0 ) { //suck up pixel + + + pixel.con = newPixel; + breakPixel(pixel.con); + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + + + +// elements.cementMix = { + +// } From d9f15d5469b05c1ce1222072cf06f8a6f05121a7 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:05:22 -0500 Subject: [PATCH 12/19] Delete sandboxels-screenshot (1).png --- sandboxels-screenshot (1).png | Bin 17105 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 sandboxels-screenshot (1).png diff --git a/sandboxels-screenshot (1).png b/sandboxels-screenshot (1).png deleted file mode 100644 index 1dc044631119e1a997fb4783c9e871f3ae1f3e33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17105 zcmeHvd011~_N9p+lL$_rB7;&04uCTj2#KQN1VPaU0)i<;R3?>CAPE!#rKnitfQmqr z(uj->$V?PON)ddU`}OPZ^Dhba-jjRQS$plZ z_c?gR-p)oSw;%R@DI*^x6Q^$SvB)NPnx7R zY1^g^dqUiLn@>IV*h?`SFlz`~b9UA3^IHx!Znb~0Q8{wSCgQBreJ|#2mY=IVqxY?U zVcq9GkKYfUEK{m9I##JP>-dq`%Ex|Cw|RbQ>Mhl29wql31$W){X}WBcu1y~5YZUhR z*D$2xf`YN}8c%5rMYwcn(H5I=0$xs0U5^+s2`BsEKo>sMx}P}tufL6W`cs6j;$Loz zAmZ@&P+THi{;wnG(G$N8H8G}rL_~z!(?v%jC%!{=L9y%b#2sJ1ewLmdT{B0?`A@Hd z?!Xt${fFPkD=K!$d;h5M*B6S2@SXD4-+X(;zpu?V6cMGraq*8J{1z@46yHSW5Apvd z-53<#vdbTa;9HJHP<*oy-)zL+5%^{!{*VXs!~aJ%LND&AG^9FRGc{WG#BUo~#ib|P z6Us#Q_okPL%BO{fIMK#<+<9!%(ccuxL@uVGJDj*h!G2E64<4E^0`0~pu>$=I<|{L3 zqj7^n)Uh$HYPPhwE@eKu_LSruS?t#`UYJvQ^3$svEAx5M@2=grp`4wPn5e=Ny7>Ds zjUN{8(lCJZ5^171qW?a6|L{5B(VQP6B3i69S+UE*eYau7(7YvjbhCi=$F^|i@A7g1 zxDx){23@S6GO{HSO?_W@rz&=o^VG~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F2iP_Hs)o7f9ZZuAY5 zG$(ObSO@*7pZb8!gH-*6^x%MY%e9fyfE^{((A6BD5fXs()d+SsO{sBTRvXbfPvkDa z;Xh&drl2lu6(+yOE4fG2o5B7S74#?HASPhqRW;QA4lM2` zU0wc$n#8c_Mlh--YsWQfOIZNl0p9J{<;C)ZI4{}Iet$2%3d;snE4OOMy0GXBYivYI zt#SOR*SlKNdS=2-#>1lE{%O2RmoCAM*{i-}%dj$@W42q#GU0wuoP4k-J2QbZMhsDK zh%2G4>yg|P{fo*?X?1TL7&jP_E3t)w`m~NT2bP2QSAdC;$|q$ zRk~Ro#GD(j?>chmg$VFb->*YrUEjJ4aD4bsHtx~7NIaq#DE>f2{R|Z7Xb<^OPKV1L zz<9_u;ffL}5LDpq>-~4L5JeA+LRR@?w*TsEv*dxd1CNL6Kj#OMc>4=Zdc5`Qe%u1S zJuTK&aJ>+5aa_7R^U{6kmjvci&NfTGZq}W2GrvLKWmVs~oF)cFBJTtN%vDPhij$!S z9#U7&?6_#|`USFw8fP1Yo8^*cQfw929o9W&7^ryoSkfNLK=aV+CeSZd^G|g|kUx;>CHCg@ZUGbq$9IMMP{ep7}Ze1OSrMFVkjL}9g zLalZ Date: Sun, 17 Mar 2024 15:10:45 -0500 Subject: [PATCH 13/19] Update ExtraMachines.js From 4b639b1b8f86e7f8d3ef3e7eb5f799c950382550 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:12:25 -0500 Subject: [PATCH 14/19] Add files via upload --- mods/ExtraMachines.js | 1232 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1232 insertions(+) create mode 100644 mods/ExtraMachines.js diff --git a/mods/ExtraMachines.js b/mods/ExtraMachines.js new file mode 100644 index 00000000..538028b9 --- /dev/null +++ b/mods/ExtraMachines.js @@ -0,0 +1,1232 @@ +// this is a epic mod + +let heatSen = 0; +elements.heatSensor = { + + color: "#ff0000", + conduct: 1, + category:"test", + behavior: behaviors.WALL, + + onSelect: function(pixel){ + setTemp = parseInt(prompt("Enter the temperature you want it to sense. zero will not work", (heatSen || undefined))); + + }, + + + tick: function(pixel) { + if((pixel.start == pixelTicks) && !(heatSen == 0)){ + pixel.clone.temp = heatSen + } + + if (pixel.temp > pixel.clone ) { + pixel.charge = 1; + } + + + }, + +}; + +let itemA = "steam"; +elements.SteamTurbine = { + behavior: behaviors.WALL, + desc: "When steam touches it, it conducts electricity and the steam pixel is deleted", + color: "#826c6e", + tick: function(pixel) { + if(pixel.start == pixelTicks){ + pixel.clone = itemA; + } + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element == pixel.clone) { + deletePixel(x,y); + pixel.charge = 5; + break; + } + } + } + doDefaults(pixel); + }, + conduct: 1, + movable: false, + category:"machines", + darkText: true, + hardness: 1, + + }; + + +elements.coal = { + desc: "A black powder that burns", + color: "#3d3c39", + behavior: behaviors.POWDER, + category: "energy", + state: "solid", + density: 208, + conduct: 0.001, + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:2500, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, +}; + + + elements.coal_dust = { + desc: "A byproduct of smashed solid coal that burns like coal but for a shorter time", + color: "#3d3c39", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + stain: 1, + density: 190, + conduct: 0.001, + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:2000, + stateHigh: "fire", + hardness: 0.3, + burn: 100, + burnTime: 3500, +}; + + +elements.gasoline = { + color: "#c9c5b1", + desc: "A liquid that burns and is used to power most cars", + behavior: behaviors.LIQUID, + tick: function(pixel) { + if (pixel.temp > 430 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + tempHigh:3000, + stateHigh: "fire", + viscosity: 0.56, + burn: 100, + burnTime: 10000, + fireColor: "#c9c5b1", + category: "liquids", + state: "liquid", + density: 792, + stain: -0.25, +} + +let itemB = "light"; +elements.solar_panel = { + behavior: behaviors.WALL, + desc: "When light touches it, it conducts electricity and the light pixel is deleted", + color: "#bebfa3", + tick: function(pixel) { + if(pixel.start == pixelTicks){ + pixel.clone = itemB; + } + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element == pixel.clone) { + deletePixel(x,y); + pixel.charge = 5; + break; + } + } + } + doDefaults(pixel); + }, + conduct: 1, + movable: false, + category:"machines", + darkText: true, + hardness: 1, + + }; + +elements.titanium = { + desc: "Another metal that does not erode nor conduct electricity", + conduct: 0, + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + tempHigh:3000, + stateHigh: "molten_titanium", + category: "solids", + state: "soild", + hardness: 1, + density: 792, + behavior: behaviors.WALL, +}; + +elements.molten_titanium = { + desc: "Melted version of titanium", + temp : 3000, + conduct: 0, + color: "#d16e04", + tempLow:2999, + stateLow: "titanium", + category: "states", + state: "soild", + density: 792, + behavior: behaviors.MOLTEN, +}; + +elements.solid_coal = { + desc: "A solid version of coal", + color: "#3d3c39", + behavior: behaviors.WALL, + category: "energy", + state: "solid", + breakInto: "coal_dust", + density: 380, + conduct: 0.001, + + tick: function(pixel) { + if (pixel.temp > 900 && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + }, + + tempHigh:3000, + stateHigh: "fire", + hardness: 0.85, + burn: 100, + burnTime: 3500, +}; + +elements.rubber = { + desc: "Not finnished", + color: "#ffc0cb", + hardness: 0.5, + tempHigh:180, + state: "solid", + behavior: behaviors.WALL, + conduct: 0, + category: "solids", +}; + +elements.coolant = { + desc: "Cools down pixels that touch it and is a liquid", + color: "#71ded3", + state: "liquid", + insulate: true, + behavior: behaviors.LIQUID, + tick: function(pixel) { + + + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.element && sensed.temp > 21 ) { + + sensed.temp -= 1; + break; + } + } + } + doDefaults(pixel); + }, + conduct: 0.5, + category: "test", + +}; + +elements.e_cooler = { + desc: "Works like the cooler but needs power to work", + color: elements.cooler.color, + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + behaviorOn: [ + "XX|CO:2|XX", + "CO:2|XX|CO:2", + "XX|CO:2|XX", + ], + name: "E-Cooler", +}; + +elements.e_Freezer = { + desc: "Works like the freezer but needs power to work", + color: elements.cooler.color, + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + behaviorOn: [ + "XX|CO:10|XX", + "CO:10|XX|CO:10", + "XX|CO:10|XX", + ], + name: "E-Freezer", +}; + +elements.e_heater = { + desc: "Works like the heater but needs power to work", + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + color: "#881111", + behaviorOn: [ + "XX|HT:4|XX", + "HT:4|XX|HT:4", + "XX|HT:4|XX", + ], + name: "E-Heater", +}; + +elements.e_SuperHeater = { + desc: "Works like the Super Heater but needs power to work", + hardness: 0.5, + state: "solid", + behavior: behaviors.WALL, + conduct: 1, + category: "machines", + color: "#881111", + behaviorOn: [ + "XX|HT:12|XX", + "HT:12|XX|HT:12", + "XX|HT:12|XX", + ], + name: "E-SuperHeater", +}; + +elements.slow_Ecloner = { + desc: "Works like the Slow Cloner but needs power to work", + color: "#888800", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|CF%10|XX", + "CF%10|XX|CF%10", + "XX|CF%10|XX", + ], + ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall","SteamTurbine","solar_panel"], + category:"machines", + insulate:true, + hardness: 1, + conduct: 1, + name: "E-SlowCloner", +}; + +elements.Android = { + desc: "A robot", + color: "#a1ada5", + category: "life", + color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"], + category: "life", + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+1)) { + createPixel("AndroidBody", pixel.x, pixel.y+1); + pixel.element = "AndroidHead"; + } + else if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("AndroidHead", pixel.x, pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixel.color; + pixel.element = "AndroidBody"; + pixel.color = pixelColorPick(pixel) + } + else { + deletePixel(pixel.x, pixel.y); + } + }, + related: ["AndroidBody","AndroidHead"], + cooldown: defaultCooldown +}; + + +elements.AndroidBody = { + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "life", + breakInto: ["oil","metal_scrap","explosion"], + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "AndroidHead") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "AndroidHead") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create blood if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("oil", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + } +}; + +elements.AndroidHead = { + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "life", + density: 1080, + state: "solid", + conduct: .05, + temp: 69, + breakInto: ["oil","metal_scrap","explosion"], +}; + +listPipes = "pipe" + + +//thx to morechem.js for the idea + +let setTemp = ""; +elements.ajustableHeater = { + desc: "Works like a heater but it can be set to a specific temp and needs power to work", + color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + category: "machines", + density: 1080, + state: "solid", + conduct: 1, + movable: false, + name: "Ajustable-E-Heater", + onSelect: function(pixel){ + setTemp = parseInt(prompt("Enter the temperature you want it set to.", (setTemp || undefined))); + + }, + tick: function(pixel) { + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + var sensed = pixelMap[x][y]; + if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { + sensed.temp += setTemp/6; + + break; + } + } + } + doDefaults(pixel); + }, + insulate:true +}; + +//old grinder +// elements.grinder = { + // color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], + // category: "machines", + // density: 1080, + // state: "solid", + // conduct: 1, + // movable: false, + + // ignore: "grinder", + + // tick: function(pixel) { + // for (var i = 0; i < adjacentCoords.length; i++) { + // var coords = adjacentCoords[i]; + // var x = pixel.x + coords[0]; + // var y = pixel.y + coords[1]; + // if (!isEmpty(x,y,true)) { + // var sensed = pixelMap[x][y]; + // if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { + // breakPixel(sensed); + // } + // } + // } + // doDefaults(pixel); + // }, + // insulate:true + + + +// }; + + + +elements.dead_plant.conduct = 1; +// let compact = "dead_plant"; +// elements.compacter = { + // behavior: behaviors.WALL, + // color: "#bebfa3", + // tick: function(pixel) { + // if(pixel.start == pixelTicks){ + // pixel.clone = compact; + // } + + + // for (var i = 0; i < adjacentCoords.length; i++) { + // var coords = adjacentCoords[i]; + // var x = pixel.x + coords[0]; + // var y = pixel.y + coords[1]; + // if (!isEmpty(x,y,true)) { + // var sensed = pixelMap[x][y]; + // if (sensed.element == pixel.clone && pixel.charge > 0) { + // sensed.element = "coal" + // sensed.color = elements.coal.color + // break; + // } + // } + // } + // doDefaults(pixel); + // }, + // conduct: 1, + // movable: false, + // category:"machines", + // darkText: true, + // hardness: 1, +// } +compactPi = "dead_plant"; +compactPi2 = "coal"; +elements.compacter = { + color: "#4e524f", + desc: "Turns dead plants into coal and needs power", + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.CompactEl = compactPi + pixel.CompactEl2 = compactPi2 + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if ((newPixel.element == pixel.CompactEl) || (newPixel.element == pixel.CompactEl2) && pixel.charge > 0 ) { + + pixel.con = newPixel; + changePixel(newPixel, "coal") + newPixel.color = elements.coal.color + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +// thx to nousersthings mod for the filter +// only adding this bc my freind told me so +// im not good at javascript and coding so yeah + +filterTypeVar = 0; +elements.filter = { + color: "#599fc2", + desc: "A filter made by nouser", + onSelect: function() { + var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); + if (!answer4) { return } + filterTypeVar = answer4; + }, + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.filterType = filterTypeVar + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if (newPixel.element == pixel.filterType ) { + + pixel.con = newPixel; + + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +filterTypeVar2 = 0; +elements.Destructive_Filter = { + color: "#3c6c85", + desc: "A filter that destroys anything that isn't allowed to get through", + onSelect: function() { + var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); + if (!answer4) { return } + filterTypeVar2 = answer4; + }, + tick: function(pixel) { + if (pixel.start === pixelTicks) { + pixel.filterType = filterTypeVar2 + } + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con ) { //suck up pixel + if (newPixel.element == pixel.filterType) { + + pixel.con = newPixel; + + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + else if(!(newPixel.element == "filter") && !(newPixel.element == "Destructive_Filter") && !doNotEF.includes(newPixel.element) ) { + deletePixel(newPixel.x, newPixel.y); + break; + + } + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + + + +// going to fix the sucking up solids problem soon!! +doNotEF = ["e_grinder","grinder","filter", "battery", "wire", "cloner", "sensor", "heater","cooler", "Ajustable-E-Heater", "E-Cooler", "E-Freezer", "E-Heater", "E-SuperHeater", "E-SlowCloner", "ewall", "titanium", "tungsten", "steel", "insulation","SteamTurbine","solar_panel"]; + +elements.grinder = { + color: "#55565c", + ignore: ["e_grinder","grinder"], + desc: "Grinds things", + tick: function(pixel) { + + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con && !doNotEF.includes(newPixel.element) ) { //suck up pixel + // (!pixel.con && !(newPixel.element === "e_grinder") && pixel.charge > 0 && !(newPixel.element.movable)) + // (!pixel.con && !(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") && !(newPixel.element === "filter") && (newPixel.element.movable)) + //!(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") + pixel.con = newPixel; + breakPixel(pixel.con); + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + +//elements.battery.movable: false + +elements.e_grinder = { + color: "#55565c", + ignore: ["e_grinder","grinder"], + conduct: 1, + desc: "Grinds things,needs power to work", + tick: function(pixel) { + + if (1 === 2) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { +// createPixel("brick",x,y); +// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); + } + } + // pixel.stage = 1; + } + else if (1 === 2) { //uninitialized + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + // pixel.stage = 2; //blue + // pixel.color = pixelColorPick(pixel,"#000036"); + break; + } + } + } + else if (1 === 1) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { +// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green + // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red +// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue + } + // newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (listPipes.includes(newPixel.element)) { + var nextStage; + switch (pixel.stage) { + // case 2: nextStage = 4; break; //green +// case 3: nextStage = 2; break; //red + // case 4: nextStage = 3; break; //blue + } + if (pixel.con && !newPixel.con) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con && !doNotEF.includes(newPixel.element) && pixel.charge > 0 ) { //suck up pixel + + + pixel.con = newPixel; + breakPixel(pixel.con); + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + + } + } + } + if (pixel.con && !moved) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); + }, + category: "machines", + movable: false, + canContain: true, + noMix: true, + insulate: true, +} + + + +// elements.cementMix = { + +// } \ No newline at end of file From e249837812d4f5e76ed1129667886547e584b570 Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:12:43 -0500 Subject: [PATCH 15/19] Delete ExtraMachines.js --- ExtraMachines.js | 1232 ---------------------------------------------- 1 file changed, 1232 deletions(-) delete mode 100644 ExtraMachines.js diff --git a/ExtraMachines.js b/ExtraMachines.js deleted file mode 100644 index 20137987..00000000 --- a/ExtraMachines.js +++ /dev/null @@ -1,1232 +0,0 @@ -// this is a epic mod - -let heatSen = 0; -elements.heatSensor = { - - color: "#ff0000", - conduct: 1, - category:"test", - behavior: behaviors.WALL, - - onSelect: function(pixel){ - setTemp = parseInt(prompt("Enter the temperature you want it to sense. zero will not work", (heatSen || undefined))); - - }, - - - tick: function(pixel) { - if((pixel.start == pixelTicks) && !(heatSen == 0)){ - pixel.clone.temp = heatSen - } - - if (pixel.temp > pixel.clone ) { - pixel.charge = 1; - } - - - }, - -}; - -let itemA = "steam"; -elements.SteamTurbine = { - behavior: behaviors.WALL, - desc: "When steam touches it, it conducts electricity and the steam pixel is deleted", - color: "#826c6e", - tick: function(pixel) { - if(pixel.start == pixelTicks){ - pixel.clone = itemA; - } - - for (var i = 0; i < adjacentCoords.length; i++) { - var coords = adjacentCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (!isEmpty(x,y,true)) { - var sensed = pixelMap[x][y]; - if (sensed.element == pixel.clone) { - deletePixel(x,y); - pixel.charge = 5; - break; - } - } - } - doDefaults(pixel); - }, - conduct: 1, - movable: false, - category:"machines", - darkText: true, - hardness: 1, - - }; - - -elements.coal = { - desc: "A black powder that burns", - color: "#3d3c39", - behavior: behaviors.POWDER, - category: "energy", - state: "solid", - density: 208, - conduct: 0.001, - - tick: function(pixel) { - if (pixel.temp > 900 && !pixel.burning) { - pixel.burning = true; - pixel.burnStart = pixelTicks; - } - }, - - tempHigh:2500, - stateHigh: "fire", - hardness: 0.85, - burn: 100, - burnTime: 3500, -}; - - - elements.coal_dust = { - desc: "A byproduct of smashed solid coal that burns like coal but for a shorter time", - color: "#3d3c39", - behavior: behaviors.POWDER, - category: "powders", - state: "solid", - stain: 1, - density: 190, - conduct: 0.001, - - tick: function(pixel) { - if (pixel.temp > 900 && !pixel.burning) { - pixel.burning = true; - pixel.burnStart = pixelTicks; - } - }, - - tempHigh:2000, - stateHigh: "fire", - hardness: 0.3, - burn: 100, - burnTime: 3500, -}; - - -elements.gasoline = { - color: "#c9c5b1", - desc: "A liquid that burns and is used to power most cars", - behavior: behaviors.LIQUID, - tick: function(pixel) { - if (pixel.temp > 430 && !pixel.burning) { - pixel.burning = true; - pixel.burnStart = pixelTicks; - } - }, - tempHigh:3000, - stateHigh: "fire", - viscosity: 0.56, - burn: 100, - burnTime: 10000, - fireColor: "#c9c5b1", - category: "liquids", - state: "liquid", - density: 792, - stain: -0.25, -} - -let itemB = "light"; -elements.solar_panel = { - behavior: behaviors.WALL, - desc: "When light touches it, it conducts electricity and the light pixel is deleted", - color: "#bebfa3", - tick: function(pixel) { - if(pixel.start == pixelTicks){ - pixel.clone = itemB; - } - - for (var i = 0; i < adjacentCoords.length; i++) { - var coords = adjacentCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (!isEmpty(x,y,true)) { - var sensed = pixelMap[x][y]; - if (sensed.element == pixel.clone) { - deletePixel(x,y); - pixel.charge = 5; - break; - } - } - } - doDefaults(pixel); - }, - conduct: 1, - movable: false, - category:"machines", - darkText: true, - hardness: 1, - - }; - -elements.titanium = { - desc: "Another metal that does not erode nor conduct electricity", - conduct: 0, - color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], - tempHigh:3000, - stateHigh: "molten_titanium", - category: "solids", - state: "soild", - hardness: 1, - density: 792, - behavior: behaviors.WALL, -}; - -elements.molten_titanium = { - desc: "Melted version of titanium", - temp : 3000, - conduct: 0, - color: "#d16e04", - tempLow:2999, - stateLow: "titanium", - category: "states", - state: "soild", - density: 792, - behavior: behaviors.MOLTEN, -}; - -elements.solid_coal = { - desc: "A solid version of coal", - color: "#3d3c39", - behavior: behaviors.WALL, - category: "energy", - state: "solid", - breakInto: "coal_dust", - density: 380, - conduct: 0.001, - - tick: function(pixel) { - if (pixel.temp > 900 && !pixel.burning) { - pixel.burning = true; - pixel.burnStart = pixelTicks; - } - }, - - tempHigh:3000, - stateHigh: "fire", - hardness: 0.85, - burn: 100, - burnTime: 3500, -}; - -elements.rubber = { - desc: "Not finnished", - color: "#ffc0cb", - hardness: 0.5, - tempHigh:180, - state: "solid", - behavior: behaviors.WALL, - conduct: 0, - category: "solids", -}; - -elements.coolant = { - desc: "Cools down pixels that touch it and is a liquid", - color: "#71ded3", - state: "liquid", - insulate: true, - behavior: behaviors.LIQUID, - tick: function(pixel) { - - - for (var i = 0; i < adjacentCoords.length; i++) { - var coords = adjacentCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (!isEmpty(x,y,true)) { - var sensed = pixelMap[x][y]; - if (sensed.element && sensed.temp > 21 ) { - - sensed.temp -= 1; - break; - } - } - } - doDefaults(pixel); - }, - conduct: 0.5, - category: "test", - -}; - -elements.e_cooler = { - desc: "Works like the cooler but needs power to work", - color: elements.cooler.color, - hardness: 0.5, - state: "solid", - behavior: behaviors.WALL, - conduct: 1, - category: "machines", - behaviorOn: [ - "XX|CO:2|XX", - "CO:2|XX|CO:2", - "XX|CO:2|XX", - ], - name: "E-Cooler", -}; - -elements.e_Freezer = { - desc: "Works like the freezer but needs power to work", - color: elements.cooler.color, - hardness: 0.5, - state: "solid", - behavior: behaviors.WALL, - conduct: 1, - category: "machines", - behaviorOn: [ - "XX|CO:10|XX", - "CO:10|XX|CO:10", - "XX|CO:10|XX", - ], - name: "E-Freezer", -}; - -elements.e_heater = { - desc: "Works like the heater but needs power to work", - hardness: 0.5, - state: "solid", - behavior: behaviors.WALL, - conduct: 1, - category: "machines", - color: "#881111", - behaviorOn: [ - "XX|HT:4|XX", - "HT:4|XX|HT:4", - "XX|HT:4|XX", - ], - name: "E-Heater", -}; - -elements.e_SuperHeater = { - desc: "Works like the Super Heater but needs power to work", - hardness: 0.5, - state: "solid", - behavior: behaviors.WALL, - conduct: 1, - category: "machines", - color: "#881111", - behaviorOn: [ - "XX|HT:12|XX", - "HT:12|XX|HT:12", - "XX|HT:12|XX", - ], - name: "E-SuperHeater", -}; - -elements.slow_Ecloner = { - desc: "Works like the Slow Cloner but needs power to work", - color: "#888800", - behavior: behaviors.WALL, - behaviorOn: [ - "XX|CF%10|XX", - "CF%10|XX|CF%10", - "XX|CF%10|XX", - ], - ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall","SteamTurbine","solar_panel"], - category:"machines", - insulate:true, - hardness: 1, - conduct: 1, - name: "E-SlowCloner", -}; - -elements.Android = { - desc: "A robot", - color: "#a1ada5", - category: "life", - color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"], - category: "life", - properties: { - dead: false, - dir: 1, - panic: 0 - }, - tick: function(pixel) { - if (isEmpty(pixel.x, pixel.y+1)) { - createPixel("AndroidBody", pixel.x, pixel.y+1); - pixel.element = "AndroidHead"; - } - else if (isEmpty(pixel.x, pixel.y-1)) { - createPixel("AndroidHead", pixel.x, pixel.y-1); - pixelMap[pixel.x][pixel.y-1].color = pixel.color; - pixel.element = "AndroidBody"; - pixel.color = pixelColorPick(pixel) - } - else { - deletePixel(pixel.x, pixel.y); - } - }, - related: ["AndroidBody","AndroidHead"], - cooldown: defaultCooldown -}; - - -elements.AndroidBody = { - color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], - category: "life", - breakInto: ["oil","metal_scrap","explosion"], - properties: { - dead: false, - dir: 1, - panic: 0 - }, - tick: function(pixel) { - if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall - if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down - var headpixel = pixelMap[pixel.x][pixel.y-2]; - if (headpixel.element == "AndroidHead") { - if (isEmpty(pixel.x, pixel.y-1)) { - movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); - } - else { - swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); - } - } - } - } - doHeat(pixel); - doBurning(pixel); - doElectricity(pixel); - if (pixel.dead) { - // Turn into rotten_meat if pixelTicks-dead > 500 - if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { - changePixel(pixel,"rotten_meat"); - } - return - } - - // Find the head - if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "AndroidHead") { - var head = pixelMap[pixel.x][pixel.y-1]; - if (head.dead) { // If head is dead, kill body - pixel.dead = head.dead; - } - } - else { var head = null } - if (pixel.burning) { - pixel.panic += 0.1; - if (head && pixelTicks-pixel.burnStart > 240) { - pixel.color = head.color; - } - } - else if (pixel.panic > 0) { - pixel.panic -= 0.1; - } - - if (isEmpty(pixel.x, pixel.y-1)) { - // create blood if decapitated 10% chance - if (Math.random() < 0.1 && !pixel.charge) { - createPixel("oil", pixel.x, pixel.y-1); - // set dead to true 15% chance - if (Math.random() < 0.15) { - pixel.dead = pixelTicks; - } - } - } - else if (head == null) { return } - else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance - var movesToTry = [ - [1*pixel.dir,0], - [1*pixel.dir,-1], - ]; - // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. - while (movesToTry.length > 0) { - var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; - if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { - var origx = pixel.x+move[0]; - var origy = pixel.y+move[1]; - if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { - movePixel(head, head.x+move[0], head.y+move[1]); - break; - } - } - } - // 15% chance to change direction - if (Math.random() < 0.15) { - pixel.dir *= -1; - } - // homeostasis - if (pixel.temp > 37) { pixel.temp -= 1; } - else if (pixel.temp < 37) { pixel.temp += 1; } - } - - } -}; - -elements.AndroidHead = { - color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], - category: "life", - density: 1080, - state: "solid", - conduct: .05, - temp: 69, - breakInto: ["oil","metal_scrap","explosion"], -}; - -listPipes = "pipe" - - -//thx to morechem.js for the idea - -let setTemp = ""; -elements.ajustableHeater = { - desc: "Works like a heater but it can be set to a specific temp and needs power to work", - color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], - category: "machines", - density: 1080, - state: "solid", - conduct: 1, - movable: false, - name: "Ajustable-E-Heater", - onSelect: function(pixel){ - setTemp = parseInt(prompt("Enter the temperature you want it set to.", (setTemp || undefined))); - - }, - tick: function(pixel) { - for (var i = 0; i < adjacentCoords.length; i++) { - var coords = adjacentCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (!isEmpty(x,y,true)) { - var sensed = pixelMap[x][y]; - if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { - sensed.temp += setTemp/6; - - break; - } - } - } - doDefaults(pixel); - }, - insulate:true -}; - -//old grinder -// elements.grinder = { - // color: ["#a1ada5","#ebf5ee","#bac2bc","#848a86","#505251"], - // category: "machines", - // density: 1080, - // state: "solid", - // conduct: 1, - // movable: false, - - // ignore: "grinder", - - // tick: function(pixel) { - // for (var i = 0; i < adjacentCoords.length; i++) { - // var coords = adjacentCoords[i]; - // var x = pixel.x + coords[0]; - // var y = pixel.y + coords[1]; - // if (!isEmpty(x,y,true)) { - // var sensed = pixelMap[x][y]; - // if (sensed.con || elements[sensed.element].movable && pixel.charge > 0) { - // breakPixel(sensed); - // } - // } - // } - // doDefaults(pixel); - // }, - // insulate:true - - - -// }; - - - -elements.dead_plant.conduct = 1; -// let compact = "dead_plant"; -// elements.compacter = { - // behavior: behaviors.WALL, - // color: "#bebfa3", - // tick: function(pixel) { - // if(pixel.start == pixelTicks){ - // pixel.clone = compact; - // } - - - // for (var i = 0; i < adjacentCoords.length; i++) { - // var coords = adjacentCoords[i]; - // var x = pixel.x + coords[0]; - // var y = pixel.y + coords[1]; - // if (!isEmpty(x,y,true)) { - // var sensed = pixelMap[x][y]; - // if (sensed.element == pixel.clone && pixel.charge > 0) { - // sensed.element = "coal" - // sensed.color = elements.coal.color - // break; - // } - // } - // } - // doDefaults(pixel); - // }, - // conduct: 1, - // movable: false, - // category:"machines", - // darkText: true, - // hardness: 1, -// } -compactPi = "dead_plant"; -compactPi2 = "coal"; -elements.compacter = { - color: "#4e524f", - desc: "Turns dead plants into coal and needs power", - tick: function(pixel) { - if (pixel.start === pixelTicks) { - pixel.CompactEl = compactPi - pixel.CompactEl2 = compactPi2 - } - if (1 === 2) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { -// createPixel("brick",x,y); -// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); - } - } - // pixel.stage = 1; - } - else if (1 === 2) { //uninitialized - for (var i = 0; i < adjacentCoords.length; i++) { - var coord = adjacentCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - // pixel.stage = 2; //blue - // pixel.color = pixelColorPick(pixel,"#000036"); - break; - } - } - } - else if (1 === 1) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { -// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green - // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red -// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue - } - // newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (listPipes.includes(newPixel.element)) { - var nextStage; - switch (pixel.stage) { - // case 2: nextStage = 4; break; //green -// case 3: nextStage = 2; break; //red - // case 4: nextStage = 3; break; //blue - } - if (pixel.con && !newPixel.con) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con ) { //suck up pixel - if ((newPixel.element == pixel.CompactEl) || (newPixel.element == pixel.CompactEl2) && pixel.charge > 0 ) { - - pixel.con = newPixel; - changePixel(newPixel, "coal") - newPixel.color = elements.coal.color - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - } - } - } - } - if (pixel.con && !moved) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } - doDefaults(pixel); - }, - category: "machines", - movable: false, - canContain: true, - noMix: true, - insulate: true, -} - -// thx to nousersthings mod for the filter -// only adding this bc my freind told me so -// im not good at javascript and coding so yeah - -filterTypeVar = 0; -elements.filter = { - color: "#599fc2", - desc: "A filter made by nouser", - onSelect: function() { - var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); - if (!answer4) { return } - filterTypeVar = answer4; - }, - tick: function(pixel) { - if (pixel.start === pixelTicks) { - pixel.filterType = filterTypeVar - } - if (1 === 2) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { -// createPixel("brick",x,y); -// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); - } - } - // pixel.stage = 1; - } - else if (1 === 2) { //uninitialized - for (var i = 0; i < adjacentCoords.length; i++) { - var coord = adjacentCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - // pixel.stage = 2; //blue - // pixel.color = pixelColorPick(pixel,"#000036"); - break; - } - } - } - else if (1 === 1) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { -// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green - // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red -// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue - } - // newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (listPipes.includes(newPixel.element)) { - var nextStage; - switch (pixel.stage) { - // case 2: nextStage = 4; break; //green -// case 3: nextStage = 2; break; //red - // case 4: nextStage = 3; break; //blue - } - if (pixel.con && !newPixel.con) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con ) { //suck up pixel - if (newPixel.element == pixel.filterType ) { - - pixel.con = newPixel; - - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - } - } - } - } - if (pixel.con && !moved) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } - doDefaults(pixel); - }, - category: "machines", - movable: false, - canContain: true, - noMix: true, - insulate: true, -} - -filterTypeVar2 = 0; -elements.Destructive_Filter = { - color: "#3c6c85", - desc: "A filter that destroys anything that isn't allowed to get through", - onSelect: function() { - var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined)); - if (!answer4) { return } - filterTypeVar2 = answer4; - }, - tick: function(pixel) { - if (pixel.start === pixelTicks) { - pixel.filterType = filterTypeVar2 - } - if (1 === 2) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { -// createPixel("brick",x,y); -// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); - } - } - // pixel.stage = 1; - } - else if (1 === 2) { //uninitialized - for (var i = 0; i < adjacentCoords.length; i++) { - var coord = adjacentCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - // pixel.stage = 2; //blue - // pixel.color = pixelColorPick(pixel,"#000036"); - break; - } - } - } - else if (1 === 1) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { -// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green - // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red -// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue - } - // newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (listPipes.includes(newPixel.element)) { - var nextStage; - switch (pixel.stage) { - // case 2: nextStage = 4; break; //green -// case 3: nextStage = 2; break; //red - // case 4: nextStage = 3; break; //blue - } - if (pixel.con && !newPixel.con) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con ) { //suck up pixel - if (newPixel.element == pixel.filterType) { - - pixel.con = newPixel; - - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - } - else if(!(newPixel.element == "filter") && !(newPixel.element == "Destructive_Filter") && !doNotEF.includes(newPixel.element) ) { - deletePixel(newPixel.x, newPixel.y); - break; - - } - } - } - } - if (pixel.con && !moved) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } - doDefaults(pixel); - }, - category: "machines", - movable: false, - canContain: true, - noMix: true, - insulate: true, -} - - - -// going to fix the sucking up solids problem soon!! -doNotEF = ["e_grinder","grinder","filter", "battery", "wire", "cloner", "sensor", "heater","cooler", "Ajustable-E-Heater", "E-Cooler", "E-Freezer", "E-Heater", "E-SuperHeater", "E-SlowCloner", "ewall", "titanium", "tungsten", "steel", "insulation","SteamTurbine","solar_panel"]; - -elements.grinder = { - color: "#55565c", - ignore: ["e_grinder","grinder"], - desc: "Grinds things", - tick: function(pixel) { - - if (1 === 2) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { -// createPixel("brick",x,y); -// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); - } - } - // pixel.stage = 1; - } - else if (1 === 2) { //uninitialized - for (var i = 0; i < adjacentCoords.length; i++) { - var coord = adjacentCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - // pixel.stage = 2; //blue - // pixel.color = pixelColorPick(pixel,"#000036"); - break; - } - } - } - else if (1 === 1) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { -// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green - // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red -// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue - } - // newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (listPipes.includes(newPixel.element)) { - var nextStage; - switch (pixel.stage) { - // case 2: nextStage = 4; break; //green -// case 3: nextStage = 2; break; //red - // case 4: nextStage = 3; break; //blue - } - if (pixel.con && !newPixel.con) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con && !doNotEF.includes(newPixel.element) ) { //suck up pixel - // (!pixel.con && !(newPixel.element === "e_grinder") && pixel.charge > 0 && !(newPixel.element.movable)) - // (!pixel.con && !(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") && !(newPixel.element === "filter") && (newPixel.element.movable)) - //!(newPixel.element === "grinder") && !(newPixel.element === "e_grinder") - pixel.con = newPixel; - breakPixel(pixel.con); - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - - } - } - } - if (pixel.con && !moved) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } - doDefaults(pixel); - }, - category: "machines", - movable: false, - canContain: true, - noMix: true, - insulate: true, -} - -//elements.battery.movable: false - -elements.e_grinder = { - color: "#55565c", - ignore: ["e_grinder","grinder"], - conduct: 1, - desc: "Grinds things,needs power to work", - tick: function(pixel) { - - if (1 === 2) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { -// createPixel("brick",x,y); -// pixelMap[x][y].color = pixelColorPick(pixel,"#808080"); - } - } - // pixel.stage = 1; - } - else if (1 === 2) { //uninitialized - for (var i = 0; i < adjacentCoords.length; i++) { - var coord = adjacentCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - // pixel.stage = 2; //blue - // pixel.color = pixelColorPick(pixel,"#000036"); - break; - } - } - } - else if (1 === 1) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { -// case 2: newPixel.stage = 3; newColor = "#003600"; break; //green - // case 3: newPixel.stage = 4; newColor = "#360000"; break; //red -// case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue - } - // newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (listPipes.includes(newPixel.element)) { - var nextStage; - switch (pixel.stage) { - // case 2: nextStage = 4; break; //green -// case 3: nextStage = 2; break; //red - // case 4: nextStage = 3; break; //blue - } - if (pixel.con && !newPixel.con) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con && !doNotEF.includes(newPixel.element) && pixel.charge > 0 ) { //suck up pixel - - - pixel.con = newPixel; - breakPixel(pixel.con); - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - - } - } - } - if (pixel.con && !moved) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && listPipes.includes(pixelMap[x][y].element)) { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } - doDefaults(pixel); - }, - category: "machines", - movable: false, - canContain: true, - noMix: true, - insulate: true, -} - - - -// elements.cementMix = { - -// } From 18ff6466d303eb95b5ec12b3cbc64286aa74f7cd Mon Sep 17 00:00:00 2001 From: Mecoolnotcool <106288499+Mecoolnotcool@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:31:39 -0500 Subject: [PATCH 16/19] Update ExtraMachines.js --- mods/ExtraMachines.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mods/ExtraMachines.js b/mods/ExtraMachines.js index 538028b9..2ea54034 100644 --- a/mods/ExtraMachines.js +++ b/mods/ExtraMachines.js @@ -1225,8 +1225,11 @@ elements.e_grinder = { insulate: true, } - - -// elements.cementMix = { - -// } \ No newline at end of file +elements.quickSand = { + color: elements.sand.color, + category: "land", + state: "liquid", + behavior : behaviors.POWDER, //did this as a joke to see if it works lol + density: 500, + conduct: 0.02, +} From 6bc22bb75b309a93d0e148778e5227f8e4116010 Mon Sep 17 00:00:00 2001 From: HACKERPRO908 <130792075+HACKERPRO908@users.noreply.github.com> Date: Sun, 17 Mar 2024 20:55:18 +0000 Subject: [PATCH 17/19] Update fantasy_elements.js - 1.5 Signed-off-by: HACKERPRO908 <130792075+HACKERPRO908@users.noreply.github.com> --- mods/fantasy_elements.js | 64 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/mods/fantasy_elements.js b/mods/fantasy_elements.js index 09f3c813..4ca0481d 100644 --- a/mods/fantasy_elements.js +++ b/mods/fantasy_elements.js @@ -1,4 +1,37 @@ +// 1.0 update +// adds dragon breath +// adds frostbite +// adds pulsium +// adds pulsium bar +// adds goblins delight +// adds pheonix +// adds pheonix ash +// adds baby pheonix +// adds ice pheonix + +// 1.1 update +// adds dragon scale +// adds mystic runes +// adds enchanted wood +// adds quartzium +// adds quartz +// adds moonite + +// 1.2 update +// fixed visibility bug and some errors +// adds faustium +// adds nebulaflare +// adds flaro +// adds aurorium +// adds glimmerium +// adds ozmoz +// adds goblin +// adds fenzium +// adds sceptrium +// adds sceptrium dust + // 1.3.2 fantasy_elements.js mod +// added changelog // adds plode a bomb // 1.4 the golem mod @@ -12,6 +45,11 @@ // iced pheonix at 700 degrees becomes pheonix // added blood golem +// 1.5 update +// corrected the 'phoenix' wrong spelling mistake to pheonix +// added grethe +// added grothea + elements.dragon_breath = { color: "#f94e4e", behavior: behaviors.GAS, @@ -110,7 +148,7 @@ elements.pheonix = { baby: "baby_pheonix", }; -elements.phoenix_ash = { +elements.pheonix_ash = { color: "#a8a8a5", behavior: behaviors.POWDER, category: "fantasy", @@ -134,7 +172,7 @@ elements.baby_pheonix = { burnTime:19, state: "solid", stateLow: "iced_pheonix", - breakInto: "phoenix_ash", + breakInto: "pheonix_ash", density: 850, conduct: 1, }; @@ -738,3 +776,25 @@ elements.blood_golem= { "category":"fantasy", "temp": 10, }; + +elements.grethe = { + color: "#51f542", + "behavior": [ + "XX|XX|DL", + "SA|XX|M2", + "XX|M1|XX", + ], + category: "fantasy", + state: "solid", +}; + +elements.grothea = { + color: ["#d742f5","#c246db","#772987"], + "behavior": [ + "M2|XX|XX", + "SA|M1|XX", + "XX|XX|DL", + ], + category: "fantasy", + state: "solid", +}; From edb3d7d8598c4e28350a6227f026f055a0795091 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Sun, 17 Mar 2024 17:05:46 -0400 Subject: [PATCH 18/19] bug fixes --- mods/a_mod_by_alice.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/mods/a_mod_by_alice.js b/mods/a_mod_by_alice.js index 873f89a3..0b5bda76 100644 --- a/mods/a_mod_by_alice.js +++ b/mods/a_mod_by_alice.js @@ -14,6 +14,13 @@ try { //ESSENTIAL COMMON FUNCTIONS (CODE LIBRARY) ## + //DEBUGGING + + function logAndReturn(thing) { + console.log(thing); + return thing + }; + //URL urlParams = new URLSearchParams(window.location.search); @@ -493,7 +500,7 @@ try { if(!color.startsWith("hsl(") || !color.endsWith(")")) { throw new Error(`The color ${color} is not a valid hsl() color`) }; - var colorTempArray = color.split(",") + var colorTempArray = color.split(",").map(x => x.trim()) if(colorTempArray.length !== 3) { throw new Error(`The color ${color} is not a valid hsl() color`) }; @@ -2101,6 +2108,8 @@ try { if(pixelIndex !== -1) { currentPixels.splice(pixelIndex,1) if (pixelMap[x][y]) { delete pixelMap[x][y] }; + } else { + return false }; //if (pixelMap[x][y]) {pixelMap[x][y].del = true} //if (pixelMap[x][y]) { delete pixelMap[x][y] }; @@ -21260,10 +21269,13 @@ Pixel size (rendering only): (Use if the save looks cut o tempLow: Math.min(rockInfo.tempHigh - 100,800), stateLow: rockName, density: rockInfo.density * 0.9, - hardness: rockInfo.density * 0.85, //breakInto: newName + "_gravel", _data: [rockData[0], rockData[1], hotData2Switch(rockData[2])], }; + + if(rockInfo.hardness) { + elements[newName].hardness = rockInfo.hardness * 0.85 + }; //console.log([elements[rockName].tempHigh,elements[rockName].stateHigh]); //console.log([elements[newName].tempLow,elements[newName].stateLow]) @@ -45937,14 +45949,15 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa //SPECIFY CURRENT ELEMENT ON LOAD ## window.addEventListener("load",function() { - //console.log(currentElement); currentElement = urlParams.get("currentElement") ?? "sand"; - //console.log(currentElement); if(!elementExists(currentElement)) { - //console.log(false); currentElement = "sand" - }// else { console.log(true) }; - //console.log(currentElement); + } + var size = urlParams.get("mouseSize") ?? 5; + if(isNaN(size)) { + size = 5; + }; + mouseSize = size }); //MISCELLANEOUS CHANGES ## From 4e946c1f8f2282fcf17d26512a39736885efd8ba Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:36:30 -0400 Subject: [PATCH 19/19] Add files via upload --- mods/jaydsfunctions.js | 111 +++++++++++++++++++++++++++++++++++++++++ mods/weapons.js | 85 ++++++++++++++++++++++++++++++- 2 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 mods/jaydsfunctions.js diff --git a/mods/jaydsfunctions.js b/mods/jaydsfunctions.js new file mode 100644 index 00000000..724ace4b --- /dev/null +++ b/mods/jaydsfunctions.js @@ -0,0 +1,111 @@ +//jaydsfunctions +erase1Var = 0; +elements.selective_eraser = { + color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"], + category: "tools", + tool: function(pixel) { + if (pixel.element === erase1Var) { + deletePixel(pixel.x, pixel.y); + } + }, + onSelect: function() { + var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined)); + if (!answer1) { return } + erase1Var = answer1; + } +}, +explode1Var = 0; +elements.selective_exploder = { + color: ["#ff0000","#ff0000","#ff0000","#555555","#555555","#555555"], + category: "tools", + tool: function(pixel) { + if (pixel.element === explode1Var) { + changePixel(pixel, "explosion") + } + }, + onSelect: function() { + var answer2 = prompt("Please input what element to explode.",(explode1Var||undefined)); + if (!answer2) { return } + explode1Var = answer2; + } +}, +convert11Var = 0; +convert22Var = 0; +elements.converter_tool = { + color: ["#ffffff","#ffffff","#ffffff","#555555","#555555","#555555"], + darkText: true, + category: "tools", + tool: function(pixel) { + if (pixel.element === convert11Var) { + changePixel(pixel, convert22Var) + } + }, + onSelect: function() { + var answer3 = prompt("Please input what should element be converted.",(convert11Var||undefined)); + if (!answer3) { return } + convert11Var = answer3; + var answer4 = prompt("Please input what element to convert into.",(convert22Var||undefined)); + if (!answer4) { return } + convert22Var = answer4; + } +}, +elements.fast_bomb = { + color: "#524c41", + category: "weapons", + state: "solid", + behavior: [ + "XX|EX:10>explosion|XX", + "XX|XX|XX", + "M2|M1 AND EX:10>explosion|M2", + ], + tick: function(pixel) { + for (var i=0; i<3; i++) { + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + if (!isEmpty(pixel.x, pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x][pixel.y+1]; + if (newPixel.element === "fast_bomb") { break; } + } + } + } + }, + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown +}, +exclude1Var = 0; +elements.exclusive_eraser = { + color: ["#ff5a00","#ff5a00","#ff5a00","#555555","#555555","#555555"], + category: "tools", + tool: function(pixel) { + if (pixel.element !== exclude1Var) { + deletePixel(pixel.x, pixel.y); + } + }, + onSelect: function() { + var answer5 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined)); + if (!answer5) { return } + exclude1Var = answer5; + } +}, +elements.tenth_heater = { + category: "special", + color: "#ff0000", + behavior: [ + "XX|HT:0.1|XX", + "HT:0.1|XX|HT:0.1", + "XX|HT:0.1|XX", + ], + ignore: "tenth_heater" +}, +elements.e_tenth_heater = { + category: "special", + color: "#ff0000", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|HT:0.1|XX", + "HT:0.1|XX|HT:0.1", + "XX|HT:0.1|XX", + ], + ignore: "tenth_heater", + conduct: 1 +} \ No newline at end of file diff --git a/mods/weapons.js b/mods/weapons.js index 3eef74c2..6c8181a3 100644 --- a/mods/weapons.js +++ b/mods/weapons.js @@ -509,4 +509,87 @@ tick: function(pixel) { }}}, category: "aircrafts", breakInto: "metal_scrap" - } \ No newline at end of file + }, +elements.machine_for_throwing_bombs_at_you_left = { + color: "#524c41", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|XX|XX", + "CR:bombs_for_throwing_at_you_left|XX|XX", + "XXXX|XX", + ], + category: "weapons", + conduct: 1 +}, +elements.bombs_for_throwing_at_you_left = { + color: "#524c41", + category: "ammunition", + behavior: [ + "XX|EX:10>bomb|XX", + "XX|XX|XX", + "M1|M1%10 AND EX:10>bomb|XX", + ], +} +elements.machine_for_throwing_bombs_at_right = { + color: "#524c41", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|XX|XX", + "XX|XX|CR:bombs_for_throwing_at_you_right", + "XXXX|XX", + ], + category: "weapons", + conduct: 1 +}, +elements.bombs_for_throwing_at_you_right = { + color: "#524c41", + category: "ammunition", + behavior: [ + "XX|EX:10>bomb|XX", + "XX|XX|XX", + "XX|M1%10 AND EX:10>bomb|M1", + ], +}, +elements.energized_orb_left = { + color: ["#e0e000","#f3f300"], + category: "energy", + behavior: [ + "XX|EX:50>electric|XX", + "M1 AND EX:50>electric|XX|EX:50>electric", + "XX|EX:50>electric|XX" + ], + state: "gas", +}, +elements.energized_orb_right = { + color: ["#e0e000","#f3f300"], + category: "energy", + behavior: [ + "XX|EX:50>electric|XX", + "EX:50>electric|XX|M1 AND EX:50>electric", + "XX|EX:50>electric|XX" + ], + state: "gas", +}, +elements.fast_bomb = { + color: "#524c41", + category: "weapons", + state: "solid", + behavior: [ + "XX|EX:10>explosion|XX", + "XX|XX|XX", + "M2|M1 AND EX:10>explosion|M2", + ], + tick: function(pixel) { + for (var i=0; i<3; i++) { + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + if (!isEmpty(pixel.x, pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x][pixel.y+1]; + if (newPixel.element === "fast_bomb") { break; } + } + } + } + }, + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown +} \ No newline at end of file