Create potato_chips.js

This commit is contained in:
guzzo86 2024-04-30 01:04:26 -04:00 committed by GitHub
parent 5b5c7d3f7b
commit 53c00e6592
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 44 additions and 0 deletions

44
mods/potato_chips.js Normal file
View File

@ -0,0 +1,44 @@
elements.potato_chip = {
behavior: behaviors.STURDYPOWDER,
state: "solid",
density: 1350,
color: ["#F7DD93", "#D8A44B"],
category: "food",
desc: "Potato chip. Turns potato next to it into potato chip if temp is >= 104.",
tick: function(pixel) {
if(pixelTicks - pixel.start >= 15) {
if (!isEmpty(pixel.x, pixel.y - 1, true)) {
if (pixel.temp >= 104 && pixelMap[pixel.x][pixel.y - 1].element === "potato") {
changePixel(pixelMap[pixel.x][pixel.y - 1], "potato_chip");
}
}
if (!isEmpty(pixel.x, pixel.y + 1, true)) {
if (pixel.temp >= 104 && pixelMap[pixel.x][pixel.y + 1].element === "potato") {
changePixel(pixelMap[pixel.x][pixel.y + 1], "potato_chip");
}
}
if (!isEmpty(pixel.x - 1, pixel.y, true)) {
if (pixel.temp >= 104 && pixelMap[pixel.x - 1][pixel.y].element === "potato") {
changePixel(pixelMap[pixel.x - 1][pixel.y], "potato_chip");
}
}
if (!isEmpty(pixel.x + 1,pixel.y, true)) {
if (pixel.temp >= 104 && pixelMap[pixel.x + 1][pixel.y].element === "potato") {
changePixel(pixelMap[pixel.x + 1][pixel.y], "potato_chip");
}
}
}
}
}
elements.sunflower_oil = {
behavior: behaviors.LIQUID,
color: ["#FFFFCC", "#FFFF99", "#FFFF66", "#FFFF33", "#FFFF00", "#FFCC00"],
viscosity: 63,
category: "food",
state: "liquid",
reactions: {
"potato": {elem2: "potato_chip", tempMin: 140},
}
}