Merge branch 'main' of https://github.com/R74nCom/sandboxels
This commit is contained in:
commit
23a26d24d5
|
|
@ -263,6 +263,7 @@
|
|||
<tr><td>volcanic_expansion.js</td><td>Adds Obsidian, Pumice, and Andesite rocks</td><td>Jayd</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
|
||||
<tr><td>10kelements.js</td><td>Inserts a customizable amount of randomly generated elements into the game</td><td>nousernamefound</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>Adora</td></tr>
|
||||
<tr><td>amogus.js</td><td>Adds a small amogus structure</td><td>Alice</td></tr>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,31 @@
|
|||
var color = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e","f"]
|
||||
var states = ["solid", "liquid", "gas"]
|
||||
var total = 0
|
||||
var dangerouselements = ["supernova", "n_explosion", "pn_explosion", "armageddon", "nuke", "h_bomb"]
|
||||
var elementslist = []
|
||||
for (elementi in elements){
|
||||
elementslist.push(elementi)
|
||||
}
|
||||
elements.change_count = {
|
||||
color: "#34eb86",
|
||||
canPlace: false,
|
||||
behavior: behaviors.SELFDELETE,
|
||||
onSelect: function() {
|
||||
var cans = prompt("Please input how many elements you would like to be generared each time.", 10000);
|
||||
if (!cans) { return }
|
||||
if (cans > 2000000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
|
||||
if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return}
|
||||
if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
|
||||
settings.randomcount = parseInt(cans)
|
||||
saveSettings()
|
||||
},
|
||||
category: "random"
|
||||
}
|
||||
var choosebehaviors = behaviors
|
||||
delete choosebehaviors.KILLPIXEL2
|
||||
delete choosebehaviors.KILLPIXEL1
|
||||
if (!settings.randomcount){settings.randomcount = 10000; saveSettings()}
|
||||
var color = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e","f"]
|
||||
var states = ["solid", "liquid", "gas"]
|
||||
var essentialelements = ["molten_gallium", "gallium", "gallium_gas", "change_count"]
|
||||
var total = 0
|
||||
var dangerouselements = ["supernova", "n_explosion", "pn_explosion", "armageddon", "nuke", "h_bomb"]
|
||||
function randomIntFromInterval(min, max) { // min and max included
|
||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||
}
|
||||
|
|
@ -13,41 +33,70 @@ var randomProperty = function (obj) {
|
|||
var keys = Object.keys(obj);
|
||||
return obj[keys[ keys.length* Math.random() << 0]];
|
||||
};
|
||||
for (var i = 1; i <= 10000; i++){
|
||||
var f = Math.random() < 0.2
|
||||
var co = Math.random() < 0.2
|
||||
elements["element_"+i] = {
|
||||
color: "#" + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)],
|
||||
category: "random",
|
||||
behavior: randomProperty(behaviors),
|
||||
state: states[Math.floor(Math.random()*states.length)],
|
||||
reactions: {},
|
||||
density: randomIntFromInterval(1, 10000)
|
||||
if (Math.abs(settings.randomcount) == settings.randomcount){
|
||||
for (var i = 1; i <= settings.randomcount; i++){
|
||||
var f = Math.random() < 0.2
|
||||
var co = Math.random() < 0.2
|
||||
elements["element_"+i] = {
|
||||
color: "#" + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)],
|
||||
category: "random",
|
||||
behavior: randomProperty(choosebehaviors),
|
||||
state: states[Math.floor(Math.random()*states.length)],
|
||||
reactions: {},
|
||||
density: randomIntFromInterval(1, 10000)
|
||||
}
|
||||
total = i
|
||||
if (f){
|
||||
elements["element_"+i].tempHigh = 20 + randomIntFromInterval(10, 6000)
|
||||
elements["element_"+i].stateHigh = elementslist[Math.floor(Math.random()*elementslist.length)]
|
||||
}
|
||||
if (co){
|
||||
elements["element_"+i].tempLow = 20 - randomIntFromInterval(10, 270)
|
||||
elements["element_"+i].stateLow = elementslist[Math.floor(Math.random()*elementslist.length)]
|
||||
}
|
||||
for (r = 0; r < 10; r++){
|
||||
elements["element_"+i].reactions[elementslist[Math.floor(Math.random()*elementslist.length)]] = { elem1: elementslist[Math.floor(Math.random()*elementslist.length)], elem2: elementslist[Math.floor(Math.random()*elementslist.length)]}
|
||||
}
|
||||
// console.log(i + " is done!")
|
||||
// console.log(i)
|
||||
// console.log(elements["element_"+i].behavior)
|
||||
if (elements["element_" + i].density == i){
|
||||
console.log(i + "is unique because its density is the same as its id!")
|
||||
}
|
||||
total = i
|
||||
if (f){
|
||||
elements["element_"+i].tempHigh = 20 + randomIntFromInterval(10, 6000)
|
||||
elements["element_"+i].stateHigh = elementslist[Math.floor(Math.random()*elementslist.length)]
|
||||
}
|
||||
if (co){
|
||||
elements["element_"+i].tempLow = 20 - randomIntFromInterval(10, 270)
|
||||
elements["element_"+i].stateLow = elementslist[Math.floor(Math.random()*elementslist.length)]
|
||||
}
|
||||
for (r = 0; r < 10; r++){
|
||||
elements["element_"+i].reactions[elementslist[Math.floor(Math.random()*elementslist.length)]] = { elem1: elementslist[Math.floor(Math.random()*elementslist.length)], elem2: elementslist[Math.floor(Math.random()*elementslist.length)]}
|
||||
}
|
||||
// console.log(i + " is done!")
|
||||
// console.log(i)
|
||||
// console.log(elements["element_"+i].behavior)
|
||||
if (elements["element_" + i].density == i){
|
||||
console.log(i + "is unique because its density is the same as its id!")
|
||||
}
|
||||
for (var reaction in elements["element_" + i].reactions){
|
||||
if (dangerouselements.includes(elements["element_" + i].reactions[reaction].elem1)|| dangerouselements.includes(elements["element_" + i].reactions[reaction].elem2)){
|
||||
console.log(i + " is scary due to its reaction with " + reaction)
|
||||
if (!elements["element_"+i].desc){
|
||||
elements["element_" + i].desc = "This is scary! Don't let it touch " + reaction
|
||||
}else(elements["element_"+i].desc += (" or " + reaction))
|
||||
for (var reaction in elements["element_" + i].reactions){
|
||||
if (dangerouselements.includes(elements["element_" + i].reactions[reaction].elem1)|| dangerouselements.includes(elements["element_" + i].reactions[reaction].elem2)){
|
||||
console.log(i + " is scary due to its reaction with " + reaction)
|
||||
if (!elements["element_"+i].desc){
|
||||
elements["element_" + i].desc = "This is scary! Don't let it touch " + reaction
|
||||
}else(elements["element_"+i].desc += (" or " + reaction))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
window.addEventListener('load', function() {
|
||||
elementslist = []
|
||||
for (elementi in elements){
|
||||
elementslist.push(elementi)
|
||||
}
|
||||
var eLen = elementslist.length
|
||||
const p = document.createElement("p");
|
||||
p.innerText = `v${currentversion} • ` +(eLen - Math.abs(settings.randomcount)) +` elements, with 0 hidden`;
|
||||
document.getElementById("extraInfo").querySelectorAll("small")[1].replaceChildren(p);
|
||||
if (Math.abs(settings.randomcount) > elementslist.length){
|
||||
console.log("mode 1")
|
||||
for (var elementi in elements){
|
||||
if(!essentialelements.includes(elementi)){
|
||||
document.getElementById("elementButton-" + elementi)?.remove()
|
||||
console.log(elementi)
|
||||
}
|
||||
}
|
||||
} else for (var i = 1; i <= Math.abs(settings.randomcount); i++){
|
||||
var elementi = elementslist[Math.floor(Math.random()*elementslist.length)]
|
||||
if(!essentialelements.includes(elementi)){
|
||||
elementslist.splice(elementslist.indexOf(elementi), 1)
|
||||
document.getElementById("elementButton-" + elementi)?.remove()
|
||||
console.log(elementi)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
113
mods/Thread.js
113
mods/Thread.js
|
|
@ -1,23 +1,25 @@
|
|||
elements.thread = {
|
||||
color: "#fff3e6",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
behavior: behaviors.SUPPORTPOWDER,
|
||||
category: "thread",
|
||||
state: "solid",
|
||||
tempHigh: "50",
|
||||
stateHigh: "ash",
|
||||
hardness: "0.2",
|
||||
breakInto: "wool"
|
||||
breakInto: "wool",
|
||||
density: " 1314",
|
||||
burn: "99",
|
||||
burnTime: "40"
|
||||
burnTime: "40",
|
||||
burnInto: "ash",
|
||||
reactions: {
|
||||
"weavepowder": { elem1: null, elem2: "rope" },
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
elements.wool = {
|
||||
color: "#e2e1d8",
|
||||
behavior: behaviors.POWDER,
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "thread",
|
||||
state: "solid",
|
||||
tempHigh: "40",
|
||||
|
|
@ -25,11 +27,12 @@ elements.wool = {
|
|||
hardness: "1",
|
||||
density: " 1314",
|
||||
burn: "90",
|
||||
burnTime: "40"
|
||||
burnTime: "40",
|
||||
burnInto: "ash",
|
||||
reactions: {
|
||||
"weavepowder": { elem1: null, elem2: "thread" },
|
||||
};
|
||||
}
|
||||
}
|
||||
elements.weavepowder = {
|
||||
color: "#494736",
|
||||
behavior: behaviors.POWDER,
|
||||
|
|
@ -40,23 +43,105 @@ elements.weavepowder = {
|
|||
hardness: "1",
|
||||
density: " 1314",
|
||||
burn: "0",
|
||||
burnTime: "0"
|
||||
burnTime: "0",
|
||||
burnInto: "dust",
|
||||
reactions: {
|
||||
"wool": { elem1: thread, elem2: "null" },
|
||||
"thread": { elem1: rope, elem2: "null" },
|
||||
};
|
||||
"wool": { elem1: "thread", elem2: null },
|
||||
"thread": { elem1: "rope", elem2: null },
|
||||
}
|
||||
|
||||
}
|
||||
elements.rope = {
|
||||
color: "#ffe6cc",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
behavior: behaviors.SUPPORT,
|
||||
category: "thread",
|
||||
state: "solid",
|
||||
tempHigh: "60",
|
||||
stateHigh: "ash",
|
||||
hardness: "0.4",
|
||||
breakInto: "thread"
|
||||
breakInto: "thread",
|
||||
density: " 1314",
|
||||
burn: "85",
|
||||
burnTime: "50"
|
||||
burnTime: "50",
|
||||
burnInto: "ash",
|
||||
}
|
||||
elements.sheep = {
|
||||
color: ["#FFFFE8", "#F4FFFF", "#FFF7F2","#796464","#282828"],
|
||||
behavior: [
|
||||
"M2%1|M2%1|M2%1",
|
||||
"M2%3|XX|M2%3",
|
||||
"XX|M1|XX",
|
||||
],
|
||||
reactions: {
|
||||
"grass": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
|
||||
"dead_plant": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
|
||||
"plant": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
|
||||
"oxygen": { elem2:"carbon_dioxide", chance:0.3 },
|
||||
"mercury": { elem1:"rotten_meat", chance:0.1 },
|
||||
"bleach": { elem1:"rotten_meat", chance:0.1 },
|
||||
"infection": { elem1:"rotten_meat", chance:0.025 },
|
||||
"uranium": { elem1:"rotten_meat", chance:0.1 },
|
||||
"cyanide": { elem1:"rotten_meat", chance:0.1 },
|
||||
"chlorine": { elem1:"meat", chance:0.1 },
|
||||
"alcohol": { elem1:"meat", chance:0.025 },
|
||||
"dirty_water": { elem1:"rotten_meat", chance:0.0001 },
|
||||
"pool_water": { elem1:"rotten_meat", chance:0.005 },
|
||||
"vinegar": { elem1:"rotten_meat", chance:0.001 },
|
||||
"body": { elem1:["wool","sheep"], chance:0.1 },
|
||||
},
|
||||
egg: "lamb",
|
||||
foodNeed: 10,
|
||||
temp: 30,
|
||||
tempHigh: 100,
|
||||
stateHigh: "cooked_meat",
|
||||
tempLow: -18,
|
||||
stateLow: "frozen_meat",
|
||||
category:"life",
|
||||
breakInto: ["meat", "wool"],
|
||||
burn:15,
|
||||
burnTime:300,
|
||||
state: "solid",
|
||||
density: 1450,
|
||||
conduct: 0.2
|
||||
};
|
||||
|
||||
elements.lamb = {
|
||||
color: ["#FFFFE8", "#F4FFFF", "#FFF7F2","#796464","#282828"],
|
||||
state: "solid",
|
||||
behavior: [
|
||||
"M2%1|M2%2|M2%1",
|
||||
"M2%4|FX%5 AND CH:sheep%0.1|M2%4",
|
||||
"XX|M1|XX",
|
||||
],
|
||||
reactions: {
|
||||
"grass": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"dead_plant": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"plant": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"oxygen": { elem2:"carbon_dioxide", chance:0.3 },
|
||||
"mercury": { elem1:"rotten_meat", chance:0.1 },
|
||||
"bleach": { elem1:"rotten_meat", chance:0.1 },
|
||||
"infection": { elem1:"rotten_meat", chance:0.025 },
|
||||
"uranium": { elem1:"rotten_meat", chance:0.1 },
|
||||
"cyanide": { elem1:"rotten_meat", chance:0.1 },
|
||||
"chlorine": { elem1:"meat", chance:0.1 },
|
||||
"alcohol": { elem1:"meat", chance:0.025 },
|
||||
"dirty_water": { elem1:"rotten_meat", chance:0.0001 },
|
||||
"pool_water": { elem1:"rotten_meat", chance:0.005 },
|
||||
"vinegar": { elem1:"rotten_meat", chance:0.001 },
|
||||
"body": { elem1:["wool","sheep"], chance:0.1 },
|
||||
},
|
||||
egg: "lamb",
|
||||
foodNeed: 20,
|
||||
temp: 30,
|
||||
tempHigh: 100,
|
||||
stateHigh: "cooked_meat",
|
||||
tempLow: -18,
|
||||
stateLow: "frozen_meat",
|
||||
category:"life",
|
||||
breakInto: ["meat","wool"],
|
||||
burn:15,
|
||||
burnTime:300,
|
||||
state: "solid",
|
||||
density: 1450,
|
||||
conduct: 0.2
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
console.log("Thanks for using UAMM!")
|
||||
|
||||
elements.rubidium = {
|
||||
color: ["#b5b5b5", "#c9c9c9", "#d6cccb"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
tempHigh: 39.3,
|
||||
stateHigh: "liquid_rubidium",
|
||||
density: 1532,
|
||||
tick: function (pixel){
|
||||
var foundelem1 = false
|
||||
var foundelem2 = false
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if(!isEmpty(x, y, true)){
|
||||
var otherPixel = pixelMap[x][y]
|
||||
if (otherPixel.element == "liquid_ammonia"){foundelem1 = true; break}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if(!isEmpty(x, y, true)){
|
||||
var otherPixel = pixelMap[x][y]
|
||||
if (otherPixel.element == "oxygen"){foundelem2 = true; break}
|
||||
}
|
||||
}
|
||||
if (foundelem1 && foundelem2){changePixel(pixel, "rubidium_peroxide", false)}
|
||||
},
|
||||
reactions: {
|
||||
"water": {elem1: "pop", elem2: "hydrogen", temp2: 400},
|
||||
"oxygen": {elem1: "rubidium_superoxide", elem2: null, chance: 0.3}
|
||||
}
|
||||
};
|
||||
|
||||
elements.liquid_rubidium = {
|
||||
color: ["#cccccc", "#ebe8e8", "#f2e7e6"],
|
||||
behavior: behaviors.LIQUID,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
tempLow: 38,
|
||||
stateLow: "rubidium",
|
||||
density: 1475,
|
||||
reactions: {
|
||||
"water": {elem1: "pop", elem2: "hydrogen", temp2: 400}
|
||||
}
|
||||
}
|
||||
|
||||
elements.rubidium_superoxide = {
|
||||
color: ["#eded00", "#ffff26", "#e3e33d"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
tempHigh: 340,
|
||||
stateHigh: "rubidium_peroxide",
|
||||
density: 1532,
|
||||
reactions: {
|
||||
"water": {elem2: null}
|
||||
}
|
||||
};
|
||||
|
||||
elements.rubidium_peroxide = {
|
||||
color: ["#fffed9", "#ffffe8", "#edede4"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 1532,
|
||||
reactions: {
|
||||
"water": {elem2: null}
|
||||
}
|
||||
};
|
||||
|
||||
elements.cesium = {
|
||||
color: ["#e3a814", "#dbab32", "#e8bc4f", "#fabf2d"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
fireColor: "#8c21de",
|
||||
burn: 1,
|
||||
burnTime: 500,
|
||||
tempHigh: 29,
|
||||
stateHigh: "liquid_cesium",
|
||||
density: 1873,
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: "pop", elem2: ["smoke", "fire"], temp2: 22},
|
||||
"fire": {elem1: ["smoke", "pop"]}
|
||||
}
|
||||
};
|
||||
|
||||
elements.liquid_cesium = {
|
||||
color: ["#ebb121", "#edbd42", "#f5cb62", "#fcd26a"],
|
||||
behavior: behaviors.LIQUID,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
tempLow: 28,
|
||||
stateLow: "cesium",
|
||||
density: 1842,
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: "pop", elem2: ["smoke", "fire"], temp2: 22},
|
||||
"radiation": {elem1: "liquid_radiocesium", elem2: "smoke", chance: 0.65}
|
||||
}
|
||||
};
|
||||
|
||||
elements.radiocesium = {
|
||||
color: ["#c7bda5", "#ada287", "#99958b", "#d1ccc0"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%1|XX",
|
||||
"CR:radiation%1|XX|CR:radiation%1",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
fireColor: "#8c21de",
|
||||
burn: 1,
|
||||
burnTime: 500,
|
||||
tempHigh: 29,
|
||||
stateHigh: "liquid_radiocesium",
|
||||
density: 1873,
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: ["rad_steam", "fallout"], elem2: "explosion"}
|
||||
}
|
||||
}
|
||||
|
||||
elements.liquid_radiocesium = {
|
||||
color: ["#e8dcc1", "#d4c6a5", "#bfbaae", "#f5f1e9"],
|
||||
behavior: behaviors.RADMOLTEN,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
tempLow: 28,
|
||||
stateLow: "radiocesium",
|
||||
density: 1842,
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: ["rad_steam", "fallout"], elem2: "explosion"}
|
||||
}
|
||||
}
|
||||
|
||||
elements.lithium = {
|
||||
color: ["#e3a814", "#dbab32", "#e8bc4f", "#fabf2d"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
fireColor: "#8c21de",
|
||||
burn: 1,
|
||||
burnTime: 500,
|
||||
tempHigh: 29,
|
||||
stateHigh: "liquid_cesium",
|
||||
density: 534,
|
||||
}
|
||||
|
|
@ -4,125 +4,185 @@
|
|||
* Don't see your favorite dessert? Let me know!
|
||||
*
|
||||
* Got questions? Contact tisqbisque on Discord!
|
||||
*
|
||||
* This version: 1.1
|
||||
*/
|
||||
// Dulce de leche items - BASE COMPLETE
|
||||
|
||||
// Dulce de leche items
|
||||
elements.dulce_de_leche = {
|
||||
alias: "manjar",
|
||||
color: ["#c56600","#f7a204","#ca6400","#893604"],
|
||||
category: "Community",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
state: "liquid",
|
||||
behavior: behaviors.LIQUID,
|
||||
reactions: {
|
||||
"cream_cheese": { elem1:"dulce_de_leche", elem2:null, color1:["#DFAB73","#fbcc75","#e2aa73","#be9075"], oneway:true }, // for recipe accuracy :3
|
||||
},
|
||||
tempLow: -20,
|
||||
stateLow: "candy",
|
||||
tempHigh: 250,
|
||||
stateHigh: ["fragrance","smoke","smoke"],
|
||||
viscosity: 500,
|
||||
stain: 0.02,
|
||||
density: 1284.93,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. From undexconocidox_26419.\n"
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by heating Sweetened Condensed Milk at 175°C+.\nFrom undexconocidox_26419.\n"
|
||||
}
|
||||
elements.sweetened_condensed_milk = {
|
||||
color: ["#ffe9ba","#fbd396","#fde2a9"],
|
||||
category: "Community",
|
||||
state: "liquid",
|
||||
behavior: behaviors.LIQUID,
|
||||
tempLow: 0,
|
||||
stateLow: ["ice_cream","sugar"],
|
||||
tempHigh: 175,
|
||||
stateHigh: "dulce_de_leche",
|
||||
viscosity: 5,
|
||||
stain: 0.015,
|
||||
density: 1050.83,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by mixing Milk and Sugar at 85°C+.\n",
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by mixing Milk and Sugar at 85°C+.\n",
|
||||
}
|
||||
|
||||
// Chocotorta items - BASE COMPLETE
|
||||
// Chocotorta items
|
||||
elements.cream_cheese = {
|
||||
color: ["#ebe9ea","#e4dfdd","#eeeeee"],
|
||||
category: "Community",
|
||||
behavior: behaviors.SUPPORTPOWDER,
|
||||
state: "solid",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
//reactions: {
|
||||
// For future use
|
||||
//},
|
||||
tempHigh: 65,
|
||||
stateHigh: "melted_cheese",
|
||||
stateHighColor: ["#fbffff","#f6f6f6"],
|
||||
hardness: 0.01,
|
||||
density: 980.61,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by mixing Acid with Milk or Cream.\n",
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by mixing Acid with Milk or Cream.\n",
|
||||
}
|
||||
elements.cocoa_bean = {
|
||||
color: ["#e16f51","#e28e67","#e18550","#84574d"],
|
||||
category: "Community",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
state: "solid",
|
||||
behavior: behaviors.POWDER,
|
||||
// Has no reactions
|
||||
breakInto: "cocoa_powder",
|
||||
density: 593,
|
||||
tempHigh: 179.4,
|
||||
stateHigh: "dead_plant",
|
||||
tempLow: -2,
|
||||
stateLow: "frozen_plant",
|
||||
// not hidden by default
|
||||
// not food don't eat it
|
||||
desc: "Added in the first version of the mod.\n",
|
||||
}
|
||||
elements.cocoa_powder = {
|
||||
color: ["#855344","#6d4c41","#40271d"],
|
||||
category: "Community",
|
||||
state: "solid",
|
||||
behavior: behaviors.POWDER,
|
||||
onMix: function(powder, doughcheck) {
|
||||
if (doughcheck.name == "dough" && shiftDown && Math.random() < 0.01) {
|
||||
changePixel(powder,"chocolate_biscuit_dough");
|
||||
if (elements[doughcheck.element].id == elements.dough.id && shiftDown && Math.random() < 0.25) {
|
||||
deletePixel(powder.x,powder.y);
|
||||
changePixel(doughcheck,"chocolate_biscuit_dough");
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"dough": { elem1:null, elem2:"chocolate_biscuit_dough" },
|
||||
},
|
||||
category: "Community",
|
||||
density: 363.5,
|
||||
tempHigh: 50,
|
||||
stateHigh: "smoke",
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by Smashing Cocoa Bean.\n",
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by Smashing Cocoa Bean.\n",
|
||||
}
|
||||
elements.chocolate_biscuit_dough = {
|
||||
name: "choco_Biscuit_Dough",
|
||||
color: "#623727",
|
||||
category: "Community",
|
||||
state: "solid",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 94,
|
||||
stateHigh: "chocolate_biscuit",
|
||||
burn: 40,
|
||||
burnTime: 25,
|
||||
burnInto: "ash",
|
||||
state: "solid",
|
||||
density: 526.9,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by mixing Cocoa Powder with Dough.\n",
|
||||
desc: "Added in the first version of the mod.\nMade by hard mixing Cocoa Powder with Dough.\n",
|
||||
}
|
||||
elements.chocolate_biscuit = {
|
||||
name: "choco_Biscuit",
|
||||
color: "#864B36",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 550,
|
||||
stateHigh: ["smoke","smoke","smoke","ash"],
|
||||
breakInto: "crumb",
|
||||
category: "Community",
|
||||
state: "solid",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
breakInto: "crumb",
|
||||
breakIntoColor: ["#af8264","#b28461","#aa7852","#a8744b"],
|
||||
tempHigh: 232.2,
|
||||
stateHigh: ["smoke","smoke","smoke","ash"],
|
||||
density: 233.96,
|
||||
isFood: true,
|
||||
category: "Community",
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by cooking Choco Biscuit Dough at 94°C+. Can be layered with other items to make chocotorta, from undexconocidox_26419.\n",
|
||||
desc: "Added in the first version of the mod.\nMade by cooking Choco Biscuit Dough at 94°C+.\nCan be layered with other items to make chocotorta, from undexconocidox_26419.\n",
|
||||
}
|
||||
|
||||
// Haupia items - BASE COMPLETE
|
||||
// Haupia items
|
||||
elements.coconut = {
|
||||
color: ["#793b1e","#995c31","#5f3015"],
|
||||
category: "Community",
|
||||
state: "solid",
|
||||
behavior: behaviors.POWDER,
|
||||
breakInto: ["coconut_milk","tinder"],
|
||||
category: "Community",
|
||||
tempHigh: 225,
|
||||
stateHigh: ["steam","ash","smoke"],
|
||||
density: 822,
|
||||
desc: "Added in the first version of the mod.\n",
|
||||
}
|
||||
elements.coconut_milk = {
|
||||
color: ["#f3f3f3","#e4ddcb","#f8f8f8"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "Community",
|
||||
state: "liquid",
|
||||
behavior: behaviors.LIQUID,
|
||||
reactions: {
|
||||
"sugar": { elem1:null, elem2:"haupia_mix", tempMin:90 },
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: "steam",
|
||||
tempLow: -0.5,
|
||||
stateLowName: "coconut_ice",
|
||||
viscosity: 1.8,
|
||||
density: 1031.33,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by smashing Coconut.\n",
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by smashing Coconut.\n",
|
||||
}
|
||||
elements.haupia_mix = {
|
||||
color: ["#f3f3f3","#e4ddcb","#f8f8f8"],
|
||||
behavior: behaviors.LIQUID,
|
||||
tempLow: 3,
|
||||
category: "Community",
|
||||
state: "liquid",
|
||||
behavior: behaviors.LIQUID,
|
||||
tempHigh: 105,
|
||||
stateHigh: "steam",
|
||||
tempLow: 3,
|
||||
stateLow: "haupia",
|
||||
viscosity: 2.3,
|
||||
density: 1242.67,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by mixing Coconut Milk and Sugar at 90°C+.\n",
|
||||
desc: "Added in the first version of the mod.\nMade by mixing Coconut Milk and Sugar at 90°C+.\n",
|
||||
}
|
||||
elements.haupia = {
|
||||
color: ["#ffffff","#f8f8f8","#f7f9f8"],
|
||||
behavior: behaviors.SUPPORT,
|
||||
density: 1300,
|
||||
category: "Community",
|
||||
state: "solid",
|
||||
behavior: behaviors.SUPPORT,
|
||||
tempHigh: 105,
|
||||
stateHigh: ["steam","fragrance"],
|
||||
density: 1300,
|
||||
hidden: true,
|
||||
desc: "Added in the first version of the mod. Made by cooling Haupia Mix at 3°C-. From tisqbisque.\n"
|
||||
isFood: true,
|
||||
desc: "Added in the first version of the mod.\nMade by cooling Haupia Mix at 3°C-.\nFrom tisqbisque.\n"
|
||||
}
|
||||
|
||||
// Adjusting existing elements here
|
||||
|
|
|
|||
|
|
@ -256,9 +256,13 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
|
|||
}
|
||||
|
||||
// ugly way of doing it but probably works
|
||||
// it didnt - me 8 months later
|
||||
const checkType = (key, value) => {
|
||||
if (key == "behavior" && (typeof value == "function" || (value instanceof Array && value.filter(e => typeof e == "string").length == value.length))) return true;
|
||||
else if (key == "behavior") return false;
|
||||
if (key == "behavior") {
|
||||
const constructed = constructBehavior(value);
|
||||
if (constructed == undefined || (Array.isArray(constructed) && constructed.some(a => typeof a != "string"))) return false;
|
||||
return true;
|
||||
}
|
||||
if (["darkText", "hidden", "insulate", "noMix", "isFood", "forceAutoGen", "customColor", "ignoreAir", "excludeRandom", "burning", "flipX", "flipY", "flippableX", "flippableY"].includes(key) && typeof value != "boolean") return false;
|
||||
if (["name", "category", "desc", "alias", "seed", "baby", "state", "stateHigh", "stateHighName", "stateHighColor", "stateLow", "stateLowNmae", "stateLowColor"].includes(key) && typeof value != "string") return false;
|
||||
if (["id", "burn", "burnTime", "stateHighColorMultiplier", "stateLowColorMutliplier", "temp", "tempHigh", "extraTempHigh", "tempLow", "extraTempLow"].includes(key) && typeof value != "number") return false;
|
||||
|
|
@ -269,24 +273,29 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
|
|||
return true;
|
||||
}
|
||||
|
||||
const constructBehavior = (behavior) => {
|
||||
if (typeof behavior == "function" || Array.isArray(behavior)) return behavior;
|
||||
if (typeof behavior != "string") return undefined;
|
||||
return behavior.split(";");
|
||||
}
|
||||
|
||||
const loadChanges = () => {
|
||||
const newElements = Storage.get("elements", []);
|
||||
for (const element of newElements) {
|
||||
const element_ = element;
|
||||
if (Object.keys(behaviors).includes(element_["behavior"])) element_["behavior"] = behaviors[element_["behavior"]];
|
||||
if (Object.keys(behaviors).includes(element["behavior"])) element["behavior"] = behaviors[element["behavior"]];
|
||||
elements[element.name] = {};
|
||||
// elements[element.name] = element_;
|
||||
for (const key of Object.keys(element_)) {
|
||||
const val = element_[key];
|
||||
if (checkType(key, val)) elements[element.name][key] = val;
|
||||
for (const key of Object.keys(element)) {
|
||||
const val = element[key];
|
||||
if (checkType(key, val)) elements[element.name][key] = key == "behavior" ? constructBehavior(val) : val;
|
||||
else if (["name", "category"].includes(key)) elements[element.name][key] = key == "name" ? "NewElement" : "other";
|
||||
}
|
||||
}
|
||||
const changes = Storage.get("changes", []);
|
||||
for (const change of changes) {
|
||||
for (const key of Object.keys(change.changes)) {
|
||||
const c = change.changes[key];
|
||||
if (checkType(key, c)) elements[change.element][key] = c;
|
||||
let c = change.changes[key];
|
||||
if (key == "behavior" && Object.keys(behaviors).includes(c)) c = behaviors[c];
|
||||
if (checkType(key, c)) elements[change.element][key] = key == "behavior" ? constructBehavior(c) : c;
|
||||
}
|
||||
}
|
||||
const deleted = Storage.get("deletedElements", []);
|
||||
|
|
@ -547,7 +556,7 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
|
|||
el.style.display = "none";
|
||||
el.onchange = (ev) => {
|
||||
if (document.getElementById(id).value == "CUSTOM") {
|
||||
applyChange(prop.name, ev.target.value.split(";").map(e => e.split(",")));
|
||||
applyChange(prop.name, ev.target.value);
|
||||
} else {
|
||||
ev.target.style.display = "none";
|
||||
}
|
||||
|
|
@ -658,7 +667,7 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
|
|||
el.onchange = (ev) => {
|
||||
if (document.getElementById(id).value == "CUSTOM") {
|
||||
const elementData = Storage.get("newElement", {});
|
||||
elementData[prop.name] = ev.target.value.split(";").map(e => e.split(","));
|
||||
elementData[prop.name] = ev.target.value.split(";");
|
||||
Storage.set("newElement", elementData);
|
||||
} else {
|
||||
ev.target.style.display = "none";
|
||||
|
|
@ -961,22 +970,33 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
|
|||
else el.setAttribute("value", "none");
|
||||
}
|
||||
} else {
|
||||
if (element[prop.name]) {
|
||||
if (element[prop.name] || prop.name == "behavior") {
|
||||
if (prop.type == "boolean") {
|
||||
el.setAttribute("value", element[prop.name] ? "ON" : "OFF");
|
||||
el.setAttribute("state", element[prop.name] ? "1" : "0");
|
||||
} else if (prop.type == "color") {
|
||||
el.setAttribute("value", parseColor(element[prop.name]));
|
||||
} else if (prop.name == "behavior") {
|
||||
const behavior = element[prop.name];
|
||||
const index = Object.keys(behaviors).map(b => `${behaviors[b] instanceof Array ? behaviors[b].join(";") : behaviors[b]}`).indexOf(behavior instanceof Array ? behavior.join(";") : behavior);
|
||||
if (index == -1) {
|
||||
document.getElementById(id + "/option/custom").selected = true;
|
||||
document.getElementById(id + "/textInput").style.display = "";
|
||||
document.getElementById(id + "/textInput").setAttribute("value", behavior.join(";"))
|
||||
} else {
|
||||
let behavior = element[prop.name];
|
||||
if (!behavior && element.tick) behavior = element.tick;
|
||||
if (typeof behavior == "function" && behavior.name) {
|
||||
const name = behavior.name;
|
||||
const index = Object.keys(behaviors).indexOf(name);
|
||||
document.getElementById(id + "/textInput").style.display = "none";
|
||||
document.getElementById(id + "/option/" + index).selected = true;
|
||||
document.getElementById(id + "/option/" + (index == -1 ? "none" : index)).selected = true;
|
||||
} else if (typeof behavior == "function") {
|
||||
document.getElementById(id + "/textInput").style.display = "none";
|
||||
document.getElementById(id + "/option/none").selected = true;
|
||||
} else {
|
||||
const index = Object.keys(behaviors).map(b => `${behaviors[b] instanceof Array ? behaviors[b].join(";") : behaviors[b]}`).indexOf(behavior instanceof Array ? behavior.join(";") : behavior);
|
||||
if (index == -1) {
|
||||
document.getElementById(id + "/option/custom").selected = true;
|
||||
document.getElementById(id + "/textInput").style.display = "";
|
||||
document.getElementById(id + "/textInput").setAttribute("value", behavior.map(b => b.join("|")).join(";"))
|
||||
} else {
|
||||
document.getElementById(id + "/textInput").style.display = "none";
|
||||
document.getElementById(id + "/option/" + index).selected = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
el.setAttribute("value", element[prop.name] instanceof Function ? element[prop.name].toString() : element[prop.name]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
elements.ultra_uranium = {
|
||||
color: ["#50C878" , "#4F7942"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|DL%5|XX",
|
||||
"M2%25|M1%25|M2%25",
|
||||
],
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
temp: 9999999999999999,
|
||||
hardness: 1,
|
||||
};
|
||||
elements.mega_beam = {
|
||||
color: ["#DFFF00" , "#00FFFF"],
|
||||
tick: function(pixel) {
|
||||
var x = pixel.x;
|
||||
for (var y = pixel.y; y < height; y++) {
|
||||
if (outOfBounds(x, y)) {
|
||||
break;
|
||||
}
|
||||
if (isEmpty(x, y)) {
|
||||
if (Math.random() > 0.05) { continue }
|
||||
createPixel("flash", x, y);
|
||||
pixelMap[x][y].color = "#DFFF00";
|
||||
pixelMap[x][y].temp = 9800;
|
||||
}
|
||||
else {
|
||||
if (elements[pixelMap[x][y].element].isGas) { continue }
|
||||
if (elements[pixelMap[x][y].element].id === elements.mega_beam.id) { break }
|
||||
pixelMap[x][y].temp += 9800;
|
||||
pixelTempCheck(pixelMap[x][y]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
deletePixel(pixel.x-1, pixel.y-1);
|
||||
deletePixel(pixel.x+1, pixel.y+1);
|
||||
if ( pixelTicks - pixel.start > 1) {
|
||||
deletePixel(pixel.x, pixel.y)
|
||||
}
|
||||
doHeat(pixel);
|
||||
},
|
||||
temp: 9800,
|
||||
category: "weapons",
|
||||
state: "gas",
|
||||
density: 1,
|
||||
excludeRandom: true,
|
||||
noMix: true
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ elements.molten_caesium = {
|
|||
stateLow: "caesium",
|
||||
tempHigh: 671,
|
||||
stateHigh: "caesium_vapor",
|
||||
density: 1843,
|
||||
density: 1842,
|
||||
temp: 29,
|
||||
conduct: 0.90,
|
||||
reactions: {
|
||||
|
|
@ -1444,19 +1444,48 @@ elements.blackhole_storage = {
|
|||
conduct: 1,
|
||||
},
|
||||
elements.plutonium = {
|
||||
color: ["#616161", "#4b4949", "#353232", "#211c1c"],
|
||||
color: ["#212121", "#2b1c1c", "#371616", "#430e0e", "#510606", "#212121", "#1e1e1e", "#1b1b1b", "#171717", "#141414", "#212121", "#1e1e1e", "#1b1b1b", "#171717", "#141414"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "powders",
|
||||
tempHigh: 640,
|
||||
stateHigh: "molten_plutonium",
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
if (Math.random() < 0.0007) {
|
||||
changePixel(pixel, "neutron", false);
|
||||
} else if (Math.random() < 0.0007) {
|
||||
changePixel(pixel, "uranium", false);
|
||||
}
|
||||
},
|
||||
if(Math.random() < 0.0007){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("helium", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 200
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Math.random() < 0.5){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("neutron", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 200
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
changePixel(pixel, "uranium", false);
|
||||
pixelMap[x][y].temp += 200
|
||||
for (var i = 0; i < adjacentCoords.length; i++) {
|
||||
var coord = adjacentCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x, y, true)){
|
||||
pixelMap[x][y].temp += 175
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 },
|
||||
},
|
||||
|
|
@ -1470,19 +1499,48 @@ elements.molten_plutonium = {
|
|||
tempLow: 620,
|
||||
stateLow: "plutonium",
|
||||
tick: function(pixel){
|
||||
if (Math.random() < 0.0007) {
|
||||
changePixel(pixel, "neutron", false);
|
||||
} else if (Math.random() < 0.0007) {
|
||||
changePixel(pixel, "uranium", false);
|
||||
}
|
||||
},
|
||||
if(Math.random() < 0.0007){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("helium", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 200
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Math.random() < 0.5){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("neutron", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 200
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
changePixel(pixel, "uranium", false);
|
||||
pixelMap[x][y].temp += 200
|
||||
for (var i = 0; i < adjacentCoords.length; i++) {
|
||||
var coord = adjacentCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x, y, true)){
|
||||
pixelMap[x][y].temp += 175
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 },
|
||||
},
|
||||
density: 16629,
|
||||
},
|
||||
elements.neutron.reactions.plutonium = { temp2:100 };
|
||||
elements.neutron.reactions.molten_plutonium = { temp2:100 }
|
||||
elements.neutron.reactions.plutonium = { temp2:200 };
|
||||
elements.neutron.reactions.molten_plutonium = { temp2:200 }
|
||||
elements.pn_explosion = {
|
||||
color: ["#ffb48f","#ffd991","#ffad91"],
|
||||
behavior: [
|
||||
|
|
@ -2431,4 +2489,4 @@ elements.grid_brush = {
|
|||
deletePixel(pixel.x, pixel.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,200 @@
|
|||
const adjectives = ["shiny", "glowing", "dark", "bright", "heavy", "light", "hot", "cold", "hard", "soft", "smooth", "rough", "round", "sharp", "sweet", "sour", "bitter", "salty", "savory"];
|
||||
|
||||
const nouns = ["metal", "crystal", "stone", "powder", "liquid", "gas", "plasma", "slime", "sand", "dust", "rock", "lava", "ice", "vapor", "ash", "soot", "sludge"];
|
||||
|
||||
const elementNames = [];
|
||||
|
||||
while (elementNames.length < 300) {
|
||||
|
||||
const adjective = adjectives[Math.floor(Math.random() * adjectives.length)];
|
||||
const noun = nouns[Math.floor(Math.random() * nouns.length)];
|
||||
|
||||
const name = `${adjective}_${noun}`;
|
||||
|
||||
if (!elementNames.includes(name)) {
|
||||
elementNames.push(name);
|
||||
}
|
||||
}
|
||||
|
||||
const nounTemperatures = {
|
||||
metal: {tempLow: 1000, tempHigh: 1800},
|
||||
crystal: {tempLow: 500, tempHigh: 1000},
|
||||
stone: {tempLow: 600, tempHigh: 1200},
|
||||
powder: {tempLow: 100, tempHigh: 500},
|
||||
liquid: {tempLow: -100, tempHigh: 100},
|
||||
gas: {tempLow: -200, tempHigh: -100},
|
||||
plasma: {tempLow: 8000, tempHigh: 20000},
|
||||
slime: {tempLow: -10, tempHigh: 30},
|
||||
sand: {tempLow: 100, tempHigh: 500},
|
||||
dust: {tempLow: 50, tempHigh: 200},
|
||||
rock: {tempLow: 500, tempHigh: 1000},
|
||||
lava: {tempLow: 700, tempHigh: 1200},
|
||||
ice: {tempLow: -50, tempHigh: 0},
|
||||
vapor: {tempLow: -50, tempHigh: 100},
|
||||
ash: {tempLow: 200, tempHigh: 500},
|
||||
soot: {tempLow: 200, tempHigh: 500},
|
||||
sludge: {tempLow: -10, tempHigh: 100}
|
||||
}
|
||||
|
||||
const nounColors = {
|
||||
metal: ["#999999", "#bbbbbb", "#cccccc", "#dddddd", "#eeeeee"],
|
||||
crystal: ["#77ffff", "#88eeff", "#99ddff", "#aaccff", "#bbbbff"],
|
||||
stone: ["#888888", "#999999", "#aaaaaa", "#bbbbbb", "#cccccc"],
|
||||
powder: ["#eeeeee", "#ffffff", "#dddddd", "#cccccc", "#bbbbbb"],
|
||||
liquid: ["#336699", "#4477aa", "#5588bb", "#6699cc", "#77aadd"],
|
||||
gas: ["#ffffff", "#eeeeee", "#dddddd", "#cccccc", "#bbbbbb"],
|
||||
plasma: ["#ff9966", "#ffaa77", "#ffbb88", "#ffcc99", "#ffddaa"],
|
||||
slime: ["#88cc88", "#99dd99", "#aaddaa", "#bbeebb", "#ccffcc"],
|
||||
sand: ["#D2B48C", "#E8D5A9", "#F0E3C4", "#DCD0BF", "#EBE4D6"],
|
||||
dust: ["#aaaaaa", "#bbbbbb", "#cccccc", "#dddddd", "#eeeeee"],
|
||||
rock: ["#777777", "#888888", "#999999", "#aaaaaa", "#bbbbbb"],
|
||||
lava: ["#ff4400", "#ff5511", "#ff6622", "#ff7733", "#ff8844"],
|
||||
ice: ["#66cccc", "#77dddd", "#88eeee", "#99ffff", "#aaffff"],
|
||||
vapor: ["#ffffff", "#eeeeee", "#dddddd", "#cccccc", "#bbbbbb"],
|
||||
ash: ["#cccccc", "#dddddd", "#eeeeee", "#ffffff", "#eeeeee"],
|
||||
soot: ["#333333", "#444444", "#555555", "#666666", "#777777"],
|
||||
sludge: ["#886633", "#997733", "#a98844", "#bb9944", "#ccaa55"]
|
||||
};
|
||||
|
||||
|
||||
const nounStates = {
|
||||
metal: "solid",
|
||||
crystal: "solid",
|
||||
stone: "solid",
|
||||
powder: "liquid",
|
||||
liquid: "liquid",
|
||||
gas: "gas",
|
||||
plasma: "gas",
|
||||
slime: "liquid",
|
||||
sand: "liquid",
|
||||
dust: "liquid",
|
||||
rock: "solid",
|
||||
lava: "liquid",
|
||||
ice: "solid",
|
||||
vapor: "gas",
|
||||
ash: "liquid",
|
||||
soot: "liquid",
|
||||
sludge: "liquid"
|
||||
};
|
||||
|
||||
// Map noun to behavior
|
||||
const nounBehaviors = {
|
||||
metal: behaviors.WALL,
|
||||
crystal: behaviors.WALL,
|
||||
stone: behaviors.WALL,
|
||||
powder: behaviors.POWDER,
|
||||
liquid: behaviors.LIQUID,
|
||||
gas: behaviors.GAS,
|
||||
plasma: behaviors.GAS,
|
||||
slime: behaviors.LIQUID,
|
||||
sand: behaviors.POWDER,
|
||||
dust: behaviors.POWDER,
|
||||
rock: behaviors.WALL,
|
||||
lava: behaviors.LIQUID,
|
||||
ice: behaviors.WALL,
|
||||
vapor: behaviors.GAS,
|
||||
ash: behaviors.POWDER,
|
||||
soot: behaviors.POWDER,
|
||||
sludge: behaviors.LIQUID
|
||||
};
|
||||
|
||||
const adjectiveBreakInto = {
|
||||
sweet: "sugar",
|
||||
salty: "salt",
|
||||
};
|
||||
|
||||
const nounBreakInto = {
|
||||
crystal: "glass_shard",
|
||||
ice: "snow",
|
||||
rock: ["sand", "gravel"],
|
||||
};
|
||||
|
||||
const adjectiveColorModifiers = {
|
||||
dark: 0.8, // darker
|
||||
shiny: 1.2, // brighter
|
||||
glowing: 1.5 // brightest
|
||||
};
|
||||
|
||||
// Generate elements
|
||||
for (const name of elementNames) {
|
||||
|
||||
const [adjective, noun] = name.split("_");
|
||||
|
||||
let baseColor = nounColors[noun];
|
||||
|
||||
const {tempLow, tempHigh} = nounTemperatures[noun];
|
||||
|
||||
let temp = Math.random() * (tempHigh - tempLow) + tempLow;
|
||||
|
||||
if (adjective === "hot") {
|
||||
temp *= 1.5;
|
||||
} else if (adjective === "cold") {
|
||||
temp /= 2;
|
||||
}
|
||||
|
||||
if (adjective in adjectiveColorModifiers) {
|
||||
const modifier = adjectiveColorModifiers[adjective];
|
||||
baseColor = modifyColor(baseColor, modifier);
|
||||
}
|
||||
|
||||
elements[name] = {
|
||||
color: baseColor,
|
||||
behavior: nounBehaviors[noun],
|
||||
category: "random elements",
|
||||
state: nounStates[noun],
|
||||
temp: temp,
|
||||
breakInto: adjectiveBreakInto[adjective] || nounBreakInto[noun],
|
||||
density: Math.random() * 100,
|
||||
viscosity: Math.random() * 100
|
||||
};
|
||||
|
||||
function modifyColor(color, modifier) {
|
||||
if (color[0] === '#') {
|
||||
color = color.slice(1);
|
||||
}
|
||||
|
||||
color = String(color);
|
||||
|
||||
// Check for '#'
|
||||
const match = color.match(/^#?(.*)$/);
|
||||
if (match) {
|
||||
color = match[1];
|
||||
}
|
||||
|
||||
// Convert to RGB
|
||||
let [r, g, b] = color.match(/.{1,2}/g).map(x => parseInt(x, 16));
|
||||
|
||||
// Apply modifier
|
||||
r = Math.round(r * modifier);
|
||||
g = Math.round(g * modifier);
|
||||
b = Math.round(b * modifier);
|
||||
|
||||
// Constrain RGB values to 0-255
|
||||
r = Math.max(0, Math.min(255, r));
|
||||
g = Math.max(0, Math.min(255, g));
|
||||
b = Math.max(0, Math.min(255, b));
|
||||
|
||||
// Convert back to hex
|
||||
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
changelog only count importtant stuff and not the small details
|
||||
|
||||
0.1
|
||||
added the mod
|
||||
|
||||
0.2
|
||||
elements have breakInto's
|
||||
elements with the adjectives "dark, shiny and glowing" are darker or brighter
|
||||
elements with the nouns "crystal, ice, rock" can break into other elements like "glass_shard, snow, sand"
|
||||
fixed some elements having wrong states
|
||||
|
||||
todo:
|
||||
elements have reactions
|
||||
gases dont have breakintos
|
||||
|
||||
what a silly little changelog! i made it literally right here!!
|
||||
*/
|
||||
222
mods/sbstuff.js
222
mods/sbstuff.js
|
|
@ -1,7 +1,5 @@
|
|||
elements.cooked_rice = {
|
||||
viscosity: 1000,
|
||||
tempMin: 20,
|
||||
stateMin: "rice",
|
||||
tempHigh: 500,
|
||||
stateHigh: "charcoal",
|
||||
density: 699,
|
||||
|
|
@ -1452,7 +1450,7 @@ elements.silver_coin = {
|
|||
state: "solid",
|
||||
};
|
||||
|
||||
elements.uraniumaniumaniumaniumanium_popcornicecream_plutoniumeptunium_238239 = {
|
||||
elements.lololol_this_crashes_ur_game_lololol_why_would_you_want_to_use_this_lololol_it_crashes = {
|
||||
color: "#238fe8",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
|
|
@ -1501,104 +1499,6 @@ elements.oreo = {
|
|||
state: "liquid"
|
||||
};
|
||||
|
||||
elements.uranium_238 = {
|
||||
tempHigh: 1200,
|
||||
stateHigh: "molten_uranium",
|
||||
color: ["#0f400b", "#30522d", "#4d6b4a", "#6f8f6d"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%1|XX",
|
||||
"CR:radiation%1|CH:lead%0.001|CR:radiation%1",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
category: "powders",
|
||||
state: "liquid",
|
||||
density: 19100,
|
||||
hardness: 0.6,
|
||||
conduct: 0.235,
|
||||
excludeRandom: true,
|
||||
reactions: {
|
||||
"neutron": {elem1: "uranium_239",},
|
||||
}
|
||||
};
|
||||
|
||||
elements.uranium_239 = {
|
||||
tempHigh: 1300,
|
||||
stateHigh: "molten_uranium",
|
||||
color: ["#153816", "#135e14", "#379138", "#567556", "#7bb37b"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%2|XX",
|
||||
"CR:radiation%2|CH:lead%0.002|CR:radiation%2",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
category: "powders",
|
||||
state: "liquid",
|
||||
hidden: true,
|
||||
density: 19100,
|
||||
hardness: 0.6,
|
||||
conduct: 0.235,
|
||||
excludeRandom: true,
|
||||
reactions: {
|
||||
"electron": {elem1: "neptunium_239"}
|
||||
}
|
||||
};
|
||||
|
||||
elements.neptunium_239 = {
|
||||
tempHigh: 1500,
|
||||
stateHigh: "molten_uranium",
|
||||
color: ["#082e19", "#173b27", "#354a3f", "#4c635a", "#344a41"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%3|XX",
|
||||
"CR:radiation%3|CH:lead%0.003|CR:radiation%3",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
category: "powders",
|
||||
state: "liquid",
|
||||
hidden: true,
|
||||
density: 20000,
|
||||
hardness: 0.7,
|
||||
conduct: 0.3,
|
||||
excludeRandom: true,
|
||||
reactions: {
|
||||
"electron": {elem1: "plutonium"},
|
||||
"neutron": { elem1:"n_explosion", tempMin:500, chance:0.1 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.plutonium = {
|
||||
tempHigh: 2000,
|
||||
stateHigh: "molten_uranium",
|
||||
color: ["#0a4a17", "#194d23", "#263b2a", "#475449"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%4|XX",
|
||||
"CR:radiation%4|CH:lead%0.004|CR:radiation%4",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
category: "powders",
|
||||
state: "liquid",
|
||||
hidden: true,
|
||||
density: 22000,
|
||||
hardness: 0.8,
|
||||
conduct: 0.4,
|
||||
excludeRandom: true,
|
||||
reactions: {
|
||||
"neutron": { elem1:"n_explosion", tempMin:500, chance:0.2 },
|
||||
"electron": { elem1:"n_explosion", tempMin:500, chance:0.00000000000000000000001 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.electron = {
|
||||
color: "#c99d16",
|
||||
behavior: behaviors.BOUNCY,
|
||||
reactions: {
|
||||
"uranium": { temp2:100 },
|
||||
},
|
||||
temp: 35,
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 0.00002,
|
||||
ignoreAir: true
|
||||
};
|
||||
|
||||
elements.sned = {
|
||||
desc: "slowly expanding...",
|
||||
color: "#dfe0d9",
|
||||
|
|
@ -1757,15 +1657,7 @@ elements.thermal_paste = {
|
|||
state: "liquid",
|
||||
};
|
||||
|
||||
elements.sam = {
|
||||
name: "sam's sperm i think",
|
||||
viscosity: 10000,
|
||||
color: "#0e0e0e",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "joke",
|
||||
state: "liquid",
|
||||
desc: "begs the question; did he censor himself?"
|
||||
};
|
||||
// die
|
||||
|
||||
elements.glitch = {
|
||||
color: ["#ff0000", "#c300ff", "#bbff00", "#1100ff", "#00ffaa"],
|
||||
|
|
@ -1803,11 +1695,20 @@ elements.sound = {
|
|||
}
|
||||
file.click();
|
||||
},
|
||||
onUnselect: function() {},
|
||||
tool: function() {},
|
||||
category: "special",
|
||||
};
|
||||
|
||||
elements.vomit = {
|
||||
viscosity: 170,
|
||||
tempHigh: 100,
|
||||
stateHigh: ["dirty_water", "stench"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
stain: 0.1
|
||||
};
|
||||
|
||||
elements.incinerate.category = "tools",
|
||||
elements.cook.category = "tools",
|
||||
elements.room_temp.category = "tools",
|
||||
|
|
@ -1863,3 +1764,102 @@ if (!elements.coffee.reactions) elements.coffee.reactions = {};
|
|||
elements.coffee.reactions.milk = {elem1: null, elem2: "coffee_milk",}
|
||||
|
||||
elements.silver.breakInto = "silver_coin"
|
||||
|
||||
// sb is an idiot and he has alzheimer so here is a property list
|
||||
/*
|
||||
== METADATA ==
|
||||
name
|
||||
alias
|
||||
category
|
||||
desc
|
||||
extraInfo
|
||||
related
|
||||
hidden
|
||||
darkText
|
||||
canPlace
|
||||
nocheer
|
||||
forceAutoGen
|
||||
|
||||
== COLOR ==
|
||||
color
|
||||
innerColor (dead property)
|
||||
colorOn
|
||||
customColor
|
||||
forceSaveColor
|
||||
colorPattern
|
||||
colorKey
|
||||
|
||||
== BEHAVIOR ==
|
||||
behavior
|
||||
behaviorOn
|
||||
tool (func)
|
||||
onMouseUp (func)
|
||||
onSelect (func)
|
||||
onUnselect (func)
|
||||
onMix (func)
|
||||
tick (func)
|
||||
perTick (func)
|
||||
reactions
|
||||
|
||||
== TEMP ==
|
||||
temp
|
||||
tempLow
|
||||
stateLow
|
||||
stateLowName
|
||||
stateLowColor
|
||||
stateLowColorMultiplier
|
||||
tempHigh
|
||||
stateHigh
|
||||
stateHighName
|
||||
stateHighColor
|
||||
stateHighColorMultiplier
|
||||
extraTempLow
|
||||
extraTempHigh
|
||||
heatCapacity (dead property)
|
||||
|
||||
== PROPERTIES ==
|
||||
state
|
||||
density
|
||||
insulate
|
||||
viscosity
|
||||
conduct
|
||||
stain
|
||||
stainSelf
|
||||
charge
|
||||
movable
|
||||
hardness
|
||||
foodNeed
|
||||
properties
|
||||
maxSize
|
||||
baby
|
||||
egg
|
||||
eggColor
|
||||
seed
|
||||
noMix
|
||||
ignoreAir
|
||||
excludeRandom
|
||||
cooldown
|
||||
isFood
|
||||
ignore
|
||||
canContain
|
||||
|
||||
== BURN ==
|
||||
burn
|
||||
burning
|
||||
burnTime
|
||||
burnInto
|
||||
extinguish
|
||||
fireColor
|
||||
fireElement
|
||||
|
||||
== FLIP ==
|
||||
rotatable
|
||||
flipX
|
||||
flippableX
|
||||
flipY
|
||||
flippableY
|
||||
|
||||
== BREAK ==
|
||||
breakInto
|
||||
breakIntoColor
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue