From f5e923afb1051fc375e54fe11f26e635e181d96c Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Mon, 11 Mar 2024 17:33:52 -0400 Subject: [PATCH] selective void --- mods/nousersthings.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index f55da663..00d4aea5 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -2274,4 +2274,33 @@ elements.insulating_filler = { category: elements.filler.category, state: elements.filler.state, insulate: true -} \ No newline at end of file +} +selvoid = 0; +elements.selective_void = { + category: "special", + color: elements.void.color, + excludeRandom: true, + state: "solid", + movable: "false", + onSelect: function() { + var selvoidans = prompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined)); + if (!selvoidans) { return } + selvoid = mostSimilarElement(selvoidans); + }, + tick: function(pixel){ + var neighbors = 0; + if(!pixel.changeElem){ + pixel.changeElem = selvoid; + } + 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)) { + var otherPixel = pixelMap[x][y] + if (otherPixel.element == pixel.changeElem) + deletePixel(x, y) + } + } + } +} \ No newline at end of file