Merge pull request #191 from theenchantedsword/main

morechemistry v1.4.1
This commit is contained in:
slweeb 2023-12-18 21:42:23 -05:00 committed by GitHub
commit 59397c0b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 136 additions and 18 deletions

21
allliquids.js Normal file
View File

@ -0,0 +1,21 @@
let liquid = [["XX", "XX", "XX"], ["M1", "XX", "M1"], ["M1", "M2", "M1"]]
for (var element in elements){
let a = elements[element].behavior;
console.log(a, elements[element], liquid)
if(a != undefined && typeof a != 'function'){
let i = 0;
while (i < a.length){
if(typeof a[i] == "string"){
a[i] = a[i].split("|");
i += 1;
} else {
i += 1;
}
}
elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]];
} else {
elements[element].behavior = liquid;
}
}

View File

@ -1,4 +1,5 @@
//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. //This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
//V1.4.1: added a mixer element and an improved sensor element.
function customExplosion(pixel1, pixel2, radius, list) { function customExplosion(pixel1, pixel2, radius, list) {
let x = pixel1.x; let x = pixel1.x;
let y = pixel1.y; let y = pixel1.y;
@ -278,23 +279,7 @@ elements.acid.ignore.push("aqua_regia");
elements.cwall = { elements.cwall = {
"color": "rgb(128,128,128)", "color": "rgb(128,128,128)",
"name": "Conductive Wall", "name": "Conductive Wall",
"behavior": [ "behavior": [["XX", "XX", "XX"], ["XX", "XX", "XX"], ["XX", "XX", "XX"]],
[
"XX",
"XX",
"XX"
],
[
"XX",
"XX",
"XX"
],
[
"XX",
"XX",
"XX"
]
],
"category": "solids", "category": "solids",
"insulate": false, "insulate": false,
"hardness": 1, "hardness": 1,
@ -811,7 +796,6 @@ elements.rubidiumsalt = {
density: 2800, density: 2800,
} }
elements.hydrogen.burnInto = "steam";
elements.irradiate = { elements.irradiate = {
"color": "rgb(25,150,25)", "color": "rgb(25,150,25)",
"temp": 2, "temp": 2,
@ -910,3 +894,116 @@ elements.rubidiumhydroxidecrystals = {
stateHigh: "potassiumhydroxidecrystals", stateHigh: "potassiumhydroxidecrystals",
tempHigh: "1388", tempHigh: "1388",
} }
elements.esuperheater = {
conduct: 1,
color: '#dd1111',
colorObject: {
"r": 221,
"g": 17,
"b": 17
},
behavior: behaviors.WALL,
behaviorOn: [
[
"XX",
"HT:10",
"XX"
],
[
"HT:10",
"XX",
"HT:10"
],
[
"XX",
"HT:10",
"XX"
]
],
category: "machines",
name: "e-superheater",
},
elements.efreezer = {
conduct: 1,
color: '#ffffff',
colorObject: {
"r": 255,
"g": 255,
"b": 255
},
behavior: behaviors.WALL,
behaviorOn: [
[
"XX",
"CO:10",
"XX"
],
[
"CO:10",
"XX",
"CO:10"
],
[
"XX",
"CO:10",
"XX"
]
],
category: "machines",
name: "e-freezer",
},
elements.mixer = {
name: "Mixer",
behavior:[
[
"SW",
"SW",
"SW"
],
[
"SW",
"XX",
"SW"
],
[
"SW",
"SW",
"SW"
]
],
category: "machines",
noMix: true,
}
let item = "";
elements.improvedsensor = {
behavior: behaviors.WALL,
color: "#bebfa3",
onSelect: function(){
item = prompt("what item should it detect?");
},
tick: function(pixel) {
if(pixel.start == pixelTicks){
pixel.clone = item;
}
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = pixel.x + coords[0];
var y = pixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var sensed = pixelMap[x][y];
if (sensed.element == pixel.clone) {
pixel.charge = 5;
break;
}
}
}
doDefaults(pixel);
},
conduct: 1,
movable: false,
category:"machines",
darkText: true,
hardness: 1,
};