From ee77ecc1d1f0f939430c63bc759edb8f12a8ca74 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:06:43 -0500 Subject: [PATCH] Update nousersthings.js --- mods/nousersthings.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 4fc88be4..9843d7cd 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1321,4 +1321,38 @@ elements.soup = { }, elements.broth.onMix = function(pixel){ changePixel(pixel, "soup") +}, +converter1Var = 0; +converter2Var = 0; +elements.converter = { + color: "#296127", + behavior: behaviors.WALL, + category: "machines", + tick: function(pixel) { + if (pixel.start === pixelTicks){ + pixel.contype = converter2Var; + pixel.specialturn = converter1Var; + } + 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)) { + var otherPixel = pixelMap[x][y]; + if ((otherPixel.element == pixel.specialturn || pixel.specialturn == "all") && !elements.converter.ignore.includes(otherPixel.element)){ + changePixel(otherPixel, pixel.contype) + } + } + } + }, + onSelect: function() { + var answer5 = prompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined)); + if (!answer5) { return } + converter1Var = answer5; + var answer6 = prompt("Please input what it should turn into.",(converter2Var||undefined)); + if (!answer6) { return } + converter2Var = answer6; + }, + ignore: ["converter", "wall", "ewall", "border"], } +