Merge branch 'main' of https://github.com/R74nCom/sandboxels
This commit is contained in:
commit
7b9476e399
|
|
@ -0,0 +1,20 @@
|
|||
elements.Ultra_Steel = {
|
||||
color: "#8f748f",
|
||||
behavior: behaviors.WALL,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
tempHigh: 26525,
|
||||
stateHigh: "Molten_Ultra_Steel",
|
||||
};
|
||||
|
||||
elements.Molten_Ultra_Steel = {
|
||||
color: ["#bf56bf","#873987","#d158d1","#a145a1"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
tempLow: 24725,
|
||||
stateLow: "Ultra_Steel",
|
||||
reactions: {
|
||||
"molten_gold": { elem1: "salt", elem2: "salt" },
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -106,7 +106,7 @@ const inject = () => {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param {string} menu Menu do be opened
|
||||
* @param {string} menu Menu to be opened
|
||||
* @param {boolean} [closeCurrent] Whether it should forcefully close the current screen
|
||||
*/
|
||||
const openMenu = (menu, closeCurrent = false) => {
|
||||
|
|
@ -130,6 +130,7 @@ class MenuScreen {
|
|||
this.showCloseButton = true;
|
||||
this.closeButtonText = "-";
|
||||
this.closeButtonClass = "XButton";
|
||||
this.titleId = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -141,6 +142,15 @@ class MenuScreen {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets screen title ID
|
||||
* @param {string} [id] Screen title element ID
|
||||
*/
|
||||
setTitleId(id) {
|
||||
this.titleId = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets close button visibility. When false the close button will not be added to the menu screen
|
||||
* @param {boolean} show Visibility of the close button
|
||||
|
|
@ -253,7 +263,7 @@ class MenuScreen {
|
|||
const inner = document.createElement("div");
|
||||
inner.className = this.innerDivClass ?? "menuScreen";
|
||||
inner.innerHTML = `${this.showCloseButton ? `<button class="${this.closeButtonClass ?? "XButton"}" onclick="closeMenu();">${this.closeButtonText}` : ""}</button>
|
||||
<span class="menuTitle">${this.title ?? "Menu Screen"}</span><br><br><div class="menuText">` + this.innerHtml + "</div>";
|
||||
<span class="menuTitle"${this.titleId ? ` id="${this.titleId}"` : ""}>${this.title ?? "Menu Screen"}</span><br><br><div class="menuText">` + this.innerHtml + "</div>";
|
||||
this.nodes.forEach(n => inner.querySelector(".menuText").appendChild(n));
|
||||
parent.appendChild(inner);
|
||||
document.getElementById(id).appendChild(parent);
|
||||
|
|
|
|||
1181
mods/chem.js
1181
mods/chem.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,26 @@
|
|||
//В этом моде я добавил печёное яблоко
|
||||
elements.cooked_apple = {
|
||||
color: "#271f1c",
|
||||
behavior: behaviors.POWDER,
|
||||
temp: 20,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
tempHigh: 345,
|
||||
stateHigh: "ash",
|
||||
tempLow: -30,
|
||||
stateLow: "iced_apple",
|
||||
density: 475
|
||||
};
|
||||
|
||||
elements.iced_apple = {
|
||||
color: "#f7a37e",
|
||||
behavior: behaviors.WALL,
|
||||
temp: 20,
|
||||
category: "states",
|
||||
state: "solid",
|
||||
tempHigh: 10,
|
||||
stateHigh: "cooked_apple",
|
||||
density: 745
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
//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.
|
||||
//how to use:
|
||||
//the "customExplosion" function is to be used in reactions, like so:
|
||||
//instead of putting an element, put "explosion" in along with the radius, like so:
|
||||
//"water": {
|
||||
//func: function (pixel1, pixel2) {customExplosion(pixel1, pixel2, 5, ["fire", "fire", "pop", "hydrogen", "sodiumhydroxide", "potassiumhydroxide","sodiumhydroxide", "potassiumhydroxide","sodiumhydroxide", "potassiumhydroxide"])}
|
||||
//explosion: "fire,fire,fire,hydrogen", radius: 5
|
||||
//}
|
||||
//and the element you just have to select and enter "EX:(radius)>(elem1),(elem2),(elem3)" and so on. do not include spaces.
|
||||
function customExplosion(pixel1, pixel2, radius, list) {
|
||||
let x = pixel1.x;
|
||||
let y = pixel1.y;
|
||||
|
|
@ -12,15 +11,100 @@ function customExplosion(pixel1, pixel2, radius, list) {
|
|||
deletePixel(pixel2.x, pixel2.y);
|
||||
explodeAt(x, y, radius, list);
|
||||
};
|
||||
function reactPixels(pixel1,pixel2) {
|
||||
var r = elements[pixel1.element].reactions[pixel2.element];
|
||||
if (r.setting && settings[r.setting]===0) {
|
||||
return false;
|
||||
}
|
||||
// r has the attribute "y" which is a range between two y values
|
||||
// r.y example: [10,30]
|
||||
// return false if y is defined and pixel1's y is not in the range
|
||||
if (r.tempMin !== undefined && pixel1.temp < r.tempMin) {
|
||||
return false;
|
||||
}
|
||||
if (r.tempMax !== undefined && pixel1.temp > r.tempMax) {
|
||||
return false;
|
||||
}
|
||||
if (r.burning1 !== undefined && Boolean(pixel1.burning) !== r.burning1) {
|
||||
return false;
|
||||
}
|
||||
if (r.burning2 !== undefined && Boolean(pixel2.burning) !== r.burning2) {
|
||||
return false;
|
||||
}
|
||||
if (r.charged && !pixel.charge) {
|
||||
return false;
|
||||
}
|
||||
if (r.chance !== undefined && Math.random() > r.chance) {
|
||||
return false;
|
||||
}
|
||||
if (r.y !== undefined && (pixel1.y < r.y[0] || pixel1.y > r.y[1])) {
|
||||
return false;
|
||||
}
|
||||
if (r.explosion !== undefined){
|
||||
if (r.radius !== undefined){
|
||||
let radius = r.radius;
|
||||
let list = r.explosion.split(",");
|
||||
console.log(list);
|
||||
console.log(pixel1, pixel2, radius, list);
|
||||
customExplosion(pixel1, pixel2, radius, list);
|
||||
}
|
||||
}
|
||||
if (r.elem1 !== undefined) {
|
||||
// if r.elem1 is an array, set elem1 to a random element from the array, otherwise set it to r.elem1
|
||||
if (Array.isArray(r.elem1)) {
|
||||
var elem1 = r.elem1[Math.floor(Math.random() * r.elem1.length)];
|
||||
} else { var elem1 = r.elem1; }
|
||||
|
||||
if (elem1 == null) {
|
||||
deletePixel(pixel1.x,pixel1.y);
|
||||
}
|
||||
else {
|
||||
changePixel(pixel1,elem1);
|
||||
}
|
||||
}
|
||||
if (r.charge1) { pixel1.charge = r.charge1; }
|
||||
if (r.temp1) { pixel1.temp += r.temp1; pixelTempCheck(pixel1); }
|
||||
if (r.color1) { // if it's a list, use a random color from the list, else use the color1 attribute
|
||||
pixel1.color = pixelColorPick(pixel1, Array.isArray(r.color1) ? r.color1[Math.floor(Math.random() * r.color1.length)] : r.color1);
|
||||
}
|
||||
if (r.attr1) { // add each attribute to pixel1
|
||||
for (var key in r.attr1) {
|
||||
pixel1[key] = r.attr1[key];
|
||||
}
|
||||
}
|
||||
if (r.elem2 !== undefined) {
|
||||
// if r.elem2 is an array, set elem2 to a random element from the array, otherwise set it to r.elem2
|
||||
if (Array.isArray(r.elem2)) {
|
||||
var elem2 = r.elem2[Math.floor(Math.random() * r.elem2.length)];
|
||||
} else { var elem2 = r.elem2; }
|
||||
|
||||
if (elem2 == null) {
|
||||
deletePixel(pixel2.x,pixel2.y);
|
||||
}
|
||||
else {
|
||||
changePixel(pixel2,elem2);
|
||||
}
|
||||
}
|
||||
if (r.charge2) { pixel2.charge = r.charge2; }
|
||||
if (r.temp2) { pixel2.temp += r.temp2; pixelTempCheck(pixel2); }
|
||||
if (r.color2) { // if it's a list, use a random color from the list, else use the color2 attribute
|
||||
pixel2.color = pixelColorPick(pixel2, Array.isArray(r.color2) ? r.color2[Math.floor(Math.random() * r.color2.length)] : r.color2);
|
||||
}
|
||||
if (r.attr2) { // add each attribute to pixel2
|
||||
for (var key in r.attr2) {
|
||||
pixel2[key] = r.attr2[key];
|
||||
}
|
||||
}
|
||||
if (r.func) { r.func(pixel1,pixel2); }
|
||||
return r.elem1!==undefined || r.elem2!==undefined;
|
||||
}
|
||||
elements.customExplosion = {
|
||||
items: "",
|
||||
rItems: "",
|
||||
behavior: behaviors.SOLID,
|
||||
state: "solid",
|
||||
onSelect: function(){
|
||||
items = prompt("What should this explosion include?");
|
||||
this.items = items;
|
||||
console.log(items);
|
||||
elements.customExplosion.behavior = [["XX", "XX", "XX"], ["XX", `EX:4>${items}`, "XX"], ["XX", "XX", "XX"]]
|
||||
let items = prompt("What should this explosion include? enter in format of \"elem1,elem2,elem3\" ensuring that there are no spaces, you can also use the same element multiple times.");
|
||||
let radius = prompt("Enter explosion radius:");
|
||||
elements.customExplosion.behavior = [["XX", "XX", "XX"], ["XX", `EX:${radius}>${items}`, "XX"], ["XX", "XX", "XX"]]
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
elements.dragon_breath = {
|
||||
color: "#f94e4e",
|
||||
behavior: behaviors.GAS,
|
||||
category: "fantasy",
|
||||
state: "gas",
|
||||
density: 0.1,
|
||||
weight: 1,
|
||||
update: function(x, y) {
|
||||
// Update the element's behavior
|
||||
},
|
||||
reactions: {
|
||||
"oxygen": { elem1: "fire", elem2: "fire" },
|
||||
"frostbite": { elem1: "pulsium", elem2: "pulsium" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.frostbite = {
|
||||
color: "#0000ff",
|
||||
behavior: behaviors.SOLID,
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
density: 1.5,
|
||||
weight: 100,
|
||||
update: function(x, y) {
|
||||
// Update the element's behavior
|
||||
},
|
||||
reactions: {
|
||||
"water": { elem1: "ice", elem2: "ice" },
|
||||
"dragon_breath": { elem1: "pulsium", elem2: "pulsium" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.pulsium = {
|
||||
color: "#ffff00",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "fantasy",
|
||||
state: "liquid",
|
||||
density: 1923,
|
||||
weight: 100,
|
||||
update: function(x, y) {
|
||||
// Update the element's behavior
|
||||
},
|
||||
reactions: {
|
||||
"molten_iron": { elem1: "pulsium_bar", elem2: "pulsium_bar" },
|
||||
"molten_tin": { elem1: "pulsium_bar", elem2: "pulsium_bar" },
|
||||
"water": { elem1: "sap", elem2: "sap" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.pulsium_bar = {
|
||||
color: "#ffd700",
|
||||
behavior: behaviors.SOLID,
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
density: 1700,
|
||||
weight: 100,
|
||||
update: function(x, y) {
|
||||
// Update the element's behavior
|
||||
}
|
||||
};
|
||||
|
||||
elements.goblins_delight = {
|
||||
color: "#00ff00",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
density: 0.5,
|
||||
weight: 50,
|
||||
reactions: {
|
||||
"liquid_light": { elem1: "water", elem2: "oil" },
|
||||
"radiation": { elem1: "sauce", elem2: "sauce" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.pheonix = {
|
||||
color: ["#ff0000"],
|
||||
tick: behaviors.FLY,
|
||||
reactions: { "fire": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"salt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"pulsium_bar": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"pulsium": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"dragon_breath": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
},
|
||||
foodNeed: 5,
|
||||
tempHigh: 999999,
|
||||
stateHigh: "ash",
|
||||
tempLow: 0,
|
||||
category:"fantasy",
|
||||
burn:100,
|
||||
burnTime:19,
|
||||
state: "solid",
|
||||
density: 850,
|
||||
conduct: 1,
|
||||
baby: "baby_pheonix",
|
||||
};
|
||||
|
||||
elements.phoenix_ash = {
|
||||
color: "#a8a8a5",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
density: 1.5,
|
||||
weight: 100,
|
||||
reactions: {
|
||||
"water": { elem1: "pheonix", elem2: "pheonix" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.baby_pheonix = {
|
||||
color: ["#ffdd00"],
|
||||
tick: behaviors.FLY,
|
||||
foodNeed: 5,
|
||||
tempHigh: 999999,
|
||||
stateHigh: "ash",
|
||||
tempLow: 0,
|
||||
category:"fantasy",
|
||||
burn:100,
|
||||
burnTime:19,
|
||||
state: "solid",
|
||||
stateLow: "iced_pheonix",
|
||||
breakInto: "phoenix_ash",
|
||||
density: 850,
|
||||
conduct: 1,
|
||||
};
|
||||
|
||||
elements.iced_pheonix = {
|
||||
color: "#34baeb",
|
||||
behavior: behaviors.SOLID,
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
density: 1.5,
|
||||
weight: 100,
|
||||
update: function(x, y) {
|
||||
// Update the element's behavior
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
elements.poop = {
|
||||
color: "#411900",
|
||||
density: 200,
|
||||
state: "solid",
|
||||
burn: 5,
|
||||
tempHigh: 400,
|
||||
burnTime: 200,
|
||||
burnInto: ["driedPoop"],
|
||||
category: "gross stuff",
|
||||
}
|
||||
|
||||
elements.driedPoop = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: '#181100',
|
||||
state: 'powder',
|
||||
category: "gross stuff",
|
||||
reactions: {
|
||||
"water": { elem1: null, elem2: "wetPoop" },
|
||||
"milk": { elem1: null, elem2: "poopyMilk" },
|
||||
|
||||
},
|
||||
density: 10
|
||||
}
|
||||
|
||||
elements.wetPoop = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: "#A9844F",
|
||||
state: 'liquid',
|
||||
category: 'gross stuff',
|
||||
density: '25'
|
||||
}
|
||||
|
||||
elements.poopyMilk = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: '#BEB2AD',
|
||||
state: 'liquid',
|
||||
category: "gross stuff",
|
||||
density: 10
|
||||
}
|
||||
|
||||
elements.peePee = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: '#f1ed00',
|
||||
state: 'liquid',
|
||||
category: "gross stuff",
|
||||
tempHigh: 100,
|
||||
stateHigh: ["ammonia", "fragrance"],
|
||||
density: 25
|
||||
}
|
||||
|
||||
elements.ammonia = {
|
||||
behavior: behaviors.GAS,
|
||||
color: '#E5E4E2',
|
||||
category: 'gross stuff',
|
||||
density: .86,
|
||||
state: 'gas',
|
||||
}
|
||||
|
|
@ -1,19 +1,21 @@
|
|||
// Gallium is the best element
|
||||
elements.caesium = {
|
||||
color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"],
|
||||
behavior: behaviors.WALL,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
tempHigh: 28.44,
|
||||
stateHigh: "molten_caesium",
|
||||
density: 1873,
|
||||
reactions: {
|
||||
"water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"sugar_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"dirty_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"pool_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"salt_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"seltzer": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
}
|
||||
color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"],
|
||||
behavior: behaviors.WALL,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
tempHigh: 28.44,
|
||||
stateHigh: "molten_caesium",
|
||||
density: 1873,
|
||||
conduct: 0.90,
|
||||
reactions: {
|
||||
"water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"sugar_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"dirty_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"pool_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"salt_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"seltzer": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
}
|
||||
},
|
||||
elements.molten_caesium = {
|
||||
color: ["#735c0a", "#a68e37", "#7e6715", "#9b832e"],
|
||||
|
|
@ -26,6 +28,7 @@ elements.molten_caesium = {
|
|||
stateHigh: "caesium_vapor",
|
||||
density: 1843,
|
||||
temp: 29,
|
||||
conduct: 0.90,
|
||||
reactions: {
|
||||
"water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"sugar_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
|
|
@ -80,7 +83,8 @@ elements.technetium = {
|
|||
state: "solid",
|
||||
tempHigh: 2157,
|
||||
stateHigh: "molten_technetium",
|
||||
density: 11500
|
||||
density: 11500,
|
||||
conduct: 0.9
|
||||
},
|
||||
elements.molten_technetium = {
|
||||
color: ["#d16b42", "#da904c", "#dfb360", "#e2d57f"],
|
||||
|
|
@ -303,7 +307,7 @@ elements.roomtemper = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
if(pixelMap[x][y].temp < -230) {
|
||||
pixelMap[x][y].temp = (pixelMap[x][y].temp + 7)
|
||||
} else if(pixelMap[x][y].temp > 270) {
|
||||
|
|
@ -330,7 +334,7 @@ elements.destroyable_roomtemper = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
if(pixelMap[x][y].temp < -230) {
|
||||
pixelMap[x][y].temp = (pixelMap[x][y].temp + 7)
|
||||
} else if(pixelMap[x][y].temp > 270) {
|
||||
|
|
@ -361,7 +365,7 @@ elements.customtemper = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
if(pixelMap[x][y].temp < (pixel.temp - 250)) {
|
||||
pixelMap[x][y].temp = (pixelMap[x][y].temp + 7)
|
||||
} else if(pixelMap[x][y].temp > (pixel.temp + 250)) {
|
||||
|
|
@ -388,7 +392,7 @@ elements.destroyable_customtemper = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
if(pixelMap[x][y].temp < (pixel.temp - 250)) {
|
||||
pixelMap[x][y].temp = (pixelMap[x][y].temp + 7)
|
||||
} else if(pixelMap[x][y].temp > (pixel.temp + 250)) {
|
||||
|
|
@ -1337,7 +1341,7 @@ elements.converter = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
var otherPixel = pixelMap[x][y];
|
||||
if ((otherPixel.element == pixel.specialturn || pixel.specialturn == "all") && !elements.converter.ignore.includes(otherPixel.element)){
|
||||
changePixel(otherPixel, pixel.contype)
|
||||
|
|
@ -1370,7 +1374,7 @@ elements.blackhole_storage = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y) && (!pixel.charge && !pixel.chargeCD)) {
|
||||
if (!isEmpty(x,y, true) && (!pixel.charge && !pixel.chargeCD)) {
|
||||
var otherPixel = pixelMap[x][y];
|
||||
if (elements[otherPixel.element].movable == true){
|
||||
pixel.bhcontents.push(otherPixel);
|
||||
|
|
@ -1407,7 +1411,6 @@ elements.plutonium = {
|
|||
},
|
||||
reactions: {
|
||||
"neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 },
|
||||
"neutron": { temp1: 100, temp2: 100 },
|
||||
},
|
||||
density: 19186,
|
||||
}
|
||||
|
|
@ -1430,10 +1433,8 @@ elements.molten_plutonium = {
|
|||
},
|
||||
density: 16629,
|
||||
},
|
||||
elements.neutron.reactions = {
|
||||
"uranium": { temp2:100 },
|
||||
"plutonium": { temp2: 100 }
|
||||
},
|
||||
elements.neutron.reactions.plutonium = { temp2:100 };
|
||||
elements.neutron.reactions.molten_plutonium = { temp2:100 }
|
||||
elements.pn_explosion = {
|
||||
color: ["#ffb48f","#ffd991","#ffad91"],
|
||||
behavior: [
|
||||
|
|
@ -1459,7 +1460,7 @@ elements.smasher = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true)) {
|
||||
var otherPixel = pixelMap[x][y];
|
||||
breakPixel(otherPixel);
|
||||
}
|
||||
|
|
@ -1477,7 +1478,7 @@ elements.mixer = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y)) {
|
||||
if (!isEmpty(x,y, true) && !elements[pixelMap[x][y].element].noMix) {
|
||||
var otherPixel = pixelMap[x][y];
|
||||
pixel.mixList.push(otherPixel);
|
||||
}
|
||||
|
|
@ -1497,4 +1498,129 @@ elements.mixer = {
|
|||
}
|
||||
},
|
||||
movable: false,
|
||||
},
|
||||
elements.invisiblesupport = {
|
||||
color: "#000000",
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
var x = pixel.x
|
||||
var y = pixel.y
|
||||
if (currentElement == "invisiblesupport"){
|
||||
pixel.color = "rgb(15, 15, 15)";
|
||||
} else {
|
||||
pixel.color = "rgba(0, 0, 0, -1)";
|
||||
}
|
||||
if ((isEmpty(x-1, y) || isEmpty(x+1,y)) && isEmpty(x,y+1)){
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
category: "powders",
|
||||
},
|
||||
elements.invisiblewall = {
|
||||
color: "#000000",
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
if (currentElement == "invisiblewall"){
|
||||
pixel.color = "rgb(15, 15, 15)";
|
||||
} else {
|
||||
pixel.color = "rgba(0, 0, 0, -1)";
|
||||
}
|
||||
},
|
||||
category: "solids",
|
||||
},
|
||||
elements.bismuth = {
|
||||
color: ["#818181","#989898","#b0b0b0","#c9c9c9"],
|
||||
behavior: behaviors.WALL,
|
||||
category: "solids",
|
||||
tempHigh: 271.4,
|
||||
stateHigh: "molten_bismuth",
|
||||
density: 9780,
|
||||
state: "solid"
|
||||
}
|
||||
function RGBtoHSV(r, g, b) {
|
||||
if (arguments.length === 1) {
|
||||
g = r.g, b = r.b, r = r.r;
|
||||
}
|
||||
var max = Math.max(r, g, b), min = Math.min(r, g, b),
|
||||
d = max - min,
|
||||
h,
|
||||
s = (max === 0 ? 0 : d / max),
|
||||
v = max / 255;
|
||||
|
||||
switch (max) {
|
||||
case min: h = 0; break;
|
||||
case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
|
||||
case g: h = (b - r) + d * 2; h /= 6 * d; break;
|
||||
case b: h = (r - g) + d * 4; h /= 6 * d; break;
|
||||
}
|
||||
|
||||
return {
|
||||
h: h,
|
||||
s: s,
|
||||
v: v
|
||||
};
|
||||
}
|
||||
function HSVtoRGB(h, s, v) {
|
||||
var r, g, b, i, f, p, q, t;
|
||||
if (arguments.length === 1) {
|
||||
s = h.s, v = h.v, h = h.h;
|
||||
}
|
||||
i = Math.floor(h * 6);
|
||||
f = h * 6 - i;
|
||||
p = v * (1 - s);
|
||||
q = v * (1 - f * s);
|
||||
t = v * (1 - (1 - f) * s);
|
||||
switch (i % 6) {
|
||||
case 0: r = v, g = t, b = p; break;
|
||||
case 1: r = q, g = v, b = p; break;
|
||||
case 2: r = p, g = v, b = t; break;
|
||||
case 3: r = p, g = q, b = v; break;
|
||||
case 4: r = t, g = p, b = v; break;
|
||||
case 5: r = v, g = p, b = q; break;
|
||||
}
|
||||
return {
|
||||
r: Math.round(r * 255),
|
||||
g: Math.round(g * 255),
|
||||
b: Math.round(b * 255)
|
||||
};
|
||||
}
|
||||
elements.molten_bismuth = {
|
||||
color: ["#ee8d63", "#ef7e5e", "#f06e5c", "#f05c5c"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
tick: function(pixel){
|
||||
if (pixel.temp <= 261.4){
|
||||
pixel.tHue = 0;
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x, y, true)){
|
||||
if (pixelMap[x][y].element == "bismuth"){
|
||||
var otherPixel = pixelMap[x][y]
|
||||
var nR = parseInt(otherPixel.color.slice(4, otherPixel.color.indexOf(',')), 10)
|
||||
var nG = parseInt(otherPixel.color.slice(otherPixel.color.indexOf(',') + 1, otherPixel.color.lastIndexOf(',')), 10)
|
||||
var nB = parseInt(otherPixel.color.slice(otherPixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||
var hsvResult = RGBtoHSV(nR, nG, nB)
|
||||
if ((pixel.tHue+1)%1 < hsvResult.h){
|
||||
pixel.tHue = hsvResult.h;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
changePixel(pixel, "bismuth")
|
||||
if (1 == 1){
|
||||
var rgbResult = HSVtoRGB(pixel.tHue + 0.02, 0.8, 0.8);
|
||||
} else {
|
||||
var rgbResult = HSVtoRGB(pixel.tHue, 0.8, 0.8);
|
||||
}
|
||||
const hexR = rgbResult.r.toString(16).padStart(2, '0');
|
||||
const hexG = rgbResult.g.toString(16).padStart(2, '0');
|
||||
const hexB = rgbResult.b.toString(16).padStart(2, '0');
|
||||
const hexCode = `#${hexR}${hexG}${hexB}`;
|
||||
pixel.color = pixelColorPick(pixel, hexCode)
|
||||
}
|
||||
},
|
||||
density: 10049,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,197 @@
|
|||
elements.fruit_slushy = {
|
||||
color: "#b867cf",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.mold = {
|
||||
color: "#86ab29",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.chocolate_slushy = {
|
||||
color: "#4f2e16",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.chocolate_sauce = {
|
||||
color: "#754828",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.chocolate_ice_cream = {
|
||||
color: "#704b3a",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.fruit_ice_cream = {
|
||||
color: "#de6ab7",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.cooking_oil = {
|
||||
color: "#c4ab4f",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"meat": { elem1: null, elem2: "chicken_nuggets" },
|
||||
"potato": { elem1: null, elem2: "fries" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.chicken_nuggets = {
|
||||
color: "#967242",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.fries = {
|
||||
color: "#ebba34",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.rose_sauce = {
|
||||
color: "#f0340e",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
hidden: "TRUE",
|
||||
};
|
||||
|
||||
elements.smashed_ice = {
|
||||
color: "#c3d4e6",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"grape": { elem1: null, elem2: "fruit_slushy" },
|
||||
"chocolate": { elem1: null, elem2: "chocolate_slushy" },
|
||||
"juice": { elem1: null, elem2: "fruit_slushy" },
|
||||
"chocolate_sauce": { elem1: null, elem2: "chocolate_slushy" },
|
||||
},
|
||||
density: 100,
|
||||
tempHigh: 25,
|
||||
stateHigh: "water",
|
||||
tempLow: -50,
|
||||
stateLow: "snow",
|
||||
};
|
||||
|
||||
elements.moss = {
|
||||
color: "#389639",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "life",
|
||||
state: "solid",
|
||||
burn: 5,
|
||||
burnTime: 15,
|
||||
density: 1400,
|
||||
breakInto: "dead_plant",
|
||||
tempHigh: 120,
|
||||
stateHigh: "dead_plant",
|
||||
tempLow: -4,
|
||||
stateLow: "frozen_plant",
|
||||
|
||||
reactions: {
|
||||
"dna": { elem1: "moth", elem2: null },
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
elements.moth = {
|
||||
color: "#665233",
|
||||
behavior: behaviors.BOUNCY,
|
||||
category: "life",
|
||||
state: "solid",
|
||||
burn: 95,
|
||||
burnTime: 25,
|
||||
density: 600,
|
||||
breakInto: "dead_bug",
|
||||
tempHigh: 100,
|
||||
stateHigh: "ash",
|
||||
tempLow: 0,
|
||||
stateLow: "dead_bug",
|
||||
};
|
||||
|
||||
if (!elements.lettuce.reactions) elements.lettuce.reactions = {};
|
||||
elements.lettuce.reactions.ice_cream = { elem1: "moss", elem2: null }
|
||||
|
||||
if (!elements.ketchup.reactions) elements.ketchup.reactions = {};
|
||||
elements.ketchup.reactions.mayonnaise = { elem1: "rose_sauce", elem2: null }
|
||||
|
||||
|
||||
if (!elements.bread.reactions) elements.bread.reactions = {};
|
||||
elements.bread.reactions.rotten_cheese = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.bread.reactions) elements.bread.reactions = {};
|
||||
elements.bread.reactions.dirty_water = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.toast.reactions) elements.toast.reactions = {};
|
||||
elements.toast.reactions.rotten_cheese = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.toast.reactions) elements.toast.reactions = {};
|
||||
elements.toast.reactions.dirty_water = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.baked_batter.reactions) elements.baked_batter.reactions = {};
|
||||
elements.baked_batter.reactions.rotten_cheese = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.baked_batter.reactions) elements.baked_batter.reactions = {};
|
||||
elements.baked_batter.reactions.dirty_water = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.bread.reactions) elements.bread.reactions = {};
|
||||
elements.bread.reactions.worm = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.bread.reactions) elements.bread.reactions = {};
|
||||
elements.bread.reactions.mud = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.toast.reactions) elements.toast.reactions = {};
|
||||
elements.toast.reactions.worm = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.toast.reactions) elements.toast.reactions = {};
|
||||
elements.toast.reactions.mud = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.baked_batter.reactions) elements.baked_batter.reactions = {};
|
||||
elements.baked_batter.reactions.worm = { elem1: "mold", elem2: null }
|
||||
|
||||
if (!elements.baked_batter.reactions) elements.baked_batter.reactions = {};
|
||||
elements.baked_batter.reactions.mud = { elem1: "mold", elem2: null }
|
||||
|
||||
elements.sugar_ice.breakInto = "smashed_ice"
|
||||
|
||||
elements.chocolate.breakInto = "chocolate_sauce"
|
||||
|
||||
if (!elements.ice_cream.reactions) elements.ice_cream.reactions = {};
|
||||
elements.ice_cream.reactions.juice = { elem1: "fruit_ice_cream", elem2: null }
|
||||
|
||||
if (!elements.ice_cream.reactions) elements.ice_cream.reactions = {};
|
||||
elements.ice_cream.reactions.grape = { elem1: "fruit_ice_cream", elem2: null }
|
||||
|
||||
if (!elements.ice_cream.reactions) elements.ice_cream.reactions = {};
|
||||
elements.ice_cream.reactions.chocolate = { elem1: "chocolate_ice_cream", elem2: null }
|
||||
|
||||
if (!elements.ice_cream.reactions) elements.ice_cream.reactions = {};
|
||||
elements.ice_cream.reactions.chocolate_sauce = { elem1: "chocolate_ice_cream", elem2: null }
|
||||
|
||||
if (!elements.ice_cream.reactions) elements.ice_cream.reactions = {};
|
||||
elements.ice_cream.reactions.melted_chocolate = { elem1: "chocolate_ice_cream", elem2: null }
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
elements.rice = {
|
||||
color: "#d1d1d1",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
reactions: {
|
||||
"fire": { elem1: "rice", elem2: "burnt_rice" },
|
||||
"heat": { elem1: "rice", elem2: "burnt_rice" },
|
||||
"plasma": { elem1: "fire", elem2: "ash" },
|
||||
"incinerate": { elem1: "fire", elem2: "ash" },
|
||||
"heat_ray": { elem1: "fire", elem2: "ash" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.burnt_rice = {
|
||||
color: "#242424",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
reactions: {
|
||||
"water": { elem1 : null, elem2: "dirty_water" },
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue