Merge branch 'main' of https://github.com/GGodPL/sandboxels
This commit is contained in:
commit
23c950203c
|
|
@ -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
1181
mods/chem.js
1181
mods/chem.js
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"]]
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,33 @@ 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",
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue