Merge pull request #382 from SquareScreamYT/main

This commit is contained in:
slweeb 2024-03-02 17:40:24 -05:00 committed by GitHub
commit ac392a367b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 388 additions and 126 deletions

View File

@ -2,7 +2,7 @@
Created by SquareScreamYT <@918475812884344852> and RealerRaddler <@914371295561535508>
Thanks to Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696> and Fioushemastor <@738828785482203189> for helping :)
v1.7
v1.8
me trying to come up with stuff not in plants.js:
@ -11,10 +11,9 @@ Upcoming Features:
- spring onions
- soy sauce
- rice and porridge (white rice noodles)
- seaweed and agar
- seaweed and agar (makes juice into jelly)
- pigs, ham and bacon
- garlic
- msg
- stainless steel
- chili
- pepper plants
@ -25,7 +24,15 @@ Upcoming Features:
- cows and beef
- celery
- marshmallows, normal, cooked and burnt
- broccoli
- lime
- kiwi, guavas and lychees
- dragonfuits
- dates and figs
- avocados
- apricots and plums
- curry/chicken tikka masala
- raisins
- peaches
Changelog (v1.0)
- added chickens
@ -263,6 +270,16 @@ Changelog (v1.7)
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
*/
@ -298,13 +315,53 @@ elements.knife = {
//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)
//changePixel(pixel, cutInto)
if (shiftDown) {
if (Math.random() < 0.5) {
}
}
else if (!shiftDown) {
if (Math.random() < 0.1) {
changePixel(pixel, cutInto)
}
}
var thiselement = pixel.element;
if (elements[thiselement].cutIntoEmit && Math.random() < 0.1 && isEmpty(pixel.x,pixel.y-1)) {
createPixel(pixel.x,pixel.y-1,elements[thiselement].cutIntoEmit);
}
},
category:"tools",
canPlace: false,
desc: "Use on pixels to cut 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."
}
eLists.JUICEMIXABLE = ["juice"];
elements.chicken = {
@ -360,12 +417,13 @@ elements.chicken = {
stateHigh: "cooked_chicken",
tempLow: -18,
stateLow: "frozen_meat",
breakInto: ["feather", "raw_chicken"],
breakInto: "raw_chicken",
burn:85,
burnTime:450,
state: "solid",
density: 1117,
conduct: 0.3,
cutInto: "raw_chicken",
};
elements.chicken_egg = {
@ -376,7 +434,7 @@ elements.chicken_egg = {
"M2%30|M1|M2%30",
],
tick: function(pixel) {
if (Math.random() < 0.1 && pixel.temp > 20) {
if (Math.random() < 0.1 && pixel.temp > 20 && pixel.temp < 35) {
changePixel(pixel,"chick")
}
doDefaults(pixel);
@ -983,6 +1041,8 @@ elements.apple = {
cutInto: "apple_slice",
state: "solid",
density: 1050,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#cfc540",
}
elements.apple_slice = {
@ -1300,6 +1360,8 @@ elements.orange = {
cutInto: ["orange_slice","orange_slice","orange_slice","orange_slice","orange_peels"],
state: "solid",
density: 1050,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#cf9f40",
}
elements.orange_slice = {
@ -1574,10 +1636,10 @@ elements.raw_salmon = {
behavior: behaviors.STURDYPOWDER,
category: "food",
state: "solid",
burnInto: "cook_salmon",
burnInto: "cooked_salmon",
temp:25,
tempHigh: 600,
stateHigh: ["ash", "smoke"],
tempHigh: 80,
stateHigh: "cooked_salmon",
isFood: true,
reactions: {
"smoke": {elem1: "smoked_salmon"},
@ -1654,8 +1716,8 @@ elements.raw_tuna = {
state: "solid",
temp:25,
burnInto: "cooked_tuna",
tempHigh: 600,
stateHigh: ["ash", "smoke"],
tempHigh: 80,
stateHigh: "cooked_tuna",
isFood: true,
reactions: {
"smoke": {elem1: "smoked_tuna"},
@ -1841,6 +1903,8 @@ elements.watermelon_flesh = {
state: "solid",
density: 1050,
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#c43f33",
}
elements.watermelon_juice = {
@ -1868,35 +1932,7 @@ elements.watermelon_juice = {
};
eLists.JUICEMIXABLE.push("watermelon_juice");
elements.grape = {
color: ["#b84b65","#a10e69","#a10e95","#8a3eab"],
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: 825,
breakInto: "grape_juice",
ignoreAir: true,
isFood: true
},
elements.grape.breakInto = "grape_juice",
elements.grape_juice = {
color: "#6d2282",
@ -2279,6 +2315,8 @@ elements.cut_coconut = {
state: "solid",
density: 1050,
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#ede9b9",
}
elements.coconut_juice = {
@ -2394,6 +2432,8 @@ elements.lemon = {
density: 1050,
isFood: true,
cutInto: ["lemon_zest","lemon_slice","lemon_slice","lemon_slice","lemon_slice"],
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#b8af4b",
}
elements.lemon_juice = {
@ -2633,6 +2673,8 @@ elements.carrot = {
state: "solid",
density: 1050,
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#ba8125",
}
elements.carrot_juice = {
@ -2800,6 +2842,8 @@ elements.turnip = {
state: "solid",
density: 1050,
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#79097d",
}
elements.turnip_juice = {
@ -2827,32 +2871,7 @@ elements.turnip_juice = {
};
eLists.JUICEMIXABLE.push("turnip_juice");
elements.corn = {
color: ["#f8d223","#d6ba2a","#f7f5ba","#dbd281","#cdb12d"],
tick: function(pixel) {
if (pixel.temp >= 180) {
changePixel(pixel,"popcorn");
if (isEmpty(pixel.x,pixel.y-1)) {
tryMove(pixel,pixel.x,pixel.y-1);
if (isEmpty(pixel.x-1,pixel.y)) { createPixel("pop",pixel.x-1,pixel.y) }
if (isEmpty(pixel.x+1,pixel.y)) { createPixel("pop",pixel.x+1,pixel.y) }
if (isEmpty(pixel.x,pixel.y-1)) { createPixel("pop",pixel.x,pixel.y-1) }
if (isEmpty(pixel.x,pixel.y+1)) { createPixel("pop",pixel.x,pixel.y+1) }
}
}
doDefaults(pixel)
},
category: "food",
burn: 10,
burnTime: 200,
breakInto: "corn_starch",
breakIntoColor: ["#ffe9a8","#ffecb3","#ffe28a"],
state: "solid",
density: 721,
seed: "corn_seed",
isFood: true,
movable: false,
}
elements.corn.breakInto ="corn_starch"
elements.corn_starch = {
color: ["#fcf2e1","#f2e7d3","#fcf3de"],
@ -2937,31 +2956,8 @@ elements.pancake_batter = {
hidden: true,
isFood: true
}
elements.sap = {
color: ["#b67f18","#c86305","#cf7a19","#e4ae3a"],
behavior: behaviors.LIQUID,
reactions: {
"dead_bug": { elem1:"amber", elem2:null, chance:0.1 },
"ant": { elem1:"amber", elem2:null, chance:0.1 },
"fly": { elem1:"amber", elem2:null, chance:0.1 },
"flea": { elem1:"amber", elem2:null, chance:0.1 },
"termite": { elem1:"amber", elem2:null, chance:0.1 },
"worm": { elem1:"amber", elem2:null, chance:0.1 },
"bee": { elem1:"amber", elem2:null, chance:0.1 },
"firefly": { elem1:"amber", elem2:null, chance:0.1 },
"stinkbug": { elem1:"amber", elem2:null, chance:0.1 },
"slug": { elem1:"amber", elem2:null, chance:0.1 },
"snail": { elem1:"amber", elem2:null, chance:0.1 },
},
tempHigh: 104,
stateHigh: ["maple_syrup","maple_syrup","maple_syrup","sap"],
tempLow: 0,
stateLowName: "amber",
category:"liquids",
state: "liquid",
viscosity: 15,
density: 1400
}
elements.sap.tempHigh = 104,
elements.sap.stateHigh = ["maple_syrup","maple_syrup","maple_syrup","sap"],
elements.maple_syrup = {
color: ["#fabb34","#facc34","#fabb34"],
behavior: behaviors.LIQUID,
@ -3157,7 +3153,8 @@ elements.strawberry = {
burnInto: "dead_plant",
breakInto: "strawberry_juice",
state: "solid",
density: 1050
density: 1050,
freezeDryInto: "freeze_dried_fruits",
}
elements.strawberry_juice = {
color: "#e03a3a",
@ -3183,42 +3180,16 @@ elements.strawberry_juice = {
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 = {
color: "#f7f7f7",
behavior: behaviors.LIQUID,
onMix: function(cream1, cream2) {
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")
}
},
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: "liquids",
hidden: true,
isFood: true,
state: "liquid",
density: 959.97,
}
}
elements.whipped_cream = {
color: "#fafafa",
behavior: behaviors.LIQUID,
@ -3548,7 +3519,9 @@ elements.blueberry = {
breakInto: "blueberry_juice",
state: "solid",
density: 1050,
cutInto: "cut_blueberry"
cutInto: "cut_blueberry",
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#33146e",
}
elements.blueberry_juice = {
color: "#5030a1",
@ -4180,7 +4153,9 @@ elements.banana = {
breakInto: "banana_juice",
state: "solid",
density: 1050,
cutInto: "cut_banana"
cutInto: "cut_banana",
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#c4b939",
}
elements.cut_banana = {
color: "#f2e56b",
@ -4198,7 +4173,9 @@ elements.cut_banana = {
breakInto: "banana_juice",
state: "solid",
density: 1050,
hidden: true
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#c4b939",
}
elements.banana_juice = {
color: "#dbc440",
@ -4520,6 +4497,8 @@ elements.mango = {
cutInto: "cut_mango",
state: "solid",
density: 1050,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#ccb50a",
}
elements.cut_mango = {
@ -4535,6 +4514,8 @@ elements.cut_mango = {
state: "solid",
density: 1050,
hidden: true,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#ccb50a",
}
elements.mango_seed = {
@ -4647,7 +4628,9 @@ elements.pineapple = {
breakInto: "pineapple_juice",
state: "solid",
density: 1050,
temp:20
temp:20,
freezeDryInto: "freeze_dried_fruits",
freezeDryIntoColor: "#ccb90a",
}
elements.pineapple_seed = {
color: "#695531",
@ -4757,3 +4740,282 @@ elements.pineapple_juice = {
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: [
"XX|XX|XX",
"XX|XX|",
"M2%10|M1|M2%10",
],
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
}
*/