From 20dd2adb3e9257dde12c09c7a02146000cbbe486 Mon Sep 17 00:00:00 2001 From: lllllllllwith10ls <38187754+lllllllllwith10ls@users.noreply.github.com> Date: Thu, 18 Jan 2024 19:04:23 -0600 Subject: [PATCH 01/67] pressure update --- mods/pressure.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mods/pressure.js b/mods/pressure.js index 09861474..5453439e 100644 --- a/mods/pressure.js +++ b/mods/pressure.js @@ -231,6 +231,23 @@ drawPixels = function(forceTick=false) { 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++}; } From d17940e18775fe781fcaf1a657944107cb14d35f Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 5 Apr 2024 08:19:49 +0800 Subject: [PATCH 02/67] Update aChefsDream.js --- mods/aChefsDream.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index c8a2039e..34d9342b 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -7099,12 +7099,14 @@ elements.food_coloring = { pixelMap[x][y].color = `rgb(${parseInt(newrgb2.r)},${parseInt(newrgb2.g)},${parseInt(newrgb2.b)})`; if (Math.random() < 0.002) { deletePixel(pixel.x,pixel.y) + break } } } } } } + doDefaults(pixel) }, onSelect: function () { logMessage("Tip: You can spread food coloring using water."); From 09c557e75853fb1d67451a1e507c48c9880e300c Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:18:58 +0800 Subject: [PATCH 03/67] Update mod-list.html --- mod-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index ddfd8508..1c428dca 100644 --- a/mod-list.html +++ b/mod-list.html @@ -218,7 +218,7 @@ weapons.jsAdds some extra weaponsJayd Food & Cooking -aChefsDream.jsAdds more foods, animals, tools and many other cooking related itemsSquareScreamYT, RealerRaddler +aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYT, RealerRaddler bananas.jsAdds bananas and banana plantsAlice greenitemsandmore.jsAdds various green things, including apples and more foodzonneschijn7 ketchup_mod.jsAdds a bunch of ketchup related stuff, plus a few other condimentsNubo318 (main dev), Devi, Alice (contributors) From 1126e180c95b97dcf8a4074cba9920b55e4855c6 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:37:18 +0800 Subject: [PATCH 04/67] i spent 2 hours making beef and duck before wooper --- mods/aChefsDream.js | 538 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 521 insertions(+), 17 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 34d9342b..a7286eb9 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,20 +1,21 @@ /* Created by SquareScreamYT/sqec <@918475812884344852> Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696>, ryan(R74n) <@101070932608561152> and Fioushemastor <@738828785482203189> for helping :) -Compatibility with other mods coming soon! s +Compatibility with plants.js coming soon +Works well with community_desserts.js -v1.12.4 +v1.13 you can support me at my youtube: https://youtube.com/@sqec Upcoming Features: +- extract tool - cinnamon - spring onions - white rice noodles - matcha leaves, powder, tea - cacao pods - more chocolate, cocoa powder, white chocolate, cocoa butter -- agar (makes juice into jelly) - pigs, ham and bacon - garlic - stainless steel @@ -35,7 +36,6 @@ Upcoming Features: - peaches - cucumbers - eggplants -- food coloring - crabs (they eat coconuts) - squids - tofu @@ -43,9 +43,6 @@ Upcoming Features: - juice reaction with milk makes average color - juice reaction with other juices - jackfruit -- barbecueing meats -- bbq sauce -- mustard Changelog (v1.0) - added chickens @@ -419,6 +416,30 @@ Changelog (v1.12.4) +Changelog (v1.13) + - added cracker and cracker dough + - added barbecue sauce + - added mustard + - added agar + - added barbecued chicken + - tweaked grape juice color + - added duck + - added duckling + - added duck eggs and frozen duck eggs + - added raw duck and cooked duck + - added fried duck + - added boiled duck + - added barbecued duck + - added smoked duck + - added steamed duck + - added cows + - added calves + - added steak and beef + - added smoked steak and barbecued steak + + + + */ /* @@ -745,6 +766,45 @@ elements.chick = { } }; +elements.barbecued_chicken = { + color:["#bf743b", "#b57026","#8f5e29","#a87b11"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.barbecue_sauce = { + color: "#571e1A", + behavior: behaviors.LIQUID, + viscosity: 50000, + tempHigh: 260, + stateHigh: ["carbon_dioxide","methane","steam","salt","sugar"], + category:"food", + state: "liquid", + density: 1235, + stain: 0.05, + isFood: true, +} +if (!elements.ketchup.reactions) { elements.ketchup.reactions = {}; } +elements.ketchup.reactions.molasses = { elem1:"barbecue_sauce", elem2:"barbecue_sauce" } + +elements.mustard = { + color: "#e1ad01", + behavior: behaviors.LIQUID, + viscosity: 50000, + tempHigh: 260, + stateHigh: ["carbon_dioxide","methane","steam","sugar"], + category:"food", + state: "liquid", + density: 1235, + stain: 0.05, + isFood: true +} + elements.soup = { color: "#fbd189", behavior: behaviors.LIQUID, @@ -830,8 +890,8 @@ elements.battered_raw_chicken = { category: "food", state: "solid", temp:25, - tempHigh: 600, - stateHigh: ["ash","smoke"], + tempHigh: 125, + stateHigh: "cooked_chicken", reactions: { "crumb": { elem1: "raw_chicken_nugget", elem2: null }, }, @@ -918,7 +978,9 @@ elements.raw_chicken = { "smoke": {elem1: "smoked_chicken"}, "steam": {elem1: "steamed_chicken"}, "water": {elem1: "boiled_chicken", tempMin: 70}, - "nut_oil": {elem1: "fried_chicken", tempMin: 70} + "nut_oil": {elem1: "fried_chicken", tempMin: 70}, + "charcoal": {elem1: "barbecued_chicken", tempMin: 70}, + "fire": {elem1: "barbecued_chicken"} } }; @@ -2100,13 +2162,13 @@ eLists.JUICEMIXABLE.push("watermelon_juice"); elements.grape.breakInto = "grape_juice", elements.grape_juice = { - color: "#6d2282", + color: "#291824", behavior: behaviors.LIQUID, onMix: function(pixel) { if (shiftDown) { if (Math.random() < 0.2) { changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel, "#6d2282") + pixel.color = pixelColorPick(pixel, "#291824") } } }, @@ -3054,8 +3116,8 @@ elements.corn_starch = { "seltzer": { elem1: "dough", elem2: null }, "pool_water": { elem1: "dough", elem2: null }, "juice": { elem1: "dough", elem2: null }, - "yolk": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" }, - "yogurt": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" }, + "yolk": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, + "yogurt": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, "broth": { elem1:"dough", elem2:null }, "soda": { elem1:"dough", elem2:null }, "tea": { elem1:"dough", elem2:null }, @@ -5695,6 +5757,7 @@ elements.seaweed_stem = { "alcohol": { elem1:"dead_plant", elem2:null, chance:0.035 }, "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, "stench": { elem2:null, chance:0.25 }, + "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, }, category:"life", tempHigh: 100, @@ -5721,6 +5784,7 @@ elements.seaweed = { "alcohol": { elem1:"dead_plant", elem2:null, chance:0.035 }, "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, "stench": { elem2:null, chance:0.25 }, + "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, }, category:"food", tempHigh: 100, @@ -7080,7 +7144,7 @@ elements.food_coloring = { stainSelf: true, ignore: ["glass", "porcelain", "wall","iron","steel","copper","silver","aluminum","tungsten","gold","plastic"], desc: "coloring for food. color may fade when diluting with water.", - tick: function (pixel) { + onMix: function (pixel) { for (var i = 0; i < squareCoords.length; i++) { var coord = squareCoords[i]; var x = pixel.x + coord[0]; @@ -7099,14 +7163,12 @@ elements.food_coloring = { pixelMap[x][y].color = `rgb(${parseInt(newrgb2.r)},${parseInt(newrgb2.g)},${parseInt(newrgb2.b)})`; if (Math.random() < 0.002) { deletePixel(pixel.x,pixel.y) - break } } } } } } - doDefaults(pixel) }, onSelect: function () { logMessage("Tip: You can spread food coloring using water."); @@ -7251,3 +7313,445 @@ elements.soy_sauce = { density: 1200, }; // end of confused part + +elements.ice.breakInto = "slush"; + +elements.cracker_dough = { + color: "#dbd19a", + behavior: behaviors.STURDYPOWDER, + category: "food", + tempHigh: 94, + stateHigh: "cracker", + stateHighColorMultiplier: 1.1, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true, + hidden: true +} + +elements.cracker = { + color: "#e0ddb8", + behavior: behaviors.STURDYPOWDER, + tempHigh: 605, + stateHigh: "ash", + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + isFood: true +} + +elements.agar = { + color: "#e0e0e0", + behavior: behaviors.POWDER, + reactions: { + "ice": { elem1:null, elem2:"salt_water", chance:0.1 }, + "rime": { elem1:null, elem2:"salt_water", chance:0.075 }, + "snow": { elem1:null, elem2:"salt_water", chance:0.25 }, + "packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 }, + "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 } + }, + category: "food", + tempHigh: 801, + state: "solid", + density: 2160, + alias: "gelatin" +} +// thanks to adora +elements.agar.reactions.juice = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; +}} +elements.agar.reactions.water = {elem1:"jelly",elem2:null,color1:"#e0e0e0",chance:0.05} + +elements.duck = { + color: ["#826c4e", "#2b5927", "#d6d6d6", "#7d4a2c"], + behavior: [ + "M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1|M2%2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%50|M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1", + "M2%10|XX|M2%10", + "XX|M1%33|XX", + ], + category:"life", + state: "solid", + reactions: { + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "duck_egg", + foodNeed: 10, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_duck", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "raw_duck", + burn:85, + burnTime:450, + state: "solid", + density: 1117, + conduct: 0.3, + cutInto: "raw_duck", +}; + +elements.duck_egg = { + color: "#e0d3ab", + behavior: behaviors.STURDYPOWDER2, + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) { + changePixel(pixel,"duckling") + } + doDefaults(pixel); + }, + category: "food", + state: "solid", + temp: 20, + tempLow: -18, + stateLow: "frozen_duck_egg", + breakInto: ["yolk"], + tempHigh: 400, + stateHigh: ["calcium", "ash"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "water": { elem2:null, elem1:"hard_boiled_egg", chance:10, tempMin:80 } + } +}; +elements.frozen_duck_egg = { + color: "#e0d3cf", + behavior: behaviors.POWDER, + category: "food", + state: "solid", + temp: -20, + tempHigh: 10, + stateHigh: "duck_egg", + breakInto: ["calcium", "hard_yolk"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + hidden: true, +}; +elements.duckling = { + color: ["#f0eba8", "#f0eba8"], + behavior: [ + "M2%1|M2%2|M2%1", + "M2%10|FX%5 AND CH:duck%0.1|M2%10", + "XX|M1%33|XX", + ], + category: "life", + state: "solid", + egg: "duck_egg", + foodNeed: 20, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_meat", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "blood", + burn:85, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "crushed_worm": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL}, + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + } +}; + +elements.barbecued_duck = { + color:["#a67d2d","#9c721f"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.steamed_duck = { + color:["#e8cb7b", "#d6bf7e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:50, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_duck = { + color:["#6b470e", "#8f5b09"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.cooked_duck = { + color: ["#a38046", "#b39652"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +}; + +elements.raw_duck = { + color: ["#d6a587", "#c99873"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "cooked_duck", + temp:25, + tempHigh: 600, + stateHigh: ["cooked_duck"], + reactions: { + "smoke": {elem1: "smoked_duck"}, + "steam": {elem1: "steamed_duck"}, + "water": {elem1: "boiled_duck", tempMin: 70}, + "nut_oil": {elem1: "fried_duck", tempMin: 70}, + "charcoal": {elem1: "barbecued_duck", tempMin: 70}, + "fire": {elem1: "barbecued_duck"} + } +}; + +elements.boiled_duck = { + color: ["#e0d4a4", "#e0d4a4"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 65, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} + +elements.fried_duck = { + color: ["#c49543", "#b88835", "#b07b20", "#996e23"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 90, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} +// side note: i don't eat beef +elements.cow = { + color: ["#292928", "#332b23", "#e0dfde", "#f0edeb"], + behavior: [ + "M2%1|XX|M2%1", + "M2%10|XX|M2%10", + "XX|M1|XX", + ], + category:"life", + state: "solid", + reactions: { + "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "calf", + foodNeed: 10, + temp: 40, + tempHigh: 75, + stateHigh: "steak", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "raw_beef", + burn:85, + burnTime:450, + state: "solid", + density: 1117, + conduct: 0.3, + cutInto: "raw_beef", +}; +elements.calf = { + color: ["#363535", "#bdbdbd"], + behavior: [ + "M2%1|XX|M2%1", + "M2%10|FX%5 AND CH:cow%0.1|M2%10", + "XX|M1|XX", + ], + category: "life", + state: "solid", + foodNeed: 20, + temp: 40, + tempHigh: 75, + stateHigh: "steak", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "blood", + burn:85, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, +}; + +elements.barbecued_steak = { + color:["#3b271a","#29180d"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_beef = { + color:["#3b1911", "#3b2719"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.steak = { + color: ["#a38046", "#b39652"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, + alias: "cooked_beef" +}; + +elements.raw_beef = { + color: ["#ab5841", "#ab322e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "steak", + temp:25, + tempHigh: 600, + stateHigh: ["steak"], + reactions: { + "smoke": {elem1: "smoked_beef"}, + "charcoal": {elem1: "barbecued_beef", tempMin: 70}, + "fire": {elem1: "barbecued_beef"} + } +}; From 050ec0b38f9e95003d308324b210858c87957c72 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:38:09 +0800 Subject: [PATCH 05/67] Update mod-list.html --- mod-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index 84dfe98c..164ee392 100644 --- a/mod-list.html +++ b/mod-list.html @@ -218,7 +218,7 @@ weapons.jsAdds some extra weaponsJayd Food & Cooking -aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYT, RealerRaddler +aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYTr bananas.jsAdds bananas and banana plantsAlice greenitemsandmore.jsAdds various green things, including apples and more foodzonneschijn7 ketchup_mod.jsAdds a bunch of ketchup related stuff, plus a few other condimentsNubo318 (main dev), Devi, Alice (contributors) From 62765a44b0d53c9896d6bfda3283dd7ee8162d7f Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:39:49 +0800 Subject: [PATCH 06/67] ONO I FORGOR TO REMOVE THE R --- mod-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index 164ee392..23f82cb3 100644 --- a/mod-list.html +++ b/mod-list.html @@ -218,7 +218,7 @@ weapons.jsAdds some extra weaponsJayd Food & Cooking -aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYTr +aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYT bananas.jsAdds bananas and banana plantsAlice greenitemsandmore.jsAdds various green things, including apples and more foodzonneschijn7 ketchup_mod.jsAdds a bunch of ketchup related stuff, plus a few other condimentsNubo318 (main dev), Devi, Alice (contributors) From eff8201f01c44dbed87cb995c812d080722a3235 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:43:01 +0800 Subject: [PATCH 07/67] cherries? --- mods/aChefsDream.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index a7286eb9..ac55b359 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -26,6 +26,7 @@ Upcoming Features: - kiwis - guavas - lychees +- cherries (and the plasticky maraschino cherries 🤮🤮🤮) - dragonfuits - dates - figs From b39dd218d903650f8784170e2308642ecd586fcd Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:00:28 +0100 Subject: [PATCH 08/67] Update Science_mod.js Still not finished (Check to-do list to see the things I have to-do before the main release) --- mods/Science_mod.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index df1eab48..252e7636 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,5 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) +// Build 10 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1109,4 +1110,20 @@ substance.Cinnamaldehyde = { hidden:true } -// Doing more tmrw +substance.Acetone = { + behavior: behaviors.LIQUID, + color:"DADEDF", + category:"liquids", + state:"liquid", + hidden:true +} + +substance.Methane = { + behavior: behaviors.GAS, + color:"C1C7C9", + category:"gases", + state:"gas", + hidden:true +} + +// Doing more later From 0b8fa40b601f428f7843a83cda007197066413f4 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:08:22 +0100 Subject: [PATCH 09/67] Update Science_mod.js Added new substance property, adding more tmrw (not really active today :/) --- mods/Science_mod.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 252e7636..0b14d1a3 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 10 +// Build 11 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1126,4 +1126,12 @@ substance.Methane = { hidden:true } -// Doing more later +substance.Ethane = { + behavior: behaviors.GAS, + color:"C1C7C9", + category:"gases", + state:"gas", + hidden:true +} + +// Doing more tmrw From 872772b1803e387ff67176ef8cb39aab818b9db1 Mon Sep 17 00:00:00 2001 From: CarbonMonoxida <164758530+CarbonMonoxida@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:11:09 +0700 Subject: [PATCH 10/67] Update aScientistsWish.js Changelog: Add Rad metal and Rad ice --- mods/aScientistsWish.js | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/mods/aScientistsWish.js b/mods/aScientistsWish.js index 25e2647d..90e306de 100644 --- a/mods/aScientistsWish.js +++ b/mods/aScientistsWish.js @@ -15,6 +15,7 @@ elements.carbon_monoxide = { tempLow: -192, stateLow: "liquid_carbon_monoxide", burntime: 5, + darkText: true, fireColor: "#ebba34", reactions: { "head": { elem1:"rotten_meat", chance:0.5 }, @@ -31,6 +32,7 @@ elements.liquid_carbon_monoxide = { tempHigh: -190, temp: -192, tempLow: -199, + hidden: true, stateLow: "ice_carbon_monoxide", stateHigh: "carbon_monoxide", }; @@ -200,13 +202,17 @@ elements.radiated_water = { density :1300, color: ["#23d959","#29d65d"], hidden: true, + tempHigh: 140, + stateHigh: "polluted_air", + tempLow: -6, + stateLow: "rad_ice", reactions: { "human": { elem2:"rotten_meat" }, "body": { elem2:"rotten_meat" }, "head": { elem2:"ash" }, "bird": { elem2:"rotten_meat"}, - "cell": { elem2:"cancer"}, - } + "cell": { elem2:"cancer"}, + } }; elements.polluted_air = { @@ -221,7 +227,8 @@ elements.polluted_air = { "human": { elem2:"rotten_meat" }, "bird": { elem2:"rotten_meat" }, "cell": { elem2:"cancer"}, - } + "water": { elem1: null, elem2: "radiated_water" }, + } }; elements.siren = { @@ -236,4 +243,28 @@ elements.siren = { "radiated_water": {"charge1":1}, "polluted_air": {"charge1":1}, } +}; + +elements.radiated_metal = { + behavior: behaviors.WALL, + category: "radiated", + state:"solid", + density :2045, + color: ["#5e705a","#83ab7b","#474747"], + tempHigh: 1440, + stateHigh: ["molten_nickel","molten_iron","molten_tin","fallout"], + reactions: { + "water": { elem2:"radiated_water", chance:0.7 }, + "foam": { elem1:["tin","nickel","iron"] }, + } +}; + +elements.rad_ice = { + behavior: behaviors.WALL, + category: "radiated", + state:"solid", + density: 1905, + color: ["#81d79c","#68b899","#68abb8"], + hidden: true, + temp: -6, } From 6337d238976d8340e6e261d86e7df57ca6b673d4 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:49:57 +0100 Subject: [PATCH 11/67] Update Science_mod.js Wow, an extra 100 lines on a school day/night, that's rare --- mods/Science_mod.js | 218 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 188 insertions(+), 30 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 0b14d1a3..041da274 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 11 +// Build 12 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1086,52 +1086,210 @@ element.Oganesson = { // Substance proporties (These are the properties of the substances, not the elements These properties // use hidden:true as you don't start with these but instead have to craft them): -substance.Polystyrene = { - behavior: behaviors.WALL, - color:"FFFFFF", - category:"land", +// I replaced all of it with this because it might get in the way in future updates + +substance.Silver_Hexafluoroarsenate = { + behavior: behaviours.WALL, + color:"FFFFFE", + category:"lands", state:"solid", hidden:true } -substance.Styrene = { +substance.Silver_Tetrafluoroborate = { + behavior: behaviors.POWDER, + color: "FAF9F6", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Bromide = { + behavior: behaviors.WALL, + color: "FDFD96", + category: "lands", + state: "solid", + hidden: true +} + +substance.Silver_Bromate = { + behavior: behaviors.POWDER, + colour: "FFFFFF", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Picrate_Monohydrate = { + behavior: behaviors.WALL, + color: "E4D99F", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Chloride = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Perchlorate_Hydrate = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +// I can't believe i almost forgor about the "." +subtance.Silver_Perchlorate_Monohydrate = { + behavior: behaviors.POWDER, + color: "FFFFFF", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Chlorite = { + behavior: behaviors.WALL, + colour: "FFFF00", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Chlorate ={ + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Perchlorate = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Fluoride = { + behavior: behaviors.WALL, + color: "9B7A01", + category: "lands", + state: "solid", + hidden:true +} + +// Basically the same as Silver_Floride but instead the second version +subtance.Silver_Difluoride = { + behavior: behaviors.WALL, + color: "9B7A01", + category: "lands", + state: "solid", + hidden:true +} + +// Only just realised that this had spaces :skull: +substance.Silver_Hydrogen_Sluoride = { + // I'm guessing that this is a liquid behavior: behaviors.LIQUID, - color:"FFFFED", - category:"liquids", - state:"liquid", + color: "FFFFFF", + category: "liquid", + state: "liquid", hidden:true } -substance.Cinnamaldehyde = { - behavior: behaviors.LIQUID, - color:"FDFD96", - category:"liquids", - state:"liquid", +// Why are a bunch of these just silver compounds? Really weird :/ +subtance.Silver_Hexafluorophosphate = { + behavior: behaviors.POWDER, + color: "FFFFFF", + category: "lands", + state: "powder", hidden:true } -substance.Acetone = { - behavior: behaviors.LIQUID, - color:"DADEDF", - category:"liquids", - state:"liquid", +substance.Silver_Hexafluoroantimonate = { + behavior: behaviors.WALL, + color: "FFFDD0", + category: "lands", + state: "solid", hidden:true } -substance.Methane = { - behavior: behaviors.GAS, - color:"C1C7C9", - category:"gases", - state:"gas", +// There's a purple crystal version and a brown powder version +// Why does this sound like something you'd get at a posh (maybe Italian) restruant (without the "01" and the "_") +subtance.Silver_permanganate_01 = { + behavior: behaviours.WALL, + color: "800080", + category: "lands", + state: "solid", hidden:true } -substance.Ethane = { - behavior: behaviors.GAS, - color:"C1C7C9", - category:"gases", - state:"gas", +subtance.Silver_permanganate_02 = { + behavior: behaviors.POWDER, + color: "964B00", + category: "lands", + state: "powder", hidden:true } -// Doing more tmrw +substance.Silver_Vandium_Trioxide = { + behavior: behaviors.WALL, + color: "FFFF00", + category: "lands", + state: "solid", + hidden:true +} + +// Why is this fun? How is this not torture? This is line 1247! (at the time I am making this comment) + +// I think there's two silver iodides I'm just not so sure (and I ain't editing this after) +// Nvm it's only one , I got silver iodide and silver iodate mixed up :skull: +subtance.Silver_Iodide = { + behavior: behaviors.POWDER, + color: "E4D99F", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Iodate = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden: true +} + +// I was confused at first on why there were two silver nitrates, but now I understand +substance.Silver_Nitrate_01 = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Nitrate_02 = { + behavior: behaviors.POWDER, + color: "FFFFFF", + category: "lands", + state: "powder", + hidden:true +} + +subtance.Silver_Azide = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +// I'll leave the rest for tmrw as I need to go to bed, I tired ok! From 3fba615adb471be9f2bfa9b5f2e13e4b669a0ecd Mon Sep 17 00:00:00 2001 From: AuraPy <119633142+AuraPy@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:51:52 +0100 Subject: [PATCH 12/67] added updated uamm.js by upload --- mods/UAMM.js | 112 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 104 insertions(+), 8 deletions(-) diff --git a/mods/UAMM.js b/mods/UAMM.js index bb229509..acee7e62 100644 --- a/mods/UAMM.js +++ b/mods/UAMM.js @@ -126,7 +126,7 @@ elements.radiocesium = { "water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks}, elem1: ["rad_steam", "fallout"], elem2: "explosion"} } -} +}; elements.liquid_radiocesium = { color: ["#e8dcc1", "#d4c6a5", "#bfbaae", "#f5f1e9"], @@ -140,17 +140,113 @@ elements.liquid_radiocesium = { "water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks}, elem1: ["rad_steam", "fallout"], elem2: "explosion"} } -} +}; elements.lithium = { - color: ["#e3a814", "#dbab32", "#e8bc4f", "#fabf2d"], + color: ["#e8e8e8", "#f5f5f5", "#c9c9c9", "#d4d4d4"], behavior: behaviors.POWDER, category: "powders", state: "solid", - fireColor: "#8c21de", - burn: 1, - burnTime: 500, - tempHigh: 29, - stateHigh: "liquid_cesium", + tempHigh: 180.5, + stateHigh: "liquid_lithium", density: 534, + tick: function (pixel){ + var otherPixel; + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y, true)){ + if(Math.random()<0.003) { + changePixel(pixel, "dull_lithium") + } + } + if (!isEmpty(x, y, true)) { + otherPixel = pixelMap[x][y]; + if (otherPixel.element != "mineral_oil") { + if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") { + if(Math.random()<0.0007) { + changePixel(pixel, "dull_lithium") + } + } + } + } + } + }, + reactions: { + "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400} + } +}; + +elements.dull_lithium = { + color: ["#d4d4d4", "#e3e3e3", "#b3b3b3", "#bfbfbf"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + tempHigh: 180.5, + stateHigh: "liquid_lithium", + density: 534, + tick: function (pixel){ + var otherPixel; + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y, true)){ + if(Math.random()<0.003) { + changePixel(pixel, "dull_lithium") + } + } + if (!isEmpty(x, y, true)) { + otherPixel = pixelMap[x][y]; + if (otherPixel.element != "mineral_oil") { + if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") { + if(Math.random()<0.0007) { + changePixel(pixel, "dull_lithium") + } + } + } + } + } + }, + reactions: { + "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400} + } +}; + +elements.tarnished_lithium = { + color: ["#212121", "#303030", "#0d0d0d", "#404040"], + behavior: behaviors.POWDER, + state: "solid", + hidden: true, + tempHigh: 180.5, + stateHigh: "liquid_lithium" +}; + +elements.liquid_lithium = { + color: ["#e8e8e8", "#f5f5f5", "#c9c9c9", "#d4d4d4"], + behavior: behaviors.LIQUID, + hidden: true, + state: "liquid", + tempLow: 179.5, + stateLow: "lithium", + density: 511.7 +} + +elements.lithium_hydroxide = { + color: ["#ffffff", "#f1f1f1", "#e7e7e7", "#ededed"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + tempHigh: 180.5, + stateHigh: "liquid_lithium", + density: 1540, +} + +elements.mineral_oil = { + color: ["#cdf6fa", "#e6fdff", "#bff9ff", "#f5feff"], + behavior: behaviors.LIQUID, + state: "liquid", + category: "liquids", + density: 870 } From 9263dc4e97f09056872abcdf8c4585bd06f3e9b5 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Tue, 9 Apr 2024 18:34:17 -0400 Subject: [PATCH 13/67] caesium 137 and barium --- mods/nousersthings.js | 171 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 3 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 4ea7fd55..e76e60fa 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1,4 +1,9 @@ // Gallium is the best element +behaviors.RADSOLID = [ + "XX|CR:radiation%1|XX", + "CR:radiation%1|XX|CR:radiation%1", + "XX|CR:radiation%1|XX" +] elements.caesium = { color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"], behavior: behaviors.WALL, @@ -24,6 +29,7 @@ elements.molten_caesium = { state: "liquid", tempLow: 27.44, stateLow: "caesium", + hidden: true, tempHigh: 671, stateHigh: "caesium_vapor", density: 1842, @@ -44,10 +50,165 @@ elements.caesium_vapor = { category: "states", state: "gas", tempLow: 660, + hidden: true, stateLow: "molten_caesium", density: 1.7, temp: 700 +} +elements.caesium_137 = { + color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"], + behavior: behaviors.RADSOLID, + category: "solids", + state: "solid", + tempHigh: 28.44, + stateHigh: "molten_caesium_137", + density: 1873, + conduct: 0.90, + reactions: { + "water": { "elem1":"pop", "elem2":"hydrogen" }, + "sugar_water": { "elem1":"pop", "elem2":"hydrogen" }, + "dirty_water": { "elem1":"pop", "elem2":"hydrogen" }, + "pool_water": { "elem1":"pop", "elem2":"hydrogen" }, + "salt_water": { "elem1":"pop", "elem2":"hydrogen" }, + "seltzer": { "elem1":"pop", "elem2":"hydrogen" }, + }, + tick: function(pixel){ + if (Math.random()<0.0002){ + changePixel(pixel, "barium", false) + if (Math.random() >= 0.946){ + pixelMap[pixel.x][pixel.y].excited = true + } + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("electric", x, y) + break; + } + } + } + } }, +elements.molten_caesium_137 = { + color: ["#735c0a", "#a68e37", "#7e6715", "#9b832e"], + behavior: behaviors.RADLIQUID, + category: "states", + state: "liquid", + tempLow: 27.44, + stateLow: "caesium_137", + tempHigh: 671, + hidden: true, + stateHigh: "caesium_vapor_137", + density: 1842, + temp: 29, + conduct: 0.90, + reactions: { + "water": { "elem1":"pop", "elem2":"hydrogen" }, + "sugar_water": { "elem1":"pop", "elem2":"hydrogen" }, + "dirty_water": { "elem1":"pop", "elem2":"hydrogen" }, + "pool_water": { "elem1":"pop", "elem2":"hydrogen" }, + "salt_water": { "elem1":"pop", "elem2":"hydrogen" }, + "seltzer": { "elem1":"pop", "elem2":"hydrogen" }, + }, + tick: function(pixel){ + if (Math.random()<0.0002){ + changePixel(pixel, "barium", false) + if (Math.random() >= 0.946){ + pixelMap[pixel.x][pixel.y].excited = true + } + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("electric", x, y) + break; + } + } + } + } +}, +elements.caesium_vapor_137 = { + color: ["#d89e77", "#cd9064", "#af6f34", "#a26320"], + behavior: behaviors.GAS, + category: "states", + state: "gas", + tempLow: 660, + stateLow: "molten_caesium_137", + density: 1.7, + temp: 700, + hidden: true, + tick: function(pixel){ + behaviors.RADSOLID + if (Math.random()<0.0002){ + changePixel(pixel, "barium", false) + if (Math.random() >= 0.946){ + pixelMap[pixel.x][pixel.y].excited = true + } + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("electric", x, y) + break; + } + } + } + } +} +elements.barium = { + color: ["#191f19", "#2c332c", "#3f483f", "#545e54", "#6a756a"], + behavior: behaviors.STURDYPOWDER, + reactions: elements.caesium.reactions, + category: "powders", + state: "solid", + tempHigh: 730, + stateHigh: "molten_barium", + density: 3594, + tick: function(pixel){ + if(pixel.excited && Math.random() < 0.005){ + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("laser", x, y) + pixelMap[x][y].temp = pixel.temp + 120 + delete pixel.excited + break; + } + } + } + } +} +elements.molten_barium = { + color: ["#c26d24", "#cf8225", "#da9727", "#e4ad2b", "#ecc432"], + behavior: behaviors.MOLTEN, + reactions: elements.caesium.reactions, + category: "states", + state: "liquid", + tempLow: 728, + hidden: true, + stateLow: "barium", + density: 3338, + tick: function(pixel){ + if(pixel.excited && Math.random() < 0.005){ + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("laser", x, y) + pixelMap[x][y].temp = pixel.temp + 120 + delete pixel.excited + break; + } + } + } + } +} elements.subzero_grass_seed = { color: ["#022c14", "#032911", "#032205", "#021f00"], behavior: [ @@ -97,7 +258,7 @@ elements.acid_gas.ignore.push("ruthenium"), elements.acid_gas.ignore.push("molten_ruthenium") elements.technetium = { color: ["#e7d9bb", "#bab195", "#8f8a70", "#66654e"], - behavior: behaviors.WALL, + behavior: behaviors.RADSOLID, tick: function(pixel){ if(Math.random() < 0.0007){ for (var i = 0; i < squareCoords.length; i++) { @@ -121,7 +282,7 @@ elements.technetium = { }, elements.molten_technetium = { color: ["#d16b42", "#da904c", "#dfb360", "#e2d57f"], - behavior: behaviors.MOLTEN, + behavior: behaviors.RADMOLTEN, tick: function(pixel){ if(Math.random() < 0.0007){ for (var i = 0; i < squareCoords.length; i++) { @@ -1485,6 +1646,7 @@ elements.plutonium = { } } } + behaviors.RADSOLID }, reactions: { "neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 }, @@ -1493,7 +1655,7 @@ elements.plutonium = { } elements.molten_plutonium = { color: ["#6b5133", "#743f26", "#7c2727"], - behavior: behaviors.LIQUID, + behavior: behaviors.RADMOLTEN, category: "states", state: "liquid", tempLow: 620, @@ -2445,6 +2607,9 @@ elements.scuffed_circle_brush = { createPixel(circleElem, thisx, thisy) } } +function randomIntFromInterval(min, max) { // min and max included + return Math.floor(Math.random() * (max - min + 1) + min) + } elements.spacedust_cola = { color: ["#090033", "#0a0027", "#0a001b", "#0b000f"], behavior: elements.soda.behavior, From 8123773adc03eff606447409ff66545c2e4a08cb Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Tue, 9 Apr 2024 18:50:14 -0400 Subject: [PATCH 14/67] e --- mods/nousersthings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index e76e60fa..86789235 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -129,9 +129,9 @@ elements.molten_caesium_137 = { } } }, -elements.caesium_vapor_137 = { +elements.caesium_137_vapor = { color: ["#d89e77", "#cd9064", "#af6f34", "#a26320"], - behavior: behaviors.GAS, + behavior: behaviors.RADSOLID, category: "states", state: "gas", tempLow: 660, @@ -140,7 +140,7 @@ elements.caesium_vapor_137 = { temp: 700, hidden: true, tick: function(pixel){ - behaviors.RADSOLID + behaviors.GAS(pixel) if (Math.random()<0.0002){ changePixel(pixel, "barium", false) if (Math.random() >= 0.946){ From a3dafa128ba696e56a985883d9db3d71828b463a Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:04:40 +0100 Subject: [PATCH 15/67] Update Science_mod.js --- mods/Science_mod.js | 69 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 041da274..1519b005 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 12 +// Build 13 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1292,4 +1292,69 @@ subtance.Silver_Azide = { hidden:true } -// I'll leave the rest for tmrw as I need to go to bed, I tired ok! +// This one is powder and crystals +substance.Silver_Oxzide_01 = { + behavior: behaviors.POWDER, + color: "000001", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Oxzide_02 = { + behavior: behaviors.WALL, + color: "000001", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Metaphospahte = { + behavior: behaviors.WALL, + color: "FFFF00", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Perrhenate = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Acetylide = { + behavior: behaviors.WALL, + color: "C0C0C0", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Chromate = { + behavior: behaviors.POWDER, + color: "A52A2A", + category: "lands", + state: "powder", + hidden:true +} + +substance.Silver_Dichromate = { + behavior: behaviors.WALL, + color: "A52A2A", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Subfluoride = { + behavior: behaviors.WALL, + color: "CD7F32", + category: "lands", + state: "solid", + hidden:true +} + +// Doing more later (let's hope my phone is charged in the morning :skull:) From 4304ba995e4f4ff37539cba84b41148e3b41c19f Mon Sep 17 00:00:00 2001 From: AuraPy <119633142+AuraPy@users.noreply.github.com> Date: Thu, 11 Apr 2024 01:15:17 +0100 Subject: [PATCH 16/67] Updated UAMM.js --- mods/UAMM.js | 179 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 171 insertions(+), 8 deletions(-) diff --git a/mods/UAMM.js b/mods/UAMM.js index acee7e62..bf134799 100644 --- a/mods/UAMM.js +++ b/mods/UAMM.js @@ -15,7 +15,7 @@ elements.rubidium = { var coord = squareCoords[i]; var x = pixel.x+coord[0]; var y = pixel.y+coord[1]; - if(!isEmpty(x, y, true)){ + if (!isEmpty(x, y, true)){ var otherPixel = pixelMap[x][y] if (otherPixel.element == "liquid_ammonia"){foundelem1 = true; break} } @@ -24,7 +24,7 @@ elements.rubidium = { var coord = squareCoords[i]; var x = pixel.x+coord[0]; var y = pixel.y+coord[1]; - if(!isEmpty(x, y, true)){ + if (!isEmpty(x, y, true)){ var otherPixel = pixelMap[x][y] if (otherPixel.element == "oxygen"){foundelem2 = true; break} } @@ -122,6 +122,16 @@ elements.radiocesium = { tempHigh: 29, stateHigh: "liquid_radiocesium", density: 1873, + tick: function (pixel) { + if (Math.random()<0.007) { + if (Math.random()<0.5) { + changePixel(pixel, "barium") + } + else { + changePixel(pixel, "radiobarium") + } + } + }, reactions: { "water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks}, elem1: ["rad_steam", "fallout"], elem2: "explosion"} @@ -136,12 +146,94 @@ elements.liquid_radiocesium = { tempLow: 28, stateLow: "radiocesium", density: 1842, + tick: function (pixel) { + if (Math.random()<0.007) { + if (Math.random()<0.5) { + changePixel(pixel, "barium") + } + else { + changePixel(pixel, "radiobarium") + } + } + }, reactions: { "water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks}, elem1: ["rad_steam", "fallout"], elem2: "explosion"} } }; +elements.barium = { + color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"], + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + tempHigh: 730, + stateHigh: "liquid_barium", + density: 3510, + reactions: { + "water": {elem1: "barium_hydroxide", elem2: "pop"} + } +}; + +elements.liquid_barium = { + color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"], + behavior: behaviors.POWDER, + hidden: true, + state: "liquid", + tempLow: 729, + stateLow: "barium", + density: 3338 +} + +elements.radiobarium = { + color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + density: 3510, + tick: function (pixel) { + if (Math.random()<0.007) { + changePixel(pixel, "barium") + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + var rays = 0; + if (isEmpty(x, y)){ + createPixel("gamma_ray", x, y) + rays += 1 + if (rays == 2) { + break + } + } + } + } + } +}; + +elements.barium_hydroxide = { + color: ["#f4f4f4", "#ffffff", "#ebebeb", "#e5e5e5"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + density: 3510 +} + +elements.gamma_ray = { + color: "#ffffff", + behavior: [ + "XX|XX|XX", + "XX|DL%5|XX", + "XX|XX|XX", + ], + hidden: true, + temp: 1000, + state: "gas", + density: 0.00001, + ignoreAir: true, + tick: behaviors.BOUNCY +}; + elements.lithium = { color: ["#e8e8e8", "#f5f5f5", "#c9c9c9", "#d4d4d4"], behavior: behaviors.POWDER, @@ -174,7 +266,8 @@ elements.lithium = { } }, reactions: { - "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400} + "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400}, + "hydrogen": {elem1:"lithium_hydride", elem2: null, chance: 0.5} } }; @@ -210,7 +303,8 @@ elements.dull_lithium = { } }, reactions: { - "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400} + "water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400}, + "hydrogen": {elem1:"lithium_hydride", elem2: null, chance: 0.5} } }; @@ -231,7 +325,7 @@ elements.liquid_lithium = { tempLow: 179.5, stateLow: "lithium", density: 511.7 -} +}; elements.lithium_hydroxide = { color: ["#ffffff", "#f1f1f1", "#e7e7e7", "#ededed"], @@ -241,12 +335,81 @@ elements.lithium_hydroxide = { tempHigh: 180.5, stateHigh: "liquid_lithium", density: 1540, -} +}; + +elements.lithium_hydride = { + color: ["#8a8a8a", "#b5b5b5", "#bbbbbb"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + density: 820, + tick: function (pixel){ + var otherPixel; + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y, true)){ + var chance = Math.random() + if(Math.random()<0.003) { + if (chance<0.3) { + changePixel(pixel, "lithium_hydroxide") + } + else if (chance>0.3 && chance<0.7) { + changePixel(pixel, "lithium_oxide") + } + else { + changePixel(pixel, "lithium_carbonate") + } + } + } + if (!isEmpty(x, y, true)) { + otherPixel = pixelMap[x][y]; + if (otherPixel.element != "mineral_oil") { + if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") { + var chance = Math.random() + if(Math.random()<0.0007) { + if (chance<0.3) { + changePixel(pixel, "lithium_hydroxide") + } + else if (chance>0.3 && chance<0.7) { + changePixel(pixel, "lithium_oxide") + } + else { + changePixel(pixel, "lithium_carbonate") + } + } + } + } + } + } + }, +}; + +elements.lithium_oxide = { + color: ["#ffffff", "#ececec", "#dbdbdb"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + density: 2013, + reactions: { + "water": {elem1: "lithium_hydroxide", elem2: "pop", chance: 0.2}, + "carbon_dioxide": {elem1: "lithium_carbonate", elem2: null} + } +}; + +elements.lithium_carbonate = { + color: ["#ffffff", "#e0e0e0", "#c9c8c8"], + behavior: behaviors.POWDER, + hidden: true, + state: "solid", + density: 2110 +}; elements.mineral_oil = { color: ["#cdf6fa", "#e6fdff", "#bff9ff", "#f5feff"], behavior: behaviors.LIQUID, state: "liquid", category: "liquids", - density: 870 -} + density: 870, +}; \ No newline at end of file From 161e1cb59ca2ba6f010a930e655df46dee50981b Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Thu, 11 Apr 2024 07:54:55 +0100 Subject: [PATCH 17/67] Comment update Science_mod.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edited from my phone 💀 --- mods/Science_mod.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 1519b005..dce0c58e 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 13 +// Build 14 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1358,3 +1358,4 @@ substance.Silver_Subfluoride = { } // Doing more later (let's hope my phone is charged in the morning :skull:) +// Yep it's charged! :) (I can't multitask on my phone than on my computer :/) From b1c638aff5687e5dfa6219e54cc321fcddb487f6 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:50:30 +0800 Subject: [PATCH 18/67] quick upd --- mods/aChefsDream.js | 72 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index ac55b359..a88ba401 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -4,11 +4,12 @@ Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nous Compatibility with plants.js coming soon Works well with community_desserts.js -v1.13 +v1.13.5 you can support me at my youtube: https://youtube.com/@sqec Upcoming Features: +- pudding/cream - extract tool - cinnamon - spring onions @@ -21,7 +22,6 @@ Upcoming Features: - stainless steel - pepper plants - hot chocolate -- cows and beef - celery - kiwis - guavas @@ -41,9 +41,11 @@ Upcoming Features: - squids - tofu - miso -- juice reaction with milk makes average color - juice reaction with other juices - jackfruit +- fruit soda (any juice + co2 or seltzer) +- rambutan +- shrimp/prawn meat Changelog (v1.0) - added chickens @@ -441,6 +443,15 @@ Changelog (v1.13) +Changelog (v1.13.5) + - added hard jelly + - soda can mix colors + - added soda jelly + - added fanta (orange juice + carbon dioxide) + + + + */ /* @@ -7756,3 +7767,58 @@ elements.raw_beef = { "fire": {elem1: "barbecued_beef"} } }; + +elements.juice.reactions.milk = { 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)})`; +}} +elements.juice.reactions.cream = { 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)})`; +}} +elements.soda.reactions.soda = { + 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.reactions.soda = { + chance:70, + 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); + changePixel(pixelMap[pixel1.x][pixel1.y],"soda") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } + } +} +if (!elements.orange_juice.reactions) { elements.orange_juice.reactions = {} } +elements.orange_juice.reactions.seltzer = { elem1:"soda", elem2:"foam", color1:"#ffb319"} +elements.orange_juice.reactions.carbon_dioxide = { elem1:"soda", elem2:"foam", color1:"#ffb319"} +elements.agar.reactions.soda = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; +}} +elements.hard_jelly = { + color: "#c372b8", + behavior: behaviors.STURDYPOWDER, + tempHigh: 200, + stateHigh: ["smoke","sugar"], + category: "food", + state: "solid", + density: 1245, + isFood: true, + hidden: true, + temp: 0 +} +elements.jelly.stateLow = "hard_jelly" +elements.jelly.stateLowColorMultiplier = 1.2 +elements.jelly.temp = 0 From fd0be17b104d5e3c6ab98d25cb8d9b452026cdf5 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:20:18 +0100 Subject: [PATCH 19/67] Update Science_mod.js Done in school :/ --- mods/Science_mod.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index dce0c58e..ccd94e5d 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 14 +// Build 15 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1357,5 +1357,30 @@ substance.Silver_Subfluoride = { hidden:true } -// Doing more later (let's hope my phone is charged in the morning :skull:) -// Yep it's charged! :) (I can't multitask on my phone than on my computer :/) +substance.Silver_Sulfide = { + behavior: behaviors.WALL, + color: "3f3f3f", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Oxzide = { + behavior: behaviors.POWDER, + color: "000002", + category: "lands", + state: "powder", + hidden:true +} + +// Editing this later on when I get back home +substance.Silver_Sulfate = { + behavior: behaviors.POWDER, + color: (Unsure), + category: "lands" + state: "powder", + hidden:true +} + +// I done this on my school computers :skull: +// doing more later From b1c59dbe58be2fce6f598bcad4de2830ecc4c8c4 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:43:31 +0800 Subject: [PATCH 20/67] 1.13.7 --- mods/aChefsDream.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index a88ba401..94574ee9 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -4,7 +4,7 @@ Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nous Compatibility with plants.js coming soon Works well with community_desserts.js -v1.13.5 +v1.13.7 you can support me at my youtube: https://youtube.com/@sqec @@ -31,7 +31,9 @@ Upcoming Features: - dates - figs - avocados -- apricots and plums +- apricots and almonds (roasted) +- hazelnuts +- plums - curry/chicken tikka masala - raisins - peaches @@ -452,6 +454,16 @@ Changelog (v1.13.5) +Changelog (v1.13.7) + - rename nut to peanut + + + + + + + + */ /* @@ -7822,3 +7834,7 @@ elements.hard_jelly = { elements.jelly.stateLow = "hard_jelly" elements.jelly.stateLowColorMultiplier = 1.2 elements.jelly.temp = 0 + +elements.nut.name = "peanut"; +elements.nut_meat.name = "peanut_meat"; +elements.nut_butter.name = "peanut_butter"; From b3bb63719d5e37f6a869c0a99ba018f1cc9cb937 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:35:49 +0100 Subject: [PATCH 21/67] Update Science_mod.js --- mods/Science_mod.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index ccd94e5d..9910a969 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 15 +// Build 16 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1384,3 +1384,5 @@ substance.Silver_Sulfate = { // I done this on my school computers :skull: // doing more later + +// I accidentally pressed Ctrl+V instead of Ctrl+C so it deleted my work D: From 90479db528de65e3e0a33104679d44f41c05c80c Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:04:55 +0100 Subject: [PATCH 22/67] Update Science_mod.js Forgot the "Nitrogen" in the part of the code --- mods/Science_mod.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 9910a969..1ddb65d4 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 16 +// Build 17 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -19,6 +19,7 @@ if (!settings.Science_mod) { "Beryllium": 9.223372036854776e+18, "Boron": 9.223372036854776e+18, "Carbon": 9.223372036854776e+18, + "Nitrogen": 9.223372036854776e+18, "Oxygen": 9.223372036854776e+18, "Flourine": 9.223372036854776e+18, "Neon": 9.223372036854776e+18, From 91e3be140722447e39a7c41ca858d55a05a7956b Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:08:36 +0100 Subject: [PATCH 23/67] Update Science_mod.js forgot to update a part of it --- mods/Science_mod.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 1ddb65d4..47f8b3b4 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1376,10 +1376,10 @@ substance.Silver_Oxzide = { // Editing this later on when I get back home substance.Silver_Sulfate = { - behavior: behaviors.POWDER, - color: (Unsure), + behavior: behaviors.WALL, + color: "FFFFFF", category: "lands" - state: "powder", + state: "solid", hidden:true } From 8a6b9ea6310ccc041b8f7974fae5a9cfa7dde57b Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:54:03 +0800 Subject: [PATCH 24/67] Host aChefsDream.js on my GitHub https://github.com/SquareScreamYT/aChefsDream.js/blob/main/aChefsDream.js --- mods/aChefsDream.js | 7848 +------------------------------------------ 1 file changed, 8 insertions(+), 7840 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 94574ee9..3c19ad5e 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,7840 +1,8 @@ -/* -Created by SquareScreamYT/sqec <@918475812884344852> -Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696>, ryan(R74n) <@101070932608561152> and Fioushemastor <@738828785482203189> for helping :) -Compatibility with plants.js coming soon -Works well with community_desserts.js - -v1.13.7 - -you can support me at my youtube: https://youtube.com/@sqec - -Upcoming Features: -- pudding/cream -- extract tool -- cinnamon -- spring onions -- white rice noodles -- matcha leaves, powder, tea -- cacao pods -- more chocolate, cocoa powder, white chocolate, cocoa butter -- pigs, ham and bacon -- garlic -- stainless steel -- pepper plants -- hot chocolate -- celery -- kiwis -- guavas -- lychees -- cherries (and the plasticky maraschino cherries 🤮🤮🤮) -- dragonfuits -- dates -- figs -- avocados -- apricots and almonds (roasted) -- hazelnuts -- plums -- curry/chicken tikka masala -- raisins -- peaches -- cucumbers -- eggplants -- crabs (they eat coconuts) -- squids -- tofu -- miso -- juice reaction with other juices -- jackfruit -- fruit soda (any juice + co2 or seltzer) -- rambutan -- shrimp/prawn meat - -Changelog (v1.0) - - added chickens - - lays chicken eggs - - added chicks - - hatches from chicken eggs - - grows into chickens - - added chicken eggs - - added frozen chicken eggs - - added hard boiled eggs - - made by putting chicken eggs in hot water - - added soup - - made from broth and water - - added noodles - - made by putting batter in hot water - - added chicken meat - - raw chicken meat - - cooked chicken meat - - battered raw chicken - - made by mixing raw chicken and batter - - raw chicken nuggets - - made by mixing battered raw chicken with crumbs - - (cooked) chicken nuggets - - added crushed worm - - chicken food - - made by smashing worms or mixing worms with rocks - - added frozen crushed worms - - added fried potato - - made by putting potatoes in hot cooking oil - - added smoked chicken - - made by putting raw chicken with smoke - - added boiled chicken - - made by putting raw chicken in hot water - - added fried chicken - - made by putting raw chicken in hot cooking oil - - added steamed chicken - - made by putting raw chicken with steam - - added olives - - added olives - - olives can be smashed into cooking oil - - added olive wood - - added olive branches - - added olive leaves - - added cooking oil - - - - -Changelog (v1.1) - - added apples and related stuff - - apples - - applewood - - apple branches - - apple leaves - - apple juice - - made by smashing apples - - apple seeds - - apple slices - - made by cutting apples - - apple jam - - made by putting sugar in apple juice - - added knife tool - - cuts, peels, etc. pixels - - readded potato skin and peeled potato - - changed fried potato recipe from potato to skinned potato - - added pepper - - added cake - - made by mixing baked batter and cream - - added icing sugar - - made by smashing sugar - - added icing - - made by shift-mixing icing sugar - - noodles description - - bug fix (freezing crushed worms makes them alive) - - - - -Changelog (v1.2) - - added boilers - - added steamers - - added smokers - - added oranges and related stuff - - oranges - - orange wood - - orange branches - - orange leaves - - orange juice - - made by smashing orange - - orange seeds - - orange slices - - made by cutting oranges - - orange peels - - byproduct of cutting oranges into orange slices - - marmalade - - made by putting sugar in orange peels and orange slices - - apple and orange juice now turn into juice ice under 0 degrees - - apple juice now boils into sugar and steam - - apple juice now boils at 100 instead of 400 - - added coral and coral stems - - added tuna - - added cooked and raw tuna - - added smoked tuna - - made by putting raw tuna with smoke - - added boiled tuna - - made by putting raw tuna in hot water - - added fried tuna - - made by putting raw tuna in hot cooking oil - - added steamed tuna - - made by putting raw tuna with steam - - added salmon - - added cooked and raw salmon - - added smoked salmon - - made by putting raw salmon with smoke - - added boiled salmon - - made by putting raw salmon in hot water - - added fried salmon - - made by putting raw salmon in hot cooking oil - - added steamed salmon - - made by putting raw salmon with steam - - added grape juice - - added cream of tartar - - added wine - - added corn syrup - - - -Changelog (v1.3) - - added shrimp - - added coconuts - - added coconut stems - - added coconut leaves - - added coconut tree tops - - added coconut milk and coconut juice - - added cut coconuts - - salmon and tuna meats no longer melt - - added knife description - - added lemons and related stuff - - lemons - - lemon wood - - lemon branches - - lemon leaves - - lemon juice - - made by smashing lemons - - lemon seeds - - lemon slices - - made by cutting lemons - - lemon zest - - byproduct of cutting lemons - - lemon marmalade can now be made by mixing lemon slices or lemon zest with sugar - - added carrots - - added carrot seeds and leaves - - added carrot juice - - added dry icing - - - -Changelog (v1.3.1) - - added lemonade - - - -Changelog (v1.3.2) - - added apple cider vinegar - - added turnips - - added turnip seeds and leaves - - added turnip juice - - - -Changelog (v1.4) - - added baking powder - - added corn starch - - added maple syrup - - added pancakes - - added pancake mix - - added pancake batter - - added normal pancakes - - added crispy pancakes - - added burnt pancakes - - added strawberries - - added strawberries - - added strawberry seeds, stem, and leaves - - added strawberry juice - - added whipped cream - - chicken eggs no longer hatch under 20 degrees - - added ginger - - added ginger juice - - added ginger rhizomes, pseudostems and leaves - - - -Changelog (v1.5) - - added blueberries - - added blueberries - - added blueberry seeds, stem, and leaves - - added blueberry juice - - added strawberry and blueberry jam - - added cut blueberries - - added advanced dough - - added carbonic acid - - 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 - - - -Changelog (v1.7) - - added chocolate chips - - added sprinkles - - added banana milk (yellow fruit milk) - - added passion fruits - - added passion fruit vines and seeds (new climbing vines feature!) - - added mangoes - - added mango juice - - added mango wood, branch, leaves and seeds - - added pineapples - - added pineapple leaves, seed and juice - - - -Changelog (v1.8) - - added lime and lime juice - - added lime zest and slices - - added escargot - - added broccoli - - added broccoli stem, cut broccoli and broccoli seed - - added freeze drying and freeze dried fruits - - added soapy water - - - - -Changelog (v1.9) - - added onion - - added cut onion - - added fried onion - - added rice - - added porridge - - added cooked and burnt rice - - added rice plants and rice panicles - - added rice seeds - - added msg - - added seaweed - - added dried seaweed - - added seaweed stem and seeds - - fix egg and noodle bug - - - - -Changelog (v1.10) - - tweaked seaweed behavior - - tweaked tomato and grape vines - - added peppermint - - added peppermint leaves and stems - - added peppermint seeds - - added vanilla - - added vanilla seeds, stem, leaves - - added vanilla flower - - added vanilla pod - - added vanilla essence - - - - -Changelog (v1.10.1) - - unhid vanilla essence - - added peppermint candy - - vanilla essence can now turn ice cream light yellow - - added peppermint candy - - added tapioca - - added tapioca stems, leaves, and seed - - - - -Changelog (v1.10.2) - - added sprinkle explosions - - - - -Changelog (v1.10.5) - - added chilli - - added chilli seed, stem and leaves - - added chilli powder - - added hot sauce - - - - -Changelog (v1.10.7) - - added mango milk - - - - -Changelog (v1.10.8) - - added onion powder - - fix carrot plant bug - - added fried rice - - added durians - - added cut durians - - added durian seed, wood, leaves and branches - - - - -Changelog (v1.11) - - unhid carrot - - unhid turnip - - - - -Changelog (v1.12) - - added whisk - - added egg white - - added hard egg white - - added whisked egg white - - added marshmallows - - added cooked marshmallows - - added burnt marshmallows - - improved soup (from nousersthings.js) - - added food coloring (color may fade) - - added eat tool - - added drink tool - - - - -Changelog (v1.12.1) - - removed coral, can still be found in ocean.js - - updated food coloring - - - - -Changelog (v1.12.2) - - updated cooked meat behavior - - - - -Changelog (v1.12.4) - - added cake batter - - added condensed milk - - added wasabi - - added beans - - added baked beans - - added fermented beans/natto - - added soy sauce - - - - -Changelog (v1.13) - - added cracker and cracker dough - - added barbecue sauce - - added mustard - - added agar - - added barbecued chicken - - tweaked grape juice color - - added duck - - added duckling - - added duck eggs and frozen duck eggs - - added raw duck and cooked duck - - added fried duck - - added boiled duck - - added barbecued duck - - added smoked duck - - added steamed duck - - added cows - - added calves - - added steak and beef - - added smoked steak and barbecued steak - - - - -Changelog (v1.13.5) - - added hard jelly - - soda can mix colors - - added soda jelly - - added fanta (orange juice + carbon dioxide) - - - - -Changelog (v1.13.7) - - rename nut to peanut - - - - - - - - -*/ - -/* -elements.test = { - //other needed properties - cutInto: "elem" -} -*/ - -console.log("Thanks for using aChefsDream.js! -sqec") - -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]) }; -} - -behaviors.STURDYPOWDER2 = [ - "XX|XX|XX", - "XX|XX|XX", - "M2%30|M1|M2%30", -], - -elements.knife = { - color: "#adb5bd", - // other needed properties - tool: (pixel) => { - //store cutInto as a variable for legibility - var cutInto = elements[pixel.element].cutInto; - //if there’s no cutInto, it should equal undefined, which is falsey and !undefined = true - if (!cutInto) { return }; - //if cutInto is an array, randomly pick one of its elements - if(cutInto instanceof Array) { cutInto = cutInto[Math.floor(Math.random() * cutInto.length)] }; - //change pixel into the (chosen) element - //changePixel(pixel, cutInto) - - //var cutIntoEmit = elements[pixel.element].cutIntoEmit; - //if (!cutIntoEmit) { return }; - //if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] }; - //var thiselement = pixel.element; - if (shiftDown) { - if (Math.random() < 0.5) { - changePixel(pixel, cutInto) - //if (elements[thiselement].cutIntoEmit && Math.random() < 0.5 && isEmpty(pixel.x,pixel.y-1)) { - // createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1); - //} - } - } - else if (!shiftDown) { - if (Math.random() < 0.1) { - changePixel(pixel, cutInto) - //if (elements[thiselement].cutIntoEmit && Math.random() < 0.5 && isEmpty(pixel.x,pixel.y-1)) { - // createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1); - //} - } - } - }, - category:"tools", - canPlace: false, - desc: "Use on pixels to cut them, if possible." -} -elements.whisk = { - color: ["#a4a7b0","#a4a7b0","#a4a7b0","#bfc2c9","#e9eaf0","#bfc2c9","#a4a7b0"], - // other needed properties - tool: (pixel) => { - //store whiskInto as a variable for legibility - var whiskInto = elements[pixel.element].whiskInto; - //if there’s no whiskInto, it should equal undefined, which is falsey and !undefined = true - if (!whiskInto) { return }; - //if whiskInto is an array, randomly pick one of its elements - if(whiskInto instanceof Array) {whiskInto = whiskInto[Math.floor(Math.random() * whiskInto.length)] }; - //change pixel into the (chosen) element - //changePixel(pixel, whiskInto) - if (shiftDown) { - if (Math.random() < 0.5) { - changePixel(pixel, whiskInto) - } - } - else if (!shiftDown) { - if (Math.random() < 0.1) { - changePixel(pixel, whiskInto) - } - } - }, - category:"tools", - canPlace: false, - desc: "Use on pixels to whisk them, if possible." -} -elements.freeze_dry = { - color: "#3a65b5", - tool: function(pixel) { - if (elements[pixel.element].freezeDryInto !== undefined) { - if (Math.random() < 0.2) { - var freezeDryInto = elements[pixel.element].freezeDryInto; - if (Array.isArray(freezeDryInto)) { - freezeDryInto = freezeDryInto[Math.floor(Math.random() * freezeDryInto.length)]; - } - if (freezeDryInto === null) { - deletePixel(pixel.x,pixel.y); - return; - } - var previouselement = pixel.element; - changePixel(pixel,freezeDryInto); - pixelTempCheck(pixel); - if (elements[previouselement].freezeDryIntoColor) { - pixel.color = pixelColorPick(pixel, elements[previouselement].freezeDryIntoColor); - } - } - } - }, - category: "tools", - excludeRandom: true, - desc: "Use on pixels to freeze dry them, if possible." -} - -elements.eat = { - color: ["#ffba79","#efff79"], - tool: function(pixel) { - if (elements[pixel.element].isFood || elements[pixel.element].category === "food" || eLists.JUICEMIXABLE.includes(pixel.element) || elements[pixel.element].id === elements.uranium.id || elements[pixel.element].id === elements.mercury.id) { - deletePixel(pixel.x, pixel.y); - } - }, - category: "tools", - desc: "Eats pixels." -} -elements.drink = { - color: ["#03c6fc","#03a1fc"], - tool: function(pixel) { - if (elements[pixel.element].state === "liquid") { - deletePixel(pixel.x, pixel.y); - } - }, - category: "tools", - desc: "Drinks pixels." -} - -eLists.JUICEMIXABLE = ["juice"]; - -elements.chicken = { - color: ["#c29046", "#f5d271", "#d4bd7d"], - behavior: [ - "M2%1|M2%2|M2%1", - "M2%10|XX|M2%10", - "XX|M1%33|XX", - ], - category:"life", - state: "solid", - reactions: { - "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "worm": { elem2: "crushed_worm", chance:0.3}, - "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, - "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - }, - egg: "chicken_egg", - foodNeed: 10, - temp: 40, - tempHigh: 75, - stateHigh: "cooked_chicken", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "raw_chicken", - burn:85, - burnTime:450, - state: "solid", - density: 1117, - conduct: 0.3, - cutInto: "raw_chicken", -}; - -elements.chicken_egg = { - color: ["#e0d3ab","#d9cdb5"], - behavior: behaviors.STURDYPOWDER2, - tick: function(pixel) { - if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) { - changePixel(pixel,"chick") - } - doDefaults(pixel); - }, - category: "food", - state: "solid", - temp: 20, - tempLow: -18, - stateLow: "frozen_chicken_egg", - breakInto: ["yolk"], - tempHigh: 400, - stateHigh: ["calcium", "ash"], - burn:50, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - reactions: { - "water": { elem2:null, elem1:"hard_boiled_egg", chance:10, tempMin:80 } - } -}; -elements.water.reactions.egg = { elem1:null, elem2:"hard_boiled_egg", chance:10, tempMin:80 } -elements.frozen_chicken_egg = { - color: ["#e0d3cf","#d9cdd3"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - temp: -20, - tempHigh: 10, - stateHigh: "chicken_egg", - breakInto: ["calcium", "hard_yolk"], - burn:50, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - hidden: true, -}; - -elements.hard_boiled_egg = { - color: ["#e0d3ab","#d9cdb5","#e4d4b4","#f3f3ef"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - hidden: "TRUE", - tempHigh: 1000, - stateHigh: ["ash", "smoke"], - density: 820.33, - isFood: true, - hidden: true, -}; - -elements.chick = { - color: ["#ffdf85", "#ffef5c"], - behavior: [ - "M2%1|M2%2|M2%1", - "M2%10|FX%5 AND CH:chicken%0.1|M2%10", - "XX|M1%33|XX", - ], - category: "life", - state: "solid", - egg: "chicken_egg", - foodNeed: 20, - temp: 40, - tempHigh: 75, - stateHigh: "cooked_meat", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "blood", - burn:85, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - reactions: { - "crushed_worm": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL}, - "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "worm": { elem2: "crushed_worm", chance:0.3}, - "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, - "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - } -}; - -elements.barbecued_chicken = { - color:["#bf743b", "#b57026","#8f5e29","#a87b11"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} -elements.barbecue_sauce = { - color: "#571e1A", - behavior: behaviors.LIQUID, - viscosity: 50000, - tempHigh: 260, - stateHigh: ["carbon_dioxide","methane","steam","salt","sugar"], - category:"food", - state: "liquid", - density: 1235, - stain: 0.05, - isFood: true, -} -if (!elements.ketchup.reactions) { elements.ketchup.reactions = {}; } -elements.ketchup.reactions.molasses = { elem1:"barbecue_sauce", elem2:"barbecue_sauce" } - -elements.mustard = { - color: "#e1ad01", - behavior: behaviors.LIQUID, - viscosity: 50000, - tempHigh: 260, - stateHigh: ["carbon_dioxide","methane","steam","sugar"], - category:"food", - state: "liquid", - density: 1235, - stain: 0.05, - isFood: true -} - -elements.soup = { - color: "#fbd189", - behavior: behaviors.LIQUID, - tempHigh: 130, - stateHigh: ["steam","steam","steam","fragrance"], - tempLow: 0, - category: "food", - state: "liquid", - density: 1052, - conduct: 0.03, - stain: -0.01, - isFood: true, - //thanks to nouser - onMix: function(soup,ingredient) { - if (elements[ingredient.element].id !== elements.soup.id && elements[ingredient.element].id !== elements.broth.id) { - if (elements[ingredient.element].isFood || elements[ingredient.element].category === "food" || elements[ingredient.element].category === "liquids") { - var rgb1 = soup.color.match(/\d+/g); - var rgb2 = ingredient.color.match(/\d+/g); - // average the colors - var rgb = [ - Math.round((parseInt(rgb1[0])+parseInt(rgb2[0]))/2), - Math.round((parseInt(rgb1[1])+parseInt(rgb2[1]))/2), - Math.round((parseInt(rgb1[2])+parseInt(rgb2[2]))/2) - ]; - if (!soup.elemlist){ - soup.elemlist = []; - } - soup.decidedHigh = soup.elemlist[Math.floor(Math.random()*soup.elemlist.length)]; - soup.elemlist.push(ingredient.element) - soup.stateHigh = soup.elemlist; - changePixel(ingredient, "soup"); - var hex = RGBToHex(rgb); - soup.color = pixelColorPick(soup, hex); - if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); } - else { - ingredient.color = pixelColorPick(ingredient, hex); - } - } - } - }, - tick: function(pixel) { - if (!pixel.decidedHigh){ - pixel.decidedHigh = "steam"; - } - if (pixel.temp > 100){ - if (Math.random() < 0.5) { - changePixel(pixel, "steam"); - } - else { - changePixel(pixel, pixel.decidedHigh) - } - } - }, -} - -if (!elements.broth.reactions) elements.broth.reactions = {}; -elements.broth.reactions.water = { elem1: "soup", elem2: "soup" } - -elements.noodles = { - desc: "whatever noodles", - color: ["#F3BA4F", "#F7D161"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - temp: 30, - breakInto: ["crumb"], - tempHigh: 130, - stateHigh: ["toast"], - burn:50, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - hidden: true, -}; - -if (!elements.batter.reactions) elements.batter.reactions = {}; -elements.batter.reactions.water = {elem1: "noodles", tempMin: 70} - -elements.battered_raw_chicken = { - color: ["#eacfa9", "#ecd2af"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:25, - tempHigh: 125, - stateHigh: "cooked_chicken", - reactions: { - "crumb": { elem1: "raw_chicken_nugget", elem2: null }, - }, - hidden: true, -}; - -elements.steamed_chicken = { - color:["#cfba8f", "#d2b788"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:50, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} - -elements.smoked_chicken = { - color:["#AF4523", "#AC481F"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} - -elements.crushed_worm = { - color: ["#e56932", "#c0714e"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 20, - tempHigh: 50, - stateHigh: ["ash", "smoke"], - tempLow: -4, - stateLow: "frozen_crushed_worm", - density: 200.33, - isFood: true, - hidden: true, -}; - -elements.worm.reactions.rock = { elem1: "crushed_worm" } -elements.worm.breakInto = "crushed_worm" - -elements.frozen_crushed_worm = { - color: ["#2fcbae", "#3edabd", "#b2d5d9"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: -4, - tempHigh: 20, - stateHigh: "crushed_worm", - density: 200.33, - isFood: false, - hidden: true, -}; - -elements.cooked_chicken = { - color: ["#c17c20", "#ebad2b", "#f7b846"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 40, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -}; - -elements.raw_chicken = { - color: ["#dfc8bd", "#e2cdc0", "#b9a195"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - burnInto: "cooked_chicken", - temp:25, - tempHigh: 600, - stateHigh: ["cooked_chicken"], - reactions: { - "batter": { elem1: "battered_raw_chicken", elem2: null }, - "smoke": {elem1: "smoked_chicken"}, - "steam": {elem1: "steamed_chicken"}, - "water": {elem1: "boiled_chicken", tempMin: 70}, - "nut_oil": {elem1: "fried_chicken", tempMin: 70}, - "charcoal": {elem1: "barbecued_chicken", tempMin: 70}, - "fire": {elem1: "barbecued_chicken"} - } -}; - -elements.boiled_chicken = { - color: ["#F9CC84", "#EDCE89", "#F8CB78"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - isFood: true, - temp: 65, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -} - -elements.fried_chicken = { - color: ["#E87D1A", "#E77106", "#E77106"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - isFood: true, - temp: 90, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -} - -elements.raw_chicken_nugget = { - color: ["#d6bc7e", "#d2b47a", "#c7a969"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - burnInto: "chicken_nugget", - temp:25, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, - reactions: { - "nut_oil": {elem1: "chicken_nugget", tempMin: 70} - } -}; - -elements.chicken_nugget = { - color: ["#D77105", "#D77105", "#EB8C2C", "#EB8C2C"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 40, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - tempLow: -20, - stateLow: "frozen_chicken_nugget", - isFood: true, - density: 100, - hidden: true, -}; - -elements.frozen_chicken_nugget = { - color: ["#45a69c", "#73d9cd", "#3f9f95", "#389d8e"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: -20, - tempHigh: 40, - stateHigh: "chicken_nugget", - isFood: false, - density: 100, - hidden: true, -}; - -elements.olive_wood = { - color: "#632e1f", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], -} -elements.olive_branch = { - color: "#632e1f", - behavior: [ - "CR:olive_leaves,olive_branch%2|CR:olive_leaves,olive_leaves,olive_leaves,olive_branch%2|CR:olive_leaves,olive_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "olive_wood", - tempLow: -30, - stateLow: "olive_wood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], - hidden: true, -} -elements.olive_leaves = { - color: ["#407603","#376502","#2e5502"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:olive%0.15|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, - seed: "olive_seed", - hidden: true -} -elements.olive = { - color: ["#6e8b3d","#7c9d45"], - behavior: behaviors.POWDER, - 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 }, - "rock": { elem1:"nut_oil", elem2:"rock", chance:0.035, color1: "#ffc844" }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "nut_oil", - breakIntoColor: "#ffc844", - 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", - behavior: behaviors.LIQUID, - category: "liquids", - tempHigh: 400, - stateHigh: "fire", - burn: 70, - burnTime: 300, - burnInto: ["carbon_dioxide","fire"], - viscosity: 250, - state: "liquid", - density: 825, - temp: 30, - reactions: { - "peeled_potato": {elem2: "fried_potato", tempMin: 70} - } -}, -*/ -elements.pepper = { - color: ["#1f190a", "#2b200d", "#362712", "#3b2211"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - isFood: true, - temp: 20, - hidden: true, - tempHigh: 250, - stateHigh: ["ash", "smoke"], -} - -elements.potato.cutInto = ["peeled_potato","peeled_potato","peeled_potato","potato_skin"]//{elem1: ["potato_skin","peeled_potato"] } - -elements.potato_skin = { - color: ["#DC8A5A", "#A86C36", "#DC9A59", "#A76B35"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - isFood: true, - temp: 20, - hidden: true, - density: 1100, - tempHigh: 250, - stateHigh: ["ash", "smoke"], -} - -elements.peeled_potato = { - color: ["#D6C39F", "#D1C09D", "#D1C09D", "#CDBF9E"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - isFood: true, - temp: 20, - hidden: true, - breakInto: "mashed_potato", - tempHigh: 176, - stateHigh: "baked_potato", - density: 1100, - reactions: { - "nut_oil": { elem1: "fried_potato", tempMin: 70 } - } -} - -elements.fried_potato = { - color: ["#DD7908", "#D57206", "#CA6801", "#D68001"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 35, - hidden: true, - tempHigh: 600, - density: 1110, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.applewood = { - color: "#632e1f", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], - hidden: true -} -elements.apple_branch = { - color: "#632e1f", - behavior: [ - "CR:apple_leaves,apple_branch%2|CR:apple_leaves,apple_branch%2|CR:apple_leaves,apple_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "applewood", - tempLow: -30, - stateLow: "applewood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], -} -elements.apple_leaves = { - color: ["#00d404","#0ec911","#109e12"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:apple%0.15|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 -} -elements.apple = { - color: ["#eb1a1a","#f22c2c","#d62020"], - behavior: behaviors.POWDER, - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "apple_juice", - cutInto: "apple_slice", - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#cfc540", -} - -elements.apple_slice = { - color: "#f0af37", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "apple_juice", - state: "solid", - density: 1050, - hidden: true, -} - -elements.apple_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 ? "applewood" : "apple_branch",pixel.x,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"applewood"); - } - 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.apple_juice = { - color: "#ffde55", - 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,"#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", - behavior: behaviors.LIQUID, - category: "food", - tempHigh: 400, - stateHigh: ["sugar","smoke"], - burn: 70, - burnTime: 300, - viscosity: 750, - state: "liquid", - density: 825, - hidden: true -}; - -elements.cake = { - color: ["#f2e5bf","#e8daba"], - behavior: behaviors.STURDYPOWDER, - tempHigh: 550, - stateHigh: "ash", - category: "food", - burn: 10, - burnTime: 400, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - state: "solid", - density: 233.96, - hidden: true, - isFood: true -}; - -elements.icing_sugar = { - color: "#f8f8f1", - behavior: behaviors.POWDER, - onMix: function(icing_sugar1, icing_sugar2) { - if (shiftDown && Math.random() < 0.2) { - changePixel(icing_sugar1,"icing") - } - }, - tempHigh: 186, - stateHigh: "caramel", - viscosity: 1.5, - category: "food", - state: "solid", - density: 1036.86, - isFood: true -}; - -elements.icing = { - color: "#fefefb", - behavior: behaviors.LIQUID, - onMix: function(icing_sugar1, icing_sugar2) { - if ((shiftDown && Math.random() < 0.2) || (elements[icing_sugar2.element].id === elements.icing_sugar.id && Math.random() < 0.25)) { - changePixel(icing_sugar1,"icing") - } - }, - tempHigh: 45, - stateHigh: ["dry_icing"], - stateLowColorMultiplier: 0.97, - category: "food", - isFood: true, - state: "solid", - density: 959.97, - viscosity: 9000, - hidden: true -}; - -elements.dry_icing = { - color: "#fffefa", - behavior: behaviors.STURDYPOWDER, - tempHigh: 1000, - stateHigh: ["smoke","smoke","smoke","steam","steam","calcium"], - stateLowColorMultiplier: 0.97, - category: "food", - isFood: true, - state: "solid", - density: 959.97, - viscosity: 9000, - hidden: true -}; - -elements.cream.reactions.baked_batter = {elem2: "cake" } - -elements.sugar.breakInto = {elem1: "icing_sugar"} - -elements.boiler = { - color: "#73fff8", - behavior: behaviors.WALL, - tick: function(pixel) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y, true)) { - if(pixelMap[x][y].temp < -230) { - pixelMap[x][y].temp = (pixelMap[x][y].temp + 7) - } else if(pixelMap[x][y].temp > 270) { - pixelMap[x][y].temp = (pixelMap[x][y].temp - 7) - } else if (pixelMap[x][y].temp < 95) { - pixelMap[x][y].temp = (pixelMap[x][y].temp + 2) - } else if (pixelMap[x][y].temp > 95) { - pixelMap[x][y].temp = (pixelMap[x][y].temp - 2) - } - } - } - }, - category:"machines", - state:"solid", - insulate: true, - noMix: true, - movable: false, - temp: 110 -}; - -elements.steamer = { - color: "#45daff", - behavior: [ - "CR:steam%90|CR:steam%90|CR:steam%90", - "XX|XX|XX", - "XX|XX|XX", - ], - category:"machines", - state:"solid", - insulate: true, - noMix: true, - movable: false, - temp: 110 -}; - -elements.smoker = { - color: "#bfa797", - behavior: [ - "CR:smoke%90|CR:smoke%90|CR:smoke%90", - "XX|XX|XX", - "XX|XX|XX", - ], - category:"machines", - state:"solid", - insulate: true, - noMix: true, - movable: false, - temp: 110 -}; - -elements.orange_wood = { - color: "#a88c4a", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], - hidden: true -} -elements.orange_branch = { - color: "#a88c4a", - behavior: [ - "CR:orange_leaves,orange_branch%2|CR:orange_leaves,orange_branch%2|CR:orange_leaves,orange_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "orange_wood", - tempLow: -30, - stateLow: "orange_wood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], -} -elements.orange_leaves = { - color: ["#61c43d","#5ddb3d","#51d44c"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:orange%0.1|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 -} -elements.orange = { - color: ["#eda137","#e39230","#d1882e"], - behavior: behaviors.POWDER, - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "orange_juice", - cutInto: ["orange_slice","orange_slice","orange_slice","orange_slice","orange_peels"], - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#cf9f40", -} - -elements.orange_slice = { - color: "#f5b133", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "orange_juice", - state: "solid", - density: 1050, - hidden: true, - reactions: { - "sugar": { elem1:"marmalade", elem2:null, chance:0.35 } - }, -} - -elements.orange_seed = { - color: "#695531", - 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 ? "orange_wood" : "orange_branch",pixel.x,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"orange_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.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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("orange_juice"); - -elements.orange_peels = { - color: "#d69c31", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "orange_juice", - state: "solid", - density: 1050, - hidden: true, - reactions: { - "sugar": { elem1:"marmalade", elem2:null, chance:0.35 } - }, -} - -elements.marmalade = { - color: "#fc9a38", - behavior: behaviors.LIQUID, - category: "food", - tempHigh: 400, - stateHigh: ["sugar","smoke"], - burn: 70, - burnTime: 300, - viscosity: 750, - state: "liquid", - density: 825, - hidden: true -}; - -elements.tuna = { - color: ["#3D74BA", "#4A6FB1", "#4A6FB1"], - behavior: [ - "XX|M2%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", - "XX|FX%0.5|BO", - "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5", - ], - category: "life", - state: "solid", - cutInto: "raw_tuna", - reactions: { - "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, - "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, - "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, - "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - }, -} - -elements.salmon = { - color: ["#C0C3CF", "#B7BAC3", "#ADB0B8"], - behavior: [ - "XX|M2%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", - "XX|FX%0.5|BO", - "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5", - ], - category: "life", - state: "solid", - reactions: { - "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, - "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, - "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, - "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - }, - cutInto: "raw_salmon" -} - -elements.raw_salmon = { - color: ["#FD7E19", "#FE842F", "#FD8F45"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - burnInto: "cooked_salmon", - temp:25, - tempHigh: 80, - stateHigh: "cooked_salmon", - isFood: true, - reactions: { - "smoke": {elem1: "smoked_salmon"}, - "steam": {elem1: "steamed_salmon"}, - "water": {elem1: "boiled_salmon", tempMin: 70}, - "nut_oil": {elem1: "fried_salmon", tempMin: 70} - } -} - -elements.cooked_salmon = { - color: ["#CB6132", "#D05D18", "#CC5926"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:25, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - isFood: true, - hidden: true, -} - -elements.smoked_salmon = { - color: ["#B64431", "#B24932"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, - isFood: true, -} - -elements.steamed_salmon = { - color: ["#BB7B4B", "#B07B54"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:60, - tempHigh: 600, - hidden: true, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.boiled_salmon = { - color: ["#F9B080", "#FFB78D"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:70, - tempHigh: 600, - hidden: true, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.fried_salmon = { - color: ["#E06643", "#ED774B"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:70, - tempHigh: 600, - hidden: true, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.raw_tuna = { - color: ["#EF4A5C", "#F74F65", "#E83A53"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:25, - burnInto: "cooked_tuna", - tempHigh: 80, - stateHigh: "cooked_tuna", - isFood: true, - reactions: { - "smoke": {elem1: "smoked_tuna"}, - "steam": {elem1: "steamed_tuna"}, - "water": {elem1: "boiled_tuna", tempMin: 70}, - "nut_oil": {elem1: "fried_tuna", tempMin: 70} - } -} - -elements.cooked_tuna = { - color: ["#B76C71", "#C2787C", "#A86265"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - hidden: true, - temp:50, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.smoked_tuna = { - color: ["#9D5C24", "#A4632A"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - hidden: true, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.steamed_tuna = { - color: ["#CFA578", "#D4AC82"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:60, - tempHigh: 600, - hidden: true, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.boiled_tuna = { - color: ["#C79F65", "#D9B075"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - hidden: true, - temp:70, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.fried_tuna = { - color: ["#BF8251", "#9F6031"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - hidden: true, - temp:70, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - isFood: true, -} - -elements.watermelon_seed = { - color: "#2b2118", - 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+1,pixel.y) && Math.random() > 0.7) { - movePixel(pixel,pixel.x+1,pixel.y); - createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x-1,pixel.y); - } - if (isEmpty(pixel.x-1,pixel.y) && Math.random() > 0.7) { - movePixel(pixel,pixel.x-1,pixel.y); - createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x+1,pixel.y); - } - if (!isEmpty(pixel.x+1,pixel.y) && !isEmpty(pixel.x-1,pixel.y) &&isEmpty(pixel.x+1,pixel.y-1) && Math.random() > 0.7) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y) &&isEmpty(pixel.x-1,pixel.y-1) && Math.random() > 0.7) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x+1,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"watermelon_stem"); - } - 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%20|XX", - "XX|M1|XX", - ], -}; - -elements.watermelon_stem = { - color: "#6ec938", - behavior: [ - "ST:watermelon_stem|ST:watermelon_stem AND CR:watermelon%0.1|ST:watermelon_stem", - "ST:watermelon_stem|XX|ST:watermelon_stem", - "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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -}; - -elements.watermelon = { - color: ["#28b02d","#36bf3a"], - behavior: behaviors.STURDYPOWDER, - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "watermelon_juice", - cutInto: "watermelon_flesh", - state: "solid", - density: 1050, -} - -elements.watermelon_flesh = { - color: "#f53527", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "watermelon_juice", - state: "solid", - density: 1050, - hidden: true, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#c43f33", -} - -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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("watermelon_juice"); - -elements.grape.breakInto = "grape_juice", - -elements.grape_juice = { - color: "#291824", - behavior: behaviors.LIQUID, - onMix: function(pixel) { - if (shiftDown) { - if (Math.random() < 0.2) { - changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel, "#291824") - } - } - }, - reactions: { - "dirt": { elem1: null, elem2: "mud" }, - "sand": { elem1: null, elem2: "wet_sand" }, - "clay_soil": { elem1: null, elem2: "clay" }, - "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, - stateHigh: ["steam","sugar"], - tempLow: -10, - stateLowColorMultiplier: 1.1, - category: "liquids", - state: "liquid", - density: 1054, - hidden: true, - isFood: true -}; -eLists.JUICEMIXABLE.push("grape_juice"); - -elements.cream_of_tartar = { - color: ["#EFEFEF", "#EBEBEB", "#D8D8D6"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - density: 1500, - isFood: true, - hidden: true, - reactions: { - "sugar_water": {elem2: "corn_syrup", elem1: null, tempMin: 80}, - "carbonic_acid": {elem1: null, elem2: "carbon_dioxide"} - } -} - -elements.corn_syrup = { - color: ["#FFCD0C", "#E47F00", "#FEB003"], - behavior: behaviors.LIQUID, - category: "food", - state: "liquid", - tempHigh: 100, - stateHigh: "caramel", - isFood: true, - hidden: true, - viscosity: 10000 -} - -if (!elements.baking_soda.reactions) elements.baking_soda.reactions = {}; -elements.baking_soda.reactions.water = { elem1: "carbonic_acid", elem2: "carbonic_acid" } - -elements.carbonic_acid = { - color: ["#E0DEA5", "#DFDB9C", "#EBE8BC"], - behavior: behaviors.LIQUID, - category: "liquids", - state: "liquid", - hidden: true, -} - -elements.wine = { - color: ["#6F0013", "#6D0112"], - 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, - density: 1000, - hidden: true, - tempLow: 0 -} -//eLists.JUICEMIXABLE.push("wine"); - -elements.shrimp = { - color: ["#EE5422", "#E9683C", "#F3583F", "#EDA270"], - behavior: [ - "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|M2%7.5 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", - "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|FX%20|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", - "M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15", - ], - category: "life", - state: "solid", - reactions: { - "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, - "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, - "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, - "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - }, -} - - -elements.coconut_seed = { - color: "#7a603d", - 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(Math.random() > 0.5 ? "coconut_stem" : "coconut_stem",pixel.x,pixel.y+1); - - pixel.height++ - } - } - else if (pixel.age > 150 && pixel.height > 6 && Math.random() < 0.1) { - changePixel(pixel,"coconut_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.coconut_stem = { - color: "#8f6c3f", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], - hidden: true -} -elements.coconut_tree_top = { - color: "#8f6c3f", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - 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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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+1)) { - createPixel(Math.random() > 0.5 ? "coconut" : "coconut",pixel.x+1,pixel.y+1); - } - } - if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) { - if (isEmpty(pixel.x-1,pixel.y+1)) { - createPixel(Math.random() > 0.5 ? "coconut" : "coconut",pixel.x-1,pixel.y+1); - } - } - pixel.age++; - doDefaults(pixel); -}, -} -elements.coconut_leaves = { - color: ["#569923","#5ea12b"], - 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.coconut = { - color: "#6e4621", - behavior: [ - "ST:coconut_tree_top|ST:coconut_leaves|ST:coconut_tree_top", - "ST:coconut_stem|XX|ST:coconut_stem", - "M2|M1|M2", - ], - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "coconut_milk", - cutInto: ["cut_coconut"], - state: "solid", - density: 1050, -} - -elements.coconut_milk = { - color: "#fffcf2", - behavior: behaviors.LIQUID, - reactions: { - "melted_chocolate": { elem1:"chocolate_milk", elem2:null }, - "chocolate": { elem1:"chocolate_milk", elem2:"melted_chocolate", chance:0.05 }, - "juice": { elem1:"fruit_milk", elem2:null, chance:0.05 }, - "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: 825, - isFood: true -} - -elements.tea.reactions.coconut_milk = { elem2:null, color1:"#ad8955", chance:0.005} -elements.coffee.reactions.coconut_milk = { elem2:"foam", color1:"#856545", chance:0.005} - -elements.cut_coconut = { - color: "#fff2cf", - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "M2|M1|M2", - ], - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "coconut_juice", - state: "solid", - density: 1050, - hidden: true, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#ede9b9", -} - -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" }, - "sand": { elem1: null, elem2: "wet_sand" }, - "clay_soil": { elem1: null, elem2: "clay" }, - "caramel": { color1:"#C8B39A", elem2:null, chance:0.05 }, - }, - tempLow: 0, - tempHigh: 93, - stateHigh: ["sugar","steam"], - viscosity: 1.5, - category: "liquids", - state: "liquid", - density: 1036.86, - hidden: true, - isFood: true -} -eLists.JUICEMIXABLE.push("coconut_juice"); - -elements.lemon_wood = { - color: "#786531", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], -} -elements.lemon_branch = { - color: "#786531", - behavior: [ - "CR:lemon_leaves,lemon_branch%2|CR:lemon_leaves,lemon_leaves,lemon_leaves,lemon_branch%2|CR:lemon_leaves,lemon_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "lemon_wood", - tempLow: -30, - stateLow: "lemon_wood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], - hidden: true, -} -elements.lemon_leaves = { - color: ["#42b336","#46a83b"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:lemon%0.15|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, - seed: "lemon_seed", - hidden: true -} -elements.lemon = { - color: ["#dbd937","#e0dd28"], - behavior: behaviors.POWDER, - 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 }, - "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "lemon_juice", - state: "solid", - density: 1050, - isFood: true, - cutInto: ["lemon_zest","lemon_slice","lemon_slice","lemon_slice","lemon_slice"], - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#b8af4b", -} - -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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - hidden: true, - tempLow: 0, - reactions: { - "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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - hidden: true, - tempLow: 0 -}; - -eLists.JUICEMIXABLE.push("lemonade"); - -elements.lemon_zest = { - color: "#dbc535", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, - reactions: { - "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } - }, -} - -elements.lemon_slice = { - color: "#ebe431", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "lemon_juice", - state: "solid", - density: 1050, - hidden: true, - reactions: { - "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } - }, -} - -elements.lemon_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 ? "lemon_wood" : "lemon_branch",pixel.x,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"lemon_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.carrot_seed = { - color: "#b08d35", - tick: function (pixel) { - if (isEmpty(pixel.x, pixel.y + 1)) { - movePixel(pixel, pixel.x, pixel.y + 1); - } - else { - if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel == 0) { - if (!outOfBounds(pixel.x, pixel.y + 1)) { - var randomNumber1 = Math.round(Math.random()); - pixel.growthpixel = pixel.growthpixel + randomNumber1; - 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") { - deletePixel(pixel.x, pixel.y + 1); - movePixel(pixel, pixel.x, pixel.y + 1); - createPixel("carrot_leaves", pixel.x, pixel.y - 1); - pixel.growthpixel++; - } - } - } - if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 4) { - 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") { - deletePixel(pixel.x, pixel.y + 1); - movePixel(pixel, pixel.x, pixel.y + 1); - createPixel("carrot", pixel.x, pixel.y - 1); - pixel.growthpixel++; - } - } - } - if (!isEmpty(pixel.x, pixel.y + 1) && Math.random() > 0.95 && isEmpty(pixel.x - 1, pixel.y - 1) && isEmpty(pixel.x + 1, pixel.y - 1) && pixel.leafgrown == false) { - 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") { - createPixel("carrot_leaves", pixel.x - 1, pixel.y - 1); - createPixel("carrot_leaves", pixel.x + 1, pixel.y - 1); - pixel.leafgrown = true; - } - } - else if (pixel.age > 150 && pixel.growthpixel == 4 && Math.random() < 0.1) { - changePixel(pixel, "carrot"); - } - pixel.age++; - } - doDefaults(pixel); - }, - properties: { - "age": 0, - "growthpixel": 0, - "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, - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1|XX", - ], -}; - -elements.carrot_leaves = { - color: ["#61cc3d","#58c234"], - behavior: behaviors.WALL, - 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, - seed: "carrot_seed", - hidden: true -} -elements.carrot = { - color: "#e39919", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "carrot_juice", - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#ba8125", -} - -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, - stateHigh: ["steam","sugar"], - burn: 70, - tempLow: 0, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - 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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("apple_cider_vinegar"); - -elements.turnip_seed = { - color: "#994828", - tick: function(pixel) { - if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel == 0) { - 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") { - deletePixel(pixel.x,pixel.y+1); - movePixel(pixel,pixel.x,pixel.y+1); - createPixel("turnip_leaves",pixel.x,pixel.y-1); - pixel.growthpixel++; - } - } - - } - if (pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 3) { - if (!outOfBounds(pixel.x-1,pixel.y)) { - var pixelleft = pixelMap[pixel.x-1][pixel.y]; - if (pixelleft.element === "dirt" || pixelleft.element === "mud" || pixelleft.element === "sand" || pixelleft.element === "wet_sand" || pixelleft.element === "clay_soil" || pixelleft.element === "mycelium") { - deletePixel(pixel.x-1,pixel.y); - createPixel("turnip",pixel.x-1,pixel.y); - } - } - if (!outOfBounds(pixel.x+1,pixel.y)) { - var pixelright = pixelMap[pixel.x+1][pixel.y]; - if (pixelright.element === "dirt" || pixelright.element === "mud" || pixelright.element === "sand" || pixelright.element === "wet_sand" || pixelright.element === "clay_soil" || pixelright.element === "mycelium") { - deletePixel(pixel.x+1,pixel.y); - createPixel("turnip",pixel.x+1,pixel.y); - } - } - } - if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 3) { - 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") { - deletePixel(pixel.x,pixel.y+1); - movePixel(pixel,pixel.x,pixel.y+1); - createPixel("turnip",pixel.x,pixel.y-1); - pixel.growthpixel++; - } - } - - } - if (!isEmpty(pixel.x,pixel.y+1) && Math.random() > 0.95 && isEmpty(pixel.x-1,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && pixel.leafgrown == false) { - 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") { - createPixel("turnip_leaves",pixel.x-1,pixel.y-1); - createPixel("turnip_leaves",pixel.x+1,pixel.y-1); - pixel.leafgrown++ - } - } - else if (pixel.age > 150 && pixel.growthpixel == 3 && Math.random() < 0.1) { - changePixel(pixel,"turnip"); - } - pixel.age++; - doDefaults(pixel); - }, - properties: { - "age":0, - "growthpixel": 0, - "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, - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1|XX", - ], -}; -elements.turnip_leaves = { - color: ["#399431","#3b8c34"], - behavior: behaviors.WALL, - 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, - seed: "turnip_seed", - hidden: true -} -elements.turnip = { - color: ["#945bb3","#a05cbd","#a053b8","#b364c4"], - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: ["steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "turnip_juice", - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#79097d", -} - -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, - stateHigh: ["steam","sugar"], - burn: 70, - tempLow: 0, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, -}; -eLists.JUICEMIXABLE.push("turnip_juice"); - -elements.corn.breakInto ="corn_starch" - -elements.corn_starch = { - color: ["#fcf2e1","#f2e7d3","#fcf3de"], - behavior: behaviors.POWDER, - name: "starch", - reactions: { - "water": { elem1: "dough", elem2: null }, - "salt_water": { elem1: "dough", elem2: null }, - "sugar_water": { elem1: "dough", elem2: null }, - "seltzer": { elem1: "dough", elem2: null }, - "pool_water": { elem1: "dough", elem2: null }, - "juice": { elem1: "dough", elem2: null }, - "yolk": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, - "yogurt": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, - "broth": { elem1:"dough", elem2:null }, - "soda": { elem1:"dough", elem2:null }, - "tea": { elem1:"dough", elem2:null }, - "blood": { elem1:"dough", elem2:null }, - "infection": { elem1:"dough", elem2:null }, - "antibody": { elem1:"dough", elem2:null }, - "milk": { elem1:"dough", elem2:null }, - "cream": { elem1:"dough", elem2:null }, - "melted_butter": { elem1:"sauce", elem2:null, color1:"#DF8D32" }, - }, - category: "food", - tempHigh: 400, - stateHigh: "fire", - burn:40, - burnTime:25, - state: "solid", - density: 600, - isFood: true, - alias:"starch" -} - -elements.baking_powder = { - color: "#fffaf0", - behavior: behaviors.POWDER, - category: "food", - state: "solid", - burn: 40, - tempHigh: 400, - stateHigh: ["salt","carbon_dioxide"], - burnTime: 25, - density: 600, - isFood: true, - reactions: { - "flour": { elem1: "pancake_mix", elem2: null, color1: "#e8b77b"}, - }, -}; - -if (!elements.baking_soda.reactions) elements.baking_soda.reactions = {}; -elements.baking_soda.reactions.neutral_acid = { elem1: "baking_powder", elem2: null } - -elements.pancake_mix = { - color: ["#f2e9c7","#f7ebbe"], - behavior: behaviors.POWDER, - reactions: { - "water": { elem1: "pancake_batter", elem2: null }, - }, - category: "food", - tempHigh: 400, - stateHigh: "fire", - burn:40, - burnTime:25, - state: "solid", - density: 600, - isFood: true -}, - -elements.pancake_batter = { - color: "#e6da9e", - behavior: behaviors.LIQUID, - category: "food", - tempHigh: 70, - stateHigh: "pancake", - stateHighColorMultiplier: 0.9, - burn:40, - burnTime:25, - burnInto:"ash", - state: "liquid", - viscosity: 10000, - density: 1001, - hidden: true, - isFood: true -} -elements.sap.tempHigh = 104, -elements.sap.stateHigh = ["maple_syrup","maple_syrup","maple_syrup","sap"], -elements.maple_syrup = { - color: ["#fabb34","#facc34","#fabb34"], - behavior: behaviors.LIQUID, - tempHigh: 170, - stateHigh: ["sugar","smoke","smoke"], - tempLow: 0, - category:"liquids", - state: "liquid", - viscosity: 15, - hidden: true, - density: 1400 -} -elements.pancake = { - color: "#e0d080", - behavior: behaviors.STURDYPOWDER, - tempHigh: 95, - stateHigh: "crispy_pancake", - category: "food", - burn: 10, - burnTime: 400, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - state: "solid", - density: 233.96, - hidden: true, - isFood: true -} -elements.crispy_pancake = { - color: "#c7a34a", - behavior: behaviors.STURDYPOWDER, - tempHigh: 150, - stateHigh: "burnt_pancake", - category: "food", - burn: 10, - burnTime: 400, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - state: "solid", - density: 233.96, - hidden: true, - isFood: true -} -elements.burnt_pancake = { - color: "#332709", - behavior: behaviors.STURDYPOWDER, - tempHigh: 550, - stateHigh: "ash", - category: "food", - burn: 10, - burnTime: 400, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - state: "solid", - density: 233.96, - hidden: true, - isFood: true -} -elements.strawberry_seed = { - color: "#7a7133", - behavior: behaviors.STURDYPOWDER, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - if (Math.random() < 0.02 && 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(pixel,"strawberry_stem"); - } - } - } - pixel.age++; - } - doDefaults(pixel); - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050, - cooldown: defaultCooldown -} -elements.strawberry_stem = { - color: "#419c2f", - behavior: [ - "CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3", - "CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|XX|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3", - "XX|M1|XX", - ], - 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"); - } - } - } - pixel.age++; - } - doDefaults(pixel); - }, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - properties: { - "age":0 - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050, -} -elements.strawberry_leaves = { - color: "#4bad37", - behavior: [ - "XX|CR:strawberry%2|XX", - "CR:strawberry%2|XX|CR:strawberry%2", - "M2|M1|M2", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -elements.strawberry = { - color: "#f04b3c", - behavior: [ - "XX|ST:strawberry_stem,strawberry_leaves|XX", - "ST:strawberry_stem,strawberry_leaves|XX|ST:strawberry_stem,strawberry_leaves", - "M2|M1|M2", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "strawberry_juice", - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", -} -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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0, - reactions: { - "sugar": { elem1:"strawberry_jam", elem2:null, chance:0.35 }, - "milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1:"#f78888"}, - }, -}; -eLists.JUICEMIXABLE.push("strawberry_juice"); - -elements.cream.onMix = function(cream1, cream2) { - if ((shiftDown && Math.random() < 0.01) || (elements[cream2.element].id === elements.cream.id && Math.random() < 0.1)) { - changePixel(cream1,"whipped_cream") - } - } -elements.whipped_cream = { - color: "#fafafa", - behavior: behaviors.LIQUID, - 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 }, - "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: "food", - hidden: true, - isFood: true, - state: "liquid", - density: 959.97, - viscosity: 2500000 -} - -elements.ginger = { - color: ["#b88f30","#d6a73a"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber%0.5|M1 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber,fiber%0.5|M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber%0.5", - ], - reactions: { - "flour": { elem1:"gingerbread", elem2:null }, - "bread": { elem1:"gingerbread", elem2:null }, - }, - tempHigh: 275, - stateHigh: "dirt", - tempLow: -50, - stateLow: "fiber", - burn: 20, - burnTime: 60, - burnInto: "dirt", - breakInto: "ginger_juice", - category: "food", - state: "solid", - density: 1250, - conduct: 0.1, - hidden: true -} - -elements.ginger_rhizome = { - color: "#c7ad58", - 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,"ginger"); - } - } - if (isEmpty(pixel.x,pixel.y-1)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("ginger_pseudostem",pixel.x,pixel.y+1); - } - if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.2) { - createPixel("ginger_leaves",pixel.x+1,pixel.y); - } - if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.2) { - createPixel("ginger_leaves",pixel.x-1,pixel.y); - } - } - else if (pixel.age > 250) { - changePixel(pixel,"ginger_leaves"); - } - 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, - breakInto: "ginger_juice", - cooldown: defaultCooldown, - seed: true, - behavior: [ - "XX|XX|XX", - "XX|FX%10|XX", - "XX|M1|XX", - ], - reactions: { - "flour": { elem1:"gingerbread", elem2:null }, - "bread": { elem1:"gingerbread", elem2:null }, - }, -}; - -elements.ginger_pseudostem = { - color: "#69a82d", - behavior: behaviors.STURDYPOWDER, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -elements.ginger_leaves = { - color: "#52bd31", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0, - reactions: { - "flour": { elem1:"gingerbread", elem2:null }, - "bread": { elem1:"gingerbread", elem2:null }, - }, -}; -eLists.JUICEMIXABLE.push("ginger_juice"); - - -elements.blueberry_seed = { - color: "#7a7133", - behavior: behaviors.STURDYPOWDER, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - if (Math.random() < 0.02 && 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(pixel,"blueberry_stem"); - } - } - } - pixel.age++; - } - doDefaults(pixel); - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050, - cooldown: defaultCooldown -} -elements.blueberry_stem = { - color: "#419c2f", - behavior: [ - "CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3", - "CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|XX|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3", - "XX|M1|XX", - ], - 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"); - } - } - } - pixel.age++; - } - doDefaults(pixel); - }, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - properties: { - "age":0 - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050, -} -elements.blueberry_leaves = { - color: "#4bad37", - behavior: [ - "XX|CR:blueberry%2|XX", - "CR:blueberry%2|XX|CR:blueberry%2", - "M2|M1|M2", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -elements.blueberry = { - color: "#5d4bc4", - behavior: [ - "XX|ST:blueberry_stem,blueberry_leaves|XX", - "ST:blueberry_stem,blueberry_leaves|XX|ST:blueberry_stem,blueberry_leaves", - "M2|M1|M2", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "blueberry_juice", - state: "solid", - density: 1050, - cutInto: "cut_blueberry", - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#33146e", -} -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, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 30, - tempLow: 0, - reactions: { - "sugar": { elem1:"blueberry_jam", elem2:null, chance:0.35 }, - "milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1: "#995fb3" }, - }, -}; - -eLists.JUICEMIXABLE.push("blueberry_juice"); -/* -elements.fruit_slushie = { - color: "#ffcc54", - behavior: behaviors.LIQUID, - reactions: { - "dirt": { elem1: null, elem2: "mud" }, - "sand": { elem1: null, elem2: "wet_sand" } - }, - temp: -5, - tempHigh: 18, - tempLow: -20, - stateLow: "ice", - stateHigh: "water", - category: "food", - state: "liquid", - density: 95, - viscosity: 100, - hidden: true -} -*/ - -elements.strawberry_jam = { - color: "#c73c3e", - behavior: behaviors.LIQUID, - category: "food", - tempHigh: 400, - stateHigh: ["sugar","smoke"], - burn: 70, - burnTime: 300, - viscosity: 750, - state: "liquid", - density: 825, - hidden: true -}; -elements.blueberry_jam = { - color: "#281C4B", - behavior: behaviors.LIQUID, - category: "food", - tempHigh: 400, - stateHigh: ["sugar","smoke"], - burn: 70, - burnTime: 300, - viscosity: 750, - state: "liquid", - density: 825, - hidden: true -}; -elements.cut_blueberry = { - color: "#d4ed8a", - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "M2|M1|M2", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "juice", - breakIntoColor:"#add69a", - state: "solid", - density: 1050, - hidden: true -} - -if (!elements.yeast.reactions) elements.yeast.reactions = {}; -elements.yeast.reactions.flour = { elem1: "advanced_dough", elem2: null } - -elements.advanced_dough = { - color: "#c49f58", - behavior: behaviors.STURDYPOWDER, - reactions: { - "milk": { elem2:"broth", color2:"#ECC891", tempMin:70 }, - "cream": { elem2:"broth", color2:"#ECC891", tempMin:70 }, - }, - category: "food", - tempHigh: 94, - stateHigh: "bread", - stateHighColorMultiplier: 0.9, - burn:40, - burnTime:25, - burnInto:"ash", - state: "solid", - density: 526.9, - isFood: true, - hidden: true -} - -if (!elements.melted_chocolate.reactions) elements.melted_chocolate.reactions = {}; -elements.melted_chocolate.reactions.flour = { elem1: "cookie_dough", elem2: null } - -elements.cookie_dough = { - color: ["#946826","#9e783f","#8a6d41","#614925"], - behavior: behaviors.STURDYPOWDER, - category: "food", - tempHigh: 94, - stateHigh: "cookie", - stateHighColorMultiplier: 1.1, - burn:40, - burnTime:25, - burnInto:"ash", - state: "solid", - density: 526.9, - isFood: true, - hidden: true -} - -elements.cookie = { - color: "#7d5f2e", - behavior: behaviors.STURDYPOWDER, - tempHigh: 605, - stateHigh: "ash", - category: "food", - burn: 30, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - breakIntoColor: "#7d6216", - state: "solid", - density: 233.96, - isFood: true -} - -elements.nut_oil.name = "cooking_oil" - -elements.bread.behavior = behaviors.SUPPORT - -elements.toast.behavior = behaviors.SUPPORT - -if (!elements.caramel.reactions) elements.caramel.reactions = {}; -elements.caramel.reactions.corn_starch = { elem1: "boba_dough", elem2: null, chance: 0.35, tempMin: 70} - -elements.boba_dough = { - color: ["#4a2007","#2b1304"], - behavior: behaviors.STURDYPOWDER, - category: "food", - tempHigh: 400, - stateHigh: "ash", - stateHighColorMultiplier: 0.8, - burn:40, - burnTime:25, - burnInto:"ash", - state: "solid", - density: 526.9, - reactions: { - "water": { elem1:"boba", tempMin:60}, - }, - isFood: true, - hidden: true -} - -elements.boba = { - color: "#59290c", - behavior: behaviors.POWDER, - tempHigh: 300, - stateHigh: "fire", - category: "food", - burn: 30, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - breakIntoColor: "#7d6216", - state: "solid", - 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", - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#c4b939", -} -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, - hidden: true, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#c4b939", -} -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 }, - "milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"}, - "coconut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"}, - "nut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"} - }, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("banana_juice"); - -elements.banana_bread = { - color: "#c2782f", - desc: "delicious banana bread", - 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 -} -elements.sprinkles = { - color: ["#eb726a", "#ebca6a", "#88eb6a", "#6aaceb", "#eb6ade"], - behavior: behaviors.POWDER, - category: "food", - state: "solid", - desc: "colorful edible sand", - hidden: false, - isFood: true, - burn: 30, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "sugar", - breakIntoColor: ["#fb827a", "#fbda7a", "#98fb7a", "#7abcfb", "#fb7aee"], - tempHigh: 176, - stateHigh: "caramel", - density: 277, - cooldown: 2 -} -elements.chocolate_chips = { - color: "#6e4c1d", - behavior: behaviors.POWDER, - tempHigh: 31, - stateHigh: "melted_chocolate", - category: "food", - state: "solid", - density: 1325, - isFood: true, - desc: "chocolate chips yum", - cooldown: 2 -} -elements.chocolate.breakInto = "chocolate_chips" -//elements.fruit_milk.stateLowColorMultiplier = 0.9 - -elements.passion_fruit_vine = { - color: "#00df00", - behavior: [ - "ST:wood|ST:wood|ST:wood", - "ST:wood AND CR:passion_fruit%0.02|XX|ST:wood AND CR:passion_fruit%0.02", - "ST:wood|ST:wood AND M1|ST:wood", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - breakInto: "dead_plant" -} -elements.passion_fruit_seed = { - color: "#6b4f36", - 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)) { - if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x,pixel.y+1); - } - } - if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); - } - /*if (pixelMap[pixel.x+1][pixel.y-1].element !== "wood" && pixelMap[pixel.x-1][pixel.y-1].element !== "wood") { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x,pixel.y+1); - if (isEmpty(pixel.x+1,pixel.y-1) && pixelMap[pixel.x+2][pixel.y-1].element === "wood") { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); - } - if (isEmpty(pixel.x-1,pixel.y-1) && pixelMap[pixel.x-2][pixel.y-1].element === "wood") { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); - } - }*/ - } - else if (pixel.age > 400 && Math.random() < 0.1) { - changePixel(pixel,"passion_fruit_vine"); - } - 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: [ - "ST:wood,passion_fruit_vine|ST:wood,passion_fruit_vine|ST:wood,passion_fruit_vine", - "ST:wood,passion_fruit_vine|XX|ST:wood,passion_fruit_vine", - "ST:wood,passion_fruit_vine|M1|ST:wood,passion_fruit_vine", - ], -}; - -elements.passion_fruit = { - color: "#78236f", - behavior: [ - "ST:passion_fruit_vine%95|ST:passion_fruit_vine%95|ST:passion_fruit_vine%95", - "ST:passion_fruit_vine%95|XX|ST:passion_fruit_vine%95", - "ST:passion_fruit_vine%95|M1|ST:passion_fruit_vine%95", - ], - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: ["passion_fruit_juice","passion_fruit_juice",/*"passion_fruit_seed"*/], - state: "solid", - density: 1050, - cutInto: "passion_fruit_flesh", - temp:20, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#412e6b" -} -elements.passion_fruit_flesh = { - color: "#ffe205", - behavior: behaviors.LIQUID, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - viscosity: 999, - burnInto: "dead_plant", - breakInto: ["passion_fruit_juice","passion_fruit_juice",/*"passion_fruit_seed"*/], - state: "solid", - density: 1050, - hidden: true, - temp: 20 -} -elements.passion_fruit_juice = { - color: "#d6bf2b", - behavior: behaviors.LIQUID, - category: "liquids", - tempHigh: 100, - stateHigh: ["steam","sugar"], - burn: 70, - burnTime: 300, - burnInto: ["steam", "smoke"], - state: "liquid", - density: 825, - hidden: true, - temp: 20, - onMix: function(pixel) { - if (shiftDown) { - if (Math.random() < 0.2) { - changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel,"#d6bf2b") - } - } - }, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("passion_fruit_juice"); - -elements.mango_wood = { - color: "#966435", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], - hidden: true -} -elements.mango_branch = { - color: "#966435", - behavior: [ - "CR:mango_leaves,mango_branch%2|CR:mango_leaves,mango_branch%2|CR:mango_leaves,mango_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "mango_wood", - tempLow: -30, - stateLow: "mango_wood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], -} -elements.mango_leaves = { - color: ["#61b535","#5fba2f"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:mango%0.1|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 -} -elements.mango = { - color: ["#cc5b3f","#cc8a3f","#ccb93f","#abcc3f"], - behavior: behaviors.POWDER, - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "mango_juice", - cutInto: "cut_mango", - state: "solid", - density: 1050, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#ccb50a", -} - -elements.cut_mango = { - color: "#ebcb2d", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "mango_juice", - state: "solid", - density: 1050, - hidden: true, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#ccb50a", -} - -elements.mango_seed = { - color: "#9e8951", - 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 ? "mango_wood" : "mango_branch",pixel.x,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"mango_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.mango_juice = { - color: "#f0c348", - onMix: function(pixel) { - if (shiftDown) { - if (Math.random() < 0.2) { - changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel,"#f0c348") - } - } - }, - reactions: { - "milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"}, - "coconut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"}, - "nut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"} - }, - 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, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("mango_juice"); - -elements.pineapple_leaves = { - color: "#3aab11", - 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 -} -elements.pineapple = { - color: "#e8bc38", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "pineapple_juice", - state: "solid", - density: 1050, - temp:20, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#ccb90a", -} -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"); - 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+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { - createPixel("pineapple_leaves",pixel.x+1,pixel.y); - createPixel("pineapple_leaves",pixel.x-1,pixel.y); - if (isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x+2,pixel.y-1)) { - createPixel("pineapple_leaves",pixel.x+2,pixel.y-1); - createPixel("pineapple_leaves",pixel.x-2,pixel.y-1); - if (isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { - createPixel("pineapple",pixel.x,pixel.y-1); - createPixel("pineapple",pixel.x+1,pixel.y-1); - createPixel("pineapple",pixel.x-1,pixel.y-1); - if (isEmpty(pixel.x,pixel.y-2) && isEmpty(pixel.x+1,pixel.y-2) && isEmpty(pixel.x-1,pixel.y-2)) { - createPixel("pineapple",pixel.x,pixel.y-2); - createPixel("pineapple",pixel.x+1,pixel.y-2); - createPixel("pineapple",pixel.x-1,pixel.y-2); - if (isEmpty(pixel.x,pixel.y-3) && isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { - createPixel("pineapple",pixel.x,pixel.y-3); - createPixel("pineapple",pixel.x+1,pixel.y-3); - createPixel("pineapple",pixel.x-1,pixel.y-3); - if (isEmpty(pixel.x,pixel.y-4) && isEmpty(pixel.x+1,pixel.y-4) && isEmpty(pixel.x-1,pixel.y-4)) { - createPixel("pineapple",pixel.x,pixel.y-4); - createPixel("pineapple",pixel.x+1,pixel.y-4); - createPixel("pineapple",pixel.x-1,pixel.y-4); - if (isEmpty(pixel.x,pixel.y-5) && isEmpty(pixel.x+1,pixel.y-6) && isEmpty(pixel.x-1,pixel.y-6)) { - createPixel("pineapple_leaves",pixel.x,pixel.y-5); - createPixel("pineapple_leaves",pixel.x+1,pixel.y-6); - createPixel("pineapple_leaves",pixel.x-1,pixel.y-6); - pixel.leafgrown = true - } - } - } - } - } - } - } - } - } - } - } - else if (pixel.age > 500 && pixel.leafgrown == true && Math.random() < 0.1) { - changePixel(pixel,"pineapple_leaves"); - } - } - pixel.age++; - } - doDefaults(pixel); - }, - properties: { - "age":0, - "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|XX|XX", - "XX|M1|XX", - ], -}; -elements.pineapple_juice = { - color: "#d9ba32", - onMix: function(pixel) { - if (shiftDown) { - if (Math.random() < 0.2) { - changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel,"#d9ba32") - } - } - }, - 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, - tempLow: 0 -}; -eLists.JUICEMIXABLE.push("pineapple_juice"); - -elements.lime = { - color: ["#549c2d","#4d9c22"], - behavior: behaviors.POWDER, - 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:"food", - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#5eab24", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "lime_juice", - state: "solid", - density: 1050, - isFood: true, - cutInto: ["lime_zest","lime_slice","lime_slice","lime_slice","lime_slice"], -} - -elements.lime_juice = { - color: "#85d14b", - onMix: function(pixel) { - if (shiftDown) { - if (Math.random() < 0.2) { - changePixel(pixel,"juice") - pixel.color = pixelColorPick(pixel,"#85d14b") - } - } - }, - 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, - hidden: true, - tempLow: 0, -}; -eLists.JUICEMIXABLE.push("lime_juice"); - -elements.lime_zest = { - color: "#4f9e13", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, -} - -elements.lime_slice = { - color: "#8acc33", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "lime_juice", - state: "solid", - density: 1050, - hidden: true, -} - -elements.snail.reactions.nut_oil = { elem1: "escargot", chance:30, tempMin:50 } - -elements.escargot = { - color: "#ab924d", - behavior: behaviors.STURDYPOWDER2, - tempHigh: 120, - stateHigh: "steam", - breakInto: "quicklime", - category: "food", - state: "solid", - density: 1500, - conduct: 0.16 -} - -elements.broccoli = { - color: ["#49a82f","#429929"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "ST:broccoli_stem AND M2|ST:broccoli_stem AND M1|ST:broccoli_stem AND M2", - ], - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - isFood: true, - density: 1050, - cutInto: "cut_broccoli", -} -elements.broccoli_stem = { - color: ["#51c431","#45ba25"], - behavior: behaviors.STURDYPOWDER, - 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:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - burnInto: "dead_plant", - cutInto: "cut_broccoli", - state: "solid", - density: 1050, - hidden: true, -} - -elements.cut_broccoli = { - color: "#75d65a", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: "steam", - burn:65, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, -} - -elements.broccoli_seed = { - color: "#9e8951", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - if (Math.random() < 0.2 && 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) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { - changePixel(pixel,"broccoli_stem"); - createPixel("broccoli",pixel.x,pixel.y-1); - createPixel("broccoli",pixel.x+1,pixel.y-1); - createPixel("broccoli",pixel.x-1,pixel.y-1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"broccoli"); - } - 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|XX|XX", - "XX|M1|XX", - ], -}; -elements.freeze_dried_fruits = { - color: "#ab1f31", - behavior: behaviors.POWDER, - tempHigh: 550, - stateHigh: "ash", - category: "food", - burn: 15, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - state: "solid", - density: 233.96, - isFood: true, -} - -elements.grape.freezeDryInto = "freeze_dried_fruits" -elements.grape.freezeDryIntoColor = "#5d156b" - -elements.soapy_water = { - color: "#72b8f2", - behavior: [ - "XX|CR:bubble%0.25|XX", - "M2%50|XX|M2%50", - "M2%50|M1|M2%50", - ], - tempHigh: 100, - stateHigh: "steam", - tempLow: 0, - category: "liquids", - heatCapacity: 4.184, - reactions: { - "dirt": {elem1: null,elem2: "mud"}, - "sand": { elem1: null, elem2: "wet_sand" }, - "clay_soil": { elem1: null, elem2: "clay" }, - "salt": { elem1: "salt_water", elem2: null, temp1:-20 }, - "dust": { elem2: null, elem2: null }, - "plague": { elem2: null, elem2: null }, - "rust": { elem1: "iron", chance:0.005 }, - "fallout": {elem2: null, chance:0.25 }, - "radiation": { elem2: null, chance:0.25 }, - "uranium": { elem2: null, chance:0.25 }, - "rotten_meat": { elem2: "meat", chance:0.25 }, - "rotten_cheese": { elem2: "cheese", chance:0.25 }, - "cancer": { elem2: null, chance:0.25 }, - "oil": { elem2: null, chance:0.005 }, - "dioxin": { elem1: "dirty_water", chance:0.1 }, - "quicklime": { elem1: "slaked_lime", elem2: "slaked_lime", temp2:100, temp1:100, chance:0.05 }, - "rock": { elem2: "wet_sand", chance: 0.00035 }, - "limestone": { elem2: "wet_sand", chance: 0.00035 }, - "tuff": { elem2: "wet_sand", color2:"#7a6b5c", chance: 0.00035 }, - "mudstone": { elem2: "mud", chance: 0.00035 }, - "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, - "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, - "cured_meat": {elem2:"meat" }, - }, - state: "liquid", - density: 997, - conduct: 0.02, - stain: -1, - extinguish: true -} - -elements.soap.behavior = behaviors.STURDYPOWDER -elements.soap.state = "solid" -elements.soap.category = "powders" - -elements.soap.reactions.water = {elem2: "soapy_water", elem1: null, chance: 10} -/* -if ([pixel.element].stain < 0 && [pixel.element] != "soap" && [pixel.element] != "soapy_water") { - [pixel.element].stain = [pixel.element].stain/10 -} -*/ -elements.onion = { - color: "#731066", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: "steam", - burn:65, - burnTime:60, - burnInto: "steam", - state: "solid", - density: 1050, - cutInto: "cut_onion", - breakInto:"onion_powder", - //cutIntoEmit: "stench", -} -elements.cut_onion = { - color: "#dcc5ed", - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: "steam", - burn:65, - burnTime:60, - burnInto: "steam", - state: "solid", - density: 1050, - breakInto:"onion_powder", - hidden: true, - reactions:{ "nut_oil": {elem1:"fried_onion", tempMin: 70, chance:10}} -} -elements.fried_onion = { - color: "#cf9344", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 500, - stateHigh: "ash", - burn:65, - burnTime:60, - burnInto: "ash", - state: "solid", - density: 1050, - hidden: true, -} - -elements.onion_seed = { - color: "#1a0e02", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - if (Math.random() < 0.2 && 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-2) && isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1) && isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { - createPixel("onion",pixel.x,pixel.y-1); - createPixel("onion",pixel.x+1,pixel.y-1); - createPixel("onion",pixel.x-1,pixel.y-1); - createPixel("onion",pixel.x,pixel.y-2); - createPixel("onion",pixel.x+1,pixel.y); - createPixel("onion",pixel.x-1,pixel.y); - if (isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { - createPixel("plant",pixel.x-1,pixel.y-3); - createPixel("plant",pixel.x+1,pixel.y-3); - changePixel(pixel,"onion"); - } - } - } - 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|XX|XX", - "XX|M1|XX", - ], -} -elements.onion_powder = { - color: "#e6d8b8", - reactions: { - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - }, - behavior: behaviors.POWDER, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"food", - state: "solid", - density: 1400, - isFood: true, -} -elements.unhusked_rice = { - color: ["#c99a42","#b08638","#deb15d"], - behavior: [ - "XX|XX|XX", - "ST:rice_panicle|XX|ST:rice_panicle", - "ST:rice_plant AND M2|ST:rice_panicle AND M1|ST:rice_plant AND M2", - ], - 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:"food", - tempHigh: 65, - stateHigh: "cooked_rice", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "flour", - breakIntoColor: "#f7f1df", - state: "solid", - isFood: true, - density: 1050, - cutInto: "rice", -} -elements.rice = { - color: "#eeeed2", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 65, - stateHigh: "cooked_rice", - burn:65, - burnTime:60, - burnInto: "dead_plant", - breakInto: "rice_flour", - state: "solid", - isFood: true, - density: 1050, - reactions:{ - "water":{elem1:"porridge",elem2:"porridge",chance:3,tempMin:70}, - "nut_oil":{elem1:"fried_rice",elem2:null,chance:3,tempMin:60} - } -} -elements.cooked_rice = { - color: "#eddfb9", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 200, - stateHigh: "burnt_rice", - burn:65, - breakInto: "rice_flour", - state: "solid", - isFood: true, - density: 1050,reactions:{ - "water":{elem1:"porridge",elem2:"porridge",chance:3,tempMin:70}, - "nut_oil":{elem1:"fried_rice",elem2:null,chance:3,tempMin:60} - }, - hidden:true -} -elements.porridge = { - color: "#f2ecdc", - behavior: behaviors.LIQUID, - category:"food", - tempHigh: 200, - stateHigh: "steam", - viscosity: 999, - burn:65, - state: "solid", - isFood: true, - density: 1050, -} -elements.fried_rice = { - color: "#e8dda0", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 200, - stateHigh: "burnt_rice", - burn:65, - burnTime:60, - state: "solid", - isFood: true, - density: 1050,reactions:{ - "salt":{color1:"#ede5b9",elem2:null,chance:3}, - "monosodium_glutamate":{color1:"#ede5b9",elem2:null,chance:3} - }, - hidden:true -} -elements.burnt_rice = { - color: "#262217", - behavior: behaviors.POWDER, - category:"food", - tempHigh: 500, - stateHigh: "ash", - burn:65, - burnTime:60, - state: "solid", - isFood: true, - density: 1050, - hidden: true -} -elements.rice_plant = { - color: "#37a825", - behavior: behaviors.WALL, - category:"life", - tempHigh: 100, - stateHigh: "steam", - burn:65, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, - -} -elements.rice_seed = { - color: "#997a23", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - if (Math.random() < 0.2 && 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-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y)){ - if(pixelMap[pixel.x+1][pixel.y].element === "water" && pixelMap[pixel.x-1][pixel.y].element === "water"){ - if (isEmpty(pixel.x,pixel.y-1)){ - movePixel(pixel,pixel.x,pixel.y-1) - createPixel("rice_plant",pixel.x,pixel.y+1) - pixel.notinwater=true - } - else if (!isEmpty(pixel.x,pixel.y-1)){ - if (pixelMap[pixel.x][pixel.y-1].element === "water") { - deletePixel(pixel.x,pixel.y-1) - movePixel(pixel,pixel.x,pixel.y-1) - createPixel("rice_plant",pixel.x,pixel.y+1) - } - } - } - } - if (Math.random() < 0.2 && pixel.age > 50 && pixel.temp < 100 && pixel.notinwater == true) { - if (isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)&&isEmpty(pixel.x+2,pixel.y-2) && isEmpty(pixel.x-2,pixel.y-2)) { - createPixel("rice_plant",pixel.x+1,pixel.y-1); - createPixel("rice_plant",pixel.x-1,pixel.y-1); - createPixel("rice_plant",pixel.x+2,pixel.y-2); - createPixel("rice_plant",pixel.x-2,pixel.y-2); - pixel.leafgrown = true - } - } - if (Math.random() < 0.2 && pixel.age > 50 && pixel.temp < 100 && pixel.leafgrown == true) { - if (isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x,pixel.y-2)&&isEmpty(pixel.x,pixel.y-3) && isEmpty(pixel.x,pixel.y-4)) { - movePixel(pixel,pixel.x,pixel.y-4) - createPixel("rice_plant",pixel.x,pixel.y+1); - createPixel("rice_plant",pixel.x,pixel.y+2); - createPixel("rice_plant",pixel.x,pixel.y+3); - createPixel("rice_plant",pixel.x,pixel.y+4); - changePixel(pixel,"rice_panicle") - pixel.grower = true - } - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"unhusked_rice"); - } - pixel.age++; - } - doDefaults(pixel); - }, - properties: { - "age":0, - "leafgrown":false, - "notinwater":false, - }, - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -2, - stateLow: "frozen_plant", - burn: 65, - burnTime: 15, - category: "life", - state: "solid", - density: 2500, - cooldown: defaultCooldown, - seed: true, - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1|XX", - ], -}; -elements.rice_panicle = { - color: "#37a825", - behavior: behaviors.WALL, - category:"life", - tempHigh: 100, - stateHigh: "steam", - burn:65, - burnTime:60, - burnInto: "dead_plant", - tick: function(pixel) { - if (Math.random() < 0.1) { - if (isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { - createPixel("unhusked_rice",pixel.x+1,pixel.y); - createPixel("unhusked_rice",pixel.x-1,pixel.y); - } - if (isEmpty(pixel.x+1,pixel.y+1) && isEmpty(pixel.x-1,pixel.y+1)) { - createPixel("unhusked_rice",pixel.x+1,pixel.y+1); - createPixel("unhusked_rice",pixel.x-1,pixel.y+1); - } - if (isEmpty(pixel.x,pixel.y-1)) { - createPixel("unhusked_rice",pixel.x,pixel.y-1); - } - } - }, - state: "solid", - density: 1050, - hidden: true, - -} - -elements.rice_flour = { - color: "#f7f1df", - behavior: behaviors.POWDER, - reactions: { - "water": { elem1: "mochi_dough", elem2: null }, - "salt_water": { elem1: "mochi_dough", elem2: null }, - "sugar_water": { elem1: "mochi_dough", elem2: null }, - "seltzer": { elem1: "mochi_dough", elem2: null }, - "yolk": { elem1: "batter", elem2: null }, - "yogurt": { elem1: "batter", elem2: null }, - "milk": { elem1:"dough", elem2:null }, - "cream": { elem1:"dough", elem2:null }, - }, - category: "food", - tempHigh: 400, - stateHigh: "fire", - burn:40, - burnTime:25, - state: "solid", - density: 600, - isFood: true -}, -elements.mochi_dough = { - color: "#ebddae", - behavior: behaviors.STURDYPOWDER, - onMix: function(dough,ingredient) { - if (elements[ingredient.element].isFood && elements[ingredient.element].id !== elements.dough.id && elements[ingredient.element].id !== elements.flour.id && elements[ingredient.element].id !== elements.batter.id && elements[ingredient.element].id !== elements.bread.id) { - var rgb1 = dough.color.match(/\d+/g); - var rgb2 = ingredient.color.match(/\d+/g); - // average the colors - var rgb = [ - Math.round((parseInt(rgb1[0])*10+parseInt(rgb2[0]))/11), - Math.round((parseInt(rgb1[1])*10+parseInt(rgb2[1]))/11), - Math.round((parseInt(rgb1[2])*10+parseInt(rgb2[2]))/11) - ]; - // convert rgb to hex - var hex = RGBToHex(rgb); - dough.color = pixelColorPick(dough, hex); - } - }, - category: "food", - tempHigh: 94, - stateHigh: "mochi", - //stateHighColorMultiplier: 0.9, - burn:40, - burnTime:25, - burnInto:"ash", - state: "solid", - density: 526.9, - isFood: true, - hidden:true -}, -elements.mochi = { - color: "#f2e2a7", - behavior: behaviors.STURDYPOWDER, - tempHigh: 400, - stateHigh: ["ash","steam"], - category: "food", - burn: 30, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - state: "solid", - density: 233.96, - isFood: true -}, -elements.monosodium_glutamate = { - color: "#eeeeee", - behavior: behaviors.POWDER, - reactions: { - "ice": { elem1:null, elem2:"salt_water", chance:0.1 }, - "rime": { elem1:null, elem2:"salt_water", chance:0.075 }, - "snow": { elem1:null, elem2:"salt_water", chance:0.25 }, - "packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 }, - "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 }, - "water": { elem2: "salt_water", elem1: null, temp2:-20 }, - }, - category: "food", - tempHigh: 801, - state: "solid", - density: 2160, - alias: "msg", -} -elements.seaweed_spore = { - color: "#291f13", - tick: function(pixel) { - pixel.age++; - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else if (!isEmpty(pixel.x,pixel.y+1)){ - if (!outOfBounds(pixel.x,pixel.y+1)) { - if (pixelMap[pixel.x][pixel.y+1].element === "water"){ - swapPixels(pixel,pixelMap[pixel.x][pixel.y+1]) - } - } - } - if (!outOfBounds(pixel.x,pixel.y+1)) { - if (!isEmpty(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.rooted = true - } - } - } - if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rooted == true) { - if(!isEmpty(pixel.x,pixel.y-1)){ - if(pixelMap[pixel.x][pixel.y-1].element === "water"){ - //swapPixels(pixel,pixelMap[pixel.x][pixel.y-1]) - //changePixel("seaweed_stem",pixel.x,pixel.y+1) - deletePixel(pixel.x,pixel.y-1) - movePixel(pixel,pixel.x,pixel.y-1) - createPixel("seaweed_stem",pixel.x,pixel.y+1) - if (!isEmpty(pixel.x-1,pixel.y+1) && !isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.5){ - if (pixelMap[pixel.x-1][pixel.y].element === "water" && pixelMap[pixel.x+1][pixel.y].element === "water" && pixelMap[pixel.x-1][pixel.y+1].element != "seaweed") { - deletePixel(pixel.x-1,pixel.y) - createPixel("seaweed",pixel.x-1,pixel.y) - deletePixel(pixel.x+1,pixel.y) - createPixel("seaweed",pixel.x+1,pixel.y) - } - } - } - } - if (pixel.age > 500 || isEmpty(pixel.x,pixel.y-1)) { - changePixel(pixel,"seaweed"); - } - } - doDefaults(pixel); - }, - properties: { - "age":0, - "rooted":false, - }, - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -2, - stateLow: "frozen_plant", - burn: 65, - burnTime: 15, - category: "life", - state: "solid", - density: 2500, - cooldown: defaultCooldown, - seed: true, - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1|XX", - ], -}; -elements.seaweed_stem = { - color: "#35702c", - behavior: behaviors.STURDYPOWDER, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dried_seaweed", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, -} -elements.seaweed = { - color: ["#2e8021","#3e9031","#4ea041"], - behavior: [ - "XX|XX|XX", - "ST:seaweed_stem|XX|ST:seaweed_stem", - "XX|M1|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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dried_seaweed", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 997, -} -elements.dried_seaweed = { - color: ["#142e13","#041e03"], - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 400, - stateHigh: "fire", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, -} -elements.grape_vine = { - color: "#427a33", - behavior: [ - "ST:wood|ST:wood|ST:wood", - "ST:wood AND CR:grape%0.02|XX|ST:wood AND CR:grape%0.02", - "ST:wood|ST:wood AND M1|ST:wood", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - breakInto: "dead_plant" -} -elements.grape_seed = { - color: "#7a6033", - 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)) { - if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("grape_vine",pixel.x,pixel.y+1); - } - } - if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("grape_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("grape_vine",pixel.x+1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("grape_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("grape_vine",pixel.x+1,pixel.y+1); - } - } - else if (pixel.age > 400 && Math.random() < 0.1) { - changePixel(pixel,"grape_vine"); - } - 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: [ - "ST:wood,grape_vine|ST:wood,grape_vine|ST:wood,grape_vine", - "ST:wood,grape_vine|XX|ST:wood,grape_vine", - "ST:wood,grape_vine|M1|ST:wood,grape_vine", - ], -}; -elements.grape.behavior = [ - "ST:grape_vine%95|ST:grape_vine%95|ST:grape_vine%95", - "ST:grape_vine%95|XX|ST:grape_vine%95", - "M2 AND ST:grape_vine%95|M1|M2 AND ST:grape_vine%95", -] -elements.tomato_vine = { - color: "#2e7d1d", - behavior: [ - "ST:wood|ST:wood|ST:wood", - "ST:wood AND CR:tomato%0.02|XX|ST:wood AND CR:tomato%0.02", - "ST:wood|ST:wood AND M1|ST:wood", - ], - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - breakInto: "dead_plant" -} -elements.tomato_seed = { - color: "#945d26", - 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)) { - if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("tomato_vine",pixel.x,pixel.y+1); - } - } - if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("tomato_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("tomato_vine",pixel.x+1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { - movePixel(pixel,pixel.x+1,pixel.y-1); - createPixel("tomato_vine",pixel.x-1,pixel.y+1); - } - if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { - movePixel(pixel,pixel.x-1,pixel.y-1); - createPixel("tomato_vine",pixel.x+1,pixel.y+1); - } - } - else if (pixel.age > 400 && Math.random() < 0.1) { - changePixel(pixel,"tomato_vine"); - } - 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: [ - "ST:wood,tomato_vine|ST:wood,tomato_vine|ST:wood,tomato_vine", - "ST:wood,tomato_vine|XX|ST:wood,tomato_vine", - "ST:wood,tomato_vine|M1|ST:wood,tomato_vine", - ], -}; -elements.tomato.behavior = [ - "ST:tomato_vine%95|ST:tomato_vine%95|ST:tomato_vine%95", - "ST:tomato_vine%95|XX|ST:tomato_vine%95", - "ST:tomato_vine%95|M1|ST:tomato_vine%95", -] -elements.peppermint_stem = { - color: "#2c9c3a", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - cutInto:"peppermint", - burnInto: "dead_plant", - state: "solid", - density: 1050, - breakInto: "dead_plant", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { - movePixel(pixel,pixel.x,pixel.y+1); - } - if (pixel.grower == true) { - // set limit to 3 + rounded math.random inside the function - // check if left side has stem if no set direction to right - if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x-1][pixel.y].element == "peppermint_stem") { - pixel.direction = "right"; - pixel.limit = 3+Math.round(Math.random()); - } - } - // same thing to set direction the left - else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x+1][pixel.y].element == "peppermint_stem") { - pixel.direction = "left"; - pixel.limit = 3+Math.round(Math.random()); - } - } - } - if (pixel.grower == true && pixel.limit > 0) { - // left - if (pixel.direction == "left") { - if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { - createPixel("peppermint_leaves",pixel.x-1,pixel.y-1); - if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { - createPixel("peppermint_leaves",pixel.x-2,pixel.y-2); - if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { - createPixel("peppermint_leaves",pixel.x-3,pixel.y-3); - if (isEmpty(pixel.x-4,pixel.y-4) && Math.random() < 0.75 && pixel.limit == 4) { - createPixel("peppermint_leaves",pixel.x-4,pixel.y-4); - } - } - } - } - } - // right - else if (pixel.direction == "right") { - if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { - createPixel("peppermint_leaves",pixel.x+1,pixel.y-1); - if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { - createPixel("peppermint_leaves",pixel.x+2,pixel.y-2); - if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { - createPixel("peppermint_leaves",pixel.x+3,pixel.y-3); - if (isEmpty(pixel.x+4,pixel.y-4) && Math.random() < 0.75 && pixel.limit == 4) { - createPixel("peppermint_leaves",pixel.x+4,pixel.y-4); - } - } - } - } - } - } - pixel.age++; - doDefaults(pixel); - }, - properties: { - "grower":false, - "age":0, - "direction":"undefined", - "limit":0 - } -} -elements.peppermint_leaves = { - color: "#36a845", - reactions: { - "water": { elem2:"peppermint_tea", tempMin:80 }, - "salt_water": { elem2:"peppermint_tea", tempMin:80 }, - "sugar_water": { elem2:"peppermint_tea", tempMin:80 }, - "seltzer": { elem2:"peppermint_tea", tempMin:80 }, - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - "yeast": {elem1:"tea", chance:0.01}, - "ice_cream": {elem1:null,color2:"#94e067",chance:0.3} - }, - behavior: behaviors.WALL, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - tempLow: -2, - stateLow: "frozen_plant", - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"food", - state: "solid", - density: 1400, - isFood: true, - cutInto: "peppermint" -}, -elements.peppermint_seed = { - color: "#6b5f4c", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - 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)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("peppermint_stem",pixel.x,pixel.y+1); - pixel.height++; - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("peppermint_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("peppermint_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { - if (isEmpty(pixel.x-1,pixel.y)) { - createPixel("peppermint_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - } - } - if (pixel.height > 11) { - if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { - createPixel("peppermint_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - createPixel("peppermint_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - deletePixel(pixel.x,pixel.y); - } - } - } - 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.peppermint_tea = { - color: "#687d1d", - behavior: behaviors.LIQUID, - reactions: { - "stench": { elem2:null }, - "flea": { elem2:null, chance:0.01 }, - "oxygen": { elem2:"fragrance", chance:0.01 }, - "infection": { elem2:"blood", chance:0.005 }, - "plague": { elem2:null, chance:0.004 }, - "sugar": { elem2:null, color1:"#8f5a21", chance:0.005}, - "honey": { elem2:null, color1:"#8f5a21", chance:0.005}, - "milk": { elem2:null, color1:"#9c6c38", chance:0.005}, - "cream": { elem2:null, color1:"#9c6c38", chance:0.005}, - "ice_cream": { elem2:null, color1:"#9c6c38", chance:0.005}, - "honey": {color1:"#8d8f27",elem2:null,chance:0.3}, - "lemon_juice": {color1:"#8d8f27",elem2:null,chance:0.3}, - "lemonade": {color1:"#8d8f27",elem2:null,chance:0.3}, - "sugar": {color1:"#83963e",elem2:null,chance:0.3} - }, - tempHigh: 125, - stateHigh: ["steam","fragrance",null], - temp: 50, - tempLow: 0, - category:"liquids", - state: "liquid", - density: 1001, - stain: -0.1, - hidden: true, - isFood: true -} -elements.peppermint = { - color: ["#64a135","#559425"], - reactions: { - "water": { elem2:"peppermint_tea", tempMin:80 }, - "salt_water": { elem2:"peppermint_tea", tempMin:80 }, - "sugar_water": { elem2:"peppermint_tea", tempMin:80 }, - "seltzer": { elem2:"peppermint_tea", tempMin:80 }, - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - "ice_cream": {elem1:null,color2:"#94e067",chance:0.3}, - }, - behavior: behaviors.POWDER, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"food", - state: "solid", - density: 1400, - isFood: true, -} -//elements.candy.reactions.peppermint = {color1:["eeeddc","f5f267"],elem2:null,chance:3} -elements.vanilla_stem = { - color: "#5d9c48", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, - breakInto: "dead_plant", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { - movePixel(pixel,pixel.x,pixel.y+1); - } - if (pixel.grower == true) { - // check if left side has stem if no set direction to right - if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x-1][pixel.y].element == "vanilla_stem") { - pixel.direction = "right"; - } - } - // same thing to set direction the left - else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x+1][pixel.y].element == "vanilla_stem") { - pixel.direction = "left"; - } - } - } - if (pixel.grower == true) { - // left - if (pixel.direction == "left") { - if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { - createPixel("vanilla_leaves",pixel.x-1,pixel.y-1); - if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { - createPixel("vanilla_leaves",pixel.x-2,pixel.y-2); - if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { - createPixel("vanilla_leaves",pixel.x-3,pixel.y-3); - } - } - } - } - // right - else if (pixel.direction == "right") { - if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { - createPixel("vanilla_leaves",pixel.x+1,pixel.y-1); - if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { - createPixel("vanilla_leaves",pixel.x+2,pixel.y-2); - if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { - createPixel("vanilla_leaves",pixel.x+3,pixel.y-3); - } - } - } - } - } - pixel.age++; - doDefaults(pixel); - }, - properties: { - "grower":false, - "age":0, - "direction":"undefined", - } -} -elements.vanilla_leaves = { - color: "#5d9c48", - reactions: { - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - "yeast": {elem1:"tea", chance:0.01}, - }, - tick: function(pixel) { - if (isEmpty(pixel.x-1,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y+1) && Math.random() < 0.03) { - createPixel("vanilla_flower",pixel.x-1,pixel.y-1); - } - if (isEmpty(pixel.x+1,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y+1) && Math.random() < 0.03) { - createPixel("vanilla_flower",pixel.x+1,pixel.y-1); - } - pixel.age++; - doDefaults(pixel); - }, - behavior: behaviors.WALL, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - tempLow: -2, - stateLow: "frozen_plant", - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"life", - state: "solid", - density: 1400, - isFood: true, - hidden:true -}, -elements.vanilla_seed = { - color: "#806d3b", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - 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)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("vanilla_stem",pixel.x,pixel.y+1); - pixel.height++; - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("vanilla_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("vanilla_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { - if (isEmpty(pixel.x-1,pixel.y)) { - createPixel("vanilla_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - } - } - if (pixel.height > 11) { - if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { - createPixel("vanilla_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - createPixel("vanilla_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - deletePixel(pixel.x,pixel.y); - } - } - } - 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.vanilla_flower = { - color: "#f7f4e1", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - tick: function(pixel) { - if (pixel.age > 175 && pixel.pod == true) { - changePixel(pixel,"vanilla_pod") - } - if (isEmpty(pixel.x,pixel.y+1) && Math.random() < 0.03 && pixel.pod == false && pixel.harvested == false) { - createPixel("vanilla_flower",pixel.x,pixel.y+1); - pixelMap[pixel.x][pixel.y+1].pod = true; - if (Math.random < 0.5) { - pixel.harvested = true; - } - } - pixel.age++ - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - properties: { - "age":0, - "pod":false, - "harvested":false, - } -} - -elements.vanilla_pod = { - color: "#36281d", - behavior: [ - "XX|ST:vanilla_flower|XX", - "XX|XX|XX", - "XX|M1|XX", - ], - reactions: { - "alcohol": { elem1:"vanilla_essence", elem2:null, chance:0.035 }, - }, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, -} -elements.ice_cream.reactions = {} -elements.ice_cream.reactions.vanilla_essence = {color1:"#fff7b6", elem2:null, chance:0.35} -elements.vanilla_essence = { - color: "#9c7211", - behavior: behaviors.LIQUID, - tempHigh: 170, - stateHigh: ["sugar","smoke","smoke"], - tempLow: 0, - category:"liquids", - state: "liquid", - density: 1400, -} - -elements.candy.reactions = {} -elements.candy.reactions.peppermint = {elem1:"peppermint_candy", elem2:null, chance:0.35} -elements.peppermint_candy = { - color: ["#fa5e3e","#fff5f5"], - behavior: behaviors.WALL, - tempHigh: 204.44, - stateHigh: "smoke", - category: "food", - state: "solid", - density: 850, - isFood: true -} -elements.tapioca = { - color: "#ded58e", - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber%0.5|M1 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber,fiber%0.5|M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber%0.5", - ], - tempHigh: 275, - stateHigh: "dirt", - tempLow: -50, - stateLow: "fiber", - burn: 20, - burnTime: 60, - burnInto: "dirt", - breakInto: "corn_starch", - category: "food", - state: "solid", - density: 1250, - conduct: 0.1, - hidden: true, - darkText: true, - desc:'a wise icyking once said: \'state:"burn 100"\'', - alias:["element that i made before icyking","burn 100 element"] -} - -elements.tapioca_seed = { - color: "#a78d38", - 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,"tapioca"); - } - } - if (isEmpty(pixel.x,pixel.y-1)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("tapioca_stem",pixel.x,pixel.y+1); - } - if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.2) { - createPixel("tapioca_leaves",pixel.x+1,pixel.y); - } - if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.2) { - createPixel("tapioca_leaves",pixel.x-1,pixel.y); - } - } - else if (pixel.age > 250) { - changePixel(pixel,"tapioca_leaves"); - } - 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.tapioca_stem = { - color: "#358f35", - behavior: behaviors.STURDYPOWDER, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -elements.tapioca_leaves = { - color: "#3e823e", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - breakInto: "dead_plant", - state: "solid", - density: 1050 -} -elements.sprinkle_bomb = { - color: ["#eb726a", "#ebca6a", "#88eb6a", "#6aaceb", "#eb6ade"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1 AND EX:10>sprinkles|XX", - ], - category: "food", - state: "solid", - density: 1300, - excludeRandom: true, - cooldown: defaultCooldown -} - -elements.chilli_stem = { - color: "#5d9c48", - behavior: behaviors.WALL, - 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 }, - "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, - "stench": { elem2:null, chance:0.25 }, - "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, - }, - category:"life", - tempHigh: 100, - stateHigh: "dead_plant", - tempLow: -1.66, - stateLow: "frozen_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - hidden: true, - breakInto: "herb", - breakIntoColor:"#245c1b", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { - movePixel(pixel,pixel.x,pixel.y+1); - } - if (pixel.grower == true) { - // check if left side has stem if no set direction to right - if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x-1][pixel.y].element == "chilli_stem") { - pixel.direction = "right"; - } - } - // same thing to set direction the left - else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { - if (pixelMap[pixel.x+1][pixel.y].element == "chilli_stem") { - pixel.direction = "left"; - } - } - } - if (pixel.grower == true) { - // left - if (pixel.direction == "left") { - if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { - createPixel("chilli_leaves",pixel.x-1,pixel.y-1); - if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { - createPixel("chilli_leaves",pixel.x-2,pixel.y-2); - if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { - createPixel("chilli_leaves",pixel.x-3,pixel.y-3); - } - } - } - } - // right - else if (pixel.direction == "right") { - if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { - createPixel("chilli_leaves",pixel.x+1,pixel.y-1); - if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { - createPixel("chilli_leaves",pixel.x+2,pixel.y-2); - if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { - createPixel("chilli_leaves",pixel.x+3,pixel.y-3); - } - } - } - } - } - pixel.age++; - doDefaults(pixel); - }, - properties: { - "grower":false, - "age":0, - "direction":"undefined", - } -} -elements.chilli_leaves = { - color: "#5d9c48", - reactions: { - "water": { elem2:"chilli_tea", tempMin:80 }, - "salt_water": { elem2:"chilli_tea", tempMin:80 }, - "sugar_water": { elem2:"chilli_tea", tempMin:80 }, - "seltzer": { elem2:"chilli_tea", tempMin:80 }, - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - "yeast": {elem1:"tea", chance:0.01}, - }, - tick: function(pixel) { - if (isEmpty(pixel.x-1,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y+1) && Math.random() < 0.03) { - createPixel("chilli",pixel.x-1,pixel.y-1); - } - if (isEmpty(pixel.x+1,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y+1) && Math.random() < 0.03) { - createPixel("chilli",pixel.x+1,pixel.y-1); - } - pixel.age++; - doDefaults(pixel); - }, - behavior: behaviors.WALL, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - tempLow: -2, - stateLow: "frozen_plant", - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"life", - state: "solid", - density: 1400, - isFood: true, - hidden:true, - breakInto: "herb", - breakIntoColor:"#245c1b", -}, -elements.chilli_seed = { - color: "#806d3b", - tick: function(pixel) { - if (isEmpty(pixel.x,pixel.y+1)) { - movePixel(pixel,pixel.x,pixel.y+1); - } - else { - 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)) { - movePixel(pixel,pixel.x,pixel.y-1); - createPixel("chilli_stem",pixel.x,pixel.y+1); - pixel.height++; - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("chilli_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("chilli_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - } - } - if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { - if (isEmpty(pixel.x-1,pixel.y)) { - createPixel("chilli_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - } - } - if (pixel.height > 11) { - if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { - createPixel("chilli_stem",pixel.x-1,pixel.y); - pixelMap[pixel.x-1][pixel.y].grower = true; - createPixel("chilli_stem",pixel.x+1,pixel.y); - pixelMap[pixel.x+1][pixel.y].grower = true; - deletePixel(pixel.x,pixel.y); - } - } - } - 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.chilli = { - color: "#ba3030", - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "ST:chilli_leaves|M1|ST:chilli_leaves", - ], - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:15, - burnTime:60, - burnInto: "dead_plant", - state: "solid", - density: 1050, - breakInto: "chilli_powder", - reactions: { - "sauce": {elem1:null, elem2:"hot_sauce", chance:2} - }, -} -elements.chilli_powder = { - color: "#a32121", - reactions: { - "stench": { elem2:null, chance:0.25 }, - "steam": { elem2:"fragrance", chance:0.1 }, - "flea": { elem2:null, chance:0.01 }, - "termite": { elem2:null, chance:0.01 }, - "fly": { elem2:null, chance:0.01 }, - "ant": { elem2:null, chance:0.01 }, - "stink_bug": { elem2:null, chance:0.01 }, - "sauce": {elem1:null, elem2:"hot_sauce", chance:2} - }, - behavior: behaviors.POWDER, - tempHigh: 300, - stateHigh: ["fire","smoke","smoke","smoke","ash"], - burn:10, - burnTime:300, - burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], - category:"food", - state: "solid", - density: 1400, - isFood: true, -} -elements.hot_sauce = { - color: "#a31414", - behavior: behaviors.LIQUID, - reactions: { - "stench": { elem2:null }, - }, - viscosity: 2600, - tempHigh: 260, - stateHigh: ["steam","salt","fragrance"], - tempLow: -2, - category:"food", - state: "liquid", - density: 1031.33, - stain: 0.01, - isFood: true -} -elements.head.reactions.hot_sauce = {elem2:["smoke","fire",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], chance:3} - - -elements.durian_wood = { - color: "#5e4b23", - behavior: behaviors.WALL, - tempHigh: 400, - stateHigh: ["ember","charcoal","fire","fire","fire"], - category: "solids", - burn: 5, - burnTime: 300, - burnInto: ["ember","charcoal","fire"], - state: "solid", - hardness: 0.15, - breakInto: "sawdust", - breakIntoColor: ["#dba66e","#cc8a64"], - hidden: true -} -elements.durian_branch = { - color: "#5e4b23", - behavior: [ - "CR:durian_leaves,durian_branch%2|CR:durian_leaves,durian_branch%2|CR:durian_leaves,durian_branch%2", - "XX|XX|XX", - "XX|XX|XX", - ], - tempHigh: 100, - stateHigh: "durian_wood", - tempLow: -30, - stateLow: "durian_wood", - category: "life", - burn: 40, - burnTime: 50, - burnInto: ["sap","ember","charcoal"], - hidden: true, - state: "solid", - density: 1500, - hardness: 0.15, - breakInto: ["sap","sawdust"], -} -elements.durian_leaves = { - color: ["#326b25","#2e751e"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:durian%0.1|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 -} -elements.durian = { - color: ["#578524","#5b8f1f"], - behavior: behaviors.POWDER, - category:"food", - tempHigh: 100, - stateHigh: "dead_plant", - burn:65, - burnTime:60, - cutInto: "cut_durian", - state: "solid", - density: 1050, -} - -elements.cut_durian = { - color: ["#e3e04b","#d1cf36"], - behavior: behaviors.STURDYPOWDER, - category:"food", - tempHigh: 100, - stateHigh: ["sugar","steam"], - burn:65, - burnTime:60, - state: "solid", - density: 1050, - hidden: true, - freezeDryInto: "freeze_dried_fruits", - freezeDryIntoColor: "#a19f3b", -} - -elements.durian_seed = { - color: "#a17d3b", - 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 ? "durian_wood" : "durian_branch",pixel.x,pixel.y+1); - } - } - else if (pixel.age > 1000) { - changePixel(pixel,"durian_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.egg_white = { - color: "#edece8", - behavior: behaviors.LIQUID, - tempHigh: 100, - stateHigh: "hard_egg_white", - tempLow: 0, - stateLow: "hard_egg_white", - category: "food", - state: "liquid", - density: 1027.5, - viscosity: 270, - isFood: true, - whiskInto: "whisked_egg_white", -} -elements.hard_egg_white = { - color: "#dedddc", - behavior: behaviors.STURDYPOWDER, - tempHigh: 400, - stateHigh: "smoke", - category: "food", - hidden: true, - isFood: true, - state: "solid", - density: 1031 -} -elements.milk.whiskInto = "cream"; -elements.cream.whiskInto = "whipped_cream"; -elements.egg.breakInto = ["egg_white","egg_white","yolk"] - -elements.whisked_egg_white ={ - color: "#fefefe", - behavior: behaviors.LIQUID, - reactions: { - "corn_syrup": { elem1: "marshmallow", elem2: null, chance: 2 }, - "sugar": { elem1: "marshmallow", elem2: null, chance: 2 }, - }, - viscosity: 1.5, - tempHigh: 1000, - stateHigh: ["smoke","steam"], - category: "food", - hidden: true, - isFood: true, - state: "liquid", - density: 959.97, -} -elements.marshmallow = { - color: "#fafafa", - behavior: [ - "XX|XX|XX", - "ST:wood|XX|ST:wood", - "XX|M1|XX", - ], - viscosity: 1.5, - tempHigh: 70, - stateHigh: "cooked_marshmallow", - category: "food", - isFood: true, - state: "solid", - density: 959.97, -} -elements.cooked_marshmallow = { - color: "#f0dbb6", - behavior: [ - "XX|XX|XX", - "ST:wood|XX|ST:wood", - "XX|M1|XX", - ], - viscosity: 1.5, - tempHigh: 150, - stateHigh: "burnt_marshmallow", - category: "food", - isFood: true, - state: "solid", - density: 959.97, - hidden:true -} -elements.burnt_marshmallow = { - color: "#29231a", - behavior: [ - "XX|XX|XX", - "ST:wood|XX|ST:wood", - "XX|M1|XX", - ], - viscosity: 1.5, - tempHigh: 1000, - stateHigh: ["steam","caramel"], - category: "food", - isFood: true, - state: "solid", - density: 959.97, - hidden:true -} -eLists.FOODCOLORINGIGNORE = ["glass", "porcelain", "wall","iron","steel","copper","silver","aluminum","tungsten","gold","plastic"]; -elements.food_coloring = { - color: ["#ff0000", "#ff8800", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"], - behavior: behaviors.LIQUID, - customColor: true, - stain: 0.5, - tempHigh: 100, - stateHigh: "steam", - category: "food", - state: "liquid", - density: 998, - stainSelf: true, - ignore: ["glass", "porcelain", "wall","iron","steel","copper","silver","aluminum","tungsten","gold","plastic"], - desc: "coloring for food. color may fade when diluting with water.", - onMix: function (pixel) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x + coord[0]; - var y = pixel.y + coord[1]; - if (!isEmpty(x, y, true)) { - if (pixelMap[x][y].element === "water" || pixelMap[x][y].element === "salt_water" || pixelMap[x][y].element === "sugar_water" || pixelMap[x][y].element === "seltzer" || pixelMap[x][y].element === "dirty_water" || pixelMap[x][y].element === "pool_water") { - changePixel(pixelMap[x][y], "food_coloring"); - let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixelMap[x][y].color), 0.5); - pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; - pixelMap[x][y].color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; - } - else { - if (!outOfBounds(pixelMap[x][y])) { - if (!eLists.FOODCOLORINGIGNORE.includes(pixelMap[x][y].element) && pixelMap[x][y].element !== "glass" && pixelMap[x][y].element !== "porcelain" && pixelMap[x][y].element !== "wall" && pixelMap[x][y].element !== "plastic") { - let newrgb2 = interpolateRgb(getRGB(pixel.color), getRGB(pixelMap[x][y].color), 0.9); - pixelMap[x][y].color = `rgb(${parseInt(newrgb2.r)},${parseInt(newrgb2.g)},${parseInt(newrgb2.b)})`; - if (Math.random() < 0.002) { - deletePixel(pixel.x,pixel.y) - } - } - } - } - } - } - }, - onSelect: function () { - logMessage("Tip: You can spread food coloring using water."); - }, -} - -elements.cooked_meat.behavior = behaviors.SUPPORT; - -elements.cake_batter = { - color: "#d4bc85", - behavior: behaviors.LIQUID, - onMix: function(batter,ingredient) { - if (elements[ingredient.element].isFood && elements[ingredient.element].id !== elements.batter.id && elements[ingredient.element].id !== elements.flour.id && elements[ingredient.element].id !== elements.yolk.id && elements[ingredient.element].id !== elements.dough.id && elements[ingredient.element].id !== elements.baked_batter.id && elements[ingredient.element].id !== elements.cake.id && elements[ingredient.element].id !== elements.cake_batter.id) { - var rgb1 = batter.color.match(/\d+/g); - var rgb2 = ingredient.color.match(/\d+/g); - // average the colors - var rgb = [ - Math.round((parseInt(rgb1[0])*10+parseInt(rgb2[0]))/11), - Math.round((parseInt(rgb1[1])*10+parseInt(rgb2[1]))/11), - Math.round((parseInt(rgb1[2])*10+parseInt(rgb2[2]))/11) - ]; - // convert rgb to hex - var hex = RGBToHex(rgb); - batter.color = pixelColorPick(batter, hex); - if ((elements[ingredient.element].density > elements.batter.density || shiftDown) && Math.random() < 0.05) { - // 50% change to delete ingredient - if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); } - else { - ingredient.color = pixelColorPick(ingredient, hex); - } - } - } - }, - reactions: { - "cream": { elem2:"cake_batter", tempMin:40, chance:0.01 }, - }, - category: "food", - tempHigh: 94, - stateHigh: "cake", - stateHighColorMultiplier: 0.9, - burn:40, - burnTime:25, - burnInto:"ash", - state: "liquid", - viscosity: 10000, - density: 1001, - hidden: true, - isFood: true -} -elements.batter.whiskInto = "cake_batter"; -elements.milk.stateHigh = ["steam","steam","condensed_milk"]; -elements.condensed_milk = { - color: "#f2f0df", - behavior: behaviors.LIQUID, - reactions: { - "cell": { elem1:"yogurt", 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": { color1:"#fffbf0", elem2:null, chance:0.5}, - }, - tempLow: 0, - stateLow: "ice_cream", - stateLowColorMultiplier: [0.97,0.93,0.87], - tempHigh: 500, - stateHigh: ["smoke","smoke","smoke","quicklime"], - viscosity: 1500, - category: "food", - state: "liquid", - density: 1036.86, - isFood: true, - alias: "evaporated_milk" -} -elements.wasabi = { - color: ["#82b55b","#6cad50","#7dcc5c"], - behavior: behaviors.STURDYPOWDER2, - 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 }, - "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"], - category: "food", - isFood: true, - state: "solid", - density: 959.97, -} -// extremely confused part -elements.beans.name = "baked_beans"; -elements.real_beans = { - name: "beans", - color: ["#e8dfc5","#d1c7ab"], - behavior: behaviors.POWDER, - category: "food", - tempHigh: 350, - stateHigh: ["fire","fire","ash"], - burn:3, - burnTime:500, - burnInto: ["fire","smoke","smoke","steam","ash"], - reactions: { - "sauce": { elem1: "beans", elem2: "beans" }, - "yeast": { elem1: "fermented_beans", elem2: null, chance:0.5 } - }, - state: "solid", - density: 721, - isFood: true, - alias: "soy_beans" -} -elements.fermented_beans = { - color:"#ada386", - behavior: behaviors.POWDER, - category: "food", - tempHigh: 350, - stateHigh: ["fire","fire","ash"], - burn:3, - burnTime:500, - burnInto: ["fire","smoke","smoke","steam","ash"], - state: "solid", - density: 721, - breakInto: "soy_sauce", - isFood: true, - alias: "natto" -} -elements.soy_sauce = { - color: "#480601", - behavior: behaviors.LIQUID, - tempLow: -5, - tempHigh: 105, - stateHigh: ["steam","steam","salt"], - state: "liquid", - category:"food", - density: 1200, -}; -// end of confused part - -elements.ice.breakInto = "slush"; - -elements.cracker_dough = { - color: "#dbd19a", - behavior: behaviors.STURDYPOWDER, - category: "food", - tempHigh: 94, - stateHigh: "cracker", - stateHighColorMultiplier: 1.1, - burn:40, - burnTime:25, - burnInto:"ash", - state: "solid", - density: 526.9, - isFood: true, - hidden: true -} - -elements.cracker = { - color: "#e0ddb8", - behavior: behaviors.STURDYPOWDER, - tempHigh: 605, - stateHigh: "ash", - category: "food", - burn: 30, - burnTime: 200, - burnInto: ["smoke","smoke","smoke","ash"], - breakInto: "crumb", - state: "solid", - density: 233.96, - isFood: true -} - -elements.agar = { - color: "#e0e0e0", - behavior: behaviors.POWDER, - reactions: { - "ice": { elem1:null, elem2:"salt_water", chance:0.1 }, - "rime": { elem1:null, elem2:"salt_water", chance:0.075 }, - "snow": { elem1:null, elem2:"salt_water", chance:0.25 }, - "packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 }, - "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 } - }, - category: "food", - tempHigh: 801, - state: "solid", - density: 2160, - alias: "gelatin" -} -// thanks to adora -elements.agar.reactions.juice = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ - let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); - pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; -}} -elements.agar.reactions.water = {elem1:"jelly",elem2:null,color1:"#e0e0e0",chance:0.05} - -elements.duck = { - color: ["#826c4e", "#2b5927", "#d6d6d6", "#7d4a2c"], - behavior: [ - "M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1|M2%2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%50|M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1", - "M2%10|XX|M2%10", - "XX|M1%33|XX", - ], - category:"life", - state: "solid", - reactions: { - "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "worm": { elem2: "crushed_worm", chance:0.3}, - "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, - "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - }, - egg: "duck_egg", - foodNeed: 10, - temp: 40, - tempHigh: 75, - stateHigh: "cooked_duck", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "raw_duck", - burn:85, - burnTime:450, - state: "solid", - density: 1117, - conduct: 0.3, - cutInto: "raw_duck", -}; - -elements.duck_egg = { - color: "#e0d3ab", - behavior: behaviors.STURDYPOWDER2, - tick: function(pixel) { - if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) { - changePixel(pixel,"duckling") - } - doDefaults(pixel); - }, - category: "food", - state: "solid", - temp: 20, - tempLow: -18, - stateLow: "frozen_duck_egg", - breakInto: ["yolk"], - tempHigh: 400, - stateHigh: ["calcium", "ash"], - burn:50, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - reactions: { - "water": { elem2:null, elem1:"hard_boiled_egg", chance:10, tempMin:80 } - } -}; -elements.frozen_duck_egg = { - color: "#e0d3cf", - behavior: behaviors.POWDER, - category: "food", - state: "solid", - temp: -20, - tempHigh: 10, - stateHigh: "duck_egg", - breakInto: ["calcium", "hard_yolk"], - burn:50, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - hidden: true, -}; -elements.duckling = { - color: ["#f0eba8", "#f0eba8"], - behavior: [ - "M2%1|M2%2|M2%1", - "M2%10|FX%5 AND CH:duck%0.1|M2%10", - "XX|M1%33|XX", - ], - category: "life", - state: "solid", - egg: "duck_egg", - foodNeed: 20, - temp: 40, - tempHigh: 75, - stateHigh: "cooked_meat", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "blood", - burn:85, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - reactions: { - "crushed_worm": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL}, - "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "worm": { elem2: "crushed_worm", chance:0.3}, - "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, - "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, - "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, - "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, - "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - } -}; - -elements.barbecued_duck = { - color:["#a67d2d","#9c721f"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} -elements.steamed_duck = { - color:["#e8cb7b", "#d6bf7e"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:50, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} - -elements.smoked_duck = { - color:["#6b470e", "#8f5b09"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} -elements.cooked_duck = { - color: ["#a38046", "#b39652"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 40, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -}; - -elements.raw_duck = { - color: ["#d6a587", "#c99873"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - burnInto: "cooked_duck", - temp:25, - tempHigh: 600, - stateHigh: ["cooked_duck"], - reactions: { - "smoke": {elem1: "smoked_duck"}, - "steam": {elem1: "steamed_duck"}, - "water": {elem1: "boiled_duck", tempMin: 70}, - "nut_oil": {elem1: "fried_duck", tempMin: 70}, - "charcoal": {elem1: "barbecued_duck", tempMin: 70}, - "fire": {elem1: "barbecued_duck"} - } -}; - -elements.boiled_duck = { - color: ["#e0d4a4", "#e0d4a4"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - isFood: true, - temp: 65, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -} - -elements.fried_duck = { - color: ["#c49543", "#b88835", "#b07b20", "#996e23"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - isFood: true, - temp: 90, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, -} -// side note: i don't eat beef -elements.cow = { - color: ["#292928", "#332b23", "#e0dfde", "#f0edeb"], - behavior: [ - "M2%1|XX|M2%1", - "M2%10|XX|M2%10", - "XX|M1|XX", - ], - category:"life", - state: "solid", - reactions: { - "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - }, - egg: "calf", - foodNeed: 10, - temp: 40, - tempHigh: 75, - stateHigh: "steak", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "raw_beef", - burn:85, - burnTime:450, - state: "solid", - density: 1117, - conduct: 0.3, - cutInto: "raw_beef", -}; -elements.calf = { - color: ["#363535", "#bdbdbd"], - behavior: [ - "M2%1|XX|M2%1", - "M2%10|FX%5 AND CH:cow%0.1|M2%10", - "XX|M1|XX", - ], - category: "life", - state: "solid", - foodNeed: 20, - temp: 40, - tempHigh: 75, - stateHigh: "steak", - tempLow: -18, - stateLow: "frozen_meat", - breakInto: "blood", - burn:85, - burnTime:450, - state: "solid", - density: 900, - conduct: 0.1, - reactions: { - "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, - "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, - "lichen": { 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 }, - "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, - }, -}; - -elements.barbecued_steak = { - color:["#3b271a","#29180d"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} - -elements.smoked_beef = { - color:["#3b1911", "#3b2719"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp:55, - tempHigh: 600, - stateHigh: ["ash","smoke"], - isFood: true, - hidden: true, -} -elements.steak = { - color: ["#a38046", "#b39652"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - temp: 40, - tempHigh: 600, - stateHigh: ["ash", "smoke"], - hidden: true, - alias: "cooked_beef" -}; - -elements.raw_beef = { - color: ["#ab5841", "#ab322e"], - behavior: behaviors.STURDYPOWDER, - category: "food", - state: "solid", - burnInto: "steak", - temp:25, - tempHigh: 600, - stateHigh: ["steak"], - reactions: { - "smoke": {elem1: "smoked_beef"}, - "charcoal": {elem1: "barbecued_beef", tempMin: 70}, - "fire": {elem1: "barbecued_beef"} - } -}; - -elements.juice.reactions.milk = { 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)})`; -}} -elements.juice.reactions.cream = { 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)})`; -}} -elements.soda.reactions.soda = { - 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.reactions.soda = { - chance:70, - 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); - changePixel(pixelMap[pixel1.x][pixel1.y],"soda") - pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; - pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; - } - } - } -} -if (!elements.orange_juice.reactions) { elements.orange_juice.reactions = {} } -elements.orange_juice.reactions.seltzer = { elem1:"soda", elem2:"foam", color1:"#ffb319"} -elements.orange_juice.reactions.carbon_dioxide = { elem1:"soda", elem2:"foam", color1:"#ffb319"} -elements.agar.reactions.soda = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ - let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); - pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; -}} -elements.hard_jelly = { - color: "#c372b8", - behavior: behaviors.STURDYPOWDER, - tempHigh: 200, - stateHigh: ["smoke","sugar"], - category: "food", - state: "solid", - density: 1245, - isFood: true, - hidden: true, - temp: 0 -} -elements.jelly.stateLow = "hard_jelly" -elements.jelly.stateLowColorMultiplier = 1.2 -elements.jelly.temp = 0 - -elements.nut.name = "peanut"; -elements.nut_meat.name = "peanut_meat"; -elements.nut_butter.name = "peanut_butter"; +fetch('https://raw.githubusercontent.com/SquareScreamYT/aChefsDream.js/main/aChefsDream.js') + .then(response => response.text()) + .then(code => { + eval(code); + }) + .catch(error => { + console.error('Error fetching or executing code:', error); + }); From d020e681813d7d7b9ad60f17ddd6db9c29effd8c Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:56:05 +0800 Subject: [PATCH 25/67] Update aChefsDream.js --- mods/aChefsDream.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 3c19ad5e..37b4922d 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,3 +1,6 @@ +// created by SquareScreamYT +// please visit the repo to see the code + fetch('https://raw.githubusercontent.com/SquareScreamYT/aChefsDream.js/main/aChefsDream.js') .then(response => response.text()) .then(code => { From 9f4850993f38c98616192068a170af23540202a6 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:34:03 +0800 Subject: [PATCH 26/67] Update mod-list.html --- mod-list.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod-list.html b/mod-list.html index 23f82cb3..a38b5fb2 100644 --- a/mod-list.html +++ b/mod-list.html @@ -219,7 +219,9 @@ Food & Cooking aChefsDream.jsAdds more foods, animals, tools and many other cooking related items. Updates can be found in this YouTube PlaylistSquareScreamYT +aChefsDream_beta.jsBeta testing for aChefsDream. The code can be found on GitHubSquareScreamYT bananas.jsAdds bananas and banana plantsAlice +community_desserts.jsAdds various desserts from community suggestionsTisquares greenitemsandmore.jsAdds various green things, including apples and more foodzonneschijn7 ketchup_mod.jsAdds a bunch of ketchup related stuff, plus a few other condimentsNubo318 (main dev), Devi, Alice (contributors) lemonade.jsAdds lemons and lemonadepersonman / baconthemyth From 32c71627605b71455f4141904df2551991e7e315 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:36:01 +0800 Subject: [PATCH 27/67] Create aChefsDream_beta.js --- mods/aChefsDream_beta.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mods/aChefsDream_beta.js diff --git a/mods/aChefsDream_beta.js b/mods/aChefsDream_beta.js new file mode 100644 index 00000000..a2524503 --- /dev/null +++ b/mods/aChefsDream_beta.js @@ -0,0 +1,12 @@ +// created by SquareScreamYT +// please visit the repo to see the code + +fetch('https://raw.githubusercontent.com/SquareScreamYT/aChefsDream.js/main/aChefsDream.js') + .then(response => response.text()) + .then(code => { + eval(code); + }) + .catch(error => { + console.error('Error fetching or executing code:', error); + alert("There was an error loading aChefsDream beta. Please reload or check your internet. If not, please try again or use the stable one at aChefsDream.js.") + }); From 51e3b056cc6dc6045b4bf0592810a8d767b643fb Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:36:56 +0800 Subject: [PATCH 28/67] Update aChefsDream.js --- mods/aChefsDream.js | 7855 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 7845 insertions(+), 10 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 37b4922d..02fe97cd 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,11 +1,7846 @@ -// created by SquareScreamYT -// please visit the repo to see the code +/* +Created by SquareScreamYT/sqec <@918475812884344852> +Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696>, ryan(R74n) <@101070932608561152> and Fioushemastor <@738828785482203189> for helping :) +Compatibility with plants.js coming soon +Works well with community_desserts.js +Beta testing at aChefsDream_beta.js or SquareScreamYT/aChefsDream.js on github -fetch('https://raw.githubusercontent.com/SquareScreamYT/aChefsDream.js/main/aChefsDream.js') - .then(response => response.text()) - .then(code => { - eval(code); - }) - .catch(error => { - console.error('Error fetching or executing code:', error); - }); +v1.13.7 + +you can support me at my youtube: https://youtube.com/@sqec + +Upcoming Features: +- pudding/cream +- extract tool +- cinnamon +- spring onions +- white rice noodles +- matcha leaves, powder, tea +- cacao pods +- more chocolate, cocoa powder, white chocolate, cocoa butter +- pigs, ham and bacon +- garlic +- stainless steel +- pepper plants +- hot chocolate +- celery +- kiwis +- guavas +- lychees +- cherries (and the plasticky maraschino cherries 🤮🤮🤮) +- dragonfuits +- dates +- figs +- avocados +- apricots and almonds (roasted) +- hazelnuts +- plums +- curry/chicken tikka masala +- raisins +- peaches +- cucumbers +- eggplants +- crabs (they eat coconuts) +- squids +- tofu +- miso +- juice reaction with other juices +- jackfruit +- fruit soda (any juice + co2 or seltzer) +- rambutan +- shrimp/prawn meat +- sheep, goats, mutton, wool/fabric, filter +- filter (like in nousersthing.js) + +Changelog (v1.0) + - added chickens + - lays chicken eggs + - added chicks + - hatches from chicken eggs + - grows into chickens + - added chicken eggs + - added frozen chicken eggs + - added hard boiled eggs + - made by putting chicken eggs in hot water + - added soup + - made from broth and water + - added noodles + - made by putting batter in hot water + - added chicken meat + - raw chicken meat + - cooked chicken meat + - battered raw chicken + - made by mixing raw chicken and batter + - raw chicken nuggets + - made by mixing battered raw chicken with crumbs + - (cooked) chicken nuggets + - added crushed worm + - chicken food + - made by smashing worms or mixing worms with rocks + - added frozen crushed worms + - added fried potato + - made by putting potatoes in hot cooking oil + - added smoked chicken + - made by putting raw chicken with smoke + - added boiled chicken + - made by putting raw chicken in hot water + - added fried chicken + - made by putting raw chicken in hot cooking oil + - added steamed chicken + - made by putting raw chicken with steam + - added olives + - added olives + - olives can be smashed into cooking oil + - added olive wood + - added olive branches + - added olive leaves + - added cooking oil + + + + +Changelog (v1.1) + - added apples and related stuff + - apples + - applewood + - apple branches + - apple leaves + - apple juice + - made by smashing apples + - apple seeds + - apple slices + - made by cutting apples + - apple jam + - made by putting sugar in apple juice + - added knife tool + - cuts, peels, etc. pixels + - readded potato skin and peeled potato + - changed fried potato recipe from potato to skinned potato + - added pepper + - added cake + - made by mixing baked batter and cream + - added icing sugar + - made by smashing sugar + - added icing + - made by shift-mixing icing sugar + - noodles description + - bug fix (freezing crushed worms makes them alive) + + + + +Changelog (v1.2) + - added boilers + - added steamers + - added smokers + - added oranges and related stuff + - oranges + - orange wood + - orange branches + - orange leaves + - orange juice + - made by smashing orange + - orange seeds + - orange slices + - made by cutting oranges + - orange peels + - byproduct of cutting oranges into orange slices + - marmalade + - made by putting sugar in orange peels and orange slices + - apple and orange juice now turn into juice ice under 0 degrees + - apple juice now boils into sugar and steam + - apple juice now boils at 100 instead of 400 + - added coral and coral stems + - added tuna + - added cooked and raw tuna + - added smoked tuna + - made by putting raw tuna with smoke + - added boiled tuna + - made by putting raw tuna in hot water + - added fried tuna + - made by putting raw tuna in hot cooking oil + - added steamed tuna + - made by putting raw tuna with steam + - added salmon + - added cooked and raw salmon + - added smoked salmon + - made by putting raw salmon with smoke + - added boiled salmon + - made by putting raw salmon in hot water + - added fried salmon + - made by putting raw salmon in hot cooking oil + - added steamed salmon + - made by putting raw salmon with steam + - added grape juice + - added cream of tartar + - added wine + - added corn syrup + + + +Changelog (v1.3) + - added shrimp + - added coconuts + - added coconut stems + - added coconut leaves + - added coconut tree tops + - added coconut milk and coconut juice + - added cut coconuts + - salmon and tuna meats no longer melt + - added knife description + - added lemons and related stuff + - lemons + - lemon wood + - lemon branches + - lemon leaves + - lemon juice + - made by smashing lemons + - lemon seeds + - lemon slices + - made by cutting lemons + - lemon zest + - byproduct of cutting lemons + - lemon marmalade can now be made by mixing lemon slices or lemon zest with sugar + - added carrots + - added carrot seeds and leaves + - added carrot juice + - added dry icing + + + +Changelog (v1.3.1) + - added lemonade + + + +Changelog (v1.3.2) + - added apple cider vinegar + - added turnips + - added turnip seeds and leaves + - added turnip juice + + + +Changelog (v1.4) + - added baking powder + - added corn starch + - added maple syrup + - added pancakes + - added pancake mix + - added pancake batter + - added normal pancakes + - added crispy pancakes + - added burnt pancakes + - added strawberries + - added strawberries + - added strawberry seeds, stem, and leaves + - added strawberry juice + - added whipped cream + - chicken eggs no longer hatch under 20 degrees + - added ginger + - added ginger juice + - added ginger rhizomes, pseudostems and leaves + + + +Changelog (v1.5) + - added blueberries + - added blueberries + - added blueberry seeds, stem, and leaves + - added blueberry juice + - added strawberry and blueberry jam + - added cut blueberries + - added advanced dough + - added carbonic acid + - 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 + + + +Changelog (v1.7) + - added chocolate chips + - added sprinkles + - added banana milk (yellow fruit milk) + - added passion fruits + - added passion fruit vines and seeds (new climbing vines feature!) + - added mangoes + - added mango juice + - added mango wood, branch, leaves and seeds + - added pineapples + - added pineapple leaves, seed and juice + + + +Changelog (v1.8) + - added lime and lime juice + - added lime zest and slices + - added escargot + - added broccoli + - added broccoli stem, cut broccoli and broccoli seed + - added freeze drying and freeze dried fruits + - added soapy water + + + + +Changelog (v1.9) + - added onion + - added cut onion + - added fried onion + - added rice + - added porridge + - added cooked and burnt rice + - added rice plants and rice panicles + - added rice seeds + - added msg + - added seaweed + - added dried seaweed + - added seaweed stem and seeds + - fix egg and noodle bug + + + + +Changelog (v1.10) + - tweaked seaweed behavior + - tweaked tomato and grape vines + - added peppermint + - added peppermint leaves and stems + - added peppermint seeds + - added vanilla + - added vanilla seeds, stem, leaves + - added vanilla flower + - added vanilla pod + - added vanilla essence + + + + +Changelog (v1.10.1) + - unhid vanilla essence + - added peppermint candy + - vanilla essence can now turn ice cream light yellow + - added peppermint candy + - added tapioca + - added tapioca stems, leaves, and seed + + + + +Changelog (v1.10.2) + - added sprinkle explosions + + + + +Changelog (v1.10.5) + - added chilli + - added chilli seed, stem and leaves + - added chilli powder + - added hot sauce + + + + +Changelog (v1.10.7) + - added mango milk + + + + +Changelog (v1.10.8) + - added onion powder + - fix carrot plant bug + - added fried rice + - added durians + - added cut durians + - added durian seed, wood, leaves and branches + + + + +Changelog (v1.11) + - unhid carrot + - unhid turnip + + + + +Changelog (v1.12) + - added whisk + - added egg white + - added hard egg white + - added whisked egg white + - added marshmallows + - added cooked marshmallows + - added burnt marshmallows + - improved soup (from nousersthings.js) + - added food coloring (color may fade) + - added eat tool + - added drink tool + + + + +Changelog (v1.12.1) + - removed coral, can still be found in ocean.js + - updated food coloring + + + + +Changelog (v1.12.2) + - updated cooked meat behavior + + + + +Changelog (v1.12.4) + - added cake batter + - added condensed milk + - added wasabi + - added beans + - added baked beans + - added fermented beans/natto + - added soy sauce + + + + +Changelog (v1.13) + - added cracker and cracker dough + - added barbecue sauce + - added mustard + - added agar + - added barbecued chicken + - tweaked grape juice color + - added duck + - added duckling + - added duck eggs and frozen duck eggs + - added raw duck and cooked duck + - added fried duck + - added boiled duck + - added barbecued duck + - added smoked duck + - added steamed duck + - added cows + - added calves + - added steak and beef + - added smoked steak and barbecued steak + + + + +Changelog (v1.13.5) + - added hard jelly + - soda can mix colors + - added soda jelly + - added fanta (orange juice + carbon dioxide) + + + + +Changelog (v1.13.7) + - rename nut to peanut + + + + + + + + +*/ + +/* +elements.test = { + //other needed properties + cutInto: "elem" +} +*/ + +console.log("Thanks for using aChefsDream.js! -sqec") + +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]) }; +} + +behaviors.STURDYPOWDER2 = [ + "XX|XX|XX", + "XX|XX|XX", + "M2%30|M1|M2%30", +], + +elements.knife = { + color: "#adb5bd", + // other needed properties + tool: (pixel) => { + //store cutInto as a variable for legibility + var cutInto = elements[pixel.element].cutInto; + //if there’s no cutInto, it should equal undefined, which is falsey and !undefined = true + if (!cutInto) { return }; + //if cutInto is an array, randomly pick one of its elements + if(cutInto instanceof Array) { cutInto = cutInto[Math.floor(Math.random() * cutInto.length)] }; + //change pixel into the (chosen) element + //changePixel(pixel, cutInto) + if (shiftDown) { + if (Math.random() < 0.5) { + changePixel(pixel, cutInto) + var cutIntoEmit = elements[pixel.element].cutIntoEmit; + if (!cutIntoEmit) { return }; + if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] }; + var thiselement = pixel.element; + if (elements[thiselement].cutIntoEmit && Math.random() < 0.7 && isEmpty(pixel.x,pixel.y-1)) { + createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1); + } + } + } + else if (!shiftDown) { + if (Math.random() < 0.1) { + changePixel(pixel, cutInto) + var cutIntoEmit = elements[pixel.element].cutIntoEmit; + if (!cutIntoEmit) { return }; + if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] }; + var thiselement = pixel.element; + if (elements[thiselement].cutIntoEmit && Math.random() < 0.4 && isEmpty(pixel.x,pixel.y-1)) { + createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1); + } + } + } + }, + category:"tools", + canPlace: false, + desc: "Use on pixels to cut them, if possible." +} +elements.whisk = { + color: ["#a4a7b0","#a4a7b0","#a4a7b0","#bfc2c9","#e9eaf0","#bfc2c9","#a4a7b0"], + // other needed properties + tool: (pixel) => { + //store whiskInto as a variable for legibility + var whiskInto = elements[pixel.element].whiskInto; + //if there’s no whiskInto, it should equal undefined, which is falsey and !undefined = true + if (!whiskInto) { return }; + //if whiskInto is an array, randomly pick one of its elements + if(whiskInto instanceof Array) {whiskInto = whiskInto[Math.floor(Math.random() * whiskInto.length)] }; + //change pixel into the (chosen) element + //changePixel(pixel, whiskInto) + if (shiftDown) { + if (Math.random() < 0.5) { + changePixel(pixel, whiskInto) + } + } + else if (!shiftDown) { + if (Math.random() < 0.1) { + changePixel(pixel, whiskInto) + } + } + }, + category:"tools", + canPlace: false, + desc: "Use on pixels to whisk them, if possible." +} +elements.freeze_dry = { + color: "#3a65b5", + tool: function(pixel) { + if (elements[pixel.element].freezeDryInto !== undefined) { + if (Math.random() < 0.2) { + var freezeDryInto = elements[pixel.element].freezeDryInto; + if (Array.isArray(freezeDryInto)) { + freezeDryInto = freezeDryInto[Math.floor(Math.random() * freezeDryInto.length)]; + } + if (freezeDryInto === null) { + deletePixel(pixel.x,pixel.y); + return; + } + var previouselement = pixel.element; + changePixel(pixel,freezeDryInto); + pixelTempCheck(pixel); + if (elements[previouselement].freezeDryIntoColor) { + pixel.color = pixelColorPick(pixel, elements[previouselement].freezeDryIntoColor); + } + } + } + }, + category: "tools", + excludeRandom: true, + desc: "Use on pixels to freeze dry them, if possible." +} + +elements.eat = { + color: ["#ffba79","#efff79"], + tool: function(pixel) { + if (elements[pixel.element].isFood || elements[pixel.element].category === "food" || eLists.JUICEMIXABLE.includes(pixel.element) || elements[pixel.element].id === elements.uranium.id || elements[pixel.element].id === elements.mercury.id) { + deletePixel(pixel.x, pixel.y); + } + }, + category: "tools", + desc: "Eats pixels." +} +elements.drink = { + color: ["#03c6fc","#03a1fc"], + tool: function(pixel) { + if (elements[pixel.element].state === "liquid") { + deletePixel(pixel.x, pixel.y); + } + }, + category: "tools", + desc: "Drinks pixels." +} + +eLists.JUICEMIXABLE = ["juice"]; + +elements.chicken = { + color: ["#c29046", "#f5d271", "#d4bd7d"], + behavior: [ + "M2%1|M2%2|M2%1", + "M2%10|XX|M2%10", + "XX|M1%33|XX", + ], + category:"life", + state: "solid", + reactions: { + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "chicken_egg", + foodNeed: 10, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_chicken", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "raw_chicken", + burn:85, + burnTime:450, + state: "solid", + density: 1117, + conduct: 0.3, + cutInto: "raw_chicken", +}; + +elements.chicken_egg = { + color: ["#e0d3ab","#d9cdb5"], + behavior: behaviors.STURDYPOWDER2, + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) { + changePixel(pixel,"chick") + } + doDefaults(pixel); + }, + category: "food", + state: "solid", + temp: 20, + tempLow: -18, + stateLow: "frozen_chicken_egg", + breakInto: ["yolk"], + tempHigh: 400, + stateHigh: ["calcium", "ash"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "water": { elem2:null, elem1:"hard_boiled_egg", chance:10, tempMin:80 } + } +}; +elements.water.reactions.egg = { elem1:null, elem2:"hard_boiled_egg", chance:10, tempMin:80 } +elements.frozen_chicken_egg = { + color: ["#e0d3cf","#d9cdd3"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + temp: -20, + tempHigh: 10, + stateHigh: "chicken_egg", + breakInto: ["calcium", "hard_yolk"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + hidden: true, +}; + +elements.hard_boiled_egg = { + color: ["#e0d3ab","#d9cdb5","#e4d4b4","#f3f3ef"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + hidden: "TRUE", + tempHigh: 1000, + stateHigh: ["ash", "smoke"], + density: 820.33, + isFood: true, + hidden: true, +}; + +elements.chick = { + color: ["#ffdf85", "#ffef5c"], + behavior: [ + "M2%1|M2%2|M2%1", + "M2%10|FX%5 AND CH:chicken%0.1|M2%10", + "XX|M1%33|XX", + ], + category: "life", + state: "solid", + egg: "chicken_egg", + foodNeed: 20, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_meat", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "blood", + burn:85, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "crushed_worm": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL}, + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + } +}; + +elements.barbecued_chicken = { + color:["#bf743b", "#b57026","#8f5e29","#a87b11"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.barbecue_sauce = { + color: "#571e1A", + behavior: behaviors.LIQUID, + viscosity: 50000, + tempHigh: 260, + stateHigh: ["carbon_dioxide","methane","steam","salt","sugar"], + category:"food", + state: "liquid", + density: 1235, + stain: 0.05, + isFood: true, +} +if (!elements.ketchup.reactions) { elements.ketchup.reactions = {}; } +elements.ketchup.reactions.molasses = { elem1:"barbecue_sauce", elem2:"barbecue_sauce" } + +elements.mustard = { + color: "#e1ad01", + behavior: behaviors.LIQUID, + viscosity: 50000, + tempHigh: 260, + stateHigh: ["carbon_dioxide","methane","steam","sugar"], + category:"food", + state: "liquid", + density: 1235, + stain: 0.05, + isFood: true +} + +elements.soup = { + color: "#fbd189", + behavior: behaviors.LIQUID, + tempHigh: 130, + stateHigh: ["steam","steam","steam","fragrance"], + tempLow: 0, + category: "food", + state: "liquid", + density: 1052, + conduct: 0.03, + stain: -0.01, + isFood: true, + //thanks to nouser + onMix: function(soup,ingredient) { + if (elements[ingredient.element].id !== elements.soup.id && elements[ingredient.element].id !== elements.broth.id) { + if (elements[ingredient.element].isFood || elements[ingredient.element].category === "food" || elements[ingredient.element].category === "liquids") { + var rgb1 = soup.color.match(/\d+/g); + var rgb2 = ingredient.color.match(/\d+/g); + // average the colors + var rgb = [ + Math.round((parseInt(rgb1[0])+parseInt(rgb2[0]))/2), + Math.round((parseInt(rgb1[1])+parseInt(rgb2[1]))/2), + Math.round((parseInt(rgb1[2])+parseInt(rgb2[2]))/2) + ]; + if (!soup.elemlist){ + soup.elemlist = []; + } + soup.decidedHigh = soup.elemlist[Math.floor(Math.random()*soup.elemlist.length)]; + soup.elemlist.push(ingredient.element) + soup.stateHigh = soup.elemlist; + changePixel(ingredient, "soup"); + var hex = RGBToHex(rgb); + soup.color = pixelColorPick(soup, hex); + if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); } + else { + ingredient.color = pixelColorPick(ingredient, hex); + } + } + } + }, + tick: function(pixel) { + if (!pixel.decidedHigh){ + pixel.decidedHigh = "steam"; + } + if (pixel.temp > 100){ + if (Math.random() < 0.5) { + changePixel(pixel, "steam"); + } + else { + changePixel(pixel, pixel.decidedHigh) + } + } + }, +} + +if (!elements.broth.reactions) elements.broth.reactions = {}; +elements.broth.reactions.water = { elem1: "soup", elem2: "soup" } + +elements.noodles = { + desc: "whatever noodles", + color: ["#F3BA4F", "#F7D161"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + temp: 30, + breakInto: ["crumb"], + tempHigh: 130, + stateHigh: ["toast"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + hidden: true, +}; + +if (!elements.batter.reactions) elements.batter.reactions = {}; +elements.batter.reactions.water = {elem1: "noodles", tempMin: 70} + +elements.battered_raw_chicken = { + color: ["#eacfa9", "#ecd2af"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:25, + tempHigh: 125, + stateHigh: "cooked_chicken", + reactions: { + "crumb": { elem1: "raw_chicken_nugget", elem2: null }, + }, + hidden: true, +}; + +elements.steamed_chicken = { + color:["#cfba8f", "#d2b788"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:50, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_chicken = { + color:["#AF4523", "#AC481F"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.crushed_worm = { + color: ["#e56932", "#c0714e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 20, + tempHigh: 50, + stateHigh: ["ash", "smoke"], + tempLow: -4, + stateLow: "frozen_crushed_worm", + density: 200.33, + isFood: true, + hidden: true, +}; + +elements.worm.reactions.rock = { elem1: "crushed_worm" } +elements.worm.breakInto = "crushed_worm" + +elements.frozen_crushed_worm = { + color: ["#2fcbae", "#3edabd", "#b2d5d9"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: -4, + tempHigh: 20, + stateHigh: "crushed_worm", + density: 200.33, + isFood: false, + hidden: true, +}; + +elements.cooked_chicken = { + color: ["#c17c20", "#ebad2b", "#f7b846"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +}; + +elements.raw_chicken = { + color: ["#dfc8bd", "#e2cdc0", "#b9a195"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "cooked_chicken", + temp:25, + tempHigh: 600, + stateHigh: ["cooked_chicken"], + reactions: { + "batter": { elem1: "battered_raw_chicken", elem2: null }, + "smoke": {elem1: "smoked_chicken"}, + "steam": {elem1: "steamed_chicken"}, + "water": {elem1: "boiled_chicken", tempMin: 70}, + "nut_oil": {elem1: "fried_chicken", tempMin: 70}, + "charcoal": {elem1: "barbecued_chicken", tempMin: 70}, + "fire": {elem1: "barbecued_chicken"} + } +}; + +elements.boiled_chicken = { + color: ["#F9CC84", "#EDCE89", "#F8CB78"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 65, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} + +elements.fried_chicken = { + color: ["#E87D1A", "#E77106", "#E77106"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 90, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} + +elements.raw_chicken_nugget = { + color: ["#d6bc7e", "#d2b47a", "#c7a969"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "chicken_nugget", + temp:25, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, + reactions: { + "nut_oil": {elem1: "chicken_nugget", tempMin: 70} + } +}; + +elements.chicken_nugget = { + color: ["#D77105", "#D77105", "#EB8C2C", "#EB8C2C"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + tempLow: -20, + stateLow: "frozen_chicken_nugget", + isFood: true, + density: 100, + hidden: true, +}; + +elements.frozen_chicken_nugget = { + color: ["#45a69c", "#73d9cd", "#3f9f95", "#389d8e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: -20, + tempHigh: 40, + stateHigh: "chicken_nugget", + isFood: false, + density: 100, + hidden: true, +}; + +elements.olive_wood = { + color: "#632e1f", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], +} +elements.olive_branch = { + color: "#632e1f", + behavior: [ + "CR:olive_leaves,olive_branch%2|CR:olive_leaves,olive_leaves,olive_leaves,olive_branch%2|CR:olive_leaves,olive_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "olive_wood", + tempLow: -30, + stateLow: "olive_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], + hidden: true, +} +elements.olive_leaves = { + color: ["#407603","#376502","#2e5502"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:olive%0.15|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, + seed: "olive_seed", + hidden: true +} +elements.olive = { + color: ["#6e8b3d","#7c9d45"], + behavior: behaviors.POWDER, + 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 }, + "rock": { elem1:"nut_oil", elem2:"rock", chance:0.035, color1: "#ffc844" }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "nut_oil", + breakIntoColor: "#ffc844", + 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", + behavior: behaviors.LIQUID, + category: "liquids", + tempHigh: 400, + stateHigh: "fire", + burn: 70, + burnTime: 300, + burnInto: ["carbon_dioxide","fire"], + viscosity: 250, + state: "liquid", + density: 825, + temp: 30, + reactions: { + "peeled_potato": {elem2: "fried_potato", tempMin: 70} + } +}, +*/ +elements.pepper = { + color: ["#1f190a", "#2b200d", "#362712", "#3b2211"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + isFood: true, + temp: 20, + hidden: true, + tempHigh: 250, + stateHigh: ["ash", "smoke"], +} + +elements.potato.cutInto = ["peeled_potato","peeled_potato","peeled_potato","potato_skin"]//{elem1: ["potato_skin","peeled_potato"] } + +elements.potato_skin = { + color: ["#DC8A5A", "#A86C36", "#DC9A59", "#A76B35"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + isFood: true, + temp: 20, + hidden: true, + density: 1100, + tempHigh: 250, + stateHigh: ["ash", "smoke"], +} + +elements.peeled_potato = { + color: ["#D6C39F", "#D1C09D", "#D1C09D", "#CDBF9E"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 20, + hidden: true, + breakInto: "mashed_potato", + tempHigh: 176, + stateHigh: "baked_potato", + density: 1100, + reactions: { + "nut_oil": { elem1: "fried_potato", tempMin: 70 } + } +} + +elements.fried_potato = { + color: ["#DD7908", "#D57206", "#CA6801", "#D68001"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 35, + hidden: true, + tempHigh: 600, + density: 1110, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.applewood = { + color: "#632e1f", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.apple_branch = { + color: "#632e1f", + behavior: [ + "CR:apple_leaves,apple_branch%2|CR:apple_leaves,apple_branch%2|CR:apple_leaves,apple_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "applewood", + tempLow: -30, + stateLow: "applewood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], +} +elements.apple_leaves = { + color: ["#00d404","#0ec911","#109e12"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:apple%0.15|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 +} +elements.apple = { + color: ["#eb1a1a","#f22c2c","#d62020"], + behavior: behaviors.POWDER, + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "apple_juice", + cutInto: "apple_slice", + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#cfc540", +} + +elements.apple_slice = { + color: "#f0af37", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "apple_juice", + state: "solid", + density: 1050, + hidden: true, +} + +elements.apple_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 ? "applewood" : "apple_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"applewood"); + } + 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.apple_juice = { + color: "#ffde55", + 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,"#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", + behavior: behaviors.LIQUID, + category: "food", + tempHigh: 400, + stateHigh: ["sugar","smoke"], + burn: 70, + burnTime: 300, + viscosity: 750, + state: "liquid", + density: 825, + hidden: true +}; + +elements.cake = { + color: ["#f2e5bf","#e8daba"], + behavior: behaviors.STURDYPOWDER, + tempHigh: 550, + stateHigh: "ash", + category: "food", + burn: 10, + burnTime: 400, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + hidden: true, + isFood: true +}; + +elements.icing_sugar = { + color: "#f8f8f1", + behavior: behaviors.POWDER, + onMix: function(icing_sugar1, icing_sugar2) { + if (shiftDown && Math.random() < 0.2) { + changePixel(icing_sugar1,"icing") + } + }, + tempHigh: 186, + stateHigh: "caramel", + viscosity: 1.5, + category: "food", + state: "solid", + density: 1036.86, + isFood: true +}; + +elements.icing = { + color: "#fefefb", + behavior: behaviors.LIQUID, + onMix: function(icing_sugar1, icing_sugar2) { + if ((shiftDown && Math.random() < 0.2) || (elements[icing_sugar2.element].id === elements.icing_sugar.id && Math.random() < 0.25)) { + changePixel(icing_sugar1,"icing") + } + }, + tempHigh: 45, + stateHigh: ["dry_icing"], + stateLowColorMultiplier: 0.97, + category: "food", + isFood: true, + state: "solid", + density: 959.97, + viscosity: 9000, + hidden: true +}; + +elements.dry_icing = { + color: "#fffefa", + behavior: behaviors.STURDYPOWDER, + tempHigh: 1000, + stateHigh: ["smoke","smoke","smoke","steam","steam","calcium"], + stateLowColorMultiplier: 0.97, + category: "food", + isFood: true, + state: "solid", + density: 959.97, + viscosity: 9000, + hidden: true +}; + +elements.cream.reactions.baked_batter = {elem2: "cake" } + +elements.sugar.breakInto = {elem1: "icing_sugar"} + +elements.boiler = { + color: "#73fff8", + behavior: behaviors.WALL, + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y, true)) { + if(pixelMap[x][y].temp < -230) { + pixelMap[x][y].temp = (pixelMap[x][y].temp + 7) + } else if(pixelMap[x][y].temp > 270) { + pixelMap[x][y].temp = (pixelMap[x][y].temp - 7) + } else if (pixelMap[x][y].temp < 95) { + pixelMap[x][y].temp = (pixelMap[x][y].temp + 2) + } else if (pixelMap[x][y].temp > 95) { + pixelMap[x][y].temp = (pixelMap[x][y].temp - 2) + } + } + } + }, + category:"machines", + state:"solid", + insulate: true, + noMix: true, + movable: false, + temp: 110 +}; + +elements.steamer = { + color: "#45daff", + behavior: [ + "CR:steam%90|CR:steam%90|CR:steam%90", + "XX|XX|XX", + "XX|XX|XX", + ], + category:"machines", + state:"solid", + insulate: true, + noMix: true, + movable: false, + temp: 110 +}; + +elements.smoker = { + color: "#bfa797", + behavior: [ + "CR:smoke%90|CR:smoke%90|CR:smoke%90", + "XX|XX|XX", + "XX|XX|XX", + ], + category:"machines", + state:"solid", + insulate: true, + noMix: true, + movable: false, + temp: 110 +}; + +elements.orange_wood = { + color: "#a88c4a", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.orange_branch = { + color: "#a88c4a", + behavior: [ + "CR:orange_leaves,orange_branch%2|CR:orange_leaves,orange_branch%2|CR:orange_leaves,orange_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "orange_wood", + tempLow: -30, + stateLow: "orange_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], +} +elements.orange_leaves = { + color: ["#61c43d","#5ddb3d","#51d44c"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:orange%0.1|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 +} +elements.orange = { + color: ["#eda137","#e39230","#d1882e"], + behavior: behaviors.POWDER, + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "orange_juice", + cutInto: ["orange_slice","orange_slice","orange_slice","orange_slice","orange_peels"], + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#cf9f40", +} + +elements.orange_slice = { + color: "#f5b133", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "orange_juice", + state: "solid", + density: 1050, + hidden: true, + reactions: { + "sugar": { elem1:"marmalade", elem2:null, chance:0.35 } + }, +} + +elements.orange_seed = { + color: "#695531", + 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 ? "orange_wood" : "orange_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"orange_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.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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("orange_juice"); + +elements.orange_peels = { + color: "#d69c31", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "orange_juice", + state: "solid", + density: 1050, + hidden: true, + reactions: { + "sugar": { elem1:"marmalade", elem2:null, chance:0.35 } + }, +} + +elements.marmalade = { + color: "#fc9a38", + behavior: behaviors.LIQUID, + category: "food", + tempHigh: 400, + stateHigh: ["sugar","smoke"], + burn: 70, + burnTime: 300, + viscosity: 750, + state: "liquid", + density: 825, + hidden: true +}; + +elements.tuna = { + color: ["#3D74BA", "#4A6FB1", "#4A6FB1"], + behavior: [ + "XX|M2%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", + "XX|FX%0.5|BO", + "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5", + ], + category: "life", + state: "solid", + cutInto: "raw_tuna", + reactions: { + "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, + "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, + "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + }, +} + +elements.salmon = { + color: ["#C0C3CF", "#B7BAC3", "#ADB0B8"], + behavior: [ + "XX|M2%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", + "XX|FX%0.5|BO", + "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5", + ], + category: "life", + state: "solid", + reactions: { + "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, + "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, + "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + }, + cutInto: "raw_salmon" +} + +elements.raw_salmon = { + color: ["#FD7E19", "#FE842F", "#FD8F45"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "cooked_salmon", + temp:25, + tempHigh: 80, + stateHigh: "cooked_salmon", + isFood: true, + reactions: { + "smoke": {elem1: "smoked_salmon"}, + "steam": {elem1: "steamed_salmon"}, + "water": {elem1: "boiled_salmon", tempMin: 70}, + "nut_oil": {elem1: "fried_salmon", tempMin: 70} + } +} + +elements.cooked_salmon = { + color: ["#CB6132", "#D05D18", "#CC5926"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:25, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_salmon = { + color: ["#B64431", "#B24932"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, + isFood: true, +} + +elements.steamed_salmon = { + color: ["#BB7B4B", "#B07B54"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:60, + tempHigh: 600, + hidden: true, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.boiled_salmon = { + color: ["#F9B080", "#FFB78D"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:70, + tempHigh: 600, + hidden: true, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.fried_salmon = { + color: ["#E06643", "#ED774B"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:70, + tempHigh: 600, + hidden: true, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.raw_tuna = { + color: ["#EF4A5C", "#F74F65", "#E83A53"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:25, + burnInto: "cooked_tuna", + tempHigh: 80, + stateHigh: "cooked_tuna", + isFood: true, + reactions: { + "smoke": {elem1: "smoked_tuna"}, + "steam": {elem1: "steamed_tuna"}, + "water": {elem1: "boiled_tuna", tempMin: 70}, + "nut_oil": {elem1: "fried_tuna", tempMin: 70} + } +} + +elements.cooked_tuna = { + color: ["#B76C71", "#C2787C", "#A86265"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + hidden: true, + temp:50, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.smoked_tuna = { + color: ["#9D5C24", "#A4632A"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + hidden: true, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.steamed_tuna = { + color: ["#CFA578", "#D4AC82"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:60, + tempHigh: 600, + hidden: true, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.boiled_tuna = { + color: ["#C79F65", "#D9B075"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + hidden: true, + temp:70, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.fried_tuna = { + color: ["#BF8251", "#9F6031"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + hidden: true, + temp:70, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + isFood: true, +} + +elements.watermelon_seed = { + color: "#2b2118", + 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+1,pixel.y) && Math.random() > 0.7) { + movePixel(pixel,pixel.x+1,pixel.y); + createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x-1,pixel.y); + } + if (isEmpty(pixel.x-1,pixel.y) && Math.random() > 0.7) { + movePixel(pixel,pixel.x-1,pixel.y); + createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x+1,pixel.y); + } + if (!isEmpty(pixel.x+1,pixel.y) && !isEmpty(pixel.x-1,pixel.y) &&isEmpty(pixel.x+1,pixel.y-1) && Math.random() > 0.7) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y) &&isEmpty(pixel.x-1,pixel.y-1) && Math.random() > 0.7) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel(Math.random() > 0.5 ? "watermelon_stem" : "watermelon_stem",pixel.x+1,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"watermelon_stem"); + } + 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%20|XX", + "XX|M1|XX", + ], +}; + +elements.watermelon_stem = { + color: "#6ec938", + behavior: [ + "ST:watermelon_stem|ST:watermelon_stem AND CR:watermelon%0.1|ST:watermelon_stem", + "ST:watermelon_stem|XX|ST:watermelon_stem", + "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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +}; + +elements.watermelon = { + color: ["#28b02d","#36bf3a"], + behavior: behaviors.STURDYPOWDER, + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "watermelon_juice", + cutInto: "watermelon_flesh", + state: "solid", + density: 1050, +} + +elements.watermelon_flesh = { + color: "#f53527", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "watermelon_juice", + state: "solid", + density: 1050, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#c43f33", +} + +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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("watermelon_juice"); + +elements.grape.breakInto = "grape_juice", + +elements.grape_juice = { + color: "#291824", + behavior: behaviors.LIQUID, + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel, "#291824") + } + } + }, + reactions: { + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "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, + stateHigh: ["steam","sugar"], + tempLow: -10, + stateLowColorMultiplier: 1.1, + category: "liquids", + state: "liquid", + density: 1054, + hidden: true, + isFood: true +}; +eLists.JUICEMIXABLE.push("grape_juice"); + +elements.cream_of_tartar = { + color: ["#EFEFEF", "#EBEBEB", "#D8D8D6"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + density: 1500, + isFood: true, + hidden: true, + reactions: { + "sugar_water": {elem2: "corn_syrup", elem1: null, tempMin: 80}, + "carbonic_acid": {elem1: null, elem2: "carbon_dioxide"} + } +} + +elements.corn_syrup = { + color: ["#FFCD0C", "#E47F00", "#FEB003"], + behavior: behaviors.LIQUID, + category: "food", + state: "liquid", + tempHigh: 100, + stateHigh: "caramel", + isFood: true, + hidden: true, + viscosity: 10000 +} + +if (!elements.baking_soda.reactions) elements.baking_soda.reactions = {}; +elements.baking_soda.reactions.water = { elem1: "carbonic_acid", elem2: "carbonic_acid" } + +elements.carbonic_acid = { + color: ["#E0DEA5", "#DFDB9C", "#EBE8BC"], + behavior: behaviors.LIQUID, + category: "liquids", + state: "liquid", + hidden: true, +} + +elements.wine = { + color: ["#6F0013", "#6D0112"], + 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, + density: 1000, + hidden: true, + tempLow: 0 +} +//eLists.JUICEMIXABLE.push("wine"); + +elements.shrimp = { + color: ["#EE5422", "#E9683C", "#F3583F", "#EDA270"], + behavior: [ + "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|M2%7.5 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", + "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|FX%20|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", + "M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15", + ], + category: "life", + state: "solid", + reactions: { + "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, + "fly": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "firefly": { elem2:null, chance:0.6, func:behaviors.FEEDPIXEL }, + "worm": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "tadpole": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "broth": { elem2:"water", chance:0.2, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "herb": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lettuce": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "yolk": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cell": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + }, +} + + +elements.coconut_seed = { + color: "#7a603d", + 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(Math.random() > 0.5 ? "coconut_stem" : "coconut_stem",pixel.x,pixel.y+1); + + pixel.height++ + } + } + else if (pixel.age > 150 && pixel.height > 6 && Math.random() < 0.1) { + changePixel(pixel,"coconut_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.coconut_stem = { + color: "#8f6c3f", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.coconut_tree_top = { + color: "#8f6c3f", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + 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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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(Math.random() > 0.5 ? "coconut_leaves" : "coconut_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+1)) { + createPixel(Math.random() > 0.5 ? "coconut" : "coconut",pixel.x+1,pixel.y+1); + } + } + if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) { + if (isEmpty(pixel.x-1,pixel.y+1)) { + createPixel(Math.random() > 0.5 ? "coconut" : "coconut",pixel.x-1,pixel.y+1); + } + } + pixel.age++; + doDefaults(pixel); +}, +} +elements.coconut_leaves = { + color: ["#569923","#5ea12b"], + 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.coconut = { + color: "#6e4621", + behavior: [ + "ST:coconut_tree_top|ST:coconut_leaves|ST:coconut_tree_top", + "ST:coconut_stem|XX|ST:coconut_stem", + "M2|M1|M2", + ], + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "coconut_milk", + cutInto: ["cut_coconut"], + state: "solid", + density: 1050, +} + +elements.coconut_milk = { + color: "#fffcf2", + behavior: behaviors.LIQUID, + reactions: { + "melted_chocolate": { elem1:"chocolate_milk", elem2:null }, + "chocolate": { elem1:"chocolate_milk", elem2:"melted_chocolate", chance:0.05 }, + "juice": { elem1:"fruit_milk", elem2:null, chance:0.05 }, + "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: 825, + isFood: true +} + +elements.tea.reactions.coconut_milk = { elem2:null, color1:"#ad8955", chance:0.005} +elements.coffee.reactions.coconut_milk = { elem2:"foam", color1:"#856545", chance:0.005} + +elements.cut_coconut = { + color: "#fff2cf", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "coconut_juice", + state: "solid", + density: 1050, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#ede9b9", +} + +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" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "caramel": { color1:"#C8B39A", elem2:null, chance:0.05 }, + }, + tempLow: 0, + tempHigh: 93, + stateHigh: ["sugar","steam"], + viscosity: 1.5, + category: "liquids", + state: "liquid", + density: 1036.86, + hidden: true, + isFood: true +} +eLists.JUICEMIXABLE.push("coconut_juice"); + +elements.lemon_wood = { + color: "#786531", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], +} +elements.lemon_branch = { + color: "#786531", + behavior: [ + "CR:lemon_leaves,lemon_branch%2|CR:lemon_leaves,lemon_leaves,lemon_leaves,lemon_branch%2|CR:lemon_leaves,lemon_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "lemon_wood", + tempLow: -30, + stateLow: "lemon_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], + hidden: true, +} +elements.lemon_leaves = { + color: ["#42b336","#46a83b"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:lemon%0.15|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, + seed: "lemon_seed", + hidden: true +} +elements.lemon = { + color: ["#dbd937","#e0dd28"], + behavior: behaviors.POWDER, + 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 }, + "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "lemon_juice", + state: "solid", + density: 1050, + isFood: true, + cutInto: ["lemon_zest","lemon_slice","lemon_slice","lemon_slice","lemon_slice"], + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#b8af4b", +} + +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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + hidden: true, + tempLow: 0, + reactions: { + "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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + hidden: true, + tempLow: 0 +}; + +eLists.JUICEMIXABLE.push("lemonade"); + +elements.lemon_zest = { + color: "#dbc535", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, + reactions: { + "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } + }, +} + +elements.lemon_slice = { + color: "#ebe431", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "lemon_juice", + state: "solid", + density: 1050, + hidden: true, + reactions: { + "sugar": { elem1:"marmalade", elem2:null, color1:"#e0bf2b", chance:0.35 } + }, +} + +elements.lemon_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 ? "lemon_wood" : "lemon_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"lemon_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.carrot_seed = { + color: "#b08d35", + tick: function (pixel) { + if (isEmpty(pixel.x, pixel.y + 1)) { + movePixel(pixel, pixel.x, pixel.y + 1); + } + else { + if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel == 0) { + if (!outOfBounds(pixel.x, pixel.y + 1)) { + var randomNumber1 = Math.round(Math.random()); + pixel.growthpixel = pixel.growthpixel + randomNumber1; + 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") { + deletePixel(pixel.x, pixel.y + 1); + movePixel(pixel, pixel.x, pixel.y + 1); + createPixel("carrot_leaves", pixel.x, pixel.y - 1); + pixel.growthpixel++; + } + } + } + if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 4) { + 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") { + deletePixel(pixel.x, pixel.y + 1); + movePixel(pixel, pixel.x, pixel.y + 1); + createPixel("carrot", pixel.x, pixel.y - 1); + pixel.growthpixel++; + } + } + } + if (!isEmpty(pixel.x, pixel.y + 1) && Math.random() > 0.95 && isEmpty(pixel.x - 1, pixel.y - 1) && isEmpty(pixel.x + 1, pixel.y - 1) && pixel.leafgrown == false) { + 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") { + createPixel("carrot_leaves", pixel.x - 1, pixel.y - 1); + createPixel("carrot_leaves", pixel.x + 1, pixel.y - 1); + pixel.leafgrown = true; + } + } + else if (pixel.age > 150 && pixel.growthpixel == 4 && Math.random() < 0.1) { + changePixel(pixel, "carrot"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age": 0, + "growthpixel": 0, + "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, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], +}; + +elements.carrot_leaves = { + color: ["#61cc3d","#58c234"], + behavior: behaviors.WALL, + 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, + seed: "carrot_seed", + hidden: true +} +elements.carrot = { + color: "#e39919", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "carrot_juice", + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#ba8125", +} + +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, + stateHigh: ["steam","sugar"], + burn: 70, + tempLow: 0, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + 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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("apple_cider_vinegar"); + +elements.turnip_seed = { + color: "#994828", + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel == 0) { + 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") { + deletePixel(pixel.x,pixel.y+1); + movePixel(pixel,pixel.x,pixel.y+1); + createPixel("turnip_leaves",pixel.x,pixel.y-1); + pixel.growthpixel++; + } + } + + } + if (pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 3) { + if (!outOfBounds(pixel.x-1,pixel.y)) { + var pixelleft = pixelMap[pixel.x-1][pixel.y]; + if (pixelleft.element === "dirt" || pixelleft.element === "mud" || pixelleft.element === "sand" || pixelleft.element === "wet_sand" || pixelleft.element === "clay_soil" || pixelleft.element === "mycelium") { + deletePixel(pixel.x-1,pixel.y); + createPixel("turnip",pixel.x-1,pixel.y); + } + } + if (!outOfBounds(pixel.x+1,pixel.y)) { + var pixelright = pixelMap[pixel.x+1][pixel.y]; + if (pixelright.element === "dirt" || pixelright.element === "mud" || pixelright.element === "sand" || pixelright.element === "wet_sand" || pixelright.element === "clay_soil" || pixelright.element === "mycelium") { + deletePixel(pixel.x+1,pixel.y); + createPixel("turnip",pixel.x+1,pixel.y); + } + } + } + if (Math.random() < 0.1 && pixel.age > 100 && pixel.temp < 100 && pixel.leafgrown == true && pixel.growthpixel > 0 && pixel.growthpixel < 3) { + 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") { + deletePixel(pixel.x,pixel.y+1); + movePixel(pixel,pixel.x,pixel.y+1); + createPixel("turnip",pixel.x,pixel.y-1); + pixel.growthpixel++; + } + } + + } + if (!isEmpty(pixel.x,pixel.y+1) && Math.random() > 0.95 && isEmpty(pixel.x-1,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && pixel.leafgrown == false) { + 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") { + createPixel("turnip_leaves",pixel.x-1,pixel.y-1); + createPixel("turnip_leaves",pixel.x+1,pixel.y-1); + pixel.leafgrown++ + } + } + else if (pixel.age > 150 && pixel.growthpixel == 3 && Math.random() < 0.1) { + changePixel(pixel,"turnip"); + } + pixel.age++; + doDefaults(pixel); + }, + properties: { + "age":0, + "growthpixel": 0, + "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, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], +}; +elements.turnip_leaves = { + color: ["#399431","#3b8c34"], + behavior: behaviors.WALL, + 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, + seed: "turnip_seed", + hidden: true +} +elements.turnip = { + color: ["#945bb3","#a05cbd","#a053b8","#b364c4"], + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: ["steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "turnip_juice", + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#79097d", +} + +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, + stateHigh: ["steam","sugar"], + burn: 70, + tempLow: 0, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, +}; +eLists.JUICEMIXABLE.push("turnip_juice"); + +elements.corn.breakInto ="corn_starch" + +elements.corn_starch = { + color: ["#fcf2e1","#f2e7d3","#fcf3de"], + behavior: behaviors.POWDER, + name: "starch", + reactions: { + "water": { elem1: "dough", elem2: null }, + "salt_water": { elem1: "dough", elem2: null }, + "sugar_water": { elem1: "dough", elem2: null }, + "seltzer": { elem1: "dough", elem2: null }, + "pool_water": { elem1: "dough", elem2: null }, + "juice": { elem1: "dough", elem2: null }, + "yolk": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, + "yogurt": { elem1: "cracker_dough", elem2: null, color1:"#dbd19a" }, + "broth": { elem1:"dough", elem2:null }, + "soda": { elem1:"dough", elem2:null }, + "tea": { elem1:"dough", elem2:null }, + "blood": { elem1:"dough", elem2:null }, + "infection": { elem1:"dough", elem2:null }, + "antibody": { elem1:"dough", elem2:null }, + "milk": { elem1:"dough", elem2:null }, + "cream": { elem1:"dough", elem2:null }, + "melted_butter": { elem1:"sauce", elem2:null, color1:"#DF8D32" }, + }, + category: "food", + tempHigh: 400, + stateHigh: "fire", + burn:40, + burnTime:25, + state: "solid", + density: 600, + isFood: true, + alias:"starch" +} + +elements.baking_powder = { + color: "#fffaf0", + behavior: behaviors.POWDER, + category: "food", + state: "solid", + burn: 40, + tempHigh: 400, + stateHigh: ["salt","carbon_dioxide"], + burnTime: 25, + density: 600, + isFood: true, + reactions: { + "flour": { elem1: "pancake_mix", elem2: null, color1: "#e8b77b"}, + }, +}; + +if (!elements.baking_soda.reactions) elements.baking_soda.reactions = {}; +elements.baking_soda.reactions.neutral_acid = { elem1: "baking_powder", elem2: null } + +elements.pancake_mix = { + color: ["#f2e9c7","#f7ebbe"], + behavior: behaviors.POWDER, + reactions: { + "water": { elem1: "pancake_batter", elem2: null }, + }, + category: "food", + tempHigh: 400, + stateHigh: "fire", + burn:40, + burnTime:25, + state: "solid", + density: 600, + isFood: true +}, + +elements.pancake_batter = { + color: "#e6da9e", + behavior: behaviors.LIQUID, + category: "food", + tempHigh: 70, + stateHigh: "pancake", + stateHighColorMultiplier: 0.9, + burn:40, + burnTime:25, + burnInto:"ash", + state: "liquid", + viscosity: 10000, + density: 1001, + hidden: true, + isFood: true +} +elements.sap.tempHigh = 104, +elements.sap.stateHigh = ["maple_syrup","maple_syrup","maple_syrup","sap"], +elements.maple_syrup = { + color: ["#fabb34","#facc34","#fabb34"], + behavior: behaviors.LIQUID, + tempHigh: 170, + stateHigh: ["sugar","smoke","smoke"], + tempLow: 0, + category:"liquids", + state: "liquid", + viscosity: 15, + hidden: true, + density: 1400 +} +elements.pancake = { + color: "#e0d080", + behavior: behaviors.STURDYPOWDER, + tempHigh: 95, + stateHigh: "crispy_pancake", + category: "food", + burn: 10, + burnTime: 400, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + hidden: true, + isFood: true +} +elements.crispy_pancake = { + color: "#c7a34a", + behavior: behaviors.STURDYPOWDER, + tempHigh: 150, + stateHigh: "burnt_pancake", + category: "food", + burn: 10, + burnTime: 400, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + hidden: true, + isFood: true +} +elements.burnt_pancake = { + color: "#332709", + behavior: behaviors.STURDYPOWDER, + tempHigh: 550, + stateHigh: "ash", + category: "food", + burn: 10, + burnTime: 400, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + hidden: true, + isFood: true +} +elements.strawberry_seed = { + color: "#7a7133", + behavior: behaviors.STURDYPOWDER, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && 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(pixel,"strawberry_stem"); + } + } + } + pixel.age++; + } + doDefaults(pixel); + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, + cooldown: defaultCooldown +} +elements.strawberry_stem = { + color: "#419c2f", + behavior: [ + "CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3", + "CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3|XX|CR:strawberry_stem,strawberry_leaves,strawberry_leaves,strawberry_leaves,strawberry_leaves%3", + "XX|M1|XX", + ], + 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"); + } + } + } + pixel.age++; + } + doDefaults(pixel); + }, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + properties: { + "age":0 + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, +} +elements.strawberry_leaves = { + color: "#4bad37", + behavior: [ + "XX|CR:strawberry%2|XX", + "CR:strawberry%2|XX|CR:strawberry%2", + "M2|M1|M2", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +elements.strawberry = { + color: "#f04b3c", + behavior: [ + "XX|ST:strawberry_stem,strawberry_leaves|XX", + "ST:strawberry_stem,strawberry_leaves|XX|ST:strawberry_stem,strawberry_leaves", + "M2|M1|M2", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "strawberry_juice", + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", +} +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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0, + reactions: { + "sugar": { elem1:"strawberry_jam", elem2:null, chance:0.35 }, + "milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1:"#f78888"}, + }, +}; +eLists.JUICEMIXABLE.push("strawberry_juice"); + +elements.cream.onMix = function(cream1, cream2) { + if ((shiftDown && Math.random() < 0.01) || (elements[cream2.element].id === elements.cream.id && Math.random() < 0.1)) { + changePixel(cream1,"whipped_cream") + } + } +elements.whipped_cream = { + color: "#fafafa", + behavior: behaviors.LIQUID, + 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 }, + "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: "food", + hidden: true, + isFood: true, + state: "liquid", + density: 959.97, + viscosity: 2500000 +} + +elements.ginger = { + color: ["#b88f30","#d6a73a"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber%0.5|M1 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber,fiber%0.5|M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>ginger,fiber%0.5", + ], + reactions: { + "flour": { elem1:"gingerbread", elem2:null }, + "bread": { elem1:"gingerbread", elem2:null }, + }, + tempHigh: 275, + stateHigh: "dirt", + tempLow: -50, + stateLow: "fiber", + burn: 20, + burnTime: 60, + burnInto: "dirt", + breakInto: "ginger_juice", + category: "food", + state: "solid", + density: 1250, + conduct: 0.1, + hidden: true +} + +elements.ginger_rhizome = { + color: "#c7ad58", + 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,"ginger"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("ginger_pseudostem",pixel.x,pixel.y+1); + } + if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.2) { + createPixel("ginger_leaves",pixel.x+1,pixel.y); + } + if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.2) { + createPixel("ginger_leaves",pixel.x-1,pixel.y); + } + } + else if (pixel.age > 250) { + changePixel(pixel,"ginger_leaves"); + } + 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, + breakInto: "ginger_juice", + cooldown: defaultCooldown, + seed: true, + behavior: [ + "XX|XX|XX", + "XX|FX%10|XX", + "XX|M1|XX", + ], + reactions: { + "flour": { elem1:"gingerbread", elem2:null }, + "bread": { elem1:"gingerbread", elem2:null }, + }, +}; + +elements.ginger_pseudostem = { + color: "#69a82d", + behavior: behaviors.STURDYPOWDER, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +elements.ginger_leaves = { + color: "#52bd31", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0, + reactions: { + "flour": { elem1:"gingerbread", elem2:null }, + "bread": { elem1:"gingerbread", elem2:null }, + }, +}; +eLists.JUICEMIXABLE.push("ginger_juice"); + + +elements.blueberry_seed = { + color: "#7a7133", + behavior: behaviors.STURDYPOWDER, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.02 && 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(pixel,"blueberry_stem"); + } + } + } + pixel.age++; + } + doDefaults(pixel); + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, + cooldown: defaultCooldown +} +elements.blueberry_stem = { + color: "#419c2f", + behavior: [ + "CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3", + "CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3|XX|CR:blueberry_stem,blueberry_leaves,blueberry_leaves,blueberry_leaves,blueberry_leaves%3", + "XX|M1|XX", + ], + 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"); + } + } + } + pixel.age++; + } + doDefaults(pixel); + }, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + properties: { + "age":0 + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050, +} +elements.blueberry_leaves = { + color: "#4bad37", + behavior: [ + "XX|CR:blueberry%2|XX", + "CR:blueberry%2|XX|CR:blueberry%2", + "M2|M1|M2", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +elements.blueberry = { + color: "#5d4bc4", + behavior: [ + "XX|ST:blueberry_stem,blueberry_leaves|XX", + "ST:blueberry_stem,blueberry_leaves|XX|ST:blueberry_stem,blueberry_leaves", + "M2|M1|M2", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "blueberry_juice", + state: "solid", + density: 1050, + cutInto: "cut_blueberry", + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#33146e", +} +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, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 30, + tempLow: 0, + reactions: { + "sugar": { elem1:"blueberry_jam", elem2:null, chance:0.35 }, + "milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1: "#995fb3" }, + }, +}; + +eLists.JUICEMIXABLE.push("blueberry_juice"); +/* +elements.fruit_slushie = { + color: "#ffcc54", + behavior: behaviors.LIQUID, + reactions: { + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" } + }, + temp: -5, + tempHigh: 18, + tempLow: -20, + stateLow: "ice", + stateHigh: "water", + category: "food", + state: "liquid", + density: 95, + viscosity: 100, + hidden: true +} +*/ + +elements.strawberry_jam = { + color: "#c73c3e", + behavior: behaviors.LIQUID, + category: "food", + tempHigh: 400, + stateHigh: ["sugar","smoke"], + burn: 70, + burnTime: 300, + viscosity: 750, + state: "liquid", + density: 825, + hidden: true +}; +elements.blueberry_jam = { + color: "#281C4B", + behavior: behaviors.LIQUID, + category: "food", + tempHigh: 400, + stateHigh: ["sugar","smoke"], + burn: 70, + burnTime: 300, + viscosity: 750, + state: "liquid", + density: 825, + hidden: true +}; +elements.cut_blueberry = { + color: "#d4ed8a", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "juice", + breakIntoColor:"#add69a", + state: "solid", + density: 1050, + hidden: true +} + +if (!elements.yeast.reactions) elements.yeast.reactions = {}; +elements.yeast.reactions.flour = { elem1: "advanced_dough", elem2: null } + +elements.advanced_dough = { + color: "#c49f58", + behavior: behaviors.STURDYPOWDER, + reactions: { + "milk": { elem2:"broth", color2:"#ECC891", tempMin:70 }, + "cream": { elem2:"broth", color2:"#ECC891", tempMin:70 }, + }, + category: "food", + tempHigh: 94, + stateHigh: "bread", + stateHighColorMultiplier: 0.9, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true, + hidden: true +} + +if (!elements.melted_chocolate.reactions) elements.melted_chocolate.reactions = {}; +elements.melted_chocolate.reactions.flour = { elem1: "cookie_dough", elem2: null } + +elements.cookie_dough = { + color: ["#946826","#9e783f","#8a6d41","#614925"], + behavior: behaviors.STURDYPOWDER, + category: "food", + tempHigh: 94, + stateHigh: "cookie", + stateHighColorMultiplier: 1.1, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true, + hidden: true +} + +elements.cookie = { + color: "#7d5f2e", + behavior: behaviors.STURDYPOWDER, + tempHigh: 605, + stateHigh: "ash", + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + breakIntoColor: "#7d6216", + state: "solid", + density: 233.96, + isFood: true +} + +elements.nut_oil.name = "cooking_oil" + +elements.bread.behavior = behaviors.SUPPORT + +elements.toast.behavior = behaviors.SUPPORT + +if (!elements.caramel.reactions) elements.caramel.reactions = {}; +elements.caramel.reactions.corn_starch = { elem1: "boba_dough", elem2: null, chance: 0.35, tempMin: 70} + +elements.boba_dough = { + color: ["#4a2007","#2b1304"], + behavior: behaviors.STURDYPOWDER, + category: "food", + tempHigh: 400, + stateHigh: "ash", + stateHighColorMultiplier: 0.8, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + reactions: { + "water": { elem1:"boba", tempMin:60}, + }, + isFood: true, + hidden: true +} + +elements.boba = { + color: "#59290c", + behavior: behaviors.POWDER, + tempHigh: 300, + stateHigh: "fire", + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakIntoColor: "#7d6216", + state: "solid", + 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", + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#c4b939", +} +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, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#c4b939", +} +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 }, + "milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"}, + "coconut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"}, + "nut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#ede59a", color2:"#ede59a"} + }, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("banana_juice"); + +elements.banana_bread = { + color: "#c2782f", + desc: "delicious banana bread", + 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 +} +elements.sprinkles = { + color: ["#eb726a", "#ebca6a", "#88eb6a", "#6aaceb", "#eb6ade"], + behavior: behaviors.POWDER, + category: "food", + state: "solid", + desc: "colorful edible sand", + hidden: false, + isFood: true, + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "sugar", + breakIntoColor: ["#fb827a", "#fbda7a", "#98fb7a", "#7abcfb", "#fb7aee"], + tempHigh: 176, + stateHigh: "caramel", + density: 277, + cooldown: 2 +} +elements.chocolate_chips = { + color: "#6e4c1d", + behavior: behaviors.POWDER, + tempHigh: 31, + stateHigh: "melted_chocolate", + category: "food", + state: "solid", + density: 1325, + isFood: true, + desc: "chocolate chips yum", + cooldown: 2 +} +elements.chocolate.breakInto = "chocolate_chips" +//elements.fruit_milk.stateLowColorMultiplier = 0.9 + +elements.passion_fruit_vine = { + color: "#00df00", + behavior: [ + "ST:wood|ST:wood|ST:wood", + "ST:wood AND CR:passion_fruit%0.02|XX|ST:wood AND CR:passion_fruit%0.02", + "ST:wood|ST:wood AND M1|ST:wood", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto: "dead_plant" +} +elements.passion_fruit_seed = { + color: "#6b4f36", + 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)) { + if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x,pixel.y+1); + } + } + if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); + } + /*if (pixelMap[pixel.x+1][pixel.y-1].element !== "wood" && pixelMap[pixel.x-1][pixel.y-1].element !== "wood") { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x,pixel.y+1); + if (isEmpty(pixel.x+1,pixel.y-1) && pixelMap[pixel.x+2][pixel.y-1].element === "wood") { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x-1,pixel.y+1); + } + if (isEmpty(pixel.x-1,pixel.y-1) && pixelMap[pixel.x-2][pixel.y-1].element === "wood") { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("passion_fruit_vine",pixel.x+1,pixel.y+1); + } + }*/ + } + else if (pixel.age > 400 && Math.random() < 0.1) { + changePixel(pixel,"passion_fruit_vine"); + } + 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: [ + "ST:wood,passion_fruit_vine|ST:wood,passion_fruit_vine|ST:wood,passion_fruit_vine", + "ST:wood,passion_fruit_vine|XX|ST:wood,passion_fruit_vine", + "ST:wood,passion_fruit_vine|M1|ST:wood,passion_fruit_vine", + ], +}; + +elements.passion_fruit = { + color: "#78236f", + behavior: [ + "ST:passion_fruit_vine%95|ST:passion_fruit_vine%95|ST:passion_fruit_vine%95", + "ST:passion_fruit_vine%95|XX|ST:passion_fruit_vine%95", + "ST:passion_fruit_vine%95|M1|ST:passion_fruit_vine%95", + ], + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: ["passion_fruit_juice","passion_fruit_juice",/*"passion_fruit_seed"*/], + state: "solid", + density: 1050, + cutInto: "passion_fruit_flesh", + temp:20, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#412e6b" +} +elements.passion_fruit_flesh = { + color: "#ffe205", + behavior: behaviors.LIQUID, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + viscosity: 999, + burnInto: "dead_plant", + breakInto: ["passion_fruit_juice","passion_fruit_juice",/*"passion_fruit_seed"*/], + state: "solid", + density: 1050, + hidden: true, + temp: 20 +} +elements.passion_fruit_juice = { + color: "#d6bf2b", + behavior: behaviors.LIQUID, + category: "liquids", + tempHigh: 100, + stateHigh: ["steam","sugar"], + burn: 70, + burnTime: 300, + burnInto: ["steam", "smoke"], + state: "liquid", + density: 825, + hidden: true, + temp: 20, + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#d6bf2b") + } + } + }, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("passion_fruit_juice"); + +elements.mango_wood = { + color: "#966435", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.mango_branch = { + color: "#966435", + behavior: [ + "CR:mango_leaves,mango_branch%2|CR:mango_leaves,mango_branch%2|CR:mango_leaves,mango_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "mango_wood", + tempLow: -30, + stateLow: "mango_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], +} +elements.mango_leaves = { + color: ["#61b535","#5fba2f"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:mango%0.1|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 +} +elements.mango = { + color: ["#cc5b3f","#cc8a3f","#ccb93f","#abcc3f"], + behavior: behaviors.POWDER, + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "mango_juice", + cutInto: "cut_mango", + state: "solid", + density: 1050, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#ccb50a", +} + +elements.cut_mango = { + color: "#ebcb2d", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "mango_juice", + state: "solid", + density: 1050, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#ccb50a", +} + +elements.mango_seed = { + color: "#9e8951", + 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 ? "mango_wood" : "mango_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"mango_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.mango_juice = { + color: "#f0c348", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#f0c348") + } + } + }, + reactions: { + "milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"}, + "coconut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"}, + "nut_milk": { elem1: "fruit_milk", elem2: "fruit_milk", chance: 0.35, color1:"#fada70", color2:"#fada70"} + }, + 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, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("mango_juice"); + +elements.pineapple_leaves = { + color: "#3aab11", + 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 +} +elements.pineapple = { + color: "#e8bc38", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "pineapple_juice", + state: "solid", + density: 1050, + temp:20, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#ccb90a", +} +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"); + 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+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { + createPixel("pineapple_leaves",pixel.x+1,pixel.y); + createPixel("pineapple_leaves",pixel.x-1,pixel.y); + if (isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x+2,pixel.y-1)) { + createPixel("pineapple_leaves",pixel.x+2,pixel.y-1); + createPixel("pineapple_leaves",pixel.x-2,pixel.y-1); + if (isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { + createPixel("pineapple",pixel.x,pixel.y-1); + createPixel("pineapple",pixel.x+1,pixel.y-1); + createPixel("pineapple",pixel.x-1,pixel.y-1); + if (isEmpty(pixel.x,pixel.y-2) && isEmpty(pixel.x+1,pixel.y-2) && isEmpty(pixel.x-1,pixel.y-2)) { + createPixel("pineapple",pixel.x,pixel.y-2); + createPixel("pineapple",pixel.x+1,pixel.y-2); + createPixel("pineapple",pixel.x-1,pixel.y-2); + if (isEmpty(pixel.x,pixel.y-3) && isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { + createPixel("pineapple",pixel.x,pixel.y-3); + createPixel("pineapple",pixel.x+1,pixel.y-3); + createPixel("pineapple",pixel.x-1,pixel.y-3); + if (isEmpty(pixel.x,pixel.y-4) && isEmpty(pixel.x+1,pixel.y-4) && isEmpty(pixel.x-1,pixel.y-4)) { + createPixel("pineapple",pixel.x,pixel.y-4); + createPixel("pineapple",pixel.x+1,pixel.y-4); + createPixel("pineapple",pixel.x-1,pixel.y-4); + if (isEmpty(pixel.x,pixel.y-5) && isEmpty(pixel.x+1,pixel.y-6) && isEmpty(pixel.x-1,pixel.y-6)) { + createPixel("pineapple_leaves",pixel.x,pixel.y-5); + createPixel("pineapple_leaves",pixel.x+1,pixel.y-6); + createPixel("pineapple_leaves",pixel.x-1,pixel.y-6); + pixel.leafgrown = true + } + } + } + } + } + } + } + } + } + } + } + else if (pixel.age > 500 && pixel.leafgrown == true && Math.random() < 0.1) { + changePixel(pixel,"pineapple_leaves"); + } + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + "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|XX|XX", + "XX|M1|XX", + ], +}; +elements.pineapple_juice = { + color: "#d9ba32", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#d9ba32") + } + } + }, + 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, + tempLow: 0 +}; +eLists.JUICEMIXABLE.push("pineapple_juice"); + +elements.lime = { + color: ["#549c2d","#4d9c22"], + behavior: behaviors.POWDER, + 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:"food", + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#5eab24", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "lime_juice", + state: "solid", + density: 1050, + isFood: true, + cutInto: ["lime_zest","lime_slice","lime_slice","lime_slice","lime_slice"], +} + +elements.lime_juice = { + color: "#85d14b", + onMix: function(pixel) { + if (shiftDown) { + if (Math.random() < 0.2) { + changePixel(pixel,"juice") + pixel.color = pixelColorPick(pixel,"#85d14b") + } + } + }, + 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, + hidden: true, + tempLow: 0, +}; +eLists.JUICEMIXABLE.push("lime_juice"); + +elements.lime_zest = { + color: "#4f9e13", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, +} + +elements.lime_slice = { + color: "#8acc33", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "lime_juice", + state: "solid", + density: 1050, + hidden: true, +} + +elements.snail.reactions.nut_oil = { elem1: "escargot", chance:30, tempMin:50 } + +elements.escargot = { + color: "#ab924d", + behavior: behaviors.STURDYPOWDER2, + tempHigh: 120, + stateHigh: "steam", + breakInto: "quicklime", + category: "food", + state: "solid", + density: 1500, + conduct: 0.16 +} + +elements.broccoli = { + color: ["#49a82f","#429929"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "ST:broccoli_stem AND M2|ST:broccoli_stem AND M1|ST:broccoli_stem AND M2", + ], + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + isFood: true, + density: 1050, + cutInto: "cut_broccoli", +} +elements.broccoli_stem = { + color: ["#51c431","#45ba25"], + behavior: behaviors.STURDYPOWDER, + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + cutInto: "cut_broccoli", + state: "solid", + density: 1050, + hidden: true, +} + +elements.cut_broccoli = { + color: "#75d65a", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: "steam", + burn:65, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, +} + +elements.broccoli_seed = { + color: "#9e8951", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.2 && 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) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { + changePixel(pixel,"broccoli_stem"); + createPixel("broccoli",pixel.x,pixel.y-1); + createPixel("broccoli",pixel.x+1,pixel.y-1); + createPixel("broccoli",pixel.x-1,pixel.y-1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"broccoli"); + } + 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|XX|XX", + "XX|M1|XX", + ], +}; +elements.freeze_dried_fruits = { + color: "#ab1f31", + behavior: behaviors.POWDER, + tempHigh: 550, + stateHigh: "ash", + category: "food", + burn: 15, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + state: "solid", + density: 233.96, + isFood: true, +} + +elements.grape.freezeDryInto = "freeze_dried_fruits" +elements.grape.freezeDryIntoColor = "#5d156b" + +elements.soapy_water = { + color: "#72b8f2", + behavior: [ + "XX|CR:bubble%0.25|XX", + "M2%50|XX|M2%50", + "M2%50|M1|M2%50", + ], + tempHigh: 100, + stateHigh: "steam", + tempLow: 0, + category: "liquids", + heatCapacity: 4.184, + reactions: { + "dirt": {elem1: null,elem2: "mud"}, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "salt": { elem1: "salt_water", elem2: null, temp1:-20 }, + "dust": { elem2: null, elem2: null }, + "plague": { elem2: null, elem2: null }, + "rust": { elem1: "iron", chance:0.005 }, + "fallout": {elem2: null, chance:0.25 }, + "radiation": { elem2: null, chance:0.25 }, + "uranium": { elem2: null, chance:0.25 }, + "rotten_meat": { elem2: "meat", chance:0.25 }, + "rotten_cheese": { elem2: "cheese", chance:0.25 }, + "cancer": { elem2: null, chance:0.25 }, + "oil": { elem2: null, chance:0.005 }, + "dioxin": { elem1: "dirty_water", chance:0.1 }, + "quicklime": { elem1: "slaked_lime", elem2: "slaked_lime", temp2:100, temp1:100, chance:0.05 }, + "rock": { elem2: "wet_sand", chance: 0.00035 }, + "limestone": { elem2: "wet_sand", chance: 0.00035 }, + "tuff": { elem2: "wet_sand", color2:"#7a6b5c", chance: 0.00035 }, + "mudstone": { elem2: "mud", chance: 0.00035 }, + "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, + "cured_meat": {elem2:"meat" }, + }, + state: "liquid", + density: 997, + conduct: 0.02, + stain: -1, + extinguish: true +} + +elements.soap.behavior = behaviors.STURDYPOWDER +elements.soap.state = "solid" +elements.soap.category = "powders" + +elements.soap.reactions.water = {elem2: "soapy_water", elem1: null, chance: 10} +/* +if ([pixel.element].stain < 0 && [pixel.element] != "soap" && [pixel.element] != "soapy_water") { + [pixel.element].stain = [pixel.element].stain/10 +} +*/ +elements.onion = { + color: "#731066", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: "steam", + burn:65, + burnTime:60, + burnInto: "steam", + state: "solid", + density: 1050, + cutInto: "cut_onion", + breakInto:"onion_powder", + cutIntoEmit: "stench", +} +elements.cut_onion = { + color: "#dcc5ed", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: "steam", + burn:65, + burnTime:60, + burnInto: "steam", + state: "solid", + density: 1050, + breakInto:"onion_powder", + hidden: true, + reactions:{ "nut_oil": {elem1:"fried_onion", tempMin: 70, chance:10}} +} +elements.fried_onion = { + color: "#cf9344", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 500, + stateHigh: "ash", + burn:65, + burnTime:60, + burnInto: "ash", + state: "solid", + density: 1050, + hidden: true, +} + +elements.onion_seed = { + color: "#1a0e02", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.2 && 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-2) && isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1) && isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { + createPixel("onion",pixel.x,pixel.y-1); + createPixel("onion",pixel.x+1,pixel.y-1); + createPixel("onion",pixel.x-1,pixel.y-1); + createPixel("onion",pixel.x,pixel.y-2); + createPixel("onion",pixel.x+1,pixel.y); + createPixel("onion",pixel.x-1,pixel.y); + if (isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { + createPixel("plant",pixel.x-1,pixel.y-3); + createPixel("plant",pixel.x+1,pixel.y-3); + changePixel(pixel,"onion"); + } + } + } + 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|XX|XX", + "XX|M1|XX", + ], +} +elements.onion_powder = { + color: "#e6d8b8", + reactions: { + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + }, + behavior: behaviors.POWDER, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"food", + state: "solid", + density: 1400, + isFood: true, +} +elements.unhusked_rice = { + color: ["#c99a42","#b08638","#deb15d"], + behavior: [ + "XX|XX|XX", + "ST:rice_panicle|XX|ST:rice_panicle", + "ST:rice_plant AND M2|ST:rice_panicle AND M1|ST:rice_plant AND M2", + ], + 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:"food", + tempHigh: 65, + stateHigh: "cooked_rice", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "flour", + breakIntoColor: "#f7f1df", + state: "solid", + isFood: true, + density: 1050, + cutInto: "rice", +} +elements.rice = { + color: "#eeeed2", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 65, + stateHigh: "cooked_rice", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "rice_flour", + state: "solid", + isFood: true, + density: 1050, + reactions:{ + "water":{elem1:"porridge",elem2:"porridge",chance:3,tempMin:70}, + "nut_oil":{elem1:"fried_rice",elem2:null,chance:3,tempMin:60} + } +} +elements.cooked_rice = { + color: "#eddfb9", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 200, + stateHigh: "burnt_rice", + burn:65, + breakInto: "rice_flour", + state: "solid", + isFood: true, + density: 1050,reactions:{ + "water":{elem1:"porridge",elem2:"porridge",chance:3,tempMin:70}, + "nut_oil":{elem1:"fried_rice",elem2:null,chance:3,tempMin:60} + }, + hidden:true +} +elements.porridge = { + color: "#f2ecdc", + behavior: behaviors.LIQUID, + category:"food", + tempHigh: 200, + stateHigh: "steam", + viscosity: 999, + burn:65, + state: "solid", + isFood: true, + density: 1050, +} +elements.fried_rice = { + color: "#e8dda0", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 200, + stateHigh: "burnt_rice", + burn:65, + burnTime:60, + state: "solid", + isFood: true, + density: 1050,reactions:{ + "salt":{color1:"#ede5b9",elem2:null,chance:3}, + "monosodium_glutamate":{color1:"#ede5b9",elem2:null,chance:3} + }, + hidden:true +} +elements.burnt_rice = { + color: "#262217", + behavior: behaviors.POWDER, + category:"food", + tempHigh: 500, + stateHigh: "ash", + burn:65, + burnTime:60, + state: "solid", + isFood: true, + density: 1050, + hidden: true +} +elements.rice_plant = { + color: "#37a825", + behavior: behaviors.WALL, + category:"life", + tempHigh: 100, + stateHigh: "steam", + burn:65, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, + +} +elements.rice_seed = { + color: "#997a23", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.2 && 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-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y)){ + if(pixelMap[pixel.x+1][pixel.y].element === "water" && pixelMap[pixel.x-1][pixel.y].element === "water"){ + if (isEmpty(pixel.x,pixel.y-1)){ + movePixel(pixel,pixel.x,pixel.y-1) + createPixel("rice_plant",pixel.x,pixel.y+1) + pixel.notinwater=true + } + else if (!isEmpty(pixel.x,pixel.y-1)){ + if (pixelMap[pixel.x][pixel.y-1].element === "water") { + deletePixel(pixel.x,pixel.y-1) + movePixel(pixel,pixel.x,pixel.y-1) + createPixel("rice_plant",pixel.x,pixel.y+1) + } + } + } + } + if (Math.random() < 0.2 && pixel.age > 50 && pixel.temp < 100 && pixel.notinwater == true) { + if (isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)&&isEmpty(pixel.x+2,pixel.y-2) && isEmpty(pixel.x-2,pixel.y-2)) { + createPixel("rice_plant",pixel.x+1,pixel.y-1); + createPixel("rice_plant",pixel.x-1,pixel.y-1); + createPixel("rice_plant",pixel.x+2,pixel.y-2); + createPixel("rice_plant",pixel.x-2,pixel.y-2); + pixel.leafgrown = true + } + } + if (Math.random() < 0.2 && pixel.age > 50 && pixel.temp < 100 && pixel.leafgrown == true) { + if (isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x,pixel.y-2)&&isEmpty(pixel.x,pixel.y-3) && isEmpty(pixel.x,pixel.y-4)) { + movePixel(pixel,pixel.x,pixel.y-4) + createPixel("rice_plant",pixel.x,pixel.y+1); + createPixel("rice_plant",pixel.x,pixel.y+2); + createPixel("rice_plant",pixel.x,pixel.y+3); + createPixel("rice_plant",pixel.x,pixel.y+4); + changePixel(pixel,"rice_panicle") + pixel.grower = true + } + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"unhusked_rice"); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0, + "leafgrown":false, + "notinwater":false, + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 2500, + cooldown: defaultCooldown, + seed: true, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], +}; +elements.rice_panicle = { + color: "#37a825", + behavior: behaviors.WALL, + category:"life", + tempHigh: 100, + stateHigh: "steam", + burn:65, + burnTime:60, + burnInto: "dead_plant", + tick: function(pixel) { + if (Math.random() < 0.1) { + if (isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { + createPixel("unhusked_rice",pixel.x+1,pixel.y); + createPixel("unhusked_rice",pixel.x-1,pixel.y); + } + if (isEmpty(pixel.x+1,pixel.y+1) && isEmpty(pixel.x-1,pixel.y+1)) { + createPixel("unhusked_rice",pixel.x+1,pixel.y+1); + createPixel("unhusked_rice",pixel.x-1,pixel.y+1); + } + if (isEmpty(pixel.x,pixel.y-1)) { + createPixel("unhusked_rice",pixel.x,pixel.y-1); + } + } + }, + state: "solid", + density: 1050, + hidden: true, + +} + +elements.rice_flour = { + color: "#f7f1df", + behavior: behaviors.POWDER, + reactions: { + "water": { elem1: "mochi_dough", elem2: null }, + "salt_water": { elem1: "mochi_dough", elem2: null }, + "sugar_water": { elem1: "mochi_dough", elem2: null }, + "seltzer": { elem1: "mochi_dough", elem2: null }, + "yolk": { elem1: "batter", elem2: null }, + "yogurt": { elem1: "batter", elem2: null }, + "milk": { elem1:"dough", elem2:null }, + "cream": { elem1:"dough", elem2:null }, + }, + category: "food", + tempHigh: 400, + stateHigh: "fire", + burn:40, + burnTime:25, + state: "solid", + density: 600, + isFood: true +}, +elements.mochi_dough = { + color: "#ebddae", + behavior: behaviors.STURDYPOWDER, + onMix: function(dough,ingredient) { + if (elements[ingredient.element].isFood && elements[ingredient.element].id !== elements.dough.id && elements[ingredient.element].id !== elements.flour.id && elements[ingredient.element].id !== elements.batter.id && elements[ingredient.element].id !== elements.bread.id) { + var rgb1 = dough.color.match(/\d+/g); + var rgb2 = ingredient.color.match(/\d+/g); + // average the colors + var rgb = [ + Math.round((parseInt(rgb1[0])*10+parseInt(rgb2[0]))/11), + Math.round((parseInt(rgb1[1])*10+parseInt(rgb2[1]))/11), + Math.round((parseInt(rgb1[2])*10+parseInt(rgb2[2]))/11) + ]; + // convert rgb to hex + var hex = RGBToHex(rgb); + dough.color = pixelColorPick(dough, hex); + } + }, + category: "food", + tempHigh: 94, + stateHigh: "mochi", + //stateHighColorMultiplier: 0.9, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true, + hidden:true +}, +elements.mochi = { + color: "#f2e2a7", + behavior: behaviors.STURDYPOWDER, + tempHigh: 400, + stateHigh: ["ash","steam"], + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + state: "solid", + density: 233.96, + isFood: true +}, +elements.monosodium_glutamate = { + color: "#eeeeee", + behavior: behaviors.POWDER, + reactions: { + "ice": { elem1:null, elem2:"salt_water", chance:0.1 }, + "rime": { elem1:null, elem2:"salt_water", chance:0.075 }, + "snow": { elem1:null, elem2:"salt_water", chance:0.25 }, + "packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 }, + "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 }, + "water": { elem2: "salt_water", elem1: null, temp2:-20 }, + }, + category: "food", + tempHigh: 801, + state: "solid", + density: 2160, + alias: "msg", +} +elements.seaweed_spore = { + color: "#291f13", + tick: function(pixel) { + pixel.age++; + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else if (!isEmpty(pixel.x,pixel.y+1)){ + if (!outOfBounds(pixel.x,pixel.y+1)) { + if (pixelMap[pixel.x][pixel.y+1].element === "water"){ + swapPixels(pixel,pixelMap[pixel.x][pixel.y+1]) + } + } + } + if (!outOfBounds(pixel.x,pixel.y+1)) { + if (!isEmpty(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.rooted = true + } + } + } + if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rooted == true) { + if(!isEmpty(pixel.x,pixel.y-1)){ + if(pixelMap[pixel.x][pixel.y-1].element === "water"){ + //swapPixels(pixel,pixelMap[pixel.x][pixel.y-1]) + //changePixel("seaweed_stem",pixel.x,pixel.y+1) + deletePixel(pixel.x,pixel.y-1) + movePixel(pixel,pixel.x,pixel.y-1) + createPixel("seaweed_stem",pixel.x,pixel.y+1) + if (!isEmpty(pixel.x-1,pixel.y+1) && !isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.5){ + if (pixelMap[pixel.x-1][pixel.y].element === "water" && pixelMap[pixel.x+1][pixel.y].element === "water" && pixelMap[pixel.x-1][pixel.y+1].element != "seaweed") { + deletePixel(pixel.x-1,pixel.y) + createPixel("seaweed",pixel.x-1,pixel.y) + deletePixel(pixel.x+1,pixel.y) + createPixel("seaweed",pixel.x+1,pixel.y) + } + } + } + } + if (pixel.age > 500 || isEmpty(pixel.x,pixel.y-1)) { + changePixel(pixel,"seaweed"); + } + } + doDefaults(pixel); + }, + properties: { + "age":0, + "rooted":false, + }, + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -2, + stateLow: "frozen_plant", + burn: 65, + burnTime: 15, + category: "life", + state: "solid", + density: 2500, + cooldown: defaultCooldown, + seed: true, + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], +}; +elements.seaweed_stem = { + color: "#35702c", + behavior: behaviors.STURDYPOWDER, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dried_seaweed", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, +} +elements.seaweed = { + color: ["#2e8021","#3e9031","#4ea041"], + behavior: [ + "XX|XX|XX", + "ST:seaweed_stem|XX|ST:seaweed_stem", + "XX|M1|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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "alcohol": { elem1:"agar", elem2:null, chance:0.035 }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dried_seaweed", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 997, +} +elements.dried_seaweed = { + color: ["#142e13","#041e03"], + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 400, + stateHigh: "fire", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, +} +elements.grape_vine = { + color: "#427a33", + behavior: [ + "ST:wood|ST:wood|ST:wood", + "ST:wood AND CR:grape%0.02|XX|ST:wood AND CR:grape%0.02", + "ST:wood|ST:wood AND M1|ST:wood", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto: "dead_plant" +} +elements.grape_seed = { + color: "#7a6033", + 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)) { + if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("grape_vine",pixel.x,pixel.y+1); + } + } + if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("grape_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("grape_vine",pixel.x+1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("grape_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("grape_vine",pixel.x+1,pixel.y+1); + } + } + else if (pixel.age > 400 && Math.random() < 0.1) { + changePixel(pixel,"grape_vine"); + } + 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: [ + "ST:wood,grape_vine|ST:wood,grape_vine|ST:wood,grape_vine", + "ST:wood,grape_vine|XX|ST:wood,grape_vine", + "ST:wood,grape_vine|M1|ST:wood,grape_vine", + ], +}; +elements.grape.behavior = [ + "ST:grape_vine%95|ST:grape_vine%95|ST:grape_vine%95", + "ST:grape_vine%95|XX|ST:grape_vine%95", + "M2 AND ST:grape_vine%95|M1|M2 AND ST:grape_vine%95", +] +elements.tomato_vine = { + color: "#2e7d1d", + behavior: [ + "ST:wood|ST:wood|ST:wood", + "ST:wood AND CR:tomato%0.02|XX|ST:wood AND CR:tomato%0.02", + "ST:wood|ST:wood AND M1|ST:wood", + ], + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto: "dead_plant" +} +elements.tomato_seed = { + color: "#945d26", + 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)) { + if (!isEmpty(pixel.x+1,pixel.y-1) || !isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("tomato_vine",pixel.x,pixel.y+1); + } + } + if (!isEmpty(pixel.x+2,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("tomato_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x-2,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("tomato_vine",pixel.x+1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x+1,pixel.y-1)) { + movePixel(pixel,pixel.x+1,pixel.y-1); + createPixel("tomato_vine",pixel.x-1,pixel.y+1); + } + if (!isEmpty(pixel.x,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x-1,pixel.y-1)) { + movePixel(pixel,pixel.x-1,pixel.y-1); + createPixel("tomato_vine",pixel.x+1,pixel.y+1); + } + } + else if (pixel.age > 400 && Math.random() < 0.1) { + changePixel(pixel,"tomato_vine"); + } + 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: [ + "ST:wood,tomato_vine|ST:wood,tomato_vine|ST:wood,tomato_vine", + "ST:wood,tomato_vine|XX|ST:wood,tomato_vine", + "ST:wood,tomato_vine|M1|ST:wood,tomato_vine", + ], +}; +elements.tomato.behavior = [ + "ST:tomato_vine%95|ST:tomato_vine%95|ST:tomato_vine%95", + "ST:tomato_vine%95|XX|ST:tomato_vine%95", + "ST:tomato_vine%95|M1|ST:tomato_vine%95", +] +elements.peppermint_stem = { + color: "#2c9c3a", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + cutInto:"peppermint", + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto: "dead_plant", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { + movePixel(pixel,pixel.x,pixel.y+1); + } + if (pixel.grower == true) { + // set limit to 3 + rounded math.random inside the function + // check if left side has stem if no set direction to right + if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x-1][pixel.y].element == "peppermint_stem") { + pixel.direction = "right"; + pixel.limit = 3+Math.round(Math.random()); + } + } + // same thing to set direction the left + else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x+1][pixel.y].element == "peppermint_stem") { + pixel.direction = "left"; + pixel.limit = 3+Math.round(Math.random()); + } + } + } + if (pixel.grower == true && pixel.limit > 0) { + // left + if (pixel.direction == "left") { + if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { + createPixel("peppermint_leaves",pixel.x-1,pixel.y-1); + if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { + createPixel("peppermint_leaves",pixel.x-2,pixel.y-2); + if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { + createPixel("peppermint_leaves",pixel.x-3,pixel.y-3); + if (isEmpty(pixel.x-4,pixel.y-4) && Math.random() < 0.75 && pixel.limit == 4) { + createPixel("peppermint_leaves",pixel.x-4,pixel.y-4); + } + } + } + } + } + // right + else if (pixel.direction == "right") { + if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { + createPixel("peppermint_leaves",pixel.x+1,pixel.y-1); + if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { + createPixel("peppermint_leaves",pixel.x+2,pixel.y-2); + if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { + createPixel("peppermint_leaves",pixel.x+3,pixel.y-3); + if (isEmpty(pixel.x+4,pixel.y-4) && Math.random() < 0.75 && pixel.limit == 4) { + createPixel("peppermint_leaves",pixel.x+4,pixel.y-4); + } + } + } + } + } + } + pixel.age++; + doDefaults(pixel); + }, + properties: { + "grower":false, + "age":0, + "direction":"undefined", + "limit":0 + } +} +elements.peppermint_leaves = { + color: "#36a845", + reactions: { + "water": { elem2:"peppermint_tea", tempMin:80 }, + "salt_water": { elem2:"peppermint_tea", tempMin:80 }, + "sugar_water": { elem2:"peppermint_tea", tempMin:80 }, + "seltzer": { elem2:"peppermint_tea", tempMin:80 }, + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + "yeast": {elem1:"tea", chance:0.01}, + "ice_cream": {elem1:null,color2:"#94e067",chance:0.3} + }, + behavior: behaviors.WALL, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + tempLow: -2, + stateLow: "frozen_plant", + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"food", + state: "solid", + density: 1400, + isFood: true, + cutInto: "peppermint" +}, +elements.peppermint_seed = { + color: "#6b5f4c", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + 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)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("peppermint_stem",pixel.x,pixel.y+1); + pixel.height++; + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("peppermint_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("peppermint_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { + if (isEmpty(pixel.x-1,pixel.y)) { + createPixel("peppermint_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + } + } + if (pixel.height > 11) { + if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { + createPixel("peppermint_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + createPixel("peppermint_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + deletePixel(pixel.x,pixel.y); + } + } + } + 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.peppermint_tea = { + color: "#687d1d", + behavior: behaviors.LIQUID, + reactions: { + "stench": { elem2:null }, + "flea": { elem2:null, chance:0.01 }, + "oxygen": { elem2:"fragrance", chance:0.01 }, + "infection": { elem2:"blood", chance:0.005 }, + "plague": { elem2:null, chance:0.004 }, + "sugar": { elem2:null, color1:"#8f5a21", chance:0.005}, + "honey": { elem2:null, color1:"#8f5a21", chance:0.005}, + "milk": { elem2:null, color1:"#9c6c38", chance:0.005}, + "cream": { elem2:null, color1:"#9c6c38", chance:0.005}, + "ice_cream": { elem2:null, color1:"#9c6c38", chance:0.005}, + "honey": {color1:"#8d8f27",elem2:null,chance:0.3}, + "lemon_juice": {color1:"#8d8f27",elem2:null,chance:0.3}, + "lemonade": {color1:"#8d8f27",elem2:null,chance:0.3}, + "sugar": {color1:"#83963e",elem2:null,chance:0.3} + }, + tempHigh: 125, + stateHigh: ["steam","fragrance",null], + temp: 50, + tempLow: 0, + category:"liquids", + state: "liquid", + density: 1001, + stain: -0.1, + hidden: true, + isFood: true +} +elements.peppermint = { + color: ["#64a135","#559425"], + reactions: { + "water": { elem2:"peppermint_tea", tempMin:80 }, + "salt_water": { elem2:"peppermint_tea", tempMin:80 }, + "sugar_water": { elem2:"peppermint_tea", tempMin:80 }, + "seltzer": { elem2:"peppermint_tea", tempMin:80 }, + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + "ice_cream": {elem1:null,color2:"#94e067",chance:0.3}, + }, + behavior: behaviors.POWDER, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"food", + state: "solid", + density: 1400, + isFood: true, +} +//elements.candy.reactions.peppermint = {color1:["eeeddc","f5f267"],elem2:null,chance:3} +elements.vanilla_stem = { + color: "#5d9c48", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, + breakInto: "dead_plant", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { + movePixel(pixel,pixel.x,pixel.y+1); + } + if (pixel.grower == true) { + // check if left side has stem if no set direction to right + if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x-1][pixel.y].element == "vanilla_stem") { + pixel.direction = "right"; + } + } + // same thing to set direction the left + else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x+1][pixel.y].element == "vanilla_stem") { + pixel.direction = "left"; + } + } + } + if (pixel.grower == true) { + // left + if (pixel.direction == "left") { + if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { + createPixel("vanilla_leaves",pixel.x-1,pixel.y-1); + if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { + createPixel("vanilla_leaves",pixel.x-2,pixel.y-2); + if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { + createPixel("vanilla_leaves",pixel.x-3,pixel.y-3); + } + } + } + } + // right + else if (pixel.direction == "right") { + if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { + createPixel("vanilla_leaves",pixel.x+1,pixel.y-1); + if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { + createPixel("vanilla_leaves",pixel.x+2,pixel.y-2); + if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { + createPixel("vanilla_leaves",pixel.x+3,pixel.y-3); + } + } + } + } + } + pixel.age++; + doDefaults(pixel); + }, + properties: { + "grower":false, + "age":0, + "direction":"undefined", + } +} +elements.vanilla_leaves = { + color: "#5d9c48", + reactions: { + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + "yeast": {elem1:"tea", chance:0.01}, + }, + tick: function(pixel) { + if (isEmpty(pixel.x-1,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y+1) && Math.random() < 0.03) { + createPixel("vanilla_flower",pixel.x-1,pixel.y-1); + } + if (isEmpty(pixel.x+1,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y+1) && Math.random() < 0.03) { + createPixel("vanilla_flower",pixel.x+1,pixel.y-1); + } + pixel.age++; + doDefaults(pixel); + }, + behavior: behaviors.WALL, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + tempLow: -2, + stateLow: "frozen_plant", + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"life", + state: "solid", + density: 1400, + isFood: true, + hidden:true +}, +elements.vanilla_seed = { + color: "#806d3b", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + 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)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("vanilla_stem",pixel.x,pixel.y+1); + pixel.height++; + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("vanilla_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("vanilla_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { + if (isEmpty(pixel.x-1,pixel.y)) { + createPixel("vanilla_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + } + } + if (pixel.height > 11) { + if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { + createPixel("vanilla_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + createPixel("vanilla_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + deletePixel(pixel.x,pixel.y); + } + } + } + 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.vanilla_flower = { + color: "#f7f4e1", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + tick: function(pixel) { + if (pixel.age > 175 && pixel.pod == true) { + changePixel(pixel,"vanilla_pod") + } + if (isEmpty(pixel.x,pixel.y+1) && Math.random() < 0.03 && pixel.pod == false && pixel.harvested == false) { + createPixel("vanilla_flower",pixel.x,pixel.y+1); + pixelMap[pixel.x][pixel.y+1].pod = true; + if (Math.random < 0.5) { + pixel.harvested = true; + } + } + pixel.age++ + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + properties: { + "age":0, + "pod":false, + "harvested":false, + } +} + +elements.vanilla_pod = { + color: "#36281d", + behavior: [ + "XX|ST:vanilla_flower|XX", + "XX|XX|XX", + "XX|M1|XX", + ], + reactions: { + "alcohol": { elem1:"vanilla_essence", elem2:null, chance:0.035 }, + }, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, +} +elements.ice_cream.reactions = {} +elements.ice_cream.reactions.vanilla_essence = {color1:"#fff7b6", elem2:null, chance:0.35} +elements.vanilla_essence = { + color: "#9c7211", + behavior: behaviors.LIQUID, + tempHigh: 170, + stateHigh: ["sugar","smoke","smoke"], + tempLow: 0, + category:"liquids", + state: "liquid", + density: 1400, +} + +elements.candy.reactions = {} +elements.candy.reactions.peppermint = {elem1:"peppermint_candy", elem2:null, chance:0.35} +elements.peppermint_candy = { + color: ["#fa5e3e","#fff5f5"], + behavior: behaviors.WALL, + tempHigh: 204.44, + stateHigh: "smoke", + category: "food", + state: "solid", + density: 850, + isFood: true +} +elements.tapioca = { + color: "#ded58e", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber%0.5|M1 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber,fiber%0.5|M2 AND CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>tapioca,fiber%0.5", + ], + tempHigh: 275, + stateHigh: "dirt", + tempLow: -50, + stateLow: "fiber", + burn: 20, + burnTime: 60, + burnInto: "dirt", + breakInto: "corn_starch", + category: "food", + state: "solid", + density: 1250, + conduct: 0.1, + hidden: true, + darkText: true, + desc:'a wise icyking once said: \'state:"burn 100"\'', + alias:["element that i made before icyking","burn 100 element"] +} + +elements.tapioca_seed = { + color: "#a78d38", + 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,"tapioca"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("tapioca_stem",pixel.x,pixel.y+1); + } + if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.2) { + createPixel("tapioca_leaves",pixel.x+1,pixel.y); + } + if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.2) { + createPixel("tapioca_leaves",pixel.x-1,pixel.y); + } + } + else if (pixel.age > 250) { + changePixel(pixel,"tapioca_leaves"); + } + 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.tapioca_stem = { + color: "#358f35", + behavior: behaviors.STURDYPOWDER, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +elements.tapioca_leaves = { + color: "#3e823e", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + breakInto: "dead_plant", + state: "solid", + density: 1050 +} +elements.sprinkle_bomb = { + color: ["#eb726a", "#ebca6a", "#88eb6a", "#6aaceb", "#eb6ade"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1 AND EX:10>sprinkles|XX", + ], + category: "food", + state: "solid", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown +} + +elements.chilli_stem = { + color: "#5d9c48", + behavior: behaviors.WALL, + 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 }, + "mercury": { elem1:"dead_plant", elem2:null, chance:0.01 }, + "stench": { elem2:null, chance:0.25 }, + "carbon_dioxide": { elem2:"oxygen", chance:0.25 }, + }, + category:"life", + tempHigh: 100, + stateHigh: "dead_plant", + tempLow: -1.66, + stateLow: "frozen_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + hidden: true, + breakInto: "herb", + breakIntoColor:"#245c1b", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1) && pixel.grower == false && pixel.leafgrower == false) { + movePixel(pixel,pixel.x,pixel.y+1); + } + if (pixel.grower == true) { + // check if left side has stem if no set direction to right + if (!isEmpty(pixel.x-1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x-1][pixel.y].element == "chilli_stem") { + pixel.direction = "right"; + } + } + // same thing to set direction the left + else if (!isEmpty(pixel.x+1,pixel.y) && pixel.direction == "undefined") { + if (pixelMap[pixel.x+1][pixel.y].element == "chilli_stem") { + pixel.direction = "left"; + } + } + } + if (pixel.grower == true) { + // left + if (pixel.direction == "left") { + if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.1) { + createPixel("chilli_leaves",pixel.x-1,pixel.y-1); + if (isEmpty(pixel.x-2,pixel.y-2) && Math.random() < 0.2) { + createPixel("chilli_leaves",pixel.x-2,pixel.y-2); + if (isEmpty(pixel.x-3,pixel.y-3) && Math.random() < 0.4) { + createPixel("chilli_leaves",pixel.x-3,pixel.y-3); + } + } + } + } + // right + else if (pixel.direction == "right") { + if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.1) { + createPixel("chilli_leaves",pixel.x+1,pixel.y-1); + if (isEmpty(pixel.x+2,pixel.y-2) && Math.random() < 0.2) { + createPixel("chilli_leaves",pixel.x+2,pixel.y-2); + if (isEmpty(pixel.x+3,pixel.y-3) && Math.random() < 0.4) { + createPixel("chilli_leaves",pixel.x+3,pixel.y-3); + } + } + } + } + } + pixel.age++; + doDefaults(pixel); + }, + properties: { + "grower":false, + "age":0, + "direction":"undefined", + } +} +elements.chilli_leaves = { + color: "#5d9c48", + reactions: { + "water": { elem2:"chilli_tea", tempMin:80 }, + "salt_water": { elem2:"chilli_tea", tempMin:80 }, + "sugar_water": { elem2:"chilli_tea", tempMin:80 }, + "seltzer": { elem2:"chilli_tea", tempMin:80 }, + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + "yeast": {elem1:"tea", chance:0.01}, + }, + tick: function(pixel) { + if (isEmpty(pixel.x-1,pixel.y-1) && !isEmpty(pixel.x+1,pixel.y+1) && Math.random() < 0.03) { + createPixel("chilli",pixel.x-1,pixel.y-1); + } + if (isEmpty(pixel.x+1,pixel.y-1) && !isEmpty(pixel.x-1,pixel.y+1) && Math.random() < 0.03) { + createPixel("chilli",pixel.x+1,pixel.y-1); + } + pixel.age++; + doDefaults(pixel); + }, + behavior: behaviors.WALL, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + tempLow: -2, + stateLow: "frozen_plant", + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"life", + state: "solid", + density: 1400, + isFood: true, + hidden:true, + breakInto: "herb", + breakIntoColor:"#245c1b", +}, +elements.chilli_seed = { + color: "#806d3b", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + 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)) { + movePixel(pixel,pixel.x,pixel.y-1); + createPixel("chilli_stem",pixel.x,pixel.y+1); + pixel.height++; + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 3) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("chilli_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 9) { + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("chilli_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + } + } + if (pixel.height < 12 && pixel.height > 2 && pixel.height == 6) { + if (isEmpty(pixel.x-1,pixel.y)) { + createPixel("chilli_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + } + } + if (pixel.height > 11) { + if (isEmpty(pixel.x-1,pixel.y) && isEmpty(pixel.x+1,pixel.y)) { + createPixel("chilli_stem",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].grower = true; + createPixel("chilli_stem",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].grower = true; + deletePixel(pixel.x,pixel.y); + } + } + } + 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.chilli = { + color: "#ba3030", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "ST:chilli_leaves|M1|ST:chilli_leaves", + ], + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:15, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto: "chilli_powder", + reactions: { + "sauce": {elem1:null, elem2:"hot_sauce", chance:2} + }, +} +elements.chilli_powder = { + color: "#a32121", + reactions: { + "stench": { elem2:null, chance:0.25 }, + "steam": { elem2:"fragrance", chance:0.1 }, + "flea": { elem2:null, chance:0.01 }, + "termite": { elem2:null, chance:0.01 }, + "fly": { elem2:null, chance:0.01 }, + "ant": { elem2:null, chance:0.01 }, + "stink_bug": { elem2:null, chance:0.01 }, + "sauce": {elem1:null, elem2:"hot_sauce", chance:2} + }, + behavior: behaviors.POWDER, + tempHigh: 300, + stateHigh: ["fire","smoke","smoke","smoke","ash"], + burn:10, + burnTime:300, + burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"], + category:"food", + state: "solid", + density: 1400, + isFood: true, +} +elements.hot_sauce = { + color: "#a31414", + behavior: behaviors.LIQUID, + reactions: { + "stench": { elem2:null }, + }, + viscosity: 2600, + tempHigh: 260, + stateHigh: ["steam","salt","fragrance"], + tempLow: -2, + category:"food", + state: "liquid", + density: 1031.33, + stain: 0.01, + isFood: true +} +elements.head.reactions.hot_sauce = {elem2:["smoke","fire",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], chance:3} + + +elements.durian_wood = { + color: "#5e4b23", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.durian_branch = { + color: "#5e4b23", + behavior: [ + "CR:durian_leaves,durian_branch%2|CR:durian_leaves,durian_branch%2|CR:durian_leaves,durian_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "durian_wood", + tempLow: -30, + stateLow: "durian_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], +} +elements.durian_leaves = { + color: ["#326b25","#2e751e"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:durian%0.1|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 +} +elements.durian = { + color: ["#578524","#5b8f1f"], + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + cutInto: "cut_durian", + state: "solid", + density: 1050, +} + +elements.cut_durian = { + color: ["#e3e04b","#d1cf36"], + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + state: "solid", + density: 1050, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#a19f3b", +} + +elements.durian_seed = { + color: "#a17d3b", + 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 ? "durian_wood" : "durian_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"durian_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.egg_white = { + color: "#edece8", + behavior: behaviors.LIQUID, + tempHigh: 100, + stateHigh: "hard_egg_white", + tempLow: 0, + stateLow: "hard_egg_white", + category: "food", + state: "liquid", + density: 1027.5, + viscosity: 270, + isFood: true, + whiskInto: "whisked_egg_white", +} +elements.hard_egg_white = { + color: "#dedddc", + behavior: behaviors.STURDYPOWDER, + tempHigh: 400, + stateHigh: "smoke", + category: "food", + hidden: true, + isFood: true, + state: "solid", + density: 1031 +} +elements.milk.whiskInto = "cream"; +elements.cream.whiskInto = "whipped_cream"; +elements.egg.breakInto = ["egg_white","egg_white","yolk"] + +elements.whisked_egg_white ={ + color: "#fefefe", + behavior: behaviors.LIQUID, + reactions: { + "corn_syrup": { elem1: "marshmallow", elem2: null, chance: 2 }, + "sugar": { elem1: "marshmallow", elem2: null, chance: 2 }, + }, + viscosity: 1.5, + tempHigh: 1000, + stateHigh: ["smoke","steam"], + category: "food", + hidden: true, + isFood: true, + state: "liquid", + density: 959.97, +} +elements.marshmallow = { + color: "#fafafa", + behavior: [ + "XX|XX|XX", + "ST:wood|XX|ST:wood", + "XX|M1|XX", + ], + viscosity: 1.5, + tempHigh: 70, + stateHigh: "cooked_marshmallow", + category: "food", + isFood: true, + state: "solid", + density: 959.97, +} +elements.cooked_marshmallow = { + color: "#f0dbb6", + behavior: [ + "XX|XX|XX", + "ST:wood|XX|ST:wood", + "XX|M1|XX", + ], + viscosity: 1.5, + tempHigh: 150, + stateHigh: "burnt_marshmallow", + category: "food", + isFood: true, + state: "solid", + density: 959.97, + hidden:true +} +elements.burnt_marshmallow = { + color: "#29231a", + behavior: [ + "XX|XX|XX", + "ST:wood|XX|ST:wood", + "XX|M1|XX", + ], + viscosity: 1.5, + tempHigh: 1000, + stateHigh: ["steam","caramel"], + category: "food", + isFood: true, + state: "solid", + density: 959.97, + hidden:true +} +eLists.FOODCOLORINGIGNORE = ["glass", "porcelain", "wall","iron","steel","copper","silver","aluminum","tungsten","gold","plastic"]; +elements.food_coloring = { + color: ["#ff0000", "#ff8800", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"], + behavior: behaviors.LIQUID, + customColor: true, + stain: 0.5, + tempHigh: 100, + stateHigh: "steam", + category: "food", + state: "liquid", + density: 998, + stainSelf: true, + ignore: ["glass", "porcelain", "wall","iron","steel","copper","silver","aluminum","tungsten","gold","plastic"], + desc: "coloring for food. color may fade when diluting with water.", + onMix: function (pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x + coord[0]; + var y = pixel.y + coord[1]; + if (!isEmpty(x, y, true)) { + if (pixelMap[x][y].element === "water" || pixelMap[x][y].element === "salt_water" || pixelMap[x][y].element === "sugar_water" || pixelMap[x][y].element === "seltzer" || pixelMap[x][y].element === "dirty_water" || pixelMap[x][y].element === "pool_water") { + changePixel(pixelMap[x][y], "food_coloring"); + let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixelMap[x][y].color), 0.5); + pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixelMap[x][y].color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + else { + if (!outOfBounds(pixelMap[x][y])) { + if (!eLists.FOODCOLORINGIGNORE.includes(pixelMap[x][y].element) && pixelMap[x][y].element !== "glass" && pixelMap[x][y].element !== "porcelain" && pixelMap[x][y].element !== "wall" && pixelMap[x][y].element !== "plastic") { + let newrgb2 = interpolateRgb(getRGB(pixel.color), getRGB(pixelMap[x][y].color), 0.9); + pixelMap[x][y].color = `rgb(${parseInt(newrgb2.r)},${parseInt(newrgb2.g)},${parseInt(newrgb2.b)})`; + if (Math.random() < 0.002) { + deletePixel(pixel.x,pixel.y) + } + } + } + } + } + } + }, + onSelect: function () { + logMessage("Tip: You can spread food coloring using water."); + }, +} + +elements.cooked_meat.behavior = behaviors.SUPPORT; + +elements.cake_batter = { + color: "#d4bc85", + behavior: behaviors.LIQUID, + onMix: function(batter,ingredient) { + if (elements[ingredient.element].isFood && elements[ingredient.element].id !== elements.batter.id && elements[ingredient.element].id !== elements.flour.id && elements[ingredient.element].id !== elements.yolk.id && elements[ingredient.element].id !== elements.dough.id && elements[ingredient.element].id !== elements.baked_batter.id && elements[ingredient.element].id !== elements.cake.id && elements[ingredient.element].id !== elements.cake_batter.id) { + var rgb1 = batter.color.match(/\d+/g); + var rgb2 = ingredient.color.match(/\d+/g); + // average the colors + var rgb = [ + Math.round((parseInt(rgb1[0])*10+parseInt(rgb2[0]))/11), + Math.round((parseInt(rgb1[1])*10+parseInt(rgb2[1]))/11), + Math.round((parseInt(rgb1[2])*10+parseInt(rgb2[2]))/11) + ]; + // convert rgb to hex + var hex = RGBToHex(rgb); + batter.color = pixelColorPick(batter, hex); + if ((elements[ingredient.element].density > elements.batter.density || shiftDown) && Math.random() < 0.05) { + // 50% change to delete ingredient + if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); } + else { + ingredient.color = pixelColorPick(ingredient, hex); + } + } + } + }, + reactions: { + "cream": { elem2:"cake_batter", tempMin:40, chance:0.01 }, + }, + category: "food", + tempHigh: 94, + stateHigh: "cake", + stateHighColorMultiplier: 0.9, + burn:40, + burnTime:25, + burnInto:"ash", + state: "liquid", + viscosity: 10000, + density: 1001, + hidden: true, + isFood: true +} +elements.batter.whiskInto = "cake_batter"; +elements.milk.stateHigh = ["steam","steam","condensed_milk"]; +elements.condensed_milk = { + color: "#f2f0df", + behavior: behaviors.LIQUID, + reactions: { + "cell": { elem1:"yogurt", 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": { color1:"#fffbf0", elem2:null, chance:0.5}, + }, + tempLow: 0, + stateLow: "ice_cream", + stateLowColorMultiplier: [0.97,0.93,0.87], + tempHigh: 500, + stateHigh: ["smoke","smoke","smoke","quicklime"], + viscosity: 1500, + category: "food", + state: "liquid", + density: 1036.86, + isFood: true, + alias: "evaporated_milk" +} +elements.wasabi = { + color: ["#82b55b","#6cad50","#7dcc5c"], + behavior: behaviors.STURDYPOWDER2, + 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 }, + "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"], + category: "food", + isFood: true, + state: "solid", + density: 959.97, +} +// extremely confused part +elements.beans.name = "baked_beans"; +elements.real_beans = { + name: "beans", + color: ["#e8dfc5","#d1c7ab"], + behavior: behaviors.POWDER, + category: "food", + tempHigh: 350, + stateHigh: ["fire","fire","ash"], + burn:3, + burnTime:500, + burnInto: ["fire","smoke","smoke","steam","ash"], + reactions: { + "sauce": { elem1: "beans", elem2: "beans" }, + "yeast": { elem1: "fermented_beans", elem2: null, chance:0.5 } + }, + state: "solid", + density: 721, + isFood: true, + alias: "soy_beans" +} +elements.fermented_beans = { + color:"#ada386", + behavior: behaviors.POWDER, + category: "food", + tempHigh: 350, + stateHigh: ["fire","fire","ash"], + burn:3, + burnTime:500, + burnInto: ["fire","smoke","smoke","steam","ash"], + state: "solid", + density: 721, + breakInto: "soy_sauce", + isFood: true, + alias: "natto" +} +elements.soy_sauce = { + color: "#480601", + behavior: behaviors.LIQUID, + tempLow: -5, + tempHigh: 105, + stateHigh: ["steam","steam","salt"], + state: "liquid", + category:"food", + density: 1200, +}; +// end of confused part + +elements.ice.breakInto = "slush"; + +elements.cracker_dough = { + color: "#dbd19a", + behavior: behaviors.STURDYPOWDER, + category: "food", + tempHigh: 94, + stateHigh: "cracker", + stateHighColorMultiplier: 1.1, + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true, + hidden: true +} + +elements.cracker = { + color: "#e0ddb8", + behavior: behaviors.STURDYPOWDER, + tempHigh: 605, + stateHigh: "ash", + category: "food", + burn: 30, + burnTime: 200, + burnInto: ["smoke","smoke","smoke","ash"], + breakInto: "crumb", + state: "solid", + density: 233.96, + isFood: true +} + +elements.agar = { + color: "#e0e0e0", + behavior: behaviors.POWDER, + reactions: { + "ice": { elem1:null, elem2:"salt_water", chance:0.1 }, + "rime": { elem1:null, elem2:"salt_water", chance:0.075 }, + "snow": { elem1:null, elem2:"salt_water", chance:0.25 }, + "packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 }, + "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 } + }, + category: "food", + tempHigh: 801, + state: "solid", + density: 2160, + alias: "gelatin" +} +// thanks to adora +elements.agar.reactions.juice = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; +}} +elements.agar.reactions.water = {elem1:"jelly",elem2:null,color1:"#e0e0e0",chance:0.05} + +elements.duck = { + color: ["#826c4e", "#2b5927", "#d6d6d6", "#7d4a2c"], + behavior: [ + "M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1|M2%2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%50|M2%1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%1", + "M2%10|XX|M2%10", + "XX|M1%33|XX", + ], + category:"life", + state: "solid", + reactions: { + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "duck_egg", + foodNeed: 10, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_duck", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "raw_duck", + burn:85, + burnTime:450, + state: "solid", + density: 1117, + conduct: 0.3, + cutInto: "raw_duck", +}; + +elements.duck_egg = { + color: "#e0d3ab", + behavior: behaviors.STURDYPOWDER2, + tick: function(pixel) { + if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) { + changePixel(pixel,"duckling") + } + doDefaults(pixel); + }, + category: "food", + state: "solid", + temp: 20, + tempLow: -18, + stateLow: "frozen_duck_egg", + breakInto: ["yolk"], + tempHigh: 400, + stateHigh: ["calcium", "ash"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "water": { elem2:null, elem1:"hard_boiled_egg", chance:10, tempMin:80 } + } +}; +elements.frozen_duck_egg = { + color: "#e0d3cf", + behavior: behaviors.POWDER, + category: "food", + state: "solid", + temp: -20, + tempHigh: 10, + stateHigh: "duck_egg", + breakInto: ["calcium", "hard_yolk"], + burn:50, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + hidden: true, +}; +elements.duckling = { + color: ["#f0eba8", "#f0eba8"], + behavior: [ + "M2%1|M2%2|M2%1", + "M2%10|FX%5 AND CH:duck%0.1|M2%10", + "XX|M1%33|XX", + ], + category: "life", + state: "solid", + egg: "duck_egg", + foodNeed: 20, + temp: 40, + tempHigh: 75, + stateHigh: "cooked_meat", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "blood", + burn:85, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "crushed_worm": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL}, + "meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chicken_nugget": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2: "crushed_worm", chance:0.3}, + "cooked_meat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fish": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "rat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "frog": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.32, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.35, func:behaviors.FEEDPIXEL }, + "bee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "flea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "termite": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + } +}; + +elements.barbecued_duck = { + color:["#a67d2d","#9c721f"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.steamed_duck = { + color:["#e8cb7b", "#d6bf7e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:50, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_duck = { + color:["#6b470e", "#8f5b09"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.cooked_duck = { + color: ["#a38046", "#b39652"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +}; + +elements.raw_duck = { + color: ["#d6a587", "#c99873"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "cooked_duck", + temp:25, + tempHigh: 600, + stateHigh: ["cooked_duck"], + reactions: { + "smoke": {elem1: "smoked_duck"}, + "steam": {elem1: "steamed_duck"}, + "water": {elem1: "boiled_duck", tempMin: 70}, + "nut_oil": {elem1: "fried_duck", tempMin: 70}, + "charcoal": {elem1: "barbecued_duck", tempMin: 70}, + "fire": {elem1: "barbecued_duck"} + } +}; + +elements.boiled_duck = { + color: ["#e0d4a4", "#e0d4a4"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 65, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} + +elements.fried_duck = { + color: ["#c49543", "#b88835", "#b07b20", "#996e23"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 90, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} +// side note: i don't eat beef +elements.cow = { + color: ["#292928", "#332b23", "#e0dfde", "#f0edeb"], + behavior: [ + "M2%1|XX|M2%1", + "M2%10|XX|M2%10", + "XX|M1|XX", + ], + category:"life", + state: "solid", + reactions: { + "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, + egg: "calf", + foodNeed: 10, + temp: 40, + tempHigh: 75, + stateHigh: "steak", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "raw_beef", + burn:85, + burnTime:450, + state: "solid", + density: 1117, + conduct: 0.3, + cutInto: "raw_beef", +}; +elements.calf = { + color: ["#363535", "#bdbdbd"], + behavior: [ + "M2%1|XX|M2%1", + "M2%10|FX%5 AND CH:cow%0.1|M2%10", + "XX|M1|XX", + ], + category: "life", + state: "solid", + foodNeed: 20, + temp: 40, + tempHigh: 75, + stateHigh: "steak", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: "blood", + burn:85, + burnTime:450, + state: "solid", + density: 900, + conduct: 0.1, + reactions: { + "petal": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "lichen": { 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 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + }, +}; + +elements.barbecued_steak = { + color:["#3b271a","#29180d"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} + +elements.smoked_beef = { + color:["#3b1911", "#3b2719"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.steak = { + color: ["#a38046", "#b39652"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, + alias: "cooked_beef" +}; + +elements.raw_beef = { + color: ["#ab5841", "#ab322e"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "steak", + temp:25, + tempHigh: 600, + stateHigh: ["steak"], + reactions: { + "smoke": {elem1: "smoked_beef"}, + "charcoal": {elem1: "barbecued_beef", tempMin: 70}, + "fire": {elem1: "barbecued_beef"} + } +}; + +elements.juice.reactions.milk = { 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)})`; +}} +elements.juice.reactions.cream = { 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)})`; +}} +elements.soda.reactions.soda = { + 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.reactions.soda = { + chance:70, + 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); + changePixel(pixelMap[pixel1.x][pixel1.y],"soda") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } + } +} +if (!elements.orange_juice.reactions) { elements.orange_juice.reactions = {} } +elements.orange_juice.reactions.seltzer = { elem1:"soda", elem2:"foam", color1:"#ffb319"} +elements.orange_juice.reactions.carbon_dioxide = { elem1:"soda", elem2:"foam", color1:"#ffb319"} +elements.agar.reactions.soda = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7); + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; +}} +elements.hard_jelly = { + color: "#c372b8", + behavior: behaviors.STURDYPOWDER, + tempHigh: 200, + stateHigh: ["smoke","sugar"], + category: "food", + state: "solid", + density: 1245, + isFood: true, + hidden: true, + temp: 0 +} +elements.jelly.stateLow = "hard_jelly" +elements.jelly.stateLowColorMultiplier = 1.2 +elements.jelly.temp = 0 + +elements.nut.name = "peanut"; +elements.nut_meat.name = "peanut_meat"; +elements.nut_butter.name = "peanut_butter"; From d6433da2eace526501eb0201f215155152d99142 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:41:19 -0400 Subject: [PATCH 29/67] big update --- mods/weapons.js | 144 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) diff --git a/mods/weapons.js b/mods/weapons.js index 6c8181a3..ecf0d417 100644 --- a/mods/weapons.js +++ b/mods/weapons.js @@ -76,6 +76,9 @@ elements.left_missile = { "M2|EX:10|XX", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.right_missile = { color: "#4c4e42", @@ -85,6 +88,9 @@ elements.right_missile = { "XX|EX:10|M2", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.up_missile = { color: "#4c4e42", @@ -94,7 +100,9 @@ elements.up_missile = { "XX|EX:10|XX", ], category:"ammunition", - alias: "the element that some guy try to add to my mod without my permission but when doing so fucked the behavior grid up", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.cluster_munition = { color: "#444444", @@ -160,6 +168,9 @@ elements.left_bullet = { "M2|XX|XX", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.right_bullet = { color: "#4c4e42", @@ -169,6 +180,9 @@ elements.left_bullet = { "XX|XX|M2", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.e_gun_left = { color: "#C0C0C0", @@ -226,6 +240,9 @@ elements.left_rocket = { "XX|XX|XX", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.right_rocket = { color: "#4c4e42", @@ -235,6 +252,9 @@ elements.left_rocket = { "XX|XX|XX", ], category:"ammunition", + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.e_rocket_launcher_left = { color: "#C0C0C0", @@ -529,6 +549,9 @@ elements.bombs_for_throwing_at_you_left = { "XX|XX|XX", "M1|M1%10 AND EX:10>bomb|XX", ], + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown } elements.machine_for_throwing_bombs_at_right = { color: "#524c41", @@ -549,6 +572,9 @@ elements.bombs_for_throwing_at_you_right = { "XX|XX|XX", "XX|M1%10 AND EX:10>bomb|M1", ], + density: 1300, + excludeRandom: true, + cooldown: defaultCooldown }, elements.energized_orb_left = { color: ["#e0e000","#f3f300"], @@ -592,4 +618,120 @@ elements.fast_bomb = { density: 1300, excludeRandom: true, cooldown: defaultCooldown +}, +elements.liquid_bomb = { + color: "#524c41", + tick: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (elements[pixel.element].viscosity && (!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + var move1Spots = [ + [pixel.x, pixel.y+1] + ] + } + else { + var move1Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x, pixel.y+1], + [pixel.x-1, pixel.y+1], + ] + } + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1); } + } + if (!moved) { + if (elements[pixel.element].viscosity===undefined || !(!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y)) { + tryMove(pixel, pixel.x-1, pixel.y); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y)) { + tryMove(pixel, pixel.x+1, pixel.y); + } + } + } + } + doDefaults(pixel); + }, + category: "weapons", + state: "liquid", + behavior: [ + "XX|EX:10>explosion|XX", + "XX|XX|XX", + "XX|EX:10>explosion|XX", + ], + density: 1300, + excludeRandom: true, + ignore: "gas_bomb", + cooldown: defaultCooldown +}, +elements.gas_bomb = { + color: "#524c41", + tick: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + var move1Spots = [ + [pixel.x, pixel.y+1], + [pixel.x, pixel.y-1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1);} + } + if (!moved) { + var move2Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x-1, pixel.y+1], + [pixel.x+1, pixel.y-1], + [pixel.x-1, pixel.y-1], + ] + for (var i = 0; i < move2Spots.length; i++) { + var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { break; } + else { move2Spots.splice(move2Spots.indexOf(coords), 1); } + } + } + doDefaults(pixel); + }, + category: "weapons", + state: "gas", + behavior: [ + "XX|EX:10>explosion|XX", + "XX|XX|XX", + "XX|EX:10>explosion|XX", + ], + density: 1300, + excludeRandom: true, + ignore: "liquid_bomb", + cooldown: defaultCooldown +} +elements.tank_left = { + color: "#bcc6cc", + category: "vehicles", + behavior: [ + "M2 AND CR:fast_bullet_left|XX|XX", + "M1|XX|XX", + "M1|M1|XX", + ], +}, +elements.tank_right = { + color: "#bcc6cc", + category: "vehicles", + behavior: [ + "XX|XX|M2 AND CR:fast_bullet_right", + "XX|XX|M1", + "XX|M1|M1", + ], } \ No newline at end of file From fb0cc8072fcc7457432a65023b48d6a21205acda Mon Sep 17 00:00:00 2001 From: lllllllllwith10ls Date: Fri, 12 Apr 2024 22:40:52 -0500 Subject: [PATCH 30/67] Actinides and Mixture II mod for nouser's competition --- mods/chem.js | 4123 +++++++++++++++++++++++++++++++++++++-------- mods/mixture.js | 26 +- mods/mixtureII.js | 440 +++++ 3 files changed, 3864 insertions(+), 725 deletions(-) create mode 100644 mods/mixtureII.js diff --git a/mods/chem.js b/mods/chem.js index c1e151f3..73438729 100644 --- a/mods/chem.js +++ b/mods/chem.js @@ -1,17 +1,77 @@ -function acidReact(acid,element,product1,product2,temp) +function toObject(color) { - if(product1 !== null) - elements[acid].ignore.push(product1); - if(product2 !== null) - elements[acid].ignore.push(product2); - elements[acid].ignore.push(element); - elements[acid].reactions[element] = { "elem1": product1, "elem2": product2, "temp1": temp, "temp2": temp }; + color = color.match(/\d+/g); + return color; +} + +function react(elem1,elem2,product1,product2,temp) +{ + elements[elem1].reactions[elem2] = { "elem1": product1, "elem2": product2, "temp1": temp, "temp2": temp }; +} +function acidReact(elem1,elem2,product1,product2,temp = 0) +{ + if(elements[elem1] && elements[elem1].ignore) + { + if(product1 !== null) + { + if(product1 instanceof Array) + { + elements[elem1].ignore.push(...product1); + } + } + if(product2 !== null) + { + if(product2 instanceof Array) + { + elements[elem1].ignore.push(...product2); + } + } + elements[elem1].ignore.push(elem2); + } + if(elements[elem2] && elements[elem2].ignore) + { + if(product1 !== null) + { + if(product1 instanceof Array) + { + elements[elem2].ignore.push(...product1); + } + } + if(product2 !== null) + { + if(product2 instanceof Array) + { + elements[elem2].ignore.push(...product2); + } + } + elements[elem2].ignore.push(elem1); + } + if(product1 !== null) + if(elements[product1] && elements[product1].ignore) + { + if(product2 !== null) + elements[product1].ignore.push(product2); + elements[product1].ignore.push(elem1); + elements[product1].ignore.push(elem2); + } + if(product2 !== null) + if(elements[product2] && elements[product2].ignore) + { + if(product1 !== null) + elements[product2].ignore.push(product1); + elements[product2].ignore.push(elem1); + elements[product2].ignore.push(elem2); + } + if(!elements[elem1].reactions[elem2]) + { + elements[elem1].reactions[elem2] = { "elem1": product1, "elem2": product2, "temp1": temp, "temp2": temp }; + } } elements.fluorine = { color: "#FFFFBF", behavior: behaviors.GAS, - ignore: ["FOOF","solid_FOOF","oxygen","liquid_oxygen","oxygen_ice","chlorine","liquid_chlorine","liquid_hydrogen_fluoride","liquid_fluorine","fluorine","fluorine_ice","hydrogen_fluoride","hydrofluoric_acid","hydrofluoric_ice","hydrofluoric_acid_gas","fire","smoke","acid_gas","neutral_acid","acid","acid_cloud","water","salt_water","sugar_water","dirty_water","steam","gold","hydrogen","polytetrafluoroethylene","molten_polytetrafluoroethylene","tungsten","tungsten_hexafluoride"], + ignore: ["foof","solid_foof","oxygen","liquid_oxygen","oxygen_ice","chlorine","liquid_chlorine","liquid_hydrogen_fluoride","liquid_fluorine","fluorine","fluorine_ice","hydrogen_fluoride","hydrofluoric_acid","hydrofluoric_ice","hydrofluoric_acid_gas","fire","smoke","acid_gas","neutral_acid","acid","acid_cloud","water","salt_water","sugar_water","dirty_water","steam","gold","hydrogen","polytetrafluoroethylene","molten_polytetrafluoroethylene","tungsten","tungsten_hexafluoride"], tick: function(pixel) { let change = false; for (let i = -1; i <= 1; i++) { @@ -39,7 +99,7 @@ elements.fluorine = { "pool_water": { "elem1": "hydrofluoric_acid", "elem2": "hydrogen" }, "primordial_soup": { "elem1": "hydrofluoric_acid", "elem2": "hydrogen" }, "neutral_acid": { "elem1": "hydrofluoric_acid", "elem2": "hydrogen" }, - "liquid_oxygen": { "elem1": "FOOF", "elem2": null }, + "liquid_oxygen": { "elem1": "foof", "elem2": null }, "hydrogen": { "elem1": "hydrogen_fluoride", "elem2":"fire" }, "tungsten": { "elem1": "tungsten_hexafluoride", "elem2": "fire" }, }, @@ -54,7 +114,7 @@ elements.fluorine = { elements.liquid_fluorine = { color: "#ffff3b", behavior: behaviors.LIQUID, - ignore: ["FOOF","solid_FOOF","oxygen","liquid_oxygen","oxygen_ice","chlorine","liquid_chlorine","liquid_hydrogen_fluoride","liquid_fluorine","fluorine","fluorine_ice","hydrogen_fluoride","hydrofluoric_acid","hydrofluoric_ice","hydrofluoric_acid_gas","fire","smoke","acid_gas","neutral_acid","acid","acid_cloud","water","salt_water","sugar_water","dirty_water","steam","seltzer","pool_water","primordial_soup","gold","hydrogen","polytetrafluoroethylene","molten_polytetrafluoroethylene","tungsten","tungsten_hexafluoride"], + ignore: ["foof","solid_foof","oxygen","liquid_oxygen","oxygen_ice","chlorine","liquid_chlorine","liquid_hydrogen_fluoride","liquid_fluorine","fluorine","fluorine_ice","hydrogen_fluoride","hydrofluoric_acid","hydrofluoric_ice","hydrofluoric_acid_gas","fire","smoke","acid_gas","neutral_acid","acid","acid_cloud","water","salt_water","sugar_water","dirty_water","steam","seltzer","pool_water","primordial_soup","gold","hydrogen","polytetrafluoroethylene","molten_polytetrafluoroethylene","tungsten","tungsten_hexafluoride"], tick: function(pixel) { let change = false; for (let i = -1; i <= 1; i++) { @@ -133,7 +193,7 @@ elements.hydrofluoric_acid = { }, state: "liquid", category:"liquids", - density: 1150, + density: 1020, stain: 0.005, tempHigh: 100, stateHigh: "hydrofluoric_acid_gas", @@ -259,6 +319,7 @@ elements.liquid_hydrogen_fluoride = { "acid": { "elem1": "hydrofluoric_acid", "elem2": null }, }, state: "liquid", + category: "liquids", hidden: true, density: 1.7, stain: 0.005, @@ -268,10 +329,18 @@ elements.liquid_hydrogen_fluoride = { tempLow: -83.6, }; -elements.FOOF = { + +runAfterLoad(function() { + reactList("fluorine", eLists.WATER, { "elem1": "hydrofluoric_acid", "elem2": "hydrogen" }); + reactList("liquid_fluorine", eLists.WATER, { "elem1": "hydrofluoric_acid", "elem2": "hydrogen" }); + reactList("hydrogen_fluoride", eLists.WATER, { "elem1": "hydrofluoric_acid", "elem2": null }); + reactList("liquid_hydrogen_fluoride", eLists.WATER, { "elem1": "hydrofluoric_acid", "elem2": null }); +}); + +elements.foof = { color: "#fa1e1e", behavior: behaviors.LIQUID, - ignore: ["FOOF","solid_FOOF","fluorine","liquid_fluorine","fluorine_ice","liquid_oxygen","oxygen_ice","oxygen","fire","polytetrafluoroethylene","molten_polytetrafluoroethylene"], + ignore: ["foof","solid_foof","fluorine","liquid_fluorine","fluorine_ice","liquid_oxygen","oxygen_ice","oxygen","fire","polytetrafluoroethylene","molten_polytetrafluoroethylene"], tick: function(pixel) { let change = false; for (let i = -1; i <= 1; i++) { @@ -303,13 +372,14 @@ elements.FOOF = { tempHigh: -57, stateHigh: ["oxygen","fluorine","explosion"], tempLow: -154, - stateLow: "solid_FOOF", + stateLow: "solid_foof", + reactions: {} }; -elements.solid_FOOF = { +elements.solid_foof = { color: "#fa4a1e", behavior: behaviors.WALL, - ignore: ["FOOF","solid_FOOF","fluorine","liquid_fluorine","fluorine_ice","liquid_oxygen","oxygen_ice","oxygen","fire","polytetrafluoroethylene","molten_polytetrafluoroethylene"], + ignore: ["foof","solid_foof","fluorine","liquid_fluorine","fluorine_ice","liquid_oxygen","oxygen_ice","oxygen","fire","polytetrafluoroethylene","molten_polytetrafluoroethylene"], tick: function(pixel) { let change = false; for (let i = -1; i <= 1; i++) { @@ -339,14 +409,12 @@ elements.solid_FOOF = { stain: 0.01, temp: -160, tempHigh: -154, - stateHigh: "FOOF", + stateHigh: "foof", }; -elements.tungsten_hexafluoride = { - color: "#f5f57a", - behavior: behaviors.GAS, - reactions: { +elements.tungsten_hexafluoride = {color: "#f5f57a",behavior: behaviors.GAS,tempLow: 17.1,state: "gas",category:"gases",density: 12.4,stain: 0.005, + reactions: { "water": { "elem1": "hydrofluoric_acid", "elem2": "tungsten" }, "salt_water": { "elem1": "hydrofluoric_acid", "elem2": "tungsten" }, "sugar_water": { "elem1": "hydrofluoric_acid", "elem2": "tungsten" }, @@ -357,17 +425,11 @@ elements.tungsten_hexafluoride = { "primordial_soup": { "elem1": "hydrofluoric_acid_gas", "elem2": "tungsten" }, "neutral_acid": { "elem1": "hydrofluoric_acid", "elem2": "tungsten" }, }, - tempLow: 17.1, - state: "gas", - category:"gases", - density: 12.4, - stain: 0.005, }; -elements.liquid_tungsten_hexafluoride = { - density: 4560, - tempLow: 2.3, -}; + + +elements.liquid_tungsten_hexafluoride = {density: 4560,tempLow: 2.3,}; if (!elements.acid.ignore) { elements.acid.ignore = []; @@ -388,6 +450,9 @@ let defaultAcidReactions = { "borax": { "elem1":"neutral_acid", "elem2":null }, "ammonia": { "elem1":"neutral_acid", "elem2":null }, "bleach": { "elem1":"neutral_acid", "elem2":null }, + "caustic_potash": { "elem1":"neutral_acid", "elem2":null }, + "radium_hydroxide": { "elem1":"neutral_acid", "elem2":null }, + "actinium_hydroxide": { "elem1":"neutral_acid", "elem2":null }, "water": { "elem1":null, "elem2":"dirty_water" }, "salt_water": { "elem1":null, "elem2":"water" }, "sugar_water": { "elem1":null, "elem2":"water" }, @@ -420,10 +485,12 @@ let defaultAcidGasReactions = { "meat": { "elem2":"rotten_meat", "elem1":null, "chance":0.4 }, }; -acids = [elements.acid, elements.acid_gas, elements.fluorine, elements.liquid_fluorine, elements.hydrofluoric_acid, elements.hydrofluoric_acid_gas, elements.hydrogen_fluoride, elements.liquid_hydrogen_fluoride]; -ignoreAcid = []; -trueAcids = ["acid", "hydrofluoric_acid"]; -trueAcidGases = ["acid_gas", "hydrofluoric_acid_gas"]; + +eListAdd("CAUSTIC", ["acid", "acid_gas", "fluorine", "liquid_fluorine", "hydrofluoric_acid", "hydrofluoric_acid_gas", "hydrogen_fluoride", "liquid_hydrogen_fluoride"]); +eListAdd("CAUSTICIGNORE", []); + +eListAdd("ACID", ["acid", "hydrofluoric_acid"]); +eListAdd("ACIDGAS", ["acid_gas", "hydrofluoric_acid_gas"]); if (enabledMods.includes("mods/generative_mods.js")) { @@ -442,7 +509,7 @@ runAfterLoad(function() { }); } -function createAcid(name,reactions, gasReactions, color, categoryhidden, categoryhiddenGas, tempHigh, tempLowGas, tempLow, tempHighGas, density, densityGas) +function createAcid(name,reactions, gasReactions, color, categoryhidden, categoryhiddenGas, tempHigh, tempLowGas, tempLow, tempHighGas, density, densityGas, type, compound = "acid") { elements[name] = { forceAutoGen: true, @@ -452,15 +519,13 @@ function createAcid(name,reactions, gasReactions, color, categoryhidden, categor "DB%5 AND M2|XX|DB%5 AND M2", "DB%5 AND M2|DB%10 AND M1|DB%5 AND M2", ], - ignore: defaultAcidIgnore.concat(ignoreAcid), + ignore: defaultAcidIgnore.concat(eLists.CAUSTICIGNORE), reactions: reactions, category: "liquids", hidden: categoryhidden, tempHigh: tempHigh, stateHigh: name + "_gas", tempLow: tempLow, - burn: 30, - burnTime: 1, state: "liquid", density: density } @@ -470,7 +535,7 @@ function createAcid(name,reactions, gasReactions, color, categoryhidden, categor "DB%5 AND M1|XX|DB%5 AND M1", "DB%5 AND M1|DB%10 AND M1|DB%5 AND M1", ], - ignore: defaultAcidGasIgnore.concat(ignoreAcid), + ignore: defaultAcidGasIgnore.concat(eLists.CAUSTICIGNORE), reactions: gasReactions, category: "gases", hidden: categoryhiddenGas, @@ -479,8 +544,6 @@ function createAcid(name,reactions, gasReactions, color, categoryhidden, categor tempLow: tempLowGas, stateLow: name, temp: tempLowGas + 20, - burn: 30, - burnTime: 1, state: "gas", density: densityGas, } @@ -502,30 +565,179 @@ function createAcid(name,reactions, gasReactions, color, categoryhidden, categor { elements[name+"_gas"].reactions[name+"_gas"]= { "elem1": null, "elem2": "acid_cloud", "chance":0.3, "y":[0,12], "setting":"clouds" }; } - acids.push(elements[name], elements[name+"_gas"]); + eLists.CAUSTIC.push(name, name+"_gas"); acidIgnore([name, name + "_gas", name + "_ice", name + "_cloud"]); + if(type) { + eListAddIon(type, [name, name+"_gas"], compound); + } + if(compound == "acid") { + eListAddIon("HYDROGEN", [name, name+"_gas"], compound); + } +} + +function eListAddIon(listName, itemList, compoundType = "default", priority = 0) +{ + eListAdd(listName, itemList); + if (typeof itemList === "string") { itemList = [itemList]; } + for (var i = 0; i < itemList.length; i++) { + if(!elements[itemList[i]]) { + elements[itemList[i]] = {}; + } + if (!elements[itemList[i]].salt) { + elements[itemList[i]].salt = {}; + } + if (!elements[itemList[i]].salt[compoundType]) { + elements[itemList[i]].salt[compoundType] = {}; + elements[itemList[i]].salt[compoundType].priority = priority; + elements[itemList[i]].salt[compoundType].components = []; + } + if (elements[itemList[i]].salt[compoundType].components.indexOf(listName) === -1) { + elements[itemList[i]].salt[compoundType].components.push(listName); + } + } } function acidIgnore(ignore) { - for(let i = 0; i < acids.length; i++) + for(let i = 0; i < eLists.CAUSTIC.length; i++) { - acids[i].ignore = acids[i].ignore.concat(ignore); + elements[eLists.CAUSTIC[i]].ignore = elements[eLists.CAUSTIC[i]].ignore.concat(ignore); } - ignoreAcid = ignoreAcid.concat(ignore); + eLists.CAUSTICIGNORE = eLists.CAUSTICIGNORE.concat(ignore); } +eListAdd("WATER", ["water", "salt_water", "sugar_water", "dirty_water", "neutral_acid", "seltzer", "pool_water", "primordial_soup"]); +function reactList(element, list, reaction) { + for(let i = 0; i < list.length; i++) + { + acidReact(element, list[i], reaction.elem1, reaction.elem2); + elements[element].reactions[list[i]] = reaction; + } +} + +function createSalt(name,nameWater,color,colorWater,hidden,hiddenWater,tempHigh,tempLowWater,tempHighWater,density,densityWater,cation,anion) +{ + if(!elements[name]) + { + elements[name] = { + color: color, + behavior: behaviors.POWDER, + category: "powders", + density: density, + state: "solid", + tempHigh: tempHigh, + reactions: { + "ice": { elem1:null, elem2:nameWater, chance:0.1 }, + "rime": { elem1:null, elem2:nameWater, chance:0.075 }, + "snow": { elem1:null, elem2:nameWater, chance:0.25 }, + "packed_snow": { elem1:null, elem2:nameWater, chance:0.05 }, + "packed_ice": { elem1:null, elem2:nameWater, chance:0.01 }, + "water": { elem2: nameWater, elem1: null } + }, + hidden: hidden + } + } + if(!elements[nameWater]) + { + + elements[nameWater] = { + color: colorWater, + behavior: behaviors.LIQUID, + tempHigh: tempHighWater, + stateHigh: ["steam",name], + tempLow: tempLowWater, + category: "liquids", + reactions: { + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + "dust": { elem1: "dirty_water", elem2: null }, + "ash": { elem1: "dirty_water", elem2: null }, + "carbon_dioxide": { elem1: "dirty_water", elem2: null }, + "sulfur": { elem1: "dirty_water", elem2: null }, + "charcoal": { elem1: "dirty_water", chance:0.005 }, + "rat": { elem1: "dirty_water", chance:0.005 }, + "plague": { elem1: "dirty_water", elem2: null }, + "fallout": { elem1: "dirty_water", chance:0.25 }, + "radiation": { elem1: "dirty_water", chance:0.25 }, + "rust": { elem1: "dirty_water", chance:0.005 }, + "quicklime": { elem1: null, elem2: "slaked_lime" }, + "rock": { elem2: "wet_sand", chance: 0.0005 }, + "fly": { elem2:"dead_bug", chance:0.1, "oneway":true }, + "firefly": { elem2:"dead_bug", chance:0.1, "oneway":true }, + "bee": { elem2:"dead_bug", chance:0.05, "oneway":true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, "oneway":true }, + "cancer": { elem1: "dirty_water", chance:0.25 }, + // electrolysis: + "aluminum": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0025 }, + "zinc": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.015 }, + "steel": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0125 }, + "iron": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0125 }, + "tin": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.01 }, + "lead": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.01 }, + "brass": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.001 }, + "bronze": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.001 }, + "copper": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0075 }, + "silver": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0075 }, + "gold": { elem1:["hydrogen","hydrogen","oxygen",name], charged:true, chance:0.0075 }, + "fire": { elem2: "smoke" }, + "snow": { elem2:"slush" }, + "rat": { elem1:"dirty_water", chance:0.2 }, + "slug": { elem2: "slime", elem1: null }, + "snail": { elem2: "calcium", elem1: null }, + "torch": { elem2:"wood" }, + "light": { "color2":"#a1bac9" }, + "sawdust": { elem2:"cellulose", elem1:null }, + "oxygen": { elem2:"foam" }, + "paper": { elem2:"cellulose", elem1:null }, + "pollen": { elem2: null }, + "soda": { elem1:"foam", chance:0.01 }, + "ice_nine": { elem1: "ice_nine" }, + "ant_wall": { elem2:["mud","mud","wet_sand"], elem1:null, chance:0.007 }, + "iron": { elem2:"rust", chance:0.005 }, + "copper": { elem2:"oxidized_copper", chance:0.005 }, + "steel": { elem2:"rust", chance:0.004 }, + "bronze": { elem2:"oxidized_copper", chance:0.0025 }, + "soap": { elem1: "water" }, + "soap": { elem2: ["foam","bubble"], chance:0.005 }, + "dye": { elem2:null, chance:0.05 }, + "ink": { elem2:null, chance:0.01 }, + "sodium": { elem2:["pop","pop","pop","hydrogen"], chance:0.01, temp1:250 }, + "molten_sodium": { elem2:["pop","pop","pop","hydrogen"], chance:0.01, temp1:250 }, + "radiation": { elem2:"rad_steam", chance:0.4 }, + "confetti": { elem2:[null,"cellulose"], chance:0.001 }, + "greek_fire": { func: function(p,pixel){if (!pixel.burning) { pixel.burning=true; pixel.burnStart=pixelTick }}}, + }, + state: "liquid", + density: densityWater, + conduct: 0.1, + stain: -0.66, + hidden: hiddenWater + }; + } + eListAddIon(cation, [name,nameWater,"molten_" + name]); + eListAddIon(anion, [name,nameWater,"molten_" + name]); + eListAdd("WATER", nameWater); + eListAdd("COMPOUND", name); +} + +createSalt("salt","salt_water",null,null,false,false,0,0,0,0,0,"SODIUM","CHLORIDE"); + acidIgnore(["acid", "acid_gas", "acid_ice", "liquid_fluorine","fluorine","fluorine_ice","hydrogen_fluoride","liquid_hydrogen_fluoride","hydrogen_fluoride_ice","hydrofluoric_acid_ice","hydrofluoric_acid","hydrofluoric_acid_gas","hydrofluoric_acid_cloud","acid_cloud"]); elements.acid.name = "hydrochloricAcid"; elements.acid_gas.name = "hydrochloricAcidGas"; +eListAddIon("CHLORIDE", ["acid", "acid_gas"],"acid"); +eListAddIon("HYDROGEN", ["acid", "acid_gas"],"acid"); +eListAddIon("FLUORIDE", ["hydrofluoric_acid", "hydrofluoric_acid_gas"],"acid"); +eListAddIon("HYDROGEN", ["hydrofluoric_acid", "hydrofluoric_acid_gas"],"acid"); createAcid("generic_acid",defaultAcidReactions,defaultAcidGasReactions,"#80d488",true,true,110,100,-10,400,1020,1) elements.generic_acid.name = "acid"; elements.generic_acid_gas.name = "acid_gas"; -trueAcids.push("generic_acid") -trueAcidGases.push("generic_acid_gas"); +eLists.ACID.push("generic_acid") +eLists.ACIDGAS.push("generic_acid_gas"); if (!enabledMods.includes("mods/generative_mods.js")) { elements.acid_cloud.behavior = [ @@ -535,13 +747,13 @@ if (!enabledMods.includes("mods/generative_mods.js")) { ]; } -createAcid("nitric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#91993c","#6b7041","#5f614b"],false,false,83,70,-42,400,1500,1.5) +createAcid("nitric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#91993c","#6b7041","#5f614b"],false,false,83,70,-42,400,1500,1.5,"NITRATE") acidReact("nitric_acid","ammonia","fertilizer",null,0); acidReact("nitric_acid_gas","ammonia","fertilizer",null,0); -trueAcids.push("nitric_acid") -trueAcidGases.push("nitric_acid_gas"); +eLists.ACID.push("nitric_acid") +eLists.ACIDGAS.push("nitric_acid_gas"); elements.nitric_oxide = { color: "#b8926c", @@ -566,8 +778,6 @@ elements.nitrogen_dioxide = { reactions: { "steam": { "elem1": "smog", "elem2": null, "chance":0.01 }, "blood": { "elem1":null, "elem2":"infection", "chance":0.01 }, - "water": { "elem1":null, "elem2":"nitric_acid", "chance":0.01 }, - "dirty_water": { "elem1":null, "elem2":"nitric_acid", "chance":0.01 }, "plant": { "elem1":null, "elem2":"dead_plant", "chance":0.01 }, "grass": { "elem1":null, "elem2":"dead_plant", "chance":0.01 }, "algae": { "elem1":null, "elem2":null, "chance":0.01 }, @@ -600,6 +810,10 @@ elements.nitrogen_dioxide = { density: 1.88, }; +runAfterLoad(function() { + reactList("nitrogen_dioxide", eLists.WATER, { "elem1":null, "elem2":"nitric_acid", "chance":0.01 }); +}); + elements.liquid_nitrogen_dioxide = { tempLow: -9.3, hidden: true, @@ -833,16 +1047,8 @@ elements.sulfur_dioxide = { color: "#FFF700", behavior: behaviors.GAS, reactions: { - "water": { "elem1": null, "elem2": "sulfuric_acid" }, - "salt_water": { "elem1": null, "elem2": "sulfuric_acid" }, - "sugar_water": { "elem1": null, "elem2": "sulfuric_acid" }, - "dirty_water": { "elem1": null, "elem2": "sulfuric_acid" }, "steam": { "elem1": null, "elem2": "sulfuric_acid_gas" }, "acid_gas": { "elem1": null, "elem2": "sulfuric_acid_gas" }, - "neutral_acid": { "elem1": null, "elem2": "sulfuric_acid" }, - "seltzer": { "elem1": null, "elem2": "sulfuric_acid" }, - "pool_water": { "elem1": null, "elem2": "sulfuric_acid" }, - "primordial_soup": { "elem1": null, "elem2": "sulfuric_acid" }, //poison "blood": { "elem1":null, "elem2":"infection" }, "soap": { "elem1":null, "chance":0.02 }, @@ -892,11 +1098,20 @@ elements.sulfur_dioxide = { density: 2.6, }; + +runAfterLoad(function() { + reactList("sulfur_dioxide", eLists.WATER, { "elem1": null, "elem2": "sulfuric_acid" }); +}); + elements.liquid_sulfur_dioxide = { color: "#d1cb17", behavior: behaviors.LIQUID, + category: "liquids", reactions: elements.sulfur_dioxide.reactions, + tempHigh: -10, + temp: -15, tempLow: -72, + stateHigh: "sulfur_dioxide", state: "liquid", hidden: true, density: 1435, @@ -907,15 +1122,6 @@ elements.hydrogen_sulfide = { behavior: behaviors.GAS, reactions: { "oxygen": { "elem2":"stench" }, - "water": { "elem1":null, "elem2":"dirty_water" }, - "salt_water": { "elem1":null, "elem2":"dirty_water" }, - "sugar_water": { "elem1":null, "elem2":"dirty_water" }, - "dirty_water": { "elem1":null, "elem2":"dirty_water" }, - "acid_gas": { "elem1":null, "elem2":"dirty_water" }, - "neutral_acid": { "elem1":null, "elem2":"dirty_water" }, - "seltzer": { "elem1":null, "elem2":"dirty_water" }, - "pool_water": { "elem1":null, "elem2":"dirty_water" }, - "primordial_soup": { "elem1":null, "elem2":"dirty_water" }, "nitrogen": { "elem2":"stench" }, "baking_soda": { "elem1":null } }, @@ -931,39 +1137,39 @@ elements.hydrogen_sulfide = { fireColor: ["#8180CC","#7F84E6"], } + +runAfterLoad(function() { + reactList("hydrogen_sulfide", eLists.WATER, { "elem1":null, "elem2":"dirty_water" }); +}); + acidIgnore(["sulfur_dioxide","liquid_sulfur_dioxide","sulfur_dioxide_ice"]); elements.acid.ignore.push("liquid_hydrogen_sulfide"); elements.acid_gas.ignore.push("liquid_hydrogen_sulfide"); -acidReact("acid","pyrite","iron_chloride","hydrogen_sulfide",50); -acidReact("acid_gas","pyrite","iron_chloride","hydrogen_sulfide",50); +acidReact("acid","pyrite","iron_dichloride_solution","hydrogen_sulfide",50); +acidReact("acid_gas","pyrite","iron_dichloride_solution","hydrogen_sulfide",50); -elements.iron_chloride = { - color: ["#207d09","#b51259"], - behavior: behaviors.POWDER, - reactions: { - "dirty_water": { "elem1": null, "elem2":"water" }, - //"ethylene": { "elem2":"one_two_dichloroethane" }, todo: vinyl chloride - }, - category: "powders", - tempHigh: 307.6, - state: "solid", - density: 2900, + +function blendColors(colorA, colorB, amount = 0.5) { + const [rA, gA, bA] = colorA.match(/\w\w/g).map((c) => parseInt(c, 16)); + const [rB, gB, bB] = colorB.match(/\w\w/g).map((c) => parseInt(c, 16)); + const r = Math.round(rA + (rB - rA) * amount).toString(16).padStart(2, '0'); + const g = Math.round(gA + (gB - gA) * amount).toString(16).padStart(2, '0'); + const b = Math.round(bA + (bB - bA) * amount).toString(16).padStart(2, '0'); + return '#' + r + g + b; } -createAcid("sulfuric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#e9e05e","#c2bd7a","#9e9c7b"],false,false,337,337,10,500,1830,1.26) +createSalt("iron_dichloride","iron_dichloride_solution",["#207d09","#b51259"],[blendColors("#207d09","#2167ff",0.5),blendColors("#b51259","#2167ff",0.5)],false,true,307.6,-2,102,2900,1030,"IRONII","CHLORIDE"); + +createAcid("sulfuric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#e9e05e","#c2bd7a","#9e9c7b"],false,false,337,337,10,500,1830,1.26,"SULFATE") elements.sulfuric_acid.ignore.push("charcoal"); elements.sulfuric_acid_gas.ignore.push("charcoal"); -elements.sulfuric_acid.reactions["water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["sugar_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["dirty_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["acid_gas"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["neutral_acid"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["seltzer"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["pool_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.sulfuric_acid.reactions["primordial_soup"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; + +runAfterLoad(function() { + reactList("sulfuric_acid", eLists.WATER, { "elem2":"dirty_water"}); +}); elements.sulfuric_acid.reactions["grape"] = { "elem1": "charcoal", "elem2": "steam", "temp2": 200}; elements.sulfuric_acid.reactions["juice"] = { "elem1": "charcoal", "elem2": "steam", "temp2": 200}; elements.sulfuric_acid.reactions["corn"] = { "elem1": "charcoal", "elem2": "steam", "temp2": 200}; @@ -996,8 +1202,8 @@ delete elements.sulfuric_acid_gas.reactions["charcoal"]; acidReact("sulfuric_acid","magnesium_oxide","epsom_salt",null,50); acidReact("sulfuric_acid_gas","magnesium_oxide","epsom_salt",null,50); -trueAcids.push("sulfuric_acid") -trueAcidGases.push("sulfuric_acid_gas"); +eLists.ACID.push("sulfuric_acid") +eLists.ACIDGAS.push("sulfuric_acid_gas"); elements.polytetrafluoroethylene = { color: "#efefef", @@ -1127,6 +1333,7 @@ elements.tetrafluoroethylene = { burn: 100, burnTime: 2, density: 1.52, + category: "gases", } @@ -1229,7 +1436,7 @@ elements.chloroethane = { elements.diethylaluminium_chloride = { color: "#7faf7f", behavior: behaviors.LIQUID, - category: "hidden", + category: "liquids", hidden: true, tempHigh: 125, stateHigh: "fire", @@ -1315,16 +1522,10 @@ elements.titanium = { tempHigh: 1668, conduct: 0.5, hardness: 0.7, + forceAutoGen: true, }; elements.molten_titanium = { - density: 4500, color: ["#e0921d", "#e89e2e", "#f7b24a", "#fce168", "#fceca2", "#fffcf0"], - hidden: true, - state: "liquid", - behavior: behaviors.LIQUID, - stateLow: "titanium", - tempLow: 1668, - temp: 2000, viscosity: 10000 }; @@ -1336,19 +1537,13 @@ elements.rutile = { state: "solid", tempHigh: 1843, stateHigh: "molten_rutile", + forceAutoGen: true }; elements.molten_rutile = { color: ["#e3907f", "#e68f3e"], - behavior: behaviors.LIQUID, - hidden: true, reactions: { "chlorine": { "elem1": "titanium_tetrachloride", "elem2":null }, }, - density: 4230, - state: "liquid", - temp: 2000, - tempLow: 1843, - stateLow: "rutile", viscosity: 10000 }; elements.titanium_tetrachloride = { @@ -1360,22 +1555,29 @@ elements.titanium_tetrachloride = { tempHigh: 136.4, stateHigh: "titanium_tetrachloride_gas", tempLow: -24, - stateLow: "titanium_tetrachloride_crystal", + stateLow: "solid_titanium_tetrachloride", }; +eListAddIon("TITANIUMIV","solid_titanium_tetrachloride"); +eListAddIon("CHLORIDE","solid_titanium_tetrachloride"); +eListAddIon("TITANIUMIV","titanium_tetrachloride"); +eListAddIon("CHLORIDE","titanium_tetrachloride"); +eListAddIon("TITANIUMIV","titanium_tetrachloride_gas"); +eListAddIon("CHLORIDE","titanium_tetrachloride_gas"); +eListAdd("INSOLUBLE","titanium_tetrachloride"); elements.titanium_tetrachloride_gas = { - color: "#e8edd5", behavior: behaviors.GAS, hidden: true, + category: "gases", density: 500, state: "gas", temp: 200, tempLow: 136.4, stateLow: "titanium_tetrachloride" }; -elements.titanium_tetrachloride_crystal = { - color: "#f5fffe", +elements.solid_titanium_tetrachloride = { behavior: behaviors.WALL, hidden: true, + category: "solids", density: 1728, state: "solid", temp: -50, @@ -1384,62 +1586,19 @@ elements.titanium_tetrachloride_crystal = { }; -elements.titanium_trichloride = { - color: "#c71585", - behavior: behaviors.SOLID, - category: "solids", - density: 2640, - state: "solid", -}; -elements.magnesium = { - color: "#dddce6", - category: "solids", - state: "solid", - density: 1738, - behavior: behaviors.WALL, - tick: function(pixel) { - if (pixel.burning) { - if(pixel.temp < 2200) { - pixel.temp += 10; - } - } - }, - stateHigh: "molten_magnesium", - tempHigh: 650, - conduct: 0.3, - burn: 1, - burnTime: 300, - fireColor: "#ffffff", - burnInto: "magnesium_oxide", - hardness: 0.5, -}; -elements.molten_magnesium = { - density: 1738, - color: ["#cc9c7c", "#ebb896", "#f5bb95", "#f7cd9c", "#fcd2a2", "#fff8f0"], - hidden: true, - state: "liquid", - behavior: behaviors.MOLTEN, - reactions: { - "titanium_tetrachloride": { "elem1": "titanium", "elem2": "magnesium_chloride"}, - "titanium_tetrachloride_gas": { "elem1": "titanium", "elem2": "magnesium_chloride"}, - }, - tick: function(pixel) { - if (pixel.burning) { - if(pixel.temp < 2200) { - pixel.temp += 10; - } - } - }, - stateLow: "magnesium", - tempLow: 650, - temp: 1000, - viscosity: 10000, - burn: 1, - conduct: 0.3, - burnTime: 300, - fireColor: "#ffffff", - burnInto: "magnesium_oxide", +createSalt("titanium_trichloride","titanium_trichloride_solution","#c71585",blendColors("#c71585","#2167ff",0.4),false,true,440,-2,102,2640,1020,"TITANIUMIII","CHLORIDE"); + +elements["titanium_trichloride"].behavior = behaviors.SOLID; +elements["titanium_trichloride"].category = "solids"; +elements["titanium_trichloride"].stateHigh = ["chlorine","titanium_tetrachloride"]; +delete elements["molten_titanium_trichloride"]; + +elements.magnesium.burnInto = "magnesium_oxide"; +elements.molten_magnesium.burnInto = "magnesium_oxide"; +elements.molten_magnesium.reactions = { + "titanium_tetrachloride": { "elem1": "titanium", "elem2": "magnesium_chloride"}, + "titanium_tetrachloride_gas": { "elem1": "titanium", "elem2": "magnesium_chloride"}, }; @@ -1456,30 +1615,27 @@ elements.magnesium_oxide = { }; -elements.magnesium_chloride = { - color: "#bfbfbf", - behavior: behaviors.POWDER, - category: "powders", - density: 2640, - state: "solid", - tempHigh: 714, - stateHigh: "molten_magnesium_chloride", -}; +eListAdd("INSOLUBLE","magnesium_oxide"); +eListAddIon("MAGNESIUM","magnesium_oxide"); +eListAddIon("OXIDE","magnesium_oxide"); +eListAddIon("MAGNESIUM","molten_magnesium_oxide"); +eListAddIon("OXIDE","molten_magnesium_oxide"); + elements.molten_magnesium_chloride = { - behavior: behaviors.MOLTEN, behaviorOn: [ "XX|CR:fire%2.5|XX", "M2|CH:chlorine,magnesium%25|M2", "M1|M1|M1", ], - hidden: true, - temp: 750, - density: 2620, - state: "liquid", conduct: 0.3, }; +createSalt("magnesium_chloride","magnesium_chloride_solution","#bfbfbf",blendColors("#bfbfbf","#2167ff",0.75),false,true,714,-2,102,2320,1015,"MAGNESIUM","CHLORIDE"); + +elements.magnesium_chloride.forceAutoGen = true; + + elements.francium = { color: "#3eff3b", behavior: [ @@ -1491,23 +1647,21 @@ elements.francium = { pixel.temp += 5; }, reactions: { - "water": { "elem1":"radon", "elem2":"rad_pop"}, - "salt_water": { "elem1":"radon", "elem2":"rad_pop"}, - "sugar_water": { "elem1":"radon", "elem2":"rad_pop"}, - "dirty_water": { "elem1":"radon", "elem2":"rad_pop"}, - "seltzer": { "elem1":"radon", "elem2":"rad_pop"}, "steam": { "elem1":"radon", "elem2":"rad_pop"}, "rad_steam": { "elem1":"radon", "elem2":"rad_pop"}, - "seltzer": { "elem1":"radon", "elem2":"rad_pop"}, - "pool_water": { "elem1":"radon", "elem2":"rad_pop"}, - "primordial_soup": { "elem1":"radon", "elem2":"rad_pop"}, "quark_matter": { "elem1":"stable_francium", "elem2":"quark_matter"} }, tempHigh: 27, category: "powders", state: "solid", density: 2480, + conduct: 0.70, }; + +runAfterLoad(function() { + reactList("francium", eLists.WATER, { "elem1":"radon", "elem2":"rad_pop"}); +}); + elements.molten_francium = { color: "#9ff31e", behavior: [ @@ -1519,24 +1673,21 @@ elements.molten_francium = { pixel.temp += 5; }, reactions: { - "water": { "elem1":"radon", "elem2":"rad_pop"}, - "salt_water": { "elem1":"radon", "elem2":"rad_pop"}, - "sugar_water": { "elem1":"radon", "elem2":"rad_pop"}, - "dirty_water": { "elem1":"radon", "elem2":"rad_pop"}, - "seltzer": { "elem1":"radon", "elem2":"rad_pop"}, "steam": { "elem1":"radon", "elem2":"rad_pop"}, "rad_steam": { "elem1":"radon", "elem2":"rad_pop"}, - "seltzer": { "elem1":"radon", "elem2":"rad_pop"}, - "pool_water": { "elem1":"radon", "elem2":"rad_pop"}, - "primordial_soup": { "elem1":"radon", "elem2":"rad_pop"}, "quark_matter": { "elem1":"stable_francium", "elem2":"quark_matter"} }, tempLow: 27, hidden: true, state: "liquid", density: 2480, + conduct: 0.70, }; +runAfterLoad(function() { + reactList("molten_francium", eLists.WATER, { "elem1":"radon", "elem2":"rad_pop"}); +}); + elements.astatine = { color: "#5a5e5a", @@ -1551,7 +1702,7 @@ elements.astatine = { reactions: { "quark_matter": { "elem1":"stable_astatine", "elem2":"quark_matter"} }, - tempHigh: 107, //pulled out of ass-tatine + tempHigh: 301, category: "powders", state: "solid", density: 8910, @@ -1569,11 +1720,25 @@ elements.molten_astatine = { tick: function(pixel) { pixel.temp += 5; }, - tempLow: 107, //pulled out of ass-tatine + tempLow: 301, hidden: true, state: "liquid", density: 8910, + tempHigh: 336, }; +elements.astatine_gas = { + behavior: [ + "M2|M1 AND CR:radiation%50|M2", + "M1 AND CR:radiation%50|CH:polonium,big_pop%0.1|M1 AND CR:radiation%50", + "M2|M1 AND CR:radiation%50|M2", + ], + reactions: { + "quark_matter": { "elem1":"molten_stable_astatine", "elem2":"quark_matter"} + }, + tick: function(pixel) { + pixel.temp += 5; + } +} elements.radon = { color: "#b6ffb5", @@ -1646,15 +1811,6 @@ elements.rad_pop = { }; -function blendColors(colorA, colorB, amount = 0.5) { - const [rA, gA, bA] = colorA.match(/\w\w/g).map((c) => parseInt(c, 16)); - const [rB, gB, bB] = colorB.match(/\w\w/g).map((c) => parseInt(c, 16)); - const r = Math.round(rA + (rB - rA) * amount).toString(16).padStart(2, '0'); - const g = Math.round(gA + (gB - gA) * amount).toString(16).padStart(2, '0'); - const b = Math.round(bA + (bB - bA) * amount).toString(16).padStart(2, '0'); - return '#' + r + g + b; -} - elements.stable_radon = { color: [blendColors("#b6ffb5","#ff0000"),blendColors("#b6ffb5","#00ff00"),blendColors("#b6ffb5","#0000ff")], @@ -1701,142 +1857,139 @@ elements.molten_stable_polonium = { elements.stable_astatine = { color: [blendColors("#5a5e5a","#ff0000"),blendColors("#5a5e5a","#00ff00"),blendColors("#5a5e5a","#0000ff")], behavior: behaviors.POWDER, - tempHigh: 107, //pulled out of ass-tatine + tempHigh: 301, reactions: { - "water": { "elem1":"hydroastatic_acid", "elem2":null}, - "salt_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "sugar_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "dirty_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "seltzer": { "elem1":"hydroastatic_acid", "elem2":null}, "steam": { "elem1":"hydroastatic_acid", "elem2":null}, "rad_steam": { "elem1":"hydroastatic_acid", "elem2":null}, - "seltzer": { "elem1":"hydroastatic_acid", "elem2":null}, - "pool_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "primordial_soup": { "elem1":"hydroastatic_acid", "elem2":null}, }, category: "powders", state: "solid", hidden: true, density: 8910, }; + + +runAfterLoad(function() { + reactList("stable_astatine", eLists.WATER, { "elem1":"hydroastatic_acid", "elem2":null}); +}); + elements.molten_stable_astatine = { color: [blendColors("#aab0a0","#ff0000"),blendColors("#aab0a0","#00ff00"),blendColors("#aab0a0","#0000ff")], behavior: behaviors.LIQUID, - tempLow: 107, //pulled out of ass-tatine + tempLow: 301, reactions: { - "water": { "elem1":"hydroastatic_acid", "elem2":null}, - "salt_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "sugar_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "dirty_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "seltzer": { "elem1":"hydroastatic_acid", "elem2":null}, "steam": { "elem1":"hydroastatic_acid", "elem2":null}, "rad_steam": { "elem1":"hydroastatic_acid", "elem2":null}, - "seltzer": { "elem1":"hydroastatic_acid", "elem2":null}, - "pool_water": { "elem1":"hydroastatic_acid", "elem2":null}, - "primordial_soup": { "elem1":"hydroastatic_acid", "elem2":null}, }, hidden: true, state: "liquid", density: 8910, + tempHigh: 336, }; -createAcid("hydroastatic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),[blendColors("#5a5e5a","#ff0000",.25),blendColors("#5a5e5a","#00ff00",.25),blendColors("#5a5e5a","#0000ff",.25)],true,true,100,100,0,1000,1200,1) + +runAfterLoad(function() { + reactList("molten_stable_astatine", eLists.WATER, { "elem1":"hydroastatic_acid", "elem2":null}); +}); + +createAcid("hydroastatic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),[blendColors("#5a5e5a","#ff0000",.25),blendColors("#5a5e5a","#00ff00",.25),blendColors("#5a5e5a","#0000ff",.25)],true,true,100,100,0,1000,1200,1,"ASTATIDE") elements.hydroastatic_acid.ignore.push("astatine","molten_astatine","stable_astatine","molten_stable_astatine"); elements.hydroastatic_acid_gas.ignore.push("astatine","molten_astatine","stable_astatine","molten_stable_astatine"); -trueAcids.push("hydroastatic_acid"); -trueAcidGases.push("hydroastatic_acid_gas"); +eLists.ACID.push("hydroastatic_acid"); +eLists.ACIDGAS.push("hydroastatic_acid_gas"); -elements.hydroastatic_acid.reactions["water"] = { "elem1":"hydroastatic_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["sugar_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["dirty_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["acid_gas"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["neutral_acid"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["seltzer"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["pool_water"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; -elements.hydroastatic_acid.reactions["primordial_soup"] = { "elem1":"sulfuric_acid", "elem2":"dirty_water"}; + + +runAfterLoad(function() { + reactList("hydroastatic_acid", eLists.WATER, {"elem2":"dirty_water"}); +}); elements.polonium_dioxide = { - color: "#ffff7f", + color: [blendColors("#ffff7f","#ff0000"), blendColors("#ffff7f","#00ff00"), blendColors("#ffff7f","#0000ff")], behavior: behaviors.POWDER, tempHigh: 500, hidden: true, state: "solid", density: 8900, + category: "powders", }; -elements.magnesium_polonide = { - color: [blendColors("#b5b5b5","#ff0000",.25),blendColors("#b5b5b5","#00ff00",.25),blendColors("#b5b5b5","#0000ff",.25)], - behavior: behaviors.POWDER, - tempHigh: 1800, - hidden: true, - state: "solid", - density: 6700, -}; +eListAdd("INSOLUBLE","polonium_dioxide"); +eListAddIon("POLONIUMIV","polonium_dioxide"); +eListAddIon("OXIDE","polonium_dioxide"); +eListAddIon("POLONIUMIV","molten_polonium_dioxide"); +eListAddIon("OXIDE","molten_polonium_dioxide"); -acidReact("acid","magnesium_polonide","magnesium_chloride","polonium_hydride",100); -acidReact("acid_gas","magnesium_polonide","magnesium_chloride","polonium_hydride",100); -acidReact("acid","molten_magnesium_polonide","magnesium_chloride","polonium_hydride",100); -acidReact("acid_gas","molten_magnesium_polonide","magnesium_chloride","polonium_hydride",100); -elements.acid.ignore.push("magnesium_polonide","molten_magnesium_polonide","polonium_hydride","polonium_hydride_ice","polonium_hydride_gas","magnesium_chloride","molten_magnesium_chloride"); -elements.acid_gas.ignore.push("magnesium_polonide","molten_magnesium_polonide","polonium_hydride","polonium_hydride_ice","polonium_hydride_gas","magnesium_chloride","molten_magnesium_chloride"); + +createSalt("magnesium_polonide","magnesium_polonide_solution",[blendColors("#b5b5b5","#ff0000",.25),blendColors("#b5b5b5","#00ff00",.25),blendColors("#b5b5b5","#0000ff",.25)],[blendColors("#2167ff","#ff0000",0.25),blendColors("#2167ff","#00ff00",0.25),blendColors("#2167ff","#0000ff",0.25)],true,true,1800,-2,102,6700,1050,"MAGNESIUM","POLONIDE"); + + +acidReact("acid","magnesium_polonide","magnesium_chloride_solution","polonium_hydride",100); +acidReact("acid_gas","magnesium_polonide","magnesium_chloride_solution","polonium_hydride",100); +acidReact("acid","molten_magnesium_polonide","magnesium_chloride_solution","polonium_hydride",100); +acidReact("acid_gas","molten_magnesium_polonide","magnesium_chloride_solution","polonium_hydride",100); +elements.acid.ignore.push("polonium_hydride_ice","polonium_hydride_gas","magnesium_chloride"); +elements.acid_gas.ignore.push("polonium_hydride_ice","polonium_hydride_gas","magnesium_chloride"); elements.polonium_hydride = { density: 2450, - color: "#838396", + color: [blendColors("#838396","#ff0000"), blendColors("#838396","#00ff00"), blendColors("#838396","#0000ff")], hidden: true, state: "liquid", behavior: behaviors.LIQUID, tempLow: -35.3, tempHigh: 36.1, + stain: 0.05, burn: 1, burnTime: 10, burnInto: ["polonium_dioxide","steam"], + category: "liquids", +}; + +elements.polonium_hydride_gas = { + density: 8.29, }; elements.stable_francium = { color: [blendColors("#3eff3b","#ff0000"),blendColors("#3eff3b","#00ff00"),blendColors("#3eff3b","#0000ff")], behavior: behaviors.POWDER, reactions: { - "water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "salt_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "sugar_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "dirty_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "seltzer": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, "steam": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, "rad_steam": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "seltzer": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "pool_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "primordial_soup": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, }, tempHigh: 27, category: "powders", state: "solid", density: 2480, hidden: true, + conduct: 0.70, }; + + +runAfterLoad(function() { + reactList("stable_francium", eLists.WATER, { "elem1":"francium_hydroxide", "elem2":"big_pop"}); +}); + + elements.molten_stable_francium = { color: [blendColors("#9ff31e","#ff0000"),blendColors("#9ff31e","#00ff00"),blendColors("#9ff31e","#0000ff")], behavior: behaviors.LIQUID, reactions: { - "water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "salt_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "sugar_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "dirty_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "seltzer": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, "steam": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, "rad_steam": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "seltzer": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "pool_water": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, - "primordial_soup": { "elem1":"francium_hydroxide", "elem2":"big_pop"}, }, tempLow: 27, state: "liquid", hidden: true, density: 2480, + conduct: 0.70, }; +runAfterLoad(function() { + reactList("molten_stable_francium", eLists.WATER, { "elem1":"francium_hydroxide", "elem2":"big_pop"}); +}); elements.big_pop = { color: ["#ffb48f","#ffd991","#ffad91"], @@ -1852,107 +2005,28 @@ elements.big_pop = { hidden: true, }; -elements.potassium_salt_water = { - color: "#416ed1", - behavior: behaviors.LIQUID, - tempHigh: 102, - stateHigh: ["steam","potassium_salt"], - tempLow: -2, - stateLowName: "potassium_salt_ice", - category: "liquids", - reactions: { - "dirt": { elem1: null, elem2: "mud" }, - "sand": { elem1: null, elem2: "wet_sand" }, - "clay_soil": { elem1: null, elem2: "clay" }, - "dust": { elem1: "dirty_water", elem2: null }, - "ash": { elem1: "dirty_water", elem2: null }, - "carbon_dioxide": { elem1: "dirty_water", elem2: null }, - "sulfur": { elem1: "dirty_water", elem2: null }, - "charcoal": { elem1: "dirty_water", chance:0.005 }, - "rat": { elem1: "dirty_water", chance:0.005 }, - "plague": { elem1: "dirty_water", elem2: null }, - "fallout": { elem1: "dirty_water", chance:0.25 }, - "radiation": { elem1: "dirty_water", chance:0.25 }, - "rust": { elem1: "dirty_water", chance:0.005 }, - "quicklime": { elem1: null, elem2: "slaked_lime" }, - "rock": { elem2: "wet_sand", chance: 0.0005 }, - "fly": { elem2:"dead_bug", chance:0.1, "oneway":true }, - "firefly": { elem2:"dead_bug", chance:0.1, "oneway":true }, - "bee": { elem2:"dead_bug", chance:0.05, "oneway":true }, - "stink_bug": { elem2:"dead_bug", chance:0.1, "oneway":true }, - "cancer": { elem1: "dirty_water", chance:0.25 }, - // electrolysis: - "aluminum": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0025 }, - "zinc": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.015 }, - "steel": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0125 }, - "iron": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0125 }, - "tin": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.01 }, - "lead": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.01 }, - "brass": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.001 }, - "bronze": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.001 }, - "copper": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0075 }, - "silver": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0075 }, - "gold": { elem1:["hydrogen","hydrogen","oxygen","potassium_salt"], charged:true, chance:0.0075 }, - }, - state: "liquid", - density: 1026, - conduct: 0.1, - stain: -0.66 +createSalt("potassium_salt","potassium_salt_water",["#f2f2f2","#e0e0e0"],"#416ed1",false,false,292,-2,102,3980,1026,"POTASSIUM","CHLORIDE"); + +elements.potassium.reactions = { + "chlorine": { elem1:"potassium_salt", elem2:null, chance:0.05 }, + "smog": { elem1:["potassium_hydroxide","pop"], elem2:["hydrogen","pop","fire"], chance:0.01, temp2:400 }, + "electric": { elem1:[null,"pop"], elem2:["pop","fire"], chance:0.05, temp2:400 }, }; +runAfterLoad(function() { + reactList("potassium", eLists.WATER, { elem1:["potassium_hydroxide","pop"], elem2:["hydrogen","pop","fire"], chance:0.01, temp2:400 }); +}); -elements.potassium = { - color: ["#8e8ba3","#8797a8","#7d6a75","#879dad"], - tick: function(pixel) { - for (var i = 0; i < adjacentCoords.length; i++) { - var x = pixel.x+adjacentCoords[i][0]; - var y = pixel.y+adjacentCoords[i][1]; - if (isEmpty(x,y)) { - if (Math.random() < 0.005) { deletePixel(pixel.x,pixel.y) } - break - } } }, - reactions: { - "chlorine": { elem1:"potassium_salt", elem2:"big_pop" }, - "water": { elem1:"big_pop" }, - "salt_water": { elem1:"big_pop" }, - "sugar_water": { elem1:"big_pop" }, - "dirty_water": { elem1:"big_pop" }, - "seltzer": { elem1:"big_pop" }, - "pool_water": { elem1:"big_pop" }, - "primordial_soup": { elem1:"big_pop" }, - "acid": { elem1:"explosion" } - }, - tempHigh: 63.5, - category: "solids", - state: "solid", - density: 890, - conduct: 0.85, - hardness: 0.04, - burn:40, - burnTime: 200, - fireColor: ["#ff00ee","#ff6bf5"] -}; -elements.molten_potassium = { - tempLow: 63.5, - tempHigh: 757.6, - burn:40, - burnTime: 200, - fireColor: ["#ff00ee","#ff6bf5"], - reactions: { - "chlorine": { elem1:"potassium_salt", elem2:"big_pop" }, - "water": { elem1:"big_pop" }, - "salt_water": { elem1:"big_pop" }, - "sugar_water": { elem1:"big_pop" }, - "dirty_water": { elem1:"big_pop" }, - "seltzer": { elem1:"big_pop" }, - "pool_water": { elem1:"big_pop" }, - "primordial_soup": { elem1:"big_pop" }, - "acid": { elem1:"explosion" } - } -}; -elements.potassium_gas = { - color: "#5e6fdb" +elements.molten_potassium.reactions = { + "chlorine": { elem1:"potassium_salt", elem2:null, chance:0.05 }, + "smog": { elem1:["potassium_hydroxide","pop"], elem2:["hydrogen","pop","fire"], chance:0.01, temp2:400 }, + "electric": { elem1:[null,"pop"], elem2:["pop","fire"], chance:0.05, temp2:400 }, }; + +runAfterLoad(function() { + reactList("molten_potassium", eLists.WATER, { elem1:["potassium_hydroxide","pop"], elem2:["hydrogen","pop","fire"], chance:0.01, temp2:400 }); +}); + elements.molten_salt = {}; elements.molten_potassium_salt = {}; @@ -2020,6 +2094,49 @@ elements.niter = { state: "solid", density: 2109, }; +createSalt("niter","niter_solution","#f0efcc",blendColors("#f0efcc","#2167ff",0.75),false,true,334,-2,102,2109,1011,"POTASSIUM","NITRATE"); +elements["niter"].stateHigh = "fire"; +elements["niter"].reactions = Object.assign(elements["niter"].reactions,{ + "plant": { "elem1":"plant", "chance":0.05 }, + "wheat_seed": { "elem1":"wheat", "chance":0.05 }, + "grass": { "elem1":"grass", "chance":0.05 }, + "grass_seed": { "elem1":"grass", "chance":0.05 }, + "bamboo_plant": { "elem1":"bamboo", "chance":0.05 }, + "flower_seed": { "elem1":"flower_seed", "chance":0.05 }, + "petal": { "elem1":"flower_seed", "chance":0.05 }, + "vine": { "elem1":"vine", "chance":0.05 }, + "sapling": { "elem1":"tree_branch", "chance":0.05 }, + "tree_branch": { "elem1":"tree_branch", "chance":0.05 }, + "corn_seed": { "elem1":"corn", "chance":0.05 }, + "root": { "elem1":"root", "chance":0.05 }, + "dirt": { "elem1":"grass", "chance":0.05 }, + "mud": { "elem1":"grass", "chance":0.05 }, + "potato_seed": { "elem1":"potato", "chance":0.05 }, + "yeast": { "elem1":"yeast", "chance":0.05 }, + "sulfur": { "elem1":"gunpowder", "elem2": null}, + }); +elements["niter_solution"].reactions = Object.assign(elements["niter_solution"].reactions,{ + "plant": { "elem1":"plant", "chance":0.05 }, + "wheat_seed": { "elem1":"wheat", "chance":0.05 }, + "grass": { "elem1":"grass", "chance":0.05 }, + "grass_seed": { "elem1":"grass", "chance":0.05 }, + "bamboo_plant": { "elem1":"bamboo", "chance":0.05 }, + "flower_seed": { "elem1":"flower_seed", "chance":0.05 }, + "petal": { "elem1":"flower_seed", "chance":0.05 }, + "vine": { "elem1":"vine", "chance":0.05 }, + "sapling": { "elem1":"tree_branch", "chance":0.05 }, + "tree_branch": { "elem1":"tree_branch", "chance":0.05 }, + "corn_seed": { "elem1":"corn", "chance":0.05 }, + "root": { "elem1":"root", "chance":0.05 }, + "dirt": { "elem1":"grass", "chance":0.05 }, + "mud": { "elem1":"grass", "chance":0.05 }, + "potato_seed": { "elem1":"potato", "chance":0.05 }, + "yeast": { "elem1":"yeast", "chance":0.05 }, + "sulfur": { "elem1":"gunpowder", "elem2": "water"}, + }); +delete elements["molten_niter"]; + + elements.potassium_salt.hidden = false; @@ -2035,6 +2152,18 @@ elements.fluorite = { } }; + +eListAddIon("CALCIUM","fluorite"); +eListAddIon("FLUORIDE","fluorite"); +eListAddIon("CALCIUM","molten_fluorite"); +eListAddIon("FLUORIDE","molten_fluorite"); +eListAdd("INSOLUBLE","fluorite"); +eListAddIon("CALCIUM","chalk"); +eListAddIon("SULFATE","chalk"); +eListAddIon("CALCIUM","molten_chalk"); +eListAddIon("SULFATE","molten_chalk"); +eListAdd("INSOLUBLE","chalk"); + elements.sulfuric_acid.ignore.push("chalk","fluorite"); elements.sulfuric_acid_gas.ignore.push("chalk","fluorite"); @@ -2067,10 +2196,10 @@ elements.liquid_sulfur_hexafluoride = { tempLow: -64 }; -createAcid("hexafluorosilicic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ebeed8","#f9ffc2","#c7e189"],true,true,100,100,0,1000,1460,1) +createAcid("hexafluorosilicic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ebeed8","#f9ffc2","#c7e189"],true,true,100,100,0,1000,1460,1,"HEXAFLUOROSILICATE") -trueAcids.push("hexafluorosilicic_acid"); -trueAcidGases.push("hexafluorosilicic_acid_gas"); +eLists.ACID.push("hexafluorosilicic_acid"); +eLists.ACIDGAS.push("hexafluorosilicic_acid_gas"); elements.hydrofluoric_acid.ignore.push("sand","hexafluorosilicic_acid","hexafluorosilicic_acid_gas","potassium_carbonate","potassium_fluoride","carbon_dioxide","hydrogen"); @@ -2082,36 +2211,27 @@ elements.hexafluorosilicic_acid_gas.ignore.push("sand"); acidReact("hydrofluoric_acid","sand","hexafluorosilicic_acid","fire",0); acidReact("hydrofluoric_acid_gas","sand","hexafluorosilicic_acid","fire",0); -acidReact("hydrofluoric_acid","potassium_carbonate","potassium_fluoride","carbon_dioxide",100); -acidReact("hydrofluoric_acid_gas","potassium_carbonate","potassium_fluoride","carbon_dioxide",100); -acidReact("hydrogen_fluoride","potassium_carbonate","potassium_fluoride","carbon_dioxide",100); -acidReact("liquid_hydrogen_fluoride","potassium_carbonate","potassium_fluoride","carbon_dioxide",100); -acidReact("hydrofluoric_acid","potassium_carbonate",["hydrogen","fluorine"],"potassium_fluoride",100); -acidReact("hydrofluoric_acid_gas","potassium_carbonate",["hydrogen","fluorine"],"potassium_fluoride",100); - -elements.fluorine.ignore.push("sand","potassium_fluoride","carbon_dioxide"); -elements.liquid_fluorine.ignore.push("sand","potassium_fluoride","carbon_dioxide"); - -elements.potassium_carbonate = { - color: "#e2e1e8", - behavior: behaviors.POWDER, - category: "powders", - hidden: true, - density: 2430, - state: "solid", - tempHigh: 891 -} +acidReact("hydrofluoric_acid","potassium_carbonate","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("hydrofluoric_acid_gas","potassium_carbonate","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("hydrogen_fluoride","potassium_carbonate","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("liquid_hydrogen_fluoride","potassium_carbonate","potassium_fluoride_solution","carbon_dioxide",100); -elements.potassium_fluoride = { - color: "#e8e8e1", - behavior: behaviors.POWDER, - category: "powders", - hidden: true, - density: 2480, - state: "solid", - tempHigh: 858 -} +acidReact("hydrofluoric_acid","potassium_carbonate_solution","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("hydrofluoric_acid_gas","potassium_carbonate_solution","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("hydrogen_fluoride","potassium_carbonate_solution","potassium_fluoride_solution","carbon_dioxide",100); +acidReact("liquid_hydrogen_fluoride","potassium_carbonate_solution","potassium_fluoride_solution","carbon_dioxide",100); + +acidReact("hydrofluoric_acid","potassium_fluoride","fluorine","potassium_fluoride_solution",100); +acidReact("hydrofluoric_acid_gas","potassium_fluoride","fluorine","potassium_fluoride_solution",100); +acidReact("hydrofluoric_acid","potassium_fluoride","fluorine",["potassium_fluoride_solution",null],100); +acidReact("hydrofluoric_acid_gas","potassium_fluoride","fluorine",["potassium_fluoride_solution",null],100); + +elements.fluorine.ignore.push("sand","potassium_carbonate","potassium_fluoride","carbon_dioxide"); +elements.liquid_fluorine.ignore.push("sand","potassium_carbonate","potassium_fluoride","carbon_dioxide"); + +createSalt("potassium_carbonate","potassium_carbonate_solution","#e2e1e8",blendColors("#e2e1e8","#2167ff",0.75),true,true,891,-2,102,2430,1024,"POTASSIUM","CARBONATE"); +createSalt("potassium_fluoride","potassium_fluoride_solution","#e8e8e1",blendColors("#e8e8e1","#2167ff",0.75),true,true,858,-2,102,2480,1020,"POTASSIUM","FLUORIDE"); elements.soy_sauce = { @@ -2137,6 +2257,7 @@ elements.bromine = { "water": { elem1: "pool_water", elem2:null }, "dirty_water": { elem2:"water" }, "potassium": { elem1:"potassium_bromide", elem2:null }, + "sodium": { elem1:"sodium_bromide", elem2:null }, "root": { elem2:null, chance:0.025 }, "tree_branch": { elem2:"wood", chance:0.015 }, "pistil": { elem2:"dead_plant", chance:0.025 }, @@ -2165,6 +2286,7 @@ elements.bromine_gas = { "water": { elem1: "pool_water", elem2:null }, "dirty_water": { elem2:"water" }, "potassium": { elem1:"potassium_bromide", elem2:null }, + "sodium": { elem1:"sodium_bromide", elem2:null }, "root": { elem2:null, chance:0.025 }, "tree_branch": { elem2:"wood", chance:0.015 }, "pistil": { elem2:"dead_plant", chance:0.025 }, @@ -2183,32 +2305,28 @@ elements.bromine_gas = { stain: 0.5 }; - -elements.potassium_bromide = { - color: ["#fccaca","#f7cbcb"], - behavior: behaviors.POWDER, - category: "powders", - tempHigh: 734, - state: "solid", - density: 2740 -}; +createSalt("potassium_bromide","potassium_bromide_solution",["#fccaca","#f7cbcb"],blendColors("#fccaca","#2167ff",0.75),false,true,734,-2,102,2740,1050,"POTASSIUM","BROMIDE"); +createSalt("sodium_bromide","sodium_bromide_solution",["#f5f4ed","#f2f2eb"],blendColors("#f5f4ed","#2167ff",0.75),false,true,747,-2,102,3210,1040,"SODIUM","BROMIDE"); elements.silver_bromide = { color: ["#fcfcca","#f7f24f"], tick: function(pixel) { for (let i = -1; i <= 1; i++) { for (let j = -1; j <= 1; j++) { - if (!isEmpty(pixel.x+i,pixel.y+j,true) && (pixelMap[pixel.x+i][pixel.y+j].element === "light" || pixelMap[pixel.x+i][pixel.y+j].element === "liquid_light")) { + if (!isEmpty(pixel.x+i,pixel.y+j,true) && Math.random() < 0.1 && (pixelMap[pixel.x+i][pixel.y+j].element === "light" || pixelMap[pixel.x+i][pixel.y+j].element === "laser" || pixelMap[pixel.x+i][pixel.y+j].element === "liquid_light")) { - for (let k = -1; k <= 1; k++) { - for (let l = -1; l <= 1; l++) { - if(!isEmpty(pixel.x+k,pixel.y+l,true) && pixelMap[pixel.x+k][pixel.y+l].element === "silver_bromide") - { - pixelMap[pixel.x+k][pixel.y+l].color = pixelMap[pixel.x+i][pixel.y+j].color; - } - } + let coords = circleCoords(pixel.x+i,pixel.y+j,20); + for (var n = 0; n < coords.length; n++) { + k = coords[n].x; + l = coords[n].y; + distance = (k-pixel.x-i)*(k-pixel.x-i) + (l-pixel.y-j)*(l-pixel.y-j); + if(!isEmpty(k,l,true) && pixelMap[k][l].element === "silver_bromide") + { + if(distance <= 0) {console.log("a");} + pixelMap[k][l].color = pixelColorPick(pixelMap[k][l],blendColors(RGBToHex(toObject(pixelMap[k][l].color)),RGBToHex(toObject(pixelMap[pixel.x+i][pixel.y+j].color)),1/distance)); + } } - if(pixelMap[pixel.x+i][pixel.y+j].element === "light") + if(pixelMap[pixel.x+i][pixel.y+j].element === "light" || pixelMap[pixel.x+i][pixel.y+j].element === "laser") { deletePixel(pixel.x+i,pixel.y+j); } @@ -2223,34 +2341,35 @@ elements.silver_bromide = { density: 6470 }; +eListAddIon("SILVER","silver_bromide"); +eListAddIon("BROMIDE","silver_bromide"); +eListAdd("INSOLUBLE","silver_bromide"); +eListAddIon("SILVER","molten_silver_bromide"); +eListAddIon("BROMIDE","molten_silver_bromide"); -elements.nitric_acid.reactions["silver"] = { elem1: "nitrogen_dioxide", elem2: "silver_nitrate"}; -elements.nitric_acid_gas.reactions["silver"] = { elem1: "nitrogen_dioxide", elem2: "silver_nitrate"}; -elements.nitric_acid.ignore.push("silver","silver_nitrate"); -elements.nitric_acid_gas.ignore.push("silver","silver_nitrate"); -elements.silver_nitrate = { - color: ["#cad7fc","#cbd2f7"], - behavior: behaviors.POWDER, - reactions: { - "potassium_bromide": {elem1: "niter", elem2: "silver_bromide"} - }, - category: "powders", - tempHigh: 209, - state: "solid", - density: 2740, - hidden: true -}; +elements.nitric_acid.reactions["silver"] = { elem1: "nitrogen_dioxide", elem2: "silver_nitrate_solution"}; +elements.nitric_acid_gas.reactions["silver"] = { elem1: "nitrogen_dioxide", elem2: "silver_nitrate_solution"}; + +elements.nitric_acid.ignore.push("silver","silver_nitrate","silver_nitrate_solution"); +elements.nitric_acid_gas.ignore.push("silver","silver_nitrate","silver_nitrate_solution"); + elements.molten_silver_nitrate = { tempHigh: 440, - stateHigh: ["silver","nitrogen_dioxide","oxygen"], + stateHigh: ["silver","nitrogen_dioxide","oxygen","fire"], } -createAcid("hydrobromic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ff3b3b","#ca0000","#9e7b7b"],true,true,100,100,0,1000,1100,1) +createSalt("silver_nitrate","silver_nitrate_solution",["#cad7fc","#cbd2f7"],blendColors("#cad7fc","#2167ff",0.5),true,true,209,-2,102,4350,1060,"SILVER","NITRATE"); -trueAcids.push("hydrobromic_acid"); -trueAcidGases.push("hydrobromic_acid_gas"); +elements.silver_nitrate_solution.reactions["potassium_bromide"] = { elem1: "niter_solution", elem2: "silver_bromide"}; +elements.silver_nitrate_solution.reactions["potassium_bromide_solution"] = { elem1: "niter_solution", elem2: "silver_bromide"}; + + +createAcid("hydrobromic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ff3b3b","#ca0000","#9e7b7b"],true,true,100,100,0,1000,1100,1,"BROMIDE") + +eLists.ACID.push("hydrobromic_acid"); +eLists.ACIDGAS.push("hydrobromic_acid_gas"); acidReact("sulfuric_acid","bromine","sulfuric_acid","hydrobromic_acid",50); acidReact("sulfuric_acid","bromine_ice","sulfuric_acid","hydrobromic_acid",50); @@ -2258,8 +2377,6 @@ acidReact("sulfuric_acid","bromine_gas","sulfuric_acid","hydrobromic_acid",50); acidReact("sulfuric_acid_gas","bromine","sulfuric_acid","hydrobromic_acid",50); acidReact("sulfuric_acid_gas","bromine_ice","sulfuric_acid","hydrobromic_acid",50); acidReact("sulfuric_acid_gas","bromine_gas","sulfuric_acid","hydrobromic_acid",50); -elements.hydrobromic_acid.ignore.push("bromine","bromine_ice","bromine_gas"); -elements.hydrobromic_acid_gas.ignore.push("bromine","bromine_ice","bromine_gas"); acidReact("sulfuric_acid","potassium_salt","potassium_sulfate","acid",50); acidReact("sulfuric_acid_gas","potassium_salt","potassium_sulfate","acid",50); @@ -2268,17 +2385,9 @@ acidReact("sulfuric_acid_gas","niter","potassium_sulfate","nitric_acid",50); acidReact("sulfuric_acid","potassium_bromide","potassium_sulfate","hydrobromic_acid",50); acidReact("sulfuric_acid_gas","potassium_bromide","potassium_sulfate","hydrobromic_acid",50); -elements.acid.ignore.push("potassium_sulfate","potassium_salt"); -elements.acid_gas.ignore.push("potassium_sulfate","potassium_salt"); -elements.nitric_acid.ignore.push("potassium_sulfate","niter"); -elements.nitric_acid_gas.ignore.push("potassium_sulfate","niter"); -elements.hydrobromic_acid.ignore.push("potassium_sulfate","niter"); -elements.hydrobromic_acid_gas.ignore.push("potassium_sulfate","potassium_bromide"); -elements.potassium_sulfate = { - color: "#f0d8cc", - behavior: behaviors.POWDER, - reactions: { +createSalt("potassium_sulfate","potassium_sulfate_solution","#f0d8cc",blendColors("#f0d8cc","#2167ff",0.75),true,true,1069,-2,102,2660,1012,"POTASSIUM","SULFATE"); +elements["niter"].reactions = Object.assign(elements["potassium_sulfate"].reactions,{ "plant": { "elem1":"plant", "chance":0.05 }, "wheat_seed": { "elem1":"wheat", "chance":0.05 }, "grass": { "elem1":"grass", "chance":0.05 }, @@ -2295,49 +2404,43 @@ elements.potassium_sulfate = { "mud": { "elem1":"grass", "chance":0.05 }, "potato_seed": { "elem1":"potato", "chance":0.05 }, "yeast": { "elem1":"yeast", "chance":0.05 }, - }, - tempHigh: 1069, - category: "powders", - state: "solid", - density: 2660, - hidden: true -}; + }); +elements["niter_solution"].reactions = Object.assign(elements["potassium_sulfate_solution"].reactions,{ + "plant": { "elem1":"plant", "chance":0.05 }, + "wheat_seed": { "elem1":"wheat", "chance":0.05 }, + "grass": { "elem1":"grass", "chance":0.05 }, + "grass_seed": { "elem1":"grass", "chance":0.05 }, + "bamboo_plant": { "elem1":"bamboo", "chance":0.05 }, + "flower_seed": { "elem1":"flower_seed", "chance":0.05 }, + "petal": { "elem1":"flower_seed", "chance":0.05 }, + "vine": { "elem1":"vine", "chance":0.05 }, + "sapling": { "elem1":"tree_branch", "chance":0.05 }, + "tree_branch": { "elem1":"tree_branch", "chance":0.05 }, + "corn_seed": { "elem1":"corn", "chance":0.05 }, + "root": { "elem1":"root", "chance":0.05 }, + "dirt": { "elem1":"grass", "chance":0.05 }, + "mud": { "elem1":"grass", "chance":0.05 }, + "potato_seed": { "elem1":"potato", "chance":0.05 }, + "yeast": { "elem1":"yeast", "chance":0.05 }, + }); + +createSalt("sodium_chlorate","sodium_chlorate_solution","#cff0cc",blendColors("#cff0cc","#2167ff",0.25),true,true,255,-2,102,2490,1011,"SODIUM","CHLORATE"); +elements.sodium_chlorate.stateHigh = "fire"; +elements.sodium_chlorate_solution.reactions["gold"] = { elem1:"sodium_perchlorate_solution", charged:true, chance:0.1 }; -elements.sodium_chlorate = { - color: "#cff0cc", - behavior: behaviors.POWDER, - reactions: { - "gold": { elem1:"sodium_perchlorate", charged:true, chance:0.1 } - }, - tempHigh: 255, - stateHigh: "fire", - category: "powders", - state: "solid", - density: 2490, - hidden: true, - conduct: 0.1, -}; +elements.chlorine.reactions["bleach"] = { elem1: "sodium_chlorate_solution", elem2: null}; +delete elements["molten_sodium_chlorate"]; -elements.chlorine.reactions["bleach"] = { elem1: "sodium_chlorate", elem2: null}; +createSalt("sodium_perchlorate","sodium_perchlorate_solution","#cff0cc",blendColors("#d6f0cc","#2167ff",0.25),true,true,468,-2,102,2499,1011,"SODIUM","PERCHLORATE"); +elements.sodium_perchlorate.stateHigh = "fire"; +elements.sodium_perchlorate.reactions["acid"] = { elem1:"perchloric_acid", elem2:"salt"}; +elements.sodium_perchlorate_solution.reactions["acid"] = { elem1:"perchloric_acid", elem2:"salt_water"}; -elements.sodium_perchlorate = { - color: "#d6f0cc", - behavior: behaviors.POWDER, - reactions: { - "acid": { elem1:"perchloric_acid", elem2: "salt"} - }, - tempHigh: 468, - stateHigh: "fire", - category: "powders", - state: "solid", - density: 2499, - hidden: true -}; +elements.acid.ignore.push("salt","sodium_perchlorate","sodium_perchlorate_solution"); +elements.acid_gas.ignore.push("salt","sodium_perchlorate","sodium_perchlorate_solution"); +delete elements["molten_sodium_perchlorate"]; -elements.acid.ignore.push("salt","sodium_perchlorate"); -elements.acid_gas.ignore.push("salt","sodium_perchlorate"); - -createAcid("perchloric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ff963b","#ca6800","#c48a56"],true,true,100,100,0,1000,1768,1) +createAcid("perchloric_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#ff963b","#ca6800","#c48a56"],true,true,100,100,0,1000,1768,1,"PERCHLORATE") elements.perchloric_acid.tick = function(pixel) { let change = false; @@ -2354,7 +2457,7 @@ elements.perchloric_acid.tick = function(pixel) { } if (change) { if(Math.random() < 0.2) { - changePixel(pixel,"pop"); + changePixel(pixel,"big_pop"); } else { deletePixel(pixel.x,pixel.y); return; @@ -2364,7 +2467,8 @@ elements.perchloric_acid.tick = function(pixel) { } } delete elements.perchloric_acid.behavior; - +elements.perchloric_acid.burn = 0; +elements.perchloric_acid.ignore.push("fire","smoke"); elements.perchloric_acid_gas.tick = function(pixel) { let change = false; @@ -2381,7 +2485,7 @@ elements.perchloric_acid_gas.tick = function(pixel) { } if (change) { if(Math.random() < 0.2) { - changePixel(pixel,"pop"); + changePixel(pixel,"big_pop"); } else { deletePixel(pixel.x,pixel.y); return; @@ -2395,15 +2499,17 @@ elements.perchloric_acid_gas.behavior = [ "XX|XX|XX", "XX|XX|XX", ]; +elements.perchloric_acid_gas.burn = 0; +elements.perchloric_acid_gas.ignore.push("fire","smoke"); -trueAcids.push("perchloric_acid"); -trueAcidGases.push("perchloric_acid_gas"); +eLists.ACID.push("perchloric_acid"); +eLists.ACIDGAS.push("perchloric_acid_gas"); acidReact("perchloric_acid","ammonia","rocket_fuel",null,100); acidReact("perchloric_acid_gas","ammonia","rocket_fuel",null,100); -elements.perchloric_acid.ignore.push("salt","sodium_perchlorate","rocket_fuel"); -elements.perchloric_acid_gas.ignore.push("salt","sodium_perchlorate","rocket_fuel"); +elements.perchloric_acid.ignore.push("salt","sodium_perchlorate","sodium_perchlorate_solution"); +elements.perchloric_acid_gas.ignore.push("salt","sodium_perchlorate","sodium_perchlorate_solution"); elements.rocket_fuel = { color: "#edcfca", @@ -2477,6 +2583,7 @@ elements.molten_iodine = { stateLow: "iodine", state: "liquid", hidden: true, + category: "liquids", }; elements.iodine_gas = { @@ -2529,10 +2636,7 @@ elements.disinfectant = { stain: 0.01 }; -createAcid("hydroiodic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#9670ff","#da6afc","#a77af5","#9670ff","#da6afc","#a77af5","#633a1d"],true,true,100,100,0,1000,1150,1) - -trueAcids.push("hydroiodic_acid"); -trueAcidGases.push("hydroiodic_acid_gas"); +createAcid("hydroiodic_acid",structuredClone(defaultAcidReactions),structuredClone(defaultAcidGasReactions),["#9670ff","#da6afc","#a77af5","#9670ff","#da6afc","#a77af5","#633a1d"],true,true,100,100,0,1000,1150,1,"IODIDE") elements.hydrogen_iodide = { color: "#aa8df2", @@ -2557,6 +2661,10 @@ elements.hydrogen_iodide = { forceAutoGen: true }; +runAfterLoad(function() { + reactList("hydrogen_iodide", eLists.WATER, { "elem1": "hydroiodic_acid", "elem2": null }); +}); + elements.liquid_hydrogen_iodide = { reactions: { "water": { "elem1": "hydroiodic_acid", "elem2": null }, @@ -2573,16 +2681,25 @@ elements.liquid_hydrogen_iodide = { tempLow: -50.8, }; +runAfterLoad(function() { + reactList("liquid_hydrogen_iodide", eLists.WATER, { "elem1": "hydroiodic_acid", "elem2": null }); +}); + elements.hydroiodic_acid.ignore.push("hydrogen_iodide","liquid_hydrogen_iodide","hydrogen_iodide_ice"); elements.hydroiodic_acid_gas.ignore.push("hydrogen_iodide","liquid_hydrogen_iodide","hydrogen_iodide_ice"); -elements.hydroiodic_acid.reactions["water"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["salt_water"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["sugar_water"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["dirty_water"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["seltzer"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["pool_water"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; -elements.hydroiodic_acid.reactions["primordial_soup"] = { "elem1":"hydroiodic_acid", "elem2":"dirty_water"}; + +eListAddIon("HYDROGEN","hydrogen_iodide"); +eListAddIon("IODIDE","hydrogen_iodide"); +eListAddIon("HYDROGEN","liquid_hydrogen_iodide"); +eListAddIon("IODIDE","liquid_hydrogen_iodide"); +eListAddIon("HYDROGEN","hydroiodic_acid"); +eListAddIon("IODIDE","hydroiodic_acid"); +eListAddIon("HYDROGEN","hydroiodic_acid_gas"); +eListAddIon("IODIDE","hydroiodic_acid_gas"); +runAfterLoad(function() { + reactList("hydroiodic_acid", eLists.WATER, { "elem2":"dirty_water"}); +}); @@ -2595,21 +2712,6 @@ elements.bauxite = { tempHigh: 300 }; -elements.sodium_aluminate_solution = { - color: ["#bdb3e6","#b4adeb"], - behavior: behaviors.LIQUID, - category: "liquids", - hidden: true, - density: 1005, - state: "liquid", - tempHigh: 100, - stateHigh: ["sodium_aluminate","steam"], - reactions: { - //Bayer process - "carbon_dioxide": { elem1:"aluminum_hydroxide", elem2: ["sodium_carbonate_solution","spent_sodium_aluminate_solution"] }, - }, -}; - elements.spent_sodium_aluminate_solution = { color: ["#696380","#7a759e"], @@ -2622,44 +2724,15 @@ elements.spent_sodium_aluminate_solution = { stateHigh: ["sodium_aluminate","sodium_aluminate","sodium_aluminate","gallium","steam","steam","steam","steam"], }; - -elements.sodium_aluminate = { - color: ["#e6c9b3","#ebc8ad"], - behavior: behaviors.POWDER, - category: "powders", - hidden: true, - density: 1500, - state: "solid", - tempHigh: 1650, - reactions: { - "water": { elem1: "sodium_aluminate_solution", elem2: null }, - }, -}; - -elements.sodium_carbonate_solution = { - color: ["#c5c1d6","#afacc2"], - behavior: behaviors.LIQUID, - category: "liquids", - hidden: true, - density: 1005, - state: "liquid", - tempHigh: 100, - stateHigh: ["sodium_carbonate","steam"], -}; +createSalt("sodium_aluminate","sodium_aluminate_solution",["#e6c9b3","#ebc8ad"],["#bdb3e6","#b4adeb"],true,true,1650,-2,102,1500,1005,"SODIUM","ALUMINATE"); +elements.sodium_aluminate_solution.reactions["carbon_dioxide"] = { elem1:"aluminum_hydroxide", elem2: ["sodium_carbonate_solution","spent_sodium_aluminate_solution"] }; -elements.sodium_carbonate = { - color: "#d8dae6", - behavior: behaviors.POWDER, - category: "powders", - hidden: false, - density: 2540, - state: "solid", - tempHigh: 851, - reactions: { - "water": { elem1: "sodium_carbonate_solution", elem2: null }, - }, -} +createSalt("sodium_carbonate","sodium_carbonate_solution","#d8dae6",["#c5c1d6","#afacc2"],true,true,851,-2,102,2540,1010,"SODIUM","CARBONATE"); +createSalt("ammonium_chloride","ammonium_chloride_solution","#daeced",["#a299c7","#7e76b3"],true,true,338 ,-2,102,1519,1008,"AMMONIUM","CHLORIDE"); +elements["ammonium_chloride"].stateHigh = ["ammonia", "acid_gas"]; +delete elements["molten_ammonium_chloride"]; +acidReact("acid_gas","ammonia","ammonium_chloride",null,0); elements.aluminum_hydroxide = { @@ -2673,6 +2746,11 @@ elements.aluminum_hydroxide = { stateHigh: ["alumina","steam"], } + +eListAddIon("ALUMINUM","aluminum_hydroxide"); +eListAddIon("HYDROXIDE","aluminum_hydroxide"); +eListAdd("INSOLUBLE","aluminum_hydroxide"); + elements.alumina = { color: "#d1cbcb", behavior: behaviors.SOLID, @@ -2685,6 +2763,14 @@ elements.alumina = { }, } +eListAddIon("ALUMINUM","alumina"); +eListAddIon("OXIDE","alumina"); +eListAdd("INSOLUBLE","alumina"); + +eListAddIon("ALUMINUM","molten_alumina"); +eListAddIon("OXIDE","molten_alumina"); + + elements.cryolite = { @@ -2699,6 +2785,13 @@ elements.cryolite = { }, } +eListAddIon("SODIUM","cryolite"); +eListAddIon("HEXAFLUOROALUMINATE","cryolite"); +eListAdd("INSOLUBLE","cryolite"); + +eListAddIon("SODIUM","molten_cryolite"); +eListAddIon("HEXAFLUOROALUMINATE","molten_cryolite"); + elements.aluminum_trifluoride = { color: ["#ebf4ff","#e3fdff"], @@ -2710,6 +2803,14 @@ elements.aluminum_trifluoride = { tempHigh: 1290, } +eListAddIon("ALUMINUM","aluminum_trifluoride"); +eListAddIon("FLUORIDE","aluminum_trifluoride"); +eListAdd("INSOLUBLE","aluminum_trifluoride"); + +eListAddIon("ALUMINUM","aluminum_trifluoride_gas"); +eListAddIon("FLUORIDE","aluminum_trifluoride_gas"); + + elements.molten_aluminum_trifluoride = { tempHigh: 1290, @@ -2718,6 +2819,8 @@ elements.molten_aluminum_trifluoride = { elements.aluminum_trifluoride_gas = { tempLow: 1290, + state: "gas", + stateLow: "molten_aluminum_trifluoride" } @@ -2743,15 +2846,35 @@ elements.cryolite_solution = { tempHigh: 950, } -elements.sodium_fluoride = { - color: ["#8aebce","#b9edde"], + +createSalt("sodium_fluoride","sodium_fluoride_solution",["#8aebce","#b9edde"],["#8ad0eb","#b9e3ed"],false,true,993,-2,102,2558,1012,"SODIUM","FLUORIDE"); + +elements.magnesium_fluoride = { + color: ["#aaabae","#a9adae"], behavior: behaviors.POWDER, category: "powders", - density: 2558, + density: 3148, state: "solid", - tempHigh: 993, -} + tempHigh: 1263, + reactions: { + "sulfuric_acid": { "elem1": "hydrogen_fluoride", "elem2":"epsom_salt" }, + }, + hidden: true +}; +eListAddIon("MAGNESIUM","magnesium_fluoride"); +eListAddIon("FLUORIDE","magnesium_fluoride"); +eListAdd("INSOLUBLE","magnesium_fluoride"); + +eListAddIon("MAGNESIUM","molten_magnesium_fluoride"); +eListAddIon("FLUORIDE","molten_magnesium_fluoride"); + + +elements.sulfuric_acid.ignore.push("epsom_salt","magnesium_fluoride"); +elements.sulfuric_acid_gas.ignore.push("epsom_salt","magnesium_fluoride"); + +elements.hydrogen_fluoride.ignore.push("epsom_salt","magnesium_fluoride"); +elements.liquid_hydrogen_fluoride.ignore.push("epsom_salt","magnesium_fluoride"); //boron @@ -2768,31 +2891,47 @@ elements.boric_acid = { reactions: { "hydrofluoric_acid": { elem1: "fluoroboric_acid", elem2: "dirty_water"}, "hydrofluoric_acid_gas": { elem1: "fluoroboric_acid_gas", elem2: "steam"}, + "neutron": {elem2: null} }, } acidReact("hydrofluoric_acid","boric_acid","fluoroboric_acid","dirty_water",50); acidReact("hydrofluoric_acid_gas","boric_acid","fluoroboric_acid_gas","steam",50); -elements.hydrofluoric_acid.ignore.push("boric_acid","molten_boric_acid"); -elements.hydrofluoric_acid_gas.ignore.push("boric_acid","molten_boric_acid"); +elements.hydrofluoric_acid.ignore.push("molten_boric_acid"); +elements.hydrofluoric_acid_gas.ignore.push("molten_boric_acid"); elements.borax.hidden = false; -acidReact("sulfuric_acid","salt","acid","sodium_sulfate"); -acidReact("sulfuric_acid_gas","salt","acid","sodium_sulfate"); -elements.acid.ignore.push("sodium_sulfate"); -elements.acid_gas.ignore.push("sodium_sulfate"); +createSalt("sodium_sulfate","sodium_sulfate_solution","#f3f2f5",blendColors("#f3f2f5","#2167ff",0.5),true,true,884,-2,102,2664,1013,"SODIUM","SULFATE"); + +acidReact("sulfuric_acid","salt","acid","sodium_sulfate_solution"); +acidReact("sulfuric_acid_gas","salt","acid","sodium_sulfate_solution"); +acidReact("sulfuric_acid","salt_water","acid","sodium_sulfate_solution"); +acidReact("sulfuric_acid_gas","salt_water","acid","sodium_sulfate_solution"); + +eListAddIon("BORON","boric_acid","base"); +eListAddIon("HYDROXIDE","boric_acid","base"); +eListAddIon("BORATE","boric_acid","acid"); +eListAddIon("HYDROGEN","boric_acid","acid"); +eListAdd("INSOLUBLE","boric_acid"); + +eListAddIon("BORON","molten_boric_acid","base"); +eListAddIon("HYDROXIDE","molten_boric_acid","base"); +eListAddIon("BORATE","molten_boric_acid","acid"); +eListAddIon("HYDROGEN","molten_boric_acid","acid"); + +eListAdd("AMPHOTERIC","boric_acid"); +eListAdd("AMPHOTERIC","molten_boric_acid"); + + +eListAddIon("BORATE","borax"); +eListAddIon("SODIUM","borax"); +eListAdd("INSOLUBLE","borax"); + +eListAddIon("BORATE","molten_borax"); +eListAddIon("SODIUM","molten_borax"); -elements.sodium_sulfate = { - color: "#f3f2f5", - behavior: behaviors.POWDER, - category: "powders", - density: 2664, - state: "solid", - hidden: true, - tempHigh: 884, -} elements.boron = { @@ -2826,6 +2965,14 @@ elements.boron_trioxide = { fireColor:["#34eb67","#5ceb34"], } +eListAddIon("BORON","boron_trioxide"); +eListAddIon("OXIDE","boron_trioxide"); +eListAdd("INSOLUBLE","boron_trioxide"); + +eListAddIon("BORON","molten_boron_trioxide"); +eListAddIon("OXIDE","molten_boron_trioxide"); + + elements.molten_boron_trioxide = { reactions: { @@ -2851,21 +2998,27 @@ elements.boron_trifluoride = { hidden: true, tempLow: -100.3, reactions: { - "water": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, - "dirty_water": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, - "salt_water": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, - "sugar_water": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, "steam": { elem1: "fluoroboric_acid_gas", elem2: "boric_acid"}, - "seltzer": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, - "pool_water": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, - "primordial_soup": { elem1: "fluoroboric_acid", elem2: "boric_acid"}, }, } +eListAddIon("BORON","boron_trifluoride"); +eListAddIon("FLUORIDE","boron_trifluoride"); +eListAdd("INSOLUBLE","boron_trifluoride"); + +runAfterLoad(function() { + reactList("boron_trifluoride", eLists.WATER, { elem1: "fluoroboric_acid", elem2: "boric_acid"}); +}); + + elements.liquid_boron_trifluoride = { tempLow: -126.8, } +eListAddIon("BORON","liquid_boron_trifluoride"); +eListAddIon("FLUORIDE","liquid_boron_trifluoride"); +eListAddIon("BORON","boron_trifluoride_ice"); +eListAddIon("FLUORIDE","boron_trifluoride_ice"); elements.boron_trichloride = { color: "#ddf0dd", @@ -2876,38 +3029,38 @@ elements.boron_trichloride = { hidden: true, tempLow: 12.6, reactions: { - "water": { elem1: "acid", elem2: "boric_acid"}, - "dirty_water": { elem1: "acid", elem2: "boric_acid"}, - "salt_water": { elem1: "acid", elem2: "boric_acid"}, - "sugar_water": { elem1: "acid", elem2: "boric_acid"}, "steam": { elem1: "acid_gas", elem2: "boric_acid"}, - "seltzer": { elem1: "acid", elem2: "boric_acid"}, - "pool_water": { elem1: "acid", elem2: "boric_acid"}, - "primordial_soup": { elem1: "acid", elem2: "boric_acid"}, "hydrogen": { elem1: "boron", elem2: "acid_gas"}, }, } +eListAddIon("BORON","boron_trichloride"); +eListAddIon("CHLORIDE","boron_trichloride"); +eListAddIon("BORON","liquid_boron_trichloride"); +eListAddIon("CHLORIDE","liquid_boron_trichloride"); +eListAddIon("BORON","boron_trichloride_ice"); +eListAddIon("CHLORIDE","boron_trichloride_ice"); +eListAdd("INSOLUBLE","boron_trichloride"); + + +runAfterLoad(function() { + reactList("boron_trichloride", eLists.WATER, { elem1: "acid", elem2: "boric_acid"}); +}); + elements.liquid_boron_trichloride = { tempLow: -107.3, } -createAcid("fluoroboric_acid",{ - "water": { "elem2": "dirty_water" }, - "salt_water": { "elem2": "dirty_water" }, - "sugar_water": { "elem2": "dirty_water" }, - "seltzer": { "elem2": "dirty_water" }, - "pool_water": { "elem2": "dirty_water" }, - "primordial_soup": { "elem2": "dirty_water" }, - },{ - "water": { "elem2": "dirty_water" }, - "salt_water": { "elem2": "dirty_water" }, - "sugar_water": { "elem2": "dirty_water" }, - "seltzer": { "elem2": "dirty_water" }, - "pool_water": { "elem2": "dirty_water" }, - "primordial_soup": { "elem2": "dirty_water" }, - },["#3bffdb","#00caaf","#56c4a3"],true,true,100,100,0,1000,1020,1) +runAfterLoad(function() { + reactList("fluoroboric_acid", eLists.WATER, { "elem2": "dirty_water" }); +}); + +runAfterLoad(function() { + reactList("fluoroboric_acid_gas", eLists.WATER, { "elem2": "dirty_water" }); +}); + +createAcid("fluoroboric_acid",{},{},["#3bffdb","#00caaf","#56c4a3"],true,true,100,100,0,1000,1020,1,"TETRAFLUOROBORATE") elements.fluoroboric_acid.ignore.push("boron_trifluoride","liquid_boron_trifluoride","boron_trifluoride_ice"); elements.fluoroboric_acid_gas.ignore.push("boron_trifluoride","liquid_boron_trifluoride","boron_trifluoride_ice"); @@ -2972,9 +3125,11 @@ elements.fluoroboric_acid_gas.behavior = [ "XX|XX|XX", ]; +elements.fluoroboric_acid.ignore.push("molten_boric_acid"); +elements.fluoroboric_acid_gas.ignore.push("molten_boric_acid"); -trueAcids.push("fluoroboric_acid"); -trueAcidGases.push("fluoroboric_acid_gas"); +eLists.ACID.push("fluoroboric_acid"); +eLists.ACIDGAS.push("fluoroboric_acid_gas"); acidReact("fluoroboric_acid","sodium_carbonate","sodium_tetrafluoroborate",["carbon_dioxide,steam"],50); acidReact("fluoroboric_acid_gas","sodium_carbonate","sodium_tetrafluoroborate",["carbon_dioxide,steam"],50); @@ -3001,13 +3156,6 @@ elements.sodium_hydride = { reactions: { "chlorine": { elem1:"salt", elem2:"acid_gas" }, "vinegar": { elem1:"sodium_acetate", elem2:null, attr1:{"foam":15} }, - "water": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "salt_water": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "sugar_water": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "dirty_water": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "seltzer": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "pool_water": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }, - "primordial_soup": { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 } }, category: "powders", state: "solid", @@ -3017,9 +3165,17 @@ elements.sodium_hydride = { burnTime:120, }; +eListAddIon("SODIUM","sodium_hydride","base"); +eListAddIon("HYDRIDE","sodium_hydride","base"); +eListAdd("INSOLUBLE","sodium_hydride"); -acids.push(elements.sodium_hydride); -elements.sodium_hydride.ignore = defaultAcidIgnore.concat(ignoreAcid); + +runAfterLoad(function() { + reactList("sodium_hydride", eLists.WATER, { elem1:["pop","pop","hydrogen","hydrogen"], chance:0.1, temp2:250 }); +}); + +eLists.CAUSTIC.push("sodium_hydride"); +elements.sodium_hydride.ignore = defaultAcidIgnore.concat(eLists.CAUSTICIGNORE); acidIgnore(["sodium_hydride"]); elements.molten_sodium.reactions.hydrogen = { elem1: "sodium_hydride", elem2: null}; @@ -3050,16 +3206,29 @@ elements.sodium_methoxide = { } }; +eListAddIon("SODIUM","sodium_methoxide","base"); +eListAddIon("METHOXIDE","sodium_methoxide","base"); +eListAdd("INSOLUBLE","sodium_methoxide"); +eListAddIon("SODIUM","molten_sodium_methoxide","base"); +eListAddIon("METHOXIDE","molten_sodium_methoxide","base"); + + + +runAfterLoad(function() { + reactList("sodium_methoxide", eLists.WATER, { elem1:"methanol", elem2:"sodium_hydroxide" }); +}); + + elements.molten_sodium_methoxide = { behavior: behaviors.MOLTEN_CAUSTIC, tempLow: 127, } -acids.push(elements.sodium_methoxide); -acids.push(elements.molten_sodium_methoxide); -elements.sodium_methoxide.ignore = defaultAcidIgnore.concat(ignoreAcid).concat(["sodium","molten_sodium","hydrogen","methanol","methanol_gas","trimethyl_borate"]); -elements.molten_sodium_methoxide.ignore = defaultAcidGasIgnore.concat(ignoreAcid).concat(["sodium","molten_sodium","hydrogen","methanol","methanol_gas","trimethyl_borate"]); +eLists.CAUSTIC.push("sodium_methoxide"); +eLists.CAUSTIC.push("molten_sodium_methoxide"); +elements.sodium_methoxide.ignore = defaultAcidIgnore.concat(eLists.CAUSTICIGNORE).concat(["sodium","molten_sodium","hydrogen","methanol","methanol_gas","trimethyl_borate"]); +elements.molten_sodium_methoxide.ignore = defaultAcidGasIgnore.concat(eLists.CAUSTICIGNORE).concat(["sodium","molten_sodium","hydrogen","methanol","methanol_gas","trimethyl_borate"]); acidIgnore(["sodium_methoxide","molten_sodium_methoxide"]); @@ -3084,38 +3253,37 @@ elements.trimethyl_borate = { fireColor:["#34eb67","#5ceb34"], }; -elements.sodium_borohydride = { - color: ["#d3d3de","#c7c7eb","#ededfc","#d9d9d9"], - tempHigh: 400, - behavior: behaviors.CAUSTIC, - fireColor:["#34eb67","#5ceb34"], - category: "powders", - state: "solid", - density: 1070, - stateHigh: ["sodium_hydride","sodium","boron"], - reactions: {}, -}; +createSalt("sodium_borohydride","sodium_borohydride_solution",["#d3d3de","#c7c7eb","#ededfc","#d9d9d9"],["#ababc7","#9d9dd1","#bdbddb","#a8a8a8"],false,true,400,-2,102,1070,1005,"SODIUM","BOROHYDRIDE"); -acids.push(elements.sodium_borohydride); -elements.sodium_borohydride.ignore = defaultAcidIgnore.concat(ignoreAcid).concat(["sodium","molten_sodium","hydrogen","boron","trimethyl_borate"]); -acidIgnore(["sodium_borohydride"]); +elements.sodium_borohydride.behavior = behaviors.CAUSTIC; +elements.sodium_borohydride_solution.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", + ]; +elements.sodium_borohydride.fireColor = ["#34eb67","#5ceb34"]; +elements.sodium_borohydride_solution.fireColor = ["#34eb67","#5ceb34"]; +elements.sodium_borohydride.stateHigh = ["sodium_hydride","sodium","boron"]; + +delete elements["molten_sodium_borohydride"]; + +eLists.CAUSTIC.push("sodium_borohydride"); +eLists.CAUSTIC.push("sodium_borohydride_solution"); +elements.sodium_borohydride.ignore = defaultAcidIgnore.concat(eLists.CAUSTICIGNORE).concat(["sodium","molten_sodium","hydrogen","boron","trimethyl_borate"]); +elements.sodium_borohydride_solution.ignore = defaultAcidIgnore.concat(eLists.CAUSTICIGNORE).concat(["sodium","molten_sodium","hydrogen","boron","trimethyl_borate"]); +acidIgnore(["sodium_borohydride","sodium_borohydride_solution"]); elements.sodium_hydride.ignore.push(["sodium","molten_sodium","hydrogen","boron"]); -elements.sodium_tetrafluoroborate = { - color: ["#deded3","#ebebc7","#fcfced","#d9d9d9"], - tempHigh: 384, - behavior: behaviors.POWDER, - fireColor:["#34eb67","#5ceb34"], - category: "powders", - state: "solid", - hidden: true, - density: 2470, - stateHigh: ["sodium_fluoride","boron_trifluoride"], -}; +createSalt("sodium_tetrafluoroborate","sodium_tetrafluoroborate_solution",["#deded3","#ebebc7","#fcfced","#d9d9d9"],["#ababb7","#9d9dc1","#bdbdcb","#a8a898"],true,true,384,-2,102,2470,1012,"SODIUM","TETRAFLUOROBORATE"); -elements.fluoroboric_acid.ignore.push("sodium_tetrafluoroborate"); -elements.fluoroboric_acid_gas.ignore.push("sodium_tetrafluoroborate"); +elements.sodium_tetrafluoroborate.stateHigh = ["sodium_fluoride","boron_trifluoride"]; +elements.sodium_tetrafluoroborate.fireColor = ["#34eb67","#5ceb34"]; + +delete elements["molten_sodium_tetrafluoroborate"]; + +elements.fluoroboric_acid.ignore.push("sodium_tetrafluoroborate","sodium_tetrafluoroborate_solution"); +elements.fluoroboric_acid_gas.ignore.push("sodium_tetrafluoroborate","sodium_tetrafluoroborate_solution"); acidReact("sodium_hydride","boron_trifluoride","diborane","sodium_tetrafluoroborate",20); acidReact("sulfuric_acid","sodium_borohydride","diborane","hydrogen",50); @@ -3147,6 +3315,12 @@ elements.diborane = { stateHigh: ["pentaborane","pentaborane","decaborane"], }; + + +runAfterLoad(function() { + reactList("diborane", eLists.WATER, { elem1:"boric_acid", elem2:"hydrogen", temp1:100}); +}); + elements.liquid_diborane = { tempLow: -164, } @@ -3168,15 +3342,11 @@ elements.decaborane = { burnInto:"boron_trioxide", reactions:{ "oxygen": { elem1:"boron_trioxide", elem2:"fire" }, - "water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "salt_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "sugar_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "dirty_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "seltzer": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "pool_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "primordial_soup": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, } }; +runAfterLoad(function() { + reactList("decaborane", eLists.WATER, { elem1:"boric_acid", elem2:"hydrogen", temp1:100}); +}); elements.molten_decaborane = { behavior: behaviors.LIQUID, @@ -3186,20 +3356,18 @@ elements.molten_decaborane = { burnInto:"boron_trioxide", reactions:{ "oxygen": { elem1:"boron_trioxide", elem2:"fire" }, - "water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "salt_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "sugar_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "dirty_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "seltzer": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "pool_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, - "primordial_soup": { elem1:"boric_acid", elem2:"hydrogen", temp1:100}, }, fireColor:["#34eb67","#5ceb34"], category: "liquids", state: "liquid", hidden: true, + density: 900, } +runAfterLoad(function() { + reactList("molten_decaborane", eLists.WATER, { elem1:"boric_acid", elem2:"hydrogen", temp1:100}); +}); + elements.pentaborane = { @@ -3217,16 +3385,13 @@ elements.pentaborane = { burnInto:"explosion", reactions:{ "oxygen": { elem1:"boron_trioxide", elem2:"explosion" }, - "water": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "salt_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "sugar_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "dirty_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "seltzer": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "pool_water": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, - "primordial_soup": { elem1:"boric_acid", elem2:"hydrogen", temp1:200}, } }; +runAfterLoad(function() { + reactList("pentaborane", eLists.WATER, { elem1:"boric_acid", elem2:"hydrogen", temp1:100}); +}); + elements.pentaborane_gas = { tempHigh: 250, stateHigh: "decaborane", @@ -3253,6 +3418,11 @@ elements.sodium_octahydrotriborate = { stateHigh: "sodium_dodecaborate" }; +eListAddIon("SODIUM","sodium_octahydrotriborate"); +eListAddIon("OCTAHYDROTRIBORATE","sodium_octahydrotriborate"); +eListAdd("INSOLUBLE","sodium_octahydrotriborate"); + + elements.sodium_dodecaborate = { color: "#f5aef5", tempHigh: 700, //see above comment @@ -3267,6 +3437,12 @@ elements.sodium_dodecaborate = { burnInto: "boron_trioxide", }; +eListAddIon("SODIUM","sodium_dodecaborate"); +eListAddIon("DODECABORATE","sodium_dodecaborate"); +eListAdd("INSOLUBLE","sodium_dodecaborate"); +eListAddIon("SODIUM","molten_sodium_dodecaborate"); +eListAddIon("DODECABORATE","molten_sodium_dodecaborate"); + @@ -3286,7 +3462,1958 @@ elements.sodium_bromoheptahydrotriborate = { }; +eListAddIon("SODIUM","sodium_bromoheptahydrotriborate"); +eListAddIon("BROMOHEPTAHYDROTRIBORATE","sodium_bromoheptahydrotriborate"); +eListAdd("INSOLUBLE","sodium_bromoheptahydrotriborate"); +//elements.indium = { +// +//} + +//quit snooping around + + + +elements.uraninite = { + color: ["#545323","#50573b","#656660","#4d4933","#615e4a","#525043"], + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + tempHigh: 2865, + category: "land", + state: "solid", + density: 10970 +} + + +elements.yellowcake = { + color: ["#dbd827","#bce346","#a8c418","#d9bb1a","#dec418","#cfb615"], + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + tempHigh: 1150, + category: "powders", + hidden: true, + state: "solid", + density: 8300, + reactions: { + "hydrogen": { elem1:["uranium_dioxide","uranium_dioxide","uranium_dioxide","uranium_dioxide","thorium_dioxide"], elem2:"steam" }, + } +} + +elements.yellowcake_solution = { + color: "#d2ed6f", + ignore: elements.sulfuric_acid.ignore.concat(eLists.CAUSTICIGNORE).concat(["radiation","yellowcake","uraninite"]), + behavior: [ + "XX|DB%5 AND CR:radiation%0.05|XX", + "DB%5 AND M2 AND CR:radiation%0.05|XX|DB%5 AND M2 AND CR:radiation%0.05", + "DB%5 AND M2|DB%10 AND M1|DB%5 AND M2", + ], + tempHigh: 337, + category: "liquids", + stateHigh: ["sulfuric_acid_gas","yellowcake"], + state: "liquid", + hidden: true, + density: 1850, + reactions: {} +} + + +acidIgnore(["yellowcake_solution"]); +eLists.CAUSTIC.push("yellowcake_solution"); +eLists.ACID.push("yellowcake_solution"); + +acidReact("sulfuric_acid","uraninite","yellowcake_solution",null,50); +acidReact("sulfuric_acid_gas","uraninite","yellowcake","sulfuric_acid_gas",50); +acidReact("sulfuric_acid","yellowcake","yellowcake_solution","yellowcake_solution",50); + + +elements.alpha_particle = { + color: "#ff7878", + behavior: [ + "XX|XX|XX", + "XX|CH:helium%0.01 AND DL%0.25|XX", + "XX|XX|XX", + ], + reactions: { + "electric": { elem1:null, elem2:"helium", temp2:200 } + }, + tick: behaviors.BOUNCY, + temp: 35, + category: "energy", + state: "gas", + density: 0.00012, + ignoreAir: true +} + +elements.depleted_uranium = { + color: ["#599e61","#364d3c","#494d4a","#6c8a42","#798d65","#b5e089"], + behavior: [ + "XX|CR:alpha_particle%0.01|XX", + "CR:alpha_particle%0.01|CH:thorium%0.001|CR:alpha_particle%0.01", + "M2|M1|M2", + ], + reactions: { + "neutron": { elem2: null, func: depleted_uranium}, + "oxygen": { elem1:"depleted_uranium_dioxide", elem2: null, chance:0.1}, + "meat": { elem2:"rotten_meat", chance:0.1 }, + "cheese": { elem2:"rotten_cheese", chance:0.1 }, + "quark_matter": {elem1: "stable_uranium"} + }, + tempHigh: 1132.2, + category: "powders", + hidden: true, + state: "solid", + density: 19100, + hardness: 0.6, + conduct: 0.235 +} + +runAfterLoad(function() { + reactList("depleted_uranium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); + + + +elements.molten_depleted_uranium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:alpha_particle%0.01|XX", + "M2 AND CR:alpha_particle%0.01|XX|M2 AND CR:alpha_particle%0.01", + "M1|M1|M1", + ], + reactions: { + "neutron": { elem2: null, func:depleted_uranium}, + "quark_matter": {elem1: "stable_uranium"} + } +} + +elements.enriched_uranium = { + color: ["#599e61","#364d3c","#494d4a","#6c8a42","#798d65","#b5e089"], + behavior: [ + "XX|CR:radiation%2.5 AND CR:alpha_particle%0.1|XX", + "CR:radiation%2.5 AND CR:alpha_particle%0.1|CH:thorium%0.05 AND CH:protactinium%0.01|CR:radiation%2.5 AND CR:alpha_particle%0.1", + "M2|M1|M2", + ], + reactions: { + "neutron": { func:enriched_uranium, temp1: 150}, + "oxygen": { elem1:"enriched_uranium_dioxide", elem2: null, chance:0.1}, + "meat": { elem2:"rotten_meat", chance:0.1 }, + "cheese": { elem2:"rotten_cheese", chance:0.1 }, + "quark_matter": {elem1: "stable_uranium"} + }, + tempHigh: 1132.2, + category: "powders", + hidden: true, + state: "solid", + density: 19100, + hardness: 0.6, + conduct: 0.235, + excludeRandom: true +} + +runAfterLoad(function() { + reactList("enriched_uranium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); + +runAfterLoad(function() { + reactList("uranium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); + + + +elements.molten_enriched_uranium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%2.5 AND CR:alpha_particle%0.1|XX", + "M2 AND CR:radiation%2.5 AND CR:alpha_particle%0.1|XX|M2 AND CR:radiation%2.5 AND CR:alpha_particle%0.1", + "M1|M1|M1", + ], + reactions: { + "neutron": { func: enriched_uranium, temp1: 150}, + "quark_matter": {elem1: "stable_uranium"} + } +} +function enriched_uranium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "neptunium"); + } + elementCircle(p.x,p.y,2,"neutron"); +} + + +function depleted_uranium(pixel,p) { + if(Math.random() < 0.1) + { + changePixel(pixel, "plutonium"); + } +} + + +elements.stable_uranium = { + color: [blendColors("#599e61","#ff0000"),blendColors("#364d3c","#00ff00"),blendColors("#494d4a","#0000ff"),blendColors("#6c8a42","#ff0000"),blendColors("#798d65","#00ff00"),blendColors("#b5e089","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "oxygen": { elem1:"stable_uranium_dioxide", elem2: null, chance:0.1}, + "meat": { elem2:"rotten_meat", chance:0.1 }, + "cheese": { elem2:"rotten_cheese", chance:0.1 }, + "water": { elem2: "dirty_water", chance:0.25 } + }, + tempHigh: 1132.2, + category: "powders", + hidden: true, + state: "solid", + density: 19100, + hardness: 0.6, + conduct: 0.235, +}; +runAfterLoad(function() { + reactList("stable_uranium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); + +elements.uranium.reactions["oxygen"] = { elem1:"uranium_dioxide", elem2: null, chance:0.1}; +elements.uranium.reactions["quark_matter"] = { elem1:"stable_uranium"}; +elements.uranium.behavior = [ + "XX|CR:radiation%1 AND CR:alpha_particle%0.01|XX", + "CR:radiation%1 AND CR:alpha_particle%0.01|CH:thorium%0.001|CR:radiation%1 AND CR:alpha_particle%0.01", + "M2|M1|M2", + ]; +elements.molten_uranium.behavior = [ + "XX|CR:fire%2.5 AND CR:radiation%1 AND CR:alpha_particle%0.01|XX", + "M2 AND CR:radiation%1 AND CR:alpha_particle%0.01|XX|M2 AND CR:radiation%1 AND CR:alpha_particle%0.01", + "M1|M1|M1", + ]; +elements.molten_uranium.reactions["quark_matter"] = { elem1:"stable_uranium"}; + + +eListAddIon("URANIUMIV","uranium_dioxide"); +eListAddIon("OXIDE","uranium_dioxide"); +eListAdd("INSOLUBLE","uranium_dioxide"); +eListAddIon("ENRICHEDURANIUMIV","enriched_uranium_dioxide"); +eListAddIon("OXIDE","enriched_uranium_dioxide"); +eListAdd("INSOLUBLE","enriched_uranium_dioxide"); +eListAddIon("DEPLETEDURANIUMIV","depleted_uranium_dioxide"); +eListAddIon("OXIDE","depleted_uranium_dioxide"); +eListAdd("INSOLUBLE","depleted_uranium_dioxide"); +eListAddIon("STABLEURANIUMIV","stable_uranium_dioxide"); +eListAddIon("OXIDE","stable_uranium_dioxide"); +eListAdd("INSOLUBLE","stable_uranium_dioxide"); + +elements.uranium_dioxide = { + color: ["#474744","#21211f","#2b2b2b","#9c998c","#40403f","#24231d"], + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + reactions: { + "neutron": { temp1: 25}, + }, + tempHigh: 2865, + category: "powders", + state: "solid", + density: 10970 +} + + +elements.molten_uranium_dioxide = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.05|XX", + "M2 AND CR:radiation%0.05|XX|M2 AND CR:radiation%0.05", + "M1|M1|M1", + ], + reactions: { + "neutron": { temp1: 25} + } +} + + +elements.depleted_uranium_dioxide = { + color: ["#474744","#21211f","#2b2b2b","#9c998c","#40403f","#24231d"], + behavior: behaviors.POWDER, + reactions: { + "neutron": { elem2: null}, + }, + tempHigh: 2865, + category: "powders", + hidden: true, + state: "solid", + density: 10970 +} + + +elements.stable_uranium_dioxide = { + color: [blendColors("#474744","#ff0000"),blendColors("#21211f","#00ff00"),blendColors("#2b2b2b","#0000ff"),blendColors("#9c998c","#ff0000"),blendColors("#40403f","#00ff00"),blendColors("#24231d","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "neutron": { elem2: null} + }, + tempHigh: 2865, + category: "powders", + hidden: true, + state: "solid", + density: 10970 +}; + +elements.enriched_uranium_dioxide = { + color: ["#474744","#21211f","#2b2b2b","#9c998c","#40403f","#24231d"], + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "M2|M1|M2", + ], + reactions: { + "neutron": {func:function(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + } + elementCircle(p.x,p.y,2,"neutron"); + }, temp1: 150}, + }, + tempHigh: 2865, + category: "powders", + hidden: true, + state: "solid", + density: 10970 +}; + +elements.molten_enriched_uranium_dioxide = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.25|XX", + "M2 AND CR:radiation%0.25|XX|M2 AND CR:radiation%0.25", + "M1|M1|M1", + ], + reactions: { + "neutron": {func:function(pixel,p) {transmuteAround(pixel);changePixel(pixel, "n_explosion"); elementCircle(p.x,p.y,2,"neutron")}}, + } +}; + +function reduce(element, element2, result) { + if(element2 === "oxygen") { + + Object.assign(elements[element].reactions, { + "molten_magnesium": { elem1: result, elem2: "magnesium_oxide"}, + "molten_calcium": { elem1: result, elem2: "quicklime"}, + //"molten_sodium": { elem1: result, elem2: "sodium_oxide"}, + }); + } + if(element2 === "fluorine") { + + Object.assign(elements[element].reactions, { + "molten_magnesium": { elem1: result, elem2: "magnesium_fluoride"}, + "molten_calcium": { elem1: result, elem2: "fluorite"}, + "molten_sodium": { elem1: result, elem2: "sodium_fluoride"}, + "molten_sodium": { elem1: result, elem2: "potassium_fluoride"}, + }); + } +} + +reduce("uranium_dioxide", "oxygen", "uranium"); +reduce("enriched_uranium_dioxide", "oxygen", "enriched_uranium"); +reduce("depleted_uranium_dioxide", "oxygen", "depleted_uranium"); +reduce("stable_uranium_dioxide", "oxygen", "stable_uranium"); + + + +acidReact("hydrofluoric_acid","uranium_dioxide","uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid","depleted_uranium_dioxide","depleted_uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid","enriched_uranium_dioxide","enriched_uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid","stable_uranium_dioxide","stable_uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","uranium_dioxide","uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","depleted_uranium_dioxide","depleted_uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","enriched_uranium_dioxide","enriched_uranium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","stable_uranium_dioxide","stable_uranium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","uranium_dioxide","uranium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","depleted_uranium_dioxide","depleted_uranium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","enriched_uranium_dioxide","enriched_uranium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","stable_uranium_dioxide","stable_uranium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","uranium_dioxide","uranium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","depleted_uranium_dioxide","depleted_uranium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","enriched_uranium_dioxide","enriched_uranium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","stable_uranium_dioxide","stable_uranium_tetrafluoride","fire"); + +elements.hydrofluoric_acid.ignore.push("uranium_hexafluoride","enriched_uranium_hexafluoride","depleted_uranium_hexafluoride","stable_uranium_hexafluoride"); +elements.hydrofluoric_acid_gas.ignore.push("uranium_hexafluoride","enriched_uranium_hexafluoride","depleted_uranium_hexafluoride","stable_uranium_hexafluoride"); +elements.hydrogen_fluoride.ignore.push("uranium_hexafluoride","enriched_uranium_hexafluoride","depleted_uranium_hexafluoride","stable_uranium_hexafluoride"); +elements.liquid_hydrogen_fluoride.ignore.push("uranium_hexafluoride","enriched_uranium_hexafluoride","depleted_uranium_hexafluoride","stable_uranium_hexafluoride"); + + +eListAddIon("URANIUMIV","uranium_tetrafluoride"); +eListAddIon("FLUORIDE","uranium_tetrafluoride"); +eListAdd("INSOLUBLE","uranium_tetrafluoride"); +eListAddIon("ENRICHEDURANIUMIV","enriched_uranium_tetrafluoride"); +eListAddIon("FLUORIDE","enriched_uranium_tetrafluoride"); +eListAdd("INSOLUBLE","enriched_uranium_tetrafluoride"); +eListAddIon("DEPLETEDURANIUMIV","depleted_uranium_tetrafluoride"); +eListAddIon("FLUORIDE","depleted_uranium_tetrafluoride"); +eListAdd("INSOLUBLE","depleted_uranium_tetrafluoride"); +eListAddIon("STABLEURANIUMIV","stable_uranium_tetrafluoride"); +eListAddIon("FLUORIDE","stable_uranium_tetrafluoride"); +eListAdd("INSOLUBLE","stable_uranium_tetrafluoride"); + + +elements.uranium_tetrafluoride = { + color: ["#495747","#394d38","#5a7859"], + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + reactions: {}, + tempHigh: 1036, + category: "powders", + state: "solid", + density: 6700, + hidden: true +} + + +elements.molten_uranium_tetrafluoride = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.05|XX", + "M2 AND CR:radiation%0.05|XX|M2 AND CR:radiation%0.05", + "M1|M1|M1", + ] +} + + +elements.depleted_uranium_tetrafluoride = { + color: ["#495747","#394d38","#5a7859"], + behavior: behaviors.POWDER, + reactions: {}, + tempHigh: 1036, + category: "powders", + state: "solid", + density: 6700, + hidden: true +} + + +elements.stable_uranium_tetrafluoride = { + color: [blendColors("#495747","#ff0000"),blendColors("#394d38","#00ff00"),blendColors("#5a7859","#0000ff")], + behavior: behaviors.POWDER, + reactions: {}, + tempHigh: 1036, + category: "powders", + state: "solid", + density: 6700, + hidden: true +} + +elements.enriched_uranium_tetrafluoride = { + color: ["#495747","#394d38","#5a7859"], + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "M2|M1|M2", + ], + reactions: {}, + tempHigh: 1036, + category: "powders", + state: "solid", + density: 6700, + hidden: true +} + + +elements.molten_enriched_uranium_tetrafluoride = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.25|XX", + "M2 AND CR:radiation%0.25|XX|M2 AND CR:radiation%0.25", + "M1|M1|M1", + ] +} + + + +acidReact("fluorine","uranium_tetrafluoride","uranium_hexafluoride","fire"); +acidReact("fluorine","depleted_uranium_tetrafluoride","depleted_uranium_hexafluoride","fire"); +acidReact("fluorine","enriched_uranium_tetrafluoride","enriched_uranium_hexafluoride","fire"); +acidReact("fluorine","stable_uranium_tetrafluoride","stable_uranium_hexafluoride","fire"); +acidReact("liquid_fluorine","uranium_tetrafluoride","uranium_hexafluoride","fire"); +acidReact("liquid_fluorine","depleted_uranium_tetrafluoride","depleted_uranium_hexafluoride","fire"); +acidReact("liquid_fluorine","enriched_uranium_tetrafluoride","enriched_uranium_hexafluoride","fire"); +acidReact("liquid_fluorine","stable_uranium_tetrafluoride","stable_uranium_hexafluoride","fire"); + +reduce("uranium_tetrafluoride", "fluorine", "uranium"); +reduce("enriched_uranium_tetrafluoride", "fluorine", "enriched_uranium"); +reduce("depleted_uranium_tetrafluoride", "fluorine", "depleted_uranium"); +reduce("stable_uranium_tetrafluoride", "fluorine", "stable_uranium"); + + +eListAddIon("URANIUMVI","uranium_hexafluoride"); +eListAddIon("FLUORIDE","uranium_hexafluoride"); +eListAdd("INSOLUBLE","uranium_hexafluoride"); +eListAddIon("ENRICHEDURANIUMVI","enriched_uranium_hexafluoride"); +eListAddIon("FLUORIDE","enriched_uranium_hexafluoride"); +eListAdd("INSOLUBLE","enriched_uranium_hexafluoride"); +eListAddIon("DEPLETEDURANIUMVI","depleted_uranium_hexafluoride"); +eListAddIon("FLUORIDE","depleted_uranium_hexafluoride"); +eListAdd("INSOLUBLE","depleted_uranium_hexafluoride"); +eListAddIon("STABLEURANIUMVI","stable_uranium_hexafluoride"); +eListAddIon("FLUORIDE","stable_uranium_hexafluoride"); +eListAdd("INSOLUBLE","stable_uranium_hexafluoride"); + + +elements.uranium_hexafluoride = { + color: "#f7fff7", + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + reactions: { + "hydrogen": { elem1: "uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 56.5, + category: "powders", + state: "solid", + density: 5090, + stateHighName: "uranium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + + +elements.uranium_hexafluoride_gas = { + behavior: behaviors.GAS, + behavior2: [ + ["XX","CR:radiation%0.25","XX"], + ["CR:radiation%0.25","XX","CR:radiation%0.25"], + ["XX","CR:radiation%0.25","XX"] + ], + tick: function(pixel) { + pixelTick(pixel,elements[pixel.element].behavior2); + }, + state: "gas", + density: 12.84, + reactions: { + "hydrogen": { elem1: "uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + onCentrifuge: function(pixel) { + if(Math.random() < 0.05) { + if(Math.random() < 0.8) { + changePixel(pixel,"depleted_uranium_hexafluoride"); + } + else + { + changePixel(pixel,"enriched_uranium_hexafluoride"); + } + } + }, +} + + +elements.depleted_uranium_hexafluoride = { + color: "#f7fff7", + behavior: behaviors.POWDER, + reactions: { + "hydrogen": { elem1: "depleted_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 56.5, + category: "powders", + state: "solid", + density: 5090, + stateHighName: "depleted_uranium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + +elements.depleted_uranium_hexafluoride_gas = { + behavior: behaviors.GAS, + state: "gas", + density: 12.84, + reactions: { + "hydrogen": { elem1: "depleted_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, +} + + + +elements.stable_uranium_hexafluoride = { + color: [blendColors("#f7fff7","#ff0000"),blendColors("#f7fff7","#00ff00"),blendColors("#f7fff7","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "hydrogen": { elem1: "stable_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 56.5, + category: "powders", + state: "solid", + density: 5090, + stateHighName: "stable_uranium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + +elements.stable_uranium_hexafluoride_gas = { + behavior: behaviors.GAS, + state: "gas", + density: 12.84, + reactions: { + "hydrogen": { elem1: "stable_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, +} + + + +elements.enriched_uranium_hexafluoride = { + color: "#f7fff7", + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "M2|M1|M2", + ], + reactions: { + "hydrogen": { elem1: "enriched_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 56.5, + category: "powders", + state: "solid", + density: 5090, + stateHighName: "enriched_uranium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + +elements.enriched_uranium_hexafluoride_gas = { + behavior: behaviors.GAS, + behavior2: [ + ["XX","CR:radiation%0.25","XX"], + ["CR:radiation%0.25","XX","CR:radiation%0.25"], + ["XX","CR:radiation%0.25","XX"] + ], + tick: function(pixel) { + pixelTick(pixel,elements[pixel.element].behavior2); + }, + reactions: { + "hydrogen": { elem1: "enriched_uranium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + state: "gas", + density: 12.84 +} + +runAfterLoad(function() { + reactList("uranium_hexafluoride", eLists.WATER, { "elem1": "uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("depleted_uranium_hexafluoride", eLists.WATER, { "elem1": "depleted_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("enriched_uranium_hexafluoride", eLists.WATER, { "elem1": "enriched_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("stable_uranium_hexafluoride", eLists.WATER, { "elem1": "stable_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("uranium_hexafluoride_gas", eLists.WATER, { "elem1": "uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("depleted_uranium_hexafluoride_gas", eLists.WATER, { "elem1": "depleted_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("enriched_uranium_hexafluoride_gas", eLists.WATER, { "elem1": "enriched_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("stable_uranium_hexafluoride_gas", eLists.WATER, { "elem1": "stable_uranium_tetrafluoride", elem2: "hydrofluoric_acid" }); +}); + +elements.radium = { + color: "#3bdeff", + behavior: [ + "XX|CR:radiation%10|XX", + "CR:radiation%10|CH:radon%0.1|CR:radiation%10", + "M2|M1|M2", + ], + tick: function(pixel) { + pixel.temp += 1; + }, + reactions: { + "quark_matter": { "elem1":"stable_radium"}, + }, + tempHigh: 700, + category: "powders", + state: "solid", + density: 5500, + conduct: 0.40, +}; + + +runAfterLoad(function() { + reactList("radium", eLists.WATER, { "elem1": ["radium_water","rad_pop"], elem2:["hydrogen","bubble"], chance:0.05, temp2:350, func:radiumWater }); +}); + +elements.molten_radium = { + behavior: [ + "XX|CR:radiation%10|XX", + "M2 AND CR:radiation%10|CH:radon%0.01|M2 AND CR:radiation%10", + "M1|M1|M1", + ], + tick: function(pixel) { + pixel.temp += 1; + }, + reactions: { + "quark_matter": { "elem1":"stable_radium"}, + }, + conduct: 0.40 +} + +runAfterLoad(function() { + reactList("molten_radium", eLists.WATER, { "elem1": ["radium_water","rad_pop"], elem2:["hydrogen","bubble"], chance:0.05, temp2:350, func:radiumWater }); +}); + +function radiumWater(pixel,p) { + elementCircle(pixel.x,pixel.y,15,"radium_water",0.1,eLists.WATER); +} + +elements.radium_water = { + color: "#3bc4ff", + behavior: [ + "XX|CR:radiation%0.05|XX", + "M2 AND CR:radiation%0.05|XX|M2 AND CR:radiation%0.05", + "M1|M1|M1", + ], + reactions: { + "head": { elem2:null, chance:0.4 }, + }, + tempHigh: 100, + stateHigh: "rad_steam", + state: "liquid", + density: 1100, + category: "liquids", + hidden: true, + tempLow: 0 +} + +eListAdd("WATER","radium_water"); + +elements.actinium = { + color: "#62ebf0", + behavior: [ + "XX|CR:alpha_particle%0.1 AND CR:radiation%10|XX", + "CR:alpha_particle%0.1 AND CR:radiation%10|CH:radium%0.02|CR:alpha_particle%0.1 AND CR:radiation%10", + "M2|M1|M2", + ], + tick: function(pixel) { + pixel.temp += 2.5; + }, + reactions: { + "quark_matter": { "elem1":"stable_actinium"} + }, + tempHigh: 1227, + category: "powders", + state: "solid", + density: 10000, + conduct: 0.225 +}; +elements.molten_actinium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:alpha_particle%0.1 AND CR:radiation%10|XX", + "M2 AND CR:alpha_particle%0.1 AND CR:radiation%10|CH:radium%0.02|M2 AND CR:alpha_particle%0.1 AND CR:radiation%10", + "M1|M1|M1", + ], + tick: function(pixel) { + pixel.temp += 2.5; + }, + reactions: { + "quark_matter": { "elem1":"stable_actinium"} + }, + conduct: 0.225 +} + +elements.thorium = { + color: ["#599e8a","#364d4b","#494d4c","#428a58","#658d7a","#89e0a2"], + behavior: [ + "XX|CR:alpha_particle%0.01|XX", + "CR:alpha_particle%0.01|CH:lead%0.001|CR:alpha_particle%0.01", + "XX|CR:alpha_particle%0.01|XX", + ], + reactions: { + "neutron": { temp1: 100, func:function(pixel,p) {if(Math.random() < 0.1) {changePixel(pixel, "radium"); elementCircle(p.x,p.y,2,"neutron");}}}, + "oxygen": { elem1:"thorium_dioxide", elem2: null, chance:0.1}, + "quark_matter": {elem1: "stable_thorium"} + }, + tempHigh: 1750, + category: "solids", + state: "solid", + density: 11700, + hardness: 0.7, + conduct: 0.235 +}; +elements.molten_thorium = { + behavior: [ + "XX|CR:alpha_particle%0.01|XX", + "M2 AND CR:alpha_particle%0.01|XX|M2 AND CR:alpha_particle%0.01", + "M1|M1|M1", + ], + reactions: { + "neutron": { temp1: 100, func:function(pixel,p) {if(Math.random() < 0.1) {changePixel(pixel, "radium"); elementCircle(p.x,p.y,2,"neutron");}}}, + "oxygen": { elem1:"thorium_dioxide", elem2: null}, + "quark_matter": {elem1: "stable_thorium"} + } +} + +elements.protactinium = { + color: ["#9899a3","#44464a","#5a5b5e"], + behavior: [ + "XX|CR:alpha_particle%0.01 AND CR:radiation%2|XX", + "CR:alpha_particle%0.01 AND CR:radiation%2|CH:actinium%0.01|CR:alpha_particle%0.01 AND CR:radiation%2", + "M2|M1|M2", + ], + reactions: { + "quark_matter": {elem1: "stable_protactinium"} + }, + tempHigh: 1568, + category: "powders", + state: "solid", + density: 15700, + hardness: 0.1, + conduct: 0.235 +} + +elements.molten_protactinium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:alpha_particle%0.01 AND CR:radiation%2|XX", + "M2 AND CR:alpha_particle%0.01 AND CR:radiation%2|CH:actinium%0.01|M2 AND CR:alpha_particle%0.01 AND CR:radiation%2", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_protactinium"} + } +} + + + +elements.neptunium = { + color: ["#626580","#3f4a61","#4a5463"], + behavior: [ + "XX|CR:neutron%0.1 AND CR:radiation%2|XX", + "CR:neutron%0.1 AND CR:radiation%2|CH:thorium%0.025|CR:neutron%0.1 AND CR:radiation%2", + "XX|CR:neutron%0.1 AND CR:radiation%2|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_neptunium"}, + "neutron": {func:fissile, temp1: 150} + }, + tempHigh: 639, + category: "solids", + state: "solid", + density: 19380, + hardness: 0.7, + conduct: 0.2 +} + +elements.molten_neptunium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%0.1 AND CR:radiation%2|XX", + "M2 AND CR:neutron%0.1 AND CR:radiation%2|CH:thorium%0.025|M2 AND CR:neutron%0.1 AND CR:radiation%2", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_neptunium"}, + "neutron": {func:fissile, temp1: 150} + } +} + +function fissile(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + } + elementCircle(p.x,p.y,2,"neutron"); +} + + +elements.plutonium = { + color: ["#5fc29f","#5d9e7d","#5b7d6b"], + behavior: [ + "XX|CR:neutron%0.05 AND CR:radiation%2|XX", + "CR:neutron%0.05 AND CR:radiation%2|CH:enriched_uranium%0.025|CR:neutron%0.05 AND CR:radiation%2", + "XX|CR:neutron%0.05 AND CR:radiation%2|XX", + ], + reactions: { + "oxygen": { elem1:"plutonium_dioxide", elem2: null}, + "quark_matter": {elem1: "stable_plutonium"}, + "neutron": {func:plutonium, temp1: 150} + }, + tempHigh: 639, + category: "solids", + state: "solid", + density: 19850, + hardness: 0.7, + conduct: 0.2 +} +elements.stable_plutonium = { + color: [blendColors("#5fc29f","#ff0000"),blendColors("#5d9e7d","#00ff00"),blendColors("#5b7d6b","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "oxygen": { elem1:"stable_plutonium_dioxide", elem2: null} + }, + tempHigh: 639, + category: "solids", + state: "solid", + density: 19850, + hardness: 0.7, + conduct: 0.2, + hidden: true +}; + +runAfterLoad(function() { + reactList("plutonium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); +runAfterLoad(function() { + reactList("stable_plutonium", eLists.WATER, { elem2: "dirty_water", chance:0.25 }); +}); + +elements.plutonium_dioxide = { + color: ["#edcf47","#c7a924","#e3c129"], + behavior: [ + "XX|CR:radiation%0.25|XX", + "CR:radiation%0.25|XX|CR:radiation%0.25", + "M2|M1|M2", + ], + reactions: { + "neutron": {func:function(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + } + elementCircle(p.x,p.y,2,"neutron"); + }, temp1: 150}, + }, + tempHigh: 2744, + category: "powders", + hidden: true, + state: "solid", + density: 11500 +}; + +elements.molten_plutonium_dioxide = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.25|XX", + "M2 AND CR:radiation%0.25|XX|M2 AND CR:radiation%0.25", + "M1|M1|M1", + ], + reactions: { + "neutron": {func:function(pixel,p) {transmuteAround(pixel);changePixel(pixel, "n_explosion"); elementCircle(p.x,p.y,2,"neutron")}}, + } +}; +elements.stable_plutonium_dioxide = { + color: [blendColors("#edcf47","#ff0000"),blendColors("#c7a924","#00ff00"),blendColors("#e3c129","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "neutron": { elem2: null} + }, + tempHigh: 2744, + category: "powders", + hidden: true, + state: "solid", + density: 11500 +}; + +reduce("plutonium_dioxide", "oxygen", "plutonium"); +reduce("stable_plutonium_dioxide", "oxygen", "stable_plutonium"); + + + +acidReact("hydrofluoric_acid","plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid","stable_plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","stable_plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","stable_plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","plutonium_dioxide","plutonium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","stable_plutonium_dioxide","plutonium_tetrafluoride","fire"); + +elements.hydrofluoric_acid.ignore.push("plutonium_hexafluoride","stable_plutonium_hexafluoride"); +elements.hydrofluoric_acid_gas.ignore.push("plutonium_hexafluoride","stable_plutonium_hexafluoride"); +elements.hydrogen_fluoride.ignore.push("plutonium_hexafluoride","stable_plutonium_hexafluoride"); +elements.liquid_hydrogen_fluoride.ignore.push("plutonium_hexafluoride","stable_plutonium_hexafluoride"); + +eListAddIon("PLUTONIUMIV","plutonium_tetrafluoride"); +eListAddIon("FLUORIDE","plutonium_tetrafluoride"); +eListAdd("INSOLUBLE","plutonium_tetrafluoride"); +eListAddIon("STABLEPLUTONIUMIV","stable_plutonium_tetrafluoride"); +eListAddIon("FLUORIDE","stable_plutonium_tetrafluoride"); +eListAdd("INSOLUBLE","stable_plutonium_tetrafluoride"); + + +elements.plutonium_tetrafluoride = { + color: ["#a13d0b","#85401d","#733211"], + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + reactions: {}, + tempHigh: 1027, + category: "powders", + state: "solid", + density: 7100, + hidden: true +} + + +elements.molten_plutonium_tetrafluoride = { + behavior: [ + "XX|CR:fire%2.5 AND CR:radiation%0.05|XX", + "M2 AND CR:radiation%0.05|XX|M2 AND CR:radiation%0.05", + "M1|M1|M1", + ] +} + + +elements.stable_plutonium_tetrafluoride = { + color: [blendColors("#a13d0b","#ff0000"),blendColors("#85401d","#00ff00"),blendColors("#733211","#0000ff")], + behavior: behaviors.POWDER, + reactions: {}, + tempHigh: 1027, + category: "powders", + state: "solid", + density: 7100, + hidden: true +} + +acidReact("fluorine","plutonium_tetrafluoride","plutonium_hexafluoride","fire"); +acidReact("fluorine","stable_plutonium_tetrafluoride","stable_plutonium_hexafluoride","fire"); +acidReact("liquid_fluorine","plutonium_tetrafluoride","plutonium_hexafluoride","fire"); +acidReact("liquid_fluorine","stable_plutonium_tetrafluoride","stable_plutonium_hexafluoride","fire"); +acidReact("foof","plutonium_tetrafluoride","plutonium_hexafluoride",null); +acidReact("foof","stable_plutonium_tetrafluoride","stable_plutonium_hexafluoride",null); + +reduce("plutonium_tetrafluoride", "fluorine", "plutonium"); +reduce("stable_plutonium_tetrafluoride", "fluorine", "stable_plutonium"); + + +eListAddIon("PLUTONIUMVI","plutonium_hexafluoride"); +eListAddIon("FLUORIDE","plutonium_hexafluoride"); +eListAdd("INSOLUBLE","plutonium_hexafluoride"); +eListAddIon("STABLEPLUTONIUMVI","stable_plutonium_hexafluoride"); +eListAddIon("FLUORIDE","stable_plutonium_hexafluoride"); +eListAdd("INSOLUBLE","stable_plutonium_hexafluoride"); + + +elements.plutonium_hexafluoride = { + color: "#6e2602", + behavior: [ + "XX|CR:radiation%0.05|XX", + "CR:radiation%0.05|XX|CR:radiation%0.05", + "M2|M1|M2", + ], + reactions: { + "hydrogen": { elem1: "plutonium_hexafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 62.5, + category: "powders", + state: "solid", + density: 5080, + stateHighName: "plutonium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + + +elements.plutonium_hexafluoride_gas = { + behavior: behaviors.GAS, + behavior2: [ + ["XX","CR:radiation%0.25","XX"], + ["CR:radiation%0.25","XX","CR:radiation%0.25"], + ["XX","CR:radiation%0.25","XX"] + ], + tick: function(pixel) { + pixelTick(pixel,elements[pixel.element].behavior2); + }, + state: "gas", + density: 14.88, + reactions: { + "hydrogen": { elem1: "plutonium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, +} + + +elements.stable_plutonium_hexafluoride = { + color: [blendColors("#6e2602","#ff0000"),blendColors("#6e2602","#00ff00"),blendColors("#6e2602","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "hydrogen": { elem1: "stable_plutonium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 62.5, + category: "powders", + state: "solid", + density: 5080, + stateHighName: "stable_plutonium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + +elements.stable_plutonium_hexafluoride_gas = { + behavior: behaviors.GAS, + state: "gas", + density: 14.88, + reactions: { + "hydrogen": { elem1: "stable_plutonium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, +} + + + +runAfterLoad(function() { + reactList("plutonium_hexafluoride", eLists.WATER, { "elem1": "plutonium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("stable_plutonium_hexafluoride", eLists.WATER, { "elem1": "stable_plutonium_tetrafluoride", elem2: "hydrofluoric_acid" }); +}); + + +elements.molten_plutonium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%0.05 AND CR:radiation%2|XX", + "M2 AND CR:neutron%0.05 AND CR:radiation%2|CH:enriched_uranium%0.025|M2 AND CR:neutron%0.05 AND CR:radiation%2", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_plutonium"}, + "neutron": {func:plutonium, temp1: 150} + } +} + + +function plutonium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "americium"); + } + elementCircle(p.x,p.y,2,"neutron"); +} + +elements.americium = { + color: ["#42ebaf","#59d998","#d0dbd5"], + behavior: [ + "XX|CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2|XX", + "CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2|CH:neptunium%0.05 AND CH:plutonium%0.05|CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2", + "XX|CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_americium"}, + "neutron": {func:americium, temp1: 150} + }, + tempHigh: 1176, + category: "solids", + state: "solid", + density: 12000, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_americium = { + color: [blendColors("#42ebaf","#ff0000"),blendColors("#59d998","#00ff00"),blendColors("#d0dbd5","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 1176, + category: "solids", + state: "solid", + density: 12000, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_americium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2|XX", + "M2 AND CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2|CH:neptunium%0.05 AND CH:plutonium%0.05|M2 AND CR:neutron%0.1 AND CR:radiation%2 AND CR:alpha_particle%2", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_americium"}, + "neutron": {func:americium, temp1: 150} + } +} + +function americium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "curium"); + } + elementCircle(p.x,p.y,2,"neutron"); +} + + +elements.curium = { + color: ["#fab1f1","#d6c9d5","#e0b1d6"], + behavior: [ + "XX|CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1|CH:plutonium%0.075|CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1", + "XX|CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_curium"}, + "neutron": {func:curium, temp1: 175} + }, + tempHigh: 1340, + category: "solids", + state: "solid", + density: 13510, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_curium = { + color: [blendColors("#fab1f1","#ff0000"),blendColors("#d6c9d5","#00ff00"),blendColors("#e0b1d6","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 1340, + category: "solids", + state: "solid", + density: 13510, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_curium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "M2 AND CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1|CH:plutonium%0.075|M2 AND CR:neutron%0.5 AND CR:radiation%1 AND CR:alpha_particle%1", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_curium"}, + "neutron": {func:curium, temp1: 150} + } +} + +function curium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "berkelium"); + } + elementCircle(p.x,p.y,2,"neutron"); +} + + +elements.berkelium = { + color: ["#f2edfa","#bdbccf","#d7cae8"], + behavior: [ + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:californium%0.075|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_berkelium"}, + "neutron": {func:berkelium, temp1: 175} + }, + tempHigh: 986, + category: "solids", + state: "solid", + density: 13250, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_berkelium = { + color: [blendColors("#f2edfa","#ff0000"),blendColors("#bdbccf","#00ff00"),blendColors("#d7cae8","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 986, + category: "solids", + state: "solid", + density: 13250, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_berkelium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:californium%0.075|M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_berkelium"}, + "neutron": {func:berkelium, temp1: 150} + } +} + +function berkelium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "californium"); + } + elementCircle(p.x,p.y,2,"neutron",0.2); +} + + +elements.californium = { + color: ["#dfd0f7","#bcbade","#b99be0"], + behavior: [ + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:curium%0.05 AND CH:einsteinium%0.05|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_californium"}, + "neutron": {func:californium, temp1: 175} + }, + tempHigh: 900 , + category: "solids", + state: "solid", + density: 15100, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_californium = { + color: [blendColors("#dfd0f7","#ff0000"),blendColors("#bcbade","#00ff00"),blendColors("#b99be0","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 900 , + category: "solids", + state: "solid", + density: 15100, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_californium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:curium%0.05 AND CH:einsteinium%0.05|M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_californium"}, + "neutron": {func:californium, temp1: 150} + } +} + +function californium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "einsteinium"); + } + elementCircle(p.x,p.y,2,"neutron",0.25); +} + + +elements.einsteinium = { + color: ["#3aa6c2","#b8edf1","#83d9e4"], + behavior: [ + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:berkelium%0.05 AND CH:fermium%0.05|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_einsteinium"}, + "neutron": {func:einsteinium, temp1: 175} + }, + tempHigh: 1133, + category: "solids", + state: "solid", + density: 8840, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_einsteinium = { + color: [blendColors("#3aa6c2","#ff0000"),blendColors("#b8edf1","#00ff00"),blendColors("#83d9e4","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 1133, + category: "solids", + state: "solid", + density: 8840, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_einsteinium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:berkelium%0.05 AND CH:fermium%0.05|M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_einsteinium"}, + "neutron": {func:einsteinium, temp1: 150} + } +} + +function einsteinium(pixel,p) { + if(pixel.temp >= 500) + { + transmuteAround(pixel); + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + if(Math.random() < 0.1) + { + changePixel(pixel, "fermium"); + } + elementCircle(p.x,p.y,3,"neutron"); +} + + +elements.fermium = { + color: ["#c8a7fc","#cecbf2","#d5bff2"], + behavior: [ + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:californium%0.1|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "XX|CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + ], + reactions: { + "quark_matter": {elem1: "stable_fermium"}, + "neutron": {func:fermium, temp1: 175} + }, + tempHigh: 1800, + category: "solids", + state: "solid", + density: 9710, + hardness: 0.9, + conduct: 0.2 +} + +elements.stable_fermium = { + color: [blendColors("#c8a7fc","#ff0000"),blendColors("#cecbf2","#00ff00"),blendColors("#d5bff2","#0000ff")], + behavior: behaviors.WALL, + tempHigh: 1800, + category: "solids", + state: "solid", + density: 9710, + hardness: 0.9, + conduct: 0.2, + hidden: true +} + +elements.molten_fermium = { + behavior: [ + "XX|CR:fire%2.5 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|XX", + "M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1|CH:californium%0.1|M2 AND CR:neutron%1 AND CR:radiation%1 AND CR:alpha_particle%1", + "M1|M1|M1", + ], + reactions: { + "quark_matter": {elem1: "stable_fermium"}, + "neutron": {func:fermium, temp1: 150} + } +} + +function fermium(pixel,p) { + if(pixel.temp >= 500) + { + changePixel(pixel, "n_explosion"); + elementCircle(p.x,p.y,5,"neutron"); + } + elementCircle(p.x,p.y,3,"neutron",0.2); +} + + +function transmuteAround(pixel) { + elementCircle(pixel.x,pixel.y,40,"radium",0.1,["thorium","molten_thorium"]); + elementCircle(pixel.x,pixel.y,40,"plutonium",0.1,["depleted_uranium","molten_depleted_uranium"]); + elementCircle(pixel.x,pixel.y,40,"neptunium",0.1,["enriched_uranium","molten_enriched_uranium"]); + elementCircle(pixel.x,pixel.y,40,"americium",0.1,["plutonium","molten_plutonium"]); + elementCircle(pixel.x,pixel.y,40,"curium",0.1,["americium","molten_americium"]); + elementCircle(pixel.x,pixel.y,40,"berkelium",0.1,["curium","molten_curium"]); + elementCircle(pixel.x,pixel.y,40,"californium",0.1,["berkelium","molten_berkelium"]); + elementCircle(pixel.x,pixel.y,40,"einsteinium",0.1,["californium","molten_californium"]); + elementCircle(pixel.x,pixel.y,40,"fermium",0.1,["einsteinium","molten_einsteinium"]); +} + + + +function elementCircle(x,y,radius,pixelType="fire",chance = 0.1,replace = [null]) { + + if (!Array.isArray(replace)) { + replace = [replace] + } + // if pixelType includes , split it into an array + if (pixelType.indexOf(",") !== -1) { + pixelType = pixelType.split(","); + } + var coords = circleCoords(x,y,radius); + for (var i = 0; i < coords.length; i++) { + if (isEmpty(coords[i].x,coords[i].y) && replace.includes(null)) { + if (Math.random() > chance) { } // do nothing + else { + // if pixelType is an array, choose a random item + if (Array.isArray(pixelType)) { + createPixel(pixelType[Math.floor(Math.random() * pixelType.length)],coords[i].x,coords[i].y); + } + else { + createPixel(pixelType,coords[i].x,coords[i].y); + } + } + } + if (!isEmpty(coords[i].x,coords[i].y, true) && replace.includes(pixelMap[coords[i].x][coords[i].y].element)) { + if (Math.random() > chance) { } // do nothing + else { + // if pixelType is an array, choose a random item + if (Array.isArray(pixelType)) { + changePixel(pixelMap[coords[i].x][coords[i].y],pixelType[Math.floor(Math.random() * pixelType.length)]); + } + else { + changePixel(pixelMap[coords[i].x][coords[i].y],pixelType); + } + } + } + } +} + + + +elements.thorium_dioxide = { + color: ["#313331","#1a1a18","#171717","#24231d","#262622","#171613"], + behavior: [ + "XX|CR:radiation%0.01|XX", + "CR:radiation%0.01|XX|CR:radiation%0.01", + "M2|M1|M2", + ], + reactions: {}, + hidden: true, + tempHigh: 2865, + category: "powders", + state: "solid", + density: 10970 +} + +elements.stable_thorium_dioxide = { + color: [blendColors("#313331","#ff0000"),blendColors("#1a1a18","#00ff00"),blendColors("#171717","#0000ff"),blendColors("#24231d","#ff0000"),blendColors("#262622","#00ff00"),blendColors("#171613","#0000ff")], + behavior: behaviors.POWDER, + reactions: {}, + hidden: true, + tempHigh: 2865, + category: "powders", + state: "solid", + density: 10970 +} + +eListAddIon("THORIUMIV","thorium_dioxide"); +eListAddIon("OXIDE","thorium_dioxide"); +eListAdd("INSOLUBLE","thorium_dioxide"); +eListAddIon("STABLETHORIUMIV","stable_thorium_dioxide"); +eListAddIon("OXIDE","stable_thorium_dioxide"); +eListAdd("INSOLUBLE","stable_thorium_dioxide"); + +acidReact("hydrofluoric_acid","thorium_dioxide","thorium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid","stable_thorium_dioxide","stable_thorium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","thorium_dioxide","thorium_tetrafluoride","fire"); +acidReact("hydrofluoric_acid_gas","stable_thorium_dioxide","stable_thorium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","thorium_dioxide","thorium_tetrafluoride","fire"); +acidReact("hydrogen_fluoride","stable_thorium_dioxide","stable_thorium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","thorium_dioxide","thorium_tetrafluoride","fire"); +acidReact("liquid_hydrogen_fluoride","stable_thorium_dioxide","stable_thorium_tetrafluoride","fire"); + + +elements.thorium_tetrafluoride = { + color: "#e5e6e5", + behavior: [ + "XX|CR:radiation%0.01|XX", + "CR:radiation%0.01|XX|CR:radiation%0.01", + "M2|M1|M2", + ], + reactions: {}, + hidden: true, + tempHigh: 1110, + category: "powders", + state: "solid", + density: 6300 +} + +elements.stable_thorium_tetrafluoride = { + color: [blendColors("#e5e6e5","#ff0000"),blendColors("#e5e6e5","#00ff00"),blendColors("#e5e6e5","#0000ff")], + behavior: behaviors.POWDER, + reactions: {}, + hidden: true, + tempHigh: 1110, + category: "powders", + state: "solid", + density: 6300 +} + +eListAddIon("THORIUMIV","thorium_tetrafluoride"); +eListAddIon("OXIDE","thorium_tetrafluoride"); +eListAdd("INSOLUBLE","thorium_tetrafluoride"); +eListAddIon("STABLETHORIUMIV","stable_thorium_tetrafluoride"); +eListAddIon("OXIDE","stable_thorium_tetrafluoride"); +eListAdd("INSOLUBLE","stable_thorium_tetrafluoride"); + +reduce("thorium_dioxide", "oxygen", "thorium"); +reduce("stable_thorium_dioxide", "oxygen", "stable_thorium"); +reduce("thorium_tetrafluoride", "fluorine", "thorium"); +reduce("stable_thorium_tetrafluoride", "fluorine", "stable_thorium"); + + +elements.stable_thorium = { + color: [blendColors("#599e8a","#ff0000"),blendColors("#364d4b","#00ff00"),blendColors("#494d4c","#0000ff"),blendColors("#428a58","#ff0000"),blendColors("#658d7a","#00ff00"),blendColors("#89e0a2","#0000ff")], + behavior: behaviors.WALL, + reactions: { + "oxygen": { elem1:"stable_thorium_dioxide", elem2: null} + }, + tempHigh: 1750, + category: "solids", + state: "solid", + hidden: true, + density: 11700, + hardness: 0.7, + conduct: 0.235 +}; +elements.molten_stable_thorium = { + reactions: { + "oxygen": { elem1:"stable_thorium_dioxide", elem2: null} + } +} + +elements.stable_radium = { + color: [blendColors("#3bdeff","#ff0000"),blendColors("#3bdeff","#00ff00"),blendColors("#3bdeff","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "oxygen": { "elem1":"radium_oxide"}, + }, + tempHigh: 700, + category: "powders", + state: "solid", + density: 5500, + hidden: true, + conduct: 0.40 +}; + + +elements.radium_oxide = { + color: [blendColors("#b2d9d9","#ff0000",0.25),blendColors("#b2d9d9","#00ff00",0.25),blendColors("#b2d9d9","#0000ff",0.25)], + behavior: behaviors.POWDER, + reactions: {}, + hidden: true, + tempHigh: 2327, + category: "powders", + state: "solid", + density: 12000, +}; + + +eListAddIon("RADIUM","radium_oxide"); +eListAddIon("OXIDE","radium_oxide"); +eListAdd("INSOLUBLE","radium_oxide"); + + +elements.radium_hydroxide = { + color: [blendColors("#f2fafa","#ff0000",0.25),blendColors("#f2fafa","#00ff00",0.25),blendColors("#f2fafa","#0000ff",0.25)], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 600, + reactions: {}, + stateHigh: "radium_oxide", + category: "powders", + state: "solid", + density: 12000, +}; + +eListAdd("BASE","radium_hydroxide"); +eListAddIon("RADIUM","radium_hydroxide","base"); +eListAddIon("HYDROXIDE","radium_hydroxide","base"); +eListAdd("INSOLUBLE","radium_hydroxide"); + +createSalt("radium_chloride","radium_chloride_solution",[blendColors("#faf3de","#ff0000",0.25),blendColors("#faf3de","#00ff00",0.25),blendColors("#faf3de","#0000ff",0.25)],[blendColors("#8eadef","#ff0000",0.25),blendColors("#8eadef","#00ff00",0.25),blendColors("#8eadef","#0000ff",0.25)],true,true,900,-2,102,4900,1050,"RADIUM","CHLORIDE"); + +elements.radium_chloride_solution.reactions["mercury"] = { elem1:["stable_radium","chlorine","hydrogen"], charged:true, chance:0.02 }; + + + +elements.molten_stable_radium = { + reactions: { + "oxygen": { "elem1":"radium_oxide"}, + }, + conduct: 0.40 +}; + +runAfterLoad(function() { + reactList("radium_oxide", eLists.WATER, { "elem1": "radium_hydroxide", "elem2": null, chance:0.01 }); + reactList("stable_radium", eLists.WATER, { "elem1": ["radium_hydroxide","pop"], elem2:["hydrogen","bubble"], chance:0.05, temp2:350 }); + reactList("molten_stable_radium", eLists.WATER, { "elem1": ["radium_hydroxide","pop"], elem2:["hydrogen","bubble"], chance:0.05, temp2:350 }); +}); + +elements.stable_actinium = { + color: [blendColors("#e5e6e5","#ff0000",0.25),blendColors("#62ebf0","#00ff00"),blendColors("#62ebf0","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "oxygen": { "elem1":"actinium_oxide"}, + }, + hidden: true, + tempHigh: 1227, + category: "powders", + state: "solid", + density: 10000, + conduct: 0.225 +}; +elements.molten_stable_actinium = { + reactions: { + "oxygen": { "elem1":"actinium_oxide"}, + }, + conduct: 0.225 +}; + + +runAfterLoad(function() { + reactList("stable_actinium", eLists.WATER, { "elem1": "actinium_hydroxide", "elem2": "hydrogen", chance:0.01 }); + reactList("molten_stable_actinium", eLists.WATER, { "elem1": "actinium_hydroxide", "elem2": "hydrogen", chance:0.01 }); +}); + + +elements.actinium_oxide = { + color: [blendColors("#ebf5f5","#ff0000",0.25),blendColors("#ebf5f5","#00ff00",0.25),blendColors("#ebf5f5","#0000ff",0.25)], + behavior: behaviors.POWDER, + reactions: { + "water": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "salt_water": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "sugar_water": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "dirty_water": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "steam": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "seltzer": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "pool_water": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + "primordial_soup": { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }, + }, + hidden: true, + tempHigh: 2327, + category: "powders", + state: "solid", + density: 12000, +}; + +runAfterLoad(function() { + reactList("actinium_oxide", eLists.WATER, { "elem1": "actinium_hydroxide", "elem2": null, chance:0.01 }); +}); + + + +elements.actinium_hydroxide = { + color: [blendColors("#f2cef2","#ff0000",0.25),blendColors("#f2cef2","#00ff00",0.25),blendColors("#f2cef2","#0000ff",0.25)], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 350, + stateHigh: ["actinium_oxide","steam"], + category: "powders", + state: "solid", + density: 12000, +}; + + +eListAdd("BASE","actinium_hydroxide"); +eListAddIon("ACTINIUM","actinium_hydroxide","base"); +eListAddIon("HYDROXIDE","actinium_hydroxide","base"); +eListAdd("INSOLUBLE","actinium_hydroxide"); + +reduce("actinium_oxide", "oxygen", "stable_actinium"); + + +elements.stable_protactinium = { + color: [blendColors("#9899a3","#ff0000"),blendColors("#44464a","#00ff00"),blendColors("#5a5b5e","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "oxygen": { "elem1":"protactinium_v_oxide", chance:0.01}, + "steam": { "elem1": "protactinium_hydroxide", "elem2": "hydrogen", chance:0.01 }, + }, + + tempHigh: 1568, + category: "powders", + state: "solid", + density: 15700, + hardness: 0.1, + conduct: 0.235, + hidden: true +}; + +elements.molten_stable_protactinium = { + reactions: { + "oxygen": { "elem1":"protactinium_v_oxide", chance:0.01}, + "steam": { "elem1": "protactinium_hydroxide", "elem2": "hydrogen", chance:0.01 }, + }, +}; + + +eListAdd("BASE","protactinium_hydroxide"); +eListAddIon("PROTACTINIUMV","protactinium_hydroxide","base"); +eListAddIon("HYDROXIDE","protactinium_hydroxide","base"); +eListAdd("INSOLUBLE","protactinium_hydroxide"); + +elements.protactinium_hydroxide = { + color: [blendColors("#95c7c7","#ff0000",0.25),blendColors("#95c7c7","#00ff00",0.25),blendColors("#95c7c7","#0000ff",0.25)], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 350, + category: "powders", + state: "solid", + stateHigh: ["protactinium_v_oxide","steam"], + density: 12000, +}; + +elements.protactinium_v_oxide = { + color: [blendColors("#353b3b","#ff0000",0.25),blendColors("#353b3b","#00ff00",0.25),blendColors("#353b3b","#0000ff",0.25)], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 2500, + category: "powders", + state: "solid", + density: 12000, + reactions: {}, +}; + +eListAddIon("PROTACTINIUMV","protactinium_v_oxide"); +eListAddIon("OXIDE","protactinium_v_oxide"); +eListAdd("INSOLUBLE","protactinium_v_oxide"); + + +acidReact("hydrofluoric_acid","protactinium_v_oxide","protactinium_pentafluoride","fire",0); +acidReact("hydrofluoric_acid_gas","protactinium_v_oxide","protactinium_pentafluoride","fire",0); +acidReact("hydrogen_fluoride","protactinium_v_oxide","protactinium_pentafluoride","fire",0); +acidReact("liquid_hydrogen_fluoride","protactinium_v_oxide","protactinium_pentafluoride","fire",0); + +elements.protactinium_pentafluoride = { + color: [blendColors("#cbf2ec","#ff0000",0.25),blendColors("#cbf2ec","#00ff00",0.25),blendColors("#cbf2ec","#0000ff",0.25)], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 2500, + category: "powders", + state: "solid", + density: 12000, + reactions: {}, +}; + +eListAddIon("PROTACTINIUMV","protactinium_pentafluoride"); +eListAddIon("OXIDE","protactinium_pentafluoride"); +eListAdd("INSOLUBLE","protactinium_pentafluoride"); + + +reduce("protactinium_v_oxide", "oxygen", "stable_protactinium"); +reduce("protactinium_pentafluoride", "fluorine", "stable_protactinium"); + +elements.stable_neptunium = { + color: [blendColors("#626580","#ff0000"),blendColors("#3f4a61","#00ff00"),blendColors("#4a5463","#0000ff")], + behavior: behaviors.WALL, + reactions: { + "oxygen": { "elem1":"neptunium_dioxide", chance:0.01} + }, + tempHigh: 639, + category: "solids", + state: "solid", + density: 19380, + hardness: 0.7, + conduct: 0.2, + hidden: true +}; + +elements.molten_stable_neptunium = { + reactions: { + "oxygen": { "elem1":"neptunium_dioxide", chance:0.01} + }, +}; + + +elements.neptunium_dioxide = { + color: [blendColors("#47c94f","#ff0000"),blendColors("#47c94f","#00ff00"),blendColors("#47c94f","#0000ff")], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 2600, + category: "powders", + state: "solid", + density: 12000, + reactions: {}, +}; + + +eListAddIon("NEPTUNIUMIV","neptunium_dioxide"); +eListAddIon("OXIDE","neptunium_dioxide"); +eListAdd("INSOLUBLE","neptunium_dioxide"); + +elements.neptunium_tetrafluoride = { + color: [blendColors("#73e67a","#ff0000"),blendColors("#73e67a","#00ff00"),blendColors("#73e67a","#0000ff")], + behavior: behaviors.POWDER, + hidden: true, + tempHigh: 2550, + category: "powders", + state: "solid", + density: 12000, + reactions: {}, +}; + +eListAddIon("NEPTUNIUMIV","neptunium_tetrafluoride"); +eListAddIon("FLUORIDE","neptunium_tetrafluoride"); +eListAdd("INSOLUBLE","neptunium_tetrafluoride"); + +acidReact("hydrofluoric_acid","neptunium_dioxide","neptunium_tetrafluoride","fire",0); +acidReact("hydrofluoric_acid_gas","neptunium_dioxide","neptunium_tetrafluoride","fire",0); +acidReact("hydrogen_fluoride","neptunium_dioxide","neptunium_tetrafluoride","fire",0); +acidReact("liquid_hydrogen_fluoride","neptunium_dioxide","neptunium_tetrafluoride","fire",0); + +acidReact("fluorine","neptunium_tetrafluoride","neptunium_hexafluoride","fire",0); +acidReact("liquid_fluorine","neptunium_tetrafluoride","neptunium_hexafluoride","fire",0); +acidReact("fluorine","neptunium_dioxide","neptunium_hexafluoride","fire",0); +acidReact("liquid_fluorine","neptunium_dioxide","neptunium_hexafluoride","fire",0); + +eListAddIon("NEPTUNIUMVI","neptunium_hexafluoride"); +eListAddIon("FLUORIDE","neptunium_hexafluoride"); +eListAdd("INSOLUBLE","neptunium_hexafluoride"); + +reduce("neptunium_dioxide", "oxygen", "stable_neptunium"); +reduce("neptunium_tetrafluoride", "fluorine", "stable_neptunium"); + +elements.neptunium_hexafluoride = { + color: [blendColors("#eda042","#ff0000"),blendColors("#eda042","#00ff00"),blendColors("#eda042","#0000ff")], + behavior: behaviors.POWDER, + reactions: { + "hydrogen": { elem1: "neptunium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, + tempHigh: 55, + category: "powders", + state: "solid", + density: 5000, + stateHighName: "neptunium_hexafluoride_gas", + forceAutoGen: true, + hidden: true +} + + +elements.neptunium_hexafluoride_gas = { + behavior: behaviors.GAS, + state: "gas", + density: 14.591, + reactions: { + "hydrogen": { elem1: "neptunium_tetrafluoride", elem2: "hydrogen_fluoride" } + }, +} + + +runAfterLoad(function() { + reactList("neptunium_hexafluoride", eLists.WATER, { "elem1": "neptunium_tetrafluoride", elem2: "hydrofluoric_acid" }); + reactList("neptunium_hexafluoride_gas", eLists.WATER, { "elem1": "neptunium_tetrafluoride", elem2: "hydrofluoric_acid" }); +}); @@ -3303,18 +5430,56 @@ let defaultBaseGasReactions = { } -createAcid("francium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#863bff","#4d00ca","#897b9e"],true,true,100,100,0,1000,1200,1) +createAcid("francium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),[blendColors("#863bff","#ff0000"),blendColors("#4d00ca","#00ff00"),blendColors("#897b9e","#0000ff")],true,true,100,100,0,1000,1200,1,"FRANCIUM","base") + +eListAddIon("HYDROXIDE",["francium_hydroxide","francium_hydroxide_gas"],"base"); + +eListAdd("BASE", []); + function acidNeutralize(base) { - for(let i = 0; i < trueAcids.length; i++) + for(let i = 0; i < eLists.ACID.length; i++) { - elements[trueAcids[i]].reactions[base] = { "elem1":"neutral_acid", "elem2":null }; + elements[eLists.ACID[i]].reactions[base] = { "elem1":"neutral_acid", "elem2":null }; } - for(let i = 0; i < trueAcidGases.length; i++) + for(let i = 0; i < eLists.ACIDGAS.length; i++) { - elements[trueAcidGases[i]].reactions[base] = { "elem1":"hydrogen", "elem2":null }; + elements[eLists.ACIDGAS[i]].reactions[base] = { "elem1":"hydrogen", "elem2":null }; } + eLists.BASE.push(base); + if(eLists.HYDROGEN.indexOf(base) >= 0) + { + eLists.HYDROGEN.splice(eLists.HYDROGEN.indexOf(base),1); + } + if(elements[base].salt) + for(i in elements[base].salt) + { + if(elements[base].salt[i]) + { + if(elements[base].salt[i].components.indexOf("HYDROGEN") >= 0) + { + elements[base].salt[i].components.splice(elements[base].salt[i].components.indexOf("HYDROGEN"),1); + } + } + } +} + + +acidNeutralize("radium_hydroxide"); +acidNeutralize("actinium_hydroxide"); +acidNeutralize("protactinium_hydroxide"); + + +elements.caustic_soda = { + color: "#ffe8ff", + behavior: behaviors.CAUSTIC, + category: "powders", + tempHigh: 323, + state: "solid", + density: 2130, + hidden: true, + alias: "sodium hydroxide powder" } acidNeutralize("sodium_hydride"); @@ -3325,21 +5490,70 @@ acidNeutralize("molten_sodium_methoxide"); elements.francium_hydroxide.breakInto = "francium_hydroxide"; elements.francium_hydroxide_gas.breakInto = "francium_hydroxide_gas"; -delete elements.francium_hydroxide.burn; -delete elements.francium_hydroxide_gas.burn; acidNeutralize("francium_hydroxide"); acidNeutralize("francium_hydroxide_gas"); -createAcid("sodium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#fc3bff","#c000ca","#9b7b9e"],false,true,100,100,0,1000,1050,1); +createAcid("sodium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#fc3bff","#c000ca","#9b7b9e"],false,true,100,100,0,1000,1050,1,"SODIUM","base"); acidNeutralize("sodium_hydroxide"); acidNeutralize("sodium_hydroxide_gas"); +eListAddIon("HYDROXIDE",["sodium_hydroxide","sodium_hydroxide_gas"],"base"); -createAcid("potassium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#3bc4ff","#0062ca","#7b949e"],false,true,100,100,0,1000,1075,1); +eLists.CAUSTIC.push("caustic_soda"); +acidNeutralize("caustic_soda"); +elements.caustic_soda.ignore = elements.sodium_hydroxide.ignore; +acidIgnore(["caustic_soda"]); + +eListAddIon("SODIUM",["caustic_soda","molten_caustic_soda"],"base"); +eListAddIon("HYDROXIDE",["caustic_soda","molten_caustic_soda"],"base"); +eListAdd("COMPOUND","caustic_soda"); + +elements.caustic_soda.behavior = behaviors.CAUSTIC; +if(!elements.caustic_soda.reactions) +{ + elements.caustic_soda.reactions = {}; +} +elements.caustic_soda.reactions["water"] = { elem1:"sodium_hydroxide", elem2:null }; +elements.caustic_soda.reactions["salt_water"] = { elem1:"sodium_hydroxide", elem2:null }; +elements.caustic_soda.reactions["sugar_water"] = { elem1:"sodium_hydroxide", elem2:null }; +elements.caustic_soda.reactions["dirty_water"] = { elem1:"sodium_hydroxide", elem2:null }; +elements.caustic_soda.reactions["seltzer"] = { elem1:"sodium_hydroxide", elem2:null }; +elements.caustic_soda.reactions["pool_water"] = { elem1:"sodium_hydroxide", elem2:null }; + +elements.sodium_hydroxide_gas.tempHigh = 150; +elements.sodium_hydroxide_gas.stateHigh = ["caustic_soda","steam"]; + +createAcid("potassium_hydroxide",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#3bc4ff","#0062ca","#7b949e"],false,true,100,100,0,1000,1075,1,"POTASSIUM","base"); acidNeutralize("potassium_hydroxide"); acidNeutralize("potassium_hydroxide_gas"); +eListAddIon("HYDROXIDE",["potassium_hydroxide","potassium_hydroxide_gas"],"base"); + +eLists.CAUSTIC.push("caustic_potash"); +acidNeutralize("caustic_potash"); +elements.caustic_potash.ignore = elements.potassium_hydroxide.ignore; +acidIgnore(["caustic_potash"]); -createAcid("red_mud",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#ab3d24","#cc5d2d","#a81b1b"],true,true,1600,1600,0,Infinity,5200,3); +eListAddIon("POTASSIUM",["caustic_potash","molten_caustic_potash"],"base"); +eListAddIon("HYDROXIDE",["caustic_potash","molten_caustic_potash"],"base"); +eListAdd("COMPOUND","caustic_potash"); + + +elements.caustic_potash.behavior = behaviors.CAUSTIC; +if(!elements.caustic_potash.reactions) +{ + elements.caustic_potash.reactions = {}; +} +elements.caustic_potash.reactions["water"] = { elem1:"potassium_hydroxide", elem2:null }; +elements.caustic_potash.reactions["salt_water"] = { elem1:"potassium_hydroxide", elem2:null }; +elements.caustic_potash.reactions["sugar_water"] = { elem1:"potassium_hydroxide", elem2:null }; +elements.caustic_potash.reactions["dirty_water"] = { elem1:"potassium_hydroxide", elem2:null }; +elements.caustic_potash.reactions["seltzer"] = { elem1:"potassium_hydroxide", elem2:null }; +elements.caustic_potash.reactions["pool_water"] = { elem1:"potassium_hydroxide", elem2:null }; + +elements.potassium_hydroxide_gas.tempHigh = 150; +elements.potassium_hydroxide_gas.stateHigh = ["caustic_potash","steam"]; + +createAcid("red_mud",structuredClone(defaultBaseReactions),structuredClone(defaultBaseGasReactions),["#ab3d24","#cc5d2d","#a81b1b"],true,true,1600,1600,0,Infinity,5200,3,"REDMUD","base"); acidNeutralize("red_mud"); acidNeutralize("red_mud_gas"); elements.red_mud.viscosity = 1000000; @@ -3349,30 +5563,29 @@ elements.red_mud.reactions.sugar_water = {"elem2":"dirty_water" }; elements.red_mud.reactions.seltzer = {"elem2":"dirty_water" }; elements.red_mud.reactions.pool_water = {"elem2":"dirty_water" }; elements.red_mud.reactions.primordial_soup = {"elem2":"dirty_water" }; -elements.potassium_hydroxide.reactions["fertilizer"] = { elem1: "niter", elem2: "ammonia"}; -elements.potassium_hydroxide_gas.reactions["fertilizer"] = { elem1: "niter", elem2: "ammonia"}; -elements.potassium_hydroxide.ignore.push("fertilizer","niter","ammonia"); -elements.potassium_hydroxide_gas.ignore.push("fertilizer","niter","ammonia"); + +acidReact("potassium_hydroxide","fertilizer","niter","ammonia",10); +acidReact("potassium_hydroxide_gas","fertilizer","niter","ammonia",10); -elements.potassium_hydroxide.reactions["carbon_dioxide"] = { elem1: "potassium_carbonate", elem2: null}; -elements.potassium_hydroxide_gas.reactions["carbon_dioxide"] = { elem1: "potassium_carbonate", elem2: null}; +acidReact("potassium_hydroxide","carbon_dioxide","potassium_carbonate",null,10); +acidReact("potassium_hydroxide_gas","carbon_dioxide","potassium_carbonate",null,10); elements.potassium_hydroxide.ignore.push("carbon_dioxide","potassium_carbonate"); elements.potassium_hydroxide_gas.ignore.push("carbon_dioxide","potassium_carbonate"); elements.salt_water.reactions["mercury"] = { elem1:["sodium_hydroxide","chlorine","hydrogen"], charged:true, chance:0.02 }; -elements.sodium_hydroxide.ignore.push("mercury"); -elements.sodium_hydroxide.ignore.push("salt_water"); +elements.sodium_hydroxide.ignore.push("mercury","chlorine","salt_water"); +elements.sodium_hydroxide_gas.ignore.push("mercury","chlorine","salt_water"); elements.potassium_salt_water.reactions["mercury"] = { elem1:["potassium_hydroxide","chlorine","hydrogen"], charged:true, chance:0.02 }; -elements.potassium_hydroxide.ignore.push("mercury"); -elements.potassium_hydroxide.ignore.push("potassium_salt_water"); +elements.potassium_hydroxide.ignore.push("mercury","chlorine","potassium_salt_water"); +elements.potassium_hydroxide_gas.ignore.push("mercury","chlorine","potassium_salt_water"); acidReact("sodium_hydroxide","bauxite","sodium_aluminate_solution","red_mud",10); acidReact("sodium_hydroxide_gas","bauxite","sodium_aluminate_solution","red_mud",10); -elements.red_mud.ignore.push("bauxite","sodium_aluminate_solution","sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); -elements.red_mud_gas.ignore.push("bauxite","sodium_aluminate_solution","sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); -elements.sodium_hydroxide.ignore.push("sodium_aluminate_solution","sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); -elements.sodium_hydroxide_gas.ignore.push("sodium_aluminate_solution","sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); +elements.red_mud.ignore.push("sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); +elements.red_mud_gas.ignore.push("sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); +elements.sodium_hydroxide.ignore.push("sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); +elements.sodium_hydroxide_gas.ignore.push("sodium_aluminate_solution_ice","sodium_aluminate","molten_sodium_aluminate","sodium_carbonate_solution","spent_sodium_aluminate_solution","spent_sodium_aluminate_solution_ice","aluminum_hydroxide","alumina","molten_alumina"); @@ -3400,10 +5613,10 @@ acidReact("hydrofluoric_acid_gas","alumina","aluminum_trifluoride","fire",0); acidReact("hydrogen_fluoride","alumina","aluminum_trifluoride","fire",0); acidReact("liquid_hydrogen_fluoride","alumina","aluminum_trifluoride","fire",0); -elements.hydrofluoric_acid.ignore.push("molten_alumina","molten_aluminum_trifluoride"); -elements.hydrofluoric_acid_gas.ignore.push("molten_alumina","molten_aluminum_trifluoride"); -elements.hydrogen_fluoride.ignore.push("molten_alumina","molten_aluminum_trifluoride"); -elements.liquid_hydrogen_fluoride.ignore.push("molten_alumina","molten_aluminum_trifluoride"); +elements.hydrofluoric_acid.ignore.push("molten_alumina","aluminum_trifluoride_gas"); +elements.hydrofluoric_acid_gas.ignore.push("molten_alumina","aluminum_trifluoride_gas"); +elements.hydrogen_fluoride.ignore.push("molten_alumina","aluminum_trifluoride_gas"); +elements.liquid_hydrogen_fluoride.ignore.push("molten_alumina","aluminum_trifluoride_gas"); acidReact("hydrofluoric_acid","aluminum_hydroxide","aluminum_trifluoride","fire",0); @@ -3412,13 +5625,21 @@ acidReact("hydrofluoric_acid_gas","aluminum_hydroxide","aluminum_trifluoride","f acidReact("hydrogen_fluoride","aluminum_hydroxide","aluminum_trifluoride","fire",0); acidReact("liquid_hydrogen_fluoride","aluminum_hydroxide","aluminum_trifluoride","fire",0); -acidReact("hydrofluoric_acid","sodium_hydroxide","sodium_fluoride","fire",0); -acidReact("hydrofluoric_acid_gas","sodium_hydroxide","sodium_fluoride","fire",0); -acidReact("hydrofluoric_acid","sodium_hydroxide_gas","sodium_fluoride","fire",0); -acidReact("hydrofluoric_acid_gas","sodium_hydroxide_gas","sodium_fluoride","fire",0); +acidReact("hydrofluoric_acid","sodium_hydroxide","sodium_fluoride_solution","fire",0); +acidReact("hydrofluoric_acid_gas","sodium_hydroxide","sodium_fluoride_solution","fire",0); +acidReact("hydrofluoric_acid","sodium_hydroxide_gas","sodium_fluoride_solution","fire",0); +acidReact("hydrofluoric_acid_gas","sodium_hydroxide_gas","sodium_fluoride_solution","fire",0); + +acidReact("acid","sodium_hydroxide","salt_water",null,0); +acidReact("acid_gas","sodium_hydroxide","salt_water",null,0); +acidReact("acid","sodium_hydroxide_gas","salt_water",null,0); +acidReact("acid_gas","sodium_hydroxide_gas","salt_water",null,0); + +acidReact("acid","potassium_hydroxide","potassium_salt_water",null,0); +acidReact("acid_gas","potassium_hydroxide","potassium_salt_water",null,0); +acidReact("acid","potassium_hydroxide_gas","potassium_salt_water",null,0); +acidReact("acid_gas","potassium_hydroxide_gas","potassium_salt_water",null,0); -elements.sodium_hydroxide.ignore.push("sodium_fluoride"); -elements.sodium_hydroxide_gas.ignore.push("sodium_fluoride"); elements.sodium_hydroxide.ignore.push("sodium_methoxide","methanol"); @@ -3432,10 +5653,9 @@ acidReact("fluoroboric_acid","sodium_hydroxide_gas","sodium_tetrafluoroborate",n acidReact("fluoroboric_acid_gas","sodium_hydroxide_gas","sodium_tetrafluoroborate",null,50); -acidNeutralize("sodium_hydride"); -elements.bless.reactions["FOOF"] = {elem2: "oxygen"}; -elements.bless.reactions["solid_FOOF"] = {elem2: "oxygen"}; +elements.bless.reactions["foof"] = {elem2: "oxygen"}; +elements.bless.reactions["solid_foof"] = {elem2: "oxygen"}; elements.bless.reactions["fluorine"] = {elem2: null}; elements.bless.reactions["liquid_fluorine"] = {elem2: null}; elements.bless.reactions["fluorine_ice"] = {elem2: null}; @@ -3465,10 +5685,84 @@ elements.bless.reactions["sulfur_dioxide_ice"] = {elem2: "oxygen"}; elements.bless.reactions["hydrogen_sulfide"] = {elem2: "hydrogen"}; elements.bless.reactions["liquid_hydrogen_sulfide"] = {elem2: "hydrogen"}; elements.bless.reactions["rocket_fuel"] = {elem2: null}; +elements.bless.reactions["diborane"] = {elem2: "hydrogen"}; +elements.bless.reactions["pentaborane"] = {elem2: "hydrogen"}; +elements.bless.reactions["decaborane"] = {elem2: "hydrogen"}; +elements.bless.reactions["sodium_hydride"] = {elem2: "hydrogen"}; +elements.bless.reactions["sodium_borohydride"] = {elem2: "hydrogen"}; +elements.bless.reactions["sodium_borohydride_solution"] = {elem2: "water"}; +elements.bless.reactions["uraninite"] = {elem2: "rock"}; +elements.bless.reactions["yellowcake_solution"] = {elem2: ["rock","hydrogen","rock","hydrogen","rock","hydrogen","baked_batter","hydrogen"]}; +elements.bless.reactions["yellowcake"] = {elem2: ["rock","rock","rock","baked_batter"]}; +elements.bless.reactions["depleted_uranium"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium"] = {elem2: "rock"}; +elements.bless.reactions["uranium_dioxide"] = {elem2: "rock"}; +elements.bless.reactions["depleted_uranium_dioxide"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium_dioxide"] = {elem2: "rock"}; +elements.bless.reactions["uranium_tetrafluoride"] = {elem2: "rock"}; +elements.bless.reactions["depleted_uranium_tetrafluoride"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium_tetrafluoride"] = {elem2: "rock"}; +elements.bless.reactions["uranium_hexafluoride"] = {elem2: "rock"}; +elements.bless.reactions["depleted_uranium_hexafluoride"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium_hexafluoride"] = {elem2: "rock"}; +elements.bless.reactions["stable_uranium_hexafluoride"] = {elem2: "stable_uranium"}; +elements.bless.reactions["molten_depleted_uranium"] = {elem2: "magma"}; +elements.bless.reactions["molten_enriched_uranium"] = {elem2: "magma"}; +elements.bless.reactions["molten_uranium_dioxide"] = {elem2: "magma"}; +elements.bless.reactions["molten_depleted_uranium_dioxide"] = {elem2: "magma"}; +elements.bless.reactions["molten_enriched_uranium_dioxide"] = {elem2: "magma"}; +elements.bless.reactions["molten_uranium_tetrafluoride"] = {elem2: "magma"}; +elements.bless.reactions["molten_depleted_uranium_tetrafluoride"] = {elem2: "magma"}; +elements.bless.reactions["molten_enriched_uranium_tetrafluoride"] = {elem2: "magma"}; +elements.bless.reactions["uranium_hexafluoride_gas"] = {elem2: "rock"}; +elements.bless.reactions["depleted_uranium_hexafluoride_gas"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium_hexafluoride_gas"] = {elem2: "rock"}; +elements.bless.reactions["stable_uranium_hexafluoride_gas"] = {elem2: "stable_uranium"}; +elements.bless.reactions["neptunium"] = {elem2: "rock"}; +elements.bless.reactions["molten_neptunium"] = {elem2: "rock"}; +elements.bless.reactions["enriched_uranium_hexafluoride_gas"] = {elem2: "rock"}; +elements.bless.reactions["radium"] = {elem2: null}; +elements.bless.reactions["molten_radium"] = {elem2: null}; +elements.bless.reactions["actinium"] = {elem2: null}; +elements.bless.reactions["molten_actinium"] = {elem2: null}; +elements.bless.reactions["thorium"] = {elem2: "rock"}; +elements.bless.reactions["molten_thorium"] = {elem2: "magma"}; +elements.bless.reactions["thorium_dioxide"] = {elem2: "rock"}; +elements.bless.reactions["molten_thorium_dioxide"] = {elem2: "magma"}; +elements.bless.reactions["thorium_tetrafluoride"] = {elem2: "rock"}; +elements.bless.reactions["molten_thorium_tetrafluoride"] = {elem2: "magma"}; +elements.bless.reactions["protactinium"] = {elem2: "rock"}; +elements.bless.reactions["molten_protactinium"] = {elem2: "magma"}; +elements.bless.reactions["neptunium"] = {elem2: "rock"}; +elements.bless.reactions["molten_neptunium"] = {elem2: "magma"}; +elements.bless.reactions["neptunium_hexafluoride"] = {elem2: "stable_neptunium"}; +elements.bless.reactions["neptunium_hexafluoride_gas"] = {elem2: "stable_neptunium"}; +elements.bless.reactions["plutonium"] = {elem2: "rock"}; +elements.bless.reactions["molten_plutonium"] = {elem2: "magma"}; +elements.bless.reactions["plutonium_dioxide"] = {elem2: "rock"}; +elements.bless.reactions["molten_plutonium_dioxide"] = {elem2: "magma"}; +elements.bless.reactions["plutonium_tetrafluoride"] = {elem2: "rock"}; +elements.bless.reactions["molten_plutonium_tetrafluoride"] = {elem2: "magma"}; +elements.bless.reactions["plutonium_hexafluoride"] = {elem2: "rock"}; +elements.bless.reactions["plutonium_hexafluoride_gas"] = {elem2: "magma"}; +elements.bless.reactions["stable_plutonium_hexafluoride"] = {elem2: "stable_plutonium"}; +elements.bless.reactions["stable_plutonium_hexafluoride_gas"] = {elem2: "stable_plutonium"}; +elements.bless.reactions["americium"] = {elem2: "rock"}; +elements.bless.reactions["molten_americium"] = {elem2: "magma"}; +elements.bless.reactions["curium"] = {elem2: "rock"}; +elements.bless.reactions["molten_curium"] = {elem2: "magma"}; +elements.bless.reactions["berkelium"] = {elem2: "rock"}; +elements.bless.reactions["molten_berkelium"] = {elem2: "magma"}; +elements.bless.reactions["californium"] = {elem2: "rock"}; +elements.bless.reactions["molten_californium"] = {elem2: "magma"}; +elements.bless.reactions["einsteinium"] = {elem2: "rock"}; +elements.bless.reactions["molten_einsteinium"] = {elem2: "magma"}; +elements.bless.reactions["fermium"] = {elem2: "rock"}; +elements.bless.reactions["molten_fermium"] = {elem2: "magma"}; -elements.FOOF.ignore.push("foof_grass","foof_grass_seed"); -elements.solid_FOOF.ignore.push("foof_grass","foof_grass_seed"); +elements.foof.ignore.push("foof_grass","foof_grass_seed"); +elements.solid_foof.ignore.push("foof_grass","foof_grass_seed"); elements.fluorine.ignore.push("foof_grass","foof_grass_seed"); elements.liquid_fluorine.ignore.push("foof_grass","foof_grass_seed"); @@ -3510,10 +5804,10 @@ elements.foof_grass= { tempHigh: -57, stateHigh: ["oxygen","fluorine","explosion"], tempLow: -200, - stateLow: "solid_FOOF", + stateLow: "solid_foof", burn:50, burnTime:20, - breakInto: "FOOF", + breakInto: "foof", category:"life", state: "solid", density: 1400, @@ -3533,14 +5827,421 @@ elements.foof_grass_seed = { tempHigh: -57, stateHigh: ["oxygen","fluorine","explosion"], tempLow: -200, - stateLow: "solid_FOOF", + stateLow: "solid_foof", burn: 50, burnTime: 20, category: "life", state: "solid", density: 1400, - breakInto: "FOOF", + breakInto: "foof", hidden: true, cooldown: defaultCooldown, seed: true -}; \ No newline at end of file +}; + +elements.centrifuge= { + color: "#89888f", + category: "machines", + tempHigh: 1455.5, + stateHigh: "molten_steel", + tick: function(pixel) { + if(!pixel.del) + { + for(let i = 0; i < 10; i++) + { + for(let j = 1; j < 10; j++) + { + let x = [pixel.x + i, pixel.x - j, pixel.x - i, pixel.x + j]; + let y = [pixel.y + j, pixel.y + i, pixel.y - j, pixel.y - i]; + var oob = outOfBounds(x[0],y[0]) || outOfBounds(x[1],y[1]) || outOfBounds(x[2],y[2]) || outOfBounds(x[3],y[3]); + if(!oob) + { + pixels = [null,null,null,null] + let immovable = false; + for(let k = 0; k < 4; k++) + { + pixels[k] = !isEmpty(x[k],y[k],true) ? pixelMap[x[k]][y[k]] : null; + if(pixels[k] && !elements[pixels[k].element].movable) + { + immovable = true; + } + } + if(!immovable) + { + for(let k = 0; k < 4; k++) + { + if(pixelMap[x[k]][y[k]]) + { + delete pixelMap[x[k]][y[k]]; + } + } + for(let k = 0; k < 4; k++) + { + if(pixels[k] && !pixels[k].del) + { + pixels[k].x = x[(k+1)%4]; + pixels[k].y = y[(k+1)%4]; + movePixel(pixels[k],x[(k+1)%4], y[(k+1)%4]); + } + } + + for(let k = 0; k < 4; k++) + { + if(pixels[k] && elements[pixels[k].element].onCentrifuge) + { + elements[pixels[k].element].onCentrifuge(pixels[k]); + } + } + } + } + } + } + } + doDefaults(pixel); + }, + movable: false +}; + + +for(let i = 0; i < eLists.INSOLUBLE.length; i++) +{ + eListAdd("COMPOUND",eLists.INSOLUBLE[i]); +} + +eListAdd("COMPOUND","water"); +eListAddIon("HYDROGEN","water"); +eListAddIon("HYDROXIDE","water"); + +eListAdd("COMPOUND","methanol"); +eListAddIon("HYDROGEN","methanol"); +eListAddIon("METHOXIDE","methanol"); + +eListAdd("COMPOUND","vinegar"); +eListAdd("ACID","vinegar"); +eListAddIon("HYDROGEN","vinegar","acid"); +eListAddIon("ACETATE","vinegar","acid"); + +createSalt("baking_soda","baking_soda_solution",["#f2f2f2","#e0e0e0"],"#7494db",false,true,292,-2,102,3980,1026,"SODIUM","BICARBONATE"); + +delete elements["molten_baking_soda"]; + +eListAdd("COMPOUND","baking_soda"); +eListAdd("BASE","baking_soda"); +eListAdd("COMPOUND","baking_soda_solution"); +eListAdd("BASE","baking_soda_solution"); +eListAddIon("SODIUM","baking_soda","base"); +eListAddIon("BICARBONATE","baking_soda","base"); +eListAddIon("SODIUM","baking_soda_solution","base"); +eListAddIon("BICARBONATE","baking_soda_solution","base"); + +elements["baking_soda"].reactions["sodium_hydroxide"] = {elem1: "sodium_carbonate_solution", elem2: "null"}; +elements["baking_soda"].reactions["sodium_hydroxide_gas"] = {elem1: "sodium_carbonate_solution", elem2: "null"}; +elements["baking_soda_solution"].reactions["sodium_hydroxide"] = {elem1: "sodium_carbonate_solution", elem2: "null"}; +elements["baking_soda_solution"].reactions["sodium_hydroxide_gas"] = {elem1: "sodium_carbonate_solution", elem2: "null"}; + +createSalt("sodium_acetate","sodium_acetate_solution",["#f2f2f2","#e0e0e0"],"#7ea2f2",false,true,292,-2,102,3980,1028,"SODIUM","ACETATE"); + +eListAdd("ACID","seltzer"); +eListAddIon("HYDROGEN","seltzer","acid"); +eListAddIon("CARBONATE","seltzer","acid"); +eListAddIon("HYDROGEN","seltzer","bicarbonate"); +eListAddIon("BICARBONATE","seltzer","bicarbonate"); + +eListAdd("ACID","soda"); +eListAddIon("HYDROGEN","soda","acid"); +eListAddIon("CARBONATE","soda","acid"); +eListAddIon("HYDROGEN","soda","bicarbonate"); +eListAddIon("BICARBONATE","soda","bicarbonate"); + +eListAdd("ACID","pilk"); +eListAddIon("HYDROGEN","pilk","acid"); +eListAddIon("CARBONATE","pilk","acid"); +eListAddIon("HYDROGEN","pilk","bicarbonate"); +eListAddIon("BICARBONATE","pilk","bicarbonate"); + + +eListAdd("COMPOUND","copper_sulfate"); +eListAddIon("COPPERII","copper_sulfate"); +eListAddIon("SULFATE","copper_sulfate"); + +eListAddIon("COPPERII","molten_copper_sulfate"); +eListAddIon("SULFATE","molten_copper_sulfate"); + +function listMatching(list) +{ + let result = []; + for(let i in elements) + { + let valid = false; + if(elements[i].salt) + { + for(let ii in elements[i].salt) + { + let valid2 = true; + + for(let j = 0; j < list.length; j++) + { + if(!elements[i].salt[ii].components.includes(list[j])) + { + valid2 = false; + continue; + } + } + + for(let j = 0; j < elements[i].salt[ii].components.length; j++) + { + if(!list.includes(elements[i].salt[ii].components[j])) + { + valid2 = false; + continue; + } + } + valid = valid || valid2; + } + } + if(valid) + { + result.push(i); + } + } + return result; +} + +function listMatching2(list, elem) +{ + let result = []; + for(let i = 0; i < elem.length; i++) + { + let valid = true; + for(let j = 0; j < list.length; j++) + { + if(!eLists[list[j]].includes(elem[i])) + { + valid = false; + break; + } + } + if(valid) + { + result.push(elem[i]); + } + } + return result; +} + +runAfterAutogen(function() { + for(let ii = 0; ii < eLists.WATER.length; ii++) + { + let i = eLists.WATER[ii]; + if(!elements[i]) + { + console.log(i); + continue; + } + if(!elements[i].reactions) + { + elements[i].reactions = {}; + } + for(let jj = 0; jj < eLists.WATER.length; jj++) + { + let j = eLists.WATER[jj]; + if(i != j && elements[i].salt && elements[j].salt) + { + let priorityA = -Infinity; + let priorityB = -Infinity; + for(let iii in elements[i].salt) + { + if(priorityA > elements[i].salt[iii].priority) + { + continue; + } + for(let jjj in elements[j].salt) + { + if(priorityB > elements[j].salt[jjj].priority) + { + continue; + } + if(elements[i].salt[iii].components.length > 1 && elements[j].salt[jjj].components.length > 1) + { + let match1 = listMatching([elements[i].salt[iii].components[0],elements[j].salt[jjj].components[1]]); + let match2 = listMatching([elements[i].salt[iii].components[1],elements[j].salt[jjj].components[0]]); + let match3 = listMatching([elements[i].salt[iii].components[0],elements[j].salt[jjj].components[0]]); + let match4 = listMatching([elements[i].salt[iii].components[1],elements[j].salt[jjj].components[1]]); + + let water1 = listMatching2(["WATER"],match1); + let water2 = listMatching2(["WATER"],match2); + let water3 = listMatching2(["WATER"],match3); + let water4 = listMatching2(["WATER"],match4); + let salt1 = listMatching2(["INSOLUBLE"],match1); + let salt2 = listMatching2(["INSOLUBLE"],match2); + let salt3 = listMatching2(["INSOLUBLE"],match3); + let salt4 = listMatching2(["INSOLUBLE"],match4); + + let productsA = []; + let productsB = []; + + if(water1.length > 0 && salt2.length > 0) + { + productsA = productsA.concat(water1); + productsB = productsB.concat(salt2); + } + if(water2.length > 0 && salt1.length > 0) + { + productsA = productsA.concat(water2); + productsB = productsB.concat(salt1); + } + + + if(water3.length > 0 && salt4.length > 0) + { + productsA = productsA.concat(water3); + productsB = productsB.concat(salt4); + } + if(water4.length > 0 && salt3.length > 0) + { + productsA = productsA.concat(water4); + productsB = productsB.concat(salt3); + } + + if(productsA.length > 0 && productsB.length > 0) + { + acidReact(i,j,productsA,productsB,0); + console.log("precipitate"); + console.log(i); + console.log(j); + console.log(productsA); + console.log(productsB); + priorityA = elements[i].salt[iii].priority; + priorityB = elements[j].salt[jjj].priority; + continue; + } + + + if(elements[i].salt[iii].components[0] == elements[j].salt[jjj].components[0] || elements[i].salt[iii].components[1] == elements[j].salt[jjj].components[1] || + elements[i].salt[iii].components[1] == elements[j].salt[jjj].components[0] || elements[i].salt[iii].components[0] == elements[j].salt[jjj].components[1]) + { + continue; + } + + productsA = []; + productsB = []; + + if(water1.length > 0 && water2.length > 0) + { + productsA = productsA.concat(water1); + productsB = productsB.concat(water2); + } + + if(water3.length > 0 && water4.length > 0) + { + productsA = productsA.concat(water3); + productsB = productsB.concat(water4); + } + + + if(productsA.length > 0 && productsB.length > 0) + { + elements[i].reactions[j] = { elem1:productsA, elem2:productsB, chance:0.001, oneway:true }; + console.log(i); + console.log(j); + console.log(productsA); + console.log(productsB); + priorityA = elements[i].salt[iii].priority; + priorityB = elements[j].salt[jjj].priority; + } + } + } + } + } + } + } + let acids = eLists.ACID.concat(eLists.ACIDGAS).concat(eLists.AMPHOTERIC); + for(let ii = 0; ii < acids.length; ii++) + { + let i = acids[ii]; + if(!elements[i]) + { + console.log(i); + continue; + } + if(!elements[i].reactions) + { + elements[i].reactions = {}; + } + let bases = eLists.BASE.concat(eLists.AMPHOTERIC); + for(let jj = 0; jj < bases.length; jj++) + { + let j = bases[jj]; + if(i != j && elements[i].salt && elements[j].salt && elements[i].salt["acid"].components.length > 1 && elements[j].salt["base"].components.length > 1) + { + let productsA = []; + let productsB = []; + + let match = [listMatching([elements[i].salt["acid"].components[0],elements[j].salt["base"].components[1]]), + listMatching([elements[i].salt["acid"].components[1],elements[j].salt["base"].components[0]]), + listMatching([elements[i].salt["acid"].components[0],elements[j].salt["base"].components[0]]), + listMatching([elements[i].salt["acid"].components[1],elements[j].salt["base"].components[1]])]; + + let compounds = [listMatching2(["COMPOUND"],match[0]),listMatching2(["COMPOUND"],match[1]),listMatching2(["COMPOUND"],match[2]),listMatching2(["COMPOUND"],match[3])]; + + + for(let n = 0; n < compounds.length; n++) + { + let m = n-1; + if(n%2 == 0) + { + m = n+1; + } + if(compounds[n].includes("water")) + { + let water1 = listMatching2(["WATER"],match[m]); + if(water1.length > 0) + { + compounds[m] = water1; + compounds[n].splice(compounds[n].indexOf("water"),1); + if(compounds[n].length == 0) + compounds[n] = [null]; + } + } + } + + if(compounds[0].length > 0 && compounds[1].length > 0) + { + productsA = productsA.concat(compounds[0]); + productsB = productsB.concat(compounds[1]); + } + if(compounds[2].length > 0 && compounds[3].length > 0) + { + productsA = productsA.concat(compounds[2]); + productsB = productsB.concat(compounds[3]); + } + if(productsA.length > 0 && productsB.length > 0) + { + let reactionTemp = 0; + if(elements[i].salt["acid"].components.includes("FLUORIDE") && elements[i].salt["acid"].components.includes("HYDROGEN")) + { + if(productsB[0] === null && productsB.length === 1) + { + productsB = ["fire"]; + } + else + { + productsB.push("fire"); + } + } + if((elements[i].salt["acid"].components.includes("SULFATE") || elements[i].salt["acid"].components.includes("CHLORIDE")) && elements[i].salt["acid"].components.includes("HYDROGEN")) + { + reactionTemp = 50; + } + acidReact(i,j,productsA,productsB,reactionTemp); + console.log("neutral"); + console.log(i); + console.log(j); + console.log(compounds); + console.log(productsA); + console.log(productsB); + } + } + } + } +}); \ No newline at end of file diff --git a/mods/mixture.js b/mods/mixture.js index eada089f..491f931e 100644 --- a/mods/mixture.js +++ b/mods/mixture.js @@ -20,7 +20,6 @@ function whenAvailable(names, callback) { } }, interval); } -var runAfterAutogenMod = "mods/runAfterAutogen2.js"; function getName(elementList) { @@ -274,11 +273,14 @@ function mixture(elementList) reactions: {}, }; - elementCount++; - elements[name].hidden = true; - hiddenCount++; - elements[name].id = nextid++; - document.getElementById("extraInfo").innerHTML = "

There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.

©2021-" + new Date().getFullYear() + ". All Rights Reserved. R74n

"; //update extra info counts (and the copyright year, due to the method used) + if(typeof elementCount !== 'undefined') + { + elementCount++; + elements[name].hidden = true; + hiddenCount++; + elements[name].id = nextid++; + document.getElementById("extraInfo").innerHTML = "

There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.

©2021-" + new Date().getFullYear() + ". All Rights Reserved. R74n

"; //update extra info counts (and the copyright year, due to the method used) + } } else if(!elements[name].mixture) { @@ -498,15 +500,11 @@ function isValidMixture(elementList) return true; } -if(enabledMods.includes(runAfterAutogenMod)){ -whenAvailable(["runAfterAutogen"], function() { - runAfterAutogen(function() { - mixture2(["water","blood"]); - mixture2(["water","cough_drugs","cellulose_gum","carbon_dioxide","sugar","milk"]); - - }); +runAfterAutogen(function() { + mixture2(["water","blood"]); + mixture2(["water","cough_drugs","cellulose_gum","carbon_dioxide","sugar","milk"]); + }); -} predefinedColors = [ diff --git a/mods/mixtureII.js b/mods/mixtureII.js new file mode 100644 index 00000000..b69d6381 --- /dev/null +++ b/mods/mixtureII.js @@ -0,0 +1,440 @@ +function getName(elementList) +{ + if(elementList.filter(function(item, pos, self) { + return self.indexOf(item) == pos; + }).length == 1) + { + return elementList[0]; + } + let name = elementList.join("_") + "_mixture"; + if(nameList[name]) + { + name = nameList[name]; + }; + return name; +} + + +function makeColors(elementList) +{ + return elementList.map((c) => elements[c].color instanceof Array ? elements[c].color : [elements[c].color]); +} + +function mixture(elementList) +{ + elementList.sort(); + + let name = getName(elementList); + + if(!elements[name]) + { + elements[name] = true; + let minTempHigh = Infinity; + let stateHigh = null; + let indexStateHigh = -1; + + let maxTempLow = -Infinity; + let stateLow = null; + let indexStateLow = -1; + + + for(let i = 0; i < elementList.length; i++) + { + if(elements[elementList[i]]) + { + if(typeof elements[elementList[i]].tempHigh === "number" && elements[elementList[i]].stateHigh) + { + if(elements[elementList[i]].tempHigh < minTempHigh) + { + minTempHigh = elements[elementList[i]].tempHigh; + indexStateHigh = i; + stateHigh = elements[elementList[i]].stateHigh; + } + } + + if(typeof elements[elementList[i]].tempLow === "number" && elements[elementList[i]].stateLow) + { + if(elements[elementList[i]].tempLow > maxTempLow) + { + maxTempLow = elements[elementList[i]].tempLow; + indexStateLow = i; + stateLow = elements[elementList[i]].stateLow; + } + } + } + } + + let elementList2 = elementList.slice(); + let elementHigh = null; + if(indexStateHigh >= 0) + { + if(stateHigh instanceof Array) + { + elementHigh = []; + for(let i = 0; i < stateHigh.length; i++) + { + elementList2[indexStateHigh] = stateHigh[i]; + elementHigh.push(mixture(elementList2)); + } + } + else + { + elementList2[indexStateHigh] = stateHigh; + elementHigh = mixture(elementList2); + } + } + + let elementList3 = elementList.slice(); + let elementLow = null; + if(indexStateLow >= 0) + { + if(stateLow instanceof Array) + { + elementLow = []; + for(let i = 0; i < stateLow.length; i++) + { + elementList3[indexStateLow] = stateLow[i]; + elementLow.push(mixture(elementList3)); + } + } + else + { + elementList3[indexStateLow] = stateLow; + elementLow = mixture(elementList3); + } + } + + if(elementHigh instanceof Array && elementHigh.length === 0) + { + minTempHigh = Infinity; + elementHigh = null; + } + if(elementLow instanceof Array && elementLow.length === 0) + { + maxTempLow = -Infinity; + elementLow = null; + } + + let colors = makeColors(elementList.slice()); + let colors2 = []; + let maxLength = Math.max(...(colors.map((c) => c.length))); + + for(let i = 0; i < maxLength; i++) + { + let colors3 = []; + for(let j = 0; j < colors.length; j++) + { + colors3.push(toObject(colors[j][i%colors[j].length])); + } + colors2.push(averageRGB(colors3)); + } + let temp = airTemp; + if(maxTempLow < airTemp && minTempHigh > airTemp) + { + + } + else if(maxTempLow > -Infinity && minTempHigh < Infinity) + { + temp = (maxTempLow + minTempHigh)/2; + } + else if(maxTempLow > -Infinity) + { + temp = maxTempLow+20; + } + else if(minTempHigh < Infinity) + { + temp = Math.max(minTempHigh-20,absoluteZero); + } + + + let movable = elementList.some((c) => elements[c].movable || elements[c].movable === undefined); + + let density = elementList.map((c) => elements[c].density ? elements[c].density : 0).reduce((a,b)=>a+b)/elementList.length; + let stain = elementList.map((c) => elements[c].stain ? elements[c].stain : 0).reduce((a,b)=>a+b)/elementList.length; + + let states = elementList.map((c) => elements[c].state); + if(states.includes("gas")) + { + state = "gas"; + density = 0; + } + else if(!movable) + { + state = "solid"; + } + else if(states.includes("liquid")) + { + state = "liquid"; + } + else + { + state = "solid"; + } + + elements[name] = { + color: colors2.length == 1 ? colors2[0] : colors2, + colorObject: colors2.length == 1 ? toObject(colors2[0]) :colors2.map((c) => toObject(c)), + tick: function(pixel) { + mixtureBehavior(pixel, elementList); + }, + tempHigh: minTempHigh, + stateHigh: elementHigh, + tempLow: maxTempLow, + stateLow: elementLow, + temp: temp, + category: "mixture", + mixture: elementList, + movable: movable, + density: density, + state: state, + stain: stain, + reactions: {}, + isGas: state === "gas" + }; + + for(let i in elements) + { + for(let j = 0; j < elementList.length; j++) + { + if(elements[i].reactions && elements[i].reactions[elementList[j]] !== undefined) + { + if(name === i) + { + continue; + } + elements[i].reactions[name] = {elem2: name, func: function(a,b){mixtureReact(b,a,elementList)}} + } + if(elements[elementList[j]].reactions && elements[elementList[j]].reactions[i] !== undefined) + { + if(name === i) + { + continue; + } + elements[name].reactions[i] = {elem2: i, func: function(a,b){mixtureReact(a,b,elementList)}} + } + } + } + if(typeof elementCount !== 'undefined') + { + elementCount++; + elements[name].hidden = true; + elements[name].id = nextid++; + if (elements[name].hidden && (!settings["unhide"] || ( settings["unhide"]===2 && !settings.unlocked[name] ))) { hiddenCount++; } + else + { + var categoryDiv = document.getElementById("category-mixture"); + if (categoryDiv == null) { + createCategoryDiv("mixture"); + } + createElementButton(name); + } + document.getElementById("extraInfo").innerHTML = "

There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.

©2021-" + new Date().getFullYear() + ". All Rights Reserved. R74n

"; //update extra info counts (and the copyright year, due to the method used) + } + } + return name; +} + + +function mixtureBehavior(pixel, elementList) +{ + let prevCol = pixel.color; + let previous = pixel.element; + let elem = elementList[Math.floor(Math.random()*elementList.length)]; + if (elements[elem].tick) { // Run tick function if it exists + elements[elem].tick(pixel); + } + + if (pixel.del) {return} + + if (elements[elem].behavior) { // Parse behavior if it exists + pixelTick(pixel,elements[elem].behavior); + } + if(pixel.element === previous) + { + pixel.color = prevCol; + } +} + + +function mixtureReact(pixel, pixel2, elementList) +{ + elementList = elementList.slice(); + shuffleArray(elementList); + let previous = pixel.element; + let prevCol = pixel.color; + let previous2 = pixel2.element; + let prevCol2 = pixel2.color; + for(let i = 0; i < elementList.length; i++) + { + let elem = elementList[i]; + if(pixel.del) + { + return; + } + changePixel(pixel,elem, false); + let rr1 = false; + if (elements[elem].reactions !== undefined && elements[elem].reactions[pixel2.element] !== undefined) { + rr1 = reactPixels(pixel,pixel2); + } + if (!rr1 && elements[pixel2.element].reactions !== undefined && elements[pixel2.element].reactions[elem] !== undefined && !elements[pixel2.element].reactions[elem].oneway) { + reactPixels(pixel2,pixel); + } + if(pixel2.element === previous2) + { + pixel2.color = prevCol2; + } + if(!pixel.del && pixel.element === elem) + { + } + else if(pixel.del) + { + elementList.splice(elementList.indexOf(elem),1); + createPixel(mixture(elementList),pixel.x,pixel.y); + currentPixels[currentPixels.length-1].temp = pixel.temp; + return; + } + else + { + elementList.splice(elementList.indexOf(elem),1) + changePixel(pixel, mixture(elementList.concat([pixel.element])), false); + return; + } + if(pixel2.del) + { + return; + } + } + changePixel(pixel, previous, false); + pixel.color = prevCol; +} + +nameList = []; + +function toObject(color) +{ + color = color.match(/\d+/g); + return { + r: parseInt(color[0]), + g: parseInt(color[1]), + b: parseInt(color[2]) + }; +} + +function averageRGB2(colors) +{ + return toObject(averageRGB(colors.map((d) => (toObject(d))))); +} + +function averageRGB(rgblist) { + var r = 0; + var g = 0; + var b = 0; + for (var i = 0; i < rgblist.length; i++) { + var rgb = rgblist[i]; + r += parseInt(rgb.r); + g += parseInt(rgb.g); + b += parseInt(rgb.b); + } + r = Math.floor(r/rgblist.length); + g = Math.floor(g/rgblist.length); + b = Math.floor(b/rgblist.length); + return "rgb("+r+","+g+","+b+")"; +} + + +function blendColors(colorA, colorB, amount = 0.5) { + const [rA, gA, bA] = colorA.match(/\w\w/g).map((c) => parseInt(c, 16)); + const [rB, gB, bB] = colorB.match(/\w\w/g).map((c) => parseInt(c, 16)); + const r = Math.round(rA + (rB - rA) * amount).toString(16).padStart(2, '0'); + const g = Math.round(gA + (gB - gA) * amount).toString(16).padStart(2, '0'); + const b = Math.round(bA + (bB - bA) * amount).toString(16).padStart(2, '0'); + return '#' + r + g + b; +} + +changePixel = function (pixel,element,changetemp=true) { + if (!elements[element]) { + pixel.invalidElement = element; + element = "unknown" + } + if(pixel.element !== element) + { + pixel.element = element; + pixel.color = pixelColorPick(pixel); + } + pixel.start = pixelTicks; + var elementInfo = elements[element]; + if (elementInfo.burning == true) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + else if (pixel.burning && !elementInfo.burn) { + delete pixel.burning; + delete pixel.burnStart; + } + delete pixel.origColor; // remove stain + if (pixel.r && !elementInfo.rotatable) { + delete pixel.r; + } + if (pixel.flipX && !elementInfo.flippableX) { + delete pixel.flipX; + } + if (pixel.flipY && !elementInfo.flippableY) { + delete pixel.flipY; + } + // If elementInfo.flippableX, set it to true or false randomly + if (elementInfo.flipX !== undefined) { pixel.flipX = elementInfo.flipX } + else if (elementInfo.flippableX) { + pixel.flipX = Math.random() >= 0.5; + } + // If elementInfo.flippableY, set it to true or false randomly + if (elementInfo.flipY !== undefined) { pixel.flipY = elementInfo.flipY } + else if (elementInfo.flippableY) { + pixel.flipY = Math.random() >= 0.5; + } + if (elementInfo.temp !== undefined && changetemp) { + pixel.temp = elementInfo.temp; + pixelTempCheck(pixel) + } + if (pixel.con && !elementInfo.canContain) { + delete pixel.con; + } + // If elementInfo.properties, set each key to its value + if (elementInfo.properties !== undefined) { + for (var key in elementInfo.properties) { + // If it is an array or object, make a copy of it + if (typeof elementInfo.properties[key] == "object") { + pixel[key] = JSON.parse(JSON.stringify(elementInfo.properties[key])); + } + else { + pixel[key] = elementInfo.properties[key]; + } + } + } + checkUnlock(element); +} + + +elements.mixer = { + color: "#999999", + ignore: ["mixer"], + category:"machines", + insulate:true, + hardness: 1, + tick: function(pixel) { + if (!isEmpty(pixel.x-1,pixel.y,true) && !isEmpty(pixel.x+1,pixel.y,true) && isEmpty(pixel.x,pixel.y+1,false)) + { + if(elements.mixer.ignore.includes(pixelMap[pixel.x-1][pixel.y].element) || elements.mixer.ignore.includes(pixelMap[pixel.x+1][pixel.y].element)) + { + return; + } + else + { + createPixel(mixture([pixelMap[pixel.x-1][pixel.y].element,pixelMap[pixel.x+1][pixel.y].element]),pixel.x,pixel.y+1); + deletePixel(pixel.x-1,pixel.y); + deletePixel(pixel.x+1,pixel.y); + } + } + doDefaults(pixel); + }, + maxSize: 1 +}; \ No newline at end of file From d42a377c7d0b4af481d2d105ef7707ac907e7669 Mon Sep 17 00:00:00 2001 From: IreoftheShire <155935118+IreoftheShire@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:05:41 -0700 Subject: [PATCH 31/67] Batteries.js Adds Batteries and a test Radio. --- mods/Batteries.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 mods/Batteries.js diff --git a/mods/Batteries.js b/mods/Batteries.js new file mode 100644 index 00000000..54ac3ce9 --- /dev/null +++ b/mods/Batteries.js @@ -0,0 +1,89 @@ + +elements.charged_battery= { + color: "#9c6c25", + behavior: [ + "XX|SH%50|XX", // shocks (adds charge) + "SH%50|CH:low_battery%0.05|SH%50", + "XX|SH%50|XX", + ], + colorOn: "#00ff00", + category: "machines", + tempHigh: 1455.5, + stateHigh: ["molten_steel","explosion","acid_gas"], + charge: 0.5, + conduct: 1, +}; +elements.low_battery= { + color: "#9c6c25", + behavior: [ + "XX|SH%10|XX", // shocks (adds charge) + "SH%10|CH:dead_battery%0.05|SH%10", + "XX|SH%10|XX", + ], + colorOn: "#4fb613", + category: "machines", + tempHigh: 1455.5, + stateHigh: ["molten_steel","explosion","acid_gas"], + charge: 0.5, + conduct: 0.75, +}; +elements.dead_battery= { + color: "#9c6c25", + behavior: [ + "XX|SH%0.005|XX", // shocks (adds charge) + "SH%0.005|XX|SH%0.005", + "XX|SH%0.005|XX", + ], + colorOn: "#699e19", + category: "machines", + tempHigh: 1455.5, + stateHigh: ["molten_steel","explosion","acid_gas"], + charge: 0.5, + conduct: 0.5, +}; +elements.radio_broadcaster= { + color: "#78784c", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|SH AND CR:radio_wave AND CR:radio_wave|XX", + "SH AND CR:radio_wave AND CR:radio_wave|XX|SH AND CR:radio_wave AND CR:radio_wave", + "XX|SH AND CR:radio_wave AND CR:radio_wave|XX", + ], + colorOn: "#ffff59", + category: "machines", + tempHigh: 1455.5, + stateHigh: ["molten_steel","explosion","acid_gas"], + conduct: 1 +}; +elements.radio_receiver= { + color: "#78784c", + behavior: behaviors.WALL, + reactions: {radio_wave: {elem2: "electric", chance: 0.75}}, + colorOn: "#ffff59", + category: "machines", + tempHigh: 1455.5, + stateHigh: ["molten_steel","explosion","acid_gas"], + conduct: 1 +}; +elements.radio_wave= { + color: ["#000000"], + behavior: behaviors.BOUNCY, + behaviorOn: [ + ["XX","CL","XX"], + ["CL","DL%5","CL"], + ["XX","CL","XX"] + ] + , + colorOn: "#000000", + tick: function(pixel){ + if (currentElement == "radio_wave"){ + pixel.color = "rgb(15, 15, 15)"; + } else { + pixel.color = "rgba(0, 0, 0, -1)"; + } + }, + category: "energy", + density: 1, + //charge: 0.5, + conduct: 0.01 +}; \ No newline at end of file From 3ad5b1e5c51799921819eb8e55fdd531535f798d Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:59:56 +0800 Subject: [PATCH 32/67] useful mod --- mods/mobile_shift.js | 336 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 336 insertions(+) create mode 100644 mods/mobile_shift.js diff --git a/mods/mobile_shift.js b/mods/mobile_shift.js new file mode 100644 index 00000000..34bd6cb8 --- /dev/null +++ b/mods/mobile_shift.js @@ -0,0 +1,336 @@ +mobileshift = null; +mobileShiftButton = document.createElement("button"); +mobileShiftButton.onclick = function() { + if (mobileshift == "shift") { + mobileshift = null;this.setAttribute("on","false"); + onShiftDown(1); + } else { + mobileshift = "shift"; + this.setAttribute("on","true"); + onShiftDown(0); + }; + focusGame(); + on="false" +}; +mobileShiftButton.textContent = "Shift"; +window.addEventListener("load",function(){ + document.getElementById("toolControls").appendChild(mobileShiftButton); +}); + +elements.heat.tool = function(pixel) { + if (mobileshift == "shift" || shiftDown) {pixel.temp += elements.heat.temp+(Math.random()*elements.heat.temp*1.5)*20;} + else {pixel.temp += elements.heat.temp+(Math.random()*elements.heat.temp*1.5);} + pixelTempCheck(pixel); +} +elements.cool.tool = function(pixel) { + if (shiftDown) {pixel.temp += elements.cool.temp+(Math.random()*elements.cool.temp*1.5)*20;} + else {pixel.temp += elements.cool.temp+(Math.random()*elements.cool.temp*1.5);} + pixelTempCheck(pixel); +} +elements.drag.tool = function(pixel) { + if (!dragStart) { + dragStart = pixelTicks; + draggingPixels = []; + } + if (pixelTicks === dragStart && !pixel.drag && (elements[pixel.element].movable || shiftDown || mobileshift == "shift")) { + pixel.drag = true; + draggingPixels.push(pixel); + } +} +elements.paint.tool = function(pixel) { + if (!shiftDown && mobileshift != "shift") { + pixel.color = pixelColorPick(pixel,currentColor) + } + else { + // convert the hex of currentColor to rgb and set it as a string + var rgb = currentColor.replace("#","").match(/.{1,2}/g); + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(rgb[i],16); + } + pixel.color = "rgb(" + rgb.join(",") + ")" + } + delete pixel.origColor; +} +elements.milk.onMix = function(milk1, milk2) { + if (shiftDown && Math.random() < 0.01) { + changePixel(milk1,"butter") + } +} +elements.cream.onMix = function(milk1, milk2) { + if ((shiftDown && Math.random() < 0.01) || (elements[milk2.element].id === elements.milk.id && Math.random() < 0.00025)) { + changePixel(milk1,"butter") + } +} +elements.batter.onMix = function(batter,ingredient) { + if (elements[ingredient.element].isFood && elements[ingredient.element].id !== elements.batter.id && elements[ingredient.element].id !== elements.flour.id && elements[ingredient.element].id !== elements.yolk.id && elements[ingredient.element].id !== elements.dough.id && elements[ingredient.element].id !== elements.baked_batter.id) { + var rgb1 = batter.color.match(/\d+/g); + var rgb2 = ingredient.color.match(/\d+/g); + // average the colors + var rgb = [ + Math.round((parseInt(rgb1[0])*10+parseInt(rgb2[0]))/11), + Math.round((parseInt(rgb1[1])*10+parseInt(rgb2[1]))/11), + Math.round((parseInt(rgb1[2])*10+parseInt(rgb2[2]))/11) + ]; + // convert rgb to hex + var hex = RGBToHex(rgb); + batter.color = pixelColorPick(batter, hex); + if ((elements[ingredient.element].density > elements.batter.density || shiftDown || mobileshift == "shift") && Math.random() < 0.05) { + // 50% change to delete ingredient + if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); } + else { + ingredient.color = pixelColorPick(ingredient, hex); + } + } + } +} +elements.cook.tool = function(pixel) { + if (!shiftDown && mobileshift != "shift") { + pixel.temp += 0.5; + pixelTempCheck(pixel); + } + else { + pixel.temp += 1; + pixelTempCheck(pixel); + } +} +elements.debug.tool = function(pixel) { + mouseIsDown = false; + shiftDown = false; + mobileshift = null; + var output = pixel.element.toUpperCase()+" at x"+pixel.x+", y"+pixel.y+", tick"+pixelTicks+"\n"; + for (var i in pixel) { + if (i !== "x" && i !== "y" && i !== "element") { + output += " " + i + ": " + pixel[i] + "\n"; + } + } + console.log(output); + console.log(JSON.stringify(pixel)); + alert(output); + lastDebug = pixelTicks; +} +function mouseClick(e) { + if (showingMenu && currentElement != "lookup") { + closeMenu(); + return false; + } + mouseIsDown = true; + lastPlace = -100; + if (e.button === 0) { + mouseType = "left"; + } + else if (e.button === 2) { + mouseType = "right"; + } + else if (e.button === 1) { + mouseType = "middle"; + } + else { + mouseType = "left"; + } + if ((e.button === 0 || e.touches) && placingImage) { + if (e.touches) { mouseMove(e); } + placeImage(); + return false; + } + else if (mobileshift == "shift" && e.button !== 1 && !((elements[currentElement].tool || elements[currentElement].category==="tools") && mouseType==="left")|| shiftDown && e.button !== 1 && !((elements[currentElement].tool || elements[currentElement].category==="tools") && mouseType==="left")) { + shaping = 1; + shapeStart = mousePos; + } + if (elements[currentElement].singleColor) { + // choose random item from .color + if (Array.isArray(elements[currentElement].color)) { + currentColor = elements[currentElement].color[Math.floor(Math.random() * elements[currentElement].color.length)]; + } + else { currentColor = elements[currentElement].color;} + // convert from rgb(r,g,b) to #rrggbb + // RGBToHex takes an array of integers + if (currentColor.indexOf("rgb") !== -1) { + var rgb = currentColor.match(/\d+/g); + currentColor = RGBToHex([parseInt(rgb[0]),parseInt(rgb[1]),parseInt(rgb[2])]); + } + } + mouseMove(e); + return false; +} +function placeImage(placementX,placementY,scale) { + if (!scale) { scale = mouseSize } + // downscale the placingImage.height) { + canvas.width = mouseSize; + canvas.height = Math.round(placingImage.height/placingImage.width*mouseSize); + } + else { + canvas.height = mouseSize; + canvas.width = Math.round(placingImage.width/placingImage.height*mouseSize); + } + var newWidth = canvas.width; + var newHeight = canvas.height; + var ctx = canvas.getContext("2d"); + if (settings.imagesmooth === 0) { + ctx.webkitImageSmoothingEnabled = false; + ctx.mozImageSmoothingEnabled = false; + ctx.imageSmoothingEnabled = false; + } + ctx.drawImage(placingImage,0,0,newWidth,newHeight); + var newImage = ctx.getImageData(0,0,newWidth,newHeight); + var elem = (settings.imageelem || "wood"); + if (!elements[elem] || elements[elem].tool || elements[elem].canPlace===false) { elem = "wood";} + // loop through each pixel in the ImageData + for (var x = 0; x < newWidth; x++) { + for (var y = 0; y < newHeight; y++) { + var i = (y*newWidth+x)*4; + var r = newImage.data[i]; + var g = newImage.data[i+1]; + var b = newImage.data[i+2]; + var a = newImage.data[i+3]; + if (a > 0.33) { + // mousePos is the center of the image + var pixelX = (placementX||mousePos.x) - Math.round(newWidth/2) + x+1; + var pixelY = (placementY||mousePos.y) - Math.round(newHeight/2) + y+1; + if (isEmpty(pixelX,pixelY)) { + createPixel(elem,pixelX,pixelY); + pixelMap[pixelX][pixelY].color = pixelColorPick(pixelMap[pixelX][pixelY], RGBToHex([r,g,b])); + } + else if (!outOfBounds(pixelX,pixelY) && (mobileshift == "shift" || shiftDown || mode === "replace")) { + changePixel(pixelMap[pixelX][pixelY],elem); + pixelMap[pixelX][pixelY].color = pixelColorPick(pixelMap[pixelX][pixelY], RGBToHex([r,g,b])); + } + } + } + } +} +function mouse1Action(e,mouseX=undefined,mouseY=undefined,startPos) { + if (currentElement === "erase") { mouse2Action(e,mouseX,mouseY); return; } + else if (currentElement === "pick") { mouseMiddleAction(e,mouseX,mouseY); return; } + // If x and y are undefined, get the mouse position + if (mouseX == undefined && mouseY == undefined) { + // var canvas = document.getElementById("game"); + // var ctx = canvas.getContext("2d"); + lastPos = mousePos; + mousePos = getMousePos(canvas, e); + var mouseX = mousePos.x; + var mouseY = mousePos.y; + } + var cooldowned = false; + if ((mouseSize===1 || elements[currentElement].maxSize===1) && elements[currentElement].cooldown) { + if (pixelTicks-lastPlace < elements[currentElement].cooldown) { + return; + } + cooldowned = true; + } + lastPlace = pixelTicks; + startPos = startPos || lastPos + if (!(isMobile || (cooldowned && startPos.x===lastPos.x && startPos.y===lastPos.y) || elements[currentElement].tool || elements[currentElement].category==="tools")) { + var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); + } + else { var coords = mouseRange(mouseX,mouseY); } + var element = elements[currentElement]; + var mixList = []; + // For each x,y in coords + for (var i = 0; i < coords.length; i++) { + var x = coords[i][0]; + var y = coords[i][1]; + + if (currentElement === "mix") { + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + if (!(elements[pixel.element].movable !== true || elements[pixel.element].noMix === true) || shiftDown || mobileshift == "shift") { + mixList.push(pixel); + } + } + } + else if (currentElement === "shock") { + if (!isEmpty(x,y,true)) { + // One loop that repeats 5 times if shiftDown else 1 time + for (var j = 0; j < (shiftDown ? 5 : 1); j++) { + var pixel = pixelMap[x][y]; + var con = elements[pixel.element].conduct; + if (con == undefined) {continue} + if (Math.random() < con) { // If random number is less than conductivity + if (!pixel.charge && !pixel.chargeCD) { + pixel.charge = 1; + if (elements[pixel.element].colorOn) { + pixel.color = pixelColorPick(pixel); + } + } + } + else if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation) + pixel.temp += 0.25; + pixelTempCheck(pixel); + } + } + } + } + else if (currentElement === "random" && isEmpty(x, y)) { + // create pixel with random element from "randomChoices" array + currentPixels.push(new Pixel(x, y, randomChoices[Math.floor(Math.random() * randomChoices.length)])); + } + else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) { + // run the tool function on the pixel + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + // if the current element has an ignore property and the pixel's element is in the ignore property, don't do anything + if (elements[currentElement].ignore && elements[currentElement].ignore.indexOf(pixel.element) != -1) { + continue; + } + elements[currentElement].tool(pixel); + } + } + else if (mode === "replace") { + if (outOfBounds(x,y)) { + continue; + } + // Remove pixel at position from currentPixels + var index = currentPixels.indexOf(pixelMap[x][y]); + if (index > -1) { + currentPixels.splice(index, 1); + } + if (currentElement == "random") { + currentPixels.push(new Pixel(x, y, randomChoices[Math.floor(Math.random() * randomChoices.length)])); + } + else { + currentPixels.push(new Pixel(x, y, currentElement)); + } + if (elements[currentElement].customColor || elements[currentElement].singleColor) { + pixelMap[x][y].color = pixelColorPick(currentElement,currentColor); + } + if (currentElementProp) { + for (var key in currentElementProp) { + pixelMap[x][y][key] = currentElementProp[key] + } + } + } + else if (isEmpty(x, y)) { + currentPixels.push(new Pixel(x, y, currentElement)); + if (elements[currentElement].customColor || elements[currentElement].singleColor) { + pixelMap[x][y].color = pixelColorPick(currentElement,currentColor); + } + if (currentElementProp) { + for (var key in currentElementProp) { + pixelMap[x][y][key] = currentElementProp[key] + } + } + } + } + if (currentElement == "mix") { + // 1. repeat for each pixel in mixList + // 2. choose 2 random pixels and swap their x and y + // 3. remove pixel from mixList + for (var i = 0; i < mixList.length; i++) { + var pixel1 = mixList[Math.floor(Math.random()*mixList.length)]; + var pixel2 = mixList[Math.floor(Math.random()*mixList.length)]; + swapPixels(pixel1,pixel2); + mixList.splice(mixList.indexOf(pixel1),1); + mixList.splice(mixList.indexOf(pixel2),1); + if (elements[pixel1.element].onMix) { + elements[pixel1.element].onMix(pixel1,pixel2); + } + if (elements[pixel2.element].onMix) { + elements[pixel2.element].onMix(pixel2,pixel1); + } + } + + } +} From 5f13e75bc5fa2cab682156762e22db27a274da32 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:02:29 +0800 Subject: [PATCH 33/67] mobile shift --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index a38b5fb2..0ae2d891 100644 --- a/mod-list.html +++ b/mod-list.html @@ -137,6 +137,7 @@ find.jsAdds a find mode that highlights a chosen element as pulsating red and yellow (read commit description)Alice insane_random_events.jsMassively buffs random eventsAlice invertscroll.jsInverts the scroll wheel for adjusting brush sizeSquareScreamYT +mobile_shift.jsAdds a button for shift on mobileSquareScreamYT moretools.jsAdds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)Sightnado move_tools.jsAdds tools that move pixelsAlice noconfirm.jsRemoves all confirmation pop upsmollthecoder From b23242feebb07611254a03155314150b12e08969 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:11:44 +0800 Subject: [PATCH 34/67] milk --- mods/mobile_shift.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/mobile_shift.js b/mods/mobile_shift.js index 34bd6cb8..60fa64ce 100644 --- a/mods/mobile_shift.js +++ b/mods/mobile_shift.js @@ -52,12 +52,12 @@ elements.paint.tool = function(pixel) { delete pixel.origColor; } elements.milk.onMix = function(milk1, milk2) { - if (shiftDown && Math.random() < 0.01) { + if (shiftDown && Math.random() < 0.01 || mobileshift == "shift" && Math.random() < 0.01) { changePixel(milk1,"butter") } } elements.cream.onMix = function(milk1, milk2) { - if ((shiftDown && Math.random() < 0.01) || (elements[milk2.element].id === elements.milk.id && Math.random() < 0.00025)) { + if ((shiftDown && Math.random() < 0.01 || mobileshift == "shift" && Math.random() < 0.01) || (elements[milk2.element].id === elements.milk.id && Math.random() < 0.00025)) { changePixel(milk1,"butter") } } From bd78eee2239897c5b9ae08e9bf4e3536187a324c Mon Sep 17 00:00:00 2001 From: IreoftheShire <155935118+IreoftheShire@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:12:33 -0700 Subject: [PATCH 35/67] Update Batteries.js --- mods/Batteries.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mods/Batteries.js b/mods/Batteries.js index 54ac3ce9..424a79a7 100644 --- a/mods/Batteries.js +++ b/mods/Batteries.js @@ -20,6 +20,11 @@ elements.low_battery= { "SH%10|CH:dead_battery%0.05|SH%10", "XX|SH%10|XX", ], + behaviorOn: [ + "XX|SH%10|XX", // shocks (adds charge) + "SH%10|CH:charged_battery%0.05|SH%10", + "XX|SH%10|XX", + ], colorOn: "#4fb613", category: "machines", tempHigh: 1455.5, @@ -30,9 +35,14 @@ elements.low_battery= { elements.dead_battery= { color: "#9c6c25", behavior: [ - "XX|SH%0.005|XX", // shocks (adds charge) - "SH%0.005|XX|SH%0.005", - "XX|SH%0.005|XX", + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + behaviorOn: [ + "XX|XX|XX", + "XX|CH:low_battery%0.05|XX", + "XX|XX|XX", ], colorOn: "#699e19", category: "machines", @@ -86,4 +96,4 @@ elements.radio_wave= { density: 1, //charge: 0.5, conduct: 0.01 -}; \ No newline at end of file +}; From 9a3a0c0da4a3bf48019286378876e46152b8cf49 Mon Sep 17 00:00:00 2001 From: voidapex11 <154328367+voidapex11@users.noreply.github.com> Date: Sun, 14 Apr 2024 09:48:42 +0100 Subject: [PATCH 36/67] Update pullers.js --- mods/pullers.js | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/mods/pullers.js b/mods/pullers.js index b0b4e7e7..0072128a 100644 --- a/mods/pullers.js +++ b/mods/pullers.js @@ -2,19 +2,23 @@ // a sandboxels mod that adds pullers /* ==CHANGELOG== - Version 1.1.1# + Version 1.1.2 @voidapex11 -~initial comit +~fixed spelling mistake's + + Version 1.1.1 +@voidapex11 +~initial commit +pullersDesc +imovable_inator& movable_inator +imovable wall, steel & insulation +L, R, U & D pullers +void light&dark -~don't comit without permision as you may disrupt other dev's hard work +~don't commit without permission as you may disrupt other dev's hard work ~update changelog with newer updates first ~Version format is: - rewrites.major updates.paches&minor feechers - put a '#' at end of version format if it has not been pushed to the github + rewrites.major updates.paches&minor features + put a '#' at the end of the version format if it has not been pushed to the github ~for change-log '~' means notes/changes '+' means aditions and '-' is removals */ @@ -41,10 +45,10 @@ elements.pullersDesc = { }; // for the inator reference: if you know you know -elements.imovable_inator = { +elements.immovable_inator = { color: "#525252", tool: function(pixel) { - pixel.imovable = true + pixel.immovable = true }, category: "tools", } @@ -52,14 +56,14 @@ elements.imovable_inator = { elements.movable_inator = { color: "#a8a8a8", tool: function(pixel) { - pixel.imovable = false + pixel.immovable = false }, category: 'tools', } -elements.imovable_wall = { +elements.immovable_wall = { color: "#808080", behavior: behaviors.WALL, category: "solids", @@ -67,11 +71,11 @@ elements.imovable_wall = { hardness: 1, noMix: true, properties: { - imovable: true + immovable: true } } -elements.imovable_steel = { +elements.immovable_steel = { color: "#71797e", behavior: behaviors.WALL, reactions: { @@ -92,11 +96,11 @@ elements.imovable_steel = { conduct: 0.42, hardness: 0.8, properties: { - imovable: true + immovable: true } } -elements.imovable_insulation = { +elements.immovable_insulation = { color: "#b8aea5", behavior: behaviors.WALL, category: "solids", @@ -104,7 +108,7 @@ elements.imovable_insulation = { state: "solid", noMix: true, properties: { - imovable: true + immovable: true } } @@ -123,7 +127,7 @@ elements.left_puller = { for (i = 1; i <= pixel.range; i++) { if (!isEmpty(pixel.x + i, pixel.y, true)) { - if (pixelMap[pixel.x+i][pixel.y]['imovable']) {break} + if (pixelMap[pixel.x+i][pixel.y]['immovable']) {break} else { tryMove(pixelMap[pixel.x + i][pixel.y], pixel.x + i - 1, pixel.y); } @@ -157,7 +161,7 @@ elements.right_puller = { for(h = pixel.pushStrength; h >= pixel.pushStrength; h--) { for (i = 1; i <= pixel.range; i++) { if (!isEmpty(pixel.x - i, pixel.y, true)) { - if (pixelMap[pixel.x-i][pixel.y]['imovable']) {break} + if (pixelMap[pixel.x-i][pixel.y]['immovable']) {break} else { tryMove(pixelMap[pixel.x - i][pixel.y], pixel.x - i + 1, pixel.y); } @@ -190,7 +194,7 @@ elements.down_puller = { for (i = 1; i <= pixel.range; i++) { if (!isEmpty(pixel.x, pixel.y - i, true)) { - if (pixelMap[pixel.x][pixel.y - i]['imovable']) {break} + if (pixelMap[pixel.x][pixel.y - i]['immovable]) {break} else { tryMove(pixelMap[pixel.x][pixel.y - i], pixel.x, pixel.y - i + 1); } @@ -223,7 +227,7 @@ elements.up_puller = { for (i = 1; i <= pixel.range; i++) { if (!isEmpty(pixel.x, pixel.y + i, true)) { - if (pixelMap[pixel.x][pixel.y + i]['imovable']){ + if (pixelMap[pixel.x][pixel.y + i]['immovable']){ break } else { @@ -246,5 +250,5 @@ elements.up_puller = { } if (enabledMods.includes("pushers.js")) { - console.info('compatibility with pushers.js and imovable objects coming in a later update of the pullers.js') + console.log('compatibility with pushers.js and imovable objects coming in a later update of the pullers.js\neventualy...') } From 43d858f153d8eb33edb3fc5e04be4da89d52a383 Mon Sep 17 00:00:00 2001 From: voidapex11 <154328367+voidapex11@users.noreply.github.com> Date: Sun, 14 Apr 2024 09:51:36 +0100 Subject: [PATCH 37/67] Update mod-list.html --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index 0ae2d891..1cc72a2a 100644 --- a/mod-list.html +++ b/mod-list.html @@ -199,6 +199,7 @@ note_block.jsAdds musical Note BlocksAlice nousersthings.jsDestroyable machines, pipe variants, filters, and morenousernamefound portal.jsAdds portals that can teleport pixelsAlice +pushers.jsAdds pixels that pull pixels towards themvoidapex11 pushers.jsAdds pixels that push elements away from themAlice spouts.jsAdds spouts for all liquidskaeud state_voids.jsAdds several elements that each delete a specific state of matter (and combinations thereof)Alice From d1093bf7f5992fe2730fd1c624653d36c2adc46d Mon Sep 17 00:00:00 2001 From: scen2tester <156643479+scen2tester@users.noreply.github.com> Date: Sun, 14 Apr 2024 17:39:47 -0400 Subject: [PATCH 38/67] shipstuff.js mod go to the shipstuff.js thread for more info :D --- mods/shipstuff.js | 198 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 mods/shipstuff.js diff --git a/mods/shipstuff.js b/mods/shipstuff.js new file mode 100644 index 00000000..d8769099 --- /dev/null +++ b/mods/shipstuff.js @@ -0,0 +1,198 @@ +// Shipstuff, made by netty + +// Ship materials +elements.ship_steel = { + color: ["#2B7D15", "#2B7D15", "#34E504"], + behavior: behaviors.WALL, + hardness: 1, + tempHigh: 9500, + stateHigh: "magma", + density: 1e+20, +}; +// Bombers +elements.bomberLeft = { + color: "#555757", + conduct: 1, + behavior: behaviors.WALL, + behaviorOn: [ + "XX|XX|XX", + "CR:ship_missileL|XX|XX", + "XX|XX|XX", + ], +}; +elements.bomberRight = { + color: "#555757", + behavior: behaviors.WALL, + conduct: 1, + behaviorOn: [ + "XX|XX|XX", + "XX|XX|CR:ship_missileR", + "XX|XX|XX", + ], +}; + +// Missiles +elements.ship_missileR = { + color: "#FFFFFF", + hidden: true, + behavior: [ + "XX|XX|XX", + "CR:fw_ember|XX|M1", + "XX|XX|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x4 = pixel.x+coord[0]; + var y4 = pixel.y+coord[1]; + if (isEmpty(x4, y4, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 25, "plasma"); + } + } +}, +}; +elements.ship_missileL = { + color: "#FFFFFF", + hidden: true, + behavior: [ + "XX|XX|XX", + "M1|XX|CR:fw_ember", + "XX|XX|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x5 = pixel.x+coord[0]; + var y5 = pixel.y+coord[1]; + if (isEmpty(x5, y5, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 25, "plasma"); + } + } +}, +}; + elements.ship_missile = { + color: ["#F5F6F5", "#E1DFDF"], + category: "weapons", + behavior: [ + "XX|M1|XX", + "XX|XX|XX", + "XX|CR:flash|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x6 = pixel.x+coord[0]; + var y6 = pixel.y+coord[1]; + if (isEmpty(x6, y6, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 30, "plasma, fire, fw_ember"); + } + } + }, + }; + elements.ship_flare = { + color: ["#FFBD00", "#FF4200", "#7C00FF"], + category: "weapons", + behavior: [ + "XX|M1|XX", + "XX|XX|XX", + "XX|CR:smoke|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x7 = pixel.x+coord[0]; + var y7 = pixel.y+coord[1]; + if (isEmpty(x7, y7, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 20, "fw_ember, smoke"); + } + } + }, + }; +// Bombs / Nukes +elements.stationary_nuke = { +color: ["#E7E71B", "#CCCC31", "#048904"], +burn: 25, +burnInto: "n_explosion", +burnTime: 200, +behavior: WALL, +}; +elements.naval_mine = { + color: ["#0C32A0", "#09267A"], + behavior: behaviors.POWDER, + reactions: { + "water": { elem1: "explosion", elem2: "water" }, + "salt_water": { elem1: "explosion", elem2: "salt" }, + }, + hardness: 0.45, + density: 500, +}; + +// Other ship materials +elements.tempered_glass = { + color: "#A1A1A1", + behavior: behaviors.WALL, + colorPattern: textures.GLASS, + colorKey: { + "g": "#5e807d", + "s": "#638f8b", + "S": "#679e99"}, + hardnesss: 0.85, + tempHigh: 2500, + stateHigh: "rad_glass", + density: 5700, +}; +elements.bulletproof_glass= { + color: "#5E5F5E", + behavior: behaviors.WALL, + colorPattern: textures.GLASS, + colorKey: { + "g": "#5e807d", + "s": "#638f8b", + "S": "#679e99"}, + hardnesss: 0.94, + tempHigh: 3500, + stateHigh: "rad_glass", + density: 6000, +}; +elements.asphalt = { + color: "#313131", + behavior: behaviors.WALL, + hardness: 0.35, + density: 145, + tempHigh: 2500, + stateHigh: "molten_asphalt", +}; +elements.molten_asphalt = { + color: "#313131", + behavior: behaviors.LIQUID, + hardness: 0.30, + density: 125, + temp: 3000, + burnTime: 50 +}; +// Technologies +elements.flare_shooter = { + color: ["#000000", "#FFBD00"], + conduct: 1, + behavior: behaviors.WALL, + behaviorOn: [ + "XX|CR:ship_flare|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + hardness: 0.20, + tempHigh: 2000, + stateHigh: "molten_glass", + density: 900, +}; +elements.flying_nuker ={ + color: ["#0BD10B", "#034603"], + behavior: [ + "XX|XX|XX", + "XX|XX|M1 AND BO", + "XX|CR:nuke|XX", + ], + hardness: 0.55, + density: 300 +}; +// End of mod \ No newline at end of file From 0b42760a9403df18a0d641ecd1392e3d45f984ee Mon Sep 17 00:00:00 2001 From: scen2tester <156643479+scen2tester@users.noreply.github.com> Date: Sun, 14 Apr 2024 17:49:12 -0400 Subject: [PATCH 39/67] Add files via upload --- mods/shipstuff.js | 198 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 mods/shipstuff.js diff --git a/mods/shipstuff.js b/mods/shipstuff.js new file mode 100644 index 00000000..d8769099 --- /dev/null +++ b/mods/shipstuff.js @@ -0,0 +1,198 @@ +// Shipstuff, made by netty + +// Ship materials +elements.ship_steel = { + color: ["#2B7D15", "#2B7D15", "#34E504"], + behavior: behaviors.WALL, + hardness: 1, + tempHigh: 9500, + stateHigh: "magma", + density: 1e+20, +}; +// Bombers +elements.bomberLeft = { + color: "#555757", + conduct: 1, + behavior: behaviors.WALL, + behaviorOn: [ + "XX|XX|XX", + "CR:ship_missileL|XX|XX", + "XX|XX|XX", + ], +}; +elements.bomberRight = { + color: "#555757", + behavior: behaviors.WALL, + conduct: 1, + behaviorOn: [ + "XX|XX|XX", + "XX|XX|CR:ship_missileR", + "XX|XX|XX", + ], +}; + +// Missiles +elements.ship_missileR = { + color: "#FFFFFF", + hidden: true, + behavior: [ + "XX|XX|XX", + "CR:fw_ember|XX|M1", + "XX|XX|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x4 = pixel.x+coord[0]; + var y4 = pixel.y+coord[1]; + if (isEmpty(x4, y4, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 25, "plasma"); + } + } +}, +}; +elements.ship_missileL = { + color: "#FFFFFF", + hidden: true, + behavior: [ + "XX|XX|XX", + "M1|XX|CR:fw_ember", + "XX|XX|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x5 = pixel.x+coord[0]; + var y5 = pixel.y+coord[1]; + if (isEmpty(x5, y5, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 25, "plasma"); + } + } +}, +}; + elements.ship_missile = { + color: ["#F5F6F5", "#E1DFDF"], + category: "weapons", + behavior: [ + "XX|M1|XX", + "XX|XX|XX", + "XX|CR:flash|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x6 = pixel.x+coord[0]; + var y6 = pixel.y+coord[1]; + if (isEmpty(x6, y6, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 30, "plasma, fire, fw_ember"); + } + } + }, + }; + elements.ship_flare = { + color: ["#FFBD00", "#FF4200", "#7C00FF"], + category: "weapons", + behavior: [ + "XX|M1|XX", + "XX|XX|XX", + "XX|CR:smoke|XX", + ], + tick: function(pixel) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x7 = pixel.x+coord[0]; + var y7 = pixel.y+coord[1]; + if (isEmpty(x7, y7, true) && !isEmpty(x, y)) { + explodeAt(pixel.x, pixel.y, 20, "fw_ember, smoke"); + } + } + }, + }; +// Bombs / Nukes +elements.stationary_nuke = { +color: ["#E7E71B", "#CCCC31", "#048904"], +burn: 25, +burnInto: "n_explosion", +burnTime: 200, +behavior: WALL, +}; +elements.naval_mine = { + color: ["#0C32A0", "#09267A"], + behavior: behaviors.POWDER, + reactions: { + "water": { elem1: "explosion", elem2: "water" }, + "salt_water": { elem1: "explosion", elem2: "salt" }, + }, + hardness: 0.45, + density: 500, +}; + +// Other ship materials +elements.tempered_glass = { + color: "#A1A1A1", + behavior: behaviors.WALL, + colorPattern: textures.GLASS, + colorKey: { + "g": "#5e807d", + "s": "#638f8b", + "S": "#679e99"}, + hardnesss: 0.85, + tempHigh: 2500, + stateHigh: "rad_glass", + density: 5700, +}; +elements.bulletproof_glass= { + color: "#5E5F5E", + behavior: behaviors.WALL, + colorPattern: textures.GLASS, + colorKey: { + "g": "#5e807d", + "s": "#638f8b", + "S": "#679e99"}, + hardnesss: 0.94, + tempHigh: 3500, + stateHigh: "rad_glass", + density: 6000, +}; +elements.asphalt = { + color: "#313131", + behavior: behaviors.WALL, + hardness: 0.35, + density: 145, + tempHigh: 2500, + stateHigh: "molten_asphalt", +}; +elements.molten_asphalt = { + color: "#313131", + behavior: behaviors.LIQUID, + hardness: 0.30, + density: 125, + temp: 3000, + burnTime: 50 +}; +// Technologies +elements.flare_shooter = { + color: ["#000000", "#FFBD00"], + conduct: 1, + behavior: behaviors.WALL, + behaviorOn: [ + "XX|CR:ship_flare|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + hardness: 0.20, + tempHigh: 2000, + stateHigh: "molten_glass", + density: 900, +}; +elements.flying_nuker ={ + color: ["#0BD10B", "#034603"], + behavior: [ + "XX|XX|XX", + "XX|XX|M1 AND BO", + "XX|CR:nuke|XX", + ], + hardness: 0.55, + density: 300 +}; +// End of mod \ No newline at end of file From 2d337fa145d523306cc8e77d06bd52b912b7d584 Mon Sep 17 00:00:00 2001 From: GuyWhoGotSpringlocked <163777207+GWhoGS@users.noreply.github.com> Date: Sun, 14 Apr 2024 20:59:17 -0400 Subject: [PATCH 40/67] survival.js but it's basically cheating Credits to Ryan for the base mod (and the game itself) --- mods/easysurvival.js | 518 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 518 insertions(+) create mode 100644 mods/easysurvival.js diff --git a/mods/easysurvival.js b/mods/easysurvival.js new file mode 100644 index 00000000..9b8aba3f --- /dev/null +++ b/mods/easysurvival.js @@ -0,0 +1,518 @@ +if (!settings.survival) { + settings.survival = { + "wall": 9999, + "dirt": 9999, + "sapling": 10, + "seeds": 50, + "ice": 250, + "cloner": 10, + } +} +settings.survival.cloner = 1; +settings.unhide = 0; +// settings.survivalClone=null; settings.survival = null; saveSettings(); + +survivalTimeout = null; +function survivalSave() { + if (survivalTimeout) { clearTimeout(survivalTimeout); } + survivalTimeout = setTimeout(function(){ + saveSettings(); + },1000); +} +function survivalAdd(element,amount,skipSave) { + if (elements[element].category === "tools") { return } + if (settings.survival[element]) { + settings.survival[element] += amount; + } + else { + settings.survival[element] = amount; + } + survivalUpdate(element); + if (!skipSave) {survivalSave()} +} +function survivalRemove(element,amount,skipSave) { + if (elements[element].category === "tools") { return } + if (settings.survival[element]) { + settings.survival[element] -= amount; + survivalUpdate(element); + } + if (settings.survival[element] <= 0) { + delete settings.survival[element]; + var btn = document.getElementById("elementButton-"+element); + if (btn) { btn.remove(); } + selectElement("unknown"); + } + if (!skipSave) {survivalSave()} +} +function survivalCount(element) { + return settings.survival[element] || 0; +} +function survivalUpdate(element) { + if (element === "gold_coin") { + // if it is not an integer, round it to 0.1 + if (settings.survival.gold_coin % 1 !== 0) { + settings.survival.gold_coin = Math.round(settings.survival.gold_coin*10)/10; + } + document.getElementById("coinCount").innerHTML = settings.survival.gold_coin||0; + } + var btn = document.getElementById("elementButton-"+element); + if (elements[element] && elements[element].category === "tools") { return } + if (btn) { + btn.innerHTML = btn.innerHTML.split("(")[0]+"("+settings.survival[element]+")"; + } + else if (elements[element]) { + createElementButton(element); + document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; + } +} + +runAfterAutogen(function(){ + elements.erase.name = "pick_up"; + delete elements.paint.category; + delete elements.lookup.category; + delete elements.pick; + delete elements.prop; + elements.radiation.category = "tools"; + for (var element in elements) { + if (elements[element].category !== "tools") { + elements[element].hidden = true; + elements[element].category = "inventory"; + } + } + for (var element in settings.survival) { + if (!elements[element]) { continue; } + if (elements[element].category === "tools") { continue; } + createElementButton(element); + document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; + } +}); + +delete elements.cloner.behavior; +elements.cloner.tick = function(pixel) { + if (settings.survivalClone) { + if (Math.random() < 0.025) { + // 1 or -1 + var x = pixel.x + (Math.random() < 0.5 ? 1 : -1); + var y = pixel.y + (Math.random() < 0.5 ? 1 : -1); + if (isEmpty(x,y)) { + createPixel(settings.survivalClone,x,y); + } + } + } + else { + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break } + var element = pixelMap[x][y].element; + if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1) { continue } + settings.survivalClone = element; + survivalSave(); + break; + } + } + } +}; +elements.cloner.ignore = elements.cloner.ignore.concat(["sun","supernova"]); +elements.cloner.desc = "You can only clone one element at a time!" + +elements.smash.tool = function(pixel) { + if (elements[pixel.element].seed === true) { return } + if (elements[pixel.element].breakInto !== undefined || (elements[pixel.element].seed !== undefined && elements[pixel.element].seed !== true)) { + // times 0.25 if not shiftDown else 1 + if (Math.random() < (elements[pixel.element].hardness || 1) * (shiftDown ? 1 : 0.25)) { + var breakInto = elements[pixel.element].breakInto; + if (elements[pixel.element].seed && (!breakInto || Math.random() < 0.5)) { + if (Math.random() < 0.2) { + breakInto = elements[pixel.element].seed; + } + else { + breakInto = null; + } + } + // if breakInto is an array, pick one + if (Array.isArray(breakInto)) { + breakInto = breakInto[Math.floor(Math.random() * breakInto.length)]; + } + if (breakInto === null) { + deletePixel(pixel.x,pixel.y); + return; + } + var oldelement = pixel.element; + changePixel(pixel,breakInto); + pixelTempCheck(pixel); + if (elements[oldelement].breakIntoColor) { + pixel.color = pixelColorPick(pixel, elements[oldelement].breakIntoColor); + } + } + } +}; + +elementWorth = { + "gold_coin": 1, + "diamond": 1000^21, + "ketchup": 150, + "jelly": 120, + "soda": 104, + "toast": 120, + "oil": 1023423, + "bread": 32, + "glass": 54, + "rad_glass": 64, + "glass_shard": 42, + "rad_shard": 312412, + "paper": 512312, + "broth": 512312, + "honey": 125, + "caramel": 53, + "sap": 34, + "candy": 325, + "popcorn": 232, + "flour": 322, + "lettuce": 2232, + "sauce": 2232, + "wood": 999, + "tree_branch": 100000, + "plant": 1, + "mushroom_cap": 1, + "mushroom_gill": 3, + "vine": 1, + "cactus": 1, + "cloner": 2, + "wall": 1000^22, + "fire": 100000^232, + "smoke": 0, + "plasma": 0, + "light": 0, + "laser": 0, + "liquid_light": 0.1, + "flash": 0, + "radiation": 0, + "petal": -1, + "cell": -1, + "cancer": -1, + "foam": -1, +} +elements.sell = { + color: ["#fff0b5","#ffe680","#c48821","#986a1a","#eca832","#f0bb62"], + tool: function(pixel) { + if (elementWorth[pixel.element] === 0) { return; } + deletePixel(pixel.x,pixel.y); + if (elementWorth[pixel.element] === -1) { return; } + survivalAdd("gold_coin",elementWorth*10[pixel.element]||1); + }, + category: "tools", + desc: "Exchanges pixels for their market value in Gold Coins x 10" +} +elements.seeds.name = "seed"; + +/* +~Cloner +~Sell +Shop + Cloner Reset + ~Ammonia + ~Dirt + ~Water + ~Seeds + ~Sapling + ~Pinecone + ~Primordial Soup + ~Worm + ~Bee + ~Human + ~TNT + Seller (Runs Sell tool on pixels that touch it) + Buyer (Cloner but uses store price every time, prompt to select item on select) +Prices tab +*/ +survivalShop = { + "dirt*25": 25, + "water*25": 250, + "ammonia*25": 500, + "seeds*1": 500, + "sapling*1": 500, + "pinecone*1": 500, + "tnt*25": 1000, + "worm*1": 1000, + "bee*1": 5000, + "primordial_soup*5": 10000, + "human*1": 50000, + "sun*1": 500000, + "milk": -200^2, +} +function survivalBuy(element) { + var price = survivalShop[element]; + if (!price) { alert("The shop isn't selling "+element+"!"); return } + if (!settings.survival.gold_coin || settings.survival.gold_coin < price) { alert("You can't afford that!"); return } + survivalRemove("gold_coin",price); + var amount = 1; + if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); element = element.split("*")[0]; } + survivalAdd(element,amount); + selectElement(element); +} +function survivalResetCloner() { + if (!settings.survival.gold_coin || settings.survival.gold_coin < 1000) { alert("You can't afford that!"); return } + survivalRemove("gold_coin",1000); + settings.survivalClone = null; + survivalSave(); +} + +worldgentypes = {} +window.addEventListener("load",function(){ + // move to start of tools + var erase = document.getElementById("elementButton-erase"); + var sell = document.getElementById("elementButton-sell"); + var parent = erase.parentElement; + parent.removeChild(sell); + parent.insertBefore(sell,parent.firstChild); + parent.removeChild(erase); + parent.insertBefore(erase,parent.firstChild); + document.getElementById("replaceButton").remove(); + document.getElementById("savesButton").remove(); + document.getElementById("elemSelectButton").remove(); + doRandomEvents = function() {} + worldGen = function() {} + worldgentypes = {} + loadSave = function() {} + showSaves = function() {} + placeImage = function() {} + chooseElementPrompt = function() {} + document.getElementById("toolControls").insertAdjacentHTML("beforeend",``); + createCategoryDiv("shop"); + var shopDiv = document.getElementById("category-shop"); + shopDiv.style.display = "none"; + shopDiv.insertAdjacentHTML("beforeend",`

You have $${settings.survival.gold_coin||0}

`); + for (var element in survivalShop) { + var price = survivalShop[element]; + var button = document.createElement("button"); + var name = element; + var amount = 1; + if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); name = element.split("*")[0]; } + var elemname = name; + name = (elements[elemname].name||name).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ",".").replace(/ /g, ""); + button.classList.add("elementButton"); + button.setAttribute("element",element); + button.setAttribute("category","shop"); + button.setAttribute("title",amount+" "+name+" for $"+price); + button.innerHTML = name+" ("+amount+" for $"+price+")"; + if (elements[elemname]) { + if (elements[elemname].color instanceof Array) { + button.style.backgroundImage = "linear-gradient(to bottom right, "+elements[elemname].color.join(", ")+")"; + // choose the middlemost item in array + var colorObject = elements[elemname].colorObject[Math.floor(elements[elemname].colorObject.length/2)]; + if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { + button.className += " bright" + } + } + else { + button.style.background = elements[elemname].color; + var colorObject = elements[elemname].colorObject; + if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { + button.className += " bright" + } + } + } + button.addEventListener("click",function(){ + survivalBuy(this.getAttribute("element")); + }); + shopDiv.appendChild(button); + } + shopDiv.insertAdjacentHTML("beforeend",`

`); + + createCategoryDiv("prices"); + var pricesDiv = document.getElementById("category-prices"); + pricesDiv.style.display = "none"; + for (var element in elementWorth) { + if (elementWorth[element] <= 0) { continue } + var name = (elements[element].name||element).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ","."); + // create text with the name of the element and its worth, separated by • + var text = name+"="+elementWorth[element] + " • "; + pricesDiv.insertAdjacentHTML("beforeend",`${text}`); + } + pricesDiv.innerHTML = pricesDiv.innerHTML.slice(0,-2); + pricesDiv.innerHTML = "

"+pricesDiv.innerHTML+"

"; +}); +runAfterLoad(function(){ + checkUnlock = function(element) { + return; + } + oldClearAll = clearAll; + clearAll = function() { + if (currentPixels && currentPixels.length > 0) { + for (var i = 0; i < currentPixels.length; i++) { + var pixel = currentPixels[i]; + if (pixel && pixel.element) { + survivalAdd(pixel.element,1); + } + } + } + oldClearAll(); + } + mouseAction = function(e,mouseX,mouseY,startPos) { + if (mouseType == "left") { + mouse1Action(e,mouseX,mouseY,startPos); + } + else if (mouseType == "right") { mouse2Action(e,mouseX,mouseY,startPos); } + else if (mouseType == "middle") { mouseMiddleAction(e,mouseX,mouseY); } + } + mouse1Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { + if (currentElement === "erase") { mouse2Action(e,mouseX,mouseY); return; } + else if (currentElement === "pick") { mouseMiddleAction(e,mouseX,mouseY); return; } + // If x and y are undefined, get the mouse position + if (mouseX == undefined && mouseY == undefined) { + // var canvas = document.getElementById("game"); + // var ctx = canvas.getContext("2d"); + lastPos = mousePos; + mousePos = getMousePos(canvas, e); + var mouseX = mousePos.x; + var mouseY = mousePos.y; + } + var cooldowned = false; + if ((mouseSize===1 || elements[currentElement].maxSize===1) && elements[currentElement].cooldown) { + if (pixelTicks-lastPlace < elements[currentElement].cooldown) { + return; + } + cooldowned = true; + } + lastPlace = pixelTicks; + startPos = startPos || lastPos + if (!(isMobile || (cooldowned && startPos.x===lastPos.x && startPos.y===lastPos.y) || elements[currentElement].tool || elements[currentElement].category==="tools")) { + var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); + } + else { var coords = mouseRange(mouseX,mouseY); } + var element = elements[currentElement]; + var mixList = []; + // For each x,y in coords + for (var i = 0; i < coords.length; i++) { + var x = coords[i][0]; + var y = coords[i][1]; + + if (currentElement === "mix") { + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + if (!(elements[pixel.element].movable !== true || elements[pixel.element].noMix === true) || shiftDown) { + mixList.push(pixel); + } + } + } + else if (currentElement === "shock") { + if (!isEmpty(x,y,true)) { + // One loop that repeats 5 times if shiftDown else 1 time + for (var j = 0; j < (shiftDown ? 5 : 1); j++) { + var pixel = pixelMap[x][y]; + var con = elements[pixel.element].conduct; + if (con == undefined) {continue} + if (Math.random() < con) { // If random number is less than conductivity + if (!pixel.charge && !pixel.chargeCD) { + pixel.charge = 1; + if (elements[pixel.element].colorOn) { + pixel.color = pixelColorPick(pixel); + } + } + } + else if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation) + pixel.temp += 0.25; + pixelTempCheck(pixel); + } + } + } + } + else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) { + // run the tool function on the pixel + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + // if the current element has an ignore property and the pixel's element is in the ignore property, don't do anything + if (elements[currentElement].ignore && elements[currentElement].ignore.indexOf(pixel.element) != -1) { + continue; + } + elements[currentElement].tool(pixel); + } + } + else if (isEmpty(x, y)) { + if (survivalCount(currentElement) < 1 && elements[currentElement].category !== "tools") { + return; + } + currentPixels.push(new Pixel(x, y, currentElement)); + if (elements[currentElement].customColor || elements[currentElement].singleColor) { + pixelMap[x][y].color = pixelColorPick(currentElement,currentColor); + } + if (elements[currentElement].category !== "tools") { survivalRemove(currentElement,1); } + } + } + if (currentElement == "mix") { + for (var i = 0; i < mixList.length; i++) { + var pixel1 = mixList[Math.floor(Math.random()*mixList.length)]; + var pixel2 = mixList[Math.floor(Math.random()*mixList.length)]; + swapPixels(pixel1,pixel2); + mixList.splice(mixList.indexOf(pixel1),1); + mixList.splice(mixList.indexOf(pixel2),1); + if (elements[pixel1.element].onMix) { + elements[pixel1.element].onMix(pixel1,pixel2); + } + if (elements[pixel2.element].onMix) { + elements[pixel2.element].onMix(pixel2,pixel1); + } + } + + } + } + mouse2Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { + // Erase pixel at mouse position + if (mouseX == undefined && mouseY == undefined) { + // var canvas = document.getElementById("game"); + // var ctx = canvas.getContext("2d"); + lastPos = mousePos; + mousePos = getMousePos(canvas, e); + var mouseX = mousePos.x; + var mouseY = mousePos.y; + } + if (dragStart) { + dragStart = 0; + for (var i = 0; i < draggingPixels.length; i++) { + var pixel = draggingPixels[i]; + delete pixel.drag; + } + draggingPixels = null; + } + // If the current element is "pick" or "lookup", coords = [mouseX,mouseY] + if (currentElement == "pick" || currentElement == "lookup") { + var coords = [[mouseX,mouseY]]; + } + else if (!isMobile) { + startPos = startPos || lastPos + var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); + } + else { + var coords = mouseRange(mouseX,mouseY); + } + // For each x,y in coords + for (var i = 0; i < coords.length; i++) { + var x = coords[i][0]; + var y = coords[i][1]; + + if (!isEmpty(x, y)) { + if (outOfBounds(x,y)) { + continue + } + var pixel = pixelMap[x][y]; + survivalAdd(pixel.element,1); + delete pixelMap[x][y]; + // Remove pixel from currentPixels + for (var j = 0; j < currentPixels.length; j++) { + if (currentPixels[j].x == x && currentPixels[j].y == y) { + currentPixels.splice(j, 1); + break; + } + } + } + } + } +}) + +window.addEventListener("beforeunload",function(){ + clearAll(); + saveSettings(); +}); \ No newline at end of file From cdfcc8a612d9493e2b8d91da539e27494de02592 Mon Sep 17 00:00:00 2001 From: GuyWhoGotSpringlocked <163777207+GWhoGS@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:10:05 -0400 Subject: [PATCH 41/67] survival.js but cheating credits to Ryan for making the game & the mod survival.js --- easysurvival.js | 917 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 917 insertions(+) create mode 100644 easysurvival.js diff --git a/easysurvival.js b/easysurvival.js new file mode 100644 index 00000000..86fdcc7b --- /dev/null +++ b/easysurvival.js @@ -0,0 +1,917 @@ +behaviors = { + POWDER_OLD: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + POWDER: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y+1)) { + tryMove(pixel, pixel.x-1, pixel.y+1); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y+1)) { + tryMove(pixel, pixel.x+1, pixel.y+1); + } + } + } + doDefaults(pixel); + }, + AGPOWDER: [ + "M2|M1|M2", + "XX|XX|XX", + "XX|XX|XX", + ], + LIQUID_OLD: [ + "XX|XX|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + LIQUID: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (elements[pixel.element].viscosity && (!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + var move1Spots = [ + [pixel.x, pixel.y+1] + ] + } + else { + var move1Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x, pixel.y+1], + [pixel.x-1, pixel.y+1], + ] + } + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1); } + } + if (!moved) { + if (elements[pixel.element].viscosity===undefined || !(!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y)) { + tryMove(pixel, pixel.x-1, pixel.y); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y)) { + tryMove(pixel, pixel.x+1, pixel.y); + } + } + } + } + doDefaults(pixel); + }, + SUPERFLUID_OLD: [ + "XX|XX|XX", + "XX|XX|M2 AND BO", + "XX|M1|M2", + ], + SUPERFLUID: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + // go either left or right depending on pixel.flipX + var newx = pixel.flipX ? pixel.x-1 : pixel.x+1; + if (Math.random() < 0.5) { + if (!tryMove(pixel, newx, pixel.y)) { + pixel.flipX = !pixel.flipX; + tryMove(pixel, newx, pixel.y+1); + } + } + else { + if (!tryMove(pixel, newx, pixel.y+1)) { + if (!tryMove(pixel, newx, pixel.y)) { pixel.flipX = !pixel.flipX; } + } + } + } + doDefaults(pixel); + }, + LIGHTWEIGHT: [ + "XX|XX|XX", + "XX|FX%0.25|XX", + "M2%10|M1%10|M1%10", + ], + SLIDE: [ + "XX|XX|XX", + "XX|XX|M2 AND BO", + "XX|M1|M1", + ], + AGLIQUID: [ + "M1|M1|M1", + "M2|XX|M2", + "XX|XX|XX", + ], + WALL: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + UL_UR: [ + "M1|M1|M1", + "M2|XX|M2", + "XX|M2|XX", + ], + UL_UR_OPTIMIZED: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + var move1Spots = [ + [pixel.x, pixel.y-1], + [pixel.x+1, pixel.y-1], + [pixel.x-1, pixel.y-1], + ] + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1);} + } + if (!moved && !pixel.del) { + var move2Spots = [ + [pixel.x, pixel.y+1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + for (var i = 0; i < move2Spots.length; i++) { + var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { break; } + else { move2Spots.splice(move2Spots.indexOf(coords), 1); } + } + } + if (!pixel.del) { doDefaults(pixel); } + }, + GAS_OLD: [ + "M2|M1|M2", + "M1|XX|M1", + "M2|M1|M2", + ], + GAS: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + var move1Spots = [ + [pixel.x, pixel.y+1], + [pixel.x, pixel.y-1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1);} + } + if (!moved) { + var move2Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x-1, pixel.y+1], + [pixel.x+1, pixel.y-1], + [pixel.x-1, pixel.y-1], + ] + for (var i = 0; i < move2Spots.length; i++) { + var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { break; } + else { move2Spots.splice(move2Spots.indexOf(coords), 1); } + } + } + doDefaults(pixel); + }, + DGAS: [ + "M2|M1|M2", + "M1|DL%5|M1", + "M2|M1|M2", + ], + SUPPORT: [ + "XX|XX|XX", + "SP|XX|SP", + "XX|M1|XX", + ], + SUPPORTPOWDER: [ + "XX|XX|XX", + "SP|XX|SP", + "M2|M1|M2", + ], + DELETE: [ + "XX|DL|XX", + "DL|XX|DL", + "XX|DL|XX", + ], + FILL: [ + "XX|CL|XX", + "CL|XX|CL", + "XX|CL|XX", + ], + CLONER: [ + "XX|CF|XX", + "CF|XX|CF", + "XX|CF|XX", + ], + SUPERCLONER: [ + "CF|CF|CF", + "CF|CF|CF", + "CF|CF|CF", + ], + STURDYPOWDER: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], + SELFDELETE: [ + "XX|XX|XX", + "XX|DL|XX", + "XX|XX|XX", + ], + FOAM: [ + "XX|XX|XX", + "XX|DL%5|XX", + "M2%25|M1%25|M2%25", + ], + BUBBLE: [ + "XX|XX|XX", + "XX|DL%0.25 AND FX%1|M1%5", + "XX|M1%1|M1%2", + ], + STICKY: [ + "XX|ST|XX", + "ST|XX|ST", + "XX|ST AND M1|XX", + ], + MOLTEN: [ + "XX|CR:fire%2.5|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + RADPOWDER: [ + "XX|CR:radiation%1|XX", + "CR:radiation%1|XX|CR:radiation%1", + "M2|M1|M2", + ], + RADMOLTEN: [ + "XX|CR:fire,fire,fire,radiation%4.5|XX", + "M2 AND CR:radiation%1|XX|M2 AND CR:radiation%1", + "M1|M1|M1", + ], + RADLIQUID: [ + "XX|CR:radiation%2|XX", + "M2 AND CR:radiation%2|XX|M2 AND CR:radiation%2", + "M1|M1|M1", + ], + BOUNCY: function(pixel) { + if (pixel.bx===undefined) { + // choose 1, 0, or -1 + pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; + pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; + // if both are 0, make one of them 1 or -1 + if (pixel.bx===0 && pixel.by===0) { + if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; } + else { pixel.by = Math.random() < 0.5 ? 1 : -1; } + } + } + // move and invert direction if hit + if (!pixel.del && pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) { pixel.bx = -pixel.bx; } + if (!pixel.del && pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) { pixel.by = -pixel.by; } + }, + FEEDPIXEL: function(pixel) { + if (!pixel.food) { pixel.food = 1 } + else { pixel.food ++ } + if (pixel.food > (elements[pixel.element].foodNeed||30)) { + // loop through adjacentCoords and check each pixel to lay an egg + for (var i = 0; i < adjacentCoords.length; i++) { + var x = pixel.x+adjacentCoords[i][0]; + var y = pixel.y+adjacentCoords[i][1]; + if (isEmpty(x, y)) { + if (elements[pixel.element].egg) { + createPixel(elements[pixel.element].egg,x,y) + } + else { + createPixel("egg",x,y) + pixelMap[x][y].animal = elements[pixel.element].baby || pixel.element; + if (elements[pixel.element].eggColor) { + pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],elements[pixel.element].eggColor) + } + } + pixel.food = 0; + break; + } + } + } + }, + KILLPIXEL1: function(pixel) { + pixel.dead = true; + }, + KILLPIXEL2: function(pixel1,pixel2) { + pixel2.dead = true; + }, + FLY: function(pixel, onHit) { + var nx = pixel.flipX ? -1 : 1; + var ny = Math.random() < 0.5 ? -1 : 1; + var hit = false; + if (!tryMove(pixel, pixel.x+nx, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x+nx, pixel.y-ny)) { + if (!tryMove(pixel, pixel.x, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x, pixel.y-ny)) {hit=[pixel.x, pixel.y-ny]} + }else {hit=[pixel.x, pixel.y+ny]} + }else {hit=[pixel.x+nx, pixel.y-ny]} + }else {hit=[pixel.x+nx, pixel.y+ny]} + if (hit && onHit) { + if (!isEmpty(hit[0], hit[1], true)) { + onHit(pixel, pixelMap[hit[0]][hit[1]]); + } + else {onHit(pixel);} + } + if (pixel.del) {return} + if (!isEmpty(pixel.x+nx,pixel.y) || Math.random() < 0.02) { + pixel.flipX = !pixel.flipX; + } + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + doDefaults(pixel); + }, + CRAWLER: function(pixel) { + if (Math.random() < 0.08) { // flip + pixel.flipX = !pixel.flipX; + } + var dir = pixel.flipX ? -1 : 1; + var dirY = pixel.flipY ? -1 : 1; + if (!tryMove(pixel,pixel.x,pixel.y+dirY)) { // fall or climb + if (!tryMove(pixel,pixel.x+dir,pixel.y)) { // hits wall + if (!pixel.hilled && !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { + pixel.hilled = true; + } + tryMove(pixel,pixel.x+dir,pixel.y + (Math.random() < 0.25 ? 1 : -1)); + } + if (Math.random() < 0.01 && !isEmpty(pixel.x+dir,pixel.y+1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y+1].element) !== -1) { + if (!pixel.hilled || !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { + var wallCoords = [ + [-1,-1],[1,-1], + [-1,0],[1,0], + [0,1] + ]; + if (!isEmpty(pixel.x,pixel.y-2)) { + wallCoords.push([0,-1]) + } + if (Math.random() < 0.15) { wallCoords.push([-1,1]) } + if (Math.random() < 0.15) { wallCoords.push([1,1]) } + // loop through wallCoords, change pixel to ant_wall if in crawlthru + for (var i = 0; i < wallCoords.length; i++) { + var x = pixel.x+dir+wallCoords[i][0]; + var y = pixel.y+1+wallCoords[i][1]; + if (!isEmpty(x,y,true) && eLists.CRAWLTHRU.indexOf(pixelMap[x][y].element) !== -1) { + changePixel(pixelMap[x][y],"ant_wall"); + } + } + deletePixel(pixel.x+dir,pixel.y+1); + tryMove(pixel,pixel.x+dir,pixel.y+1); + } + } + else if (Math.random() < 0.08 && !isEmpty(pixel.x+dir,pixel.y-1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y-1].element) !== -1) { + swapPixels(pixel,pixelMap[pixel.x+dir][pixel.y-1]); + } + } + doDefaults(pixel); + } +} + +elements.supercloner = { + color: "#dddd00", + behavior: behaviors.SUPERCLONER, + ignore: ["ecloner","slow_cloner","clone_powder","floating_cloner","wall","ewall", "cloner"], + category:"inventory", + insulate:true, + hardness: 1, + darkText: true, +} + +if (!settings.survival) { + settings.survival = { + "wall": 9999, + "dirt": 9999, + "sapling": 10, + "seeds": 50, + "ice": 250, + "cloner": 10, + "supercloner": 10 + } +} +settings.survival.cloner = 1; +settings.unhide = 0; +// settings.survivalClone=null; settings.survival = null; saveSettings(); + +survivalTimeout = null; +function survivalSave() { + if (survivalTimeout) { clearTimeout(survivalTimeout); } + survivalTimeout = setTimeout(function(){ + saveSettings(); + },1000); +} +function survivalAdd(element,amount,skipSave) { + if (elements[element].category === "tools") { return } + if (settings.survival[element]) { + settings.survival[element] += amount; + } + else { + settings.survival[element] = amount; + } + survivalUpdate(element); + if (!skipSave) {survivalSave()} +} +function survivalRemove(element,amount,skipSave) { + if (elements[element].category === "tools") { return } + if (settings.survival[element]) { + settings.survival[element] -= amount; + survivalUpdate(element); + } + if (settings.survival[element] <= 0) { + delete settings.survival[element]; + var btn = document.getElementById("elementButton-"+element); + if (btn) { btn.remove(); } + selectElement("unknown"); + } + if (!skipSave) {survivalSave()} +} +function survivalCount(element) { + return settings.survival[element] || 0; +} +function survivalUpdate(element) { + if (element === "gold_coin") { + // if it is not an integer, round it to 0.1 + if (settings.survival.gold_coin % 1 !== 0) { + settings.survival.gold_coin = Math.round(settings.survival.gold_coin*10)/10; + } + document.getElementById("coinCount").innerHTML = settings.survival.gold_coin||0; + } + var btn = document.getElementById("elementButton-"+element); + if (elements[element] && elements[element].category === "tools") { return } + if (btn) { + btn.innerHTML = btn.innerHTML.split("(")[0]+"("+settings.survival[element]+")"; + } + else if (elements[element]) { + createElementButton(element); + document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; + } +} + +runAfterAutogen(function(){ + elements.erase.name = "pick_up"; + delete elements.paint.category; + delete elements.lookup.category; + delete elements.pick; + delete elements.prop; + elements.radiation.category = "tools"; + for (var element in elements) { + if (elements[element].category !== "tools") { + elements[element].hidden = true; + elements[element].category = "inventory"; + } + } + for (var element in settings.survival) { + if (!elements[element]) { continue; } + if (elements[element].category === "tools") { continue; } + createElementButton(element); + document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; + } +}); + +delete elements.cloner.behavior; +elements.cloner.tick = function(pixel) { + if (settings.survivalClone) { + if (Math.random() < 0.025) { + // 1 or -1 + var x = pixel.x + (Math.random() < 0.5 ? 1 : -1); + var y = pixel.y + (Math.random() < 0.5 ? 1 : -1); + if (isEmpty(x,y)) { + createPixel(settings.survivalClone,x,y); + } + } + } + else { + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break } + var element = pixelMap[x][y].element; + if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1) { continue } + settings.survivalClone = element; + survivalSave(); + break; + } + } + } +}; +elements.cloner.ignore = elements.cloner.ignore.concat(["sun","supernova"]); +elements.cloner.desc = "You can only clone one element at a time!" + +elements.smash.tool = function(pixel) { + if (elements[pixel.element].seed === true) { return } + if (elements[pixel.element].breakInto !== undefined || (elements[pixel.element].seed !== undefined && elements[pixel.element].seed !== true)) { + // times 0.25 if not shiftDown else 1 + if (Math.random() < (elements[pixel.element].hardness || 1) * (shiftDown ? 1 : 0.25)) { + var breakInto = elements[pixel.element].breakInto; + if (elements[pixel.element].seed && (!breakInto || Math.random() < 0.5)) { + if (Math.random() < 0.2) { + breakInto = elements[pixel.element].seed; + } + else { + breakInto = null; + } + } + // if breakInto is an array, pick one + if (Array.isArray(breakInto)) { + breakInto = breakInto[Math.floor(Math.random() * breakInto.length)]; + } + if (breakInto === null) { + deletePixel(pixel.x,pixel.y); + return; + } + var oldelement = pixel.element; + changePixel(pixel,breakInto); + pixelTempCheck(pixel); + if (elements[oldelement].breakIntoColor) { + pixel.color = pixelColorPick(pixel, elements[oldelement].breakIntoColor); + } + } + } +}; + +elementWorth = { + "gold_coin": 1, + "diamond": 1000^21, + "ketchup": 150, + "jelly": 120, + "soda": 104, + "toast": 120, + "oil": 1023423, + "bread": 32, + "glass": 54, + "rad_glass": 64, + "glass_shard": 42, + "rad_shard": 312412, + "paper": 512312, + "broth": 512312, + "honey": 125, + "caramel": 53, + "sap": 34, + "candy": 325, + "popcorn": 232, + "flour": 322, + "lettuce": 2232, + "sauce": 2232, + "wood": 999, + "tree_branch": 100000, + "plant": 1, + "mushroom_cap": 1, + "mushroom_gill": 3, + "vine": 1, + "cactus": 1, + "cloner": 2, + "wall": 1000^22, + "fire": 100000^232, + "smoke": 0, + "plasma": 0, + "light": 0, + "laser": 0, + "liquid_light": 0.1, + "flash": 0, + "radiation": 0, + "petal": -1, + "cell": -1, + "cancer": -1, + "foam": -1, +} +elements.sell = { + color: ["#fff0b5","#ffe680","#c48821","#986a1a","#eca832","#f0bb62"], + tool: function(pixel) { + if (elementWorth[pixel.element] === 0) { return; } + deletePixel(pixel.x,pixel.y); + if (elementWorth[pixel.element] === -1) { return; } + survivalAdd("gold_coin",elementWorth*10[pixel.element]||1); + }, + category: "tools", + desc: "Exchanges pixels for their market value in Gold Coins x 10" +} +elements.seeds.name = "seed"; + +/* +~Cloner +~Sell +Shop + Cloner Reset + ~Ammonia + ~Dirt + ~Water + ~Seeds + ~Sapling + ~Pinecone + ~Primordial Soup + ~Worm + ~Bee + ~Human + ~TNT + Seller (Runs Sell tool on pixels that touch it) + Buyer (Cloner but uses store price every time, prompt to select item on select) +Prices tab +*/ +survivalShop = { + "dirt*25": 25, + "water*25": 250, + "ammonia*25": 500, + "seeds*1": 500, + "sapling*1": 500, + "pinecone*1": 500, + "tnt*25": 1000, + "worm*1": 1000, + "bee*1": 5000, + "primordial_soup*5": 10000, + "human*1": 50000, + "sun*1": 500000, + "milk": -200^2, +} +function survivalBuy(element) { + var price = survivalShop[element]; + if (!price) { alert("The shop isn't selling "+element+"!"); return } + if (!settings.survival.gold_coin || settings.survival.gold_coin < price) { alert("You can't afford that!"); return } + survivalRemove("gold_coin",price); + var amount = 1; + if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); element = element.split("*")[0]; } + survivalAdd(element,amount); + selectElement(element); +} +function survivalResetCloner() { + if (!settings.survival.gold_coin || settings.survival.gold_coin < 1000) { alert("You can't afford that!"); return } + survivalRemove("gold_coin",1000); + settings.survivalClone = null; + survivalSave(); +} + +worldgentypes = {} +window.addEventListener("load",function(){ + // move to start of tools + var erase = document.getElementById("elementButton-erase"); + var sell = document.getElementById("elementButton-sell"); + var parent = erase.parentElement; + parent.removeChild(sell); + parent.insertBefore(sell,parent.firstChild); + parent.removeChild(erase); + parent.insertBefore(erase,parent.firstChild); + document.getElementById("replaceButton").remove(); + document.getElementById("savesButton").remove(); + document.getElementById("elemSelectButton").remove(); + doRandomEvents = function() {} + worldGen = function() {} + worldgentypes = {} + loadSave = function() {} + showSaves = function() {} + placeImage = function() {} + chooseElementPrompt = function() {} + document.getElementById("toolControls").insertAdjacentHTML("beforeend",``); + createCategoryDiv("shop"); + var shopDiv = document.getElementById("category-shop"); + shopDiv.style.display = "none"; + shopDiv.insertAdjacentHTML("beforeend",`

You have $${settings.survival.gold_coin||0}

`); + for (var element in survivalShop) { + var price = survivalShop[element]; + var button = document.createElement("button"); + var name = element; + var amount = 1; + if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); name = element.split("*")[0]; } + var elemname = name; + name = (elements[elemname].name||name).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ",".").replace(/ /g, ""); + button.classList.add("elementButton"); + button.setAttribute("element",element); + button.setAttribute("category","shop"); + button.setAttribute("title",amount+" "+name+" for $"+price); + button.innerHTML = name+" ("+amount+" for $"+price+")"; + if (elements[elemname]) { + if (elements[elemname].color instanceof Array) { + button.style.backgroundImage = "linear-gradient(to bottom right, "+elements[elemname].color.join(", ")+")"; + // choose the middlemost item in array + var colorObject = elements[elemname].colorObject[Math.floor(elements[elemname].colorObject.length/2)]; + if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { + button.className += " bright" + } + } + else { + button.style.background = elements[elemname].color; + var colorObject = elements[elemname].colorObject; + if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { + button.className += " bright" + } + } + } + button.addEventListener("click",function(){ + survivalBuy(this.getAttribute("element")); + }); + shopDiv.appendChild(button); + } + shopDiv.insertAdjacentHTML("beforeend",`

`); + + createCategoryDiv("prices"); + var pricesDiv = document.getElementById("category-prices"); + pricesDiv.style.display = "none"; + for (var element in elementWorth) { + if (elementWorth[element] <= 0) { continue } + var name = (elements[element].name||element).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ","."); + // create text with the name of the element and its worth, separated by • + var text = name+"="+elementWorth[element] + " • "; + pricesDiv.insertAdjacentHTML("beforeend",`${text}`); + } + pricesDiv.innerHTML = pricesDiv.innerHTML.slice(0,-2); + pricesDiv.innerHTML = "

"+pricesDiv.innerHTML+"

"; +}); +runAfterLoad(function(){ + checkUnlock = function(element) { + return; + } + oldClearAll = clearAll; + clearAll = function() { + if (currentPixels && currentPixels.length > 0) { + for (var i = 0; i < currentPixels.length; i++) { + var pixel = currentPixels[i]; + if (pixel && pixel.element) { + survivalAdd(pixel.element,1); + } + } + } + oldClearAll(); + } + mouseAction = function(e,mouseX,mouseY,startPos) { + if (mouseType == "left") { + mouse1Action(e,mouseX,mouseY,startPos); + } + else if (mouseType == "right") { mouse2Action(e,mouseX,mouseY,startPos); } + else if (mouseType == "middle") { mouseMiddleAction(e,mouseX,mouseY); } + } + mouse1Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { + if (currentElement === "erase") { mouse2Action(e,mouseX,mouseY); return; } + else if (currentElement === "pick") { mouseMiddleAction(e,mouseX,mouseY); return; } + // If x and y are undefined, get the mouse position + if (mouseX == undefined && mouseY == undefined) { + // var canvas = document.getElementById("game"); + // var ctx = canvas.getContext("2d"); + lastPos = mousePos; + mousePos = getMousePos(canvas, e); + var mouseX = mousePos.x; + var mouseY = mousePos.y; + } + var cooldowned = false; + if ((mouseSize===1 || elements[currentElement].maxSize===1) && elements[currentElement].cooldown) { + if (pixelTicks-lastPlace < elements[currentElement].cooldown) { + return; + } + cooldowned = true; + } + lastPlace = pixelTicks; + startPos = startPos || lastPos + if (!(isMobile || (cooldowned && startPos.x===lastPos.x && startPos.y===lastPos.y) || elements[currentElement].tool || elements[currentElement].category==="tools")) { + var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); + } + else { var coords = mouseRange(mouseX,mouseY); } + var element = elements[currentElement]; + var mixList = []; + // For each x,y in coords + for (var i = 0; i < coords.length; i++) { + var x = coords[i][0]; + var y = coords[i][1]; + + if (currentElement === "mix") { + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + if (!(elements[pixel.element].movable !== true || elements[pixel.element].noMix === true) || shiftDown) { + mixList.push(pixel); + } + } + } + else if (currentElement === "shock") { + if (!isEmpty(x,y,true)) { + // One loop that repeats 5 times if shiftDown else 1 time + for (var j = 0; j < (shiftDown ? 5 : 1); j++) { + var pixel = pixelMap[x][y]; + var con = elements[pixel.element].conduct; + if (con == undefined) {continue} + if (Math.random() < con) { // If random number is less than conductivity + if (!pixel.charge && !pixel.chargeCD) { + pixel.charge = 1; + if (elements[pixel.element].colorOn) { + pixel.color = pixelColorPick(pixel); + } + } + } + else if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation) + pixel.temp += 0.25; + pixelTempCheck(pixel); + } + } + } + } + else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) { + // run the tool function on the pixel + if (!isEmpty(x,y,true)) { + var pixel = pixelMap[x][y]; + // if the current element has an ignore property and the pixel's element is in the ignore property, don't do anything + if (elements[currentElement].ignore && elements[currentElement].ignore.indexOf(pixel.element) != -1) { + continue; + } + elements[currentElement].tool(pixel); + } + } + else if (isEmpty(x, y)) { + if (survivalCount(currentElement) < 1 && elements[currentElement].category !== "tools") { + return; + } + currentPixels.push(new Pixel(x, y, currentElement)); + if (elements[currentElement].customColor || elements[currentElement].singleColor) { + pixelMap[x][y].color = pixelColorPick(currentElement,currentColor); + } + if (elements[currentElement].category !== "tools") { survivalRemove(currentElement,1); } + } + } + if (currentElement == "mix") { + for (var i = 0; i < mixList.length; i++) { + var pixel1 = mixList[Math.floor(Math.random()*mixList.length)]; + var pixel2 = mixList[Math.floor(Math.random()*mixList.length)]; + swapPixels(pixel1,pixel2); + mixList.splice(mixList.indexOf(pixel1),1); + mixList.splice(mixList.indexOf(pixel2),1); + if (elements[pixel1.element].onMix) { + elements[pixel1.element].onMix(pixel1,pixel2); + } + if (elements[pixel2.element].onMix) { + elements[pixel2.element].onMix(pixel2,pixel1); + } + } + + } + } + mouse2Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { + // Erase pixel at mouse position + if (mouseX == undefined && mouseY == undefined) { + // var canvas = document.getElementById("game"); + // var ctx = canvas.getContext("2d"); + lastPos = mousePos; + mousePos = getMousePos(canvas, e); + var mouseX = mousePos.x; + var mouseY = mousePos.y; + } + if (dragStart) { + dragStart = 0; + for (var i = 0; i < draggingPixels.length; i++) { + var pixel = draggingPixels[i]; + delete pixel.drag; + } + draggingPixels = null; + } + // If the current element is "pick" or "lookup", coords = [mouseX,mouseY] + if (currentElement == "pick" || currentElement == "lookup") { + var coords = [[mouseX,mouseY]]; + } + else if (!isMobile) { + startPos = startPos || lastPos + var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); + } + else { + var coords = mouseRange(mouseX,mouseY); + } + // For each x,y in coords + for (var i = 0; i < coords.length; i++) { + var x = coords[i][0]; + var y = coords[i][1]; + + if (!isEmpty(x, y)) { + if (outOfBounds(x,y)) { + continue + } + var pixel = pixelMap[x][y]; + survivalAdd(pixel.element,1); + delete pixelMap[x][y]; + // Remove pixel from currentPixels + for (var j = 0; j < currentPixels.length; j++) { + if (currentPixels[j].x == x && currentPixels[j].y == y) { + currentPixels.splice(j, 1); + break; + } + } + } + } + } +}) + +window.addEventListener("beforeunload",function(){ + clearAll(); + saveSettings(); +}); \ No newline at end of file From db0511f1df0992f6e425f873781f0c3d737c7aa3 Mon Sep 17 00:00:00 2001 From: GuyWhoGotSpringlocked <163777207+GWhoGS@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:14:53 -0400 Subject: [PATCH 42/67] survival.js but cheating credits to Ryan for base game and survival.js --- mods/easysurvival.js | 399 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) diff --git a/mods/easysurvival.js b/mods/easysurvival.js index 9b8aba3f..86fdcc7b 100644 --- a/mods/easysurvival.js +++ b/mods/easysurvival.js @@ -1,3 +1,401 @@ +behaviors = { + POWDER_OLD: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + POWDER: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y+1)) { + tryMove(pixel, pixel.x-1, pixel.y+1); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y+1)) { + tryMove(pixel, pixel.x+1, pixel.y+1); + } + } + } + doDefaults(pixel); + }, + AGPOWDER: [ + "M2|M1|M2", + "XX|XX|XX", + "XX|XX|XX", + ], + LIQUID_OLD: [ + "XX|XX|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + LIQUID: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (elements[pixel.element].viscosity && (!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + var move1Spots = [ + [pixel.x, pixel.y+1] + ] + } + else { + var move1Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x, pixel.y+1], + [pixel.x-1, pixel.y+1], + ] + } + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1); } + } + if (!moved) { + if (elements[pixel.element].viscosity===undefined || !(!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y)) { + tryMove(pixel, pixel.x-1, pixel.y); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y)) { + tryMove(pixel, pixel.x+1, pixel.y); + } + } + } + } + doDefaults(pixel); + }, + SUPERFLUID_OLD: [ + "XX|XX|XX", + "XX|XX|M2 AND BO", + "XX|M1|M2", + ], + SUPERFLUID: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + // go either left or right depending on pixel.flipX + var newx = pixel.flipX ? pixel.x-1 : pixel.x+1; + if (Math.random() < 0.5) { + if (!tryMove(pixel, newx, pixel.y)) { + pixel.flipX = !pixel.flipX; + tryMove(pixel, newx, pixel.y+1); + } + } + else { + if (!tryMove(pixel, newx, pixel.y+1)) { + if (!tryMove(pixel, newx, pixel.y)) { pixel.flipX = !pixel.flipX; } + } + } + } + doDefaults(pixel); + }, + LIGHTWEIGHT: [ + "XX|XX|XX", + "XX|FX%0.25|XX", + "M2%10|M1%10|M1%10", + ], + SLIDE: [ + "XX|XX|XX", + "XX|XX|M2 AND BO", + "XX|M1|M1", + ], + AGLIQUID: [ + "M1|M1|M1", + "M2|XX|M2", + "XX|XX|XX", + ], + WALL: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + UL_UR: [ + "M1|M1|M1", + "M2|XX|M2", + "XX|M2|XX", + ], + UL_UR_OPTIMIZED: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + var move1Spots = [ + [pixel.x, pixel.y-1], + [pixel.x+1, pixel.y-1], + [pixel.x-1, pixel.y-1], + ] + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1);} + } + if (!moved && !pixel.del) { + var move2Spots = [ + [pixel.x, pixel.y+1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + for (var i = 0; i < move2Spots.length; i++) { + var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { break; } + else { move2Spots.splice(move2Spots.indexOf(coords), 1); } + } + } + if (!pixel.del) { doDefaults(pixel); } + }, + GAS_OLD: [ + "M2|M1|M2", + "M1|XX|M1", + "M2|M1|M2", + ], + GAS: function(pixel) { + if (pixel.start === pixelTicks) {return} + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + var move1Spots = [ + [pixel.x, pixel.y+1], + [pixel.x, pixel.y-1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + var moved = false; + for (var i = 0; i < move1Spots.length; i++) { + var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } + else { move1Spots.splice(move1Spots.indexOf(coords), 1);} + } + if (!moved) { + var move2Spots = [ + [pixel.x+1, pixel.y+1], + [pixel.x-1, pixel.y+1], + [pixel.x+1, pixel.y-1], + [pixel.x-1, pixel.y-1], + ] + for (var i = 0; i < move2Spots.length; i++) { + var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; + if (tryMove(pixel, coords[0], coords[1])) { break; } + else { move2Spots.splice(move2Spots.indexOf(coords), 1); } + } + } + doDefaults(pixel); + }, + DGAS: [ + "M2|M1|M2", + "M1|DL%5|M1", + "M2|M1|M2", + ], + SUPPORT: [ + "XX|XX|XX", + "SP|XX|SP", + "XX|M1|XX", + ], + SUPPORTPOWDER: [ + "XX|XX|XX", + "SP|XX|SP", + "M2|M1|M2", + ], + DELETE: [ + "XX|DL|XX", + "DL|XX|DL", + "XX|DL|XX", + ], + FILL: [ + "XX|CL|XX", + "CL|XX|CL", + "XX|CL|XX", + ], + CLONER: [ + "XX|CF|XX", + "CF|XX|CF", + "XX|CF|XX", + ], + SUPERCLONER: [ + "CF|CF|CF", + "CF|CF|CF", + "CF|CF|CF", + ], + STURDYPOWDER: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|M1|XX", + ], + SELFDELETE: [ + "XX|XX|XX", + "XX|DL|XX", + "XX|XX|XX", + ], + FOAM: [ + "XX|XX|XX", + "XX|DL%5|XX", + "M2%25|M1%25|M2%25", + ], + BUBBLE: [ + "XX|XX|XX", + "XX|DL%0.25 AND FX%1|M1%5", + "XX|M1%1|M1%2", + ], + STICKY: [ + "XX|ST|XX", + "ST|XX|ST", + "XX|ST AND M1|XX", + ], + MOLTEN: [ + "XX|CR:fire%2.5|XX", + "M2|XX|M2", + "M1|M1|M1", + ], + RADPOWDER: [ + "XX|CR:radiation%1|XX", + "CR:radiation%1|XX|CR:radiation%1", + "M2|M1|M2", + ], + RADMOLTEN: [ + "XX|CR:fire,fire,fire,radiation%4.5|XX", + "M2 AND CR:radiation%1|XX|M2 AND CR:radiation%1", + "M1|M1|M1", + ], + RADLIQUID: [ + "XX|CR:radiation%2|XX", + "M2 AND CR:radiation%2|XX|M2 AND CR:radiation%2", + "M1|M1|M1", + ], + BOUNCY: function(pixel) { + if (pixel.bx===undefined) { + // choose 1, 0, or -1 + pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; + pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; + // if both are 0, make one of them 1 or -1 + if (pixel.bx===0 && pixel.by===0) { + if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; } + else { pixel.by = Math.random() < 0.5 ? 1 : -1; } + } + } + // move and invert direction if hit + if (!pixel.del && pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) { pixel.bx = -pixel.bx; } + if (!pixel.del && pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) { pixel.by = -pixel.by; } + }, + FEEDPIXEL: function(pixel) { + if (!pixel.food) { pixel.food = 1 } + else { pixel.food ++ } + if (pixel.food > (elements[pixel.element].foodNeed||30)) { + // loop through adjacentCoords and check each pixel to lay an egg + for (var i = 0; i < adjacentCoords.length; i++) { + var x = pixel.x+adjacentCoords[i][0]; + var y = pixel.y+adjacentCoords[i][1]; + if (isEmpty(x, y)) { + if (elements[pixel.element].egg) { + createPixel(elements[pixel.element].egg,x,y) + } + else { + createPixel("egg",x,y) + pixelMap[x][y].animal = elements[pixel.element].baby || pixel.element; + if (elements[pixel.element].eggColor) { + pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],elements[pixel.element].eggColor) + } + } + pixel.food = 0; + break; + } + } + } + }, + KILLPIXEL1: function(pixel) { + pixel.dead = true; + }, + KILLPIXEL2: function(pixel1,pixel2) { + pixel2.dead = true; + }, + FLY: function(pixel, onHit) { + var nx = pixel.flipX ? -1 : 1; + var ny = Math.random() < 0.5 ? -1 : 1; + var hit = false; + if (!tryMove(pixel, pixel.x+nx, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x+nx, pixel.y-ny)) { + if (!tryMove(pixel, pixel.x, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x, pixel.y-ny)) {hit=[pixel.x, pixel.y-ny]} + }else {hit=[pixel.x, pixel.y+ny]} + }else {hit=[pixel.x+nx, pixel.y-ny]} + }else {hit=[pixel.x+nx, pixel.y+ny]} + if (hit && onHit) { + if (!isEmpty(hit[0], hit[1], true)) { + onHit(pixel, pixelMap[hit[0]][hit[1]]); + } + else {onHit(pixel);} + } + if (pixel.del) {return} + if (!isEmpty(pixel.x+nx,pixel.y) || Math.random() < 0.02) { + pixel.flipX = !pixel.flipX; + } + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + doDefaults(pixel); + }, + CRAWLER: function(pixel) { + if (Math.random() < 0.08) { // flip + pixel.flipX = !pixel.flipX; + } + var dir = pixel.flipX ? -1 : 1; + var dirY = pixel.flipY ? -1 : 1; + if (!tryMove(pixel,pixel.x,pixel.y+dirY)) { // fall or climb + if (!tryMove(pixel,pixel.x+dir,pixel.y)) { // hits wall + if (!pixel.hilled && !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { + pixel.hilled = true; + } + tryMove(pixel,pixel.x+dir,pixel.y + (Math.random() < 0.25 ? 1 : -1)); + } + if (Math.random() < 0.01 && !isEmpty(pixel.x+dir,pixel.y+1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y+1].element) !== -1) { + if (!pixel.hilled || !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { + var wallCoords = [ + [-1,-1],[1,-1], + [-1,0],[1,0], + [0,1] + ]; + if (!isEmpty(pixel.x,pixel.y-2)) { + wallCoords.push([0,-1]) + } + if (Math.random() < 0.15) { wallCoords.push([-1,1]) } + if (Math.random() < 0.15) { wallCoords.push([1,1]) } + // loop through wallCoords, change pixel to ant_wall if in crawlthru + for (var i = 0; i < wallCoords.length; i++) { + var x = pixel.x+dir+wallCoords[i][0]; + var y = pixel.y+1+wallCoords[i][1]; + if (!isEmpty(x,y,true) && eLists.CRAWLTHRU.indexOf(pixelMap[x][y].element) !== -1) { + changePixel(pixelMap[x][y],"ant_wall"); + } + } + deletePixel(pixel.x+dir,pixel.y+1); + tryMove(pixel,pixel.x+dir,pixel.y+1); + } + } + else if (Math.random() < 0.08 && !isEmpty(pixel.x+dir,pixel.y-1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y-1].element) !== -1) { + swapPixels(pixel,pixelMap[pixel.x+dir][pixel.y-1]); + } + } + doDefaults(pixel); + } +} + +elements.supercloner = { + color: "#dddd00", + behavior: behaviors.SUPERCLONER, + ignore: ["ecloner","slow_cloner","clone_powder","floating_cloner","wall","ewall", "cloner"], + category:"inventory", + insulate:true, + hardness: 1, + darkText: true, +} + if (!settings.survival) { settings.survival = { "wall": 9999, @@ -6,6 +404,7 @@ if (!settings.survival) { "seeds": 50, "ice": 250, "cloner": 10, + "supercloner": 10 } } settings.survival.cloner = 1; From 51b7bc93f6e973c2b5e4a6a74f8f5589f1e15a6a Mon Sep 17 00:00:00 2001 From: GuyWhoGotSpringlocked <163777207+GWhoGS@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:17:29 -0400 Subject: [PATCH 43/67] Delete easysurvival.js extra one ig --- easysurvival.js | 917 ------------------------------------------------ 1 file changed, 917 deletions(-) delete mode 100644 easysurvival.js diff --git a/easysurvival.js b/easysurvival.js deleted file mode 100644 index 86fdcc7b..00000000 --- a/easysurvival.js +++ /dev/null @@ -1,917 +0,0 @@ -behaviors = { - POWDER_OLD: [ - "XX|XX|XX", - "XX|XX|XX", - "M2|M1|M2", - ], - POWDER: function(pixel) { - if (pixel.start === pixelTicks) {return} - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - if (!tryMove(pixel, pixel.x, pixel.y+1)) { - if (Math.random() < 0.5) { - if (!tryMove(pixel, pixel.x+1, pixel.y+1)) { - tryMove(pixel, pixel.x-1, pixel.y+1); - } - } else { - if (!tryMove(pixel, pixel.x-1, pixel.y+1)) { - tryMove(pixel, pixel.x+1, pixel.y+1); - } - } - } - doDefaults(pixel); - }, - AGPOWDER: [ - "M2|M1|M2", - "XX|XX|XX", - "XX|XX|XX", - ], - LIQUID_OLD: [ - "XX|XX|XX", - "M2|XX|M2", - "M1|M1|M1", - ], - LIQUID: function(pixel) { - if (pixel.start === pixelTicks) {return} - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - if (elements[pixel.element].viscosity && (!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { - var move1Spots = [ - [pixel.x, pixel.y+1] - ] - } - else { - var move1Spots = [ - [pixel.x+1, pixel.y+1], - [pixel.x, pixel.y+1], - [pixel.x-1, pixel.y+1], - ] - } - var moved = false; - for (var i = 0; i < move1Spots.length; i++) { - var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; - if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } - else { move1Spots.splice(move1Spots.indexOf(coords), 1); } - } - if (!moved) { - if (elements[pixel.element].viscosity===undefined || !(!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) { - if (Math.random() < 0.5) { - if (!tryMove(pixel, pixel.x+1, pixel.y)) { - tryMove(pixel, pixel.x-1, pixel.y); - } - } else { - if (!tryMove(pixel, pixel.x-1, pixel.y)) { - tryMove(pixel, pixel.x+1, pixel.y); - } - } - } - } - doDefaults(pixel); - }, - SUPERFLUID_OLD: [ - "XX|XX|XX", - "XX|XX|M2 AND BO", - "XX|M1|M2", - ], - SUPERFLUID: function(pixel) { - if (pixel.start === pixelTicks) {return} - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - if (!tryMove(pixel, pixel.x, pixel.y+1)) { - // go either left or right depending on pixel.flipX - var newx = pixel.flipX ? pixel.x-1 : pixel.x+1; - if (Math.random() < 0.5) { - if (!tryMove(pixel, newx, pixel.y)) { - pixel.flipX = !pixel.flipX; - tryMove(pixel, newx, pixel.y+1); - } - } - else { - if (!tryMove(pixel, newx, pixel.y+1)) { - if (!tryMove(pixel, newx, pixel.y)) { pixel.flipX = !pixel.flipX; } - } - } - } - doDefaults(pixel); - }, - LIGHTWEIGHT: [ - "XX|XX|XX", - "XX|FX%0.25|XX", - "M2%10|M1%10|M1%10", - ], - SLIDE: [ - "XX|XX|XX", - "XX|XX|M2 AND BO", - "XX|M1|M1", - ], - AGLIQUID: [ - "M1|M1|M1", - "M2|XX|M2", - "XX|XX|XX", - ], - WALL: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", - ], - UL_UR: [ - "M1|M1|M1", - "M2|XX|M2", - "XX|M2|XX", - ], - UL_UR_OPTIMIZED: function(pixel) { - if (pixel.start === pixelTicks) {return} - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - var move1Spots = [ - [pixel.x, pixel.y-1], - [pixel.x+1, pixel.y-1], - [pixel.x-1, pixel.y-1], - ] - var moved = false; - for (var i = 0; i < move1Spots.length; i++) { - var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; - if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } - else { move1Spots.splice(move1Spots.indexOf(coords), 1);} - } - if (!moved && !pixel.del) { - var move2Spots = [ - [pixel.x, pixel.y+1], - [pixel.x+1, pixel.y], - [pixel.x-1, pixel.y], - ] - for (var i = 0; i < move2Spots.length; i++) { - var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; - if (tryMove(pixel, coords[0], coords[1])) { break; } - else { move2Spots.splice(move2Spots.indexOf(coords), 1); } - } - } - if (!pixel.del) { doDefaults(pixel); } - }, - GAS_OLD: [ - "M2|M1|M2", - "M1|XX|M1", - "M2|M1|M2", - ], - GAS: function(pixel) { - if (pixel.start === pixelTicks) {return} - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - var move1Spots = [ - [pixel.x, pixel.y+1], - [pixel.x, pixel.y-1], - [pixel.x+1, pixel.y], - [pixel.x-1, pixel.y], - ] - var moved = false; - for (var i = 0; i < move1Spots.length; i++) { - var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)]; - if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; } - else { move1Spots.splice(move1Spots.indexOf(coords), 1);} - } - if (!moved) { - var move2Spots = [ - [pixel.x+1, pixel.y+1], - [pixel.x-1, pixel.y+1], - [pixel.x+1, pixel.y-1], - [pixel.x-1, pixel.y-1], - ] - for (var i = 0; i < move2Spots.length; i++) { - var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)]; - if (tryMove(pixel, coords[0], coords[1])) { break; } - else { move2Spots.splice(move2Spots.indexOf(coords), 1); } - } - } - doDefaults(pixel); - }, - DGAS: [ - "M2|M1|M2", - "M1|DL%5|M1", - "M2|M1|M2", - ], - SUPPORT: [ - "XX|XX|XX", - "SP|XX|SP", - "XX|M1|XX", - ], - SUPPORTPOWDER: [ - "XX|XX|XX", - "SP|XX|SP", - "M2|M1|M2", - ], - DELETE: [ - "XX|DL|XX", - "DL|XX|DL", - "XX|DL|XX", - ], - FILL: [ - "XX|CL|XX", - "CL|XX|CL", - "XX|CL|XX", - ], - CLONER: [ - "XX|CF|XX", - "CF|XX|CF", - "XX|CF|XX", - ], - SUPERCLONER: [ - "CF|CF|CF", - "CF|CF|CF", - "CF|CF|CF", - ], - STURDYPOWDER: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|M1|XX", - ], - SELFDELETE: [ - "XX|XX|XX", - "XX|DL|XX", - "XX|XX|XX", - ], - FOAM: [ - "XX|XX|XX", - "XX|DL%5|XX", - "M2%25|M1%25|M2%25", - ], - BUBBLE: [ - "XX|XX|XX", - "XX|DL%0.25 AND FX%1|M1%5", - "XX|M1%1|M1%2", - ], - STICKY: [ - "XX|ST|XX", - "ST|XX|ST", - "XX|ST AND M1|XX", - ], - MOLTEN: [ - "XX|CR:fire%2.5|XX", - "M2|XX|M2", - "M1|M1|M1", - ], - RADPOWDER: [ - "XX|CR:radiation%1|XX", - "CR:radiation%1|XX|CR:radiation%1", - "M2|M1|M2", - ], - RADMOLTEN: [ - "XX|CR:fire,fire,fire,radiation%4.5|XX", - "M2 AND CR:radiation%1|XX|M2 AND CR:radiation%1", - "M1|M1|M1", - ], - RADLIQUID: [ - "XX|CR:radiation%2|XX", - "M2 AND CR:radiation%2|XX|M2 AND CR:radiation%2", - "M1|M1|M1", - ], - BOUNCY: function(pixel) { - if (pixel.bx===undefined) { - // choose 1, 0, or -1 - pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; - pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1; - // if both are 0, make one of them 1 or -1 - if (pixel.bx===0 && pixel.by===0) { - if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; } - else { pixel.by = Math.random() < 0.5 ? 1 : -1; } - } - } - // move and invert direction if hit - if (!pixel.del && pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) { pixel.bx = -pixel.bx; } - if (!pixel.del && pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) { pixel.by = -pixel.by; } - }, - FEEDPIXEL: function(pixel) { - if (!pixel.food) { pixel.food = 1 } - else { pixel.food ++ } - if (pixel.food > (elements[pixel.element].foodNeed||30)) { - // loop through adjacentCoords and check each pixel to lay an egg - for (var i = 0; i < adjacentCoords.length; i++) { - var x = pixel.x+adjacentCoords[i][0]; - var y = pixel.y+adjacentCoords[i][1]; - if (isEmpty(x, y)) { - if (elements[pixel.element].egg) { - createPixel(elements[pixel.element].egg,x,y) - } - else { - createPixel("egg",x,y) - pixelMap[x][y].animal = elements[pixel.element].baby || pixel.element; - if (elements[pixel.element].eggColor) { - pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],elements[pixel.element].eggColor) - } - } - pixel.food = 0; - break; - } - } - } - }, - KILLPIXEL1: function(pixel) { - pixel.dead = true; - }, - KILLPIXEL2: function(pixel1,pixel2) { - pixel2.dead = true; - }, - FLY: function(pixel, onHit) { - var nx = pixel.flipX ? -1 : 1; - var ny = Math.random() < 0.5 ? -1 : 1; - var hit = false; - if (!tryMove(pixel, pixel.x+nx, pixel.y+ny)) { - if (!tryMove(pixel, pixel.x+nx, pixel.y-ny)) { - if (!tryMove(pixel, pixel.x, pixel.y+ny)) { - if (!tryMove(pixel, pixel.x, pixel.y-ny)) {hit=[pixel.x, pixel.y-ny]} - }else {hit=[pixel.x, pixel.y+ny]} - }else {hit=[pixel.x+nx, pixel.y-ny]} - }else {hit=[pixel.x+nx, pixel.y+ny]} - if (hit && onHit) { - if (!isEmpty(hit[0], hit[1], true)) { - onHit(pixel, pixelMap[hit[0]][hit[1]]); - } - else {onHit(pixel);} - } - if (pixel.del) {return} - if (!isEmpty(pixel.x+nx,pixel.y) || Math.random() < 0.02) { - pixel.flipX = !pixel.flipX; - } - if (pixel.charge && elements[pixel.element].behaviorOn) { - pixelTick(pixel) - } - doDefaults(pixel); - }, - CRAWLER: function(pixel) { - if (Math.random() < 0.08) { // flip - pixel.flipX = !pixel.flipX; - } - var dir = pixel.flipX ? -1 : 1; - var dirY = pixel.flipY ? -1 : 1; - if (!tryMove(pixel,pixel.x,pixel.y+dirY)) { // fall or climb - if (!tryMove(pixel,pixel.x+dir,pixel.y)) { // hits wall - if (!pixel.hilled && !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { - pixel.hilled = true; - } - tryMove(pixel,pixel.x+dir,pixel.y + (Math.random() < 0.25 ? 1 : -1)); - } - if (Math.random() < 0.01 && !isEmpty(pixel.x+dir,pixel.y+1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y+1].element) !== -1) { - if (!pixel.hilled || !isEmpty(pixel.x+dir,pixel.y,true) && pixelMap[pixel.x+dir][pixel.y].element === "ant_wall") { - var wallCoords = [ - [-1,-1],[1,-1], - [-1,0],[1,0], - [0,1] - ]; - if (!isEmpty(pixel.x,pixel.y-2)) { - wallCoords.push([0,-1]) - } - if (Math.random() < 0.15) { wallCoords.push([-1,1]) } - if (Math.random() < 0.15) { wallCoords.push([1,1]) } - // loop through wallCoords, change pixel to ant_wall if in crawlthru - for (var i = 0; i < wallCoords.length; i++) { - var x = pixel.x+dir+wallCoords[i][0]; - var y = pixel.y+1+wallCoords[i][1]; - if (!isEmpty(x,y,true) && eLists.CRAWLTHRU.indexOf(pixelMap[x][y].element) !== -1) { - changePixel(pixelMap[x][y],"ant_wall"); - } - } - deletePixel(pixel.x+dir,pixel.y+1); - tryMove(pixel,pixel.x+dir,pixel.y+1); - } - } - else if (Math.random() < 0.08 && !isEmpty(pixel.x+dir,pixel.y-1,true) && eLists.CRAWLTHRU.indexOf(pixelMap[pixel.x+dir][pixel.y-1].element) !== -1) { - swapPixels(pixel,pixelMap[pixel.x+dir][pixel.y-1]); - } - } - doDefaults(pixel); - } -} - -elements.supercloner = { - color: "#dddd00", - behavior: behaviors.SUPERCLONER, - ignore: ["ecloner","slow_cloner","clone_powder","floating_cloner","wall","ewall", "cloner"], - category:"inventory", - insulate:true, - hardness: 1, - darkText: true, -} - -if (!settings.survival) { - settings.survival = { - "wall": 9999, - "dirt": 9999, - "sapling": 10, - "seeds": 50, - "ice": 250, - "cloner": 10, - "supercloner": 10 - } -} -settings.survival.cloner = 1; -settings.unhide = 0; -// settings.survivalClone=null; settings.survival = null; saveSettings(); - -survivalTimeout = null; -function survivalSave() { - if (survivalTimeout) { clearTimeout(survivalTimeout); } - survivalTimeout = setTimeout(function(){ - saveSettings(); - },1000); -} -function survivalAdd(element,amount,skipSave) { - if (elements[element].category === "tools") { return } - if (settings.survival[element]) { - settings.survival[element] += amount; - } - else { - settings.survival[element] = amount; - } - survivalUpdate(element); - if (!skipSave) {survivalSave()} -} -function survivalRemove(element,amount,skipSave) { - if (elements[element].category === "tools") { return } - if (settings.survival[element]) { - settings.survival[element] -= amount; - survivalUpdate(element); - } - if (settings.survival[element] <= 0) { - delete settings.survival[element]; - var btn = document.getElementById("elementButton-"+element); - if (btn) { btn.remove(); } - selectElement("unknown"); - } - if (!skipSave) {survivalSave()} -} -function survivalCount(element) { - return settings.survival[element] || 0; -} -function survivalUpdate(element) { - if (element === "gold_coin") { - // if it is not an integer, round it to 0.1 - if (settings.survival.gold_coin % 1 !== 0) { - settings.survival.gold_coin = Math.round(settings.survival.gold_coin*10)/10; - } - document.getElementById("coinCount").innerHTML = settings.survival.gold_coin||0; - } - var btn = document.getElementById("elementButton-"+element); - if (elements[element] && elements[element].category === "tools") { return } - if (btn) { - btn.innerHTML = btn.innerHTML.split("(")[0]+"("+settings.survival[element]+")"; - } - else if (elements[element]) { - createElementButton(element); - document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; - } -} - -runAfterAutogen(function(){ - elements.erase.name = "pick_up"; - delete elements.paint.category; - delete elements.lookup.category; - delete elements.pick; - delete elements.prop; - elements.radiation.category = "tools"; - for (var element in elements) { - if (elements[element].category !== "tools") { - elements[element].hidden = true; - elements[element].category = "inventory"; - } - } - for (var element in settings.survival) { - if (!elements[element]) { continue; } - if (elements[element].category === "tools") { continue; } - createElementButton(element); - document.getElementById("elementButton-"+element).innerHTML += "("+settings.survival[element]+")"; - } -}); - -delete elements.cloner.behavior; -elements.cloner.tick = function(pixel) { - if (settings.survivalClone) { - if (Math.random() < 0.025) { - // 1 or -1 - var x = pixel.x + (Math.random() < 0.5 ? 1 : -1); - var y = pixel.y + (Math.random() < 0.5 ? 1 : -1); - if (isEmpty(x,y)) { - createPixel(settings.survivalClone,x,y); - } - } - } - else { - for (var i = 0; i < adjacentCoords.length; i++) { - var coords = adjacentCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (!isEmpty(x,y,true)) { - if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break } - var element = pixelMap[x][y].element; - if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1) { continue } - settings.survivalClone = element; - survivalSave(); - break; - } - } - } -}; -elements.cloner.ignore = elements.cloner.ignore.concat(["sun","supernova"]); -elements.cloner.desc = "You can only clone one element at a time!" - -elements.smash.tool = function(pixel) { - if (elements[pixel.element].seed === true) { return } - if (elements[pixel.element].breakInto !== undefined || (elements[pixel.element].seed !== undefined && elements[pixel.element].seed !== true)) { - // times 0.25 if not shiftDown else 1 - if (Math.random() < (elements[pixel.element].hardness || 1) * (shiftDown ? 1 : 0.25)) { - var breakInto = elements[pixel.element].breakInto; - if (elements[pixel.element].seed && (!breakInto || Math.random() < 0.5)) { - if (Math.random() < 0.2) { - breakInto = elements[pixel.element].seed; - } - else { - breakInto = null; - } - } - // if breakInto is an array, pick one - if (Array.isArray(breakInto)) { - breakInto = breakInto[Math.floor(Math.random() * breakInto.length)]; - } - if (breakInto === null) { - deletePixel(pixel.x,pixel.y); - return; - } - var oldelement = pixel.element; - changePixel(pixel,breakInto); - pixelTempCheck(pixel); - if (elements[oldelement].breakIntoColor) { - pixel.color = pixelColorPick(pixel, elements[oldelement].breakIntoColor); - } - } - } -}; - -elementWorth = { - "gold_coin": 1, - "diamond": 1000^21, - "ketchup": 150, - "jelly": 120, - "soda": 104, - "toast": 120, - "oil": 1023423, - "bread": 32, - "glass": 54, - "rad_glass": 64, - "glass_shard": 42, - "rad_shard": 312412, - "paper": 512312, - "broth": 512312, - "honey": 125, - "caramel": 53, - "sap": 34, - "candy": 325, - "popcorn": 232, - "flour": 322, - "lettuce": 2232, - "sauce": 2232, - "wood": 999, - "tree_branch": 100000, - "plant": 1, - "mushroom_cap": 1, - "mushroom_gill": 3, - "vine": 1, - "cactus": 1, - "cloner": 2, - "wall": 1000^22, - "fire": 100000^232, - "smoke": 0, - "plasma": 0, - "light": 0, - "laser": 0, - "liquid_light": 0.1, - "flash": 0, - "radiation": 0, - "petal": -1, - "cell": -1, - "cancer": -1, - "foam": -1, -} -elements.sell = { - color: ["#fff0b5","#ffe680","#c48821","#986a1a","#eca832","#f0bb62"], - tool: function(pixel) { - if (elementWorth[pixel.element] === 0) { return; } - deletePixel(pixel.x,pixel.y); - if (elementWorth[pixel.element] === -1) { return; } - survivalAdd("gold_coin",elementWorth*10[pixel.element]||1); - }, - category: "tools", - desc: "Exchanges pixels for their market value in Gold Coins x 10" -} -elements.seeds.name = "seed"; - -/* -~Cloner -~Sell -Shop - Cloner Reset - ~Ammonia - ~Dirt - ~Water - ~Seeds - ~Sapling - ~Pinecone - ~Primordial Soup - ~Worm - ~Bee - ~Human - ~TNT - Seller (Runs Sell tool on pixels that touch it) - Buyer (Cloner but uses store price every time, prompt to select item on select) -Prices tab -*/ -survivalShop = { - "dirt*25": 25, - "water*25": 250, - "ammonia*25": 500, - "seeds*1": 500, - "sapling*1": 500, - "pinecone*1": 500, - "tnt*25": 1000, - "worm*1": 1000, - "bee*1": 5000, - "primordial_soup*5": 10000, - "human*1": 50000, - "sun*1": 500000, - "milk": -200^2, -} -function survivalBuy(element) { - var price = survivalShop[element]; - if (!price) { alert("The shop isn't selling "+element+"!"); return } - if (!settings.survival.gold_coin || settings.survival.gold_coin < price) { alert("You can't afford that!"); return } - survivalRemove("gold_coin",price); - var amount = 1; - if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); element = element.split("*")[0]; } - survivalAdd(element,amount); - selectElement(element); -} -function survivalResetCloner() { - if (!settings.survival.gold_coin || settings.survival.gold_coin < 1000) { alert("You can't afford that!"); return } - survivalRemove("gold_coin",1000); - settings.survivalClone = null; - survivalSave(); -} - -worldgentypes = {} -window.addEventListener("load",function(){ - // move to start of tools - var erase = document.getElementById("elementButton-erase"); - var sell = document.getElementById("elementButton-sell"); - var parent = erase.parentElement; - parent.removeChild(sell); - parent.insertBefore(sell,parent.firstChild); - parent.removeChild(erase); - parent.insertBefore(erase,parent.firstChild); - document.getElementById("replaceButton").remove(); - document.getElementById("savesButton").remove(); - document.getElementById("elemSelectButton").remove(); - doRandomEvents = function() {} - worldGen = function() {} - worldgentypes = {} - loadSave = function() {} - showSaves = function() {} - placeImage = function() {} - chooseElementPrompt = function() {} - document.getElementById("toolControls").insertAdjacentHTML("beforeend",``); - createCategoryDiv("shop"); - var shopDiv = document.getElementById("category-shop"); - shopDiv.style.display = "none"; - shopDiv.insertAdjacentHTML("beforeend",`

You have $${settings.survival.gold_coin||0}

`); - for (var element in survivalShop) { - var price = survivalShop[element]; - var button = document.createElement("button"); - var name = element; - var amount = 1; - if (element.indexOf("*") !== -1) { amount = parseInt(element.split("*")[1]); name = element.split("*")[0]; } - var elemname = name; - name = (elements[elemname].name||name).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ",".").replace(/ /g, ""); - button.classList.add("elementButton"); - button.setAttribute("element",element); - button.setAttribute("category","shop"); - button.setAttribute("title",amount+" "+name+" for $"+price); - button.innerHTML = name+" ("+amount+" for $"+price+")"; - if (elements[elemname]) { - if (elements[elemname].color instanceof Array) { - button.style.backgroundImage = "linear-gradient(to bottom right, "+elements[elemname].color.join(", ")+")"; - // choose the middlemost item in array - var colorObject = elements[elemname].colorObject[Math.floor(elements[elemname].colorObject.length/2)]; - if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { - button.className += " bright" - } - } - else { - button.style.background = elements[elemname].color; - var colorObject = elements[elemname].colorObject; - if (elements[elemname].darkText !== false && (elements[elemname].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) { - button.className += " bright" - } - } - } - button.addEventListener("click",function(){ - survivalBuy(this.getAttribute("element")); - }); - shopDiv.appendChild(button); - } - shopDiv.insertAdjacentHTML("beforeend",`

`); - - createCategoryDiv("prices"); - var pricesDiv = document.getElementById("category-prices"); - pricesDiv.style.display = "none"; - for (var element in elementWorth) { - if (elementWorth[element] <= 0) { continue } - var name = (elements[element].name||element).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ","."); - // create text with the name of the element and its worth, separated by • - var text = name+"="+elementWorth[element] + " • "; - pricesDiv.insertAdjacentHTML("beforeend",`${text}`); - } - pricesDiv.innerHTML = pricesDiv.innerHTML.slice(0,-2); - pricesDiv.innerHTML = "

"+pricesDiv.innerHTML+"

"; -}); -runAfterLoad(function(){ - checkUnlock = function(element) { - return; - } - oldClearAll = clearAll; - clearAll = function() { - if (currentPixels && currentPixels.length > 0) { - for (var i = 0; i < currentPixels.length; i++) { - var pixel = currentPixels[i]; - if (pixel && pixel.element) { - survivalAdd(pixel.element,1); - } - } - } - oldClearAll(); - } - mouseAction = function(e,mouseX,mouseY,startPos) { - if (mouseType == "left") { - mouse1Action(e,mouseX,mouseY,startPos); - } - else if (mouseType == "right") { mouse2Action(e,mouseX,mouseY,startPos); } - else if (mouseType == "middle") { mouseMiddleAction(e,mouseX,mouseY); } - } - mouse1Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { - if (currentElement === "erase") { mouse2Action(e,mouseX,mouseY); return; } - else if (currentElement === "pick") { mouseMiddleAction(e,mouseX,mouseY); return; } - // If x and y are undefined, get the mouse position - if (mouseX == undefined && mouseY == undefined) { - // var canvas = document.getElementById("game"); - // var ctx = canvas.getContext("2d"); - lastPos = mousePos; - mousePos = getMousePos(canvas, e); - var mouseX = mousePos.x; - var mouseY = mousePos.y; - } - var cooldowned = false; - if ((mouseSize===1 || elements[currentElement].maxSize===1) && elements[currentElement].cooldown) { - if (pixelTicks-lastPlace < elements[currentElement].cooldown) { - return; - } - cooldowned = true; - } - lastPlace = pixelTicks; - startPos = startPos || lastPos - if (!(isMobile || (cooldowned && startPos.x===lastPos.x && startPos.y===lastPos.y) || elements[currentElement].tool || elements[currentElement].category==="tools")) { - var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); - } - else { var coords = mouseRange(mouseX,mouseY); } - var element = elements[currentElement]; - var mixList = []; - // For each x,y in coords - for (var i = 0; i < coords.length; i++) { - var x = coords[i][0]; - var y = coords[i][1]; - - if (currentElement === "mix") { - if (!isEmpty(x,y,true)) { - var pixel = pixelMap[x][y]; - if (!(elements[pixel.element].movable !== true || elements[pixel.element].noMix === true) || shiftDown) { - mixList.push(pixel); - } - } - } - else if (currentElement === "shock") { - if (!isEmpty(x,y,true)) { - // One loop that repeats 5 times if shiftDown else 1 time - for (var j = 0; j < (shiftDown ? 5 : 1); j++) { - var pixel = pixelMap[x][y]; - var con = elements[pixel.element].conduct; - if (con == undefined) {continue} - if (Math.random() < con) { // If random number is less than conductivity - if (!pixel.charge && !pixel.chargeCD) { - pixel.charge = 1; - if (elements[pixel.element].colorOn) { - pixel.color = pixelColorPick(pixel); - } - } - } - else if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation) - pixel.temp += 0.25; - pixelTempCheck(pixel); - } - } - } - } - else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) { - // run the tool function on the pixel - if (!isEmpty(x,y,true)) { - var pixel = pixelMap[x][y]; - // if the current element has an ignore property and the pixel's element is in the ignore property, don't do anything - if (elements[currentElement].ignore && elements[currentElement].ignore.indexOf(pixel.element) != -1) { - continue; - } - elements[currentElement].tool(pixel); - } - } - else if (isEmpty(x, y)) { - if (survivalCount(currentElement) < 1 && elements[currentElement].category !== "tools") { - return; - } - currentPixels.push(new Pixel(x, y, currentElement)); - if (elements[currentElement].customColor || elements[currentElement].singleColor) { - pixelMap[x][y].color = pixelColorPick(currentElement,currentColor); - } - if (elements[currentElement].category !== "tools") { survivalRemove(currentElement,1); } - } - } - if (currentElement == "mix") { - for (var i = 0; i < mixList.length; i++) { - var pixel1 = mixList[Math.floor(Math.random()*mixList.length)]; - var pixel2 = mixList[Math.floor(Math.random()*mixList.length)]; - swapPixels(pixel1,pixel2); - mixList.splice(mixList.indexOf(pixel1),1); - mixList.splice(mixList.indexOf(pixel2),1); - if (elements[pixel1.element].onMix) { - elements[pixel1.element].onMix(pixel1,pixel2); - } - if (elements[pixel2.element].onMix) { - elements[pixel2.element].onMix(pixel2,pixel1); - } - } - - } - } - mouse2Action = function(e,mouseX=undefined,mouseY=undefined,startPos) { - // Erase pixel at mouse position - if (mouseX == undefined && mouseY == undefined) { - // var canvas = document.getElementById("game"); - // var ctx = canvas.getContext("2d"); - lastPos = mousePos; - mousePos = getMousePos(canvas, e); - var mouseX = mousePos.x; - var mouseY = mousePos.y; - } - if (dragStart) { - dragStart = 0; - for (var i = 0; i < draggingPixels.length; i++) { - var pixel = draggingPixels[i]; - delete pixel.drag; - } - draggingPixels = null; - } - // If the current element is "pick" or "lookup", coords = [mouseX,mouseY] - if (currentElement == "pick" || currentElement == "lookup") { - var coords = [[mouseX,mouseY]]; - } - else if (!isMobile) { - startPos = startPos || lastPos - var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY); - } - else { - var coords = mouseRange(mouseX,mouseY); - } - // For each x,y in coords - for (var i = 0; i < coords.length; i++) { - var x = coords[i][0]; - var y = coords[i][1]; - - if (!isEmpty(x, y)) { - if (outOfBounds(x,y)) { - continue - } - var pixel = pixelMap[x][y]; - survivalAdd(pixel.element,1); - delete pixelMap[x][y]; - // Remove pixel from currentPixels - for (var j = 0; j < currentPixels.length; j++) { - if (currentPixels[j].x == x && currentPixels[j].y == y) { - currentPixels.splice(j, 1); - break; - } - } - } - } - } -}) - -window.addEventListener("beforeunload",function(){ - clearAll(); - saveSettings(); -}); \ No newline at end of file From 3a8e1098c50c8c3d0e06251d28de8799a03634d7 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Mon, 15 Apr 2024 20:57:40 -0400 Subject: [PATCH 44/67] halogen.js --- mods/halogen.js | 375 ++++++++++++++++++++++++++++++++++++++++++ mods/nousersthings.js | 2 +- 2 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 mods/halogen.js diff --git a/mods/halogen.js b/mods/halogen.js new file mode 100644 index 00000000..9d3df94d --- /dev/null +++ b/mods/halogen.js @@ -0,0 +1,375 @@ +var metalstocorrode = ["iron", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","tin","lead", "rose_gold", "blue_gold", "gallium", "electrum", "purple_gold"] +var biologicaltocorrode = [] +var alkalimetals = ["lithium", "sodium", "potassium", "rubidium", "cesium", "radiocesium", "caesium", "caesium_137", "francium", "molten_caesium", "molten_caesium_137", "liquid_cesium", "liquid_radiocesium"] +for (let elementi in elements){ + if (elements[elementi].category == "life" || elements[elementi].category == "food"){ + biologicaltocorrode.push(elementi) + } +} +biologicaltocorrode.splice(biologicaltocorrode.indexOf("salt"), 1) +biologicaltocorrode.splice(biologicaltocorrode.indexOf("sugar"), 1) +function basicHalogen(pixel){ + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + var otherPixel = pixelMap[x][y] + if (metalstocorrode.includes(otherPixel.element) && Math.random() < 0.01){ + otherPixel.element = "metal_scrap" + if (Math.random()<0.5){ + deletePixel(pixel.x, pixel.y) + } + } + if (biologicaltocorrode.includes(otherPixel.element) && Math.random() < 0.1){ + changePixel(otherPixel, "ash", false) + if (Math.random()<0.5){ + deletePixel(pixel.x, pixel.y) + } + } + if (alkalimetals.includes(otherPixel.element) && Math.random() < 0.1){ + changePixel(otherPixel, "salt", false) + deletePixel(pixel.x, pixel.y) + otherPixel.temp += 100 + } + } + } +} +elements.fluorine = { + color: ["#c4d067", "#ced87e", "#d8e094", "#e2e9aa", "#ecf1c0"], + behavior: behaviors.GAS, + state: "gas", + category: "gases", + tempLow: -188, + stateLow: "liquid_fluorine", + density: 1.696, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.liquid_fluorine = { + color: ["#aed067", "#b8d87e", "#c3e194", "#cee9aa", "#daf1c0"], + behavior: behaviors.LIQUID, + state: "liquid", + tempLow: -220, + stateLow: "fluorine_ice", + category: "states", + tempHigh: -186, + stateHigh: "fluorine", + hidden: true, + density: 1509, + tick: function(pixel){ + basicHalogen(pixel) + }, +} +elements.fluorine_ice = { + color: ["#b3c97c", "#b9ce8c", "#bfd39c", "#c5d8ac", "#cdddbb"], + behavior: behaviors.WALL, + state: "solid", + tempHigh: -218, + stateHigh: "liquid_fluorine", + category: "states", + hidden: true, + density: 1520 +} +elements.bromine = { + color: ["#901100", "#7f1702", "#6e1a05", "#5e1b07", "#4e1b0a"], + behavior: behaviors.LIQUID, + state: "liquid", + tempLow: -7, + stateLow: "bromine_ice", + tempHigh: 59, + stateHigh: "bromine_gas", + category: "liquids", + density: 3120, + tick: function(pixel){ + basicHalogen(pixel); + if (pixel.isVapor){ + deletePixel(pixel.x, pixel.y) + return; + } + if (pixel.temp > 16 && Math.random() < 0.01){ + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("bromine_gas", x, y) + pixelMap[x][y].isVapor = true + break; + } + } + } + } +} +elements.bromine_gas = { + color: ["#8f0000", "#7e0205", "#6e0508", "#5d080a", "#4d0a0a"], + behavior: behaviors.GAS, + state: "gas", + tempLow: 57, + stateLow: "bromine", + category: "states", + hidden: true, + density: 6, + tick: function(pixel){ + basicHalogen(pixel) + if (pixel.isVapor && Math.random() < 0.07){ + deletePixel(pixel.x, pixel.y) + } + } +} +elements.bromine_ice = { + color: ["#8f002b", "#7e0522", "#6d091a", "#5d0a13", "#4d0a0a"], + behavior: behaviors.WALL, + state: "solid", + tempHigh: -5, + stateHigh: "bromine", + category: "states", + hidden: true, + density: 3119, + tick: function(pixel){ + basicHalogen(pixel) + if (pixel.isVapor){ + deletePixel(pixel.x, pixel.y) + return; + } + } +} +elements.iodine = { + color: ["#323131", "#3a3737", "#423d3f", "#494347", "#504950"], + behavior: behaviors.WALL, + state: "solid", + tempHigh: 114, + stateHigh: "liquid_iodine", + category: "solids", + density: 4940, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.liquid_iodine = { + color: ["#7d2d84", "#71267b", "#651f71", "#591868", "#4e115f"], + behavior: behaviors.LIQUID, + state: "liquid", + tempLow: 112, + stateLow: "iodine", + tempHigh: 184, + stateHigh: "iodine_gas", + category: "states", + hidden: true, + density: 3960, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.iodine_gas = { + color: ["#923a89", "#84337d", "#762c71", "#692666", "#5c1f5a"], + behavior: behaviors.GAS, + state: "gas", + tempLow: 182, + stateLow: "liquid_iodine", + category: "states", + hidden: true, + density: 7, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.astatine = { + color: ["#303130", "#333633", "#373a37", "#3a3f3a", "#3e443e"], + behavior: behaviors.RADSOLID, + state: "solid", + tempHigh: 302, + stateHigh: "molten_astatine", + category: "solids", + density: 6400, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.molten_astatine = { + color: ["#cdaf42", "#d09a2c", "#d38419", "#d66b10", "#d84e13"], + behavior: behaviors.RADMOLTEN, + state: "solid", + tempHigh: 337, + stateHigh: "astatine_gas", + stateLow: "astatine", + tempLow: 300, + category: "states", + hidden: true, + density: 6400, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.astatine_gas = { + color: ["#cdaf42", "#d09a2c", "#d38419", "#d66b10", "#d84e13"], + behavior: behaviors.GAS, + state: "gas", + tempLow: 335, + stateLow: "molten_astatine", + category: "states", + hidden: true, + density: 7, + tick: function(pixel){ + basicHalogen(pixel) + } +} +elements.tennessine = { + color: ["#675151", "#5b4845", "#4f3f3b", "#433630", "#382d27"], + behavior: behaviors.RADSOLID, + state: "solid", + category: "solids", + density: 7000, + tick: function(pixel){ + basicHalogen(pixel) + } +} +window.addEventListener('load', function() { + if (elements.polonium){ + elements.astatine.tick = function(pixel){ + basicHalogen(pixel) + if (Math.random()<0.005){ + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("positron", x, y) + pixelMap[x][y].temp += 270 + break; + } + } + changePixel(pixel, "polonium", false) + pixel.temp += 270 + } + } + let oldgas = elements.astatine_gas.tick + let oldmolten = elements.molten_astatine.tick + elements.molten_astatine.tick = function(pixel){ + oldmolten(pixel) + if (Math.random()<0.005){ + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("positron", x, y) + pixelMap[x][y].temp += 270 + break; + } + } + changePixel(pixel, "polonium", false) + pixel.temp += 270 + } + } + elements.astatine_gas.tick = function(pixel){ + oldgas(pixel) + if (Math.random()<0.005){ + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("positron", x, y) + pixelMap[x][y].temp += 270 + break; + } + } + changePixel(pixel, "polonium", false) + pixel.temp += 270 + } + } + } + else { + elements.astatine.tick = function(pixel){ + basicHalogen(pixel) + if (Math.random()<0.005){ + changePixel(pixel, "positron", false) + pixel.temp += 270 + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + pixelMap[x][y].temp += 100 + } + } + } + } + let oldgas = elements.astatine_gas.tick + let oldmolten = elements.molten_astatine.tick + elements.molten_astatine.tick = function(pixel){ + oldmolten(pixel) + if (Math.random()<0.005){ + changePixel(pixel, "positron", false) + pixel.temp += 270 + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + pixelMap[x][y].temp += 100 + } + } + } + } + elements.astatine_gas.tick = function(pixel){ + oldgas(pixel) + if (Math.random()<0.005){ + changePixel(pixel, "positron", false) + pixel.temp += 270 + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + pixelMap[x][y].temp += 100 + } + } + } + } + } + if (elements.moscovium){ + elements.tennessine.tick = function(pixel){ + basicHalogen(pixel) + if (Math.random()<0.04){ + changePixel(pixel, "moscovium", false) + pixel.temp += 450 + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y)){ + createPixel("helium", x, y) + break; + } + } + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + pixelMap[x][y].temp += 200 + } + } + } + } + } else { + elements.tennessine.tick = function(pixel){ + basicHalogen(pixel) + if (Math.random()<0.04){ + changePixel(pixel, "helium", false) + pixel.temp += 450 + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true)){ + pixelMap[x][y].temp += 200 + } + } + } + } + } +}) \ No newline at end of file diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 86789235..8a15d5fb 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1882,7 +1882,7 @@ elements.molten_bismuth = { } } changePixel(pixel, "bismuth") - var rgbResult = HSVtoRGB(pixel.tHue + 0.08, 0.5, 0.9); + var rgbResult = HSVtoRGB(pixel.tHue + 0.02, 0.5, 0.9); const hexR = rgbResult.r.toString(16).padStart(2, '0'); const hexG = rgbResult.g.toString(16).padStart(2, '0'); const hexB = rgbResult.b.toString(16).padStart(2, '0'); From e0f4db879cc2c729a1d071904ec8d58986ba0f4f Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Mon, 15 Apr 2024 20:59:33 -0400 Subject: [PATCH 45/67] halojen modlijst --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index 23f82cb3..6b29f302 100644 --- a/mod-list.html +++ b/mod-list.html @@ -166,6 +166,7 @@ Gemstones.jsAdds more gemstonesSchweeny glenn_gases.jsAdds most gases from the Glenn's Gases mod into SandboxelsAlice grav_mudstones.jsAdds various forms of mudstone with different gravitiesAlice +halogen.jsAdds the missing halogensnousernamefound hidden_ground.jsHides most rock variants from the_ground.js excluding the base rocks and wallsMelecie iocalfaeus_clones.jsAdds Iorefrius, Iolucius, and Ioradius gasAlice jaydstuff.jsAdds various chemicals and compoundsJayd From bf7d65b46aa3ce9266ae9ee4e6403408ffb68856 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Mon, 15 Apr 2024 21:06:13 -0400 Subject: [PATCH 46/67] Update mod-list.html --- mod-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index 1cc72a2a..64026e8a 100644 --- a/mod-list.html +++ b/mod-list.html @@ -199,7 +199,7 @@ note_block.jsAdds musical Note BlocksAlice nousersthings.jsDestroyable machines, pipe variants, filters, and morenousernamefound portal.jsAdds portals that can teleport pixelsAlice -pushers.jsAdds pixels that pull pixels towards themvoidapex11 +pullers.jsAdds pixels that pull pixels towards themvoidapex11 pushers.jsAdds pixels that push elements away from themAlice spouts.jsAdds spouts for all liquidskaeud state_voids.jsAdds several elements that each delete a specific state of matter (and combinations thereof)Alice From 9389971e332099e192b0156209e56cccb063a469 Mon Sep 17 00:00:00 2001 From: voidapex11 <154328367+voidapex11@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:46:03 +0100 Subject: [PATCH 47/67] fix bug --- mods/pullers.js | 101 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/mods/pullers.js b/mods/pullers.js index 0072128a..70602c4a 100644 --- a/mods/pullers.js +++ b/mods/pullers.js @@ -2,6 +2,11 @@ // a sandboxels mod that adds pullers /* ==CHANGELOG== + Version 1.2.1 +@voidapex11 +~fixed error ++e pullers + Version 1.1.2 @voidapex11 ~fixed spelling mistake's @@ -194,7 +199,7 @@ elements.down_puller = { for (i = 1; i <= pixel.range; i++) { if (!isEmpty(pixel.x, pixel.y - i, true)) { - if (pixelMap[pixel.x][pixel.y - i]['immovable]) {break} + if (pixelMap[pixel.x][pixel.y - i]['immovable']) {break} else { tryMove(pixelMap[pixel.x][pixel.y - i], pixel.x, pixel.y - i + 1); } @@ -252,3 +257,97 @@ elements.up_puller = { if (enabledMods.includes("pushers.js")) { console.log('compatibility with pushers.js and imovable objects coming in a later update of the pullers.js\neventualy...') } + +e_pullerColour='#c3a5d6' + +elements.left_e_puller = { + color: e_pullerColour, + properties: { + range: 10, + pushStrength: 1, + }, + tick: function(pixel) { + if (pixel.charge) { + elements.left_puller.tick(pixel) + } + doDefaults(pixel); + }, + category: "machines", + breakInto: ["metal_scrap", "steel", "iron", "glass", "uranium", "tin"], + tempHigh: 2400, + stateHigh: ["molten_aluminum", "molten_steel", "molten_iron", "molten_glass", "molten_uranium", "molten_tin"], + density: 10000, + hardness: 0.85, + conduct: 1, + state: "solid", +} + + + +elements.right_e_puller = { + color: e_pullerColour, + properties: { + range: 10, + pushStrength: 1, + }, + tick: function(pixel) { + if (pixel.charge) { + elements.right_puller.tick(pixel) + } + + doDefaults(pixel); + }, + category: "machines", + breakInto: ["metal_scrap", "steel", "iron", "glass", "uranium", "tin"], + tempHigh: 2400, + stateHigh: ["molten_aluminum", "molten_steel", "molten_iron", "molten_glass", "molten_uranium", "molten_tin"], + density: 10000, + hardness: 0.85, + conduct: 1, + state: "solid", +} + +elements.down_e_puller = { + color: e_pullerColour, + properties: { + range: 10, + pushStrength: 1, + }, + tick: function(pixel) { + if (pixel.charge) { + elements.down_puller.tick(pixel) + } + + doDefaults(pixel); + }, + category: "machines", + breakInto: ["metal_scrap", "steel", "iron", "glass", "uranium", "tin"], + tempHigh: 2400, + stateHigh: ["molten_aluminum", "molten_steel", "molten_iron", "molten_glass", "molten_uranium", "molten_tin"], + density: 10000, + hardness: 0.85, + conduct: 1, + state: "solid", +} + +elements.up_e_puller = { + color: e_pullerColour, + properties: { + range: 10, + pushStrength: 1, + }, + tick: function(pixel) { + if (pixel.charge) { + elements.up_puller.tick(pixel) + } + doDefaults(pixel); + }, + category: "machines", + breakInto: ["metal_scrap", "steel", "iron", "glass", "uranium", "tin"], + tempHigh: 2400, + stateHigh: ["molten_aluminum", "molten_steel", "molten_iron", "molten_glass", "molten_uranium", "molten_tin"], + density: 10000, + hardness: 0.85, + conduct: 1, + state: "solid", +} \ No newline at end of file From 6e25db878314133159cd568c1baebcf14aa70fd3 Mon Sep 17 00:00:00 2001 From: GuyWhoGotSpringlocked <163777207+GWhoGS@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:00:57 -0400 Subject: [PATCH 48/67] Purple Guy's Mod vFinal Final update of purple guy's mod because i want to make purple guys mod + now --- mods/purple_guys_mod.js | 375 +++++++++++++++++++++++++++++++++------- 1 file changed, 311 insertions(+), 64 deletions(-) diff --git a/mods/purple_guys_mod.js b/mods/purple_guys_mod.js index b0984694..f0d2e53e 100644 --- a/mods/purple_guys_mod.js +++ b/mods/purple_guys_mod.js @@ -591,7 +591,7 @@ elements.r_gullibullium_gas = { elements.boba_pearls = { color: "#3b0a57", behavior: behaviors.POWDER, - category: "Purple Guy's Boba", + category: "Boba", state: "solid", density: 54678900, hardness:0.95 @@ -600,7 +600,7 @@ elements.boba_pearls = { elements.vanilla_boba = { color: "#fff0dd", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -609,7 +609,7 @@ elements.vanilla_boba = { elements.mango_boba = { color: "#ffc77d", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -618,7 +618,7 @@ elements.mango_boba = { elements.matcha_boba = { color: "#58d168", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -627,7 +627,7 @@ elements.matcha_boba = { elements.banana_boba = { color: "#ffe1a1", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -636,7 +636,7 @@ elements.banana_boba = { elements.banana_cream_boba = { color: "#ffffc1", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -645,7 +645,7 @@ elements.banana_cream_boba = { elements.satans_boba = { color: "#852d2d", behavior: behaviors.MOLTEN, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25, @@ -655,7 +655,7 @@ elements.satans_boba = { elements.peach_boba = { color: "#ffbe73", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -664,7 +664,7 @@ elements.peach_boba = { elements.strawberry_boba = { color: "#e27c7c", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -673,7 +673,7 @@ elements.strawberry_boba = { elements.mint_boba = { color: "#8cff9b", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -682,7 +682,7 @@ elements.mint_boba = { elements.mint_vanilla_boba = { color: "#c8ffcf", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -691,7 +691,7 @@ elements.mint_vanilla_boba = { elements.classic_boba = { color: "#ffffff", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -700,7 +700,7 @@ elements.classic_boba = { elements.taro_boba = { color: "#f1c8ff", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -709,7 +709,7 @@ elements.taro_boba = { elements.thai_tea_boba = { color: "#ffc98c", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -718,7 +718,7 @@ elements.thai_tea_boba = { elements.jasmine_green_tea_boba = { color: "#d8ffc7", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -727,7 +727,7 @@ elements.jasmine_green_tea_boba = { elements.honeydew_boba = { color: "#9eff98", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -736,7 +736,7 @@ elements.honeydew_boba = { elements.rose_boba = { color: "#ffe6e6", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -745,7 +745,7 @@ elements.rose_boba = { elements.lavender_boba = { color: "#efbfff", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -754,7 +754,7 @@ elements.lavender_boba = { elements.lychee_boba = { color: "#fff1bf", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -763,7 +763,7 @@ elements.lychee_boba = { elements.passion_fruit_boba = { color: "#ffb942", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -772,7 +772,7 @@ elements.passion_fruit_boba = { elements.pineapple_boba = { color: "#ffe742", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -781,7 +781,7 @@ elements.pineapple_boba = { elements.blueberry_boba = { color: "#272a98", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -790,7 +790,7 @@ elements.blueberry_boba = { elements.raspberry_boba = { color: "#ff3333", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -799,7 +799,7 @@ elements.raspberry_boba = { elements.coconut_boba = { color: "#f1f1f1", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -808,7 +808,7 @@ elements.coconut_boba = { elements.almond_boba = { color: "#e4daa9", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -817,7 +817,7 @@ elements.almond_boba = { elements.hazelnut_boba = { color: "#fbf4d4", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -826,7 +826,7 @@ elements.hazelnut_boba = { elements.caramel_boba = { color: "#e4ab32", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -835,7 +835,7 @@ elements.caramel_boba = { elements.chocolate_boba = { color: "#6f4b00", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -844,7 +844,7 @@ elements.chocolate_boba = { elements.coffee_boba = { color: "#866625", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -853,7 +853,7 @@ elements.coffee_boba = { elements.guava_boba = { color: "#ff390a", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -862,7 +862,7 @@ elements.guava_boba = { elements.kiwi_boba = { color: "#09de0f", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -871,7 +871,7 @@ elements.kiwi_boba = { elements.papaya_boba = { color: "#c4ce37", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -880,7 +880,7 @@ elements.papaya_boba = { elements.black_sesame_boba = { color: "#6e89a9", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -889,7 +889,7 @@ elements.black_sesame_boba = { elements.pandan_boba = { color: "#33d460", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -898,7 +898,7 @@ elements.pandan_boba = { elements.pomegranate_boba = { color: "#ca0000", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -907,7 +907,7 @@ elements.pomegranate_boba = { elements.watermelon_boba = { color: "#f26565", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -916,7 +916,7 @@ elements.watermelon_boba = { elements.grapefruit_boba = { color: "#f1962f", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -925,7 +925,7 @@ elements.grapefruit_boba = { elements.plum_boba = { color: "#dacfd9", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -934,7 +934,7 @@ elements.plum_boba = { elements.jackfruit_boba = { color: "#daa128", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -943,7 +943,7 @@ elements.jackfruit_boba = { elements.soursop_boba = { color: "#ded3bb", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -952,7 +952,7 @@ elements.soursop_boba = { elements.cranberry_boba = { color: "#f81e1e", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -961,7 +961,7 @@ elements.cranberry_boba = { elements.blood_orange_boba = { color: "#ed2115", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -970,7 +970,7 @@ elements.blood_orange_boba = { elements.lemonade_boba = { color: "#ffe151", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -979,7 +979,7 @@ elements.lemonade_boba = { elements.guanabana_boba = { color: "#f5f5f5", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -988,7 +988,7 @@ elements.guanabana_boba = { elements.cherry_blossom_boba = { color: "#f598e8", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -997,7 +997,7 @@ elements.cherry_blossom_boba = { elements.cardamom_boba = { color: "#dac370", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1006,7 +1006,7 @@ elements.cardamom_boba = { elements.saffron_boba = { color: "#ffe323", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1015,7 +1015,7 @@ elements.saffron_boba = { elements.pistachio_boba = { color: "#9cff90", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1024,7 +1024,7 @@ elements.pistachio_boba = { elements.blue_raspberry_boba = { color: "#29c9f1", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1033,7 +1033,7 @@ elements.blue_raspberry_boba = { elements.cotton_candy_boba = { color: "#f1cfde", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1042,7 +1042,7 @@ elements.cotton_candy_boba = { elements.bubblegum_boba = { color: "#ff97bc", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1051,7 +1051,7 @@ elements.bubblegum_boba = { elements.peppermint_boba = { color: ["#ffeff5", "#ff0000"], behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1060,7 +1060,7 @@ elements.peppermint_boba = { elements.spearmint_boba = { color: ["#ffeff5", "#00ff00"], behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1085,7 +1085,61 @@ elements.strawberry_kiwi_boba = { "k": "#09de0f" }, behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.lychee_rose_boba = { + color: "#e04b8c", + behavior: behaviors.LIQUID, + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.raspberry_lemonade_boba = { + color: "#e0604a", + behavior: behaviors.LIQUID, + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.blackberry_boba = { + color: "#232048", + behavior: behaviors.LIQUID, + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.elderflower_boba = { + color: "#ef9d5c", + behavior: behaviors.LIQUID, + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.hibiscus_boba = { + color: "#e8a1cd", + behavior: behaviors.LIQUID, + category: "Boba", + state: "liquid", + density: 1300, + hardness:0.25 +} + +elements.dragon_fruit_boba = { + color: "#cd4747", + behavior: behaviors.LIQUID, + category: "Boba", state: "liquid", density: 1300, hardness:0.25 @@ -1098,7 +1152,7 @@ elements.wasters_personal_boba = { "M2|M1|M2", "M2|XX|M2" ], - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1500, hardness:0.25 @@ -1111,7 +1165,7 @@ elements.when_yous_personal_boba = { "M2|M1|M2", "M2|XX|M2" ], - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 1600, hardness:0.25 @@ -1120,16 +1174,16 @@ elements.when_yous_personal_boba = { elements.nousernamefounds_gallium_boba = { color: ["#b1b1b1", "#bfbfbf", "#9e9e9e"], behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 5100, hardness:0.25 } -elements.bartender_twix_hartwell_whites_bday_cake_boba = { +elements.bart_ender_twixs_birthday_cake_boba = { color: "#e6dbe4", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 2000, hardness:0.25 @@ -1138,7 +1192,7 @@ elements.bartender_twix_hartwell_whites_bday_cake_boba = { elements.sb_boba = { color: ["#000000", "#ffff00", "#3a3a3a", "#ff0000"], behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 2000, hardness:0.25 @@ -1147,7 +1201,7 @@ elements.sb_boba = { elements.sethies_red_boba = { color: "#ff8282", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 2000, hardness:0.25 @@ -1156,7 +1210,7 @@ elements.sethies_red_boba = { elements.sethies_blue_boba = { color: "#82c0ff", behavior: behaviors.LIQUID, - category: "Purple Guy's Boba", + category: "Boba", state: "liquid", density: 2010, hardness:0.25 @@ -1516,8 +1570,8 @@ elements.water_but_it_stays_liquid = { elements.blue_uranium = { color: ["#4ba5ff","#71a8de","#b4c7da","#3e6892","#6da4da","#9dc1e6"], behavior: [ - "XX|CR:radiation%20|XX", - "CR:radiation%1|CH:lead%0.001|CR:radiation%20", + "XX|CR:radiation%15|XX", + "CR:radiation%1|CH:lead%0.001|CR:radiation%15", "M2|M1|M2", ], reactions: { @@ -3298,6 +3352,186 @@ elements.turtle_egg = { breakInto: "crushed_shell" } +elements.radium = { + color: ["#d9d9d9", "#d0d0d0", "#b3b3b3"], + behavior: [ + "XX|CR:radiation%1000000|XX", + "CR:radiation%1000000|CH:lead%0.001|CR:radiation%1000000", + "M2|M1|M2", + ], + reactions: { + "neutron": { elem1:"n_explosion", tempMin:700, chance:0.1 } + }, + tempHigh: 1132.2, + category: "powders", + state: "solid", + density: 5500, + hardness: 0.45, + conduct: 0.235, + excludeRandom: true +} + +elements.unbreakable_battery = { + color: "#9d8725", + behavior: [ + "XX|SH|XX", + "SH|XX|SH", + "XX|SH|XX", + ], + category: "machines", + hardness: 1 +} + +elements.diamond_wall = { + color: ["#03fcec","#03c6fc","#b3eeff","#8ab0e6"], + behavior: behaviors.WALL, + category: "solids", + tempHigh: 900, + stateHigh: "carbon_dioxide", + state: "solid", + density: 3515, + hardness: 0.99, + breakInto: "diamond" +} + +elements.osmium = { + color: ["#bddee4","#a7c3c8","#98b3b7"], + behavior: behaviors.WALL, + category: "solids", + tempHigh: 3033, + state: "solid", + density: 3515, + hardness: 0.7, + breakInto: "osmium_shard" +} + +elements.osmium_shard = { + color: ["#bddee4","#a7c3c8","#98b3b7"], + behavior: behaviors.POWDER, + category: "powders", + tempHigh: 3033, + state: "solid", + density: 3515, + hardness: 0.7, +} + +elements.copper_scrap = { + color: ["#a95232","#be4322","#c76035"], + behavior: behaviors.POWDER, + reactions: { + "blood": { elem1:"oxidized_copper_scrap", chance:0.003 }, + "infection": { elem1:"oxidized_copper_scrap", chance:0.003 }, + "antibody": { elem1:"oxidized_copper_scrap", chance:0.003 }, + "fire": { elem1:"oxidized_copper_scrap", chance:0.0025 }, + }, + category: "powders", + tempHigh: 1085, + density: 8960, + conduct: 0.95, + hardness: 0.3, + fireColor: ["#07BA4F","#00BC5B","#00C2A9","#11B7E7","#C6F2EC"] +} + +elements.oxidized_copper_scrap = { + color: ["#406555","#42564a","#517364"], + behavior: behaviors.POWDER, + reactions: { + "hydrogen": {tempMin:900, elem1:"copper_scrap", elem2:"steam"} + }, + category: "powders", + hidden: true, + tempHigh: 1085, + stateHigh: "molten_copper", + density: 8960, + conduct: 0.85, + hardness: 0.2, + alias: "copper carbonate" +} + +elements.cleaning_solution = { + color: "#5894e9", + behavior: behaviors.LIQUID, + reactions: { + "milk": { elem1: null, elem2: "cheese" }, + "pilk": { elem1: null, elem2: "cheese", color2:"#c48a25" }, + "fruit_milk": { elem1: null, elem2: "cheese", color2:"#c2864e" }, + "chocolate_milk": { elem1: null, elem2: "cheese", color2:"#6b4000" }, + "eggnog": { elem1: null, elem2: "cheese", color2:"#ffdb63" }, + "nut_milk": { elem1: null, elem2: "cheese", color2:"#ded0ad" }, + "yogurt": { elem1: null, elem2: "cheese" }, + "baking_soda": { elem1: "sodium_acetate", elem2: "carbon_dioxide", attr1:{"foam":20} }, + "limestone": { elem1: "sodium_acetate", elem2: "carbon_dioxide", attr1:{"foam":5} }, + "rust": { elem2:"iron", chance:0.05 }, + "oxidized_copper": { elem2:"copper", chance:0.05 }, + "egg": { elem2:"yolk", chance:0.0005 }, + "yolk": { elem1:"mayo", elem2:"mayo", chance:0.1 }, + "mushroom_spore": { elem2:null, chance:0.05 }, + "mushroom_gill": { elem2:null, chance:0.05 }, + "mushroom_cap": { elem2:null, chance:0.05 }, + "pollen": { elem2:null, chance:0.05 }, + "salt": { elem1: null, elem2: "sodium_acetate", chance:0.05 }, + "lettuce": { elem2:"pickle", chance:0.01 }, + "egg": { elem2:"pickle", color2:"#e0e0ab", chance:0.01 }, + "tomato": { elem2:"pickle", color2:"#fa6e11", chance:0.01 }, + "grape": { elem2:"pickle", color2:"#b86a4b", chance:0.01 }, + "pumpkin": { elem2:"pickle", color2:"#ffa42e", chance:0.01 }, + "dirt": { elem1: null, elem2: "mud" }, + "sand": { elem1: null, elem2: "wet_sand" }, + "clay_soil": { elem1: null, elem2: "clay" }, + }, + viscosity: 12, + tempHigh: 100.6, + stateHigh: ["steam","carbon_dioxide","methane"], + tempLow: -2.22, + stateLowName: "frozen_cleaning_solution", + category: "liquids", + state: "liquid", + density: 1006, + stain: -1.05 +} + +elements.abs_zero = { + color: "#a2ddff", + tool: function(pixel) { + pixel.temp = absoluteZero + pixelTempCheck(pixel); + }, + category: "tools", + excludeRandom: true +} + +elements.firedoesntwork = { + color: "#c44f45", + tick: function(pixel) { + if ((pixel.temp > absoluteZero || pixel.charge) && !pixel.burning) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + if (pixel.burning) { + if (!tryMove(pixel, pixel.x, pixel.y-1)) { + // tryMove again to the top left or top right + tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y-1); + } + if (pixelTicks-pixel.burnStart > 50 && Math.random() < 0.1) { + explodeAt(pixel.x, pixel.y, 10, "fw_ember"); + } + } + else { + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + // tryMove again to the bottom left or bottom right + tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1); + } + } + doDefaults(pixel); + }, + burn: 90, + burnTime: 100, + density: 2000, + conduct: 1, + state: "solid", + category: "weapons" +} + if (!elements.sand.reactions) { elements.sand.reactions = {} } elements.sand.reactions.dirt = { elem1:"dirty_sand", elem2:"dirty_sand" } @@ -3374,6 +3608,9 @@ elements.when_iium.reactions.when_i_particles = { elem1:"when_i_particles", elem if (!elements.ash.reactions) { elements.ash.reactions = {} } elements.ash.reactions.dust = { elem1:"dusty_ash", elem2:"dusty_ash" } +if (!elements.vinegar.reactions) { elements.vinegar.reactions = {} } +elements.vinegar.reactions.alchohol = { elem1:"cleaning_solution", elem2:"cleaning_solution" } + elements.steel.hardness = 0.85 elements.uncharge.category = "tools" @@ -3384,5 +3621,15 @@ elements.room_temp.category = "tools" elements.heat_ray.category = "rays" +elements.battery.breakInto = "explosion" + +elements.oxidized_copper.category = "solids" + +elements.oxidized_copper.behavior = behaviors.SOLID + +elements.oxidized_copper.breakInto = "oxidized_copper_scrap" + +elements.body.color = ["#069469","#047e99","#7f5fb0", "#e85858", "#e8ac58", "#e8cc47", "#48e84e", "#48e7e8", "#488be8", "#9312e8", "#e8136e", "#8e492d"] + // important colors: ["#000000", "#edff00", "#3a3a3a", "#ff0000"], ["#82c0ff", "#ff8282"], ["#cca77c","#ad8b63","#b59d81","#c7a073","#c9b297"], \ No newline at end of file From 5c9ce253c6d2d4e00dfa8e24d497c52a14e9b5b4 Mon Sep 17 00:00:00 2001 From: Retorta1 <165048795+Retorta1@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:21:00 +0200 Subject: [PATCH 49/67] Update hu.json Added translation for sandstorm and fixed a typo --- lang/hu.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/hu.json b/lang/hu.json index a771c0f6..b8645d87 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -348,7 +348,7 @@ "amber":"borostyán", "caramel":"karamella", "molasses":"melasz", -"ketchup":"kechup", +"ketchup":"ketchup", "mayo":"majonéz", "melted_chocolate":"olvasztott_csokoládé", "liquid_hydrogen":"folyékony_hidrogén", @@ -475,8 +475,8 @@ "molten_dirt":"olvadt_föld", "debug":"hibaelhárító", "prop":"tulajdonság-állító", -"salt_ice":"só_jég", -"sugar_ice":"cukor_jég", +"salt_ice":"sós_jég", +"sugar_ice":"cukros_jég", "seltzer_ice":"fagyott_szódavíz", "dirty_ice":"piszkos_jég", "pool_ice":"fagyott_medencevíz", @@ -531,7 +531,7 @@ "molten_potassium": "olvadt_kálium", "magnesium": "magnézium", "molten_magnesium": "olvadt_magnézium", -"sandstorm": "", +"sandstorm": "homokvihar", "caustic_potash": "kálium-hidroxid", "antibomb": "antibomba", "tornado": "tornádó", From cb4d253b2927b796bd6bdacf3981819c83c2df2f Mon Sep 17 00:00:00 2001 From: CarbonMonoxida <164758530+CarbonMonoxida@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:13:50 +0700 Subject: [PATCH 50/67] Update aScientistsWish.js Changelog: 1. Update for rad rock 2. Add rad cleaner 3. Add rad snow --- mods/aScientistsWish.js | 73 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/mods/aScientistsWish.js b/mods/aScientistsWish.js index 90e306de..88a3ca54 100644 --- a/mods/aScientistsWish.js +++ b/mods/aScientistsWish.js @@ -29,6 +29,7 @@ elements.liquid_carbon_monoxide = { category: "liquids", state: "liquid", density: 1.14, + darkText: true, tempHigh: -190, temp: -192, tempLow: -199, @@ -44,6 +45,7 @@ elements.ice_carbon_monoxide = { temp: -199, density: 1.14, tempHigh: -192, + darkText: true, stateHigh: "liquid_carbon_monoxide", }; elements.carbon_monoxide_detector = { @@ -189,6 +191,8 @@ elements.fallout_drum = { state: "solid", density: 9000, color: "#e3cc34", + tempHigh: 2500, + stateHigh: ["aluminum","radiated_water","radiated_water","fallout"], breakInto: ["fallout","fallout"], reactions: { "water": { elem1:"fallout_drum", elem2:"radiated_water" }, @@ -226,9 +230,13 @@ elements.polluted_air = { "head": { elem2:"rotten_meat" }, "human": { elem2:"rotten_meat" }, "bird": { elem2:"rotten_meat" }, - "cell": { elem2:"cancer"}, + "cell": { elem2:"cancer" }, "water": { elem1: null, elem2: "radiated_water" }, - } + "worm": { elem2: ["ash","cancer"] }, + "flea": { elem2: "ash" }, + "seed": {elem2: "dead_plant" }, + "plant": {elem1: null, chance:0.5, elem2: "dead_plant", chance:0.5 }, + }, }; elements.siren = { @@ -267,4 +275,65 @@ elements.rad_ice = { color: ["#81d79c","#68b899","#68abb8"], hidden: true, temp: -6, + tempHigh: 5, + stateHigh: ["radiated_water","water"], + reactions: { + "snow": { elem2:"dirty_water" }, + "water": { elem2:"radiated_water" }, + } +} + +elements.rad_snow = { + behavior: behaviors.POWDER, + category: "radiated", + state:"powder", + density: 1500, + color: ["#9effe4","#b5fffd","#d4fff1"], + temp: -2, + tempHigh: 21, + stateHigh: "radiated_water", +}; + +elements.rad_rock = { + behavior: behaviors.POWDER, + category: "land", + state: "powder", + density: 2790, + color: ["#34382d","#3f4633","#595a4d"], + tempHigh: 1200, + stateHigh: ["magma","fallout"], + reactions: { + "water": { elem2:"dirty_water" }, + "salt_water": { elem2:"dirty_water" }, + "sugar_water": { elem2:"dirty_water" }, + "seltzer": { elem2:"dirty_water" }, + "bleach": {elem2: "rock", chance:0.1 }, + "rad_cleaner": { elem1:"rock" }, + "foam": { elem1:"rock" }, + "juice": { elem2: null }, + "blood": { elem2:"infection" }, + "grass": { elem2:"dead_plant" }, + "plant": { elem2:"dead_plant" }, + "cell": { elem2:"cancer" }, + "worm": { elem2:"ash" }, + "glass": { elem2:"rad_glass"}, + "glass_shard": { elem2:"rad_shard" }, + } +}; + +elements.rad_cleaner = { + behavior: behaviors.WALL, + category: "machines", + state: "solid", + density: 2500, + color: ["#383838","#212220"], + desc: "clean radiated elements", + tempHigh: 1250, + stateHigh: ["fallout","molten_plastic","steam"], + reactions: { + "radiated_water": {elem2:"water" }, + "polluted_air": {elem2: "oxygen"}, + "rad_snow": {elem2: "snow"}, + "rad_rock": {elem2: "rock"}, + } } From bac8f0cb4e26881ee21f7a790e312a6886982552 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Thu, 18 Apr 2024 18:11:20 -0400 Subject: [PATCH 51/67] radon and oganesson --- mods/halogen.js | 1 + mods/noblegas.js | 124 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) diff --git a/mods/halogen.js b/mods/halogen.js index 9d3df94d..254197dd 100644 --- a/mods/halogen.js +++ b/mods/halogen.js @@ -8,6 +8,7 @@ for (let elementi in elements){ } biologicaltocorrode.splice(biologicaltocorrode.indexOf("salt"), 1) biologicaltocorrode.splice(biologicaltocorrode.indexOf("sugar"), 1) +biologicaltocorrode.push("wood") function basicHalogen(pixel){ for (var i = 0; i < adjacentCoords.length; i++) { var coord = adjacentCoords[i]; diff --git a/mods/noblegas.js b/mods/noblegas.js index 4d5a2540..4854e83f 100644 --- a/mods/noblegas.js +++ b/mods/noblegas.js @@ -102,4 +102,128 @@ elements.frozen_xenon = { stateHigh: "liquid_xenon", density: 3410, conduct: 0.8 +} +elements.radon = { + color: elements.neon.color, + behavior: behaviors.GAS, + colorOn: ["#d33d7c","#f73273","#c03190"], + category: "gases", + state: "gas", + conduct: 0.8, + tempLow: -61, + stateLow: "liquid_radon", + density: 9.73, + tick: function(pixel){ + if(elements.polonium){ + if(Math.random()<0.00038){ + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y) && Math.random()<0.01){ + createPixel(x, y, "helium") + pixelMap[x][y].temp += 75 + break; + } + } + changePixel(pixel, "polonium", false) + pixel.temp += 100 + } + }else{ + if(Math.random()<0.00038){ + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true) && Math.random()<0.01){ + pixel.temp += 50 + } + } + changePixel(pixel, "helium", false) + pixel.temp += 100 + } + } + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y) && Math.random() < 0.001){ + createPixel("radiation", x, y); + } + } + } +} +elements.liquid_radon = { + color: elements.neon.color, + behavior: behaviors.LIQUID, + colorOn: ["#d33d7c","#f73273","#c03190"], + category: "states", + state: "liquid", + tempHigh: -58, + stateHigh: "radon", + density: 13, + tempLow: -71, + stateLow: "frozen_radon", + conduct: 0.8, + tick: elements.radon.tick +} +elements.frozen_radon = { + color: elements.neon.color, + behavior: behaviors.WALL, + colorOn: ["#d33d7c","#f73273","#c03190"], + category: "states", + state: "solid", + tempHigh: -68, + stateHigh: "liquid_radon", + density: 16, + conduct: 0.8, + tick: elements.radon.tick +} +elements.oganesson = { + color: elements.neon.color, + behavior: behaviors.GAS, + colorOn: ["#5bdce6","#56a9f7","#56b0e4"], + category: "gases", + state: "gas", + conduct: 0.8, + density: 9.73, + tick: function(pixel){ + if(elements.livermorium){ + if(Math.random()<0.038){ + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y) && Math.random()<0.01){ + createPixel(x, y, "helium") + pixelMap[x][y].temp += 250 + break; + } + } + changePixel(pixel, "livermorium", false) + pixel.temp += 100 + } + }else{ + if(Math.random()<0.038){ + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x, y, true) && Math.random()<0.01){ + pixel.temp += 100 + } + } + changePixel(pixel, "helium", false) + pixel.temp += 250 + } + } + for (var i = 0; i < adjacentCoords.length; i++){ + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x, y) && Math.random() < 0.01){ + createPixel("radiation", x, y); + } + } + } } \ No newline at end of file From 84a51c12d95e1665b42f20a302a6eb1b055e22e6 Mon Sep 17 00:00:00 2001 From: WoodStuff Date: Fri, 19 Apr 2024 19:26:06 +0200 Subject: [PATCH 52/67] add freeze tool to nirmod & add copy_canvas.js --- mods/copy_canvas.js | 9 +++++++++ mods/nirmod.js | 46 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 mods/copy_canvas.js diff --git a/mods/copy_canvas.js b/mods/copy_canvas.js new file mode 100644 index 00000000..d7e8be64 --- /dev/null +++ b/mods/copy_canvas.js @@ -0,0 +1,9 @@ +document.addEventListener("keydown", function(e) { + if (e.keyCode == 83) { + document.getElementById("game").toBlob(function(blob) { + const item = new ClipboardItem({ "image/png": blob }); + navigator.clipboard.write([item]); + }); + alert("Canvas copied!"); + } +}) \ No newline at end of file diff --git a/mods/nirmod.js b/mods/nirmod.js index 013971eb..99e69ade 100644 --- a/mods/nirmod.js +++ b/mods/nirmod.js @@ -82,6 +82,7 @@ class Type { this.breakInto = undefined; this.properties = undefined; this.maxSize = undefined; + this.tool = undefined; } setColor(color) { @@ -238,16 +239,16 @@ function createOther() { Fw.stateHigh = "plasma"; Fw.breakInto = "fire"; Fw.reactions = { - "water": { elem1: "wall", chance: 0.2 }, - "steam": { elem1: "wall", chance: 0.2 }, - "carbon_dioxide": { elem1: "wall", chance: 0.2 }, - "foam": { elem1: "wall", chance: 0.2 }, - "dirty_water": { elem1: "wall", chance: 0.2 }, - "salt_water": { elem1: "wall", chance: 0.2 }, - "sugar_water": { elem1: "wall", chance: 0.2 }, - "seltzer": { elem1: "wall", chance: 0.2 }, - "pool_water": { elem1: "wall", chance: 0.2 }, - }, + "water": { elem1: "wall", chance: 0.2 }, + "steam": { elem1: "wall", chance: 0.2 }, + "carbon_dioxide": { elem1: "wall", chance: 0.2 }, + "foam": { elem1: "wall", chance: 0.2 }, + "dirty_water": { elem1: "wall", chance: 0.2 }, + "salt_water": { elem1: "wall", chance: 0.2 }, + "sugar_water": { elem1: "wall", chance: 0.2 }, + "seltzer": { elem1: "wall", chance: 0.2 }, + "pool_water": { elem1: "wall", chance: 0.2 }, + }, Fw.Add(); const Nz = new Type("nirmizer"); @@ -267,6 +268,29 @@ function createOther() { Nz.Add(); } +function createTools() { + const Fr = new Type("freeze"); + Fr.setColor(["#7fcef0", "#b2daeb"]); + Fr.behavior = [ + "CO:100|CO:100|CO:100", + "CO:100|CO:100|CO:100", + "CO:100|CO:100|CO:100", + ], + Fr.tool = function(pixel) { + let value = Math.max(30, pixel.temp / 5); + if (shiftDown) value *= 2; + pixel.temp -= value; + pixelTempCheck(pixel); + } + Fr.temp = -273; + Fr.category = cat.ENERGY; + Fr.insulate = true; + Fr.canPlace = false; + Fr.desc = "Use on pixels to heavily decrease temperature." + Fr.Add(); +} + createNirmics(); createMinerals(); -createOther(); \ No newline at end of file +createOther(); +createTools(); \ No newline at end of file From 550139bb613cfa766016d011e72e76d3f1f7af31 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Fri, 19 Apr 2024 19:40:15 -0400 Subject: [PATCH 53/67] skin --- mods/10kelements.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mods/10kelements.js b/mods/10kelements.js index 4f8ab487..f60a6e13 100644 --- a/mods/10kelements.js +++ b/mods/10kelements.js @@ -9,10 +9,12 @@ elements.change_count = { onSelect: function() { var cans = prompt("Please input how many elements you would like to be generared each time.", 10000); if (!cans) { return } + if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; saveSettings(); alert("skin"); return} if (cans > 2000000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return} if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return} if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return} settings.randomcount = parseInt(cans) + settings.skineasteregg = false; saveSettings() }, category: "random" @@ -34,6 +36,7 @@ var randomProperty = function (obj) { return obj[keys[ keys.length* Math.random() << 0]]; }; if (Math.abs(settings.randomcount) == settings.randomcount){ + if (!settings.skineasteregg){ for (var i = 1; i <= settings.randomcount; i++){ var f = Math.random() < 0.2 var co = Math.random() < 0.2 @@ -72,6 +75,21 @@ if (Math.abs(settings.randomcount) == settings.randomcount){ } } } +} else { + for (var i = 1; i <= settings.randomcount; i++){ + elements["skin_" + i] = { + color: elements.skin.color, + category: "skin", + tick: function(pixel){ + changePixel(pixel, "skin", false) + }, + density: elements.skin.color, + behavior: behaviors.WALL, + state: "solid", + name: "skin" + } + } +} } else { window.addEventListener('load', function() { elementslist = [] From 82d62b9fcc5d3f01aa6abc118f2bb38612416974 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Sat, 20 Apr 2024 23:20:00 -0400 Subject: [PATCH 54/67] healing serum --- mods/nousersthings.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 8a15d5fb..59e7028e 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -2655,3 +2655,44 @@ elements.grid_brush = { } } } +elements.healing_serum = { + color: ["#79d2c5", "#77d8c0", "#78ddb9", "#7de1b0", "#85e6a6", "#91e99a", "#9fec8e"], + behavior: behaviors.LIQUID, + category: "liquids", + state: "liquid", + properties: { + wait: 15, + waitReduce: false, + }, + tick: function(pixel){ + if (pixel.waitReduce){pixel.wait -= 1} + if (pixel.wait == 0){ + pixel.elementsSeen = {} + } + for (var i = 0; i < adjacentCoords.length; i++) { + var coord = adjacentCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y, true)){ + if (!pixel.waitReduce){ + pixel.waitReduce = true + } + if (pixel.wait == 0){ + if (!pixel.elementsSeen[pixelMap[x][y].element] && pixelMap[x][y].element != "healing_serum"){ + pixel.elementsSeen[pixelMap[x][y].element] = 1 + } else if (pixelMap[x][y].element != "healing_serum") { + pixel.elementsSeen[pixelMap[x][y].element] += 1 + } + } + } + if (pixel.wait == 0){ + if (Object.keys(pixel.elementsSeen).length == 0){ + deletePixel(pixel.x, pixel.y) + return; + } else{ + changePixel(pixel, Object.keys(pixel.elementsSeen).reduce((a, b) => pixel.elementsSeen[a] > pixel.elementsSeen[b] ? a : b)) + } + } + } + } +} \ No newline at end of file From 434dcac372def526329434f653be8efad332f277 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername Date: Sun, 21 Apr 2024 15:50:13 -0400 Subject: [PATCH 55/67] bettermetalscrap.js --- mod-list.html | 1 + mods/bettermetalscrap.js | 37 +++++++++++++++++++++++++++++++++++++ mods/halogen.js | 6 ++++++ mods/heatglow.js | 37 +++++++++++++++++++++++-------------- 4 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 mods/bettermetalscrap.js diff --git a/mod-list.html b/mod-list.html index a383129d..f07335c9 100644 --- a/mod-list.html +++ b/mod-list.html @@ -156,6 +156,7 @@ alcohol.jsAdds methanol, (iso-)propanol, and butanolAlice alkahest.jsAdds the alkahest, a liquid which dissolves anythingAlice aScientistsWish.jsAdds things that related to science, especially radiationCarbon Monoxide, CPU +bettermetalscrap.jsAllows metal scrap to be melted back into its original materialnousernamefound bigger_star_spawners.jsAdds spawners for larger starsAlice bioooze_and_pyrogens.jsAdds Bio-Ooze from Frackin’ Universe and several heat-producing materials from various games’ modsAlice boiling_things.jsAllows for various elements to be vaporizedAlice diff --git a/mods/bettermetalscrap.js b/mods/bettermetalscrap.js new file mode 100644 index 00000000..d4f34e85 --- /dev/null +++ b/mods/bettermetalscrap.js @@ -0,0 +1,37 @@ +if (!elements.aluminum.properties){elements.aluminum.properties = {}} +elements.aluminum.properties.scrapType = "aluminum" +if (!elements.tin.properties){elements.tin.properties = {}} +elements.tin.properties.scrapType = "tin" +if (!elements.brass.properties){elements.brass.properties = {}} +elements.brass.properties.scrapType = "brass" +if (!elements.grenade.properties){elements.grenade.properties = {}} +elements.grenade.properties.scrapType = "steel" +if (!elements.smoke_grenade.properties){elements.smoke_grenade.properties = {}} +elements.smoke_grenade.properties.scrapType = "steel" +if (!elements.flashbang.properties){elements.flashbang.properties = {}} +elements.flashbang.properties.scrapType = "steel" +var randomScrap = ["aluminum", "steel", "iron"] +delete elements.metal_scrap.tempHigh +delete elements.metal_scrap.stateHigh +if (!elements.metal_scrap.tick){ +elements.metal_scrap.tick = function(pixel){ + if (!pixel.scrapType){ + pixel.scrapType = randomScrap[Math.floor(Math.random()*randomScrap.length)] + } + if (pixel.temp >= elements[pixel.scrapType].tempHigh){ + changePixel(pixel, pixel.scrapType, false) + } +} +} +else { + const prefunc = elements.metal_scrap.tick; + elements.metal_scrap.tick = function(pixel){ + prefunc(pixel); + if (!pixel.scrapType){ + pixel.scrapType = randomScrap[Math.floor(Math.random()*randomScrap.length)] + } + if (pixel.temp >= elements[pixel.scrapType].tempHigh){ + changePixel(pixel, pixel.scrapType, false) + } + } +} \ No newline at end of file diff --git a/mods/halogen.js b/mods/halogen.js index 254197dd..a63b5ac3 100644 --- a/mods/halogen.js +++ b/mods/halogen.js @@ -9,6 +9,12 @@ for (let elementi in elements){ biologicaltocorrode.splice(biologicaltocorrode.indexOf("salt"), 1) biologicaltocorrode.splice(biologicaltocorrode.indexOf("sugar"), 1) biologicaltocorrode.push("wood") +if (enabledMods.includes("mods/bettermetalscrap.js")){ + for (let metal in metalstocorrode){ + if (!elements[metalstocorrode[metal]].properties){elements[metalstocorrode[metal]].properties = {}} + elements[metalstocorrode[metal]].properties.scrapType = metalstocorrode[metal] + } +} function basicHalogen(pixel){ for (var i = 0; i < adjacentCoords.length; i++) { var coord = adjacentCoords[i]; diff --git a/mods/heatglow.js b/mods/heatglow.js index 568d58fd..8c8dabc0 100644 --- a/mods/heatglow.js +++ b/mods/heatglow.js @@ -2,32 +2,41 @@ function weightedAverage(num1, num2, weight){ return ((weight * num1)+((1-weight)*num2)) } const heatfunc = function(pixel){ - if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null || !(pixel.element == pixel.ogElement)){ + if (pixel.element != "metal_scrap" || eLists.metals.includes(pixel.scrapType) || !pixel.scrapType){{ + if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null || (pixel.element != pixel.ogElement && pixel.element == "metal_scrap") || (pixel.element != "metal_scrap" && pixel.ogElement == "metal_scrap")){ pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10) pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10) pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10) pixel.ogElement = pixel.element - }else{ - var gethigh = (elements[pixel.element].tempHigh) + } + var gethigh = 1000 + var ctemp = 0 + var ogR = 0 + var ogG = 0 + var ogB = 0 + if (elements[pixel.element].tempHigh){ + gethigh = elements[pixel.element].tempHigh + } else if (pixel.scrapType) { + gethigh = elements[pixel.scrapType].tempHigh + } var halftemp = ((20+gethigh)/2) if (pixel.temp <= (gethigh) - halftemp){ - var ctemp = 0; + ctemp = 0; } else if (pixel.temp > (gethigh)-halftemp && pixel.temp <= gethigh){ - var ctemp = ((1/halftemp)*pixel.temp)-(((gethigh)-halftemp)/halftemp) + ctemp = ((1/halftemp)*pixel.temp)-(((gethigh)-halftemp)/halftemp) } if (ctemp <= 0.5){ - var newR = (((510-(2*pixel.ogR))*ctemp)+pixel.ogR); - var newG = ((0-((2*pixel.ogG)*ctemp))+pixel.ogG); - var newB = ((0-((2*pixel.ogB)*ctemp))+pixel.ogB); + newR = (((510-(2*pixel.ogR))*ctemp)+pixel.ogR); + newG = ((0-((2*pixel.ogG)*ctemp))+pixel.ogG); + newB = ((0-((2*pixel.ogB)*ctemp))+pixel.ogB); }else if (ctemp > 0.5){ - var newR = 255; - var newG = ((510*ctemp)-255); - var newB= ((280*ctemp)-140); + newR = 255; + newG = ((510*ctemp)-255); + newB= ((280*ctemp)-140); } let weight = (1-(ctemp/1.3)) pixel.color = "rgb(" + weightedAverage(pixel.ogR, newR, weight) + "," + weightedAverage(pixel.ogG, newG, weight) + "," + weightedAverage(pixel.ogB, newB, weight) + ")"; - } - }; + }}}; if (!eLists.metals) { eLists.metals = [] } eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead", "rose_gold"]) eLists.metals.forEach(metal => { @@ -36,8 +45,8 @@ eLists.metals.forEach(metal => { elements[metal].tick = heatfunc; }else{ const modfunc = function(pixel){ - prefunc(pixel); heatfunc(pixel); + prefunc(pixel); }; elements[metal].tick = modfunc; } From bdc6b0ef4996cc04665492b9a3b69a0c326775dd Mon Sep 17 00:00:00 2001 From: DoobieRalsei <163950752+DoobieRalsei@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:11:47 -0700 Subject: [PATCH 56/67] scp.js yeah i just added it to submit to see if ryan accepts it um yeah --- mods/scp.js | 1226 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1226 insertions(+) create mode 100644 mods/scp.js diff --git a/mods/scp.js b/mods/scp.js new file mode 100644 index 00000000..bdc51970 --- /dev/null +++ b/mods/scp.js @@ -0,0 +1,1226 @@ +window.addEventListener("load", () => { + document.getElementById("elementButton-mask_head")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-mask_body")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-zombie")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-z_head")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-z_body")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-REDACTED")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-hyper_tickle_monster")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-calm_682")?.remove() +}) + +window.addEventListener("load", () => { + document.getElementById("elementButton-mad_682")?.remove() +}) + +// Coding junk past this point + +// also hi jonny ray + +elements.anomalous_essence = { + hidden: true, + color: "#f7ead0", + behavior: behaviors.GAS, + category: "scp", + state: "gas", + density: 0.50, +}; + +elements.SCP_008 = { + color: "#11111f", + behavior: [ + "M2|M1|M2", + "M1|XX|M1", + "M2|M1|M2", + ], + reactions: { + "head": { elem1:null, elem2:"z_head" , chance:0.5 }, + "body": { elem1:null, elem2:"z_body" , chance:0.5 }, + "frog": { elem2:"SCP_008" , chance:0.5 }, + "ant": { elem2:"SCP_008" , chance:0.5 }, + "bee": { elem2:"SCP_008" , chance:0.5 }, + "fish": { elem2:"SCP_008" , chance:0.5 }, + "firefly": { elem2:"SCP_008" , chance:0.5 }, + "chlorine": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + "liquid_chlorine": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + "light": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + }, + tempHigh: 1000, + stateHigh: [null,null,null,null,"anomalous_essence"], + tempLow: -100, + stateLow: "frozen_008", + category: "scp", + state: "gas", + density: 100, +}, + +elements.frozen_008 = { + color: "#242424", + behavior: [ + "XX|XX|XX", + "XX|DL%0.001|X", + "M2%1.0|M1%1.0|M2%1.0", + ], + reactions: { + "head": { elem1:null, elem2:"z_head" , chance:0.4 }, + "body": { elem1:null, elem2:"z_body" , chance:0.4 }, + "chlorine": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + "liquid_chlorine": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + "light": { elem1: [null,null,null,null,"anomalous_essence"] , chance:0.01 }, + }, + temp: -50, + tempHigh: 0, + stateHigh: "SCP_008", + category: "scp", + state: "solid", + density: 95, +}, + +elements.possessive_mask = { + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + behavior: [ + "CR:black_acid%0.1|CR:black_acid%0.5|CR:black_acid%0.1", + "CR:black_acid%0.5|XX|CR:black_acid%0.5", + "CR:black_acid%0.1|CR:black_acid%0.5 AND M1|CR:black_acid%0.1", + ], + breakInto: ["porcelain_shard","porcelain_shard","black_acid","black_acid"], + density: 800, + state: "solid", + tempHigh: 3500, + stateHigh: "porcelain_shard", + reactions: { + "head": { elem1:null, elem2: "mask_head" , chance:0.2 }, + "body": { elem1:null, elem2: "mask_body" , chance:0.1 }, + "z_head": { elem1:null, elem2: "mask_head" , chance:0.1 }, + "z_body": { elem1:null, elem2: "mask_body" , chance:0.05 }, + }, +}, + +elements.mask_body = { + color: ["#242424","#069469","#047e99","#7f5fb0"], + category: "scp", + hidden: true, + density: 1500, + state: "solid", + conduct: .05, + temp: 37, + tempHigh: 250, + stateHigh: "cooked_meat", + tempLow: -30, + stateLow: "frozen_meat", + burn: 10, + burnTime: 250, + burnInto: "cooked_meat", + breakInto: ["black_acid","rotten_meat","bone"], + reactions: { + "cancer": { elem1:"cancer", chance:0.005 }, + "egg": { elem2:"yolk", chance:0.5, oneway:true }, + }, + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "mask_head") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "mask_head") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") { // If head is not mask head, make it one + var head = pixelMap[pixel.x][pixel.y-1]; + changePixel(head,"mask_head"); + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "z_head") { // If head is not mask head, make it one + var head = pixelMap[pixel.x][pixel.y-1]; + changePixel(head,"mask_head"); + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create black acid if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("black_acid", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + } + + } +}, + +elements.mask_head = { + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + hidden: true, + density: 2280, + state: "solid", + conduct: .05, + temp: 37, + tempHigh: 250, + stateHigh: "possessive_mask", + tempLow: -30, + stateLow: "possessive_mask", + burn: 10, + burnTime: 250, + burnInto: "possessive_mask", + breakInto: "possessive_mask", + forceSaveColor: true, + reactions: { + "cancer": { elem1: "possessive_mask", chance:0.05 }, + "tea": { elem2:null, chance:0.2 }, + "alcohol": { elem2:null, chance:0.2 }, + }, + properties: { + dead: false + }, + behavior: [ + "CR:black_acid%0.1|CR:black_acid%0.5|CR:black_acid%0.1", + "CR:black_acid%0.5|XX|CR:black_acid%0.5", + "CR:black_acid%0.1|CR:black_acid%0.5 AND M1|CR:black_acid%0.1", + ], + tick: function(pixel) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into the mask if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"possessive_mask"); + return + } + } + + // Find the body + if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "mask_body") { + var body = pixelMap[pixel.x][pixel.y+1]; + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") { // If body is not mask body, make it one + var body = pixelMap[pixel.x][pixel.y+1]; + changePixel(body,"mask_body"); + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "z_body") { // If body is not mask body, make it one + var body = pixelMap[pixel.x][pixel.y+1]; + changePixel(body,"mask_body"); + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else { var body = null } + + if (tryMove(pixel, pixel.x, pixel.y+1)) { + // create blood if severed 10% chance + if (isEmpty(pixel.x, pixel.y+1) && !pixel.dead && Math.random() < 0.1 && !pixel.charge) { + createPixel("black_acid", pixel.x, pixel.y+1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } +}, + +elements.black_acid = { + hidden: true, + color: ["#00000f","#111111","#242424"], + behavior: [ + "XX|DB%5|XX", + "DB%6 AND M2%10|XX|DB%6 AND M2%10", + "DB%6 AND M2%10|DB%11 AND M1|DB%6 AND M2%10", + ], + ignore: [/*"SCP_804"*/"shy_head","shy_body","SCP_055","head","body","z_body","z_head","possessive_mask","mask_body","mask_head","glass_shard","porcelain_shard","rad_shard","color_sand","sand","iron","steel","glass","rad_glass","stained_glass","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","oxygen","ozone","gold_coin","silver","nickel","calcium"], + reactions: { + "caustic_potash": { elem1:null, elem2:"potassium_salt" }, + "water": { elem1:null, elem2:"dirty_water" }, + "salt_water": { elem1:null, elem2:"water" }, + "sugar_water": { elem1:null, elem2:"water" }, + "pool_water": { elem1:null, elem2:"water" }, + "plant": { elem1:null, elem2:"dead_plant" }, + "tree_branch": { elem1:null, elem2:"wood" }, + "charcoal": { elem1:null, elem2:"carbon_dioxide" }, + "rock": { elem1:null, elem2:"sand", chance:0.05 }, + "baking_soda": { elem1:null, elem2:["carbon_dioxide","foam"] }, + "calcium": { elem1:null, elem2:"hydrogen", chance:0.01 }, + "zinc": { elem1:null, elem2:null, chance:0.03 }, + "sugar": { elem1:null, elem2:"carbon_dioxide" }, + "glass": { elem1:null, elem2: null , chance:0.01 }, + "rad_glass": { elem1:null, elem2: null , chance:0.01 }, + "stained_glass": { elem1:null, elem2: null , chance:0.01 }, + "glass_shard": { elem1:null, elem2: null , chance:0.015 }, + "rad_shard": { elem1:null, elem2: null , chance:0.015 }, + "porcelain_shard": { elem1:null, elem2: null , chance:0.015 }, + "copper": { elem1:null, elem2: null , chance:0.02 }, + "gold": { elem1:null, elem2: null , chance:0.02 }, + "porcelain": { elem1:null, elem2: null , chance:0.01 }, + "plastic": { elem1:null, elem2: null , chance:0.01 }, + "molten_plastic": { elem1:null, elem2: null , chance:0.02 }, + "gold_coin": { elem1:null, elem2: "gold" , chance:0.1 }, + "silver": { elem1:null, elem2: null , chance:0.02 }, + "nickel": { elem1:null, elem2: null , chance:0.02 }, + "calcium": { elem1:null, elem2: null , chance:0.02 }, + "iron": { elem1:null, elem2: null , chance:0.02 }, + "steel": { elem1:null, elem2: null , chance:0.02 }, + "concrete": { elem1:null, elem2: null , chance:0.05 }, + "rock": { elem1:null, elem2: null , chance:0.04 }, + "dirt": { elem1:null, elem2: null , chance:0.05 }, + "sand": { elem1:null, elem2: null , chance:0.015 }, + "color_sand": { elem1:null, elem2: null , chance:0.015 }, + "mask_head": { elem1:null, elem2: "possessive_mask" , chance:0.001}, + "mask_body": { elem1:null, elem2: null , chance:0.001 }, + "head": { elem1:null, elem2: null , chance:0.01 }, + "body": { elem1:null, elem2: null , chance:0.01 }, + "z_head": { elem1:null, elem2: null , chance:0.02 }, + "z_body": { elem1:null, elem2: null , chance:0.02 }, + /*"SCP_804": { elem1:null, elem2: null , chance:0.02 },*/ + }, + category: "scp", + tempHigh: 1000, + stateHigh: null, + tempLow: -58.88, + burn: 30, + burnTime: 10, + burnInto: ["fire","fire","fire","fire","fire","fire","fire","fire","ash","ash","anomalous_essence"], + fireColor: "#111111", + state: "liquid", + density: 1105, + stain: 0.5, +}, + +elements.SCP_055 = { + color: "#00000f", + excludeRandom: true, + behavior: [ + ["XX","XX","XX"], + ["XX","CH:REDACTED","XX"], + ["XX","XX","XX"] + ], + category: "scp", + state: "solid", + tempHigh: 55055055055, + stateHigh: ["metal_scrap","smoke","smoke","anomalous_essence"], +}, + +elements.REDACTED = { + hidden: true, + color: "#00000f", + excludeRandom: true, + behavior: [ + ["XX","xx","XX"], + ["XX","EX","XX"], + ["XX","XX","XX"] + ], + category: "scp", + state: "solid", +}, + +elements.plague_doctor = { + category: "scp", + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+1)) { + createPixel("doc_body", pixel.x, pixel.y+1); + pixel.element = "doc_head"; + } + else if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("doc_head", pixel.x, pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixel.color; + pixel.element = "doc_body"; + } + else { + deletePixel(pixel.x, pixel.y); + } + }, + related: ["doc_body","doc_head"], + cooldown: defaultCooldown +}, + +elements.doc_head = { + hidden: true, + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + breakInto: ["rotten_meat","bone","bone","blood","anomalous_essence"], + properties: { + dead: false + }, + tick: function(pixel) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + return + } + } + + // Find the body + if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "doc_body") { + var body = pixelMap[pixel.x][pixel.y+1]; + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else { var body = null } + + if (tryMove(pixel, pixel.x, pixel.y+1)) { + // create blood if severed 10% chance + if (isEmpty(pixel.x, pixel.y+1) && !pixel.dead && Math.random() < 0.1 && !pixel.charge) { + createPixel("blood", pixel.x, pixel.y+1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + }, + density: 1100, + state: "solid", + conduct: .05, + tempHigh: 350, + stateHigh: "rotten_meat", + burn: .01, + burnTime: 300, + burnInto: "rotten_meat", + reactions: { + "alcohol": { elem2 : null , chance:0.5 }, + }, +}, + +elements.doc_body = { + hidden: true, + color: ["#11111f","#242424"], + category: "scp", + breakInto: ["rotten_meat","rotten_meat","bone","blood","anomalous_essence"], + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "doc_head") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into bone if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"bone"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "doc_head") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create blood if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("blood", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + }, + density: 1100, + state: "solid", + conduct: .005, + tempHigh: 350, + stateHigh: "rotten_meat", + burn: .01, + burnTime: 300, + burnInto: "rotten_meat", + forceSaveColor: true, + reactions: { + "head": { elem2 : "z_head" , chance:0.3}, + "body": { elem2 : "z_body" , chance:0.3}, + }, +}, + +elements.zombie = { + color: ["#75816B","#4D6B53"], + category: "scp", + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+1)) { + createPixel("z_body", pixel.x, pixel.y+1); + pixel.element = "z_head"; + } + else if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("z_head", pixel.x, pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixel.color; + pixel.element = "z_body"; + } + else { + deletePixel(pixel.x, pixel.y); + } + }, + related: ["z_body","z_head"], + cooldown: defaultCooldown +}, + +elements.z_head = { + hidden: true, + color: ["#75816B","#4D6B53"], + category: "scp", + breakInto: ["rotten_meat","bone","bone","blood","anomalous_essence"], + properties: { + dead: false + }, + tick: function(pixel) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + return + } + } + + // Find the body + if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "z_body") { + var body = pixelMap[pixel.x][pixel.y+1]; + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else { var body = null } + + if (tryMove(pixel, pixel.x, pixel.y+1)) { + // create blood if severed 10% chance + if (isEmpty(pixel.x, pixel.y+1) && !pixel.dead && Math.random() < 0.1 && !pixel.charge) { + createPixel("infection", pixel.x, pixel.y+1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + }, + density: 1030, + state: "solid", + conduct: .05, + tempHigh: 250, + stateHigh: "rotten_meat", + burn: .01, + burnTime: 200, + burnInto: "rotten_meat", + reactions: { + "head": { elem2 : "z_head" , chance:1.0 }, + "body": { elem2 : "z_body" , chance:1.0 }, + }, +}, + +elements.z_body = { + hidden: true, + color: ["#11111f","#069469","#047e99","#7f5fb0"], + category: "scp", + breakInto: ["rotten_meat","rotten_meat","bone","blood","anomalous_essence"], + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "z_head") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into bone if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "z_head") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create blood if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("infection", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + }, + density: 1035, + state: "solid", + conduct: .05, + tempHigh: 250, + stateHigh: "rotten_meat", + burn: .01, + burnTime: 300, + burnInto: "rotten_meat", + forceSaveColor: true, + reactions: { + "head": { elem2 : "z_head" , chance:1.0 }, + "body": { elem2 : "z_body" , chance:1.0 }, + }, +}, + +elements.shy_guy = { + category: "scp", + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+1)) { + createPixel("shy_body", pixel.x, pixel.y+1); + pixel.element = "shy_head"; + } + else if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("shy_head", pixel.x, pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixel.color; + pixel.element = "shy_body"; + pixel.color = pixelColorPick(pixel) + } + else { + deletePixel(pixel.x, pixel.y); + } + }, + related: ["shy_body","shy_head"], + cooldown: defaultCooldown +}, + +elements.shy_head = { + hidden: true, + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + breakInto: ["bone","bone","blood","bone","bone","blood","anomalous_essence"], + properties: { + dead: false + }, + tick: function(pixel) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"bone"); + return + } + } + + // Find the body + if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "shy_body") { + var body = pixelMap[pixel.x][pixel.y+1]; + if (body.dead) { // If body is dead, kill head + pixel.dead = body.dead; + } + } + else { var body = null } + + if (tryMove(pixel, pixel.x, pixel.y+1)) { + // create blood if severed 10% chance + if (isEmpty(pixel.x, pixel.y+1) && !pixel.dead && Math.random() < 0.1 && !pixel.charge) { + createPixel("blood", pixel.x, pixel.y+1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + }, + density: 1070, + state: "solid", + conduct: .05, + tempHigh: 3500, + stateHigh: "bone", + burn: .01, + burnTime: 3000, + burnInto: "bone", + reactions: { + "homunculus": { elem2 : ["blood","slime","blood","slime","rotten_meat",null] }, + "head": { elem2 : ["blood","blood","blood","bone",null] }, + "body": { elem2: ["blood","blood","meat","bone",null] }, + "rat": { elem2: ["infection","rotten_meat",null]}, + "frog": { elem2: ["slime",null] }, + "cell": { elem2: ["dna","water",null] }, + "cancer": { elem2: ["dna","dirty_water",null], }, + "blood": { elem2: null, chance:0.2 }, + "bone": { elem2: null, chance:0.2 }, + "meat": { elem2: [null,null,null,null,null,null,"rotten_meat"], chance:0.15 }, + "dna": { elem2: null, chance:0.2 }, + "water": { elem2: "dirty_water", chance:0.01 }, + "slime": { elem2: ["dirty_water",null], chance:0.2 }, + }, +}, + +elements.shy_body = { + hidden: true, + color: ["#f7ead0","#faf9f6","#e9e6db"], + category: "scp", + breakInto: ["bone","bone","blood","bone","bone","blood","anomalous_essence"], + properties: { + dead: false, + dir: 1, + panic: 0 + }, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down + var headpixel = pixelMap[pixel.x][pixel.y-2]; + if (headpixel.element == "shy_head") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + } + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into bone if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"bone"); + } + return + } + + // Find the head + if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "shy_head") { + var head = pixelMap[pixel.x][pixel.y-1]; + if (head.dead) { // If head is dead, kill body + pixel.dead = head.dead; + } + } + else { var head = null } + if (pixel.burning) { + pixel.panic += 0.1; + if (head && pixelTicks-pixel.burnStart > 240) { + pixel.color = head.color; + } + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + } + + if (isEmpty(pixel.x, pixel.y-1)) { + // create blood if decapitated 10% chance + if (Math.random() < 0.1 && !pixel.charge) { + createPixel("blood", pixel.x, pixel.y-1); + // set dead to true 15% chance + if (Math.random() < 0.15) { + pixel.dead = pixelTicks; + } + } + } + else if (head == null) { return } + else if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + movePixel(head, head.x+move[0], head.y+move[1]); + break; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + }, + density: 1080, + state: "solid", + conduct: .005, + tempHigh: 3500, + stateHigh: "bone", + burn: .01, + burnTime: 3000, + burnInto: "bone", + forceSaveColor: true, + reactions: { + "homunculus": { elem2 : ["blood","slime","blood","slime","rotten_meat",null] }, + "head": { elem2 : ["blood","blood","blood","meat","bone",null] }, + "body": { elem2: ["blood","blood","meat","bone",null] }, + "rat": { elem2: ["infection","rotten_meat"]}, + "frog": { elem2: "slime" }, + "cell": { elem2: ["dna","water",null] }, + "cancer": { elem2: ["dna","dirty_water"] }, + "water": { elem2: "dirty_water", chance:0.01 }, + }, +}, + +elements.SCP_682 = { + color: ["#424242","#75816B","#4D6B53"], + behavior: [ + "M2%0.5|M2%0.3|M2%0.5", + "M1%10|XX|M1%10", + "XX|M1|XX", + ], + category: "scp", + density: 7500, + reactions: { + "head": { elem2 : ["bone","blood",null] , chance:10 }, + "body": { elem1 : "mad_682" , elem2 : ["meat","blood",null] , chance:10 }, + "z_head": { elem2 : ["bone","infection",null] , chance:10 }, + "z_body": { elem1 : "mad_682" , elem2 : ["rotten_meat","infection",null] , chance:10 }, + "homunculus": { elem2 : ["slime","blood",null] , chance:10 }, + "frog": { elem2 : ["slime","blood",null] , chance:10 }, + "bird": { elem2 : ["feather","blood",null] , chance:10 }, + "meat": { elem2 : null , chance:0.2 }, + "cooked_meat": { elem2 : null , chance:0.3 }, + "tickle_monster": { elem1 : "calm_682" , chance:0.1 }, + "acid": { elem1 : "calm_682" , chance:0.2 }, + "rotten_meat": { elem2 : null , chance:0.1 }, + "blood": { elem2 : null , chance:0.2 }, + "bone": { elem2 : ["blood",null,null] , chance:0.1 }, + "bone_marrow": { elem2 : ["blood",null] , chance:0.1 }, + "aluminum": { elem2 : "metal_scrap" , chance:0.07 }, + "steel": { elem2 : "metal_scrap" , chance:0.05 }, + "iron": { elem2 : "metal_scrap" , chance:0.08 }, + "glass": { elem2 : "glass_shard" , chance:0.1 }, + "wood": { elem2 : "sawdust" , chance:0.1 }, + "concrete": { elem2 : "dust" , chance:0.05 }, + "dust": { elem2 : null , chance:0.1 }, + }, + state: "solid", + hardness: 1, + conduct: .1, +}, + +elements.calm_682 = { + color: ["#424242","#75816B","#4D6B53"], + behavior: [ + "M2%0.5|M2%0.3|M2%0.5", + "M1%10|CH:mad_682%0.5|M1%10", + "XX|M1|XX", + ], + category: "scp", + density: 7350, + excludeRandom: true, + reactions: { + "meat": { elem2 : null , chance:0.2 }, + "bone": { elem2 : null , chance:0.1 }, + "blood": { elem2 : null , chance:0.1 }, + "cooked_meat": { elem2 : null , chance:0.3 }, + "acid": { elem1 : "calm_682" , chance:0.05 }, + "tickle_monster": { elem1 : "calm_682" , chance:99.9 }, + }, + hidden: true, + state: "solid", + hardness: 1, + conduct: .1, +}, + +elements.mad_682 = { + color: ["#424242","#75816B","#4D6B53"], + behavior: [ + "M2%0.5|M2%0.3|M2%0.5", + "M1%10 AND CH:concrete>dust AND DL:dust|CH:SCP_682%0.3|M1%10 AND CH:concrete>dust AND DL:dust", + "XX|M1|XX", + ], + category: "scp", + density: 8000, + excludeRandom: true, + reactions: { + "head": { elem2 : ["bone","blood",null] }, + "body": { elem2 : ["meat","blood",null] }, + "homunculus": { elem2 : ["slime","blood",null] }, + "frog": { elem2 : ["slime","blood",null] }, + "bird": { elem2 : ["feather","blood",null] }, + "meat": { elem2 : null , chance:0.5 }, + "cooked_meat": { elem2 : null , chance:0.5 }, + "rotten_meat": { elem2 : null , chance:0.2 }, + "blood": { elem2 : null , chance:0.5 }, + "bone": { elem2 : ["blood",null,null] , chance:0.2 }, + "bone_marrow": { elem2 : ["blood",null] , chance:0.2 }, + "aluminum": { elem2 : "metal_scrap" , chance:1.0 }, + "steel": { elem2 : "metal_scrap" , chance:0.2 }, + "iron": { elem2 : "metal_scrap" , chance:0.3 }, + "lead": { elem2 : ["metal_scrap","metal_scrap","radiation"] , chance:0.3 }, + "glass": { elem2 : "glass_shard" }, + "wood": { elem2 : "sawdust" }, + "concrete": { elem2 : "dust" , chance:0.1 }, + "dust": { elem2 : null , chance:0.1 }, + }, + hidden: true, + state: "solid", + hardness: 1, + conduct: .1, +}, + +// SCP-804 WIP template +/* +elements.SCP_804 = { + color:"#beigeish", + category: "scp", + excludeRandom: true, + state: "solid", +}, +*/ + +elements.tickle_monster = { + color: "#FFA500", + behavior: [ + "M2%0.5|M2%0.3 AND CR:fragrance%0.05|M2%0.5", + "M1%10|XX|M1%10", + "XX|M1|XX", + ], + category: "scp", + density: 550, + reactions: { + "sugar_water": { elem2 : "water" , chance:0.2 }, + "dirty_water": { elem2 : "water" , chance:0.2 }, + "candy": { elem2 : null }, + "sugar": { elem2 : null }, + "sauce": { elem2 : null }, + "salt": { elem2 : null , chance:0.2 }, + "cheese": { elem2 : null , chance:0.2 }, + "melted_cheese": { elem2 : null }, + "baked_potato": { elem2 : null , chance:0.2 }, + "mashed_potato": { elem2 : null , chance:0.2 }, + "bread": { elem2 : null , chance:0.2 }, + "toast": { elem2 : null , chance:0.2 }, + "jelly": { elem2 : null }, + "nut_butter": { elem2 : null }, + "grape": { elem2 : null , chance:0.2 }, + "ice_cream": { elem2 : null }, + "juice": { elem2 : null }, + "milk": { elem2 : null }, + "gingerbread": { elem2 : null , chance:0.2 }, + "crumb": { elem2 : null , chance:0.2 }, + "cream": { elem2 : null }, + "baked_batter": { elem2 : null }, + "frozen_yogurt": { elem2 : null }, + "yogurt": { elem2 : null }, + "popcorn": { elem2 : null , chance:0.2 }, + "chocolate": { elem2 : null }, + "chocolate_milk": { elem2 : null }, + "melted_chocolate": { elem2 : null }, + "caramel": { elem2 : null }, + "ash": { elem2 : null , chance:0.2 }, + "dust": { elem2 : null , chance:0.2 }, + "alchohol": { elem1 : "hyper_tickle_monster", elem2 : null }, + "pilk": { elem1 : "hyper_tickle_monster", elem2 : null }, + "coffee_bean": { elem1 : "hyper_tickle_monster", elem2 : null }, + "coffee_ground": { elem1 : "hyper_tickle_monster", elem2 : null }, + "soda": { elem1 : "hyper_tickle_monster", elem2 : null }, + "coffee": { elem1 : "hyper_tickle_monster", elem2 : null }, + "seltzer": { elem1 : "hyper_tickle_monster", elem2 : null }, + }, + state: "liquid", + conduct: .5, + temp: 20, + tempHigh: 350, + stateHigh: ["smoke","smoke","smoke","slime","anomalous_essence"], + burn: .1, + burnTime: 300, + burnInto: ["smoke","smoke","smoke","slime","anomalous_essence"], + stain: 0.03, +}, + +elements.hyper_tickle_monster = { + color: "#FFA500", + hidden: true, + behavior: [ + "XX|XX|XX", + "XX|CH:tickle_monster%1.0|XX", + "XX|XX|XX", + ], + tick: behaviors.BOUNCY, + category: "scp", + density: 575, + reactions: { + "sugar_water": { elem2 : "water" }, + "dirty_water": { elem2 : "water" }, + "candy": { elem2 : null }, + "sugar": { elem2 : null }, + "sauce": { elem2 : null }, + "salt": { elem2 : null }, + "cheese": { elem2 : null }, + "melted_cheese": { elem2 : null }, + "baked_potato": { elem2 : null }, + "mashed_potato": { elem2 : null }, + "bread": { elem2 : null }, + "toast": { elem2 : null }, + "jelly": { elem2 : null }, + "nut_butter": { elem2 : null }, + "grape": { elem2 : null }, + "ice_cream": { elem2 : null }, + "juice": { elem2 : null }, + "milk": { elem2 : null }, + "gingerbread": { elem2 : null }, + "crumb": { elem2 : null }, + "cream": { elem2 : null }, + "baked_batter": { elem2 : null }, + "frozen_yogurt": { elem2 : null }, + "yogurt": { elem2 : null }, + "popcorn": { elem2 : null }, + "chocolate": { elem2 : null }, + "chocolate_milk": { elem2 : null }, + "melted_chocolate": { elem2 : null }, + "alchohol": { elem2 : null }, + "pilk": { elem2 : null }, + "soda": { elem2 : null }, + "coffee": { elem2 : null }, + "seltzer": { elem2 : null }, + }, + state: "liquid", + conduct: .5, + temp: 20, + tempHigh: 350, + stateHigh: ["smoke","smoke","smoke","slime","anomalous_essence"], + burn: .1, + burnTime: 300, + burnInto: ["smoke","smoke","smoke","slime","anomalous_essence"], + stain: 0.08, +}; + +// SCPs with ID over 999 here \ No newline at end of file From 0f46d22a1ca3b83c9e2ef03155671c62c4e80fcd Mon Sep 17 00:00:00 2001 From: redbirdly <155550833+redbirdly@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:36:08 +0800 Subject: [PATCH 57/67] Create lizard_mod.js mod about lizards --- mods/lizard_mod.js | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 mods/lizard_mod.js diff --git a/mods/lizard_mod.js b/mods/lizard_mod.js new file mode 100644 index 00000000..d8f30415 --- /dev/null +++ b/mods/lizard_mod.js @@ -0,0 +1,91 @@ +// lizard_mod.js by @RedBirdly + +function blendColors(color1, color2, ratio = 0.5) { + // Convert the colors to RGB + const rgb1 = parseColor(color1); + const rgb2 = parseColor(color2); + + // Calculate the blended color + const blendedColor = [ + Math.round(rgb1[0] * (1 - ratio) + rgb2[0] * ratio), // Red + Math.round(rgb1[1] * (1 - ratio) + rgb2[1] * ratio), // Green + Math.round(rgb1[2] * (1 - ratio) + rgb2[2] * ratio) // Blue + ]; + + // Convert the blended color back to a CSS color string + return `rgb(${blendedColor[0]}, ${blendedColor[1]}, ${blendedColor[2]})`; +} + + +function parseColor(color) { + // Create a temporary div to parse the color + const div = document.createElement('div'); + div.style.color = color; + document.body.appendChild(div); + + // Get the computed color + const computedColor = getComputedStyle(div).color; + + // Remove the temporary div + document.body.removeChild(div); + + // Parse the computed color into RGB values + const match = computedColor.match(/\d+/g); + return match.map(Number); +} + +// dark red, dark green, brown, dark gray, light gray, lime +let lizard_colors = ["#4d2f2a", "#356641", "#85754d", "#3c3c3c", "#A1A1A1", "#98fb98"]; + +// camouflage function for lizards +function camo(pixel) { + if (!paused) { + // set camouflage color to random color + if (Math.random() < 0.002) { + let n = Math.floor(Math.random() * lizard_colors.length); + pixel.color = lizard_colors[n]; + } + // set camouflage color to random color but make it slightly gray because camouflage isn't perfect + if (Math.random() < 0.1) { + for (let i = 0; i < currentPixels.length; i++) { + let x = currentPixels[i].x; + let y = currentPixels[i].y; + let dx = Math.abs(x - pixel.x); + let dy = Math.abs(y - pixel.y); + if (dx <= 1 && dy <= 1 && currentPixels[i].element != "lizard") { + pixel.color = blendColors(blendColors(currentPixels[i].color, "#887766", 0.4), pixel.color); + break; + } + } + } + } +} + +// define element +elements.lizard = { + color: lizard_colors, + behavior: [ + "ST%98|M1%6|ST%98", + "XX|XX|M2%20 AND BO", + "XX|M1%80|M2", + ], + tick: camo, + tempHigh: 100, + stateHigh: "ash", + tempLow: 0, + stateLow: "dead_bug", + breakInto: "dead_bug", + category: "life", + burn: 95, + burnTime: 25, + state: "solid", + density: 500, + conduct: 0.15, + reactions: { + "bird": { elem2: null, chance: 0.1, func: behaviors.FEEDPIXEL }, + "plant": { elem2: null, chance: 0.05, func: behaviors.FEEDPIXEL }, + "tomato": { elem2: null, chance: 0.05, func: behaviors.FEEDPIXEL }, + "fly": { elem2: null, chance: 0.15, func: behaviors.FEEDPIXEL }, + "ant": { elem2: null, chance: 0.1, func: behaviors.FEEDPIXEL }, + } +}; From 915a65d3b019e524f0cf67ba6e7c31b4ec423e6c Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Wed, 24 Apr 2024 20:03:43 +0100 Subject: [PATCH 58/67] Update Science_mod.js Doing more tmrw --- mods/Science_mod.js | 60 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 47f8b3b4..6f2383c6 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 17 +// Build 18 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1383,7 +1383,59 @@ substance.Silver_Sulfate = { hidden:true } -// I done this on my school computers :skull: -// doing more later +// I have finally gotten my motivation back! :D -// I accidentally pressed Ctrl+V instead of Ctrl+C so it deleted my work D: +substance.Silver_Selenide = { + behavior: behaviors.WALL, + color: "333333", + category: "lands", + state: "solid", + hidden:true +} + +// Why am listening to a random playlist? I swear I'm going fully insane + +substance.Silver_Selenate = { + behavior: behaviors.WALL, + color: "FFFFFF", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Telluride = { + behavior: behaviors.WALL, + color: "333333", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Arsenate = { + behavior: behaviors.WALL, + color: "E3E35F", + category: "lands", + state: "solid", + hidden:true +} + +substance.Silver_Phosphate = { + behavior: behaviors.WALL, + color: "FFFF00", + category: "lands", + state: "solid", + hidden:true +} + +// FINALLY WE ARE OUT OF THE SILVER COMPOUNDS!!!11!!1111! :DDDDD +// Now time to go onto the aluminum compounds + +substance.Aluminum_Arsenide = { + behavior: behaviors.WALL, + color: "FF6600", + category: "lands", // Might just change this after I'm done with the substances (as well as the other one(s)) + state: "solid", + hidden:true +} + +// Doing more tmrw I guess, I'm tired From 65966dd0b7865d9d21648363f1294de3636ea6e2 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:10:31 -0400 Subject: [PATCH 59/67] fix error; Update example_mod.js --- mods/example_mod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/example_mod.js b/mods/example_mod.js index ddf36999..7425dac0 100644 --- a/mods/example_mod.js +++ b/mods/example_mod.js @@ -68,7 +68,7 @@ runAfterLoad(function() { }); // Run if another mod is active -if (enabledMods.includes("test.js")) { +if (enabledMods.includes("mods/test.js")) { runAfterLoad(function() { // Your code here console.log("Hello World!"); From 121667add3673faa155cf5c612b9768ac3b47742 Mon Sep 17 00:00:00 2001 From: F3ZZ0 <168129449+F3ZZ0@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:49:35 +0100 Subject: [PATCH 60/67] Add files via upload --- mods/morepowders.js | 209 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 mods/morepowders.js diff --git a/mods/morepowders.js b/mods/morepowders.js new file mode 100644 index 00000000..2925f699 --- /dev/null +++ b/mods/morepowders.js @@ -0,0 +1,209 @@ +elements.template = { + color: "#ffffff", + category: "more_powders", + state: "solid", + hidden: true, + behavior: behaviors.POWDER + } +elements.powder = { + color: ["#c17d17", "#f2a32e"], + behavior: behaviors.POWDER, + category: "more_powders", + state: "solid", + reactions: { + "glue": { elem1: "smoke", elem2: "sticky_powder" }, + "foam": { elem1: "foam_powder", elem2: "foam_powder" }, + "electric": { elem1: null, elem2: "electric_powder" }, + "dust": { elem1: null, elem2: "void_powder" }, + }, + stateHigh: "smoke", +tempHigh: 200, +tempLow: -200, +stateLow: "cold_powder", +stateHigh: "hot_powder", +} +elements.gas_powder = { + color: "#b98ffc", + behavior: behaviors.POWDER, + category: "more_powders", +state: "gas", +stateHigh: "smoke", +tempHigh: 2000, +reactions: { + "up_powder": { elem1: null, elem2: "up_gas_powder" }, +}, +tempLow: -200, +stateLow: "powder", +} +elements.up_powder = { + color: "#8ffcb9", + behavior: behaviors.AGPOWDER, + category: "more_powders", +state: "solid", +tempLow: -200, +stateLow: "powder", +}, +elements.up_gas_powder = { + color: ["#a2c5da", "#a0a7d8"], + behavior: behaviors.AGPOWDER, + category: "more_powders", +state: "gas", +stateHigh: "gas_powder", +tempHigh: 1000, +hidden: true, +tempLow: -200, +stateLow: "powder", +} +elements.slow_powder = { + color: "#c9445c", + behavior:[ + "XX|XX|XX", + "XX|XX|XX", + "M2%20|M1%20|M2%20", + ], + category: "more_powders", +state: "solid", +stateHigh: "smoke", +tempHigh: 2000, +reactions: { + "gas_powder": { elem1: null, elem2: "slow_gas_powder" }, + "up_powder": { elem1: null, elem2: "slow_up_powder" }, +}, +tempLow: -200, +stateLow: "powder", +} +elements.slow_gas_powder = { + color: "#c069aa", + behavior:[ + "XX|XX|XX", + "XX|XX|XX", + "M2%20|M1%20|M2%20", + ], + category: "more_powders", +state: "gas", +stateHigh: "gas_powder", +tempHigh: 1000, +hidden: true, +tempLow: -200, +stateLow: "powder", +} +elements.slow_up_powder = { + color:["#aba18a", "#a4aa8a"], + behavior:[ + "M2%20|M1%20|M2%20", + "XX|XX|XX", + "XX|XX|XX", + ], + category: "more_powders", +state: "solid", +stateHigh: "up_powder", +tempHigh: 1000, +hidden: true, +reactions: { + "slow_powder": { elem1: null, elem2: "slower_up_powder" }, +}, +tempLow: -200, +stateLow: "powder", +} +elements.slower_up_powder = { + color: ["#b5827b", "#b59e7b"], + behavior:[ + "M2%10|M1%10|M2%10", + "XX|XX|XX", + "XX|XX|XX", + ], + category: "more_powders", +state: "solid", +stateHigh: "up_powder", +tempHigh: 1000, +hidden: true, +tempLow: -200, +stateLow: "powder", +} +elements.sticky_powder = { + color: ["#badd96", "#96dd96"], + behavior:[ + "ST|ST|ST", + "ST|XX|ST", + "ST AND M2|ST AND M1|ST AND M2", + ], + category: "more_powders", + state: "solid", + hidden: true, + tempLow: -200, + stateLow: "powder", + } + elements.foam_powder = { + color: ["#e0be8b", "#ffffff"], + behavior: behaviors.FOAM, + category: "more_powders", + state: "gas", + tempLow: -200, + stateLow: "frozen_foam_powder", + hidden: true + } + elements.frozen_foam_powder = { + color: ["#c0eded", "#a7cfba"], + behavior: behaviors.POWDER, + category: "more_powders", + state: "gas", + tempHigh: 1000, + stateHigh: "foam_powder", + hidden: true + } + elements.electric_powder = { + color: ["#eae463", "#f9fc45"], + behavior: [ + "SH|SH|SH", + "SH|XX|SH", + "SH AND M2|SH AND M1|SH AND M2", + ], + category: "more_powders", + state: "solid", + reactions: { + }, + stateHigh: "smoke", + tempHigh: 500, + tempLow: -1000, + stateLow: "powder", + hidden: true + } + elements.hot_powder = { + color: ["#8a3b87", "#d43a3a", "#d43a3a"], + behavior:[ + "HT|HT|HT", + "HT|XX|HT", + "HT AND M2|HT AND M1|HT AND M2", + ], + category: "more_powders", + state: "solid", + tempLow: -200, + stateLow: "cold_powder", + temp: 200, + hidden: true + } + elements.cold_powder = { + color: ["#8a3b87", "#3f3cd4", "#3f3cd4"], + behavior:[ + "CO|CO|CO", + "CO|XX|CO", + "CO AND M2|CO AND M1|CO AND M2", + ], + category: "more_powders", + state: "solid", + tempHigh: 400, + stateHigh: "hot_powder", + temp: -200, + hidden: true + } + elements.void_powder = { + color: "#303031", + category: "more_powders", + state: "solid", + hidden: true, + behavior: [ + "DL|DL|DL", + "DL|XX|DL", + "DL AND M2|DL AND M1|DL AND M2", + ] + } \ No newline at end of file From 3242e064af09da701da1f71863f464c5bde21c52 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:05:13 +0800 Subject: [PATCH 61/67] food mod compilation --- mods/food_mods.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 mods/food_mods.js diff --git a/mods/food_mods.js b/mods/food_mods.js new file mode 100644 index 00000000..bb088d75 --- /dev/null +++ b/mods/food_mods.js @@ -0,0 +1,15 @@ +var mods_to_include = ["mods/sbstuff.js","mods/ketchup_mod.js","mods/morefoodsmod.js","mods/weAllScreamFor.js","mods/soups.js","mods/pizzasstuff.js","mods/community_desserts.js","mods/plants.js","mods/aChefsDream.js"] + +var mods_included = mods_to_include.map(mod => enabledMods.includes(mod)); +var all_mods_included = mods_included.reduce(function(a,b) { return a && b }); + +if(!all_mods_included) { + var mods_needed = mods_to_include.filter(function(modPath) { return !(enabledMods.includes(modPath)) }); + + mods_needed.forEach(function(modPath) { + enabledMods.splice(enabledMods.indexOf("mods/food_mods"),0,modPath); + }); + localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); + alert(`The following mods have been inserted: ${mods_needed.join(", ")} +Reload the page for the mods to take effect. Happy cooking!`) +} From e21f2451fb13f492c10a537bced96d7348b9515a Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:08:04 +0800 Subject: [PATCH 62/67] Update mod-list.html --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index f07335c9..52bd7060 100644 --- a/mod-list.html +++ b/mod-list.html @@ -310,6 +310,7 @@ Compilations a_mod_by_alice.jsA mod combining most of Alice’s mods, and some other thingsAlice +food_mods.jsA mod combining most food modsstefanblox, moss, Tisquares, SquareScreamYT, Adora, pixelegend4, Alice, Nubo318, Clide4, rottenEgghead Technical Libraries & Tests a_bundle_of_tests.jsSeveral test functionsAlice From 45a941f91242a46f1d947d3be29daffd3a00361a Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:18:12 +0800 Subject: [PATCH 63/67] a very big update --- mods/aChefsDream.js | 1112 ++++++++++++++++++++++++------------------- 1 file changed, 625 insertions(+), 487 deletions(-) diff --git a/mods/aChefsDream.js b/mods/aChefsDream.js index 02fe97cd..205c30d7 100644 --- a/mods/aChefsDream.js +++ b/mods/aChefsDream.js @@ -1,482 +1,10 @@ -/* -Created by SquareScreamYT/sqec <@918475812884344852> -Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696>, ryan(R74n) <@101070932608561152> and Fioushemastor <@738828785482203189> for helping :) -Compatibility with plants.js coming soon -Works well with community_desserts.js -Beta testing at aChefsDream_beta.js or SquareScreamYT/aChefsDream.js on github +// created by SquareScreamYT +// https://github.com/SquareScreamYT/aChefsDream.js -v1.13.7 - -you can support me at my youtube: https://youtube.com/@sqec - -Upcoming Features: -- pudding/cream -- extract tool -- cinnamon -- spring onions -- white rice noodles -- matcha leaves, powder, tea -- cacao pods -- more chocolate, cocoa powder, white chocolate, cocoa butter -- pigs, ham and bacon -- garlic -- stainless steel -- pepper plants -- hot chocolate -- celery -- kiwis -- guavas -- lychees -- cherries (and the plasticky maraschino cherries 🤮🤮🤮) -- dragonfuits -- dates -- figs -- avocados -- apricots and almonds (roasted) -- hazelnuts -- plums -- curry/chicken tikka masala -- raisins -- peaches -- cucumbers -- eggplants -- crabs (they eat coconuts) -- squids -- tofu -- miso -- juice reaction with other juices -- jackfruit -- fruit soda (any juice + co2 or seltzer) -- rambutan -- shrimp/prawn meat -- sheep, goats, mutton, wool/fabric, filter -- filter (like in nousersthing.js) - -Changelog (v1.0) - - added chickens - - lays chicken eggs - - added chicks - - hatches from chicken eggs - - grows into chickens - - added chicken eggs - - added frozen chicken eggs - - added hard boiled eggs - - made by putting chicken eggs in hot water - - added soup - - made from broth and water - - added noodles - - made by putting batter in hot water - - added chicken meat - - raw chicken meat - - cooked chicken meat - - battered raw chicken - - made by mixing raw chicken and batter - - raw chicken nuggets - - made by mixing battered raw chicken with crumbs - - (cooked) chicken nuggets - - added crushed worm - - chicken food - - made by smashing worms or mixing worms with rocks - - added frozen crushed worms - - added fried potato - - made by putting potatoes in hot cooking oil - - added smoked chicken - - made by putting raw chicken with smoke - - added boiled chicken - - made by putting raw chicken in hot water - - added fried chicken - - made by putting raw chicken in hot cooking oil - - added steamed chicken - - made by putting raw chicken with steam - - added olives - - added olives - - olives can be smashed into cooking oil - - added olive wood - - added olive branches - - added olive leaves - - added cooking oil - - - - -Changelog (v1.1) - - added apples and related stuff - - apples - - applewood - - apple branches - - apple leaves - - apple juice - - made by smashing apples - - apple seeds - - apple slices - - made by cutting apples - - apple jam - - made by putting sugar in apple juice - - added knife tool - - cuts, peels, etc. pixels - - readded potato skin and peeled potato - - changed fried potato recipe from potato to skinned potato - - added pepper - - added cake - - made by mixing baked batter and cream - - added icing sugar - - made by smashing sugar - - added icing - - made by shift-mixing icing sugar - - noodles description - - bug fix (freezing crushed worms makes them alive) - - - - -Changelog (v1.2) - - added boilers - - added steamers - - added smokers - - added oranges and related stuff - - oranges - - orange wood - - orange branches - - orange leaves - - orange juice - - made by smashing orange - - orange seeds - - orange slices - - made by cutting oranges - - orange peels - - byproduct of cutting oranges into orange slices - - marmalade - - made by putting sugar in orange peels and orange slices - - apple and orange juice now turn into juice ice under 0 degrees - - apple juice now boils into sugar and steam - - apple juice now boils at 100 instead of 400 - - added coral and coral stems - - added tuna - - added cooked and raw tuna - - added smoked tuna - - made by putting raw tuna with smoke - - added boiled tuna - - made by putting raw tuna in hot water - - added fried tuna - - made by putting raw tuna in hot cooking oil - - added steamed tuna - - made by putting raw tuna with steam - - added salmon - - added cooked and raw salmon - - added smoked salmon - - made by putting raw salmon with smoke - - added boiled salmon - - made by putting raw salmon in hot water - - added fried salmon - - made by putting raw salmon in hot cooking oil - - added steamed salmon - - made by putting raw salmon with steam - - added grape juice - - added cream of tartar - - added wine - - added corn syrup - - - -Changelog (v1.3) - - added shrimp - - added coconuts - - added coconut stems - - added coconut leaves - - added coconut tree tops - - added coconut milk and coconut juice - - added cut coconuts - - salmon and tuna meats no longer melt - - added knife description - - added lemons and related stuff - - lemons - - lemon wood - - lemon branches - - lemon leaves - - lemon juice - - made by smashing lemons - - lemon seeds - - lemon slices - - made by cutting lemons - - lemon zest - - byproduct of cutting lemons - - lemon marmalade can now be made by mixing lemon slices or lemon zest with sugar - - added carrots - - added carrot seeds and leaves - - added carrot juice - - added dry icing - - - -Changelog (v1.3.1) - - added lemonade - - - -Changelog (v1.3.2) - - added apple cider vinegar - - added turnips - - added turnip seeds and leaves - - added turnip juice - - - -Changelog (v1.4) - - added baking powder - - added corn starch - - added maple syrup - - added pancakes - - added pancake mix - - added pancake batter - - added normal pancakes - - added crispy pancakes - - added burnt pancakes - - added strawberries - - added strawberries - - added strawberry seeds, stem, and leaves - - added strawberry juice - - added whipped cream - - chicken eggs no longer hatch under 20 degrees - - added ginger - - added ginger juice - - added ginger rhizomes, pseudostems and leaves - - - -Changelog (v1.5) - - added blueberries - - added blueberries - - added blueberry seeds, stem, and leaves - - added blueberry juice - - added strawberry and blueberry jam - - added cut blueberries - - added advanced dough - - added carbonic acid - - 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 - - - -Changelog (v1.7) - - added chocolate chips - - added sprinkles - - added banana milk (yellow fruit milk) - - added passion fruits - - added passion fruit vines and seeds (new climbing vines feature!) - - added mangoes - - added mango juice - - added mango wood, branch, leaves and seeds - - added pineapples - - added pineapple leaves, seed and juice - - - -Changelog (v1.8) - - added lime and lime juice - - added lime zest and slices - - added escargot - - added broccoli - - added broccoli stem, cut broccoli and broccoli seed - - added freeze drying and freeze dried fruits - - added soapy water - - - - -Changelog (v1.9) - - added onion - - added cut onion - - added fried onion - - added rice - - added porridge - - added cooked and burnt rice - - added rice plants and rice panicles - - added rice seeds - - added msg - - added seaweed - - added dried seaweed - - added seaweed stem and seeds - - fix egg and noodle bug - - - - -Changelog (v1.10) - - tweaked seaweed behavior - - tweaked tomato and grape vines - - added peppermint - - added peppermint leaves and stems - - added peppermint seeds - - added vanilla - - added vanilla seeds, stem, leaves - - added vanilla flower - - added vanilla pod - - added vanilla essence - - - - -Changelog (v1.10.1) - - unhid vanilla essence - - added peppermint candy - - vanilla essence can now turn ice cream light yellow - - added peppermint candy - - added tapioca - - added tapioca stems, leaves, and seed - - - - -Changelog (v1.10.2) - - added sprinkle explosions - - - - -Changelog (v1.10.5) - - added chilli - - added chilli seed, stem and leaves - - added chilli powder - - added hot sauce - - - - -Changelog (v1.10.7) - - added mango milk - - - - -Changelog (v1.10.8) - - added onion powder - - fix carrot plant bug - - added fried rice - - added durians - - added cut durians - - added durian seed, wood, leaves and branches - - - - -Changelog (v1.11) - - unhid carrot - - unhid turnip - - - - -Changelog (v1.12) - - added whisk - - added egg white - - added hard egg white - - added whisked egg white - - added marshmallows - - added cooked marshmallows - - added burnt marshmallows - - improved soup (from nousersthings.js) - - added food coloring (color may fade) - - added eat tool - - added drink tool - - - - -Changelog (v1.12.1) - - removed coral, can still be found in ocean.js - - updated food coloring - - - - -Changelog (v1.12.2) - - updated cooked meat behavior - - - - -Changelog (v1.12.4) - - added cake batter - - added condensed milk - - added wasabi - - added beans - - added baked beans - - added fermented beans/natto - - added soy sauce - - - - -Changelog (v1.13) - - added cracker and cracker dough - - added barbecue sauce - - added mustard - - added agar - - added barbecued chicken - - tweaked grape juice color - - added duck - - added duckling - - added duck eggs and frozen duck eggs - - added raw duck and cooked duck - - added fried duck - - added boiled duck - - added barbecued duck - - added smoked duck - - added steamed duck - - added cows - - added calves - - added steak and beef - - added smoked steak and barbecued steak - - - - -Changelog (v1.13.5) - - added hard jelly - - soda can mix colors - - added soda jelly - - added fanta (orange juice + carbon dioxide) - - - - -Changelog (v1.13.7) - - rename nut to peanut - - - - - - - - -*/ - -/* -elements.test = { - //other needed properties - cutInto: "elem" -} -*/ - -console.log("Thanks for using aChefsDream.js! -sqec") +runAfterLoad(function() { + console.log("Thanks for using aChefsDream.js! -sqec") + console.log("aChefsDream is hosted at https://github.com/SquareScreamYT/aChefsDream.js") +}) function interpolateRgb(rgb1, rgb2, ratio) { const interpolatedRgb = { @@ -592,6 +120,29 @@ elements.freeze_dry = { desc: "Use on pixels to freeze dry them, if possible." } +elements.food_paint = { + color: ["#c27070","#c29c70","#c2c270","#70c270","#70c2c2","#7070c2","#c270c2"], + tool: function(pixel) { + if (elements[pixel.element].isFood == true) { + if (!shiftDown) { + pixel.color = pixelColorPick(pixel,currentColor) + } + else { + var rgb = currentColor.replace("#","").match(/.{1,2}/g); + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(rgb[i],16); + } + pixel.color = "rgb(" + rgb.join(",") + ")" + } + delete pixel.origColor; + } + }, + customColor: true, + category: "tools", + canPlace: false, + desc: "Use on edible pixels to change color." +} + elements.eat = { color: ["#ffba79","#efff79"], tool: function(pixel) { @@ -849,7 +400,7 @@ elements.soup = { isFood: true, //thanks to nouser onMix: function(soup,ingredient) { - if (elements[ingredient.element].id !== elements.soup.id && elements[ingredient.element].id !== elements.broth.id) { + if (elements[ingredient.element].id !== elements.soup.id && elements[ingredient.element].id !== elements.broth.id && ingredient.temp > 40) { if (elements[ingredient.element].isFood || elements[ingredient.element].category === "food" || elements[ingredient.element].category === "liquids") { var rgb1 = soup.color.match(/\d+/g); var rgb2 = ingredient.color.match(/\d+/g); @@ -891,7 +442,7 @@ elements.soup = { } if (!elements.broth.reactions) elements.broth.reactions = {}; -elements.broth.reactions.water = { elem1: "soup", elem2: "soup" } +elements.broth.reactions.water = { elem1: "soup", elem2: "soup", tempMin: 70 } elements.noodles = { desc: "whatever noodles", @@ -1824,6 +1375,16 @@ elements.tuna = { category: "life", state: "solid", cutInto: "raw_tuna", + conduct: 0.2, + eggColor: ["#211316","#2C1A1D","#503734"], + breakInto: "blood", + burn:20, + burnTime:200, + temp: 20, + tempHigh: 120, + stateHigh: "cooked_tuna", + tempLow: -20, + stateLow: "frozen_fish", reactions: { "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, @@ -1860,6 +1421,16 @@ elements.salmon = { ], category: "life", state: "solid", + conduct: 0.2, + eggColor: ["#e8961c","#faa82d"], + breakInto: "blood", + burn:20, + burnTime:200, + temp: 20, + tempHigh: 120, + stateHigh: "cooked_salmon", + tempLow: -20, + stateLow: "frozen_fish", reactions: { "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, @@ -2286,12 +1857,22 @@ elements.wine = { elements.shrimp = { color: ["#EE5422", "#E9683C", "#F3583F", "#EDA270"], behavior: [ - "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|M2%7.5 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", + "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|M2%7.5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", "SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|FX%20|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", - "M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%15", + "M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14", ], category: "life", state: "solid", + cutInto: "raw_shrimp", + conduct: 0.2, + breakInto: "raw_shrimp", + burn:20, + burnTime:200, + temp: 20, + tempHigh: 120, + stateHigh: "cooked_shrimp", + tempLow: -20, + stateLow: "frozen_meat", reactions: { "algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, "plant": { elem2:null, chance:0.125, func:behaviors.FEEDPIXEL }, @@ -3227,7 +2808,7 @@ elements.maple_syrup = { behavior: behaviors.LIQUID, tempHigh: 170, stateHigh: ["sugar","smoke","smoke"], - tempLow: 0, + tempLow: -15, category:"liquids", state: "liquid", viscosity: 15, @@ -5350,8 +4931,8 @@ elements.onion_seed = { createPixel("onion",pixel.x+1,pixel.y); createPixel("onion",pixel.x-1,pixel.y); if (isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { - createPixel("plant",pixel.x-1,pixel.y-3); - createPixel("plant",pixel.x+1,pixel.y-3); + createPixel("spring_onion_leaves",pixel.x+1,pixel.y-3); + createPixel("spring_onion_leaves",pixel.x-1,pixel.y-3); changePixel(pixel,"onion"); } } @@ -7777,8 +7358,8 @@ elements.raw_beef = { state: "solid", burnInto: "steak", temp:25, - tempHigh: 600, - stateHigh: ["steak"], + tempHigh: 200, + stateHigh: "steak", reactions: { "smoke": {elem1: "smoked_beef"}, "charcoal": {elem1: "barbecued_beef", tempMin: 70}, @@ -7844,3 +7425,560 @@ elements.jelly.temp = 0 elements.nut.name = "peanut"; elements.nut_meat.name = "peanut_meat"; elements.nut_butter.name = "peanut_butter"; + +elements.spring_onion_leaves = { + color: "#519c2f", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "ST:onion|M1|ST:onion", + ], + 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:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + breakInto: "herb", + state: "solid", + density: 1050, + cutInto: "chopped_spring_onion", +} +elements.chopped_spring_onion = { + color: ["#0f9912","#227d23"], + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: "dead_plant", + burn:65, + burnTime:60, + burnInto: "dead_plant", + state: "solid", + density: 1050, + breakInto:"herb", +} + + +elements.spring_onion_seed = { + color: "#1a0e02", + tick: function(pixel) { + if (isEmpty(pixel.x,pixel.y+1)) { + movePixel(pixel,pixel.x,pixel.y+1); + } + else { + if (Math.random() < 0.2 && 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-2) && isEmpty(pixel.x,pixel.y-1) && isEmpty(pixel.x+1,pixel.y-1) && isEmpty(pixel.x-1,pixel.y-1) && isEmpty(pixel.x+1,pixel.y) && isEmpty(pixel.x-1,pixel.y)) { + createPixel("onion",pixel.x,pixel.y-1); + createPixel("onion",pixel.x+1,pixel.y-1); + createPixel("onion",pixel.x-1,pixel.y-1); + createPixel("onion",pixel.x,pixel.y-2); + createPixel("onion",pixel.x+1,pixel.y); + createPixel("onion",pixel.x-1,pixel.y); + if (isEmpty(pixel.x+1,pixel.y-3) && isEmpty(pixel.x-1,pixel.y-3)) { + createPixel("spring_onion_leaves",pixel.x+1,pixel.y-3); + createPixel("spring_onion_leaves",pixel.x-1,pixel.y-3); + if (isEmpty(pixel.x+1,pixel.y-4) && isEmpty(pixel.x-1,pixel.y-4)) { + createPixel("spring_onion_leaves",pixel.x+1,pixel.y-4); + createPixel("spring_onion_leaves",pixel.x-1,pixel.y-4); + if (isEmpty(pixel.x+1,pixel.y-5) && isEmpty(pixel.x-1,pixel.y-5)) { + createPixel("spring_onion_leaves",pixel.x+1,pixel.y-5); + createPixel("spring_onion_leaves",pixel.x-1,pixel.y-5); + } + } + changePixel(pixel,"onion"); + } + } + } + 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|XX|XX", + "XX|M1|XX", + ], +} + +elements.stainless_steel ={ + color: "#91999e", + behavior: behaviors.WALL, + tempHigh: 1455.5, + category: "solids", + density: 7850, + conduct: 0.42, + hardness: 0.8 +} + +elements.rambutan_wood = { + color: "#635418", + behavior: behaviors.WALL, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + breakIntoColor: ["#dba66e","#cc8a64"], + hidden: true +} +elements.rambutan_branch = { + color: "#635418", + behavior: [ + "CR:rambutan_leaves,rambutan_branch%2|CR:rambutan_leaves,rambutan_branch%2|CR:rambutan_leaves,rambutan_branch%2", + "XX|XX|XX", + "XX|XX|XX", + ], + tempHigh: 100, + stateHigh: "rambutan_wood", + tempLow: -30, + stateLow: "rambutan_wood", + category: "life", + burn: 40, + burnTime: 50, + burnInto: ["sap","ember","charcoal"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["sap","sawdust"], +} +elements.rambutan_leaves = { + color: "#6fa611", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:unripe_rambutan%0.1|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 +} +elements.unripe_rambutan = { + color: ["#87c718","#8ac91c","#94de1d"], + behavior: [ + "XX|ST:rambutan_leaves|XX", + "XX|CH:rambutan%1|XX", + "M2|M1|M2", + ], + category:"food", + tempHigh: 100, + stateHigh: ["dead_plant","steam"], + burn:65, + burnTime:60, + cutInto: "cut_rambutan", + state: "solid", + density: 1050, +} + +elements.rambutan = { + color: ["#d64242","#f23333","#cc3737","#b1db69"], + behavior: behaviors.POWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + state: "solid", + density: 1050, + cutInto: "cut_rambutan", + hidden: true, +} + +elements.cut_rambutan = { + color: "#f5f1bf", + behavior: behaviors.STURDYPOWDER, + category:"food", + tempHigh: 100, + stateHigh: ["sugar","steam"], + burn:65, + burnTime:60, + state: "solid", + density: 1050, + hidden: true, + freezeDryInto: "freeze_dried_fruits", + freezeDryIntoColor: "#a19f3b", +} + +elements.rambutan_seed = { + color: "#2b1807", + 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 ? "rambutan_wood" : "rambutan_branch",pixel.x,pixel.y+1); + } + } + else if (pixel.age > 1000) { + changePixel(pixel,"rambutan_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.barbecued_shrimp = { + color:["#bf743b", "#b57026","#8f5e29","#a87b11"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.steamed_shrimp = { + color:["#e8dab2", "#e2cea6"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:50, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.smoked_shrimp = { + color:["#78542e", "#6b4b26"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:55, + tempHigh: 600, + stateHigh: ["ash","smoke"], + isFood: true, + hidden: true, +} +elements.cooked_shrimp = { + color:["#ff7f50", "#ffa07a", "#ffb3a7"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +}; + +elements.raw_shrimp = { + color: ["#f0e0d6", "#e8d9ce", "#cdb7b5"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + burnInto: "cooked_shrimp", + temp:25, + tempHigh: 600, + stateHigh: "cooked_shrimp", + reactions: { + "batter": { elem1: "battered_shrimp", elem2: null }, + "smoke": {elem1: "smoked_shrimp"}, + "steam": {elem1: "steamed_shrimp"}, + "water": {elem1: "boiled_shrimp", tempMin: 70}, + "nut_oil": {elem1: "fried_shrimp", tempMin: 70}, + "charcoal": {elem1: "barbecued_shrimp", tempMin: 70}, + "fire": {elem1: "barbecued_shrimp"} + } +}; + +elements.boiled_shrimp = { + color: ["#ffd180", "#ffc978", "#ffbe70"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + isFood: true, + temp: 65, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + hidden: true, +} +elements.battered_shrimp = { + color: ["#f2e7d5", "#eae0cd"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp:25, + tempHigh: 125, + stateHigh: "cooked_shrimp", + reactions: { + "crumb": { color1: "#123456", elem2: null }, + "nut_oil": {elem1: "tempura", tempMin: 60} + }, + hidden: true, +}; +elements.tempura = { + color: ["#ff8c00", "#ff8c00", "#ffab00", "#ffab00"], + behavior: behaviors.STURDYPOWDER, + category: "food", + state: "solid", + temp: 40, + tempHigh: 600, + stateHigh: ["ash", "smoke"], + tempLow: -20, + breakInto: "crumb", + isFood: true, + density: 100, + hidden: true, +}; + +elements.grape.stateHigh = "raisin" +elements.grape.tempHigh = 65 + +elements.raisin = { + color: ["#522D68","#3B194D","#381845","2B194D"], + behavior: [ + "XX|ST:vine|XX", + "ST:vine|XX|ST:vine", + "M2|M1|M2", + ], + reactions: { + "radiation": { elem1:"explosion", chance:0.1, color1:"#291824" }, + "rock": { elem1:"juice", chance:0.1, color1:"#291824" }, + "concrete": { elem1:"juice", chance:0.1, color1:"#291824" }, + "basalt": { elem1:"juice", chance:0.1, color1:"#291824" }, + "limestone": { elem1:"juice", chance:0.1, color1:"#291824" }, + "tuff": { elem1:"juice", chance:0.1, color1:"#291824" }, + "water": { elem2:"juice", chance:0.005, color2:"#291824" }, + "sugar_water": { elem2:"juice", chance:0.025, color2:"#291824" }, + "acid": { elem1:"juice", color1:"#291824" }, + "acid_gas": { elem1:"juice", color1:"#291824" }, + }, + innerColor: "#cc7492", + tempHigh: 256, + stateHigh: ["steam","sugar"], + category: "food", + state: "solid", + density: 1154, + breakInto: "juice", + breakIntoColor: "#291824", + ignoreAir: true, + isFood: true +} + +// things to mix: juice, water, seltzer, sugar water, soda, juice, milk, cream, +// juice, milk, chocolate milk, fruit milk, eggnog, nut milk, alcohol, wine, tea, +// tea, coffee, honey, caramel, vanilla essence, peppermint tea, sugar, yogurt, +// whipped cream, chocolate, jam + +// juice mixing +for (let juicei = 0; juicei < eLists.JUICEMIXABLE.length; juicei++) { + // juice with juice + for (let juicej = 0; juicej < eLists.JUICEMIXABLE.length; juicej++) { + elem = eLists.JUICEMIXABLE[juicei]; + elem2 = eLists.JUICEMIXABLE[juicej]; + if (elem != elem2) { + if (!elements[elem].reactions) { chance:1, elements[elem].reactions = {} } + elements[elem].reactions[elem2] = { func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.5); + changePixel(pixel1,"juice") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + // console.log("juice mixed") + }} + } + } + // juice with water + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.water = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB("rgb(255,255,255)"), 0.2); + if (((newrgb.r + newrgb.g + newrgb.b) / 3) > 215) { + newrgb = getRGB(pixel1.color); + } + changePixel(pixel1,"juice") + changePixel(pixel2,"juice") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} + // juice with milk + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} + // juice with coconut milk + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.coconut_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} + // juice with nut milk + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.nut_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} + // juice with cream + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.cream = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} + // juice with fruit milk + if (!elements[elem].reactions) { elements[elem].reactions = {} } + elements[elem].reactions.fruit_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + }} +} +// fruit milk with milk +elements.fruit_milk.reactions.milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + if (((newrgb.r + newrgb.g + newrgb.b) / 3) < 230) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } else if (Math.random() < 0.05) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } +} +// fruit milk with nut milk +elements.fruit_milk.reactions.nut_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + if (((newrgb.r + newrgb.g + newrgb.b) / 3) < 230) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } else if (Math.random() < 0.05) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } +} +// fruit milk with coconut milk +elements.fruit_milk.reactions.coconut_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + if (((newrgb.r + newrgb.g + newrgb.b) / 3) < 230) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } else if (Math.random() < 0.05) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } +} +// fruit milk with cream +elements.fruit_milk.reactions.cream = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + if (((newrgb.r + newrgb.g + newrgb.b) / 3) < 230) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } else if (Math.random() < 0.05) { + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } + } +} +// fruit milk with fruit milk +elements.fruit_milk.reactions.fruit_milk = { chance:1, func: function(pixel1, pixel2){ + let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2); + changePixel(pixel1,"fruit_milk") + changePixel(pixel2,"fruit_milk") + pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`; + } +} From f691ba02f2e529f3b7c383983bb717f5f54ed271 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:20:12 +0100 Subject: [PATCH 64/67] Update Science_mod.js --- mods/Science_mod.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 6f2383c6..28f359c9 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 18 +// Build 19 // By: Lucifer (@a_british_proto (Discord)) // If there is anything you want to suggest or there's a bug then just dm me on discord // Todo: @@ -1438,4 +1438,19 @@ substance.Aluminum_Arsenide = { hidden:true } -// Doing more tmrw I guess, I'm tired +substance.Aluminum_Diboride = { + behavior: behaviors.WALL, + color: "CB6D51", + category: "lands", + state: "solid", + hidden:true +} + +// Doing this later as my schools blocked chatgpt and the definition is not on Ptable.com :/ +// substance.Aluminum_Dodecaboride = { +// behavior: behaviors.NULL, +// color: "000000", +// category: "null", +// state: "null", +// hidden:true +// } From af607009e78325310efad0c432b49bbbebf59f83 Mon Sep 17 00:00:00 2001 From: ThatOtherProto <127895014+ThatOtherProto@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:55:02 +0100 Subject: [PATCH 65/67] Update Science_mod.js --- mods/Science_mod.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 28f359c9..4c216af2 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1454,3 +1454,19 @@ substance.Aluminum_Diboride = { // state: "null", // hidden:true // } + +// substance.Aluminum_Bromate_Nonahydrate = { +// behavior: behaviors.NULL, +// color: "000000", +// category: "null", +// state: "null", +// hidden:true +// } + +substance.Aluminum_Tribromide = { + behavior: behavior.NULL, // It's meant to be a powder but I'm too tired to go look plus I need to go to my next lesson now + color: "FF0000", + category: "lands", + state: "powder", + hidden:true +} From 9c969e61e5f4c4c5b0b505bc9a582dc1412179b8 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:06:58 -0400 Subject: [PATCH 66/67] Update mod-list.html --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index 52bd7060..6b6bd780 100644 --- a/mod-list.html +++ b/mod-list.html @@ -275,6 +275,7 @@ amogus.jsAdds a small amogus structureAlice citybuilding.jsAdds seeds that create miniature buildings and other city-related itemsSquareScreamYT collab_mod.jsCreated by multiple people, adds random thingsmrapple, ilikepizza, stefanblox +Doom Mod (Unreleased)As seen on TikTok - Not yet available!ggod elem3.jsAdds all elements and combinations from Elemental 3 [Very Large]Sophie fools+.jsimproves and makes fools.js EXTREMELY annoying.SquareScreamYT funny elements 2022-11-15.jsAdds a few curated randomly-generated elementsAlice From 23daf7cad858854de618ad0bf511ba6b5b754dc5 Mon Sep 17 00:00:00 2001 From: guzzo86 <126430018+guzzo86@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:26:42 -0400 Subject: [PATCH 67/67] Create CherrySoda.js --- mods/CherrySoda.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mods/CherrySoda.js diff --git a/mods/CherrySoda.js b/mods/CherrySoda.js new file mode 100644 index 00000000..0be7f3da --- /dev/null +++ b/mods/CherrySoda.js @@ -0,0 +1,52 @@ +elements.potassiumpermanganate = { + color: ["#800080", "#FF00FF"], + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 2500, + desc: "Potassium permanganate is a dark purple, crystalline solid. It is used as a powerful oxidizing agent.", + tempHigh: 240, + stateHigh: "molten_potassiumpermanganate", +} +elements.molten_potassiumpermanganate = { + color: ["#4B0082", "#800080", "#9932CC", "#8A2BE2", "#6A5ACD", "#FF00FF"], + category: "powders", + state: "solid", + density: 2500, + desc: "Potassium permanganate is a dark purple, crystalline solid. It is used as a powerful oxidizing agent.", + tempLow: 239, + stateLow: "potassiumpermanganate", +} +elements.tolulene = { + color: "#FFFFFF", + behavior: behaviors.LIQUID, + category: "liquids", + state: "liquid", + density: 866, + desc: "Tolulene is used as a paint thinner and also referred to as benezene or methylbeneze", + burn: 37.5, + burnTime: 900, + burnInto: ["steam", "smoke", "fire", "fire",], + reactions: { + "potassiumpermanganate": {elem1: "benzaldehyde", elem2: "benzaldehyde"}, + } +} +elements.benzaldehyde = { + color: "#F5F5F5", + behavior: behaviors.LIQUID, + category: "liquids", + state: "liquid", + density: 1045, + desc: "Benzaldehyde is cherry flavor. It is also clear like tolulene.", + reactions: { + "seltzer": {elem1: "cherrysoda", elem2: "cherrysoda"}, + } +} +elements.cherrysoda = { + color: "#D2042D", + behavior: behaviors.LIQUID, + category: "food", + state: "liquid", + density: 1045, + desc: "Cherry soda." +}