diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 6d8cb01c..fda04d62 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -2003,4 +2003,38 @@ elements.dyer = { } } } -} \ No newline at end of file +} +elemfillerVar = 0; +elements.element_filler = { + category: "special", + color: elements.filler.color, + state: "solid", + movable: "false", + onSelect: function() { + var answer6 = prompt("Please input the desired element of this filler. It will not work if you do multiple filter types while paused.",(elemfillerVar||undefined)); + if (!answer6) { return } + elemfillerVar = answer6; + }, + tick: function(pixel){ + var neighbors = 0; + if(!pixel.changeElem){ + pixel.changeElem = elemfillerVar; + } + 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)) { + neighbors = neighbors + 1; + } else if (isEmpty(x, y)){ + createPixel("element_filler", x, y) + pixelMap[x][y].changeElem = pixel.changeElem; + } else ( + changePixel(pixel, pixel.changeElem) + ) + } + if (neighbors >= 8){ + changePixel(pixel, pixel.changeElem) + } + } +} \ No newline at end of file