From 69c1200d90f140dae7ecf0c232cab0c257979157 Mon Sep 17 00:00:00 2001 From: O-01-67 <68935009+O-01-67@users.noreply.github.com> Date: Tue, 4 Oct 2022 14:00:14 -0400 Subject: [PATCH] alkahest dissolves everything and stores it (it does dissolve it without alteration, but good luck doing anything with that) --- mods/alkahest.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 mods/alkahest.js diff --git a/mods/alkahest.js b/mods/alkahest.js new file mode 100644 index 00000000..8cb78e6b --- /dev/null +++ b/mods/alkahest.js @@ -0,0 +1,31 @@ +elements.alkahest = { + color: "#33eeee", + behavior: behaviors.LIQUID_OLD, + state: "solid", + category: "special", + density: 999, + hardness: 1, + tick: function(pixel) { + for(i = 0; i < adjacentCoords.length; i++) { + if(Math.random() < 0.1) { + var pX = pixel.x + var pY = pixel.y + var oX = adjacentCoords[i][0]; + var oY = adjacentCoords[i][1]; + var checkPosX = pX+oX; + var checkPosY = pY+oY; + if(!isEmpty(checkPosX,checkPosY,true)) { + var newPixel = pixelMap[checkPosX][checkPosY]; + var newElement = newPixel.element; + if(![pixel.element,"wall"].includes(newElement)) { //unless someone's willing to implement dragon parts + if(typeof(pixel[newElement]) === "undefined") { + pixel[newElement] = 0; + }; + pixel[newElement]++; + deletePixel(checkPosX,checkPosY); + }; + }; + }; + }; + }, +};