Update solubility.js

Changed the tempHigh of water and tempLow of steam, and changed the chances for dissolved salts to be placed when water evaporates
This commit is contained in:
Alexthetransfem 2025-10-26 18:13:38 -05:00 committed by GitHub
parent 7984b01c3f
commit 17a0a62ed2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Version 1.0.0 * Version 1.1.0
*/ */
dependOn("orchidslibrary.js", ()=>{ dependOn("orchidslibrary.js", ()=>{
@ -46,15 +46,15 @@ dependOn("orchidslibrary.js", ()=>{
} }
function aqueousReaction(p1, p2){ function aqueousReaction(p1, p2){
for(let elem in p1.elemsDissolved){ for(let elem in p1.elemsDissolved){
if(elements[elem].reactions != null && p2.element != "water" && elements[elem].reactions[p2.element] != undefined){ if(elements[elem].reactions != null && p2.element != "water" && (elements[elem].reactions[p2.element] != undefined || (elements[p2.element].reactions != null && elements[p2.element].reactions[elem] != undefined))){
let r = elements[elem].reactions[p2.element]; let r = elements[elem].reactions[p2.element] || elements[p2.element].reactions[elem];
if(r.tempMin && !((p1.temp >= r.tempMin) && (p2.temp >= r.tempMin))){ if(r.tempMin && !((p1.temp >= r.tempMin) && (p2.temp >= r.tempMin))){
return false; return false;
} }
if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){ if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){
return false; return false;
} <<<<<<<<< }
if(r.charged && !(p1.charge || p2.charge)){ if(r.charged && !(p1.charge || p2.charge)){
return false; return false;
} }
@ -253,13 +253,13 @@ dependOn("orchidslibrary.js", ()=>{
let num = Math.random(); let num = Math.random();
if(elem === null){ if(elem === null){
for(let e in pixel.elemsDissolved){ for(let e in pixel.elemsDissolved){
if(num <= ((pixel.elemsDissolved[e]/100)/elements[e].solubility.water)){ if(num <= ((pixel.elemsDissolved[e]/100)/elements[e].solubility.water)/4){
elem = e; elem = e;
} }
} }
} }
elem = (elem == null) ? "steam" : elem; elem = (elem == null) ? "steam" : elem;
changePixel(pixel, elem); changePixel(pixel, elem, 110);
pixel.dissolvedElems = {}; pixel.dissolvedElems = {};
} }
} }
@ -282,5 +282,6 @@ dependOn("orchidslibrary.js", ()=>{
elements.water.tick = solventTick; elements.water.tick = solventTick;
elements.water.behavior = behaviors.SOLVENT; elements.water.behavior = behaviors.SOLVENT;
elements.water.tempHigh = undefined; elements.water.tempHigh = undefined;
elements.water.solventTempHigh = 100; elements.water.solventTempHigh = 101;
elements.steam.tempLow = 99
}, true); }, true);