From aee4b2444cc9f5156a662698ef48b01392b51b1f Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:36:42 -0500 Subject: [PATCH 01/19] important bugfix fix save not including pixelTicks --- mods/save_loading.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/save_loading.js b/mods/save_loading.js index 8fcab069..5f5dad74 100644 --- a/mods/save_loading.js +++ b/mods/save_loading.js @@ -69,6 +69,7 @@ try { width: width, height: height, pixelSize: pixelSize, + pixelTicks: pixelTicks, settings: settings, version: 1, enabledMods: localStorage.enabledMods, @@ -322,6 +323,7 @@ try { width = json.width; height = json.height; pixelSize = json.pixelSize; + pixelTicks = (json.pixelTicks ?? 0); //currentPixels = json.currentPixels; for(i = 0; i < json.pixelMap.length; i++) { json.pixelMap[i] = json.pixelMap[i].map(x => zeroToNull(x)); From a80db8fb8cd0d947c45d0ed5f801b4acebf58480 Mon Sep 17 00:00:00 2001 From: sb <155691462+stefanblox@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:12:16 -0300 Subject: [PATCH 02/19] single color update 1 line mod holy piss --- mods/singleColor.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/singleColor.js b/mods/singleColor.js index 7d6e23a4..0fc8d32b 100644 --- a/mods/singleColor.js +++ b/mods/singleColor.js @@ -1,3 +1 @@ -for (var element in elements) { - elements[element].singleColor = true; -} \ No newline at end of file +window.addEventListener('load', function() {for (var element in elements) {elements[element].singleColor = true;}}); From 4e32e3774b754f20bcb46a751e4d3dbc2475d604 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:56:28 -0500 Subject: [PATCH 03/19] fix tsunami velocity --- mods/a_mod_by_alice.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/a_mod_by_alice.js b/mods/a_mod_by_alice.js index 804e1714..873f89a3 100644 --- a/mods/a_mod_by_alice.js +++ b/mods/a_mod_by_alice.js @@ -2136,9 +2136,9 @@ try { }; }; - function capitalizeFirstLetter(string,locale=null) { - return string[0][locale ? "toLocaleUpperCase" : "toUpperCase"](locale) + string.slice(1) - }; + function capitalizeFirstLetter(string,locale=null) { + return string[0][locale ? "toLocaleUpperCase" : "toUpperCase"](locale) + string.slice(1) + }; //COLOR MANIPULATION TOOLS ## @@ -36321,7 +36321,7 @@ Make sure to save your command in a file if you want to add this preset again.` newPixel.vx ??= 0; newPixel.vy ??= 0; newPixel.vx += (pixel.direction * 5) - newPixel.vy += 3; + newPixel.vy -= 3; }; }; pixel.fromX += pixel.direction @@ -36406,7 +36406,7 @@ Make sure to save your command in a file if you want to add this preset again.` newPixel.vx ??= 0; newPixel.vy ??= 0; newPixel.vx += (pixel.direction * 13) - newPixel.vy += 6; + newPixel.vy -= 6; }; }; pixel.fromX += pixel.direction @@ -36503,7 +36503,7 @@ Make sure to save your command in a file if you want to add this preset again.` newPixel.vx ??= 0; newPixel.vy ??= 0; newPixel.vx += (pixel.direction * 6) - newPixel.vy += 3; + newPixel.vy -= 3; }; }; pixel.fromX += pixel.direction @@ -36598,7 +36598,7 @@ Make sure to save your command in a file if you want to add this preset again.` newPixel.vx ??= 0; newPixel.vy ??= 0; newPixel.vx += (pixel.direction * 8) - newPixel.vy += 5; + newPixel.vy -= 5; }; }; pixel.fromX += pixel.direction From bc362d38fdaf9a10c689ab6e2faf8b167d4c52c7 Mon Sep 17 00:00:00 2001 From: sb <155691462+stefanblox@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:10:45 -0300 Subject: [PATCH 04/19] sbstuff 2.6 --- mods/sbstuff.js | 98 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 16 deletions(-) diff --git a/mods/sbstuff.js b/mods/sbstuff.js index 596e6999..bf7f4d1e 100644 --- a/mods/sbstuff.js +++ b/mods/sbstuff.js @@ -192,6 +192,8 @@ elements.green_berries = { elements.meth = { hardness: 1, tempHigh: 500, + tempLow: -50, + stateLowColorMultiplier: 0.9, stateHigh: "melted_meth", color: "#0affef", behavior: behaviors.POWDER, @@ -199,6 +201,18 @@ elements.meth = { state: "liquid" }; +elements.melted_meth = { + viscosity: 1000, + tempHigh: 100000, + tempLow: -20, + stateHigh: "beans", + stateLow: "meth", + color: "#00a2ff", + behavior: behaviors.LIQUID, + category: "joke", + state: "solid", +}; + elements.garlic = { isFood: true, tempHigh: 500, @@ -217,7 +231,7 @@ elements.garlic_bread = { breakInto: "crumb", tempHigh: 500, stateHigh: "ash", - color: ["#db9b56", "#288a0c", "#db9b56", "#db9b56", "#db9b56", "#db9b56"], + color: ["#e9be90", "#288a0c", "#e0c6aa", "#b49e85", "#b6926b", "#ccac8b"], behavior: behaviors.STURDYPOWDER, category: "food", state: "solid", @@ -249,6 +263,8 @@ elements.lemon = { elements.lemonade = { isFood: true, tempHigh: 500, + tempLow: -15, + tempLowColor: "#f8eb35", stateHigh: "steam", color: "#fff41c", behavior: behaviors.LIQUID, @@ -269,6 +285,18 @@ elements.poop = { } }; +elements.diarrhea = { + hardness: 1, + viscosity: 10000, + tempHigh: 500, + stateHigh: ["ash", "ash", "ash", "ash", "ash", "ash", "ash", "steam",], + color: "#523718", + behavior: behaviors.LIQUID, + category: "joke", + state: "solid", + desc: "riddle me this, libshart, if theres liquid poop then wheres the solid piss?" +}; + elements.marshmallow = { isFood: true, tempHigh: 50, @@ -355,6 +383,7 @@ elements.diamond_ore = { elements.coca_cola = { isFood: true, tempHigh: 500, + tempLow: -10, stateHigh: "steam", color: "#381e13", behavior: behaviors.LIQUID, @@ -365,6 +394,7 @@ elements.coca_cola = { elements.pepsi = { tempHigh: 500, stateHigh: "steam", + tempLow: -10, color: "#2b1717", behavior: behaviors.LIQUID, category: "liquids", @@ -374,6 +404,7 @@ elements.pepsi = { elements.piss = { tempHigh: 500, stateHigh: "steam", + tempLow: -10, color: "#ffff00", behavior: behaviors.LIQUID, category: "joke", @@ -405,17 +436,10 @@ elements.pastry = { state: "solid", }; -elements.melted_meth = { - tempHigh: 100000, - stateHigh: "beans", - color: "#00a2ff", - behavior: behaviors.LIQUID, - category: "joke", - state: "solid", -}; -elements.expired_milk = { +elements.spoiled_milk = { tempHigh: 500, + tempLow: -20, stateHigh: "ash", color: "#b8c2b4", behavior: behaviors.LIQUID, @@ -523,6 +547,8 @@ elements.mashed_pea = { elements.burnt_beans = { tempHigh: 500, stateHigh: "ash", + tempLow: -0, + stateLow: "beans", isFood: true, viscosity: 10000, density: 721, @@ -801,6 +827,7 @@ elements.barbecue_sauce = { viscosity: 3000, density: 1800, tempHigh: 500, + tempLow: 0, stateHigh: "steam", color: "#420400", behavior: behaviors.LIQUID, @@ -907,6 +934,7 @@ elements.porridge = { viscosity: 3000, density: 500, tempHigh: 500, + tempLow: -10, stateHigh: "steam", color: "#b8a254", behavior: behaviors.LIQUID, @@ -938,7 +966,7 @@ elements.chocolate_grape = { viscosity: 10000, tempHigh: 300, stateHigh: "steam", - color: ["#9e3475", "#6e4d36"], + color: ["#7e600d", "#6e4d36"], behavior: behaviors.LIQUID, category: "food", state: "liquid", @@ -949,7 +977,7 @@ elements.sprinkles = { stateHigh: "ash", cooldown: 0.2, color: ["#ff5e5e", "#ffea5e", "#73ff5e", "#5efcff", "#995eff", "#ff5ed1"], - behavior: behaviors.STURDYPOWDER, + behavior: behaviors.POWDER, category: "powders", state: "liquid", maxSize: 1, @@ -965,6 +993,7 @@ elements.incinerator = { category: "machines", state: "solid", insulate: true, + excludeRandom: true, reactions: { "fart": { elem1: null, elem2: "ohio" }, } @@ -1113,6 +1142,7 @@ elements.strawberry = { elements.beer = { tempHigh: 300, stateHigh: "steam", + tempLow: -10, color: "#b39329", behavior: behaviors.LIQUID, category: "liquids", @@ -1140,8 +1170,10 @@ elements.carrot = { }; elements.wine = { + hidden: true, tempHigh: 400, stateHigh: "steam", + tempLow: -10, color: "#2e0206", behavior: behaviors.LIQUID, category: "liquids", @@ -1173,6 +1205,7 @@ elements.dark_energy = { ], category: "special", state: "gas", + excludeRandom: true }; elements.ohio = { @@ -1189,6 +1222,7 @@ elements.ohio = { category: "joke", state: "gas", desc: "use at own risk", + excludeRandom: true }; elements.papaya = { @@ -1279,6 +1313,9 @@ elements.heavy_water = { behavior: behaviors.LIQUID_OLD, category: "liquids", state: "liquid", + reactions: { + "sand": { elem1: null, elem2: "quicksand" }, + } }; elements.blood_orange = { @@ -1308,6 +1345,7 @@ elements.cranberry = { hidden: true, tempHigh: 300, stateHigh: "steam", + tempLow: -15, color: "#ad2a1d", behavior: behaviors.LIQUID, category: "food", @@ -1441,6 +1479,7 @@ elements.uraniumaniumaniumaniumanium_popcornicecream_plutoniumeptunium_238239 = elements.coffee_milk = { tempHigh: 300, stateHigh: "steam", + tempLow: -30, color: "#5c4c42", behavior: behaviors.LIQUID, category: "liquids", @@ -1565,6 +1604,7 @@ elements.electron = { }; elements.sned = { + desc: "slowly expanding...", color: "#dfe0d9", behavior: [ "XX|XX AND CR:sned%1|XX", @@ -1580,7 +1620,7 @@ elements.uranium_tea = { temp: 60, tempHigh: 400, stateHigh: "molten_uranium", - color: ["#0f8b15", "#316624", "#59864b", "#502e0f"], + color: ["#526306", "#40530c", "#80320e", "#502e0f"], behavior: behaviors.RADLIQUID, category: "liquids", state: "liquid" @@ -1598,19 +1638,19 @@ elements.powerlaser = { if (Math.random() > 0.05) { continue } createPixel("flash", x, y); pixelMap[x][y].color = "#b80ced"; - pixelMap[x][y].temp = 1001000; + pixelMap[x][y].temp = 11000; } else { if (elements[pixelMap[x][y].element].isGas) { continue } if (elements[pixelMap[x][y].element].id === elements.heat_ray.id) { break } - pixelMap[x][y].temp += 901000; + pixelMap[x][y].temp += 9000; pixelTempCheck(pixelMap[x][y]); break; } } deletePixel(pixel.x, pixel.y); }, - temp: 1000000, + temp: 10000, category: "energy", state: "gas", excludeRandom: true, @@ -1629,6 +1669,29 @@ elements.magma_bomb = { state: "liquid" }; +elements.quicksand = { + viscosity: 10000, + tempHigh: 1000, + stateHigh: ["molten_glass", "molten_glass", "molten_glass", "molten_glass", "steam"], + color: ["#b1873a", "#cea250"], + behavior: behaviors.LIQUID, + category: "land", + state: "liquid", + density: 1400, + stain: 0.02 +}; + +elements.liquid_filler = { + color: "#ae00ff", + behavior: [ + "XX|XX AND CR:liquid_filler%50|XX", + "M2 AND CR:liquid_filler%50|XX|M2 AND CR:liquid_filler%50", + "M1|M1 AND CH:liquid_filler%50|M1", + ], + category: "special", + state: "liquid" +}; + elements.incinerate.category = "tools", elements.cook.category = "tools", elements.room_temp.category = "tools", @@ -1663,6 +1726,9 @@ elements.potato.reactions.steam = {elem1: "fries", tempMin: 100, chance:50} if (!elements.water.reactions) elements.water.reactions = {}; elements.water.reactions.cocaine = { elem1: "solid_water", elem2: null } +if (!elements.alcohol.reactions) elements.alcohol.reactions = {}; +elements.alcohol.reactions.juice = {elem1:"wine", elem2:null, chance:5} + if (!elements.paper.reactions) elements.paper.reactions = {}; elements.paper.reactions.bless = { elem1: "robux", elem2: null, chance: 0.0000001 } From 7e33e67763e8108260df3544d36180710ee74ad6 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:57:12 +0800 Subject: [PATCH 05/19] Meese lol --- mods/meese.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 mods/meese.js diff --git a/mods/meese.js b/mods/meese.js new file mode 100644 index 00000000..d3bb3f6e --- /dev/null +++ b/mods/meese.js @@ -0,0 +1,38 @@ +// made by squarescreamyt + +elements.meese = { + color: "#6e4526", + state: "solid", + behavior: [ + "M2%1|M2%2|M2%1", + "M2%10|XX|M2%10", + "XX|M1|XX", + ], + reactions: { + "grass": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "plant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.3 }, + "mercury": { elem1:"rotten_meat", chance:0.1 }, + "bleach": { elem1:"rotten_meat", chance:0.1 }, + "infection": { elem1:"rotten_meat", chance:0.025 }, + "uranium": { elem1:"rotten_meat", chance:0.1 }, + "cyanide": { elem1:"rotten_meat", chance:0.1 }, + "chlorine": { elem1:"meat", chance:0.1 }, + "alcohol": { elem1:"meat", chance:0.025 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "meese", + foodNeed: 10, + temp: 30, + tempHigh: 100, + stateHigh: "cooked_meat", + tempLow: -18, + stateLow: "frozen_meat", + category:"life", + breakInto: "rotten_meat", + burn:15, + burnTime:300, + state: "solid", + density: 1450, + conduct: 0.2 +}; From 91322418bce88eabcc2f2ad2483bf4802a4eaf15 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:07:07 +0800 Subject: [PATCH 06/19] A Chef's Dream 1.7! --- mods/aChefsDream.js | 729 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 718 insertions(+), 11 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 09ac248d..588fa84f 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,19 +1,33 @@ /* -Created by SquareScreamYT and RealerRaddler -Thanks to Alice, nousernamefound and Fioushemastor for helping :) +Created by SquareScreamYT <@918475812884344852> and RealerRaddler <@914371295561535508> +Thanks to Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696> and Fioushemastor <@738828785482203189> for helping :) + +v1.6 + +me trying to come up with stuff not in plants.js: Upcoming Features: - onions - spring onions - soy sauce -- rice +- rice and porridge (white rice noodles) - seaweed and agar - pigs, ham and bacon - garlic - msg - stainless steel - -v1.5 +- chili +- pepper plants +- pineapples +- mint +- vanilla +- cocoa beans and hot chocolate +- normal cookies and cookie dough +- cows and beef +- mangoes and passionfruits +- celery +- marshmallows, normal, cooked and burnt +- broccoli Changelog (v1.0) - added chickens @@ -218,6 +232,22 @@ Changelog (v1.5) - added cookies and cookie dough - replaced cooking oil with nut oil - added boba and boba dough + + + +Changelog (v1.6) + - added freeze and warm tool + - added olive seeds + - juice mixing functionality + - wine can now be made by mixing grape juice and alcohol + - added bananas and related stuff + - bananas + - hanging banana peduncle and banana peduncle + - banana stem and banana stem top + - banana leaves + - cut banana + - banana juice + - banana bread */ /* @@ -227,6 +257,19 @@ elements.test = { } */ +function interpolateRgb(rgb1, rgb2, ratio) { + const interpolatedRgb = { + r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio), + g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio), + b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio), + }; + return interpolatedRgb; +} +function getRGB(rgb){ + let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r") + return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) }; + } + elements.knife = { color: "#adb5bd", // other needed properties @@ -245,6 +288,8 @@ elements.knife = { desc: "Use on pixels to cut them, if possible." } +eLists.JUICEMIXABLE = ["juice"]; + elements.chicken = { color: ["#c29046", "#f5d271", "#d4bd7d"], behavior: [ @@ -717,6 +762,53 @@ elements.olive = { density: 1050, isFood: false } + +elements.olive_seed = { + color: "#854610", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "olive_wood" : "olive_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"olive_wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0 + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, + behavior: [ + "XX|XX|XX", + "XX|FX%10|XX", + "XX|M1|XX", + ], +}; /* elements.cooking_oil = { color: "#ffc844", @@ -951,12 +1043,21 @@ elements.apple_juice = { density: 825, hidden: true, temp: 30, + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#ffde55") + } + } + }, reactions: { "sugar": { elem1:"apple_jam", elem2:null, chance:0.35 }, "yeast": { elem1:"apple_cider_vinegar", elem2:null, chance:0.35 } }, tempLow: 0 }; +eLists.JUICEMIXABLE.push("apple_juice"); elements.apple_jam = { color: "#ebc034", @@ -1251,6 +1352,14 @@ elements.orange_seed = { elements.orange_juice = { color: "#ffb326", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#ffde55") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -1264,6 +1373,7 @@ elements.orange_juice = { temp: 30, tempLow: 0 }; +eLists.JUICEMIXABLE.push("orange_juice"); elements.orange_peels = { color: "#d69c31", @@ -1708,6 +1818,14 @@ elements.watermelon_flesh = { elements.watermelon_juice = { color: "#eb4034", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#eb4034") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -1721,6 +1839,7 @@ elements.watermelon_juice = { temp: 30, tempLow: 0 }; +eLists.JUICEMIXABLE.push("watermelon_juice"); elements.grape = { color: ["#b84b65","#a10e69","#a10e95","#8a3eab"], @@ -1755,6 +1874,14 @@ elements.grape = { elements.grape_juice = { color: "#6d2282", behavior: behaviors.LIQUID, + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel, "#6d2282") + } + } + }, reactions: { "dirt": { elem1: null, elem2: "mud" }, "sand": { elem1: null, elem2: "wet_sand" }, @@ -1762,6 +1889,7 @@ elements.grape_juice = { "seltzer": { elem1: "soda", elem2: "foam" }, "carbon_dioxide": { elem1: "soda", elem2: "foam" }, "milk": { elem1: "fruit_milk", elem2: "fruit_milk" }, + "alcohol": { elem1: "wine", elem2: "wine" }, "yeast": { elem1: ["wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","cream_of_tartar"], elem2: null, chance:80 }, }, tempHigh: 160, @@ -1774,6 +1902,7 @@ elements.grape_juice = { hidden: true, isFood: true }; +eLists.JUICEMIXABLE.push("grape_juice"); elements.cream_of_tartar = { color: ["#EFEFEF", "#EBEBEB", "#D8D8D6"], @@ -1817,6 +1946,14 @@ elements.wine = { behavior: behaviors.LIQUID, category: "liquids", state: "liquid", + /*onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel, "#6D0112") + } + } + },*/ tempHigh: 100, stateHigh: "steam", isFood: true, @@ -1824,6 +1961,7 @@ elements.wine = { hidden: true, tempLow: 0 } +//eLists.JUICEMIXABLE.push("wine"); elements.shrimp = { color: ["#EE5422", "#E9683C", "#F3583F", "#EDA270"], @@ -2118,6 +2256,14 @@ elements.cut_coconut = { elements.coconut_juice = { color: "#e9ebe4", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#e9ebe4") + } + } + }, behavior: behaviors.LIQUID, reactions: { "dirt": { elem1: null, elem2: "mud" }, @@ -2135,6 +2281,7 @@ elements.coconut_juice = { hidden: true, isFood: true } +eLists.JUICEMIXABLE.push("coconut_juice"); elements.lemon_wood = { color: "#786531", @@ -2224,6 +2371,14 @@ elements.lemon = { elements.lemon_juice = { color: "#e0d358", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#e0d358") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2241,9 +2396,18 @@ elements.lemon_juice = { "sugar": {elem1:"lemonade", elem2: "null", chance:0.35} } }; +eLists.JUICEMIXABLE.push("lemon_juice"); elements.lemonade = { color: "#fff378", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#fff378") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2259,6 +2423,8 @@ elements.lemonade = { tempLow: 0 }; +eLists.JUICEMIXABLE.push("lemonade"); + elements.lemon_zest = { color: "#dbc535", behavior: behaviors.POWDER, @@ -2444,6 +2610,14 @@ elements.carrot = { elements.carrot_juice = { color: "#f5a742", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#f5a742") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2457,9 +2631,18 @@ elements.carrot_juice = { hidden: true, temp: 30, }; +eLists.JUICEMIXABLE.push("carrot_juice"); elements.apple_cider_vinegar = { color: "#fffe75", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#fffe75") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2473,6 +2656,7 @@ elements.apple_cider_vinegar = { temp: 30, tempLow: 0 }; +eLists.JUICEMIXABLE.push("apple_cider_vinegar"); elements.turnip_seed = { color: "#994828", @@ -2593,6 +2777,14 @@ elements.turnip = { elements.turnip_juice = { color: "#700f5d", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#700f5d") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2606,6 +2798,7 @@ elements.turnip_juice = { hidden: true, temp: 30, }; +eLists.JUICEMIXABLE.push("turnip_juice"); elements.corn = { color: ["#f8d223","#d6ba2a","#f7f5ba","#dbd281","#cdb12d"], @@ -2644,8 +2837,8 @@ elements.corn_starch = { "seltzer": { elem1: "dough", elem2: null }, "pool_water": { elem1: "dough", elem2: null }, "juice": { elem1: "dough", elem2: null }, - "yolk": { elem1: "batter", elem2: null }, - "yogurt": { elem1: "batter", elem2: null }, + "yolk": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" }, + "yogurt": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" }, "broth": { elem1:"dough", elem2:null }, "soda": { elem1:"dough", elem2:null }, "tea": { elem1:"dough", elem2:null }, @@ -2941,6 +3134,14 @@ elements.strawberry = { } elements.strawberry_juice = { color: "#e03a3a", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#e03a3a") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -2957,6 +3158,7 @@ elements.strawberry_juice = { "sugar": { elem1:"strawberry_jam", elem2:null, chance:0.35 }, }, }; +eLists.JUICEMIXABLE.push("strawberry_juice"); elements.cream = { color: "#f7f7f7", @@ -3152,6 +3354,14 @@ elements.ginger_leaves = { } elements.ginger_juice = { color: "#ccc056", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#ccc056") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -3169,6 +3379,7 @@ elements.ginger_juice = { "bread": { elem1:"gingerbread", elem2:null }, }, }; +eLists.JUICEMIXABLE.push("ginger_juice"); elements.blueberry_seed = { @@ -3314,6 +3525,14 @@ elements.blueberry = { } elements.blueberry_juice = { color: "#5030a1", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#5030a1") + } + } + }, behavior: behaviors.LIQUID, category: "liquids", tempHigh: 100, @@ -3331,6 +3550,8 @@ elements.blueberry_juice = { "milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1: "#995fb3" }, }, }; + +eLists.JUICEMIXABLE.push("blueberry_juice"); /* elements.fruit_slushie = { color: "#ffcc54", @@ -3399,7 +3620,8 @@ elements.cut_blueberry = { burn:15, burnTime:60, burnInto: "dead_plant", - breakInto: "blueberry_juice", + breakInto: "juice", + breakIntoColor:"#add69a", state: "solid", density: 1050, hidden: true @@ -3437,7 +3659,7 @@ elements.cookie_dough = { category: "food", tempHigh: 94, stateHigh: "cookie", - stateHighColorMultiplier: 0.8, + stateHighColorMultiplier: 1.1, burn:40, burnTime:25, burnInto:"ash", @@ -3465,7 +3687,7 @@ elements.cookie = { elements.nut_oil.name = "cooking_oil" -// elements.fire.temp = 130 +elements.fire.temp = 130 elements.bread.behavior = behaviors.SUPPORT @@ -3504,6 +3726,491 @@ elements.boba = { burnInto: ["smoke","smoke","smoke","ash"], breakIntoColor: "#7d6216", state: "solid", - density: 644, + density: 1500, + isFood: true +} +elements.caramel.density = 1500 +elements.freeze = { + color: ["#42cbf5", "#42cbf5", "#42cbf5", "#75d3f0", "#42cbf5"], + tool: function (pixel) { + if (!shiftDown) { + pixel.temp -= 0.2; + pixelTempCheck(pixel); + } else { + pixel.temp -= 200; + pixelTempCheck(pixel); + } + }, + category: "energy", + canPlace: false, + excludeRandom: true, + desc: "Use on pixels to freeze them." +}; +elements.warm = { + color: ["#c7634a", "#c7634a", "#c7634a", "#e38f7b", "#c7634a"], + tool: function (pixel) { + if (!shiftDown) { + pixel.temp += 0.2; + pixelTempCheck(pixel); + } else { + pixel.temp += 200; + pixelTempCheck(pixel); + } + }, + category: "energy", + canPlace: false, + excludeRandom: true, + desc: "Use on pixels to warm them." +}; +/* +elements.pineapple_seed = { + color: "#695531", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (pixel.temp < 100 && pixel.temp > 20) { + if (Math.random() < 0.02 && pixel.age > 50) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + pixel.leaflength = pixel.leaflength+Math.round(Math.random()) + } + } + if (isEmpty(pixel.x,pixel.y-1) && pixel.leafgrown==false) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("pineapple_leaves",pixel.x,pixel.y+1); + if (isEmpty(pixel.x,pixel.y-1)) { + createPixel("pineapple",pixel.x,pixel.y-1); + } + if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x+1,pixel.y); + if (isEmpty(pixel.x+2,pixel.y-1) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x+2,pixel.y-1); + if (pixel.leaflength == 4 && isEmpty(pixel.x+3,pixel.y-2) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x+3,pixel.y-2); + pixel.leafgrown = true + } + } + } + if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x-1,pixel.y); + if (isEmpty(pixel.x-2,pixel.y-1) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x-2,pixel.y-1); + if (pixel.leaflength = 3) { + pixel.leafgrown = true + } + if (pixel.leaflength = 4 && isEmpty(pixel.x-3,pixel.y-2) && isEmpty(pixel.x+3,pixel.y-2) && Math.random() < 0.5) { + createPixel("pineapple_leaves",pixel.x-3,pixel.y-2); + createPixel("pineapple_leaves",pixel.x+3,pixel.y-2); + pixel.leafgrown = true + } + } + } + } + } + else if (pixel.age > 500 && leafgrown == true && Math.random() < 0.1) { + changePixel(pixel,"pineapple_leaves"); + } + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + "leaflength":3, + "leafgrown":false, + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, + temp:25, + behavior: [ + "XX|XX|XX", + "XX|FX%10|XX", + "XX|M1|XX", + ], +}; +*//* +function averageHexColor(color1, color2) { + const rgb1 = hexToRgb(color1); + const rgb2 = hexToRgb(color2); + const avgRed = Math.floor((rgb1[0] + rgb2[0]) / 2); + const avgGreen = Math.floor((rgb1[1] + rgb2[1]) / 2); + const avgBlue = Math.floor((rgb1[2] + rgb2[2]) / 2); + const avgHex = rgbToHex(avgRed, avgGreen, avgBlue); + return avgHex; +} + +function hexToRgb(hex) { + hex = hex.replace(/^#/, ''); + const r = parseInt(hex.substring(0, 2), 16); + const g = parseInt(hex.substring(2, 4), 16); + const b = parseInt(hex.substring(4, 6), 16); + return [r, g, b]; +} + +function rgbToHex(r, g, b) { + const rHex = r.toString(16).padStart(2, '0'); + const gHex = g.toString(16).padStart(2, '0'); + const bHex = b.toString(16).padStart(2, '0'); + return `${rHex}${gHex}${bHex}`; +} +*/ +// test +//var color1 = "#FF0000"; +//var color2 = "#0000FF"; +//var averageColor = averageHexColor(color1, color2); +//console.log(averageColor) +/* +eLists.JUICEMIXABLE.forEach(function(element){ + elements[element].onMix = function(pixel1,pixel2) { + if (shiftDown && eLists.JUICEMIXABLE.indexOf(pixel2.element) !== -1) { + if (Math.random() < 0.2) { + var hex1 = pixel1.color + var hex2 = pixel2.color + let rgb = pixel.color.replace("rgb(", "").replace(")", "").split(","); + let rgbObj = { r: parseInt(rgb[0]), g: parseInt(rgb[1]), b: parseInt(rgb[2]) } //use this as one of the rgb objects + var finalJuiceColor = interpolatedRgb(hex1,hex2,0.5) + changePixel(pixel1,"juice") + //pixel1.color = pixelColorPick(pixel,finalJuiceColor) + pixel1.color = rgb(rgbObj) + } + } +} +})*/ +elements.juice.onMix = function(pixel){ + let num = Math.floor(Math.random() * 4); + let x = pixel.x + adjacentCoords[num][0]; + let y = pixel.y + adjacentCoords[num][1]; + if(!isEmpty(x,y) && !outOfBounds(x,y)){ + let pixel2 = pixelMap[x][y]; + if(pixel.color != pixel2.color && pixel2.element == "juice"){ + let condition; + if(shiftDown == 0){ + condition = (Math.floor(Math.random() * 2) == 1); + } else { + condition = true; + } + if(condition){ + let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixel2.color), 0.5); + pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } + } + } + +elements.juice.stain = 0 + +elements.banana_seed = { + color: "#594129", + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1) && pixel.height < 7) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("banana_stem",pixel.x,pixel.y+1); + + pixel.height++ + } + } + else if (pixel.age > 150 && pixel.height > 6 && Math.random() < 0.1) { + changePixel(pixel,"banana_tree_top"); + } + pixel.age++; + doDefaults(pixel); + }, + properties: { + "age":0, + "height": 0 + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], +}; +elements.banana_stem = { + color: "#698215", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "life", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.banana_tree_top = { + color: "#718a21", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "life", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + properties:{ + "leftleaves": 0, + "rightleaves": 0, + }, + hidden: true, + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 0) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("banana_leaves",pixel.x+1,pixel.y); + + pixel.rightleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 1) { + if (isEmpty(pixel.x+2,pixel.y)) { + createPixel("banana_leaves",pixel.x+2,pixel.y); + + pixel.rightleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 2) { + if (isEmpty(pixel.x+3,pixel.y)) { + createPixel("banana_leaves",pixel.x+3,pixel.y); + + pixel.rightleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 3) { + if (isEmpty(pixel.x+4,pixel.y+1)) { + createPixel("banana_leaves",pixel.x+4,pixel.y+1); + + pixel.rightleaves++ + } + } + + + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 0) { + if (isEmpty(pixel.x-1,pixel.y)) { + createPixel("banana_leaves",pixel.x-1,pixel.y); + + pixel.leftleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 1) { + if (isEmpty(pixel.x-2,pixel.y)) { + createPixel("banana_leaves",pixel.x-2,pixel.y); + + pixel.leftleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 2) { + if (isEmpty(pixel.x-3,pixel.y)) { + createPixel("banana_leaves",pixel.x-3,pixel.y); + + pixel.leftleaves++ + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 3) { + if (isEmpty(pixel.x-4,pixel.y+1)) { + createPixel("banana_leaves",pixel.x-4,pixel.y+1); + + pixel.leftleaves++ + } + } + + + if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) { + if (isEmpty(pixel.x+1,pixel.y+2)) { + createPixel("banana_peduncle",pixel.x+1,pixel.y+2); + } + } + if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) { + if (isEmpty(pixel.x-1,pixel.y+2)) { + createPixel("banana_peduncle",pixel.x-1,pixel.y+2); + } + } + pixel.age++; + doDefaults(pixel); + }, +} +elements.banana_leaves = { + color: ["#3da324","#3cbd1c"], + reactions: { + "vinegar": { elem1:"dead_plant", elem2:null, chance:0.035 }, + "baking_soda": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "bleach": { elem1:"dead_plant", elem2:null, chance:0.05 }, + "alcohol": { elem1:"dead_plant", elem2:null, chance:0.035 } + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true +} +elements.banana_peduncle = { + color: "#8bb81a", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "life", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + hidden: true, + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.temp < 100) { + if (isEmpty(pixel.x+1,pixel.y+1)) { + createPixel("hanging_banana_peduncle",pixel.x+1,pixel.y+1); + } + if (isEmpty(pixel.x-1,pixel.y+1)) { + createPixel("hanging_banana_peduncle",pixel.x-1,pixel.y+1); + } + if (isEmpty(pixel.x+1,pixel.y+2)) { + createPixel("hanging_banana_peduncle",pixel.x+1,pixel.y+2); + } + if (isEmpty(pixel.x-1,pixel.y+2)) { + createPixel("hanging_banana_peduncle",pixel.x-1,pixel.y+2); + } + } + pixel.age++; + doDefaults(pixel); + }, +} +elements.hanging_banana_peduncle = { + color: "#8bb81a", + behavior: [ + "XX|XX|XX", + "CR:banana%0.2|XX|CR:banana%0.2", + "XX|XX|XX", + ], + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "life", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + hidden: true, +} +elements.banana = { + color: "#ebd834", + behavior: [ + "XX|XX|XX", + "ST:hanging_banana_peduncle|XX|ST:hanging_banana_peduncle", + "XX|M1|XX", + ], + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "banana_juice", + state: "solid", + density: 1050, + cutInto: "cut_banana" +} +elements.cut_banana = { + color: "#f2e56b", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "banana_juice", + state: "solid", + density: 1050, +} +elements.banana_juice = { + color: "#dbc440", + behavior: behaviors.LIQUID, + category: "liquids", + tempHigh: 100, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#dbc440") + } + } + }, + reactions: { + "bread": { elem1:"banana_bread", elem2:null, chance:0.35 }, + }, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("banana_juice"); + +elements.banana_bread = { + color: "#c2782f", + behavior: behaviors.STURDYPOWDER, + tempHigh: 176, + stateHigh: "toast", + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, isFood: true } From 1c7724834019f5af3218cfc85251c41af9ca4d10 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:09:16 +0800 Subject: [PATCH 07/19] delete meese --- mods/meese.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 mods/meese.js diff --git a/mods/meese.js b/mods/meese.js deleted file mode 100644 index d3bb3f6e..00000000 --- a/mods/meese.js +++ /dev/null @@ -1,38 +0,0 @@ -// made by squarescreamyt - -elements.meese = { - color: "#6e4526", - state: "solid", - behavior: [ - "M2%1|M2%2|M2%1", - "M2%10|XX|M2%10", - "XX|M1|XX", - ], - reactions: { - "grass": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "plant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "oxygen": { elem2:"carbon_dioxide", chance:0.3 }, - "mercury": { elem1:"rotten_meat", chance:0.1 }, - "bleach": { elem1:"rotten_meat", chance:0.1 }, - "infection": { elem1:"rotten_meat", chance:0.025 }, - "uranium": { elem1:"rotten_meat", chance:0.1 }, - "cyanide": { elem1:"rotten_meat", chance:0.1 }, - "chlorine": { elem1:"meat", chance:0.1 }, - "alcohol": { elem1:"meat", chance:0.025 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - }, - egg: "meese", - foodNeed: 10, - temp: 30, - tempHigh: 100, - stateHigh: "cooked_meat", - tempLow: -18, - stateLow: "frozen_meat", - category:"life", - breakInto: "rotten_meat", - burn:15, - burnTime:300, - state: "solid", - density: 1450, - conduct: 0.2 -}; From af22d52bf43eb6695e5059e530c83843ac3be247 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:09:54 +0800 Subject: [PATCH 08/19] 1.7 --- mods/aChefsDream.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 588fa84f..507653fb 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -248,6 +248,11 @@ Changelog (v1.6) - cut banana - banana juice - banana bread + + + + + */ /* From 331fdf0f18f9fecfd75a5f5cff72109e90a27a85 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:14:27 +0800 Subject: [PATCH 09/19] DELICIOUS BANANA BREAD --- mods/aChefsDream.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 507653fb..19a628b3 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -4207,6 +4207,7 @@ eLists.JUICEMIXABLE.push("banana_juice"); elements.banana_bread = { color: "#c2782f", + desc: "delicious banana bread", behavior: behaviors.STURDYPOWDER, tempHigh: 176, stateHigh: "toast", From 32cbd0e8052f40457ca2062ca199135b8b754d32 Mon Sep 17 00:00:00 2001 From: GGod <46885632+GGodPL@users.noreply.github.com> Date: Thu, 15 Feb 2024 21:14:20 +0100 Subject: [PATCH 10/19] add moreViews.js mod (without dynamic lights) --- mods/VCR_OSD_MONO.ttf | Bin 0 -> 22584 bytes mods/moreViews.js | 481 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 481 insertions(+) create mode 100644 mods/VCR_OSD_MONO.ttf create mode 100644 mods/moreViews.js diff --git a/mods/VCR_OSD_MONO.ttf b/mods/VCR_OSD_MONO.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9322814923c784c0ac4bcc12ff6c960d63931025 GIT binary patch literal 22584 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 dH0 { + if (n <= views.length - 1 && n > 1) { + view = n; + } else { + view = null; + } + setSetting('view', parseInt(view)); + document.querySelector('span[setting="view"]').children[0].value = view ?? 0; +} + +for (const i in views) { + if (i < 5) continue; + const option = document.createElement("option"); + option.setAttribute("value", i); + option.innerText = views[i]; + document.querySelector('.setting-span[setting="view"]').querySelector("select").appendChild(option); + viewKey[i] = views[i]; +} + +const vcrFont = new FontFace("VCR", "url(mods/VCR_OSD_MONO.ttf)"); +vcrFont.load().then(font => { + console.log(font); + document.fonts.add(font); +}) + +function blending(color, color2, t = 0.5) { + const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16)); + const [r2, g2, b2] = parseColor(color2).replace("#", "").match(/../g).map(a => parseInt(a, 16)); + if ([r, g, b].includes(undefined) || [r, g, b, t].includes(NaN)) console.log([r, g, b, t], parseColor(color), color); + return `#${[ + (1 - t) * r + t * r2, + (1 - t) * g + t * g2, + (1 - t) * b + t * b2 + ].map(a => Math.floor(a).toString(16).padStart(2, "0")).join("")}`; +} + +const cache = new Map(); + +function mixColors(color, color2) { + if (cache.has(`${color}_${color2}`) || cache.has(`${color2}_${color}`)) return cache.get(`${color}_${color2}`) ?? cache.get(`${color2}_${color}`); + const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16)); + const [r2, g2, b2] = parseColor(color2).replace("#", "").match(/../g).map(a => parseInt(a, 16)); + const res = [ + Math.max(r, r2), + Math.max(g, g2), + Math.max(b, b2) + ]; + cache.set(`${color}_${color2}`, `#${res.map(a => (Math.floor(a) % 256).toString(16).padStart(2, "0")).join("")}`); + return `#${res.map(a => (Math.floor(a) % 256).toString(16).padStart(2, "0")).join("")}`; +} + +const parseColor = (colorString) => { + if (colorString instanceof Array) return parseColor(colorString[0]); + if (typeof colorString != "string") return "#ffffff"; + if (colorString.startsWith("rgb(")) { + const color = colorString.replace("rgb(", "").replace(")", ""); + return `#${color.split(",").map(a => parseInt(a).toString(16).length == 1 ? `0${parseInt(a).toString(16)}` : parseInt(a).toString(16)).join("")}`; + } else if (colorString.startsWith("rgba(")) { + const color = colorString.replace("rgba(", "").replace(")", ""); + return `#${color.split(",").filter((_, i) => i <= 2).map(a => parseInt(a).toString(16).length == 1 ? `0${parseInt(a).toString(16)}` : parseInt(a).toString(16)).join("")}`; + } else { + if (colorString.startsWith("#")) { + const color = colorString.slice(1); + if (color.length == 3) return `#${color.split(a => a.repeat(2)).join()}`; + else if (color.length >= 6) return `#${color.slice(0, 6)}`; + else return `#${color}`; + } + } +} + +const rgbToHsl = (r, g, b) => { + const r1 = r / 255; + const g1 = g / 255; + const b1 = b / 255; + + const cmax = Math.max(r1, g1, b1); + const cmin = Math.min(r1, g1, b1); + + const delta = cmax - cmin; + const l = (cmax + cmin) / 2; + const s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)); + let h = 0; + if (delta != 0) { + switch (cmax) { + case r1: + h = 60 * (((g1 - b1) / delta) % 6); + break; + case g1: + h = 60 * ((b1 - r1) / delta + 2); + break; + default: + h = 60 * ((r1 - g1) / delta + 4); + } + } + + return {h, s, l}; +} + +const thetaSetting = new Setting("3D View Angle (0-90)", "theta", settingType.NUMBER, false, parseFloat((Math.atan(2) * 180 / Math.PI).toPrecision(3))); + +const tab = new SettingsTab("moreViews.js"); +tab.registerSetting(thetaSetting); + +let maxDistance = -1; +const colorCache = new Map(); + +function getModeColor(color, distance = 0) { + if (!colorCache.has(view)) colorCache.set(view, new Map()); + if (view == 18) { + if (colorCache.get(view).has(color) && colorCache.get(view).get(color).has(distance)) return colorCache.get(view).get(color).get(distance); + } else if (colorCache.get(view).has(color)) return colorCache.get(view).get(color); + switch (view) { + case 6: { + const newColor = "#" + (parseInt(`0x1${parseColor(color).slice(1)}`) ^ 0xffffff).toString(16).slice(1); + colorCache.get(view).set(color, newColor); + return newColor; + } + case 7: { + const newColor = blending(pixel.color, "#000000"); + colorCache.get(view).set(color, newColor); + return newColor; + } + case 8: { + const newColor = blending(pixel.color, "#ffffff"); + colorCache.get(view).set(color, newColor); + return newColor; + } + case 9: { + const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3); + const {h, l} = rgbToHsl(r, g, b); + const newColor = `hsl(${Math.round(h)}, 0%, ${Math.round(l * 100)}%)`; + colorCache.get(view).set(color, newColor); + return newColor; + } + case 10: { + const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16)); + const [r2, g2, b2] = [ + Math.min(255, (r * 0.393) + (g * 0.769) + (b * 0.189)), + Math.min(255, (r * 0.349) + (g * 0.686) + (b * 0.168)), + Math.min(255, (r * 0.272) + (g * 0.534) + (b * 0.131)) + ]; + const newColor = `#${Math.floor(r2).toString(16).padStart(2, "0")}${Math.floor(g2).toString(16).padStart(2, "0")}${Math.floor(b2).toString(16).padStart(2, "0")}`; + colorCache.get(view).set(color, newColor); + return newColor; + } + case 11: { + const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3); + const {h, s, l} = rgbToHsl(r, g, b); + const newColor = `hsl(${(Math.round(h) + 180 % 360)}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%)`; + colorCache.get(view).set(color, newColor); + return newColor; + } + case 12: { + const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3); + const {h, s, l} = rgbToHsl(r, g, b); + const newColor = `hsl(${Math.round(h)}, ${Math.round(s * 100) * 4}%, ${Math.round(l * 100)}%)`; + colorCache.get(view).set(color, newColor); + return newColor; + } + case 15: { + const [r, g, b] = parseColor(color).replace("#", "").match(/../g); + const [r2, g2, b2] = [parseInt(r, 16) * 0.75, parseInt(g, 16) * 0.75, parseInt(b, 16) * 0.75]; + const newColor = `rgb(${r2}, ${g2}, ${b2})`; + colorCache.get(view).set(color, newColor); + return newColor; + } + case 18: { + const newColor = blending(pixel.color, "#000000", (1 / maxDistance) * distance); + colorCache.get(view).has(color) + ? colorCache.get(view).get(color).set(distance, newColor) + : colorCache.get(view).set(color, new Map([[distance, newColor]])); + return newColor; + } + } + return color; +} + +settingsManager.registerTab(tab); + +runAfterLoadList.push(() => drawPixels = (function() { + const oldDrawPixels = drawPixels; + + return function(forceTick = false) { + if (view >= 5) { + if (maxDistance = -1) maxDistance = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2) * 2; + + const canvas = document.getElementById("game"); + const ctx = canvas.getContext("2d"); + var newCurrentPixels = currentPixels.slice(); + var pixelsFirst = []; + var pixelsLast = []; + if (!paused || forceTick) { + shuffleArray(newCurrentPixels); + } + + for (var i = 0; i < newCurrentPixels.length; i++) { + pixel = newCurrentPixels[i]; + if (pixel.del) {continue} + if (!paused || forceTick) { + if (elements[pixel.element].tick) { + elements[pixel.element].tick(pixel); + } + if (pixel.del) {continue} + if (elements[pixel.element].behavior) { + pixelTick(pixel); + } + }; + if (pixel.con) { pixel = pixel.con } + if (elements[pixel.element].isGas || elements[pixel.element].glow) { + pixelsLast.push(pixel); + } + else { + pixelsFirst.push(pixel); + } + } + + if (hiding) { + if (ctx.globalAlpha < 1) { + ctx.globalAlpha = 1; + } + + if (elements[currentElement].maxSize < mouseSize) { + var mouseOffset = Math.trunc(elements[currentElement].maxSize/2); + } + else { + var mouseOffset = Math.trunc(mouseSize/2); + } + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + + ctx.strokeStyle = "white"; + ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + + if (settings.precision) { + ctx.fillStyle = "rgba(255,255,255,0.5)"; + ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } + if ((!paused) || forceTick) {pixelTicks++}; + return; + } + + if (!settings["bg"]) {ctx.clearRect(0, 0, canvas.width, canvas.height)} + else { + ctx.fillStyle = settings["bg"]; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } + var pixelDrawList = pixelsFirst.concat(pixelsLast); + for (var i = 0; i < pixelDrawList.length; i++) { + pixel = pixelDrawList[i]; + if (pixelMap[pixel.x][pixel.y] == undefined) {continue} + if (pixel.con) { pixel = pixel.con }; + ctx.fillStyle = getModeColor(pixel.color, view == 18 ? Math.sqrt((width / 2 - pixel.x) ** 2 + (height / 2 - pixel.y) ** 2) : 0); + // 3D VIEW + if (view == 5) { + const neighborRight = !outOfBounds(pixel.x + 1, pixel.y) && !!pixelMap[pixel.x + 1][pixel.y]; + const neighborUp = !outOfBounds(pixel.x, pixel.y - 1) && !!pixelMap[pixel.x][pixel.y - 1]; + const neighborUpRight = !outOfBounds(pixel.x + 1, pixel.y - 1) && !!pixelMap[pixel.x + 1][pixel.y - 1]; + let size = 0; + let currentY = pixel.y; + while (!outOfBounds(pixel.x, currentY) && pixelMap[pixel.x][currentY] && pixelMap[pixel.x][currentY].element == pixel.element) { + currentY++; + size++; + } + ctx.globalAlpha = 1; + ctx.fillStyle = pixel.color; + ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize); + const px = pixel.x * pixelSize; + const py = pixel.y * pixelSize; + const theta = Math.max(Math.min(thetaSetting.get(), 90), 0) * Math.PI / 180; + const a = Math.cos(theta); + const b = Math.sin(theta); + const w = pixelSize; + const px2 = px + a * w; + const py2 = py - b * w; + const parts = [[[px, py], [[px2, py2], [px + w, py2], [px + w, py]], !neighborUp], [[px + w, py + w], [[px2 + w, py2 + w], [px2 + w, py], [px + w, py]], !neighborRight], [[px + w, py], [[px + w, py2], [px2 + w, py2], [px + w, py]], !neighborUp && !neighborUpRight], [[px + w, py], [[px2 + w, py2], [px2 + w, py], [px + w, py]], !neighborRight && !neighborUpRight]] + for (const part of parts.filter(p => p[2])) { + ctx.fillStyle = blending(pixel.color, "#000000"); + ctx.beginPath(); + ctx.moveTo(...part[0]); + for (const v of part[1]) { + ctx.lineTo(...v); + } + ctx.closePath(); + ctx.fill(); + } + } else if (view == 13) { + const hue = 225 - (Math.log(pixel.start) / Math.log(pixelTicks)) * 225; + ctx.globalAlpha = 1; + ctx.fillStyle = `hsl(${Math.min(Math.round(hue), 250)}, 100%, 50%)`; + ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize); + } else if (view == 14) { + ctx.globalAlpha = 1; + ctx.fillStyle = pixel.color; + ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize); + + if (outOfBounds(pixel.x - 1, pixel.y) || !pixelMap[pixel.x - 1][pixel.y]) { + ctx.fillStyle = "#ff0000"; + ctx.globalAlpha = 0.5; + ctx.fillRect(pixel.x * pixelSize - 0.5 * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize); + } + if (outOfBounds(pixel.x + 1, pixel.y) || !pixelMap[pixel.x + 1][pixel.y]) { + ctx.fillStyle = "#00ffff"; + ctx.globalAlpha = 0.5; + ctx.fillRect(pixel.x * pixelSize + 0.5 * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize); + } + } else if (view == 15) { + const [r, g, b] = parseColor(pixel.color).replace("#", "").match(/../g); + const [r2, g2, b2] = [parseInt(r, 16) * 0.75, parseInt(g, 16) * 0.75, parseInt(b, 16) * 0.75] + // scrolling effect + const offset = (pixelTicks + 6) % height >= pixel.y && (pixelTicks - 3) % height <= pixel.y + || (pixelTicks + 66) % height >= pixel.y && (pixelTicks - 57) % height <= pixel.y; + if (!pixelMap[pixel.x - 1] || !pixelMap[pixel.x - 1][pixel.y]) { + ctx.globalAlpha = 0.5; + ctx.fillStyle = `#${r.padStart(2, "0")}0000`; + ctx.fillRect(pixel.x * pixelSize - 0.75 * pixelSize - (offset ? 0.5 * pixelSize : 0) , pixel.y * pixelSize, pixelSize, pixelSize); + } + if (!pixelMap[pixel.x + 1] || !pixelMap[pixel.x + 1][pixel.y]) { + ctx.globalAlpha = 0.5; + ctx.fillStyle = `#0000${b.padStart(2, "0")}`; + ctx.fillRect(pixel.x * pixelSize + 0.75 * pixelSize - (offset ? 0.5 * pixelSize : 0), pixel.y * pixelSize, pixelSize, pixelSize); + } + ctx.globalAlpha = 1; + ctx.fillStyle = `rgb(${r2}, ${g2}, ${b2})` + ctx.fillRect(pixel.x * pixelSize - (offset ? 0.5 * pixelSize : 0), pixel.y * pixelSize, pixelSize, pixelSize); + ctx.globalAlpha = 1; + // i fucking hate it but at least it works + // and i dont feel like finding something that is fast and pretty + } else if (view == 16) { + ctx.globalAlpha = 1; + ctx.strokeStyle = pixel.color; + ctx.lineWidth = 2; + const cond1 = outOfBounds(pixel.x - 1, pixel.y) + || !pixelMap[pixel.x - 1][pixel.y] + || pixelMap[pixel.x - 1][pixel.y].element != pixel.element; + const cond2 = outOfBounds(pixel.x + 1, pixel.y) + || !pixelMap[pixel.x + 1][pixel.y] + || pixelMap[pixel.x + 1][pixel.y].element != pixel.element; + const cond3 = outOfBounds(pixel.x, pixel.y - 1) + || !pixelMap[pixel.x][pixel.y - 1] + || pixelMap[pixel.x][pixel.y - 1].element != pixel.element; + const cond4 = outOfBounds(pixel.x, pixel.y + 1) + || !pixelMap[pixel.x][pixel.y + 1] + || pixelMap[pixel.x][pixel.y + 1].element != pixel.element; + const cond5 = outOfBounds(pixel.x - 1, pixel.y - 1) + || !pixelMap[pixel.x - 1][pixel.y - 1] + || pixelMap[pixel.x - 1][pixel.y - 1].element != pixel.element; + const cond6 = outOfBounds(pixel.x + 1, pixel.y - 1) + || !pixelMap[pixel.x + 1][pixel.y - 1] + || pixelMap[pixel.x + 1][pixel.y - 1].element != pixel.element; + const cond7 = outOfBounds(pixel.x - 1, pixel.y + 1) + || !pixelMap[pixel.x - 1][pixel.y + 1] + || pixelMap[pixel.x - 1][pixel.y + 1].element != pixel.element; + const cond8 = outOfBounds(pixel.x + 1, pixel.y + 1) + || !pixelMap[pixel.x + 1][pixel.y + 1] + || pixelMap[pixel.x + 1][pixel.y + 1].element != pixel.element; + + if (cond1) { + ctx.beginPath(); + ctx.moveTo(pixel.x * pixelSize + ctx.lineWidth / 2, pixel.y * pixelSize); + ctx.lineTo(pixel.x * pixelSize + ctx.lineWidth / 2, (pixel.y + 1) * pixelSize); + ctx.stroke(); + } + if (cond2) { + ctx.beginPath(); + ctx.moveTo((pixel.x + 1) * pixelSize - ctx.lineWidth / 2, pixel.y * pixelSize); + ctx.lineTo((pixel.x + 1) * pixelSize - ctx.lineWidth / 2, (pixel.y + 1) * pixelSize); + ctx.stroke(); + } + if (cond3) { + ctx.beginPath(); + ctx.moveTo(pixel.x * pixelSize, pixel.y * pixelSize + ctx.lineWidth / 2); + ctx.lineTo((pixel.x + 1) * pixelSize, pixel.y * pixelSize + ctx.lineWidth / 2); + ctx.stroke(); + } + if (cond4) { + ctx.beginPath(); + ctx.moveTo(pixel.x * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth / 2); + ctx.lineTo((pixel.x + 1) * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth / 2); + ctx.stroke(); + } + if (!cond2 && !cond4 && cond8) ctx.fillRect((pixel.x + 1) * pixelSize - ctx.lineWidth, (pixel.y + 1) * pixelSize - ctx.lineWidth, ctx.lineWidth, ctx.lineWidth); + if (!cond2 && !cond3 && cond6) ctx.fillRect((pixel.x + 1) * pixelSize - ctx.lineWidth, pixel.y * pixelSize, ctx.lineWidth, ctx.lineWidth); + if (!cond1 && !cond3 && cond5) ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, ctx.lineWidth, ctx.lineWidth); + if (!cond1 && !cond4 && cond7) ctx.fillRect(pixel.x * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth, ctx.lineWidth, ctx.lineWidth); + } else if (view == 17) { + ctx.fillRect(pixel.x * pixelSize, (height - pixel.y) * pixelSize, pixelSize, pixelSize); + } else { + ctx.fillRect(pixel.x*pixelSize, pixel.y*pixelSize, pixelSize, pixelSize); + } + if (pixel.charge && view !== 2) { // Yellow glow on charge + if (!elements[pixel.element].colorOn) { + ctx.fillStyle = "rgba(255,255,0,0.5)"; + ctx.fillRect(pixel.x*pixelSize, pixel.y*pixelSize, pixelSize, pixelSize); + } + } + } + if (view == 15) { + // TRACK READ NOISE + for (let n = 0; n < 3; n++) { + const number = Math.floor(Math.random() * height); + ctx.globalAlpha = Math.random(); + ctx.fillStyle = "#fff"; + ctx.fillRect(0, (number + 0.5) * pixelSize, width * pixelSize, 0.2); + ctx.globalAlpha = 1; + } + const {font, textAlign} = ctx; + ctx.font = "30px VCR"; + ctx.textAlign = "start"; + ctx.fillText(paused ? "PAUSE" : "PLAY", (0.025 * width) * pixelSize, (0.025 * width) * pixelSize + 15); + if (paused) { + ctx.fillRect((0.05 * width) * pixelSize + ctx.measureText("PAUSE").width, (0.025 * width) * pixelSize - 7.5, 5, 22.5); + ctx.fillRect((0.05 * width) * pixelSize + ctx.measureText("PAUSE").width + 8, (0.025 * width) * pixelSize - 7.5, 5, 22.5); + } else { + ctx.fillStyle = "#fff"; + ctx.beginPath(); + ctx.moveTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize - 7.5); + ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize + 15); + ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width + 17.5, (0.025 * width) * pixelSize + 3.75); + ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize - 7.5); + ctx.fill(); + } + const base = Math.floor(pixelTicks / tps); + const seconds = base % 60 + ""; + const minutes = Math.floor(base / 60) % 60 + ""; + const hours = Math.floor(base / 60 / 60) + ""; + ctx.textAlign = "end"; + ctx.fillText(`${hours.padStart(2, "0")}:${minutes.padStart(2, "0")}:${seconds.padStart(2, "0")}`, (0.975 * width) * pixelSize, (0.025 * width) * pixelSize + 15); + ctx.font = font; + ctx.textAlign = textAlign; + } + if (ctx.globalAlpha < 1) { + ctx.globalAlpha = 1; + } + + if (elements[currentElement].maxSize < mouseSize) { + var mouseOffset = Math.trunc(elements[currentElement].maxSize/2); + } + else { + var mouseOffset = Math.trunc(mouseSize/2); + } + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + // Draw a square around the mouse + ctx.strokeStyle = "white"; + ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + // draw one transparent pixel in the center + if (settings.precision) { + ctx.fillStyle = "rgba(255,255,255,0.5)"; + ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } + if ((!paused) || forceTick) {pixelTicks++}; + } else oldDrawPixels.apply(this, arguments); + } +}())); +} \ No newline at end of file From ffd61ea2d36cc56de87b0f5f28d46d4c8ef54532 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:02:12 -0600 Subject: [PATCH 11/19] Create plants.js --- mods/plants.js | 1190 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1190 insertions(+) create mode 100644 mods/plants.js diff --git a/mods/plants.js b/mods/plants.js new file mode 100644 index 00000000..dd304907 --- /dev/null +++ b/mods/plants.js @@ -0,0 +1,1190 @@ +//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. +let fruits = ["plum", "peach", "pear", "orange", "apple", "cherry", "mango"]; +let vineExclude = ["tomato", "grape", "fruit_vine", "kiwi"]; +let vines = ['tomato', 'grape', 'kiwi']; +let bushes = ["blackberry", "blueberry", "raspberry"]; +let allFruits = fruits.concat(vines, bushes) +function interpolateRgb(rgb1, rgb2, ratio) { + const interpolatedRgb = { + r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio), + g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio), + b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio), + }; + return interpolatedRgb; +} + +elements.fruit_branch = { + color: elements.tree_branch.color, + behavior: [ + "CR:fruit_leaves,fruit_branch%2|CR:fruit_leaves,fruit_leaves,fruit_leaves,fruit_branch%2|CR:fruit_leaves,fruit_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "wood", + tempLow: -30, + stateLow: "wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], + seed: "apple_seed", + tick: function(pixel){ + for(var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x+adjacentCoords[i][0]; + let y = pixel.y+adjacentCoords[i][1]; + if(isEmpty(x, y) || outOfBounds(x, y)) { continue; } + let pixel2 = pixelMap[x][y]; + if(pixel2.element == "fruit_branch" || pixel2.element == "fruit_leaves" || pixel2.element == "wood"){ + if(pixel.fruit && !pixel2.fruit){ + pixel2.fruit = pixel.fruit; + } else if (!pixel.fruit && pixel2.fruit){ + pixel.fruit = pixel2.fruit; + } + } + } + } +} +elements.fruit_leaves = { + color: elements.plant.color, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + reactions: { + "vinegar": { elem1:"dead_plant", elem2:null, chance:0.035 }, + "baking_soda": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "bleach": { elem1:"dead_plant", elem2:null, chance:0.05 }, + "alcohol": { elem1:"dead_plant", elem2:null, chance:0.035 } + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, + tick: function(pixel){ + if(pixelTicks == pixel.start + 1 && pixel.blooming == undefined){ + if(Math.floor(Math.random() * 3) == 2){ + pixel.blooming = true; + pixel.color = "#FFE2E2"; + } else { + pixel.blooming = false; + } + } + for(var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x+adjacentCoords[i][0]; + let y = pixel.y+adjacentCoords[i][1]; + if(isEmpty(x, y) || outOfBounds(x, y)) { continue; } + let pixel2 = pixelMap[x][y]; + if(pixel2.element == "fruit_branch" || pixel2.element == "fruit_leaves" || pixel2.element == "wood" || (elements[pixel2.element].properties && elements[pixel2.element].properties.type == "fruit")){ + if(pixel.fruit && !pixel2.fruit){ + pixel2.fruit = pixel.fruit; + } else if (!pixel.fruit && pixel2.fruit){ + pixel.fruit = pixel2.fruit; + } + } + } + if(pixel.blooming){ + if(pixelTicks > pixel.start + 150){ + if(Math.floor(Math.random() * 400) == 3){ + if(pixel.fruit){ + if(pixel.fruit == "random"){ + changePixel(pixel, fruits[Math.floor(Math.random() * fruits.length)]); + } else { + changePixel(pixel, pixel.fruit); + } + } + } + } + } + } +} + +elements.apple_seed = { + color: "#1A0E00", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves" || pixelMap[pixel.x][pixel.y+1].element == "wood"){ + pixelMap[pixel.x][pixel.y+1].fruit = "apple"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"apple" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.apple = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: "#ff0004", + category: "food", + breakInto: "juice", + breakIntoColor: "#FF4747", + isFood: true, + properties: { + fruit: "apple", + type: "fruit", + } +} +elements.pear_seed = { + color: "#1A0E00", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "pear"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"pear" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.pear = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: "#97FF43", + category: "food", + breakInto: "juice", + breakIntoColor: "#ABFF8D", + isFood: true, + properties: { + fruit: "pear", + type: "fruit", + } +} +elements.cherry_seed = { + color: "#b56233", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "cherry"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"cherry" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.cherry = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: "#750000", + category: "food", + breakInto: "juice", + breakIntoColor: "#8a0000", + isFood: true, + properties: { + fruit: "cherry", + type: "fruit", + } +} +elements.milk = { + color: "#fafafa", + behavior: behaviors.LIQUID, + onMix: function(milk1, milk2) { + if (shiftDown && Math.random() < 0.01) { + changePixel(milk1,"butter") + } + }, + reactions: { + "melted_chocolate": { elem1:"chocolate_milk", elem2:null }, + "chocolate": { elem1:"chocolate_milk", elem2:"melted_chocolate", chance:0.05 }, + "coffee_ground": { elem1:"chocolate_milk", chance:0.05 }, + "juice": { elem1:"fruit_milk", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.25); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }}, + "soda": { elem1:"pilk", elem2:null, chance:0.1 }, + "yolk": { elem1:"eggnog", elem2:null, chance:0.1 }, + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "caramel": { color1:"#C8B39A", elem2:null, chance:0.05 }, + "sugar": { elem2:null, chance:0.005}, + }, + tempLow: 0, + stateLow: "ice_cream", + stateLowColorMultiplier: [0.97,0.93,0.87], + tempHigh: 93, + stateHigh: "yogurt", + viscosity: 1.5, + category: "liquids", + state: "liquid", + density: 1036.86, + isFood: true +} +elements.cream = { + color: "#f7f7f7", + behavior: behaviors.LIQUID, + onMix: function(milk1, milk2) { + if ((shiftDown && Math.random() < 0.01) || (elements[milk2.element].id === elements.milk.id && Math.random() < 0.00025)) { + changePixel(milk1,"butter") + } + }, + reactions: { + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "melted_chocolate": { color1:"#664934", elem2:null }, + "chocolate": { color1:"#664934", elem2:"melted_chocolate", chance:0.05 }, + "juice": { elem1:"fruit_milk", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.25); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }}, + "soda": { elem1:"pilk", elem2:null, chance:0.1 }, + "yolk": { elem1:"#eggnog", elem2:null, chance:0.1 }, + "caramel": { color1:"#C8B39A", chance:0.05 }, + "sugar": { elem2:null, chance:0.005}, + }, + viscosity: 1.5, + tempHigh: 1000, + stateHigh: ["smoke","smoke","smoke","steam","steam","calcium"], + tempLow: 0, + stateLow: "ice_cream", + stateLowColorMultiplier: 0.97, + category: "liquids", + hidden: true, + isFood: true, + state: "liquid", + density: 959.97, +} +function getRGB(rgb){ + let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r") + return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) }; +} +elements.peach = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: ["#ffb485", "#ffa770", "#ff7b61", "#ff512e", "#ff350d"], + category: "food", + breakInto: "juice", + breakIntoColor: "#ffa74f", + isFood: true, + properties: { + fruit: "peach", + type: "fruit", + } +} +elements.peach_seed = { + color: "#240c00", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "peach"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"peach" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.plum = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: "#1c0030", + category: "food", + breakInto: "juice", + breakIntoColor: "#d2880a", + isFood: true, + properties: { + fruit: "plum", + type: "fruit", + } +} +elements.plum_seed = { + color: "#240c00", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "plum"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"plum" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.juice.reactions.juice = { + func: function(pixel1, pixel2){ + if(pixel1.color != pixel2.color){ + if(Math.floor(Math.random() * 1000) == 1){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.5); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } + } +} +elements.juice.onMix = function(pixel){ + let num = Math.floor(Math.random() * 4); + let x = pixel.x + adjacentCoords[num][0]; + let y = pixel.y + adjacentCoords[num][1]; + if(!isEmpty(x,y) && !outOfBounds(x,y)){ + let pixel2 = pixelMap[x][y]; + if(pixel.color != pixel2.color && pixel2.element == "juice"){ + let condition; + if(shiftDown == 0){ + condition = (Math.floor(Math.random() * 2) == 1); + } else { + condition = true; + } + if(condition){ + let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixel2.color), 0.5); + pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } + } + } +elements.vine.behavior = [["XX", "ST:vine", "XX"],["ST:vine", "XX", "ST:vine"],["XX", "ST:vine AND M1", "XX"]] +elements.apricot = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: ["#ffa100", "#FF5D00", "#FF7A00", "#FF9700"], + category: "food", + breakInto: "juice", + breakIntoColor: "#ffa836", + isFood: true, + properties: { + fruit: "apricot", + type: "fruit", + } +} +elements.apricot_seed = { + color: "#291300", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "apricot"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"apricot" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.orange = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: "#FFB400", + category: "food", + breakInto: "juice", + breakIntoColor: "#FFDB00", + isFood: true, + properties: { + fruit: "orange", + type: "fruit", + } +} +elements.orange_seed = { + color: "#291300", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "orange"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"orange" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.random_seed = { + color: "#291300", + tick: function(pixel) { + if(pixel.start == pixelTicks){ + pixel.fruit = fruits[Math.floor(Math.random() * fruits.length)]; + } + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = pixel.fruit; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.multi_seed = { + color: "#291300", + tick: function(pixel) { + pixel.fruit = fruits[Math.floor(Math.random() * fruits.length)] + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "random"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +elements.fruit_vine = { + category: "life", + color: elements.plant.color, + behavior: [["XX", "ST:fruit_vine AND ST:wood", "XX"], ["ST:fruit_vine AND ST:wood", "XX", "ST:fruit_vine AND ST:wood"], ["XX", "ST:fruit_vine AND M1 AND ST:wood", "XX"]], + properties: { + age: 0, + }, + tick: function(pixel){ + if(Math.floor(Math.random() * 100) == 1 && pixel.age > 25 && pixel.age < 500){ + for(var i = 0; i < squareCoords.length; i++){ + let x1 = pixel.x + squareCoords[i][0]; + let y1 = pixel.y + squareCoords[i][1]; + if(!isEmpty(x1,y1) && !outOfBounds(x1,y1) && !vineExclude.includes(pixelMap[x1][y1].element)){ + let randomNum = Math.floor(Math.random() * 4); + let x2 = x1 + squareCoords[randomNum][0]; + let y2 = y1 + squareCoords[randomNum][1]; + if(isEmpty(x2,y2) && !outOfBounds(x2,y2)){ + createPixel("fruit_vine", x2, y2); + pixelMap[x2][y2].fruit = pixel.fruit; + } + } + } + } + pixel.age += 1; + if(pixel.fruit){ + for(var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x + adjacentCoords[i][0]; + let y = pixel.y + adjacentCoords[i][1]; + if(isEmpty(x,y) && !outOfBounds(x,y) && Math.floor(Math.random() * 1000) == 5){ + createPixel(pixel.fruit, x, y); + } + } + } + if(!pixel.fruit){ + for(var i = 0; i < squareCoords.length; i++){ + let x = pixel.x + squareCoords[i][0]; + let y = pixel.y + squareCoords[i][1]; + if(isEmpty(x,y) || outOfBounds(x,y)){ continue; } + let pixel2 = pixelMap[x][y]; + if(pixel2.fruit){ + pixel.fruit = pixel2.fruit; + } else { continue; } + } + } + } +} +elements.grape.behavior = [["XX", "ST:fruit_vine", "XX"], ["ST:fruit_vine", "XX", "ST:fruit_vine"], ["M2", "ST:fruit_vine AND M1", "M2"]]; +elements.tomato.behavior = elements.grape.behavior; +elements.tomato_seed = { + color: "#FFFAAD", + category: "life", + behavior: behaviors.POWDER, + tick: function(pixel){ + if(pixel.age > 40){ + changePixel(pixel, "fruit_vine"); + pixel.fruit = "tomato"; + } + pixel.age += 1; + }, + properties: { + age: 0, + }, +} +elements.grape_seed = { + color: "#231A00", + category: "life", + behavior: behaviors.POWDER, + tick: function(pixel){ + if(pixel.age > 40){ + changePixel(pixel, "fruit_vine"); + pixel.fruit = "grape"; + } + pixel.age += 1; + }, + properties: { + age: 0, + }, +} +elements.kiwi = { + behavior: elements.grape.behavior, + color: "#403000", + category: "food", + breakInto: "juice", + breakIntoColor: "#21A800", + isFood: true, + properties: { + type: "fruit", + } +} +elements.kiwi_seed = { + color: "#231A00", + category: "life", + behavior: behaviors.POWDER, + tick: function(pixel){ + if(pixel.age > 40){ + changePixel(pixel, "fruit_vine"); + pixel.fruit = "kiwi"; + } + pixel.age += 1; + }, + properties: { + age: 0, + }, +} +elements.bush_base = { + color: elements.wood.color, + behavior: [ + ["CR:bush_cane%25", "XX", "CR:bush_cane%25"], + ["XX", "XX", "XX"], + ["XX", "XX", "XX"] + ], + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -40, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + tick: function(pixel){ + let caneCoords = [[-1,-1],[1,-1]]; + for(var i = 0; i < caneCoords.length; i++){ + let x = pixel.x + caneCoords[i][0]; + let y = pixel.y + caneCoords[i][1]; + if(!isEmpty(x,y) && !outOfBounds(x,y)){ + let pixel2 = pixelMap[x][y]; + if(pixel2.element == "bush_cane" && !pixel2.fruit){ + pixel2.fruit = pixel.fruit; + } + } + } + } +}; +elements.bush_cane = { + color: elements.wood.color, + tick: function(pixel){ + if(pixel.age < 200 && Math.floor(Math.random() * 40) == 1){ + if(!outOfBounds(pixel.x,pixel.y-1)){ + if(isEmpty(pixel.x,pixel.y-1)){ + createPixel("bush_cane",pixel.x,pixel.y-1); + if(pixel.fruit){ + let pixel2 = pixelMap[pixel.x][pixel.y-1]; + pixel2.fruit = pixel.fruit; + pixel2.age = pixel.age; + } + } + } + } + if(pixel.fruit && Math.floor(Math.random() * 400) == 1 && pixel.age > 200){ + for(var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x + adjacentCoords[i][0]; + let y = pixel.y + adjacentCoords[i][1]; + if(isEmpty(x,y) && !outOfBounds(x,y)){ + createPixel("fruit_leaves", x, y); + pixelMap[x][y].fruit = pixel.fruit; + pixel.blooming = trueFalse(1, 1)[Math.floor(Math.random() * 2)]; + } + } + } + pixel.age += 1; + }, + properties: { + age: 0, + }, + category: "life", + tempLow: -2, + stateLow: "frozen_plant", +} +function trueFalse(numTrue, numFalse){ + let list = []; + for(var i = 0; i < numTrue; i++){ + list.push(true); + } + for(var i = 0; i < numFalse; i++){ + list.push(false); + } + return list; +} +elements.raspberry_seed = { + color: "#ffe099", + behavior: behaviors.STURDYPOWDER, + category: "life", + properties: { + age: 0, + }, + tick: function(pixel){ + if(pixel.age > 40){ + let x1 = pixel.x - 1; + let y = pixel.y; + let x2 = pixel.x + 1; + if(isEmpty(x1,y) && !outOfBounds(x1,y)){ + createPixel("bush_base", x1, y); + pixelMap[x1][y].fruit = "raspberry"; + } + if(isEmpty(x2,y) && !outOfBounds(x2,y)){ + createPixel("bush_base", x2, y); + pixelMap[x2][y].fruit = "raspberry"; + } + if(!isEmpty(x1, y) && !isEmpty(x2, y)){ + deletePixel(pixel.x, pixel.y); + } + } + pixel.age += 1; + } +} +elements.raspberry = { + behavior: [["XX", "ST:bush_cane", "XX"],["ST:bush_cane", "XX", "ST:bush_cane"],["M2", "ST:bush_cane AND M1", "M2"]], + color: ["#b00009", "#bf000a", "#d10812", "#db1822"], + category: "food", + breakInto: "juice", + breakIntoColor: "#ff2b36", + isFood: true, + properties: { + fruit: "raspberry", + type: "fruit", + } +} +elements.blueberry_seed = { + color: "#ffe099", + behavior: behaviors.STURDYPOWDER, + category: "life", + properties: { + age: 0, + }, + tick: function(pixel){ + if(pixel.age > 40){ + let x1 = pixel.x - 1; + let y = pixel.y; + let x2 = pixel.x + 1; + if(isEmpty(x1,y) && !outOfBounds(x1,y)){ + createPixel("bush_base", x1, y); + pixelMap[x1][y].fruit = "blueberry"; + } + if(isEmpty(x2,y) && !outOfBounds(x2,y)){ + createPixel("bush_base", x2, y); + pixelMap[x2][y].fruit = "blueberry"; + } + if(!isEmpty(x1, y) && !isEmpty(x2, y)){ + deletePixel(pixel.x, pixel.y); + } + } + pixel.age += 1; + } +} +elements.blueberry = { + behavior: [["XX", "ST:bush_cane", "XX"],["ST:bush_cane", "XX", "ST:bush_cane"],["M2", "ST:bush_cane AND M1", "M2"]], + color: ["#01082b", "#060e3d", "#111b52", "#1e2866"], + category: "food", + breakInto: "juice", + breakIntoColor: "#726778", + isFood: true, + properties: { + fruit: "blueberry", + type: "fruit", + } +} +elements.blackberry_seed = { + color: "#ffe099", + behavior: behaviors.STURDYPOWDER, + category: "life", + properties: { + age: 0, + }, + tick: function(pixel){ + if(pixel.age > 40){ + let x1 = pixel.x - 1; + let y = pixel.y; + let x2 = pixel.x + 1; + if(isEmpty(x1,y) && !outOfBounds(x1,y)){ + createPixel("bush_base", x1, y); + pixelMap[x1][y].fruit = "blackberry"; + } + if(isEmpty(x2,y) && !outOfBounds(x2,y)){ + createPixel("bush_base", x2, y); + pixelMap[x2][y].fruit = "blackberry"; + } + if(!isEmpty(x1, y) && !isEmpty(x2, y)){ + deletePixel(pixel.x, pixel.y); + } + } + pixel.age += 1; + } +} +elements.blackberry = { + behavior: [["XX", "ST:bush_cane", "XX"],["ST:bush_cane", "XX", "ST:bush_cane"],["M2", "ST:bush_cane AND M1", "M2"]], + color: ["#0c0021", "#070014", "#080017", "#09001a"], + category: "food", + breakInto: "juice", + breakIntoColor: "#2e0000", + isFood: true, + properties: { + fruit: "blackberry", + type: "fruit", + } +} +elements.mango = { + behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]], + color: ["#d63a45", "#e97341", "#9d9f3e", "#e4791b"], + category: "food", + breakInto: "juice", + breakIntoColor: "#ffa300", + isFood: true, + properties: { + fruit: "mango", + type: "fruit", + } +} +elements.mango_seed = { + color: "#240c00", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") { + changePixel(dirtPixel,"root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1); + if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){ + pixelMap[pixel.x][pixel.y+1].fruit = "mango"; + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"wood"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + fruit:"mango" + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true, +}; +function conditionTrue(condition, pixel){ + let p = pixel; + let string = ""; + condition = condition.split("!OR").join("||").split("&AND").join("&&").split("\"").join("") + + condition = eval(condition); + return condition; +} +let ifCondition = ""; +let currentProp = ""; +let currentPropValue = ""; +elements.propmachine = { + name: "PropMachine", + behavior: behaviors.WALL, + category: "machines", + noMix: true, +onSelect: function(pixel) { + + let item = prompt("enter range for prop changing."); + if(/^\d+$/.test(item)){ + num4 = parseInt(item); + } else { + alert("that is not an integer."); + } + exclude2 = prompt("Enter elements to exclude, seperate them with commas. You can also enter !IF if you wish to enter conditions for it to change the property and add the exclude elements.").replace(/\s/g, ""); + if(exclude2.includes("!IF")){ + exclude2.split("!IF").join(""); + ifCondition = prompt("Enter the condition for the property to change. List of variables you can access can be found at https://5455e34a-cfe9-4576-ac9c-6e64c061433d-00-1psic9s1cgla6.kirk.replit.dev/Mods/morechemistry/conditions%20for%20if.html"); + } else { ifCondition = '1 == 1'; } + exclude2.split(","); + if(exclude2.constructor == [].constructor){ + exclude2.push("propmachine"); + } else { + exclude2 += "propmachine"; + } + var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined)); + console.log(answer1) + if (!answer1) { return } + var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined)); + if (!answer2) { return } + var valueL = answer2.toLowerCase(); + if (valueL === "true") { answer2 = true } + else if (valueL === "false") { answer2 = false } + else if (valueL === "null") { answer2 = null } + else if (valueL === "undefined") { answer2 = undefined } + else if (answer1 === "color" && valueL[0] === "#") { + var rgb = hexToRGB(valueL); + answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")"; + } + currentProp = answer1; + currentPropValue = answer2; + console.log(answer1); + var num = parseFloat(answer2); + if (!isNaN(num)) { answer2 = num } + currentPropValue = answer2; + logMessage("Prop: "+currentProp); + logMessage("Value: "+currentPropValue); +}, + tick: function(pixel) { + if(pixel.start == pixelTicks) { + pixel.range = num4; + pixel.condition = ifCondition; + pixel.prop = currentProp; + pixel.val = currentPropValue; + } + let range = mouseRange(pixel.x, pixel.y, pixel.range); + prop({ property: pixel.prop, value: pixel.val },range, exclude2, pixel.condition); + } +} +function prop(obj, range, exclude = [], condition = ""){ + let list = []; + for (var i = 0; i < range.length; i++) { + var x = range[i][0]; + var y = range[i][1]; + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + list.push(pixel); + } + } + for (var i = 0; i < list.length; i++) { + if (!isEmpty(list[i].x, list[i].y, true)) { + var pixel = list[i]; + if (!exclude.includes(pixel.element) && conditionTrue(condition, pixel)){ + if(/^\d+$/.test(obj.value)){ + obj.value = parseInt(obj.value); + } + if (!obj.property) { return } + if (pixel[obj.property] !== undefined && typeof pixel[obj.property] !== typeof obj.value) { + logMessage("Error: "+obj.property+" type is "+typeof pixel[obj.property]+", not "+typeof obj.value+"."); + obj.property = null; + obj.value = null; + return; + } + if (obj.property === "element") { + changePixel(pixel, obj.value); + list.splice(list.indexOf(pixel),1); + return; + } + if (obj.property === "burning" && obj.value === "true") { + pixel.burnStart = pixelTicks; + list.splice(list.indexOf(pixel),1); + return; + } + pixel[obj.property] = obj.value; + list.splice(list.indexOf(pixel),1); + } + } + } +} +elements.seed_maker = { + category: "machines", + behavior: behaviors.WALL, + tick: function(pixel){ + for(var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x + adjacentCoords[i][0]; + let y = pixel.y + adjacentCoords[i][1] + if(!isEmpty(x,y) && !outOfBounds(x,y)){ + let pixel2 = pixelMap[x][y]; + if(allFruits.includes(pixel2.element)){ + changePixel(pixel2, `${pixel2.element}_seed`) + } + } + } + } +} From 7872c7f76cc75e8b93069440507399e2b34115d8 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:03:31 -0600 Subject: [PATCH 12/19] Update morechemistry.js --- mods/morechemistry.js | 277 ++++++++++++++++++++++++++++++++---------- 1 file changed, 215 insertions(+), 62 deletions(-) diff --git a/mods/morechemistry.js b/mods/morechemistry.js index c220dfdf..bcbb9122 100644 --- a/mods/morechemistry.js +++ b/mods/morechemistry.js @@ -1,4 +1,4 @@ -//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. +//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. function pixelInRange(pixel, range){ let i = 0; while (i < range.length) { @@ -635,11 +635,6 @@ elements.potassiumhydroxidecrystals = { density: 2040, name: "PotassiumHydroxideCrystals", } -elements.supercooler = { - name: "SuperCooler", - category: "machines" -} -elements.supercooler.behavior = [["XX","CO:10","XX"],["CO:10","XX","CO:10"],["XX","CO:10","XX"]] elements.iron_chloride = { color: ["#010014", "#a2ff94"], reactions: { @@ -695,7 +690,7 @@ elements.kilonova = { temp: 100000000, } elements.supernova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:80>plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,oxygen,molten_sodium,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium AND CH:NeutronStar", "XX" ], ["XX", "XX", "XX"] ] -elements.kilonova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:200>plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,molten_lead,oxygen,molten_sodium,molten_gold,molten_tungsten,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium,helium AND CH:void", "XX" ], ["XX", "XX", "XX"] ] +elements.kilonova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:200>plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,molten_lead,oxygen,molten_sodium,molten_gold,molten_tungsten,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium,helium AND CH:void", "XX" ], ["XX", "XX", "XX"] ] elements.NeutronStar = { behavior: [["XX", "XX", "XX"], ["CR:light", "XX", "CR:light"], ["XX", "XX", "XX"]], name: "NeutronStar", @@ -1057,52 +1052,12 @@ elements.specialmixer = { mix(range, exclude); } } + let num4 = 0; let exclude2 = []; let property1 = ""; let value2 = ""; -elements.propmachine = { - name: "PropMachine", - behavior: behaviors.WALL, - category: "machines", - noMix: true, - onSelect: function(pixel) { - let item = prompt("enter range for prop changing."); - if(/^\d+$/.test(item)){ - num4 = parseInt(item); - } else { - alert("that is not an integer."); - } - exclude2 = prompt("Enter elements to exclude, seperate them with commas.").replace(/\s/g, "").split(","); - exclude2.push("propmachine"); - var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined)); - if (!answer1) { return } - var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined)); - if (!answer2) { return } - var valueL = answer2.toLowerCase(); - if (valueL === "true") { answer2 = true } - else if (valueL === "false") { answer2 = false } - else if (valueL === "null") { answer2 = null } - else if (valueL === "undefined") { answer2 = undefined } - else if (answer1 === "color" && valueL[0] === "#") { - var rgb = hexToRGB(valueL); - answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")"; - } - currentProp = answer1; - var num = parseFloat(answer2); - if (!isNaN(num)) { answer2 = num } - currentPropValue = answer2; - logMessage("Prop: "+currentProp); - logMessage("Value: "+currentPropValue); - }, - tick: function(pixel) { - if(pixel.start == pixelTicks) { - pixel.range = num4; - } - let range = mouseRange(pixel.x, pixel.y, pixel.range); - prop({ property: property1, value: value2 },range, exclude2); - } - } + let item = ""; elements.improvedsensor = { behavior: behaviors.WALL, @@ -1196,30 +1151,111 @@ elements.incinerator = { color: 'rgb(255, 50, 0)', noMix: true, } -function prop(obj, range, exclude = []){ +function conditionTrue(condition, pixel){ + let p = pixel; + let string = ""; + condition = condition.split("!OR").join("||").split("&AND").join("&&").split("\"").join("") + + condition = eval(condition); + return condition; +} +let ifCondition = ""; +let currentProp = ""; +let currentPropValue = ""; +elements.propmachine = { + name: "PropMachine", + behavior: behaviors.WALL, + category: "machines", + noMix: true, +onSelect: function(pixel) { + + let item = prompt("enter range for prop changing."); + if(/^\d+$/.test(item)){ + num4 = parseInt(item); + } else { + alert("that is not an integer."); + } + exclude2 = prompt("Enter elements to exclude, seperate them with commas. You can also enter !IF if you wish to enter conditions for it to change the property and add the exclude elements.").replace(/\s/g, ""); + if(exclude2.includes("!IF")){ + exclude2.split("!IF").join(""); + ifCondition = prompt("Enter the condition for the property to change. A list of variables can be seen at the bottom of the page. you cannot use \"\" but you can use `` and ''."); + } else { ifCondition = '1 == 1'; } + exclude2.split(","); + if(exclude2.constructor == [].constructor){ + exclude2.push("propmachine"); + } else { + exclude2 += "propmachine"; + } + var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined)); + console.log(answer1) + if (!answer1) { return } + var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined)); + if (!answer2) { return } + var valueL = answer2.toLowerCase(); + if (valueL === "true") { answer2 = true } + else if (valueL === "false") { answer2 = false } + else if (valueL === "null") { answer2 = null } + else if (valueL === "undefined") { answer2 = undefined } + else if (answer1 === "color" && valueL[0] === "#") { + var rgb = hexToRGB(valueL); + answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")"; + } + currentProp = answer1; + currentPropValue = answer2; + console.log(answer1); + var num = parseFloat(answer2); + if (!isNaN(num)) { answer2 = num } + currentPropValue = answer2; + logMessage("Prop: "+currentProp); + logMessage("Value: "+currentPropValue); +}, + tick: function(pixel) { + if(pixel.start == pixelTicks) { + pixel.range = num4; + pixel.condition = ifCondition; + pixel.prop = currentProp; + pixel.val = currentPropValue; + } + let range = mouseRange(pixel.x, pixel.y, pixel.range); + prop({ property: pixel.prop, value: pixel.val },range, exclude2, pixel.condition); + } +} +function prop(obj, range, exclude = [], condition = ""){ + let list = []; for (var i = 0; i < range.length; i++) { - if (!isEmpty(range[i][0], range[i][1], true)) { - var pixel = pixelMap[range[i][0]][range[i][1]]; - if (!exclude.includes(pixel.element)){ + var x = range[i][0]; + var y = range[i][1]; + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + list.push(pixel); + } + } + for (var i = 0; i < list.length; i++) { + if (!isEmpty(list[i].x, list[i].y, true)) { + var pixel = list[i]; + if (!exclude.includes(pixel.element) && conditionTrue(condition, pixel)){ if(/^\d+$/.test(obj.value)){ obj.value = parseInt(obj.value); } - if (!currentProp) { return } - if (pixel[currentProp] !== undefined && typeof pixel[currentProp] !== typeof currentPropValue) { - logMessage("Error: "+currentProp+" type is "+typeof pixel[currentProp]+", not "+typeof currentPropValue+"."); - currentProp = null; - currentPropValue = null; + if (!obj.property) { return } + if (pixel[obj.property] !== undefined && typeof pixel[obj.property] !== typeof obj.value) { + logMessage("Error: "+obj.property+" type is "+typeof pixel[obj.property]+", not "+typeof obj.value+"."); + obj.property = null; + obj.value = null; return; } - if (currentProp === "element") { - changePixel(pixel, currentPropValue); + if (obj.property === "element") { + changePixel(pixel, obj.value); + list.splice(list.indexOf(pixel),1); return; } - if (currentProp === "burning" && currentPropValue === "true") { + if (obj.property === "burning" && obj.value === "true") { pixel.burnStart = pixelTicks; + list.splice(list.indexOf(pixel),1); return; } - pixel[currentProp] = currentPropValue; + pixel[obj.property] = obj.value; + list.splice(list.indexOf(pixel),1); } } } @@ -1307,3 +1343,120 @@ function pull(range, pixel1, include = []){ } } } + +let prevNum; +elements.etemper = { + name: "E-Temper", + category: "machines", + conduct: 1, + insulate: true, + behavior: behaviors.WALL, + onSelect: function(pixel){ + prevNum = parseInt(prompt("Enter the temperature you want it set to.", (prevNum || undefined))); + }, + tick: function(pixel){ + if(pixel.start === pixelTicks){ + pixel.clone = `Temp: ${prevNum}`; + pixel.Temp = prevNum; + } + for (var i = 0; i < adjacentCoords.length; i++){ + let x = pixel.x + adjacentCoords[i][0]; + let y = pixel.y + adjacentCoords[i][1]; + if(outOfBounds(x,y)){ continue; } + if(isEmpty(x,y)){ continue; } + let pixel2 = pixelMap[x][y]; + + if (pixel2.temp < pixel.Temp && pixel.charge > 0 ){ + pixel2.temp += pixel.Temp / 6; + } + + } + }, +} +let prevString; +elements.sign = { + name: "Sign", + category: "machines", + onSelect: function(){ + prevString = prompt("Enter the text you want it to say.", (prevString || undefined)); + }, + tick: function(pixel){ + if(pixel.start == pixelTicks){ + pixel.clone = prevString; + } + } +} +document.body.innerHTML += ` +these are all properties of the pixel. another way to find pixel properties is using debug on a pixel, it will tell you the property and the value, like x and y, or, in plants.js, fruit. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Variable + + Definition +
+ p.color + + The color of the pixel. it is defined as an RGB value. +
+ p.x and p.y + + The x and y positions of the pixel. +
+ p.element + + The element of the pixel. +
+ p.clone + + Specific to cloners, specifies what the cloner clones. +
+ wc and lc + + Specific to saplings, specifies what colour the wood is (wc) and what colour the leaves are (lc). +
+ p.start + + The start tick of the pixel. +
+ p.tick + + the amount of ticks that have happened so far in the game. +
+` +document.getElementById("extraInfo").innerHTML = ` +Changelog(NEW)FeedbackWikiRedditDiscord • Install OfflineVariables

v1.9.3 • 559 elements, with 0 hidden.

©2021-2024. All Rights Reserved.

+` From 4b19b0bedf0acb8aea7bf7642f9facd557eb19a6 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:04:12 -0600 Subject: [PATCH 13/19] Update allliquids.js --- mods/allliquids.js | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/mods/allliquids.js b/mods/allliquids.js index ae92e535..80a6bfd1 100644 --- a/mods/allliquids.js +++ b/mods/allliquids.js @@ -1,21 +1,24 @@ +//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. let liquid = [["XX", "XX", "XX"], ["M1", "XX", "M1"], ["M1", "M2", "M1"]] -for (var element in elements){ - - let a = elements[element].behavior; - console.log(a, elements[element], liquid) - if(a != undefined && typeof a != 'function'){ - let i = 0; - while (i < a.length){ - if(typeof a[i] == "string"){ - a[i] = a[i].split("|"); - i += 1; - } else { - i += 1; +runAfterLoad(function(){ + for (var element in elements){ + elements[element].noMix = false; + let a = elements[element].behavior; + console.log(a, elements[element], liquid) + if(a != undefined && typeof a != 'function'){ + let i = 0; + while (i < a.length){ + if(typeof a[i] == "string"){ + a[i] = a[i].split("|"); + i += 1; + } else { + i += 1; + } } + elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]]; + } else { + elements[element].behavior = liquid; } - elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]]; - } else { - elements[element].behavior = liquid; + } - -} +}); From aad1b147125998fc4ca1f1f35485c0bd5b18cd78 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:14:22 -0600 Subject: [PATCH 14/19] Update mod-list.html --- mod-list.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod-list.html b/mod-list.html index ec35b37d..fb909973 100644 --- a/mod-list.html +++ b/mod-list.html @@ -117,7 +117,7 @@ Tools & Settings adjustablepixelsize.jsAllows you to set the pixelSize with a URL parameterAlice -betaworldgen.jsadds a more advanced world generation to the gameAlex +betaworldgen.jsadds a more advanced world generation to the gameAdora betterModManager.jsImprovements to the Mod Managerggod betterSettings.jsAdds additional settings and functionalityggod betterStats.jsSeparate “real” and “set” TPS, meaning you can see what the TPS actually is, instead of only seeing what it’s set tomollthecoder @@ -168,7 +168,7 @@ metals.jsAdds several metalsAlice mixture.jsAllows many chemicals to be mixedlllllllllwith10ls more_gold.jsAdds Green Goldpixelegend4 -morechemistry.jsAdds many new chemicals and compounds as well as some new machinesAlex +morechemistry.jsAdds many new chemicals and compounds as well as some new machinesAdora moreliquids.jsAdds various liquidste-agma-at nellfire.jsAdds a weird transforming flame and several rock typesAlice Neutronium Mod.jsVariety of scientific elements
ExplosionsStellarX20 @@ -235,6 +235,7 @@ nocancer2.jsRemoves cancer from the game altogether. May be incompatible with other mods that spawn cancermollthecoder nograssgrow.jsPrevents Grass from growingmollthecoder pizzasstuff.jsNew animals, foods, and plants_ilikepizza_ +plants.jsAdds a wide variety of new plants and fruitsAdora primordial_birthpool.jsA cross between Primordial Soup and Birthpool. Requires F&MAlice spring.jsMany nature elements, like sakura trees, butterflies, beehives, and moreR74n the_ground_og.jsSimplified and more stable version of the_ground.jsAlice @@ -244,7 +245,7 @@ Fun & Games all_around_fillers.jsAdds directional Filler variantsidk73248 -allliquids.jsMade all elements liquidsAlex +allliquids.jsMade all elements liquidsAdora amogus.jsAdds a small amogus structureAlice collab_mod.jsCreated by multiple people, adds random thingsmrapple, ilikepizza, stefanblox elem3.jsAdds all elements and combinations from Elemental 3 [Very Large]Sophie From 99ef7f15862f35c93c04e26f00a7716b9bdb0b2f Mon Sep 17 00:00:00 2001 From: sb <155691462+stefanblox@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:50:26 -0300 Subject: [PATCH 15/19] sbstuff 2.7 unstain --- mods/sbstuff.js | 62 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/mods/sbstuff.js b/mods/sbstuff.js index bf7f4d1e..41ee6af0 100644 --- a/mods/sbstuff.js +++ b/mods/sbstuff.js @@ -3,7 +3,7 @@ elements.cooked_rice = { tempMin: 20, stateMin: "rice", tempHigh: 500, - stateHigh: ["ash", "charcoal"], + stateHigh: "charcoal", density: 699, color: "#c2b6b6", behavior: behaviors.LIQUID, @@ -16,37 +16,39 @@ elements.cooked_rice = { elements.rice = { breakInto: "flour", - viscosity: 10000, isFood: true, density: 696, tempHigh: 232, stateHigh: "cooked_rice", color: "#c8c8c8", - behavior: behaviors.LIQUID, + behavior: behaviors.POWDER, category: "food", state: "liquid", }; elements.moth = { tempHigh: 500, - stateHigh: "ash", + stateHigh: "dead_bug", + breakInto: "dead_bug", color: "#57381a", behavior: behaviors.FLY, category: "life", - state: "solid", + state: "liquid", }; elements.cotton_candy = { isFood: true, - tempHigh: 500, - stateHigh: "ash", + tempHigh: 200, + stateHigh: "sugar", density: 1000, - color: "#b6c7e3", + color: ["#b6c7e3", "#c54b4b", "#e7769c"], + singleColor: true, behavior: behaviors.POWDER, category: "food", state: "liquid", reactions: { - "water": { elem1: "sugar", elem2: null }, + "water": { elem1: "sugar", elem2: "water" }, + "sugar_water": { elem1: "sugar", elem2:"sugar_water", chance: 10 } } }; @@ -358,6 +360,7 @@ elements.cereal = { behavior: behaviors.STURDYPOWDER, category: "food", state: "liquid", + stain: 0.005 }; elements.sushi = { @@ -1692,6 +1695,47 @@ elements.liquid_filler = { state: "liquid" }; +elements.antimony = { + color: ["#4b90b8", "#a3bfd8", "#89a0b6", "#8798a7", "#738092"], + behavior: behaviors.WALL, + category: "solids", + state: "solid", + density: 6697, + tempHigh: 630, + stateHigh: "melted_antimony", + alias: "...sb?!" +}; + +elements.melted_antimony = { + color: ["#8fb2c7", "#7494b1", "#72a1cc", "#a3aaaf", "#a4aab3"], + behavior: behaviors.LIQUID, + category: "liquids", + state: "liquid", + density: 6697, + stain: 0.1, + tempLow: -270, + stateLowName: "antimony_ice" +}; + +elements.unstain = { + color: "#729fff", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX" + ], + stain: -1, + tool: (pixel) => { + doStaining({ + element: "unstain", + x: pixel.x, + y: pixel.y + }) + }, + category: "tools", + state: "solid", +}; + elements.incinerate.category = "tools", elements.cook.category = "tools", elements.room_temp.category = "tools", From 46f34c6e85c6d27959172722a808c7d78ca60f14 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:52:06 -0500 Subject: [PATCH 16/19] jaydstuff.js release --- mods/jaydstuff.js | 286 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 mods/jaydstuff.js diff --git a/mods/jaydstuff.js b/mods/jaydstuff.js new file mode 100644 index 00000000..75c752bb --- /dev/null +++ b/mods/jaydstuff.js @@ -0,0 +1,286 @@ +//jaydstuff +elements.super_raincloud = { + color: "#0000ff", + behavior: [ + "XX|M1%10|XX", + "M1%5|XX|M1%5", + "CR:water%40|CR:water%40|CR:water%40", + ], + category: "gases", + state: "gas", + density: 50, +}, +elements.deuterium = { + color: "#558bcf", + behavior: behaviors.GAS, + reactions: { + "oxygen": { elem1:null, elem2:"heavy_steam", tempMin:500 }, + "tritium": { elem1:"neutron", elem2:"helium", tempMin:100000000, temp1:150000000, temp2:150000000 }, + "fire": { elem1:"explosion", chance:0.005 }, + }, + category: "gases", + burn: 100, + burnTime: 2, + burnInto: ["fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","heavy_steam"], + tempLow: -253, + stateLow: "liquid_deuterium", + state: "gas", + density: 0.180, + conduct: 0.02, + colorOn: "#d6462d" +}, +elements.liquid_deuterium = { + color: "#97afcf", + behavior: behaviors.LIQUID, + reactions: { + "liquid_oxygen": { elem1:"heavy_ice", elem2:null }, + "oxygen": { elem1:"ice", elem2:null } + }, + category: "states", + burn: 100, + burnTime: 2, + temp: -255.879, + tempHigh: -252.879, + stateHigh: "hydrogen", + tempLow: -259.2, + state: "liquid", + density: 163.83, + hidden: true +}, +elements.tritium = { + color: "#558bcf", + behavior: [ + "M2|M1 AND CR:radiation%1|M2", + "M1|XX|M1", + "M2|M1 AND CR:radiation%0.5|M2", + ], + reactions: { + "oxygen": { elem1:null, elem2:"tritiated_steam", tempMin:500 }, + "deuterium": { elem1:"neutron", elem2:"helium", tempMin:100000000, temp1:150000000, temp2:150000000 }, + "fire": { elem1:"explosion", chance:0.005 }, + }, + category: "gases", + burn: 100, + burnTime: 2, + burnInto: ["fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","steam"], + tempLow: -253, + stateLow: "liquid_tritium", + state: "gas", + density: 0.269, + conduct: 0.02, + colorOn: "#d6462d" +}, +elements.liquid_tritium = { + color: "#97afcf", + behavior: [ + "XX|CR:radiation%1|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + reactions: { + "liquid_oxygen": { elem1:"tritiated_ice", elem2:null }, + "oxygen": { elem1:"ice", elem2:null } + }, + category: "states", + burn: 100, + burnTime: 2, + temp: -255.879, + tempHigh: -252.879, + stateHigh: "tritium", + tempLow: -259.2, + state: "liquid", + density: 213, + hidden: true +}, +elements.heavy_water = { + color: "#2167ff", + behavior: behaviors.LIQUID, + tempHigh: 101.4, + stateHigh: "heavy_steam", + tempLow: 0, + stateLow: "heavy_ice", + category: "liquids", + heatCapacity: 4.184, + reactions: { + // electrolysis: + "aluminum": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0025 }, + "zinc": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.015 }, + "steel": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 }, + "iron": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 }, + "tin": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.01 }, + "brass": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 }, + "bronze": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 }, + "copper": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + "silver": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + "gold": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + }, + state: "liquid", + density: 1107, + conduct: 0.02, + stain: -0.5, + extinguish: true +}, +elements.heavy_steam = { + color: "#abd6ff", + behavior: behaviors.GAS, + reactions: { + "copper": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.01 }, + "bronze": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.005 }, + "iron": { elem1:"oxygen", elem2:"rust", chance:0.005 }, + "steel": { elem1:"oxygen", elem2:"rust", chance:0.004 }, + }, + temp: 150, + tempLow: 95, + extraTempLow: { + 0: "heavy_rime" + }, + stateLow: "heavy_water", + category: "gases", + state: "gas", + density: 1, + conduct: 0.002, + stain: -0.05, + alias: "heavy water vapor", + extinguish: true +}, +elements.heavy_ice = { + color: "#b2daeb", + behavior: behaviors.WALL, + temp: -5, + tempHigh: 5, + stateHigh: "heavy_water", + category: "solids", + state: "solid", + density: 1014.202, + breakInto: "heavy_snow" +}, +elements.tritiated_water = { + color: "#2167ff", + behavior: [ + "XX|CR:radiation%1|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + tempHigh: 101.4, + stateHigh: "tritiated_steam", + tempLow: 0, + stateLow: "tritiated_ice", + category: "liquids", + heatCapacity: 4.184, + reactions: { + // electrolysis: + "aluminum": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0025 }, + "zinc": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.015 }, + "steel": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 }, + "iron": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 }, + "tin": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.01 }, + "brass": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 }, + "bronze": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 }, + "copper": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + "silver": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + "gold": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 }, + }, + state: "liquid", + density: 1107, + conduct: 0.02, + stain: -0.5, + extinguish: true +}, +elements.tritiated_steam = { + color: "#abd6ff", + behavior: [ + "M2|M1 AND CR:radiation%1|M2", + "M1|XX|M1", + "M2|M1 AND CR:radiation%0.5|M2", + ], + reactions: { + "copper": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.01 }, + "bronze": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.005 }, + "iron": { elem1:"oxygen", elem2:"rust", chance:0.005 }, + "steel": { elem1:"oxygen", elem2:"rust", chance:0.004 }, + }, + temp: 150, + tempLow: 95, + extraTempLow: { + 0: "heavy_rime" + }, + stateLow: "tritiated_water", + category: "gases", + state: "gas", + density: 0.6, + conduct: 0.002, + stain: -0.05, + alias: "tritiated water vapor", + extinguish: true +}, +elements.tritiated_ice = { + color: "#b2daeb", + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "XX|CR:radiation%0.25|XX", + ], + temp: -5, + tempHigh: 5, + stateHigh: "tritiated_water", + category: "solids", + state: "solid", + density: 1014.202, + breakInto: "tritiated_snow" +}, +elements.fusion = { + color: "#ffffff", + tool: function(pixel) { + pixel.temp = 100000000; + pixelTempCheck(pixel) + }, + category: "tools", +}, +elements.meese = { + color: "#996515", + behavior: [ + "XX|XX|XX", + "XX|FX%0.25|M2%0.5 AND BO", + "XX|M1|XX", + ], + category: "life" +}, +elements.fluoroantimonic_acid = { + color: ["#b5cf91","#a1ff5e","#288f2a"], + behavior: [ + "XX|DB%5|XX", + "DB%5 AND M2|XX|DB%5 AND M2", + "DB%5 AND M2|DB%10 AND M1|DB%5 AND M2", + ], + ignore: ["glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","copper","gold","porcelain"], + category: "liquids", + state: "liquid", + density: 2885, + hidden: true, + stain: -0.1, +}, +elements.tritium_ice = { + color: "#b5d2ff", + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "XX|CR:radiation%0.25|XX", + ], + temp: -259, + tempHigh: -256, + stateHigh: "liquid_tritium", + category: "states", + state: "solid", + density: 258, +}, +elements.unstain = { + category: "tools", + stain: -1, + tool: (pixel) => { + doStaining({ + element: "unstain", + x: pixel.x, + y: pixel.y + }) + } +}; \ No newline at end of file From ec6ddaa176156996287050918353b0ca681611aa Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:00:20 -0600 Subject: [PATCH 17/19] Update plants.js --- mods/plants.js | 109 ------------------------------------------------- 1 file changed, 109 deletions(-) diff --git a/mods/plants.js b/mods/plants.js index dd304907..23a68e1b 100644 --- a/mods/plants.js +++ b/mods/plants.js @@ -1063,115 +1063,6 @@ elements.mango_seed = { cooldown: defaultCooldown, seed: true, }; -function conditionTrue(condition, pixel){ - let p = pixel; - let string = ""; - condition = condition.split("!OR").join("||").split("&AND").join("&&").split("\"").join("") - - condition = eval(condition); - return condition; -} -let ifCondition = ""; -let currentProp = ""; -let currentPropValue = ""; -elements.propmachine = { - name: "PropMachine", - behavior: behaviors.WALL, - category: "machines", - noMix: true, -onSelect: function(pixel) { - - let item = prompt("enter range for prop changing."); - if(/^\d+$/.test(item)){ - num4 = parseInt(item); - } else { - alert("that is not an integer."); - } - exclude2 = prompt("Enter elements to exclude, seperate them with commas. You can also enter !IF if you wish to enter conditions for it to change the property and add the exclude elements.").replace(/\s/g, ""); - if(exclude2.includes("!IF")){ - exclude2.split("!IF").join(""); - ifCondition = prompt("Enter the condition for the property to change. List of variables you can access can be found at https://5455e34a-cfe9-4576-ac9c-6e64c061433d-00-1psic9s1cgla6.kirk.replit.dev/Mods/morechemistry/conditions%20for%20if.html"); - } else { ifCondition = '1 == 1'; } - exclude2.split(","); - if(exclude2.constructor == [].constructor){ - exclude2.push("propmachine"); - } else { - exclude2 += "propmachine"; - } - var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined)); - console.log(answer1) - if (!answer1) { return } - var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined)); - if (!answer2) { return } - var valueL = answer2.toLowerCase(); - if (valueL === "true") { answer2 = true } - else if (valueL === "false") { answer2 = false } - else if (valueL === "null") { answer2 = null } - else if (valueL === "undefined") { answer2 = undefined } - else if (answer1 === "color" && valueL[0] === "#") { - var rgb = hexToRGB(valueL); - answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")"; - } - currentProp = answer1; - currentPropValue = answer2; - console.log(answer1); - var num = parseFloat(answer2); - if (!isNaN(num)) { answer2 = num } - currentPropValue = answer2; - logMessage("Prop: "+currentProp); - logMessage("Value: "+currentPropValue); -}, - tick: function(pixel) { - if(pixel.start == pixelTicks) { - pixel.range = num4; - pixel.condition = ifCondition; - pixel.prop = currentProp; - pixel.val = currentPropValue; - } - let range = mouseRange(pixel.x, pixel.y, pixel.range); - prop({ property: pixel.prop, value: pixel.val },range, exclude2, pixel.condition); - } -} -function prop(obj, range, exclude = [], condition = ""){ - let list = []; - for (var i = 0; i < range.length; i++) { - var x = range[i][0]; - var y = range[i][1]; - if (!isEmpty(x,y,true)) { - var pixel = pixelMap[x][y]; - list.push(pixel); - } - } - for (var i = 0; i < list.length; i++) { - if (!isEmpty(list[i].x, list[i].y, true)) { - var pixel = list[i]; - if (!exclude.includes(pixel.element) && conditionTrue(condition, pixel)){ - if(/^\d+$/.test(obj.value)){ - obj.value = parseInt(obj.value); - } - if (!obj.property) { return } - if (pixel[obj.property] !== undefined && typeof pixel[obj.property] !== typeof obj.value) { - logMessage("Error: "+obj.property+" type is "+typeof pixel[obj.property]+", not "+typeof obj.value+"."); - obj.property = null; - obj.value = null; - return; - } - if (obj.property === "element") { - changePixel(pixel, obj.value); - list.splice(list.indexOf(pixel),1); - return; - } - if (obj.property === "burning" && obj.value === "true") { - pixel.burnStart = pixelTicks; - list.splice(list.indexOf(pixel),1); - return; - } - pixel[obj.property] = obj.value; - list.splice(list.indexOf(pixel),1); - } - } - } -} elements.seed_maker = { category: "machines", behavior: behaviors.WALL, From 881483a9da755b9cb7e9c28e5fb95b8f31cffb31 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:12:08 -0600 Subject: [PATCH 18/19] Update morechemistry.js --- mods/morechemistry.js | 140 +++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/mods/morechemistry.js b/mods/morechemistry.js index bcbb9122..ef6b8dd9 100644 --- a/mods/morechemistry.js +++ b/mods/morechemistry.js @@ -1386,77 +1386,79 @@ elements.sign = { } } } -document.body.innerHTML += ` -these are all properties of the pixel. another way to find pixel properties is using debug on a pixel, it will tell you the property and the value, like x and y, or, in plants.js, fruit. - - - +runAfterLoad(function(){ + document.body.innerHTML += ` + these are all properties of the pixel. another way to find pixel properties is using debug on a pixel, it will tell you the property and the value, like x and y, or, in plants.js, fruit. +
+ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Variable + + Definition +
- Variable + p.color - Definition + The color of the pixel. it is defined as an RGB value.
- p.color - - The color of the pixel. it is defined as an RGB value. -
- p.x and p.y - - The x and y positions of the pixel. -
- p.element - - The element of the pixel. -
- p.clone - - Specific to cloners, specifies what the cloner clones. -
- wc and lc - - Specific to saplings, specifies what colour the wood is (wc) and what colour the leaves are (lc). -
- p.start - - The start tick of the pixel. -
- p.tick - - the amount of ticks that have happened so far in the game. -
-` -document.getElementById("extraInfo").innerHTML = ` -Changelog(NEW)FeedbackWikiRedditDiscord • Install OfflineVariables

v1.9.3 • 559 elements, with 0 hidden.

©2021-2024. All Rights Reserved.

-` + + + p.x and p.y + + + The x and y positions of the pixel. + + + + + p.element + + + The element of the pixel. + + + + + p.clone + + + Specific to cloners, specifies what the cloner clones. + + + + + wc and lc + + + Specific to saplings, specifies what colour the wood is (wc) and what colour the leaves are (lc). + + + + + p.start + + + The start tick of the pixel. + + + + + p.tick + + + the amount of ticks that have happened so far in the game. + + + + ` + document.getElementById("extraInfo").innerHTML = ` + Changelog(NEW)FeedbackWikiRedditDiscord • Install OfflineVariables

v1.9.3 • 559 elements, with 0 hidden.

©2021-2024. All Rights Reserved.

+ ` +} From a55f376ba6523a5cf3b99735480c03756ba941cb Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:32:49 -0600 Subject: [PATCH 19/19] Update morechemistry.js --- mods/morechemistry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/morechemistry.js b/mods/morechemistry.js index ef6b8dd9..3549e61b 100644 --- a/mods/morechemistry.js +++ b/mods/morechemistry.js @@ -1461,4 +1461,4 @@ runAfterLoad(function(){ document.getElementById("extraInfo").innerHTML = ` Changelog(NEW)FeedbackWikiRedditDiscord • Install OfflineVariables

v1.9.3 • 559 elements, with 0 hidden.

©2021-2024. All Rights Reserved.

` -} +});