This commit is contained in:
slweeb 2024-02-15 21:17:32 -05:00
commit f1f39daac4
12 changed files with 2958 additions and 128 deletions

View File

@ -117,7 +117,7 @@
<!----><tr><td class="modCat" colspan="3">Tools & Settings</td></tr><!---->
<tr><td>adjustablepixelsize.js</td><td>Allows you to set the pixelSize with a URL parameter</td><td>Alice</td></tr>
<tr><td>betaworldgen.js</td><td>adds a more advanced world generation to the game</td><td>Alex</td></tr>
<tr><td>betaworldgen.js</td><td>adds a more advanced world generation to the game</td><td>Adora</td></tr>
<tr><td>betterModManager.js</td><td>Improvements to the Mod Manager</td><td>ggod</td></tr>
<tr><td>betterSettings.js</td><td>Adds additional settings and functionality</td><td>ggod</td></tr>
<tr><td>betterStats.js</td><td>Separate “real” and “set” TPS, meaning you can see what the TPS actually is, instead of only seeing what its set to</td><td>mollthecoder</td></tr>
@ -168,7 +168,7 @@
<tr><td>metals.js</td><td>Adds several metals</td><td>Alice</td></tr>
<tr><td>mixture.js</td><td>Allows many chemicals to be mixed</td><td>lllllllllwith10ls</td></tr>
<tr><td>more_gold.js</td><td>Adds Green Gold</td><td>pixelegend4</td></tr>
<tr><td>morechemistry.js</td><td>Adds many new chemicals and compounds as well as some new machines</td><td>Alex</td></tr>
<tr><td>morechemistry.js</td><td>Adds many new chemicals and compounds as well as some new machines</td><td>Adora</td></tr>
<tr><td>moreliquids.js</td><td>Adds various liquids</td><td>te-agma-at</td></tr>
<tr><td>nellfire.js</td><td>Adds a weird transforming flame and several rock types</td><td>Alice</td></tr>
<tr><td>Neutronium Mod.js</td><td>Variety of scientific elements<br>Explosions</td><td>StellarX20</td></tr>
@ -235,6 +235,7 @@
<tr><td>nocancer2.js</td><td>Removes cancer from the game altogether. May be incompatible with other mods that spawn cancer</td><td>mollthecoder</td></tr>
<tr><td>nograssgrow.js</td><td>Prevents Grass from growing</td><td>mollthecoder</td></tr>
<tr><td>pizzasstuff.js</td><td>New animals, foods, and plants</td><td>_ilikepizza_</td></tr>
<tr><td>plants.js</td><td>Adds a wide variety of new plants and fruits</td><td>Adora</td></tr>
<tr><td>primordial_birthpool.js</td><td>A cross between Primordial Soup and Birthpool. Requires F&M</td><td>Alice</td></tr>
<tr><td>spring.js</td><td>Many nature elements, like sakura trees, butterflies, beehives, and more</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>the_ground_og.js</td><td>Simplified and more stable version of the_ground.js</td><td>Alice</td></tr>
@ -244,7 +245,7 @@
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
<tr><td>all_around_fillers.js</td><td>Adds directional Filler variants</td><td>idk73248</td></tr>
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Alex</td></tr>
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Adora</td></tr>
<tr><td>amogus.js</td><td>Adds a small amogus structure</td><td>Alice</td></tr>
<tr><td>collab_mod.js</td><td>Created by multiple people, adds random things</td><td>mrapple, ilikepizza, stefanblox</td></tr>
<tr><td>elem3.js</td><td>Adds all elements and combinations from Elemental 3 [Very Large]</td><td>Sophie</td></tr>

BIN
mods/VCR_OSD_MONO.ttf Normal file

Binary file not shown.

View File

