diff --git a/mod-list.html b/mod-list.html
index 54f54812..d9ed8b19 100644
--- a/mod-list.html
+++ b/mod-list.html
@@ -243,6 +243,7 @@
| radioactive.js | Radioactive elements on the periodic table [WIP] | kaeud |
| random_rocks.js | Randomly generates rocks on game load | Alice |
| roseyiede.js | Several variants of a substance called roseyiede | Alice |
+| solubility.js | Adds solubility and a simple-to-use format for other mods to use with it | Orchid |
| some_tf_liquids.js | Various liquids from the Thermal Foundation Minecraft mod | Alice |
| stickystuff.js | Slime, Honey, and others can stick to other elements | Suss |
| the_ground.js | Several rocks, worldgen types, and gemstones | Alice |
@@ -263,6 +264,7 @@
| gameOfLife.js | Conway's Game of Life on a screen | ggod |
| heatshield.js | Heatshields, makes Plasma cooler | Taterbob |
| human_friendly_design.js | Pipes, Portals, Drag, and Mix don't kill humans | Nekonico |
+| industry.js | Conveyors and emitters for most energy types | pogdog |
| logicgates.js | Predictable electricity and logic gates | nousernamefound |
| note_block_advanced.js | Edit of Alice's note_block.js, adds different blocks with different frequencies | CharsonBurensen |
| note_block.js | Musical Note Blocks | Alice |
@@ -363,6 +365,7 @@
| volcanic_expansion.js | Obsidian, Pumice, and Andesite rocks | Jayd |
| Fun & Games |
+| 3pms_mod.js | Adds random stuff and tools | 3pm |
| 10kelements.js | Customizable amount of randomly generated elements | nousernamefound |
| all_around_fillers.js | Directional Filler variants | idk73248 |
| allliquids.js | Made all elements liquids | Orchid |
@@ -396,6 +399,7 @@
| random_liquids.js | Randomly generates liquids on game load | Alice |
| sbmixup.js | Silly elements from a Mix-Up! game | stefanblox |
| scp.js | Creatures and items from the SCP Wiki | Nekonico |
+| sensitive.js | Makes all elements sensitive to air | pogdog |
| sports_beta.js | Several sports items | BluBun5193 |
| star_wars.js | Various items from Star Wars by Disney | SeaPickle754 |
| sus.js | Among Us crewmate | Nv7 |
@@ -404,6 +408,7 @@
| troll.js | Various dumb elements that iterate randomly on the entire screen | Alice |
| WhisperingTheory.js | Powder and gas variant of heater and cooler | kaeud |
+
| Visual Effects |
| acid_and_shapes.js | Weird visual effects enabled in settings | Alice |
| asciiboxels.js | Renders pixels as ASCII characters | Nekonico |
diff --git a/mods/3pms_mod.js b/mods/3pms_mod.js
index 4e39d814..622d42db 100644
--- a/mods/3pms_mod.js
+++ b/mods/3pms_mod.js
@@ -1,43 +1,37 @@
-// mod moment
-// also made by 3pm
+// made by 3pm
-// starting the initiation
-version = "0.0.1"
-subversion = "0.0.12"
-versionname = "Gullible On The Ceilling"
+version = "0.0.2"
+subversion = "0.0.21"
+versionname = "Let's take a look..."
console.log("3pms_mod.js " + version + " \"" + versionname + "\"")
console.log("3pms_mod.js | Initiating...")
// bypassing the tps limit
-// nvm this is useless
-// whatever im keeping it
-setTimeout(() => {
- const tpsbutton = document.getElementById("tpsButton");
- tpsbutton.onclick = () => {
- var tpsprompt = prompt(
- "Enter the new simulation Ticks Per Second (TPS). This is how many updates per second the simulation will run.\n\n" +
- "The default is 30.\n\nThe current TPS is " + tps + ".\n\nNOTE: 3pms_mod.js removes the TPS limit.\n" +
- "Any TPS higher than 1000 isn\'t recommended.\n\n"
- );
-
- var newtps = parseInt(tpsprompt);
- if (tpsprompt !== null) {
- if (isNaN(newtps) || newtps == "") {
- alert("You did not enter a valid TPS.");
- } else {
- tps = parseInt(newtps);
- if (isNaN(tps) || tps <= 0) {
- alert("You did not enter a valid TPS.");
- tps = 30;
+function tpsPrompt() {
+ promptInput("Enter the new simulation Ticks Per Second (TPS). This is how many updates per second the simulation will run.\n\nThe default is 30.\n\nThe current TPS is " + tps + ".\n\nNOTE: 3pms_mod.js removes the TPS limit.\nAny TPS higher than 1000 isn't recommended.\n\n",
+ (r) => {
+ var newtps = parseInt(r);
+ if (r !== null) {
+ if (isNaN(newtps) || newtps == "") logMessage("You did not enter a valid TPS.");
+ else {
+ newtps = parseInt(newtps);
+ if (isNaN(newtps) || newtps <= 0) {
+ logMessage("You did not enter a valid TPS.");
+ }
+ else {
+ tps = newtps;
+ delete currentSaveData.oldTps;
+ }
+ }
+ resetInterval(tps);
}
- }
- resetInterval(tps);
- }
- focusGame();
- };
-}, 1000);
+ focusGame();
+ },
+ "Change TPS"
+ )
+}
// more settings
@@ -60,7 +54,7 @@ setTimeout(() => {
`);
- const menuText = document.getElementsByClassName("menuText")[6]
+ const menuText = document.getElementsByClassName("menuText")[9]
const newButton = document.createElement("button")
newButton.innerText = "More Settings"
newButton.className = "settingsButton"
@@ -73,7 +67,7 @@ setTimeout(() => {
// elements
-elements.calcium_oxide = { // most of this is taken off calcium
+elements.calcium_oxide = {
color: ["#544E45","#6A635E","#6E6A61","#756F62","#918A7B"],
tick: function(pixel) {
behaviors.POWDER(pixel);
@@ -95,39 +89,56 @@ elements.calcium_oxide = { // most of this is taken off calcium
fireColor: "#ff6b21"
}
-elements.eeraser = { // finally integrating it after over a year
+elements.eeraser = {
color: "#FFFF00",
- behavior: behaviors.WALL,
- behaviorON: [
- "DL|DL|DL",
- "DL|DL|DL",
+ behaviorOn: [
+ "DL|XX|DL",
+ "DL|XX|DL",
"DL|DL|DL",
],
+ behavior: [
+ "XX|XX|XX",
+ "XX|XX|XX",
+ "XX|XX|XX"
+ ],
+ conduct: 0.5,
category: "machines",
- insulate: elements.wire.insulate,
- conduct: elements.wire.conduct,
- noMix: elements.wire.noMix
+ state: "solid",
};
-// stopping the initiation
+// tools
+elements.replace_all_of_element = {
+ color: ["#ff3030", "#800000"],
+ name: "replace all of element",
+ onSelect: async function() {
+ promptInput(
+ "Enter the element to be replaced.",
+ (r) => {
+ if (r in elements) {
+ elements.replace_all_of_element.tool = function(pixel) {
+ elementbefore = pixel.element
+ for (var i = 0; i <= width; i++) {
+ for (var j = 0; j <= height; j++) {
+ if (!isEmpty(i,j,true)) {
+ if(pixelMap[i][j].element == elementbefore) {
+ changePixel(pixelMap[i][j], r)
+ }
+ }
+ }
+ }
+ }
+ } else {
+ logMessage("You did not enter an existing element.");
+ }
+ },
+ "3pms_mod.js"
+ );
+ },
+ category: "tools",
+};
+
+
setTimeout(() => {
console.log("3pms_mod.js | Initiated. Thank you.")
-}, 1000);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const thing=document.createElement("p");thing.innerText="MY NAME π IS DAVID π¨βπ€ DAD π¨βπ©βπ§βπ¦π¨βπ©βπ§βπ§ I βΉοΈ WANT SOME ICE π§π¦πΆ CREAM π§΄π§΄ DAVID π¨βπ€ THAT IS MY NAME π DAVID π¨βπ€π¨βπ€ I βΉοΈ WANT ANOTHER WHERE ββ IS MY BALL ππ IβM RUNNING πββοΈπββοΈ OUT ON π THE ROAD π§ THERE IS A π
°οΈ CAR ππ AND IT IS GOING TO HIT π ME ππββοΈ HEEEEEEEEELP HELP π MEEEEEEE HEEEEEEEEEEEEEEEEELP\n\nthanks for using 3pms_mod.js :3";document.body.appendChild(thing)
\ No newline at end of file
+}, 1000);
\ No newline at end of file
diff --git a/mods/aChefsDream2.js b/mods/aChefsDream2.js
index 4a089e68..31fc4cfa 100644
--- a/mods/aChefsDream2.js
+++ b/mods/aChefsDream2.js
@@ -3,7 +3,7 @@
// https://github.com/SquareScreamYT/
// https://youtube.com/@sqec
-version = "v2.1.0"
+version = "v2.1.1"
runAfterLoad(function() {
console.log("Current aChefsDream version: "+version)
@@ -595,4 +595,147 @@ elements.pistachio_powder = {
hidden: true
}
+elements.pumpkin_mash = {
+ color: ["#f59c2f", "#efa810", "#e38f1a"],
+ behavior: behaviors.STURDYPOWDER,
+ tempHigh: 125,
+ stateHigh: ["pumpkin_spice","pumpkin_spice","smoke"],
+ category: "food",
+ state: "liquid",
+ density: 500,
+ isFood: true,
+ hidden: true,
+}
+
+elements.pumpkin.breakInto = ["pumpkin_seed", "pumpkin_mash", "pumpkin_mash", "pumpkin_mash", "pumpkin_mash", null];
+
+elements.pumpkin_spice = {
+ color: ["#95570b", "#ba7f36"],
+ behavior: behaviors.POWDER,
+ tempHigh: 400,
+ stateHigh: ["smoke","smoke","smoke","smoke","ash"],
+ category: "food",
+ state: "solid",
+ density: 500,
+ isFood: true,
+ hidden: true,
+}
+
+elements.cinnamon_powder.reactions.nutmeg_powder = { elem1: "pumpkin_spice", elem2: null, chance: 0.5 };
+
+elements.coffee.reactions.pumpkin_mash = { elem2: null, color1: "#7e3c09", chance: 0.005 };
+elements.coffee.reactions.pumpkin_spice = { elem2: null, color1: "#7e3c09", chance: 0.005 };
+
+elements.nutmeg_tree = {
+ color: "#6B4226",
+ behavior: behaviors.WALL,
+ tempHigh: 400,
+ stateHigh: ["ember", "charcoal", "fire"],
+ category: "solids",
+ burn: 5,
+ burnTime: 300,
+ burnInto: ["ember", "charcoal", "fire"],
+ state: "solid",
+ hardness: 0.2,
+ breakInto: "sawdust",
+ hidden: true
+};
+
+elements.nutmeg_branch = {
+ color: "#5c3b23",
+ behavior: [
+ "CR:nutmeg_leaves,nutmeg_branch%2|CR:nutmeg_leaves,nutmeg_branch%2|CR:nutmeg_leaves,nutmeg_branch%2",
+ "XX|XX|XX",
+ "XX|XX|XX",
+ ],
+ tempHigh: 100,
+ stateHigh: "nutmeg_tree",
+ tempLow: -30,
+ stateLow: "nutmeg_tree",
+ category: "life",
+ burn: 30,
+ burnTime: 60,
+ burnInto: ["sap", "ember"],
+ hidden: true,
+ state: "solid",
+ density: 1400,
+ breakInto: ["sap", "sawdust"]
+};
+
+elements.nutmeg_leaves = {
+ color: ["#4b7d3d", "#558c40"],
+ behavior: [
+ "XX|XX|XX",
+ "XX|XX|XX",
+ "XX|CR:nutmeg_fruit%0.1|XX",
+ ],
+ reactions: {
+ "vinegar": { elem1: "dead_plant", chance: 0.035 },
+ "baking_soda": { elem1: "dead_plant", chance: 0.01 },
+ "bleach": { elem1: "dead_plant", chance: 0.05 },
+ "alcohol": { elem1: "dead_plant", chance: 0.035 },
+ },
+ category: "life",
+ tempHigh: 90,
+ stateHigh: "dead_plant",
+ tempLow: -1.5,
+ stateLow: "frozen_plant",
+ burn: 60,
+ burnTime: 60,
+ burnInto: "dead_plant",
+ state: "solid",
+ density: 1050,
+ hidden: true
+};
+
+elements.nutmeg_fruit = {
+ color: ["#c0a25d", "#ddb86c"],
+ behavior: behaviors.POWDER,
+ category: "food",
+ tempHigh: 100,
+ stateHigh: "dead_plant",
+ burn: 60,
+ burnTime: 60,
+ cutInto: ["mace", "nutmeg", "nutmeg"],
+ breakInto: ["mace", "nutmeg", "nutmeg"],
+ state: "solid",
+ density: 1050
+};
+
+elements.mace = {
+ color: ["#e04e1b", "#cc3614"],
+ behavior: behaviors.POWDER,
+ category: "food",
+ tempHigh: 250,
+ stateHigh: ["ash", "smoke"],
+ isFood: true,
+ state: "solid",
+ density: 900,
+ hidden: false
+};
+
+elements.nutmeg = {
+ color: ["#8b5a2b", "#A0522D"],
+ behavior: behaviors.POWDER,
+ category: "food",
+ tempHigh: 250,
+ stateHigh: ["ash", "smoke"],
+ isFood: true,
+ state: "solid",
+ density: 1000,
+ breakInto: "nutmeg_powder",
+};
+
+elements.nutmeg_powder = {
+ color: "#C58940",
+ behavior: behaviors.POWDER,
+ category: "food",
+ tempHigh: 250,
+ stateHigh: ["ash", "smoke"],
+ isFood: true,
+ state: "solid",
+ density: 950,
+ hidden: false
+};
+
},true)
\ No newline at end of file
diff --git a/mods/devsnacks.js b/mods/devsnacks.js
index f1cde22f..20734dc8 100644
--- a/mods/devsnacks.js
+++ b/mods/devsnacks.js
@@ -73,4 +73,88 @@ elements.tea_powder = {
isFood: true,
hidden: true
}
-elements.water.reactions.tea_powder = { elem1:"tea", chance:0.0002 }
\ No newline at end of file
+elements.water.reactions.tea_powder = { elem1:"tea", chance:0.0002 }
+
+elements.pumpkin.breakInto = ["pumpkin_seed","pumpkin_mash","pumpkin_mash","pumpkin_mash",null];
+
+elements.pumpkin_mash = {
+ color: ["#DF7E06","#eba100"],
+ behavior: behaviors.STURDYPOWDER,
+ tempHigh: 125,
+ stateHigh: ["pumpkin_spice","pumpkin_spice",null],
+ category: "food",
+ state: "liquid",
+ density: 490.3,
+ isFood: true,
+ hidden: true,
+}
+
+elements.pumpkin_seed.tempHigh = 125;
+elements.pumpkin_seed.stateHigh = ["pumpkin_spice","pumpkin_spice",null];
+
+elements.pumpkin_spice = {
+ color: "#8d4f03",
+ grain: 1.5,
+ behavior: behaviors.POWDER,
+ tempHigh: 400,
+ stateHigh: ["smoke","smoke","smoke","smoke","ash"],
+ category: "food",
+ state: "solid",
+ density: 490.3,
+ isFood: true,
+ hidden: true,
+}
+
+elements.coffee.reactions.pumpkin_spice = { elem2:null, color1:"#6A2F03", chance:0.005 };
+elements.coffee.reactions.pumpkin_mash = { elem2:null, color1:"#6A2F03", chance:0.005 };
+
+elements.apple = {
+ color: ["#b22424","#f5c517","#66b447"],
+ grain: 2,
+ behavior: behaviors.POWDER,
+ // singleColor: true,
+ category: "food",
+ state: "solid",
+ density: 750,
+ isFood: true,
+ breakInto: "juice",
+ tempHigh: 175,
+ stateHigh: ["applesauce",null]
+}
+
+elements.applesauce = {
+ color: "#E7C45A",
+ behavior: behaviors.LIQUID,
+ viscosity: 50000,
+ tempHigh: 400,
+ stateHigh: "smoke",
+ category: "food",
+ state: "liquid",
+ density: 750,
+ isFood: true,
+ hidden: true,
+}
+
+if (!elements.mayo.reactions) elements.mayo.reactions = {};
+elements.mayo.reactions.ketchup = { elem1:"mayochup", elem2:"mayochup" }
+
+elements.mayochup = {
+ color: "#FDCC94",
+ behavior: behaviors.LIQUID,
+ reactions: {
+ "rust": { elem2:"iron", chance:0.005 },
+ "oxidized_copper": { elem2:"copper", chance:0.005 },
+ "baking_soda": { "elem1":"carbon_dioxide", elem2:"foam", chance:0.005, attr2:{"foam":3} },
+ "glue": { elem2:null, chance:0.005 },
+ "oil": { elem2:null, chance:0.005 },
+ "sap": { elem2:null, chance:0.005 }
+ },
+ viscosity: 26745.5,
+ tempHigh: 180.3,
+ stateHigh: ["carbon_dioxide","methane","steam","salt","sugar","steam","carbon_dioxide","methane"],
+ category:"liquids",
+ state: "liquid",
+ density: 1072.5,
+ isFood: true,
+ hidden: true
+};
\ No newline at end of file
diff --git a/mods/morechemistry.js b/mods/morechemistry.js
index eb628940..5008b2e5 100644
--- a/mods/morechemistry.js
+++ b/mods/morechemistry.js
@@ -1,97 +1,78 @@
/*
-*Version 2.2.0
+*Version 2.2.1
*/
dependOn("orchidslibrary.js", ()=>{
elements.cloner.keyInput = "str:clone", elements.ecloner.keyInput = "str:clone", elements.slow_cloner.keyInput = "str:clone", elements.floating_cloner.keyInput = "str:clone";
let xDown = false;
- elements.copper_sulfate = {
- behavior: behaviors.POWDER,
- color: ["#4391fd","#004cfe"],
- reactions: {
- ant: {"elem2": "dead_bug"},
- fly: {"elem2": "dead_bug"},
- firefly: {"elem2": "dead_bug"},
- stink_bug: {"elem2": "dead_bug"},
- bee: {"elem2": "dead_bug"},
- termite: {"elem2": "dead_bug"},
- spider: {"elem2": "dead_bug"},
- plant: {"elem2": "dead_plant"},
- grass: {"elem2": "dead_plant"},
- algae: {"elem2": null},
- kelp: {"elem2": "water"},
- coral: {"elem2": "water"},
- mushroom_cap: {"elem2": null},
- mushroom_stalk: {"elem2": null},
- mushroom_gill: {"elem2": null},
- mushroom_spore: {"elem2": null},
- zinc: {"stain2": "#2A1210"},
- fire: {"elem1": null,"elem2": "poison_gas","chance": 0.1},
- sugar: {"elem1": "oxidized_copper","elem2": null,"color1": ["#CB3D3D","#A6292B","#6E1B1B"]},
- magnesium: {elem1: "copper", elem2: "epsom_salt"},
- wood: {stain2: "#043023"},
- },
- tempHigh: 110,
- fireColor: [
- "#91d106",
- "#feff97",
- "#248e01"
- ],
- state: "solid",
- density: 3600,
- hidden: true,
- category: "powders",
- id: 509,
- movable: true,
- properties: {
- anhydrous: false
- },
- tick: function(pixel){
- if(pixelTicks-pixel.start == 2 && xDown){
- pixel.anhydrous = true;
- let rgb = {r: 235, g: 247, b: 250};
+ elements.copper_sulfate.reactions = {
+ ant: {"elem2": "dead_bug"},
+ fly: {"elem2": "dead_bug"},
+ firefly: {"elem2": "dead_bug"},
+ stink_bug: {"elem2": "dead_bug"},
+ bee: {"elem2": "dead_bug"},
+ termite: {"elem2": "dead_bug"},
+ spider: {"elem2": "dead_bug"},
+ plant: {"elem2": "dead_plant"},
+ grass: {"elem2": "dead_plant"},
+ algae: {"elem2": null},
+ kelp: {"elem2": "water"},
+ coral: {"elem2": "water"},
+ mushroom_cap: {"elem2": null},
+ mushroom_stalk: {"elem2": null},
+ mushroom_gill: {"elem2": null},
+ mushroom_spore: {"elem2": null},
+ zinc: {"stain2": "#2A1210"},
+ fire: {"elem1": null,"elem2": "poison_gas","chance": 0.1},
+ sugar: {"elem1": "oxidized_copper","elem2": null,"color1": ["#CB3D3D","#A6292B","#6E1B1B"]},
+ magnesium: {elem1: "copper", elem2: "epsom_salt"},
+ wood: {stain2: "#043023"},
+ }
+ elements.copper_sulfate.tick = function(pixel){
+ if(pixelTicks-pixel.start == 2 && xDown){
+ pixel.anhydrous = true;
+ let rgb = {r: 235, g: 247, b: 250};
+ 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: 235, g: 247, b: 250};
+ 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: 67, g: 145, b: 253} : {r: 0, g: 76, b: 254};
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: 235, g: 247, b: 250};
+
+ } 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: 67, g: 145, b: 253} : {r: 0, g: 76, b: 254};
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: 67, g: 145, b: 253} : {r: 0, g: 76, b: 254};
- 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: 67, g: 145, b: 253} : {r: 0, g: 76, b: 254};
- 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.water.ignore = ["copper_sulphate"], elements.steam.ignore = ["copper_sulphate"], elements.pool_water.ignore = ["copper_sulphate", 'pool_ice'], elements.salt_water.ignore = ["copper_sulphate", 'salt_ice'], elements.sugar_water.ignore = ["copper_sulphate", 'sugar_ice'], elements.seltzer.ignore = ["copper_sulphate", 'seltzer_ice'],
@@ -806,6 +787,7 @@ dependOn("orchidslibrary.js", ()=>{
category: "salts",
state: "solid",
density: 3900,
+ solubility: {water: 3.5},
reactions: {
potassium: {elem1: "gold_coin", elem2: "potassium_salt", func: function(pixel){for(let coords of squareCoords){let x=pixel.x+coords[0],y=pixel.y+coords[1]; if(isEmpty(x,y) && !outOfBounds(x,y) && Math.random()<0.25){createPixel("hydrogen", x, y);}}}, color1: ["#574000", "#705200", "#634900", "#755600"]},
sodium: {elem1: "gold_coin", elem2: "salt", func: function(pixel){for(let coords of squareCoords){let x=pixel.x+coords[0],y=pixel.y+coords[1]; if(isEmpty(x,y) && !outOfBounds(x,y) && Math.random()<0.25){createPixel("hydrogen", x, y);}}}, color1: ["#574000", "#705200", "#634900", "#755600"]},
@@ -823,6 +805,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
color: ["#f2f2f2", "#f5f5f5", "#ebebeb", "#e6e6e6"],
density: 2320,
+ solubility: {water: 0.543, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
baking_soda: {elem1: "magnesium_carbonate", elem2: "salt"},
lye: {elem1: "magnesium_hydroxide", elem2: "salt"},
@@ -852,6 +835,7 @@ dependOn("orchidslibrary.js", ()=>{
behavior: behaviors.POWDER,
state: "solid",
color: ["#f2f2f2", "#f5f5f5", "#ebebeb", "#e6e6e6"],
+ solubility: {water: 0.745, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
baking_soda: {elem1: "limestone", elem2: "salt"},
lye: {elem1: "slaked_lime", elem2: "salt"},
@@ -941,6 +925,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
color: ["#ffffff", "#fcfcfc", "#ffffff", "#ededed"],
density: 2470,
+ solubility: {water: 0.8, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
water: {elem1: "gallium", elem2: "acid"},
steam: {elem1: "gallium", elem2: "acid_gas"},
@@ -972,6 +957,7 @@ dependOn("orchidslibrary.js", ()=>{
density: 2480,
tempHigh: 630,
stateHigh: ["chlorine", "aluminum"],
+ solubility: {water: 0.458, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
}
elements.acid.reactions.aluminum = {elem1: "hydrogen", elem2: "aluminum_chloride"};
elements.acid.reactions.purple_gold = {elem1: ["aluminum_chloride", "aluminum_chloride", "hydrogen"], elem2: "gold"};
@@ -1079,6 +1065,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
category: "salts",
alias: "Mg(CHβCOO)β",
+ solubility: {water: 0.53, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
acid: {elem1: "magnesium_chloride", elem2: "vinegar"},
baking_soda: {elem1: "magnesium_carbonate", elem2: "sodium_acetate"},
@@ -1095,6 +1082,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
category: "salts",
alias: "Ca(CHβCOO)β",
+ solubility: {water: 0.347, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
acid: {elem1: "calcium_chloride", elem2: "vinegar"},
baking_soda: {elem1: "limestone", elem2: "sodium_acetate"},
@@ -1113,6 +1101,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
category: "salts",
alias: "CHβCOOK",
+ solubility: {water: 2.55, color: ["#7a9ff0", "#7aa4ff", "#729bf2", "#6f9cfc"]},
reactions: {
acid: {elem1: "potassium_salt", elem2: "vinegar"},
baking_soda: {elem1: "caustic_potash", elem2: "sodium_acetate"},
@@ -1128,6 +1117,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
category: "salts",
alias: "Cu(CHβCOO)β",
+ solubility: {water: 0.072},
reactions: {
sodium: {elem1: "copper", elem2: "sodium_acetate"},
potassium: {elem1: "copper", elem2: "potassium_acetate"},
@@ -1148,6 +1138,7 @@ dependOn("orchidslibrary.js", ()=>{
state: "solid",
category: "salts",
alias: "CuClβ",
+ solubility: {water: 0.743},
reactions: {
sodium: {elem1: "copper", elem2: "sodium_acetate"},
potassium: {elem1: "copper", elem2: "potassium_acetate"},
@@ -1265,6 +1256,7 @@ dependOn("orchidslibrary.js", ()=>{
alias: "HβPtClβ",
tempHigh: 500,
stateHigh: ["acid_gas", "chlorine", "platinum", "platinum"],
+ solubility: {water: 1, },
reactions: {
sodium: {elem1: "salt", elem2: "platinum", color2: ["#404040", "#525252", "#454545", "#2e2e2e", "#262626"]},
potassium: {elem1: "potassium_salt", elem2: "platinum", color2: ["#404040", "#525252", "#454545", "#2e2e2e", "#262626"]},
diff --git a/mods/solubility.js b/mods/solubility.js
new file mode 100644
index 00000000..28e8fc0e
--- /dev/null
+++ b/mods/solubility.js
@@ -0,0 +1,286 @@
+/*
+* Version 1.0.0
+*/
+
+dependOn("orchidslibrary.js", ()=>{
+ elements.water.reactions.salt = undefined;
+ elements.water.reactions.sugar = undefined;
+ elements.water.properties = {capacity: 100, elemsDissolved: {}};
+ elements.salt.solubility = {water: 0.36, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.sugar.solubility = {water: 2, visc: 850, color: ["#9bb0de", "#a8bbe3", "#a2b8e8", "#a7b7d9"]};
+ elements.lye.solubility = {water: 1.09, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.caustic_potash.solubility = {water: 1.1, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.potassium_salt.solubility = {water: 0.3397, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.borax.solubility = {water: 0.041, color: ["#658ce0", "#7299ed", "#7597e0", "#78a1fa"]};
+ elements.epsom_salt.solubility = {water: 0.351, color: ["#658ce0", "#7299ed", "#7597e0", "#78a1fa"]};
+ elements.sodium_acetate.solubility = {water: 1.233, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.baking_soda.solubility = {water: 0.097, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
+ elements.copper_sulfate.solubility = {water: 0.32, color: ["#4a68f0", "#3358ff", "#2948d6", "#2146ed"]};
+ elements.lye.reactions.water = undefined;
+ elements.soap.reactions.water = undefined;
+ elements.ash.solubility = {water: 1.1, func: function(p1, p2){
+ if(p1.elemsDissolved.caustic_potash != undefined){
+ p1.elemsDissolved.caustic_potash += p1.elemsDissolved.ash;
+ p1.elemsDissolved.ash = 0;
+ } else {
+ p1.elemsDissolved.caustic_potash = p1.elemsDissolved.ash;
+ p1.elemsDissolved.ash = 0;
+ }
+ if(p2.dissolved >= 100){
+ changePixel(p2, getItem(["limestone", "quicklime", "charcoal", "dust", "dust"]));
+ p2.dissolved = undefined;
+ }
+ }};
+ elements.water.reactions.ash = undefined;
+ function getItem(obj){
+ let res;
+ if(Array.isArray(obj)){
+ res = obj[Math.round(Math.random()*obj.length)];
+ while(res == null){
+ res = obj[Math.round(Math.random()*obj.length)];
+ }
+ } else {
+ res = obj;
+ }
+ return res;
+ }
+ function aqueousReaction(p1, p2){
+ for(let elem in p1.elemsDissolved){
+ if(elements[elem].reactions != null && p2.element != "water" && elements[elem].reactions[p2.element] != undefined){
+
+ let r = elements[elem].reactions[p2.element];
+ 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;
+ }
+ let c = (r.chance != undefined) ? r.chance : 1;
+ c = c*((p1.elemsDissolved[elem]/100)/elements[elem].solubility.water);
+ if(Math.random() > c){
+ return false;
+ }
+ if(r.aqFunc){
+ r.aqFunc(p1, p2);
+ }
+ if(r.elem1 != undefined){
+ let e = getItem(r.elem1);
+ if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
+ p1.elemsDissolved[e] = p1.elemsDissolved[elem];
+ p1.elemsDissolved[elem] = undefined;
+ } else {
+ if(e === null){
+ deletePixel(p1.x, p1.y);
+ } else {
+ changePixel(p1, e);
+ }
+ }
+ }
+ if(r.elem2 != undefined){
+ changePixel(p2, getItem(r.elem2));
+ }
+ if(r.charge1){
+ p1.charge = r.charge1;
+ }
+ if(r.charge2){
+ p2.charge = r.charge2;
+ }
+ if(r.stain1){
+ stainPixel(p1,r.stain1,0.05);
+ }
+ if(r.stain2){
+ stainPixel(p2,r.stain2,0.05);
+ }
+ } else if (p2.element == "water"){
+ for(let e2 in p2.elemsDissolved){
+ if(elements[elem].reactions != undefined && elements[elem].reactions[e2] != undefined){
+ let r = elements[elem].reactions[e2];
+ 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;
+ }
+ let c = (r.chance != undefined) ? r.chance : 1;
+ c = c*((p1.elemsDissolved[elem]/100)/elements[elem].solubility.water);
+ if(Math.random() > c){
+ return false;
+ }
+ if(r.aqFunc){
+ r.aqFunc(p1, p2);
+ }
+ if(r.elem1 != undefined){
+ let e = getItem(r.elem1);
+ if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
+ p1.elemsDissolved[e] = p1.elemsDissolved[elem];
+ p1.elemsDissolved[elem] = undefined;
+ } else {
+ if(e === null){
+ deletePixel(p1.x, p1.y);
+ } else {
+ changePixel(p1, e);
+ }
+ }
+ }
+ if(r.elem2 != undefined){
+ let e = getItem(r.elem2);
+ if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
+ p2.elemsDissolved[e] = p1.elemsDissolved[elem];
+ p2.elemsDissolved[elem] = undefined;
+ } else {
+ if(e === null){
+ deletePixel(p2.x, p2.y);
+ } else {
+ changePixel(p2, e);
+ }
+ }
+ }
+ if(r.charge1){
+ p1.charge = r.charge1;
+ }
+ if(r.charge2){
+ p2.charge = r.charge2;
+ }
+ if(r.stain1){
+ stainPixel(p1,r.stain1,0.05);
+ }
+ if(r.stain2){
+ stainPixel(p2,r.stain2,0.05);
+ }
+ }
+ }
+ }
+ }
+ }
+ function updateColor(pixel){
+ let c = pixel.oColor;
+ for(let element in pixel.elemsDissolved){
+ //if(elements[element].solubility.color != undefined){
+ let color = (elements[element].solubility.color != undefined) ? getItem(elements[element].solubility.color) : getItem(elements[element].color);
+ /*if(Array.isArray(elements[element].solubility.color)){
+ color = elements[element].solubility.color[Math.round(Math.random()*elements[element].solubility.color.length)];
+ while(color == undefined){
+ color = elements[element].solubility.color[Math.round(Math.random()*elements[element].solubility.color.length)];
+ }
+ } else {
+ color = elements[element].solubility.color;
+ }*/
+ if(color.startsWith("#")){
+ color = hexToRGB(color);
+ } else if(color.startsWith("rgb(")){
+ color = getRGB(color);
+ }
+ c = interpolateRgb(getRGB(c), color, ((pixel.elemsDissolved[element]/100)/elements[element].solubility.water) || 0.01);
+ //console.log(rgb, color, getRGB(pixel.oColor), ((pixel.elemsDissolved[elem]/100)/elements[elem].solubility.water));
+
+ }
+ pixel.color = c;
+ //}
+ }
+ function solventTick(pixel) {
+ if(pixel.start = pixelTicks+5){
+ pixel.oColor = pixel.color;
+ }
+ pixel.capacity = (1+((pixel.temp-20)/80))*100;
+ for(let coords of adjacentCoords){
+ let x = pixel.x+coords[0], y = pixel.y+coords[1];
+ let p2 = getPixel(x,y);
+ let total = 0;
+ for(let elem in pixel.elemsDissolved){
+ total += pixel.capacity*((pixel.elemsDissolved[elem]/100)/elements[elem].solubility.water);
+ }
+ if(p2 != null){
+ aqueousReaction(pixel, p2);
+ }
+ if(p2 != null && total < pixel.capacity){
+ if(elements[p2.element].solubility != null && elements[p2.element].solubility[pixel.element] != null){
+ let solubilityObj = elements[p2.element].solubility;
+ p2.dissolved = (p2.dissolved == undefined) ? elements[p2.element].solubility[pixel.element] : p2.dissolved+elements[p2.element].solubility[pixel.element];
+
+ if(pixel.elemsDissolved[p2.element] == undefined){
+ pixel.elemsDissolved[p2.element] = elements[p2.element].solubility[pixel.element];
+ } else {
+ pixel.elemsDissolved[p2.element] += elements[p2.element].solubility[pixel.element];
+ }
+ updateColor(pixel, p2.element);
+ if(solubilityObj.func != undefined){
+ solubilityObj.func(pixel, p2);
+ }
+ if(p2.dissolved >= 100){
+ deletePixel(p2.x, p2.y);
+ }
+ }
+ } else if(total > (pixel.capacity+20) && p2 == null) {
+ let solArr = [], elemArr = [];
+ for(let elem in pixel.elemsDissolved){
+ elemArr.push(elem);
+ solArr.push(elements[elem].solubility[pixel.element]);
+ }
+ let index = solArr.indexOf(Math.min(...solArr));
+ if(isEmpty(x,y) && !outOfBounds(x,y)){
+ createPixel(elemArr[index], x, y);
+ let max = (pixel.elemsDissolved[elemArr[index]] > (total-pixel.capacity)) ? total-pixel.capacity : pixel.elemsDissolved[elemArr[index]];
+ pixelMap[x][y].dissolved = 100-max;
+ updateColor(pixel);
+ pixel.elemsDissolved[elemArr[index]] -= max;
+ }
+ }
+ else if (p2 != null && p2.element == "water"){
+ for(let elem in pixel.elemsDissolved){
+ if(p2.elemsDissolved[elem] == undefined) {p2.elemsDissolved[elem] = 0;};
+ if(p2.elemsDissolved[elem] > pixel.elemsDissolved[elem] && pixel.elemsDissolved[elem]/100 < elements[elem].solubility[pixel.element]){
+ p2.elemsDissolved[elem]--;
+ pixel.elemsDissolved[elem]++;
+ updateColor(pixel);
+ updateColor(p2);
+ } else if (p2.elemsDissolved[elem] < pixel.elemsDissolved[elem] && p2.elemsDissolved[elem]/100 < elements[elem].solubility[pixel.element]) {
+ p2.elemsDissolved[elem]++;
+ pixel.elemsDissolved[elem]--;
+ updateColor(pixel);
+ updateColor(p2);
+ }
+ }
+ }
+ }
+ if(pixel.temp >= elements[pixel.element].solventTempHigh){
+ let elem = null;
+ let num = Math.random();
+ if(elem === null){
+ for(let e in pixel.elemsDissolved){
+ if(num <= ((pixel.elemsDissolved[e]/100)/elements[e].solubility.water)){
+ elem = e;
+ }
+ }
+ }
+ elem = (elem == null) ? "steam" : elem;
+ changePixel(pixel, elem);
+ pixel.dissolvedElems = {};
+ }
+ }
+ behaviors.SOLVENT = function(pixel){
+ let visc = 0;
+ for(let elem in pixel.elemsDissolved){
+ if(elements[elem].solubility.visc != undefined){
+ visc += ((pixel.elemsDissolved[elem]/100)/elements[elem].solubility[pixel.element])*elements[elem].solubility.visc;
+ }
+ }
+ if(elements[pixel.element].viscosity != undefined){
+ visc = visc*(elements[pixel.element].viscosity/1000);
+ }
+ let chance = 1-(visc/1000);
+ let dir = (Math.random()