Merge pull request #908 from Xyno-dev/main

fix: enabled liquid_sodium to solidify
This commit is contained in:
slweeb 2024-12-26 22:57:44 -05:00 committed by GitHub
commit f0cb5794c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 3 deletions

View File

@ -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")
}
@ -448,10 +448,12 @@ elements.liquid_sodium = {
behavior: behaviors.LIQUID,
hidden: true,
state: "liquid",
tempLow: 97,
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},
}
};
@ -461,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},