@ -1,19 +1,33 @@
/*
Created by SquareScreamYT and RealerRaddler
Thanks to Alice, nousernamefound and Fioushemastor for helping :)
Created by SquareScreamYT <@918475812884344852> and RealerRaddler <@914371295561535508>
Thanks to Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696> and Fioushemastor <@738828785482203189> for helping :)
v1.6
me trying to come up with stuff not in plants.js:
Upcoming Features:
- onions
- spring onions
- soy sauce
- rice
- rice and porridge (white rice noodles)
- seaweed and agar
- pigs, ham and bacon
- garlic
- msg
- stainless steel
v1.5
- chili
- pepper plants
- pineapples
- mint
- vanilla
- cocoa beans and hot chocolate
- normal cookies and cookie dough
- cows and beef
- mangoes and passionfruits
- celery
- marshmallows, normal, cooked and burnt
- broccoli
Changelog (v1.0)
- added chickens
@ -218,6 +232,27 @@ Changelog (v1.5)
- added cookies and cookie dough
- replaced cooking oil with nut oil
- added boba and boba dough
Changelog (v1.6)
- added freeze and warm tool
- added olive seeds
- juice mixing functionality
- wine can now be made by mixing grape juice and alcohol
- added bananas and related stuff
- bananas
- hanging banana peduncle and banana peduncle
- banana stem and banana stem top
- banana leaves
- cut banana
- banana juice
- banana bread
*/
/*
@ -227,6 +262,19 @@ elements.test = {
}
*/
function interpolateRgb(rgb1, rgb2, ratio) {
const interpolatedRgb = {
r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio),
g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio),
b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio),
};
return interpolatedRgb;
}
function getRGB(rgb){
let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r")
return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) };
}
elements.knife = {
color: "#adb5bd",
// other needed properties
@ -245,6 +293,8 @@ elements.knife = {
desc: "Use on pixels to cut them, if possible."
}
eLists.JUICEMIXABLE = ["juice"];
elements.chicken = {
color: ["#c29046", "#f5d271", "#d4bd7d"],
behavior: [
@ -717,6 +767,53 @@ elements.olive = {
density: 1050,
isFood: false
}
elements.olive_seed = {
color: "#854610",
tick: function(pixel) {
if (isEmpty(pixel.x,pixel.y+1)) {
movePixel(pixel,pixel.x,pixel.y+1);
}
else {
if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) {
if (!outOfBounds(pixel.x,pixel.y+1)) {
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") {
changePixel(dirtPixel,"root");
}
}
if (isEmpty(pixel.x,pixel.y-1)) {
movePixel(pixel,pixel.x,pixel.y-1);
createPixel(Math.random() > 0.5 ? "olive_wood" : "olive_branch",pixel.x,pixel.y+1);
}
}
else if (pixel.age > 1000) {
changePixel(pixel,"olive_wood");
}
pixel.age++;
}
doDefaults(pixel);
},
properties: {
"age":0
},
tempHigh: 100,
stateHigh: "dead_plant",
tempLow: -2,
stateLow: "frozen_plant",
burn: 65,
burnTime: 15,
category: "life",
state: "solid",
density: 1500,
cooldown: defaultCooldown,
seed: true,
behavior: [
"XX|XX|XX",
"XX|FX%10|XX",
"XX|M1|XX",
],
};
/*
elements.cooking_oil = {
color: "#ffc844",
@ -951,12 +1048,21 @@ elements.apple_juice = {
density: 825,
hidden: true,
temp: 30,
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#ffde55")
}
}
},
reactions: {
"sugar": { elem1:"apple_jam", elem2:null, chance:0.35 },
"yeast": { elem1:"apple_cider_vinegar", elem2:null, chance:0.35 }
},
tempLow: 0
};
eLists.JUICEMIXABLE.push("apple_juice");
elements.apple_jam = {
color: "#ebc034",
@ -1251,6 +1357,14 @@ elements.orange_seed = {
elements.orange_juice = {
color: "#ffb326",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#ffde55")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -1264,6 +1378,7 @@ elements.orange_juice = {
temp: 30,
tempLow: 0
};
eLists.JUICEMIXABLE.push("orange_juice");
elements.orange_peels = {
color: "#d69c31",
@ -1708,6 +1823,14 @@ elements.watermelon_flesh = {
elements.watermelon_juice = {
color: "#eb4034",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#eb4034")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -1721,6 +1844,7 @@ elements.watermelon_juice = {
temp: 30,
tempLow: 0
};
eLists.JUICEMIXABLE.push("watermelon_juice");
elements.grape = {
color: ["#b84b65","#a10e69","#a10e95","#8a3eab"],
@ -1755,6 +1879,14 @@ elements.grape = {
elements.grape_juice = {
color: "#6d2282",
behavior: behaviors.LIQUID,
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel, "#6d2282")
}
}
},
reactions: {
"dirt": { elem1: null, elem2: "mud" },
"sand": { elem1: null, elem2: "wet_sand" },
@ -1762,6 +1894,7 @@ elements.grape_juice = {
"seltzer": { elem1: "soda", elem2: "foam" },
"carbon_dioxide": { elem1: "soda", elem2: "foam" },
"milk": { elem1: "fruit_milk", elem2: "fruit_milk" },
"alcohol": { elem1: "wine", elem2: "wine" },
"yeast": { elem1: ["wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","wine","cream_of_tartar"], elem2: null, chance:80 },
},
tempHigh: 160,
@ -1774,6 +1907,7 @@ elements.grape_juice = {
hidden: true,
isFood: true
};
eLists.JUICEMIXABLE.push("grape_juice");
elements.cream_of_tartar = {
color: ["#EFEFEF", "#EBEBEB", "#D8D8D6"],
@ -1817,6 +1951,14 @@ elements.wine = {
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
/*onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel, "#6D0112")
}
}
},*/
tempHigh: 100,
stateHigh: "steam",
isFood: true,
@ -1824,6 +1966,7 @@ elements.wine = {
hidden: true,
tempLow: 0
}
//eLists.JUICEMIXABLE.push("wine");
elements.shrimp = {
color: ["#EE5422", "#E9683C", "#F3583F", "#EDA270"],
@ -2118,6 +2261,14 @@ elements.cut_coconut = {
elements.coconut_juice = {
color: "#e9ebe4",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#e9ebe4")
}
}
},
behavior: behaviors.LIQUID,
reactions: {
"dirt": { elem1: null, elem2: "mud" },
@ -2135,6 +2286,7 @@ elements.coconut_juice = {
hidden: true,
isFood: true
}
eLists.JUICEMIXABLE.push("coconut_juice");
elements.lemon_wood = {
color: "#786531",
@ -2224,6 +2376,14 @@ elements.lemon = {
elements.lemon_juice = {
color: "#e0d358",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#e0d358")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2241,9 +2401,18 @@ elements.lemon_juice = {
"sugar": {elem1:"lemonade", elem2: "null", chance:0.35}
}
};
eLists.JUICEMIXABLE.push("lemon_juice");
elements.lemonade = {
color: "#fff378",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#fff378")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2259,6 +2428,8 @@ elements.lemonade = {
tempLow: 0
};
eLists.JUICEMIXABLE.push("lemonade");
elements.lemon_zest = {
color: "#dbc535",
behavior: behaviors.POWDER,
@ -2444,6 +2615,14 @@ elements.carrot = {
elements.carrot_juice = {
color: "#f5a742",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#f5a742")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2457,9 +2636,18 @@ elements.carrot_juice = {
hidden: true,
temp: 30,
};
eLists.JUICEMIXABLE.push("carrot_juice");
elements.apple_cider_vinegar = {
color: "#fffe75",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#fffe75")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2473,6 +2661,7 @@ elements.apple_cider_vinegar = {
temp: 30,
tempLow: 0
};
eLists.JUICEMIXABLE.push("apple_cider_vinegar");
elements.turnip_seed = {
color: "#994828",
@ -2593,6 +2782,14 @@ elements.turnip = {
elements.turnip_juice = {
color: "#700f5d",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#700f5d")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2606,6 +2803,7 @@ elements.turnip_juice = {
hidden: true,
temp: 30,
};
eLists.JUICEMIXABLE.push("turnip_juice");
elements.corn = {
color: ["#f8d223","#d6ba2a","#f7f5ba","#dbd281","#cdb12d"],
@ -2644,8 +2842,8 @@ elements.corn_starch = {
"seltzer": { elem1: "dough", elem2: null },
"pool_water": { elem1: "dough", elem2: null },
"juice": { elem1: "dough", elem2: null },
"yolk": { elem1: "batter", elem2: null },
"yogurt": { elem1: "batter", elem2: null },
"yolk": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" },
"yogurt": { elem1: "cookie_dough", elem2: null, color1:"#dbd19a" },
"broth": { elem1:"dough", elem2:null },
"soda": { elem1:"dough", elem2:null },
"tea": { elem1:"dough", elem2:null },
@ -2941,6 +3139,14 @@ elements.strawberry = {
}
elements.strawberry_juice = {
color: "#e03a3a",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#e03a3a")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -2957,6 +3163,7 @@ elements.strawberry_juice = {
"sugar": { elem1:"strawberry_jam", elem2:null, chance:0.35 },
},
};
eLists.JUICEMIXABLE.push("strawberry_juice");
elements.cream = {
color: "#f7f7f7",
@ -3152,6 +3359,14 @@ elements.ginger_leaves = {
}
elements.ginger_juice = {
color: "#ccc056",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#ccc056")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -3169,6 +3384,7 @@ elements.ginger_juice = {
"bread": { elem1:"gingerbread", elem2:null },
},
};
eLists.JUICEMIXABLE.push("ginger_juice");
elements.blueberry_seed = {
@ -3314,6 +3530,14 @@ elements.blueberry = {
}
elements.blueberry_juice = {
color: "#5030a1",
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#5030a1")
}
}
},
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
@ -3331,6 +3555,8 @@ elements.blueberry_juice = {
"milk": { elem1:"fruit_milk", elem2:null, chance:0.35, color1: "#995fb3" },
},
};
eLists.JUICEMIXABLE.push("blueberry_juice");
/*
elements.fruit_slushie = {
color: "#ffcc54",
@ -3399,7 +3625,8 @@ elements.cut_blueberry = {
burn:15,
burnTime:60,
burnInto: "dead_plant",
breakInto: "blueberry_juice",
breakInto: "juice",
breakIntoColor:"#add69a",
state: "solid",
density: 1050,
hidden: true
@ -3437,7 +3664,7 @@ elements.cookie_dough = {
category: "food",
tempHigh: 94,
stateHigh: "cookie",
stateHighColorMultiplier: 0.8,
stateHighColorMultiplier: 1.1,
burn:40,
burnTime:25,
burnInto:"ash",
@ -3465,7 +3692,7 @@ elements.cookie = {
elements.nut_oil.name = "cooking_oil"
// elements.fire.temp = 130
elements.fire.temp = 130
elements.bread.behavior = behaviors.SUPPORT
@ -3504,6 +3731,492 @@ elements.boba = {
burnInto: ["smoke","smoke","smoke","ash"],
breakIntoColor: "#7d6216",
state: "solid",
density: 644,
density: 1500,
isFood: true
}
elements.caramel.density = 1500
elements.freeze = {
color: ["#42cbf5", "#42cbf5", "#42cbf5", "#75d3f0", "#42cbf5"],
tool: function (pixel) {
if (!shiftDown) {
pixel.temp -= 0.2;
pixelTempCheck(pixel);
} else {
pixel.temp -= 200;
pixelTempCheck(pixel);
}
},
category: "energy",
canPlace: false,
excludeRandom: true,
desc: "Use on pixels to freeze them."
};
elements.warm = {
color: ["#c7634a", "#c7634a", "#c7634a", "#e38f7b", "#c7634a"],
tool: function (pixel) {
if (!shiftDown) {
pixel.temp += 0.2;
pixelTempCheck(pixel);
} else {
pixel.temp += 200;
pixelTempCheck(pixel);
}
},
category: "energy",
canPlace: false,
excludeRandom: true,
desc: "Use on pixels to warm them."
};
/*
elements.pineapple_seed = {
color: "#695531",
tick: function(pixel) {
if (isEmpty(pixel.x,pixel.y+1)) {
movePixel(pixel,pixel.x,pixel.y+1);
}
else {
if (pixel.temp < 100 && pixel.temp > 20) {
if (Math.random() < 0.02 && pixel.age > 50) {
if (!outOfBounds(pixel.x,pixel.y+1)) {
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") {
changePixel(dirtPixel,"root");
pixel.leaflength = pixel.leaflength+Math.round(Math.random())
}
}
if (isEmpty(pixel.x,pixel.y-1) && pixel.leafgrown==false) {
movePixel(pixel,pixel.x,pixel.y-1);
createPixel("pineapple_leaves",pixel.x,pixel.y+1);
if (isEmpty(pixel.x,pixel.y-1)) {
createPixel("pineapple",pixel.x,pixel.y-1);
}
if (isEmpty(pixel.x+1,pixel.y) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x+1,pixel.y);
if (isEmpty(pixel.x+2,pixel.y-1) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x+2,pixel.y-1);
if (pixel.leaflength == 4 && isEmpty(pixel.x+3,pixel.y-2) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x+3,pixel.y-2);
pixel.leafgrown = true
}
}
}
if (isEmpty(pixel.x-1,pixel.y) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x-1,pixel.y);
if (isEmpty(pixel.x-2,pixel.y-1) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x-2,pixel.y-1);
if (pixel.leaflength = 3) {
pixel.leafgrown = true
}
if (pixel.leaflength = 4 && isEmpty(pixel.x-3,pixel.y-2) && isEmpty(pixel.x+3,pixel.y-2) && Math.random() < 0.5) {
createPixel("pineapple_leaves",pixel.x-3,pixel.y-2);
createPixel("pineapple_leaves",pixel.x+3,pixel.y-2);
pixel.leafgrown = true
}
}
}
}
}
else if (pixel.age > 500 && leafgrown == true && Math.random() < 0.1) {
changePixel(pixel,"pineapple_leaves");
}
}
pixel.age++;
}
doDefaults(pixel);
},
properties: {
"age":0,
"leaflength":3,
"leafgrown":false,
},
tempHigh: 100,
stateHigh: "dead_plant",
tempLow: -2,
stateLow: "frozen_plant",
burn: 65,
burnTime: 15,
category: "life",
state: "solid",
density: 1500,
cooldown: defaultCooldown,
seed: true,
temp:25,
behavior: [
"XX|XX|XX",
"XX|FX%10|XX",
"XX|M1|XX",
],
};
*//*
function averageHexColor(color1, color2) {
const rgb1 = hexToRgb(color1);
const rgb2 = hexToRgb(color2);
const avgRed = Math.floor((rgb1[0] + rgb2[0]) / 2);
const avgGreen = Math.floor((rgb1[1] + rgb2[1]) / 2);
const avgBlue = Math.floor((rgb1[2] + rgb2[2]) / 2);
const avgHex = rgbToHex(avgRed, avgGreen, avgBlue);
return avgHex;
}
function hexToRgb(hex) {
hex = hex.replace(/^#/, '');
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
return [r, g, b];
}
function rgbToHex(r, g, b) {
const rHex = r.toString(16).padStart(2, '0');
const gHex = g.toString(16).padStart(2, '0');
const bHex = b.toString(16).padStart(2, '0');
return `${rHex}${gHex}${bHex}`;
}
*/
// test
//var color1 = "#FF0000";
//var color2 = "#0000FF";
//var averageColor = averageHexColor(color1, color2);
//console.log(averageColor)
/*
eLists.JUICEMIXABLE.forEach(function(element){
elements[element].onMix = function(pixel1,pixel2) {
if (shiftDown && eLists.JUICEMIXABLE.indexOf(pixel2.element) !== -1) {
if (Math.random() < 0.2) {
var hex1 = pixel1.color
var hex2 = pixel2.color
let rgb = pixel.color.replace("rgb(", "").replace(")", "").split(",");
let rgbObj = { r: parseInt(rgb[0]), g: parseInt(rgb[1]), b: parseInt(rgb[2]) } //use this as one of the rgb objects
var finalJuiceColor = interpolatedRgb(hex1,hex2,0.5)
changePixel(pixel1,"juice")
//pixel1.color = pixelColorPick(pixel,finalJuiceColor)
pixel1.color = rgb(rgbObj)
}
}
}
})*/
elements.juice.onMix = function(pixel){
let num = Math.floor(Math.random() * 4);
let x = pixel.x + adjacentCoords[num][0];
let y = pixel.y + adjacentCoords[num][1];
if(!isEmpty(x,y) && !outOfBounds(x,y)){
let pixel2 = pixelMap[x][y];
if(pixel.color != pixel2.color && pixel2.element == "juice"){
let condition;
if(shiftDown == 0){
condition = (Math.floor(Math.random() * 2) == 1);
} else {
condition = true;
}
if(condition){
let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixel2.color), 0.5);
pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
}
}
}
}
elements.juice.stain = 0
elements.banana_seed = {
color: "#594129",
tick: function(pixel) {
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100) {
if (!outOfBounds(pixel.x,pixel.y+1)) {
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") {
changePixel(dirtPixel,"root");
}
}
if (isEmpty(pixel.x,pixel.y-1) && pixel.height < 7) {
movePixel(pixel,pixel.x,pixel.y-1);
createPixel("banana_stem",pixel.x,pixel.y+1);
pixel.height++
}
}
else if (pixel.age > 150 && pixel.height > 6 && Math.random() < 0.1) {
changePixel(pixel,"banana_tree_top");
}
pixel.age++;
doDefaults(pixel);
},
properties: {
"age":0,
"height": 0
},
tempHigh: 100,
stateHigh: "dead_plant",
tempLow: -2,
stateLow: "frozen_plant",
burn: 65,
burnTime: 15,
category: "life",
state: "solid",
density: 1500,
cooldown: defaultCooldown,
seed: true,
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|M1|XX",
],
};
elements.banana_stem = {
color: "#698215",
behavior: behaviors.WALL,
tempHigh: 400,
stateHigh: ["ember","charcoal","fire","fire","fire"],
category: "life",
burn: 5,
burnTime: 300,
burnInto: ["ember","charcoal","fire"],
state: "solid",
hardness: 0.15,
breakInto: "sawdust",
breakIntoColor: ["#dba66e","#cc8a64"],
hidden: true
}
elements.banana_tree_top = {
color: "#718a21",
behavior: behaviors.WALL,
tempHigh: 400,
stateHigh: ["ember","charcoal","fire","fire","fire"],
category: "life",
burn: 5,
burnTime: 300,
burnInto: ["ember","charcoal","fire"],
state: "solid",
hardness: 0.15,
breakInto: "sawdust",
breakIntoColor: ["#dba66e","#cc8a64"],
properties:{
"leftleaves": 0,
"rightleaves": 0,
},
hidden: true,
tick: function(pixel) {
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 0) {
if (isEmpty(pixel.x+1,pixel.y)) {
createPixel("banana_leaves",pixel.x+1,pixel.y);
pixel.rightleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 1) {
if (isEmpty(pixel.x+2,pixel.y)) {
createPixel("banana_leaves",pixel.x+2,pixel.y);
pixel.rightleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 2) {
if (isEmpty(pixel.x+3,pixel.y)) {
createPixel("banana_leaves",pixel.x+3,pixel.y);
pixel.rightleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.rightleaves == 3) {
if (isEmpty(pixel.x+4,pixel.y+1)) {
createPixel("banana_leaves",pixel.x+4,pixel.y+1);
pixel.rightleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 0) {
if (isEmpty(pixel.x-1,pixel.y)) {
createPixel("banana_leaves",pixel.x-1,pixel.y);
pixel.leftleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 1) {
if (isEmpty(pixel.x-2,pixel.y)) {
createPixel("banana_leaves",pixel.x-2,pixel.y);
pixel.leftleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 2) {
if (isEmpty(pixel.x-3,pixel.y)) {
createPixel("banana_leaves",pixel.x-3,pixel.y);
pixel.leftleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 50 && pixel.temp < 100 && pixel.leftleaves == 3) {
if (isEmpty(pixel.x-4,pixel.y+1)) {
createPixel("banana_leaves",pixel.x-4,pixel.y+1);
pixel.leftleaves++
}
}
if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) {
if (isEmpty(pixel.x+1,pixel.y+2)) {
createPixel("banana_peduncle",pixel.x+1,pixel.y+2);
}
}
if (Math.random() < 0.1 && pixel.age > 70 && pixel.temp < 100 && pixel.leftleaves > 0 && pixel.rightleaves > 0) {
if (isEmpty(pixel.x-1,pixel.y+2)) {
createPixel("banana_peduncle",pixel.x-1,pixel.y+2);
}
}
pixel.age++;
doDefaults(pixel);
},
}
elements.banana_leaves = {
color: ["#3da324","#3cbd1c"],
reactions: {
"vinegar": { elem1:"dead_plant", elem2:null, chance:0.035 },
"baking_soda": { elem1:"dead_plant", elem2:null, chance:0.01 },
"bleach": { elem1:"dead_plant", elem2:null, chance:0.05 },
"alcohol": { elem1:"dead_plant", elem2:null, chance:0.035 }
},
category:"life",
tempHigh: 100,
stateHigh: "dead_plant",
tempLow: -1.66,
stateLow: "frozen_plant",
burn:65,
burnTime:60,
burnInto: "dead_plant",
breakInto: "dead_plant",
state: "solid",
density: 1050,
hidden: true
}
elements.banana_peduncle = {
color: "#8bb81a",
behavior: behaviors.WALL,
tempHigh: 400,
stateHigh: ["ember","charcoal","fire","fire","fire"],
category: "life",
burn: 5,
burnTime: 300,
burnInto: ["ember","charcoal","fire"],
state: "solid",
hardness: 0.15,
breakInto: "sawdust",
hidden: true,
tick: function(pixel) {
if (Math.random() < 0.1 && pixel.temp < 100) {
if (isEmpty(pixel.x+1,pixel.y+1)) {
createPixel("hanging_banana_peduncle",pixel.x+1,pixel.y+1);
}
if (isEmpty(pixel.x-1,pixel.y+1)) {
createPixel("hanging_banana_peduncle",pixel.x-1,pixel.y+1);
}
if (isEmpty(pixel.x+1,pixel.y+2)) {
createPixel("hanging_banana_peduncle",pixel.x+1,pixel.y+2);
}
if (isEmpty(pixel.x-1,pixel.y+2)) {
createPixel("hanging_banana_peduncle",pixel.x-1,pixel.y+2);
}
}
pixel.age++;
doDefaults(pixel);
},
}
elements.hanging_banana_peduncle = {
color: "#8bb81a",
behavior: [
"XX|XX|XX",
"CR:banana%0.2|XX|CR:banana%0.2",
"XX|XX|XX",
],
tempHigh: 400,
stateHigh: ["ember","charcoal","fire","fire","fire"],
category: "life",
burn: 5,
burnTime: 300,
burnInto: ["ember","charcoal","fire"],
state: "solid",
hardness: 0.15,
breakInto: "sawdust",
hidden: true,
}
elements.banana = {
color: "#ebd834",
behavior: [
"XX|XX|XX",
"ST:hanging_banana_peduncle|XX|ST:hanging_banana_peduncle",
"XX|M1|XX",
],
category:"food",
tempHigh: 100,
stateHigh: "dead_plant",
burn:15,
burnTime:60,
burnInto: "dead_plant",
breakInto: "banana_juice",
state: "solid",
density: 1050,
cutInto: "cut_banana"
}
elements.cut_banana = {
color: "#f2e56b",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1|M2",
],
category:"food",
tempHigh: 100,
stateHigh: "dead_plant",
burn:15,
burnTime:60,
burnInto: "dead_plant",
breakInto: "banana_juice",
state: "solid",
density: 1050,
}
elements.banana_juice = {
color: "#dbc440",
behavior: behaviors.LIQUID,
category: "liquids",
tempHigh: 100,
stateHigh: ["steam","sugar"],
burn: 70,
burnTime: 300,
burnInto: ["steam", "smoke"],
state: "liquid",
density: 825,
hidden: true,
temp: 30,
onMix: function(pixel) {
if (shiftDown) {
if (Math.random() < 0.2) {
changePixel(pixel,"juice")
pixel.color = pixelColorPick(pixel,"#dbc440")
}
}
},
reactions: {
"bread": { elem1:"banana_bread", elem2:null, chance:0.35 },
},
tempLow: 0
};
eLists.JUICEMIXABLE.push("banana_juice");
elements.banana_bread = {
color: "#c2782f",
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
}

View File

@ -2136,9 +2136,9 @@ try {
};
};
function capitalizeFirstLetter(string,locale=null) {
return string[0][locale ? "toLocaleUpperCase" : "toUpperCase"](locale) + string.slice(1)
};
function capitalizeFirstLetter(string,locale=null) {
return string[0][locale ? "toLocaleUpperCase" : "toUpperCase"](locale) + string.slice(1)
};
//COLOR MANIPULATION TOOLS ##
@ -36321,7 +36321,7 @@ Make sure to save your command in a file if you want to add this preset again.`
newPixel.vx ??= 0;
newPixel.vy ??= 0;
newPixel.vx += (pixel.direction * 5)
newPixel.vy += 3;
newPixel.vy -= 3;
};
};
pixel.fromX += pixel.direction
@ -36406,7 +36406,7 @@ Make sure to save your command in a file if you want to add this preset again.`
newPixel.vx ??= 0;
newPixel.vy ??= 0;
newPixel.vx += (pixel.direction * 13)
newPixel.vy += 6;
newPixel.vy -= 6;
};
};
pixel.fromX += pixel.direction
@ -36503,7 +36503,7 @@ Make sure to save your command in a file if you want to add this preset again.`
newPixel.vx ??= 0;
newPixel.vy ??= 0;
newPixel.vx += (pixel.direction * 6)
newPixel.vy += 3;
newPixel.vy -= 3;
};
};
pixel.fromX += pixel.direction
@ -36598,7 +36598,7 @@ Make sure to save your command in a file if you want to add this preset again.`
newPixel.vx ??= 0;
newPixel.vy ??= 0;
newPixel.vx += (pixel.direction * 8)
newPixel.vy += 5;
newPixel.vy -= 5;
};
};
pixel.fromX += pixel.direction

