From 7984b01c3f9f6365546f193c8abef6bb65302f5e Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Sun, 26 Oct 2025 18:10:52 -0500 Subject: [PATCH 1/3] New salts and updated acidTick Added nitrates and made acidTick function as it should --- mods/morechemistry.js | 231 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 219 insertions(+), 12 deletions(-) diff --git a/mods/morechemistry.js b/mods/morechemistry.js index 5008b2e5..bedb5260 100644 --- a/mods/morechemistry.js +++ b/mods/morechemistry.js @@ -1,5 +1,5 @@ /* -*Version 2.2.1 +*Version 2.2.2 */ dependOn("orchidslibrary.js", ()=>{ @@ -683,23 +683,38 @@ dependOn("orchidslibrary.js", ()=>{ for(let coords of adjacentCoords){ let x = pixel.x+coords[0], y = pixel.y+coords[1]; let p2 = getPixel(x,y); - let ignore = false; - for(let item of elements[pixel.element].ignore){ + //let ignore = false; + /*for(let item of elements[pixel.element].ignore){ if(p2 != null && item.startsWith("*")&&p2.element.endsWith(item.split("*")[1])){ ignore = true; } else if (p2 != null && item.endsWith("*")&&p2.element.startsWith(item.split("*")[0])){ ignore = true; + } else if(p2 != null){ + ignore = (elements[pixel.element].ignore.includes(p2.element)) ? true : ignore; + } + }*/ + if(p2 != null){ + let ignore = elements[pixel.element].ignore.some(item=>{ + let res = false; + if(p2.element === item){ + res = true; + } else if(item.startsWith("*") && p2.element.endsWith(item.slice(1))) { + res = true; + } else if(item.endsWith("*") && p2.element.startsWith(item.slice(0,-1))){ + res = true; } + return res; + }); + if(!ignore){ + deletePixel(x,y); + deletePixel(pixel.x, pixel.y); } - if(p2 != null && !(elements[pixel.element].ignore.includes(p2.element) || ignore || p2.element == pixel.element)){ - deletePixel(x,y); - deletePixel(pixel.x, pixel.y); } } } elements.acid.behavior = behaviors.LIQUID; elements.acid.tick = acidTick; - elements.acid.ignore = elements.acid.ignore.concat(["nitric_acid", "aqua_regia", "nitrogen_dioxide", "nitric_acid_ice", "nitrogen_dioxide_ice", "acid", "chloroauric_acid", "*chloride", "*carbonate", "*acetate", "*sulfate", "*gallium", "*hydroxide", "salt", "*aluminum", "target_portal_in", "*magnesium", "*copper", "*iron", "*calcium", "sulfuric_acid", "*vinegar", "*gypsum", "*wall", "epsom_salt", "*platinum", "chloroplatinic_acid", "*sulfur*"]); + elements.acid.ignore = elements.acid.ignore.concat(["nitric_acid", "aqua_regia", "nitrogen_dioxide", "nitric_acid_ice", "nitrogen_dioxide_ice", "acid", "chloroauric_acid", "*chloride", "*carbonate", "*acetate", "*sulfate", "*gallium", "*hydroxide", "salt", "*aluminum", "target_portal_in", "*magnesium", "*copper*", "*iron", "*calcium", "sulfuric_acid", "*vinegar", "*gypsum", "*wall", "epsom_salt", "platinum", "chloroplatinic_acid", "*sulfur*", "wall", "porcelain", "plastic", "glass", "*sulfate", "*nitrate"]); elements.nitric_acid = { alias: "HNO₃", behavior: behaviors.LIQUID, @@ -710,6 +725,12 @@ dependOn("orchidslibrary.js", ()=>{ stateLow: "nitric_acid_ice", reactions: { acid: {elem1: null, elem2: "aqua_regia"}, + copper: {elem1: "hydrogen", elem2: "copper_nitrate"}, + sodium: {elem1: "hydrogen", elem2: "sodium_nitrate"}, + aluminum: {elem1: "hydrogen", elem2: "aluminum_nitrate"}, + potassium: {elem1: "hydrogen", elem2: "potassium_nitrate"}, + calcium: {elem1: "hydrogen", elem2: "calcium_nitrate"}, + magnesium: {elem1: "hydrogen", elem2: "magnesium_nitrate"}, }, density: 1510, category: "liquids", @@ -873,6 +894,8 @@ dependOn("orchidslibrary.js", ()=>{ density: 2960, reactions: { acid: {elem1: "magnesium_chloride", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + sulfuric_acid: {elem1: "epsom_salt", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + nitric_acid: {elem1: "magnesium_nitrate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, vinegar: {elem1: "magnesium_acetate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]} } } @@ -1140,11 +1163,11 @@ dependOn("orchidslibrary.js", ()=>{ alias: "CuCl₂", solubility: {water: 0.743}, reactions: { - sodium: {elem1: "copper", elem2: "sodium_acetate"}, - potassium: {elem1: "copper", elem2: "potassium_acetate"}, - magnesium: {elem1: "copper", elem2: "magnesium_acetate"}, - calcium: {elem1: "copper", elem2: "calcium_acetate"}, - aluminum: {elem1: "copper", elem2: "aluminum_acetate"}, + sodium: {elem1: "copper", elem2: "salt"}, + potassium: {elem1: "copper", elem2: "potassium_salt"}, + magnesium: {elem1: "copper", elem2: "magnesium_chloride"}, + calcium: {elem1: "copper", elem2: "calcium_chloride"}, + aluminum: {elem1: "copper", elem2: "aluminum_chloride"}, wood: {stain2: "#043023"}, }, properties: { @@ -1554,4 +1577,188 @@ dependOn("orchidslibrary.js", ()=>{ stateLow: "bismuth", temp: 270, }; + + elements.copper_nitrate = { + density: 3050, + tempHigh: 145, + stateHigh: ["oxidized_copper", "nitrogen_dioxide", "nitrogen_dioxide"], + color: ["#1717ff", "#2121ff", "#1b1bf5", "#0f0ff2", "#0707f7"], + behavior: behaviors.POWDER, + state: "solid", + category: "salts", + alias: "Cu(NO₃)₂", + solubility: {water: 1.25}, + reactions: { + sodium: {elem1: "copper", elem2: "sodium_nitrate"}, + potassium: {elem1: "copper", elem2: "potassium_nitrate"}, + calcium: {elem1: "copper", elem2: "calcium_nitrate"}, + aluminum: {elem1: "copper", elem2: "aluminum_nitrate"}, + wood: {stain2: "#043023"}, + ash: {elem1: "copper_carbonate", elem2: "potassium_nitrate"}, + baking_soda: {elem1: "copper_carbonate", elem2: "sodium_nitrate"}, + acid: {elem1: "copper_chloride", elem2: "nitric_acid"}, + sulfuric_acid: {elem1: "copper_sulfate", elem2: "nitric_acid"}, + }, + properties: { + anhydrous: false + }, + fireColor: "#19abff", + tick: function(pixel){ + if(pixelTicks-pixel.start == 2 && xDown){ + pixel.anhydrous = true; + let rgb = {r: 51, g: 158, b: 61}; + let num = 6 - (Math.round(Math.random()*12)); + for(let key in rgb){ + rgb[key] += num; + } + pixel.color = `rgb(${rgb.r},${rgb.g},${rgb.b})`; + } + let multi = (pixel.temp-70)/100; + multi = (multi < 0) ? 0 : ((multi > 1) ? 1 : multi); + if(Math.random() < 0.05*multi){ + pixel.anhydrous = true; + let rgb = {r: 51, g: 158, b: 61}; + let num = 6 - (Math.round(Math.random()*12)); + for(let key in rgb){ + rgb[key] += num; + } + pixel.color = `rgb(${rgb.r},${rgb.g},${rgb.b})`; + } + if(pixel.anhydrous){ + let neighbors = []; + for(let coords of squareCoords){ + let x = pixel.x+coords[0], y = pixel.y+coords[1]; + neighbors[neighbors.length] = (isEmpty(x,y) && !outOfBounds(x,y)) ? "air" : (!outOfBounds(x,y)) ? pixelMap[x][y].element : undefined; + } + if(neighbors.includes("air") && pixel.temp < 50 && Math.random() < 0.00035){ + pixel.anhydrous = false; + let rgb = (Math.random() > 0.5) ? {r: 7, g: 7, b: 247} : {r: 26, g: 26, b: 240}; + let num = 6 - (Math.round(Math.random()*12)); + for(let key in rgb){ + rgb[key] += num; + } + pixel.color = `rgb(${rgb.r},${rgb.g},${rgb.b})`; + + } else if (neighbors.includes("steam") || neighbors.includes("water") || neighbors.includes("salt_water") || neighbors.includes("sugar_water") || neighbors.includes("dirty_water") || neighbors.includes("seltzer") || neighbors.includes("pool_water") || neighbors.includes("slush")){ + pixel.anhydrous = false; + let rgb = (Math.random() > 0.5) ? {r: 7, g: 7, b: 247} : {r: 26, g: 26, b: 240}; + let num = 6 - (Math.round(Math.random()*12)); + for(let key in rgb){ + rgb[key] += num; + } + pixel.color = `rgb(${rgb.r},${rgb.g},${rgb.b})`; + } + } + } + }; + + elements.sodium_nitrate = { + color: ["#f5f5f5", "#e8e8e8", "#ededed", "#e3e3e3"], + density: 2260, + category: "salts", + tempHigh: 650, + stateHigh: ["sodium", "nitrogen_dioxide"], + reactions: { + ash: {elem1: "baking_soda", elem2: "potassium_nitrate"}, + potassium: {elem1: "sodium", elem2: "potassium_nitrate"}, + //sulfuric_acid: {elem1: "sodium_sulfate", elem2: "nitric_acid"}, + acid: {elem1: "salt", elem2: "nitric_acid"}, + }, + solubility: {water: 0.86}, + alias: "NaNO₃", + behavior: behaviors.POWDER + }; + + elements.potassium_nitrate = { + color: ["#f5f5f5", "#e8e8e8", "#ededed", "#e3e3e3"], + density: 2106, + category: "salts", + tempHigh: 800, + stateHigh: ["potassium", "nitrogen_dioxide"], + reactions: { + //sulfuric_acid: {elem1: "potassium_sulfate", elem2: "nitric_acid"}, + acid: {elem1: "potassium_salt", elem2: "nitric_acid"}, + }, + solubility: {water: 0.316}, + alias: "KNO₃", + behavior: behaviors.POWDER + }; + elements.magnesium_nitrate = { + color: ["#f5f5f5", "#e8e8e8", "#ededed", "#e3e3e3"], + density: 2300, + category: "salts", + tempHigh: 290, + stateHigh: ["magnesium", "nitrogen_dioxide"], + reactions: { + potassium: {elem1: "magnesium", elem2: "potassium_nitrate"}, + sodium: {elem1: "magnesium", elem2: "sodium_nitrate"}, + sulfuric_acid: {elem1: "epsom_salt", elem2: "nitric_acid"}, + acid: {elem1: "magnesium_chloride", elem2: "nitric_acid"}, + }, + solubility: {water: 0.42}, + alias: "Mg(NO₃)₂", + behavior: behaviors.POWDER + }; + elements.calcium_nitrate = { + color: ["#f5f5f5", "#e8e8e8", "#ededed", "#e3e3e3"], + density: 2504, + category: "salts", + tempHigh: 650, + stateHigh: ["calcium", "nitrogen_dioxide"], + reactions: { + potassium: {elem1: "calcium", elem2: "potassium_nitrate"}, + sodium: {elem1: "calcium", elem2: "sodium_nitrate"}, + magnesium: {elem1: "calcium", elem2: "magnesium_nitrate"}, + sulfuric_acid: {elem1: "gypsum", elem2: "nitric_acid"}, + acid: {elem1: "calcium_chloride", elem2: "nitric_acid"}, + }, + solubility: {water: 1.21}, + alias: "Ca(NO₃)₂", + behavior: behaviors.POWDER + }; + elements.aluminum_nitrate = { + color: ["#f5f5f5", "#e8e8e8", "#ededed", "#e3e3e3"], + density: 1720, + category: "salts", + tempHigh: 150, + stateHigh: ["aluminum", "nitrogen_dioxide"], + reactions: { + sodium: {elem1: "aluminum", elem2: "sodium_nitrate"}, + potassium: {elem1: "aluminum", elem2: "potassium_nitrate"}, + calcium: {elem1: "aluminum", elem2: "calcium_nitrate"}, + magnesium: {elem1: "aluminum", elem2: "magnesium_nitrate"}, + //sulfuric_acid: {elem1: "aluminum_sulfate", elem2: "nitric_acid"}, + acid: {elem1: "aluminum_chloride", elem2: "nitric_acid"}, + }, + solubility: {water: 0.739}, + alias: "Al(NO₃)₃", + behavior: behaviors.POWDER + }; + elements.limestone.reactions.sulfuric_acid = {elem1: "gypsum", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}; + elements.slaked_lime.reactions.sulfuric_acid = {elem1: "gypsum", elem2: "water"}; + elements.quicklime.reactions.sulfuric_acid = {elem1: "gypsum", elem2: "oxygen"}; + elements.limestone.reactions.nitric_acid = {elem1: "calcium_nitrate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}; + elements.slaked_lime.reactions.nitric_acid = {elem1: "calcium_nitrate", elem2: "water"}; + elements.quicklime.reactions.nitric_acid = {elem1: "calcium_nitrate", elem2: "oxygen"}; + elements.copper_carbonate = { + color: ["#5ee092", "#54d186", "#52de8a", "#44c97a"], + category: "salts", + alias: "CuCO₃", + behavior: behaviors.POWDER, + reactions: { + vinegar: {elem1: "copper_acetate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + acid: {elem1: "copper_chloride", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + sulfuric_acid: {elem1: "copper_sulfate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + nitric_acid: {elem1: "copper_nitrate", elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + aqua_regia: {elem1: ["copper_nitrate", "copper_chloride"], elem2: ["carbon_dioxide", "foam", "seltzer", "seltzer"]}, + }, + density: 4000, + tempHigh: 290, + stateHigh: ["oxidized_copper", "carbon_dioxide"], + }; + elements.aqua_regia.solubility = {water: 1}; + elements.acid.solubility = {water: 1}; + elements.vinegar.solubility = {water: 1}; + elements.nitric_acid.solubility = {water: 1}; + elements.sulfuric_acid.solubility = {water: 1}; }, true); From 17a0a62ed218b77f834ba98a8f16967f571afd8f Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Sun, 26 Oct 2025 18:13:38 -0500 Subject: [PATCH 2/3] 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 --- mods/solubility.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/solubility.js b/mods/solubility.js index 28e8fc0e..95aefb36 100644 --- a/mods/solubility.js +++ b/mods/solubility.js @@ -1,5 +1,5 @@ /* -* Version 1.0.0 +* Version 1.1.0 */ dependOn("orchidslibrary.js", ()=>{ @@ -46,15 +46,15 @@ dependOn("orchidslibrary.js", ()=>{ } function aqueousReaction(p1, p2){ 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))){ return false; } if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){ return false; - } + <<<<<<<<< } if(r.charged && !(p1.charge || p2.charge)){ return false; } @@ -253,13 +253,13 @@ dependOn("orchidslibrary.js", ()=>{ let num = Math.random(); if(elem === null){ 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 = (elem == null) ? "steam" : elem; - changePixel(pixel, elem); + changePixel(pixel, elem, 110); pixel.dissolvedElems = {}; } } @@ -282,5 +282,6 @@ dependOn("orchidslibrary.js", ()=>{ elements.water.tick = solventTick; elements.water.behavior = behaviors.SOLVENT; elements.water.tempHigh = undefined; - elements.water.solventTempHigh = 100; + elements.water.solventTempHigh = 101; + elements.steam.tempLow = 99 }, true); From 4f9ce8173e53cbdce75356283b6e669af6fc9496 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Mon, 27 Oct 2025 08:01:24 -0500 Subject: [PATCH 3/3] Removed conflict header from git conflicts --- mods/solubility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/solubility.js b/mods/solubility.js index 95aefb36..64400bad 100644 --- a/mods/solubility.js +++ b/mods/solubility.js @@ -54,7 +54,7 @@ dependOn("orchidslibrary.js", ()=>{ } if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){ return false; - <<<<<<<<< } + } if(r.charged && !(p1.charge || p2.charge)){ return false; }