From fb757d715b91752e8c8aecf0cb8b069129d9ce4c Mon Sep 17 00:00:00 2001 From: Zayan Arshad Date: Tue, 24 Dec 2024 19:00:05 +0000 Subject: [PATCH] feat: made sodium_hydroxide turn into baking_soda MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sodium Hydroxide absorbs CO₂ in the air to form Sodium Bicarbonate. --- mods/UAMM.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/mods/UAMM.js b/mods/UAMM.js index 79016f2e..ebad185a 100644 --- a/mods/UAMM.js +++ b/mods/UAMM.js @@ -428,7 +428,7 @@ elements.sodium = { if (!isEmpty(x, y, true)) { otherPixel = pixelMap[x][y]; if (otherPixel.element != "mineral_oil") { - if (otherPixel.element != "sodium" && otherPixel.element != "sodium_hydroxide") { + if (otherPixel.element != "sodium" && otherPixel.element != "sodium_hydroxide" && otherPixel.elememnt != "baking_soda") { if(Math.random()<0.001) { changePixel(pixel, "sodium_hydroxide") } @@ -452,8 +452,8 @@ elements.liquid_sodium = { stateLow: "sodium", density: 951, reactions: { - "water": {elem1: "sodium_hydroxide", elem2: "hydrogen", temp1: 200, chance: 0.001}, - "salt_water": {elem1: "sodium_hydroxide", elem2: "hydrogen", temp1: 200, chance: 0.001}, + "water": {elem1: "sodium_hydroxide", elem2: "hydrogen", temp1: 200, chance: 0.0001}, + "salt_water": {elem1: "sodium_hydroxide", elem2: "hydrogen", temp1: 200, chance: 0.0001}, } }; @@ -463,6 +463,29 @@ elements.sodium_hydroxide = { hidden: true, state: "solid", density: 2100, + tick: function (pixel){ + var otherPixel; + 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)){ + if(Math.random()<0.0003) { + changePixel(pixel, "baking_soda") + } + } + if (!isEmpty(x, y, true)) { + otherPixel = pixelMap[x][y]; + if (otherPixel.element != "mineral_oil") { + if (otherPixel.element != "sodium" && otherPixel.element != "sodium_hydroxide") { + if(Math.random()<0.00001) { + changePixel(pixel, "baking_soda") + } + } + } + } + } + }, reactions: { "water": {elem1: "salt_water", elem2: null, chance: 0.1}, "salt_water": {elem1: "salt_water", elem2: null, chance: 0.1},