View File

@ -1,21 +1,24 @@
//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
let liquid = [["XX", "XX", "XX"], ["M1", "XX", "M1"], ["M1", "M2", "M1"]]
for (var element in elements){
let a = elements[element].behavior;
console.log(a, elements[element], liquid)
if(a != undefined && typeof a != 'function'){
let i = 0;
while (i < a.length){
if(typeof a[i] == "string"){
a[i] = a[i].split("|");
i += 1;
} else {
i += 1;
runAfterLoad(function(){
for (var element in elements){
elements[element].noMix = false;
let a = elements[element].behavior;
console.log(a, elements[element], liquid)
if(a != undefined && typeof a != 'function'){
let i = 0;
while (i < a.length){
if(typeof a[i] == "string"){
a[i] = a[i].split("|");
i += 1;
} else {
i += 1;
}
}
elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]];
} else {
elements[element].behavior = liquid;
}
elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]];
} else {
elements[element].behavior = liquid;
}
}
});

286
mods/jaydstuff.js Normal file
View File

@ -0,0 +1,286 @@
//jaydstuff
elements.super_raincloud = {
color: "#0000ff",
behavior: [
"XX|M1%10|XX",
"M1%5|XX|M1%5",
"CR:water%40|CR:water%40|CR:water%40",
],
category: "gases",
state: "gas",
density: 50,
},
elements.deuterium = {
color: "#558bcf",
behavior: behaviors.GAS,
reactions: {
"oxygen": { elem1:null, elem2:"heavy_steam", tempMin:500 },
"tritium": { elem1:"neutron", elem2:"helium", tempMin:100000000, temp1:150000000, temp2:150000000 },
"fire": { elem1:"explosion", chance:0.005 },
},
category: "gases",
burn: 100,
burnTime: 2,
burnInto: ["fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","heavy_steam"],
tempLow: -253,
stateLow: "liquid_deuterium",
state: "gas",
density: 0.180,
conduct: 0.02,
colorOn: "#d6462d"
},
elements.liquid_deuterium = {
color: "#97afcf",
behavior: behaviors.LIQUID,
reactions: {
"liquid_oxygen": { elem1:"heavy_ice", elem2:null },
"oxygen": { elem1:"ice", elem2:null }
},
category: "states",
burn: 100,
burnTime: 2,
temp: -255.879,
tempHigh: -252.879,
stateHigh: "hydrogen",
tempLow: -259.2,
state: "liquid",
density: 163.83,
hidden: true
},
elements.tritium = {
color: "#558bcf",
behavior: [
"M2|M1 AND CR:radiation%1|M2",
"M1|XX|M1",
"M2|M1 AND CR:radiation%0.5|M2",
],
reactions: {
"oxygen": { elem1:null, elem2:"tritiated_steam", tempMin:500 },
"deuterium": { elem1:"neutron", elem2:"helium", tempMin:100000000, temp1:150000000, temp2:150000000 },
"fire": { elem1:"explosion", chance:0.005 },
},
category: "gases",
burn: 100,
burnTime: 2,
burnInto: ["fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","fire","steam"],
tempLow: -253,
stateLow: "liquid_tritium",
state: "gas",
density: 0.269,
conduct: 0.02,
colorOn: "#d6462d"
},
elements.liquid_tritium = {
color: "#97afcf",
behavior: [
"XX|CR:radiation%1|XX",
"M2|XX|M2",
"M1|M1|M1",
],
reactions: {
"liquid_oxygen": { elem1:"tritiated_ice", elem2:null },
"oxygen": { elem1:"ice", elem2:null }
},
category: "states",
burn: 100,
burnTime: 2,
temp: -255.879,
tempHigh: -252.879,
stateHigh: "tritium",
tempLow: -259.2,
state: "liquid",
density: 213,
hidden: true
},
elements.heavy_water = {
color: "#2167ff",
behavior: behaviors.LIQUID,
tempHigh: 101.4,
stateHigh: "heavy_steam",
tempLow: 0,
stateLow: "heavy_ice",
category: "liquids",
heatCapacity: 4.184,
reactions: {
// electrolysis:
"aluminum": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0025 },
"zinc": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.015 },
"steel": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 },
"iron": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 },
"tin": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.01 },
"brass": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 },
"bronze": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 },
"copper": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
"silver": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
"gold": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
},
state: "liquid",
density: 1107,
conduct: 0.02,
stain: -0.5,
extinguish: true
},
elements.heavy_steam = {
color: "#abd6ff",
behavior: behaviors.GAS,
reactions: {
"copper": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.01 },
"bronze": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.005 },
"iron": { elem1:"oxygen", elem2:"rust", chance:0.005 },
"steel": { elem1:"oxygen", elem2:"rust", chance:0.004 },
},
temp: 150,
tempLow: 95,
extraTempLow: {
0: "heavy_rime"
},
stateLow: "heavy_water",
category: "gases",
state: "gas",
density: 1,
conduct: 0.002,
stain: -0.05,
alias: "heavy water vapor",
extinguish: true
},
elements.heavy_ice = {
color: "#b2daeb",
behavior: behaviors.WALL,
temp: -5,
tempHigh: 5,
stateHigh: "heavy_water",
category: "solids",
state: "solid",
density: 1014.202,
breakInto: "heavy_snow"
},
elements.tritiated_water = {
color: "#2167ff",
behavior: [
"XX|CR:radiation%1|XX",
"M2|XX|M2",
"M1|M1|M1",
],
tempHigh: 101.4,
stateHigh: "tritiated_steam",
tempLow: 0,
stateLow: "tritiated_ice",
category: "liquids",
heatCapacity: 4.184,
reactions: {
// electrolysis:
"aluminum": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0025 },
"zinc": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.015 },
"steel": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 },
"iron": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0125 },
"tin": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.01 },
"brass": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 },
"bronze": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.001 },
"copper": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
"silver": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
"gold": { elem1:["deuterium","deuterium","oxygen"], charged:true, chance:0.0075 },
},
state: "liquid",
density: 1107,
conduct: 0.02,
stain: -0.5,
extinguish: true
},
elements.tritiated_steam = {
color: "#abd6ff",
behavior: [
"M2|M1 AND CR:radiation%1|M2",
"M1|XX|M1",
"M2|M1 AND CR:radiation%0.5|M2",
],
reactions: {
"copper": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.01 },
"bronze": { elem1:"oxygen", elem2:"oxidized_copper", chance:0.005 },
"iron": { elem1:"oxygen", elem2:"rust", chance:0.005 },
"steel": { elem1:"oxygen", elem2:"rust", chance:0.004 },
},
temp: 150,
tempLow: 95,
extraTempLow: {
0: "heavy_rime"
},
stateLow: "tritiated_water",
category: "gases",
state: "gas",
density: 0.6,
conduct: 0.002,
stain: -0.05,
alias: "tritiated water vapor",
extinguish: true
},
elements.tritiated_ice = {
color: "#b2daeb",
behavior: [
"XX|CR:radiation%0.25|XX",
"CR:radiation%0.25|XX|CR:radiation%0.25",
"XX|CR:radiation%0.25|XX",
],
temp: -5,
tempHigh: 5,
stateHigh: "tritiated_water",
category: "solids",
state: "solid",
density: 1014.202,
breakInto: "tritiated_snow"
},
elements.fusion = {
color: "#ffffff",
tool: function(pixel) {
pixel.temp = 100000000;
pixelTempCheck(pixel)
},
category: "tools",
},
elements.meese = {
color: "#996515",
behavior: [
"XX|XX|XX",
"XX|FX%0.25|M2%0.5 AND BO",
"XX|M1|XX",
],
category: "life"
},
elements.fluoroantimonic_acid = {
color: ["#b5cf91","#a1ff5e","#288f2a"],
behavior: [
"XX|DB%5|XX",
"DB%5 AND M2|XX|DB%5 AND M2",
"DB%5 AND M2|DB%10 AND M1|DB%5 AND M2",
],
ignore: ["glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","copper","gold","porcelain"],
category: "liquids",
state: "liquid",
density: 2885,
hidden: true,
stain: -0.1,
},
elements.tritium_ice = {
color: "#b5d2ff",
behavior: [
"XX|CR:radiation%0.25|XX",
"CR:radiation%0.25|XX|CR:radiation%0.25",
"XX|CR:radiation%0.25|XX",
],
temp: -259,
tempHigh: -256,
stateHigh: "liquid_tritium",
category: "states",
state: "solid",
density: 258,
},
elements.unstain = {
category: "tools",
stain: -1,
tool: (pixel) => {
doStaining({
element: "unstain",
x: pixel.x,
y: pixel.y
})
}
};

