Semi-accurate heat transfer

This commit is contained in:
Nekonico 2024-09-21 10:33:17 -07:00 committed by GitHub
parent e467df979c
commit ceaf2f5d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 417 additions and 41 deletions

View File

@ -63,7 +63,9 @@ elements.sand_screen = {
var newPixel = pixelMap[pixel.x][pixel.y+1]; var newPixel = pixelMap[pixel.x][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"sand_screen"); changePixel(newPixel,"sand_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
} }
else if (newPixel.element === "water_screen") { else if (newPixel.element === "water_screen") {
changePixel(newPixel,"sand_screen"); changePixel(newPixel,"sand_screen");
@ -71,26 +73,29 @@ elements.sand_screen = {
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen"); changePixel(pixel,"water_screen");
} }
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x+1][pixel.y+1]; var newPixel = pixelMap[pixel.x+1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"sand_screen"); changePixel(newPixel,"sand_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "water_screen") {
changePixel(newPixel,"sand_screen");
pixel.dtemp = newPixel.dtemp;
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
} pixel.dtemp = 0;
}
else if (!isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"sand_screen");
changePixel(pixel,"sandboxels_screen");
} }
else if (newPixel.element === "water_screen") { else if (newPixel.element === "water_screen") {
changePixel(newPixel,"sand_screen"); changePixel(newPixel,"sand_screen");
@ -98,6 +103,53 @@ elements.sand_screen = {
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen"); changePixel(pixel,"water_screen");
} }
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
else if (!isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"sand_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "water_screen") {
changePixel(newPixel,"sand_screen");
pixel.dtemp = newPixel.dtemp;
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
} }
} }
}, },
@ -129,7 +181,9 @@ elements.rock_screen = {
var newPixel = pixelMap[pixel.x][pixel.y+1]; var newPixel = pixelMap[pixel.x][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"rock_screen"); changePixel(newPixel,"rock_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
} }
else if (newPixel.element === "water_screen") { else if (newPixel.element === "water_screen") {
changePixel(newPixel,"rock_screen"); changePixel(newPixel,"rock_screen");
@ -137,26 +191,29 @@ elements.rock_screen = {
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen"); changePixel(pixel,"water_screen");
} }
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x+1][pixel.y+1]; var newPixel = pixelMap[pixel.x+1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"rock_screen"); changePixel(newPixel,"rock_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "water_screen") {
changePixel(newPixel,"rock_screen");
pixel.dtemp = newPixel.dtemp;
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
} pixel.dtemp = 0;
}
else if (!isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"rock_screen");
changePixel(pixel,"sandboxels_screen");
} }
else if (newPixel.element === "water_screen") { else if (newPixel.element === "water_screen") {
changePixel(newPixel,"rock_screen"); changePixel(newPixel,"rock_screen");
@ -164,6 +221,53 @@ elements.rock_screen = {
newPixel.dtemp = pixel.dtemp; newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen"); changePixel(pixel,"water_screen");
} }
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
else if (!isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"rock_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "water_screen") {
changePixel(newPixel,"rock_screen");
pixel.dtemp = newPixel.dtemp;
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"water_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
} }
} }
}, },
@ -195,22 +299,74 @@ elements.water_screen = {
var newPixel = pixelMap[pixel.x][pixel.y+1]; var newPixel = pixelMap[pixel.x][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"water_screen"); changePixel(newPixel,"water_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
} }
else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x+1][pixel.y+1]; var newPixel = pixelMap[pixel.x+1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"water_screen"); changePixel(newPixel,"water_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
} }
} }
else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { else if (!isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1]; var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"water_screen"); changePixel(newPixel,"water_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
} }
} }
} }
@ -218,17 +374,176 @@ elements.water_screen = {
var newPixel = pixelMap[pixel.x+1][pixel.y]; var newPixel = pixelMap[pixel.x+1][pixel.y];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"water_screen"); changePixel(newPixel,"water_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
} }
} }
else if (!isEmpty(pixel.x-1,pixel.y,true)) { else if (!isEmpty(pixel.x-1,pixel.y,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y]; var newPixel = pixelMap[pixel.x-1][pixel.y];
if (newPixel.element === "sandboxels_screen") { if (newPixel.element === "sandboxels_screen") {
changePixel(newPixel,"water_screen"); changePixel(newPixel,"water_screen");
newPixel.dtemp = pixel.dtemp;
changePixel(pixel,"sandboxels_screen"); changePixel(pixel,"sandboxels_screen");
pixel.dtemp = 0;
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "steam_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
} }
} }
if (pixel.dtemp < 1) { changePixel(pixel,"ice_screen") } if (pixel.dtemp < 0) { changePixel(pixel,"ice_screen") }
if (pixel.dtemp > 99) { changePixel(pixel,"steam_screen") }
},
state: "solid",
density: 1200,
},
elements.steam_screen = {
name:"screen",
hidden:true,
color: "#abd6ff",
behavior: [
"SW:sandboxels_screen|XX|SW:sandboxels_screen",
"XX|XX|XX",
"SW:sandboxels_screen|XX|SW:sandboxels_screen",
],
properties: {
dtemp: 150,
},
tempHigh: 1500,
stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"],
conduct: 1,
breakInto: ["glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","water"],
tempLow: -45,
stateLow: "sandboxels_screen_off",
category: "digital",
tick: function(pixel) {
if (Math.random() > 0.75 && !isEmpty(pixel.x+1,pixel.y-1,true)) {
var newPixel = pixelMap[pixel.x+1][pixel.y-1];
if (newPixel.element === "sandboxels_screen") {
newPixel.dtemp = pixel.dtemp;
changePixel(newPixel,"steam_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "water_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
else if (Math.random() > 0.75 && !isEmpty(pixel.x-1,pixel.y-1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y-1];
if (newPixel.element === "sandboxels_screen") {
newPixel.dtemp = pixel.dtemp;
changePixel(newPixel,"steam_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "water_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
else if (Math.random() > 0.75 && !isEmpty(pixel.x+1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x+1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
newPixel.dtemp = pixel.dtemp;
changePixel(newPixel,"steam_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "water_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
else if (Math.random() > 0.5 && !isEmpty(pixel.x-1,pixel.y+1,true)) {
var newPixel = pixelMap[pixel.x-1][pixel.y+1];
if (newPixel.element === "sandboxels_screen") {
newPixel.dtemp = pixel.dtemp;
changePixel(newPixel,"steam_screen");
changePixel(pixel,"sandboxels_screen");
}
else if (newPixel.element === "ice_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "water_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "sand_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
else if (newPixel.element === "rock_screen") {
newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2);
pixel.dtemp = newPixel.dtemp;
}
}
if (pixel.dtemp < 100) { changePixel(pixel,"water_screen") }
}, },
state: "solid", state: "solid",
density: 1200, density: 1200,
@ -250,7 +565,7 @@ elements.ice_screen = {
stateLow: "sandboxels_screen_off", stateLow: "sandboxels_screen_off",
category: "digital", category: "digital",
tick: function(pixel) { tick: function(pixel) {
if (pixel.dtemp > 0) { changePixel(pixel,"water_screen") } if (pixel.dtemp > 5) { changePixel(pixel,"water_screen") }
}, },
state: "solid", state: "solid",
density: 1200, density: 1200,
@ -328,6 +643,24 @@ elements.digital_ice = {
desc: "Use on a screen to place digital ice." desc: "Use on a screen to place digital ice."
}, },
elements.digital_steam = {
color: "#abd6ff",
behavior: [
"CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen",
"CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen",
"CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen",
],
tool: function(pixel) {
if (elements[pixel.element].id === elements.sandboxels_screen.id) {
changePixel(pixel,"steam_screen");
}
},
insulate:true,
canPlace: false,
category: "digital",
desc: "Use on a screen to place digital ice."
},
elements.digital_heat = { elements.digital_heat = {
color: "#ff0000", color: "#ff0000",
behavior: [ behavior: [
@ -337,16 +670,19 @@ elements.digital_heat = {
], ],
tool: function(pixel) { tool: function(pixel) {
if (elements[pixel.element].id === elements.sand_screen.id) { if (elements[pixel.element].id === elements.sand_screen.id) {
pixel.dtemp += 2 pixel.dtemp += 1
} }
else if (elements[pixel.element].id === elements.rock_screen.id) { else if (elements[pixel.element].id === elements.rock_screen.id) {
pixel.dtemp += 2 pixel.dtemp += 1
} }
else if (elements[pixel.element].id === elements.water_screen.id) { else if (elements[pixel.element].id === elements.water_screen.id) {
pixel.dtemp += 2 pixel.dtemp += 1
}
else if (elements[pixel.element].id === elements.steam_screen.id) {
pixel.dtemp += 1
} }
else if (elements[pixel.element].id === elements.ice_screen.id) { else if (elements[pixel.element].id === elements.ice_screen.id) {
pixel.dtemp += 2 pixel.dtemp += 1
} }
}, },
insulate:true, insulate:true,
@ -364,16 +700,19 @@ elements.digital_cool = {
], ],
tool: function(pixel) { tool: function(pixel) {
if (elements[pixel.element].id === elements.sand_screen.id) { if (elements[pixel.element].id === elements.sand_screen.id) {
pixel.dtemp -= 2 pixel.dtemp -= 1
} }
else if (elements[pixel.element].id === elements.rock_screen.id) { else if (elements[pixel.element].id === elements.rock_screen.id) {
pixel.dtemp -= 2 pixel.dtemp -= 1
} }
else if (elements[pixel.element].id === elements.water_screen.id) { else if (elements[pixel.element].id === elements.water_screen.id) {
pixel.dtemp -= 2 pixel.dtemp -= 1
}
else if (elements[pixel.element].id === elements.steam_screen.id) {
pixel.dtemp -= 1
} }
else if (elements[pixel.element].id === elements.ice_screen.id) { else if (elements[pixel.element].id === elements.ice_screen.id) {
pixel.dtemp -= 2 pixel.dtemp -= 1
} }
}, },
insulate:true, insulate:true,
@ -382,6 +721,36 @@ elements.digital_cool = {
desc: "Use on a screen to cool digital elements." desc: "Use on a screen to cool digital elements."
}, },
elements.digital_roomtemp = {
color: "#b1c96d",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|XX|XX",
],
tool: function(pixel) {
if (elements[pixel.element].id === elements.sand_screen.id) {
pixel.dtemp = 20
}
else if (elements[pixel.element].id === elements.rock_screen.id) {
pixel.dtemp = 20
}
else if (elements[pixel.element].id === elements.water_screen.id) {
pixel.dtemp = 20
}
else if (elements[pixel.element].id === elements.steam_screen.id) {
pixel.dtemp = 20
}
else if (elements[pixel.element].id === elements.ice_screen.id) {
pixel.dtemp = 20
}
},
insulate:true,
canPlace: false,
category: "digital",
desc: "Use on a screen to make digital elements room temperature."
},
elements.digital_smash = { elements.digital_smash = {
color: ["#666666","#888888","#666666"], color: ["#666666","#888888","#666666"],
behavior: [ behavior: [
@ -399,4 +768,11 @@ elements.digital_smash = {
category: "digital", category: "digital",
desc: "Use on a screen to smash digital elements." desc: "Use on a screen to smash digital elements."
}; };
if (!elements.malware.reactions) { elements.malware.reactions = {} }
elements.malware.reactions.sandboxels_screen = { "elem2": ["sand_screen","sandboxels_screen_off",null], chance:0.1 };
elements.malware.reactions.sand_screen = { "elem2": ["ice_screen","sandboxels_screen_off",null], chance:0.1 };
elements.malware.reactions.rock_screen = { "elem2": ["water_screen","sandboxels_screen_off",null], chance:0.1 };
elements.malware.reactions.water_screen = { "elem2": ["steam_screen","sandboxels_screen_off",null], chance:0.1 };
elements.malware.reactions.steam_screen = { "elem2": ["rock_screen","sandboxels_screen_off",null], chance:0.1 };
elements.malware.reactions.ice_screen = { "elem2": ["sand_screen","sandboxels_screen_off",null], chance:0.1 };