481
mods/moreViews.js Normal file
View File

@ -0,0 +1,481 @@
if (!enabledMods.includes("mods/betterSettings.js")) { enabledMods.unshift("mods/betterSettings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); alert("'betterSettings.js' is a dependency for 'moreViews.js' and has been added. Please reload for it to take effect.") }
else {
const views = [
// default sandboxels
"Default View",
"",
"Thermal View",
"Basic View",
"Smooth View",
// custom
"3D View",
"Inverted",
"Darker",
"Brighter",
"Gray scale",
"Sepia",
"Hue rotation 180°",
"Saturated",
"Time",
"Anaglyph",
"VHS (VCR)",
"Outline",
"Upside down",
"Vignette"
];
setView = (n) => {
if (n <= views.length - 1 && n > 1) {
view = n;
} else {
view = null;
}
setSetting('view', parseInt(view));
document.querySelector('span[setting="view"]').children[0].value = view ?? 0;
}
for (const i in views) {
if (i < 5) continue;
const option = document.createElement("option");
option.setAttribute("value", i);
option.innerText = views[i];
document.querySelector('.setting-span[setting="view"]').querySelector("select").appendChild(option);
viewKey[i] = views[i];
}
const vcrFont = new FontFace("VCR", "url(mods/VCR_OSD_MONO.ttf)");
vcrFont.load().then(font => {
console.log(font);
document.fonts.add(font);
})
function blending(color, color2, t = 0.5) {
const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16));
const [r2, g2, b2] = parseColor(color2).replace("#", "").match(/../g).map(a => parseInt(a, 16));
if ([r, g, b].includes(undefined) || [r, g, b, t].includes(NaN)) console.log([r, g, b, t], parseColor(color), color);
return `#${[
(1 - t) * r + t * r2,
(1 - t) * g + t * g2,
(1 - t) * b + t * b2
].map(a => Math.floor(a).toString(16).padStart(2, "0")).join("")}`;
}
const cache = new Map();
function mixColors(color, color2) {
if (cache.has(`${color}_${color2}`) || cache.has(`${color2}_${color}`)) return cache.get(`${color}_${color2}`) ?? cache.get(`${color2}_${color}`);
const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16));
const [r2, g2, b2] = parseColor(color2).replace("#", "").match(/../g).map(a => parseInt(a, 16));
const res = [
Math.max(r, r2),
Math.max(g, g2),
Math.max(b, b2)
];
cache.set(`${color}_${color2}`, `#${res.map(a => (Math.floor(a) % 256).toString(16).padStart(2, "0")).join("")}`);
return `#${res.map(a => (Math.floor(a) % 256).toString(16).padStart(2, "0")).join("")}`;
}
const parseColor = (colorString) => {
if (colorString instanceof Array) return parseColor(colorString[0]);
if (typeof colorString != "string") return "#ffffff";
if (colorString.startsWith("rgb(")) {
const color = colorString.replace("rgb(", "").replace(")", "");
return `#${color.split(",").map(a => parseInt(a).toString(16).length == 1 ? `0${parseInt(a).toString(16)}` : parseInt(a).toString(16)).join("")}`;
} else if (colorString.startsWith("rgba(")) {
const color = colorString.replace("rgba(", "").replace(")", "");
return `#${color.split(",").filter((_, i) => i <= 2).map(a => parseInt(a).toString(16).length == 1 ? `0${parseInt(a).toString(16)}` : parseInt(a).toString(16)).join("")}`;
} else {
if (colorString.startsWith("#")) {
const color = colorString.slice(1);
if (color.length == 3) return `#${color.split(a => a.repeat(2)).join()}`;
else if (color.length >= 6) return `#${color.slice(0, 6)}`;
else return `#${color}`;
}
}
}
const rgbToHsl = (r, g, b) => {
const r1 = r / 255;
const g1 = g / 255;
const b1 = b / 255;
const cmax = Math.max(r1, g1, b1);
const cmin = Math.min(r1, g1, b1);
const delta = cmax - cmin;
const l = (cmax + cmin) / 2;
const s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
let h = 0;
if (delta != 0) {
switch (cmax) {
case r1:
h = 60 * (((g1 - b1) / delta) % 6);
break;
case g1:
h = 60 * ((b1 - r1) / delta + 2);
break;
default:
h = 60 * ((r1 - g1) / delta + 4);
}
}
return {h, s, l};
}
const thetaSetting = new Setting("3D View Angle (0-90)", "theta", settingType.NUMBER, false, parseFloat((Math.atan(2) * 180 / Math.PI).toPrecision(3)));
const tab = new SettingsTab("moreViews.js");
tab.registerSetting(thetaSetting);
let maxDistance = -1;
const colorCache = new Map();
function getModeColor(color, distance = 0) {
if (!colorCache.has(view)) colorCache.set(view, new Map());
if (view == 18) {
if (colorCache.get(view).has(color) && colorCache.get(view).get(color).has(distance)) return colorCache.get(view).get(color).get(distance);
} else if (colorCache.get(view).has(color)) return colorCache.get(view).get(color);
switch (view) {
case 6: {
const newColor = "#" + (parseInt(`0x1${parseColor(color).slice(1)}`) ^ 0xffffff).toString(16).slice(1);
colorCache.get(view).set(color, newColor);
return newColor;
}
case 7: {
const newColor = blending(pixel.color, "#000000");
colorCache.get(view).set(color, newColor);
return newColor;
}
case 8: {
const newColor = blending(pixel.color, "#ffffff");
colorCache.get(view).set(color, newColor);
return newColor;
}
case 9: {
const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3);
const {h, l} = rgbToHsl(r, g, b);
const newColor = `hsl(${Math.round(h)}, 0%, ${Math.round(l * 100)}%)`;
colorCache.get(view).set(color, newColor);
return newColor;
}
case 10: {
const [r, g, b] = parseColor(color).replace("#", "").match(/../g).map(a => parseInt(a, 16));
const [r2, g2, b2] = [
Math.min(255, (r * 0.393) + (g * 0.769) + (b * 0.189)),
Math.min(255, (r * 0.349) + (g * 0.686) + (b * 0.168)),
Math.min(255, (r * 0.272) + (g * 0.534) + (b * 0.131))
];
const newColor = `#${Math.floor(r2).toString(16).padStart(2, "0")}${Math.floor(g2).toString(16).padStart(2, "0")}${Math.floor(b2).toString(16).padStart(2, "0")}`;
colorCache.get(view).set(color, newColor);
return newColor;
}
case 11: {
const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3);
const {h, s, l} = rgbToHsl(r, g, b);
const newColor = `hsl(${(Math.round(h) + 180 % 360)}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%)`;
colorCache.get(view).set(color, newColor);
return newColor;
}
case 12: {
const [r, g, b] = parseColor(color).slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16)).slice(0, 3);
const {h, s, l} = rgbToHsl(r, g, b);
const newColor = `hsl(${Math.round(h)}, ${Math.round(s * 100) * 4}%, ${Math.round(l * 100)}%)`;
colorCache.get(view).set(color, newColor);
return newColor;
}
case 15: {
const [r, g, b] = parseColor(color).replace("#", "").match(/../g);
const [r2, g2, b2] = [parseInt(r, 16) * 0.75, parseInt(g, 16) * 0.75, parseInt(b, 16) * 0.75];
const newColor = `rgb(${r2}, ${g2}, ${b2})`;
colorCache.get(view).set(color, newColor);
return newColor;
}
case 18: {
const newColor = blending(pixel.color, "#000000", (1 / maxDistance) * distance);
colorCache.get(view).has(color)
? colorCache.get(view).get(color).set(distance, newColor)
: colorCache.get(view).set(color, new Map([[distance, newColor]]));
return newColor;
}
}
return color;
}
settingsManager.registerTab(tab);
runAfterLoadList.push(() => drawPixels = (function() {
const oldDrawPixels = drawPixels;
return function(forceTick = false) {
if (view >= 5) {
if (maxDistance = -1) maxDistance = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2) * 2;
const canvas = document.getElementById("game");
const ctx = canvas.getContext("2d");
var newCurrentPixels = currentPixels.slice();
var pixelsFirst = [];
var pixelsLast = [];
if (!paused || forceTick) {
shuffleArray(newCurrentPixels);
}
for (var i = 0; i < newCurrentPixels.length; i++) {
pixel = newCurrentPixels[i];
if (pixel.del) {continue}
if (!paused || forceTick) {
if (elements[pixel.element].tick) {
elements[pixel.element].tick(pixel);
}
if (pixel.del) {continue}
if (elements[pixel.element].behavior) {
pixelTick(pixel);
}
};
if (pixel.con) { pixel = pixel.con }
if (elements[pixel.element].isGas || elements[pixel.element].glow) {
pixelsLast.push(pixel);
}
else {
pixelsFirst.push(pixel);
}
}
if (hiding) {
if (ctx.globalAlpha < 1) {
ctx.globalAlpha = 1;
}
if (elements[currentElement].maxSize < mouseSize) {
var mouseOffset = Math.trunc(elements[currentElement].maxSize/2);
}
else {
var mouseOffset = Math.trunc(mouseSize/2);
}
var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset];
var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset];
ctx.strokeStyle = "white";
ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize);
if (settings.precision) {
ctx.fillStyle = "rgba(255,255,255,0.5)";
ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize);
}
if ((!paused) || forceTick) {pixelTicks++};
return;
}
if (!settings["bg"]) {ctx.clearRect(0, 0, canvas.width, canvas.height)}
else {
ctx.fillStyle = settings["bg"];
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
var pixelDrawList = pixelsFirst.concat(pixelsLast);
for (var i = 0; i < pixelDrawList.length; i++) {
pixel = pixelDrawList[i];
if (pixelMap[pixel.x][pixel.y] == undefined) {continue}
if (pixel.con) { pixel = pixel.con };
ctx.fillStyle = getModeColor(pixel.color, view == 18 ? Math.sqrt((width / 2 - pixel.x) ** 2 + (height / 2 - pixel.y) ** 2) : 0);
// 3D VIEW
if (view == 5) {
const neighborRight = !outOfBounds(pixel.x + 1, pixel.y) && !!pixelMap[pixel.x + 1][pixel.y];
const neighborUp = !outOfBounds(pixel.x, pixel.y - 1) && !!pixelMap[pixel.x][pixel.y - 1];
const neighborUpRight = !outOfBounds(pixel.x + 1, pixel.y - 1) && !!pixelMap[pixel.x + 1][pixel.y - 1];
let size = 0;
let currentY = pixel.y;
while (!outOfBounds(pixel.x, currentY) && pixelMap[pixel.x][currentY] && pixelMap[pixel.x][currentY].element == pixel.element) {
currentY++;
size++;
}
ctx.globalAlpha = 1;
ctx.fillStyle = pixel.color;
ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize);
const px = pixel.x * pixelSize;
const py = pixel.y * pixelSize;
const theta = Math.max(Math.min(thetaSetting.get(), 90), 0) * Math.PI / 180;
const a = Math.cos(theta);
const b = Math.sin(theta);
const w = pixelSize;
const px2 = px + a * w;
const py2 = py - b * w;
const parts = [[[px, py], [[px2, py2], [px + w, py2], [px + w, py]], !neighborUp], [[px + w, py + w], [[px2 + w, py2 + w], [px2 + w, py], [px + w, py]], !neighborRight], [[px + w, py], [[px + w, py2], [px2 + w, py2], [px + w, py]], !neighborUp && !neighborUpRight], [[px + w, py], [[px2 + w, py2], [px2 + w, py], [px + w, py]], !neighborRight && !neighborUpRight]]
for (const part of parts.filter(p => p[2])) {
ctx.fillStyle = blending(pixel.color, "#000000");
ctx.beginPath();
ctx.moveTo(...part[0]);
for (const v of part[1]) {
ctx.lineTo(...v);
}
ctx.closePath();
ctx.fill();
}
} else if (view == 13) {
const hue = 225 - (Math.log(pixel.start) / Math.log(pixelTicks)) * 225;
ctx.globalAlpha = 1;
ctx.fillStyle = `hsl(${Math.min(Math.round(hue), 250)}, 100%, 50%)`;
ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize);
} else if (view == 14) {
ctx.globalAlpha = 1;
ctx.fillStyle = pixel.color;
ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize);
if (outOfBounds(pixel.x - 1, pixel.y) || !pixelMap[pixel.x - 1][pixel.y]) {
ctx.fillStyle = "#ff0000";
ctx.globalAlpha = 0.5;
ctx.fillRect(pixel.x * pixelSize - 0.5 * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize);
}
if (outOfBounds(pixel.x + 1, pixel.y) || !pixelMap[pixel.x + 1][pixel.y]) {
ctx.fillStyle = "#00ffff";
ctx.globalAlpha = 0.5;
ctx.fillRect(pixel.x * pixelSize + 0.5 * pixelSize, pixel.y * pixelSize, pixelSize, pixelSize);
}
} else if (view == 15) {
const [r, g, b] = parseColor(pixel.color).replace("#", "").match(/../g);
const [r2, g2, b2] = [parseInt(r, 16) * 0.75, parseInt(g, 16) * 0.75, parseInt(b, 16) * 0.75]
// scrolling effect
const offset = (pixelTicks + 6) % height >= pixel.y && (pixelTicks - 3) % height <= pixel.y
|| (pixelTicks + 66) % height >= pixel.y && (pixelTicks - 57) % height <= pixel.y;
if (!pixelMap[pixel.x - 1] || !pixelMap[pixel.x - 1][pixel.y]) {
ctx.globalAlpha = 0.5;
ctx.fillStyle = `#${r.padStart(2, "0")}0000`;
ctx.fillRect(pixel.x * pixelSize - 0.75 * pixelSize - (offset ? 0.5 * pixelSize : 0) , pixel.y * pixelSize, pixelSize, pixelSize);
}
if (!pixelMap[pixel.x + 1] || !pixelMap[pixel.x + 1][pixel.y]) {
ctx.globalAlpha = 0.5;
ctx.fillStyle = `#0000${b.padStart(2, "0")}`;
ctx.fillRect(pixel.x * pixelSize + 0.75 * pixelSize - (offset ? 0.5 * pixelSize : 0), pixel.y * pixelSize, pixelSize, pixelSize);
}
ctx.globalAlpha = 1;
ctx.fillStyle = `rgb(${r2}, ${g2}, ${b2})`
ctx.fillRect(pixel.x * pixelSize - (offset ? 0.5 * pixelSize : 0), pixel.y * pixelSize, pixelSize, pixelSize);
ctx.globalAlpha = 1;
// i fucking hate it but at least it works
// and i dont feel like finding something that is fast and pretty
} else if (view == 16) {
ctx.globalAlpha = 1;
ctx.strokeStyle = pixel.color;
ctx.lineWidth = 2;
const cond1 = outOfBounds(pixel.x - 1, pixel.y)
|| !pixelMap[pixel.x - 1][pixel.y]
|| pixelMap[pixel.x - 1][pixel.y].element != pixel.element;
const cond2 = outOfBounds(pixel.x + 1, pixel.y)
|| !pixelMap[pixel.x + 1][pixel.y]
|| pixelMap[pixel.x + 1][pixel.y].element != pixel.element;
const cond3 = outOfBounds(pixel.x, pixel.y - 1)
|| !pixelMap[pixel.x][pixel.y - 1]
|| pixelMap[pixel.x][pixel.y - 1].element != pixel.element;
const cond4 = outOfBounds(pixel.x, pixel.y + 1)
|| !pixelMap[pixel.x][pixel.y + 1]
|| pixelMap[pixel.x][pixel.y + 1].element != pixel.element;
const cond5 = outOfBounds(pixel.x - 1, pixel.y - 1)
|| !pixelMap[pixel.x - 1][pixel.y - 1]
|| pixelMap[pixel.x - 1][pixel.y - 1].element != pixel.element;
const cond6 = outOfBounds(pixel.x + 1, pixel.y - 1)
|| !pixelMap[pixel.x + 1][pixel.y - 1]
|| pixelMap[pixel.x + 1][pixel.y - 1].element != pixel.element;
const cond7 = outOfBounds(pixel.x - 1, pixel.y + 1)
|| !pixelMap[pixel.x - 1][pixel.y + 1]
|| pixelMap[pixel.x - 1][pixel.y + 1].element != pixel.element;
const cond8 = outOfBounds(pixel.x + 1, pixel.y + 1)
|| !pixelMap[pixel.x + 1][pixel.y + 1]
|| pixelMap[pixel.x + 1][pixel.y + 1].element != pixel.element;
if (cond1) {
ctx.beginPath();
ctx.moveTo(pixel.x * pixelSize + ctx.lineWidth / 2, pixel.y * pixelSize);
ctx.lineTo(pixel.x * pixelSize + ctx.lineWidth / 2, (pixel.y + 1) * pixelSize);
ctx.stroke();
}
if (cond2) {
ctx.beginPath();
ctx.moveTo((pixel.x + 1) * pixelSize - ctx.lineWidth / 2, pixel.y * pixelSize);
ctx.lineTo((pixel.x + 1) * pixelSize - ctx.lineWidth / 2, (pixel.y + 1) * pixelSize);
ctx.stroke();
}
if (cond3) {
ctx.beginPath();
ctx.moveTo(pixel.x * pixelSize, pixel.y * pixelSize + ctx.lineWidth / 2);
ctx.lineTo((pixel.x + 1) * pixelSize, pixel.y * pixelSize + ctx.lineWidth / 2);
ctx.stroke();
}
if (cond4) {
ctx.beginPath();
ctx.moveTo(pixel.x * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth / 2);
ctx.lineTo((pixel.x + 1) * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth / 2);
ctx.stroke();
}
if (!cond2 && !cond4 && cond8) ctx.fillRect((pixel.x + 1) * pixelSize - ctx.lineWidth, (pixel.y + 1) * pixelSize - ctx.lineWidth, ctx.lineWidth, ctx.lineWidth);
if (!cond2 && !cond3 && cond6) ctx.fillRect((pixel.x + 1) * pixelSize - ctx.lineWidth, pixel.y * pixelSize, ctx.lineWidth, ctx.lineWidth);
if (!cond1 && !cond3 && cond5) ctx.fillRect(pixel.x * pixelSize, pixel.y * pixelSize, ctx.lineWidth, ctx.lineWidth);
if (!cond1 && !cond4 && cond7) ctx.fillRect(pixel.x * pixelSize, (pixel.y + 1) * pixelSize - ctx.lineWidth, ctx.lineWidth, ctx.lineWidth);
} else if (view == 17) {
ctx.fillRect(pixel.x * pixelSize, (height - pixel.y) * pixelSize, pixelSize, pixelSize);
} else {
ctx.fillRect(pixel.x*pixelSize, pixel.y*pixelSize, pixelSize, pixelSize);
}
if (pixel.charge && view !== 2) { // Yellow glow on charge
if (!elements[pixel.element].colorOn) {
ctx.fillStyle = "rgba(255,255,0,0.5)";
ctx.fillRect(pixel.x*pixelSize, pixel.y*pixelSize, pixelSize, pixelSize);
}
}
}
if (view == 15) {
// TRACK READ NOISE
for (let n = 0; n < 3; n++) {
const number = Math.floor(Math.random() * height);
ctx.globalAlpha = Math.random();
ctx.fillStyle = "#fff";
ctx.fillRect(0, (number + 0.5) * pixelSize, width * pixelSize, 0.2);
ctx.globalAlpha = 1;
}
const {font, textAlign} = ctx;
ctx.font = "30px VCR";
ctx.textAlign = "start";
ctx.fillText(paused ? "PAUSE" : "PLAY", (0.025 * width) * pixelSize, (0.025 * width) * pixelSize + 15);
if (paused) {
ctx.fillRect((0.05 * width) * pixelSize + ctx.measureText("PAUSE").width, (0.025 * width) * pixelSize - 7.5, 5, 22.5);
ctx.fillRect((0.05 * width) * pixelSize + ctx.measureText("PAUSE").width + 8, (0.025 * width) * pixelSize - 7.5, 5, 22.5);
} else {
ctx.fillStyle = "#fff";
ctx.beginPath();
ctx.moveTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize - 7.5);
ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize + 15);
ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width + 17.5, (0.025 * width) * pixelSize + 3.75);
ctx.lineTo((0.05 * width) * pixelSize + ctx.measureText("PLAY").width, (0.025 * width) * pixelSize - 7.5);
ctx.fill();
}
const base = Math.floor(pixelTicks / tps);
const seconds = base % 60 + "";
const minutes = Math.floor(base / 60) % 60 + "";
const hours = Math.floor(base / 60 / 60) + "";
ctx.textAlign = "end";
ctx.fillText(`${hours.padStart(2, "0")}:${minutes.padStart(2, "0")}:${seconds.padStart(2, "0")}`, (0.975 * width) * pixelSize, (0.025 * width) * pixelSize + 15);
ctx.font = font;
ctx.textAlign = textAlign;
}
if (ctx.globalAlpha < 1) {
ctx.globalAlpha = 1;
}
if (elements[currentElement].maxSize < mouseSize) {
var mouseOffset = Math.trunc(elements[currentElement].maxSize/2);
}
else {
var mouseOffset = Math.trunc(mouseSize/2);
}
var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset];
var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset];
// Draw a square around the mouse
ctx.strokeStyle = "white";
ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize);
// draw one transparent pixel in the center
if (settings.precision) {
ctx.fillStyle = "rgba(255,255,255,0.5)";
ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize);
}
if ((!paused) || forceTick) {pixelTicks++};
} else oldDrawPixels.apply(this, arguments);
}
}()));
}

View File

@ -1,4 +1,4 @@
//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
function pixelInRange(pixel, range){
let i = 0;
while (i < range.length) {
@ -635,11 +635,6 @@ elements.potassiumhydroxidecrystals = {
density: 2040,
name: "PotassiumHydroxideCrystals",
}
elements.supercooler = {
name: "SuperCooler",
category: "machines"
}
elements.supercooler.behavior = [["XX","CO:10","XX"],["CO:10","XX","CO:10"],["XX","CO:10","XX"]]
elements.iron_chloride = {
color: ["#010014", "#a2ff94"],
reactions: {
@ -695,7 +690,7 @@ elements.kilonova = {
temp: 100000000,
}
elements.supernova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:80>plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,oxygen,molten_sodium,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium AND CH:NeutronStar", "XX" ], ["XX", "XX", "XX"] ]
elements.kilonova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:200>plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,molten_lead,oxygen,molten_sodium,molten_gold,molten_tungsten,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium,helium AND CH:void", "XX" ], ["XX", "XX", "XX"] ]
elements.kilonova.behavior = [ ["XX", "XX", "XX"], [ "XX", "EX:200>plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,molten_lead,oxygen,molten_sodium,molten_gold,molten_tungsten,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,hydrogen,hydrogen,hydrogen,hydrogen,hydrogen,helium,helium,helium,helium AND CH:void", "XX" ], ["XX", "XX", "XX"] ]
elements.NeutronStar = {
behavior: [["XX", "XX", "XX"], ["CR:light", "XX", "CR:light"], ["XX", "XX", "XX"]],
name: "NeutronStar",
@ -1057,52 +1052,12 @@ elements.specialmixer = {
mix(range, exclude);
}
}
let num4 = 0;
let exclude2 = [];
let property1 = "";
let value2 = "";
elements.propmachine = {
name: "PropMachine",
behavior: behaviors.WALL,
category: "machines",
noMix: true,
onSelect: function(pixel) {
let item = prompt("enter range for prop changing.");
if(/^\d+$/.test(item)){
num4 = parseInt(item);
} else {
alert("that is not an integer.");
}
exclude2 = prompt("Enter elements to exclude, seperate them with commas.").replace(/\s/g, "").split(",");
exclude2.push("propmachine");
var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined));
if (!answer1) { return }
var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined));
if (!answer2) { return }
var valueL = answer2.toLowerCase();
if (valueL === "true") { answer2 = true }
else if (valueL === "false") { answer2 = false }
else if (valueL === "null") { answer2 = null }
else if (valueL === "undefined") { answer2 = undefined }
else if (answer1 === "color" && valueL[0] === "#") {
var rgb = hexToRGB(valueL);
answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")";
}
currentProp = answer1;
var num = parseFloat(answer2);
if (!isNaN(num)) { answer2 = num }
currentPropValue = answer2;
logMessage("Prop: "+currentProp);
logMessage("Value: "+currentPropValue);
},
tick: function(pixel) {
if(pixel.start == pixelTicks) {
pixel.range = num4;
}
let range = mouseRange(pixel.x, pixel.y, pixel.range);
prop({ property: property1, value: value2 },range, exclude2);
}
}
let item = "";
elements.improvedsensor = {
behavior: behaviors.WALL,
@ -1196,30 +1151,111 @@ elements.incinerator = {
color: 'rgb(255, 50, 0)',
noMix: true,
}
function prop(obj, range, exclude = []){
function conditionTrue(condition, pixel){
let p = pixel;
let string = "";
condition = condition.split("!OR").join("||").split("&AND").join("&&").split("\"").join("")
condition = eval(condition);
return condition;
}
let ifCondition = "";
let currentProp = "";
let currentPropValue = "";
elements.propmachine = {
name: "PropMachine",
behavior: behaviors.WALL,
category: "machines",
noMix: true,
onSelect: function(pixel) {
let item = prompt("enter range for prop changing.");
if(/^\d+$/.test(item)){
num4 = parseInt(item);
} else {
alert("that is not an integer.");
}
exclude2 = prompt("Enter elements to exclude, seperate them with commas. You can also enter !IF if you wish to enter conditions for it to change the property and add the exclude elements.").replace(/\s/g, "");
if(exclude2.includes("!IF")){
exclude2.split("!IF").join("");
ifCondition = prompt("Enter the condition for the property to change. A list of variables can be seen at the bottom of the page. you cannot use \"\" but you can use `` and ''.");
} else { ifCondition = '1 == 1'; }
exclude2.split(",");
if(exclude2.constructor == [].constructor){
exclude2.push("propmachine");
} else {
exclude2 += "propmachine";
}
var answer1 = prompt("Warning - This tool may break the simulator if used incorrectly.\n\nEnter a pixel attribute to modify:",(currentProp||undefined));
console.log(answer1)
if (!answer1) { return }
var answer2 = prompt("Now, enter a value for "+answer1+":",(currentPropValue||undefined));
if (!answer2) { return }
var valueL = answer2.toLowerCase();
if (valueL === "true") { answer2 = true }
else if (valueL === "false") { answer2 = false }
else if (valueL === "null") { answer2 = null }
else if (valueL === "undefined") { answer2 = undefined }
else if (answer1 === "color" && valueL[0] === "#") {
var rgb = hexToRGB(valueL);
answer2 = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")";
}
currentProp = answer1;
currentPropValue = answer2;
console.log(answer1);
var num = parseFloat(answer2);
if (!isNaN(num)) { answer2 = num }
currentPropValue = answer2;
logMessage("Prop: "+currentProp);
logMessage("Value: "+currentPropValue);
},
tick: function(pixel) {
if(pixel.start == pixelTicks) {
pixel.range = num4;
pixel.condition = ifCondition;
pixel.prop = currentProp;
pixel.val = currentPropValue;
}
let range = mouseRange(pixel.x, pixel.y, pixel.range);
prop({ property: pixel.prop, value: pixel.val },range, exclude2, pixel.condition);
}
}
function prop(obj, range, exclude = [], condition = ""){
let list = [];
for (var i = 0; i < range.length; i++) {
if (!isEmpty(range[i][0], range[i][1], true)) {
var pixel = pixelMap[range[i][0]][range[i][1]];
if (!exclude.includes(pixel.element)){
var x = range[i][0];
var y = range[i][1];
if (!isEmpty(x,y,true)) {
var pixel = pixelMap[x][y];
list.push(pixel);
}
}
for (var i = 0; i < list.length; i++) {
if (!isEmpty(list[i].x, list[i].y, true)) {
var pixel = list[i];
if (!exclude.includes(pixel.element) && conditionTrue(condition, pixel)){
if(/^\d+$/.test(obj.value)){
obj.value = parseInt(obj.value);
}
if (!currentProp) { return }
if (pixel[currentProp] !== undefined && typeof pixel[currentProp] !== typeof currentPropValue) {
logMessage("Error: "+currentProp+" type is "+typeof pixel[currentProp]+", not "+typeof currentPropValue+".");
currentProp = null;
currentPropValue = null;
if (!obj.property) { return }
if (pixel[obj.property] !== undefined && typeof pixel[obj.property] !== typeof obj.value) {
logMessage("Error: "+obj.property+" type is "+typeof pixel[obj.property]+", not "+typeof obj.value+".");
obj.property = null;
obj.value = null;
return;
}
if (currentProp === "element") {
changePixel(pixel, currentPropValue);
if (obj.property === "element") {
changePixel(pixel, obj.value);
list.splice(list.indexOf(pixel),1);
return;
}
if (currentProp === "burning" && currentPropValue === "true") {
if (obj.property === "burning" && obj.value === "true") {
pixel.burnStart = pixelTicks;
list.splice(list.indexOf(pixel),1);
return;
}
pixel[currentProp] = currentPropValue;
pixel[obj.property] = obj.value;
list.splice(list.indexOf(pixel),1);
}
}
}
@ -1307,3 +1343,122 @@ function pull(range, pixel1, include = []){
}
}
}
let prevNum;
elements.etemper = {
name: "E-Temper",
category: "machines",
conduct: 1,
insulate: true,
behavior: behaviors.WALL,
onSelect: function(pixel){
prevNum = parseInt(prompt("Enter the temperature you want it set to.", (prevNum || undefined)));
},
tick: function(pixel){
if(pixel.start === pixelTicks){
pixel.clone = `Temp: ${prevNum}`;
pixel.Temp = prevNum;
}
for (var i = 0; i < adjacentCoords.length; i++){
let x = pixel.x + adjacentCoords[i][0];
let y = pixel.y + adjacentCoords[i][1];
if(outOfBounds(x,y)){ continue; }
if(isEmpty(x,y)){ continue; }
let pixel2 = pixelMap[x][y];
if (pixel2.temp < pixel.Temp && pixel.charge > 0 ){
pixel2.temp += pixel.Temp / 6;
}
}
},
}
let prevString;
elements.sign = {
name: "Sign",
category: "machines",
onSelect: function(){
prevString = prompt("Enter the text you want it to say.", (prevString || undefined));
},
tick: function(pixel){
if(pixel.start == pixelTicks){
pixel.clone = prevString;
}
}
}
runAfterLoad(function(){
document.body.innerHTML += `
these are all properties of the pixel. another way to find pixel properties is using debug on a pixel, it will tell you the property and the value, like x and y, or, in plants.js, fruit.
<table id="variables">
<thead>
<tr class="bold">
<th>
Variable
</th>
<th>
Definition
</th>
</tr>
</thead>
<tbody><tr>
<th>
p.color
</th>
<th>
The color of the pixel. it is defined as an RGB value.
</th>
</tr>
<tr>
<th>
p.x and p.y
</th>
<th>
The x and y positions of the pixel.
</th>
</tr>
<tr>
<th>
p.element
</th>
<th>
The element of the pixel.
</th>
</tr>
<tr>
<th>
p.clone
</th>
<th>
Specific to cloners, specifies what the cloner clones.
</th>
</tr>
<tr>
<th>
wc and lc
</th>
<th>
Specific to saplings, specifies what colour the wood is (wc) and what colour the leaves are (lc).
</th>
</tr>
<tr>
<th>
p.start
</th>
<th>
The start tick of the pixel.
</th>
</tr>
<tr>
<th>
p.tick
</th>
<th>
the amount of ticks that have happened so far in the game.
</th>
</tr>
</tbody></table>
`
document.getElementById("extraInfo").innerHTML = `
<small><a href="https://sandboxels.r74n.com/changelog" id="changelogButton" target="_blank">Changelog<span style="color:red">(NEW)</span></a> <a href="https://sandboxels.R74n.com/feedback" target="_blank" style="color:lime;">Feedback</a> <a href="https://sandboxels.wiki.gg/" target="_blank" id="wikiButton" title="Official Sandboxels Wiki - wiki.gg" style="color:white;">Wiki</a> <a id="moreSocial" href="https://reddit.com/r/Sandboxels" rel="me" target="_blank"><span style="color:#FF5700">Reddit</span></a> <a href="https://discord.gg/ejUc6YPQuS" target="_blank" style="color:#2f60ff;">Discord</a><span id="install-button" style="display: inline-block;">&nbsp; <a onclick="deferredPrompt.prompt(); return false" href="#" style="text-shadow: 0px 2px 10px #ff00ff; cursor:pointer">Install Offline</a> <a href = "https://sandboxels.r74n.com/#variables">Variables</a></span><!--<br><br><a style="color:lime" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSf8pVMSdC6oSnBSaTpzjPQa8Ef-vxG_eXL99UITnMSQtJFTJA/viewform?usp=sf_link">FILL OUT THE CENSUS<span style="color:red">(NEW)</span></a>--></small><small><p>v1.9.3 559 elements, with <span id="hiddenCount">0</span> hidden.</p><p>©2021-2024. <a href="https://sandboxels.R74n.com/license.txt" rel="license" target="_blank">All Rights Reserved</a>. <a style="color:#00ffff" rel="author" href="https://r74n.com">R74n</a></p></small>
`
});

1081
mods/plants.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -69,6 +69,7 @@ try {
width: width,
height: height,
pixelSize: pixelSize,
pixelTicks: pixelTicks,
settings: settings,
version: 1,
enabledMods: localStorage.enabledMods,
@ -322,6 +323,7 @@ try {
width = json.width;
height = json.height;
pixelSize = json.pixelSize;
pixelTicks = (json.pixelTicks ?? 0);
//currentPixels = json.currentPixels;
for(i = 0; i < json.pixelMap.length; i++) {
json.pixelMap[i] = json.pixelMap[i].map(x => zeroToNull(x));

View File

@ -3,7 +3,7 @@ elements.cooked_rice = {
tempMin: 20,
stateMin: "rice",
tempHigh: 500,
stateHigh: ["ash", "charcoal"],
stateHigh: "charcoal",
density: 699,
color: "#c2b6b6",
behavior: behaviors.LIQUID,
@ -16,37 +16,39 @@ elements.cooked_rice = {
elements.rice = {
breakInto: "flour",
viscosity: 10000,
isFood: true,
density: 696,
tempHigh: 232,
stateHigh: "cooked_rice",
color: "#c8c8c8",
behavior: behaviors.LIQUID,
behavior: behaviors.POWDER,
category: "food",
state: "liquid",
};
elements.moth = {
tempHigh: 500,
stateHigh: "ash",
stateHigh: "dead_bug",
breakInto: "dead_bug",
color: "#57381a",
behavior: behaviors.FLY,
category: "life",
state: "solid",
state: "liquid",
};
elements.cotton_candy = {
isFood: true,
tempHigh: 500,
stateHigh: "ash",
tempHigh: 200,
stateHigh: "sugar",
density: 1000,
color: "#b6c7e3",
color: ["#b6c7e3", "#c54b4b", "#e7769c"],
singleColor: true,
behavior: behaviors.POWDER,
category: "food",
state: "liquid",
reactions: {
"water": { elem1: "sugar", elem2: null },
"water": { elem1: "sugar", elem2: "water" },
"sugar_water": { elem1: "sugar", elem2:"sugar_water", chance: 10 }
}
};
@ -192,6 +194,8 @@ elements.green_berries = {
elements.meth = {
hardness: 1,
tempHigh: 500,
tempLow: -50,
stateLowColorMultiplier: 0.9,
stateHigh: "melted_meth",
color: "#0affef",
behavior: behaviors.POWDER,
@ -199,6 +203,18 @@ elements.meth = {
state: "liquid"
};
elements.melted_meth = {
viscosity: 1000,
tempHigh: 100000,
tempLow: -20,
stateHigh: "beans",
stateLow: "meth",
color: "#00a2ff",
behavior: behaviors.LIQUID,
category: "joke",
state: "solid",
};
elements.garlic = {
isFood: true,
tempHigh: 500,
@ -217,7 +233,7 @@ elements.garlic_bread = {
breakInto: "crumb",
tempHigh: 500,
stateHigh: "ash",
color: ["#db9b56", "#288a0c", "#db9b56", "#db9b56", "#db9b56", "#db9b56"],
color: ["#e9be90", "#288a0c", "#e0c6aa", "#b49e85", "#b6926b", "#ccac8b"],
behavior: behaviors.STURDYPOWDER,
category: "food",
state: "solid",
@ -249,6 +265,8 @@ elements.lemon = {
elements.lemonade = {
isFood: true,
tempHigh: 500,
tempLow: -15,
tempLowColor: "#f8eb35",
stateHigh: "steam",
color: "#fff41c",
behavior: behaviors.LIQUID,
@ -269,6 +287,18 @@ elements.poop = {
}
};
elements.diarrhea = {
hardness: 1,
viscosity: 10000,
tempHigh: 500,
stateHigh: ["ash", "ash", "ash", "ash", "ash", "ash", "ash", "steam",],
color: "#523718",
behavior: behaviors.LIQUID,
category: "joke",
state: "solid",
desc: "riddle me this, libshart, if theres liquid poop then wheres the solid piss?"
};
elements.marshmallow = {
isFood: true,
tempHigh: 50,
@ -330,6 +360,7 @@ elements.cereal = {
behavior: behaviors.STURDYPOWDER,
category: "food",
state: "liquid",
stain: 0.005
};
elements.sushi = {
@ -355,6 +386,7 @@ elements.diamond_ore = {
elements.coca_cola = {
isFood: true,
tempHigh: 500,
tempLow: -10,
stateHigh: "steam",
color: "#381e13",
behavior: behaviors.LIQUID,
@ -365,6 +397,7 @@ elements.coca_cola = {
elements.pepsi = {
tempHigh: 500,
stateHigh: "steam",
tempLow: -10,
color: "#2b1717",
behavior: behaviors.LIQUID,
category: "liquids",
@ -374,6 +407,7 @@ elements.pepsi = {
elements.piss = {
tempHigh: 500,
stateHigh: "steam",
tempLow: -10,
color: "#ffff00",
behavior: behaviors.LIQUID,
category: "joke",
@ -405,17 +439,10 @@ elements.pastry = {
state: "solid",
};
elements.melted_meth = {
tempHigh: 100000,
stateHigh: "beans",
color: "#00a2ff",
behavior: behaviors.LIQUID,
category: "joke",
state: "solid",
};
elements.expired_milk = {
elements.spoiled_milk = {
tempHigh: 500,
tempLow: -20,
stateHigh: "ash",
color: "#b8c2b4",
behavior: behaviors.LIQUID,
@ -523,6 +550,8 @@ elements.mashed_pea = {
elements.burnt_beans = {
tempHigh: 500,
stateHigh: "ash",
tempLow: -0,
stateLow: "beans",
isFood: true,
viscosity: 10000,
density: 721,
@ -801,6 +830,7 @@ elements.barbecue_sauce = {
viscosity: 3000,
density: 1800,
tempHigh: 500,
tempLow: 0,
stateHigh: "steam",
color: "#420400",
behavior: behaviors.LIQUID,
@ -907,6 +937,7 @@ elements.porridge = {
viscosity: 3000,
density: 500,
tempHigh: 500,
tempLow: -10,
stateHigh: "steam",
color: "#b8a254",
behavior: behaviors.LIQUID,
@ -938,7 +969,7 @@ elements.chocolate_grape = {
viscosity: 10000,
tempHigh: 300,
stateHigh: "steam",
color: ["#9e3475", "#6e4d36"],
color: ["#7e600d", "#6e4d36"],
behavior: behaviors.LIQUID,
category: "food",
state: "liquid",
@ -949,7 +980,7 @@ elements.sprinkles = {
stateHigh: "ash",
cooldown: 0.2,
color: ["#ff5e5e", "#ffea5e", "#73ff5e", "#5efcff", "#995eff", "#ff5ed1"],
behavior: behaviors.STURDYPOWDER,
behavior: behaviors.POWDER,
category: "powders",
state: "liquid",
maxSize: 1,
@ -965,6 +996,7 @@ elements.incinerator = {
category: "machines",
state: "solid",
insulate: true,
excludeRandom: true,
reactions: {
"fart": { elem1: null, elem2: "ohio" },
}
@ -1113,6 +1145,7 @@ elements.strawberry = {
elements.beer = {
tempHigh: 300,
stateHigh: "steam",
tempLow: -10,
color: "#b39329",
behavior: behaviors.LIQUID,
category: "liquids",
@ -1140,8 +1173,10 @@ elements.carrot = {
};
elements.wine = {
hidden: true,
tempHigh: 400,
stateHigh: "steam",
tempLow: -10,
color: "#2e0206",
behavior: behaviors.LIQUID,
category: "liquids",
@ -1173,6 +1208,7 @@ elements.dark_energy = {
],
category: "special",
state: "gas",
excludeRandom: true
};
elements.ohio = {
@ -1189,6 +1225,7 @@ elements.ohio = {
category: "joke",
state: "gas",
desc: "use at own risk",
excludeRandom: true
};
elements.papaya = {
@ -1279,6 +1316,9 @@ elements.heavy_water = {
behavior: behaviors.LIQUID_OLD,
category: "liquids",
state: "liquid",
reactions: {
"sand": { elem1: null, elem2: "quicksand" },
}
};
elements.blood_orange = {
@ -1308,6 +1348,7 @@ elements.cranberry = {
hidden: true,
tempHigh: 300,
stateHigh: "steam",
tempLow: -15,
color: "#ad2a1d",
behavior: behaviors.LIQUID,
category: "food",
@ -1441,6 +1482,7 @@ elements.uraniumaniumaniumaniumanium_popcornicecream_plutoniumeptunium_238239 =
elements.coffee_milk = {
tempHigh: 300,
stateHigh: "steam",
tempLow: -30,
color: "#5c4c42",
behavior: behaviors.LIQUID,
category: "liquids",
@ -1565,6 +1607,7 @@ elements.electron = {
};
elements.sned = {
desc: "slowly expanding...",
color: "#dfe0d9",
behavior: [
"XX|XX AND CR:sned%1|XX",
@ -1580,7 +1623,7 @@ elements.uranium_tea = {
temp: 60,
tempHigh: 400,
stateHigh: "molten_uranium",
color: ["#0f8b15", "#316624", "#59864b", "#502e0f"],
color: ["#526306", "#40530c", "#80320e", "#502e0f"],
behavior: behaviors.RADLIQUID,
category: "liquids",
state: "liquid"
@ -1598,19 +1641,19 @@ elements.powerlaser = {
if (Math.random() > 0.05) { continue }
createPixel("flash", x, y);
pixelMap[x][y].color = "#b80ced";
pixelMap[x][y].temp = 1001000;
pixelMap[x][y].temp = 11000;
}
else {
if (elements[pixelMap[x][y].element].isGas) { continue }
if (elements[pixelMap[x][y].element].id === elements.heat_ray.id) { break }
pixelMap[x][y].temp += 901000;
pixelMap[x][y].temp += 9000;
pixelTempCheck(pixelMap[x][y]);
break;
}
}
deletePixel(pixel.x, pixel.y);
},
temp: 1000000,
temp: 10000,
category: "energy",
state: "gas",
excludeRandom: true,
@ -1629,6 +1672,70 @@ elements.magma_bomb = {
state: "liquid"
};
elements.quicksand = {
viscosity: 10000,
tempHigh: 1000,
stateHigh: ["molten_glass", "molten_glass", "molten_glass", "molten_glass", "steam"],
color: ["#b1873a", "#cea250"],
behavior: behaviors.LIQUID,
category: "land",
state: "liquid",
density: 1400,
stain: 0.02
};
elements.liquid_filler = {
color: "#ae00ff",
behavior: [
"XX|XX AND CR:liquid_filler%50|XX",
"M2 AND CR:liquid_filler%50|XX|M2 AND CR:liquid_filler%50",
"M1|M1 AND CH:liquid_filler%50|M1",
],
category: "special",
state: "liquid"
};
elements.antimony = {
color: ["#4b90b8", "#a3bfd8", "#89a0b6", "#8798a7", "#738092"],
behavior: behaviors.WALL,
category: "solids",
state: "solid",
density: 6697,
tempHigh: 630,
stateHigh: "melted_antimony",
alias: "...sb?!"
};
elements.melted_antimony = {
color: ["#8fb2c7", "#7494b1", "#72a1cc", "#a3aaaf", "#a4aab3"],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 6697,
stain: 0.1,
tempLow: -270,
stateLowName: "antimony_ice"
};
elements.unstain = {
color: "#729fff",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|XX|XX"
],
stain: -1,
tool: (pixel) => {
doStaining({
element: "unstain",
x: pixel.x,
y: pixel.y
})
},
category: "tools",
state: "solid",
};
elements.incinerate.category = "tools",
elements.cook.category = "tools",
elements.room_temp.category = "tools",
@ -1663,6 +1770,9 @@ elements.potato.reactions.steam = {elem1: "fries", tempMin: 100, chance:50}
if (!elements.water.reactions) elements.water.reactions = {};
elements.water.reactions.cocaine = { elem1: "solid_water", elem2: null }
if (!elements.alcohol.reactions) elements.alcohol.reactions = {};
elements.alcohol.reactions.juice = {elem1:"wine", elem2:null, chance:5}
if (!elements.paper.reactions) elements.paper.reactions = {};
elements.paper.reactions.bless = { elem1: "robux", elem2: null, chance: 0.0000001 }

View File

@ -1,3 +1 @@
for (var element in elements) {
elements[element].singleColor = true;
}
window.addEventListener('load', function() {for (var element in elements) {elements[element].singleColor = true;}});