cursed shock tool

This commit is contained in:
Lily-129 2022-02-12 19:17:04 -05:00 committed by GitHub
parent 2ae92dcb9a
commit 2e07fc1e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 0 deletions

View File

@ -17,3 +17,37 @@ elements.extinguisher = {
category: "tools",
excludeRandom: true,
};
elements.cursed_shock = {
color: ["#ffff00", "#00ff00", "#ffff00", "#00ff00", "#ffff00", "#00ff00", "#ffff00", "#00ff00"],
tool: function(pixel) {
var con = elements[pixel.element].conduct;
if (con == undefined) {con = 0}
if (Math.random() < con || con == 0) { // If random number is less than conductivity, or anyway
if (!pixel.charge && !pixel.chargeCD) {
pixel.charge = 1;
if (elements[pixel.element].colorOn) {
pixel.color = pixelColorPick(pixel);
}
}
}
if(Math.random() > con) {
if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation)
pixel.temp += 0.25;
pixelTempCheck(pixel);
}
}
},
category: "tools",
excludeRandom: true,
};
elements.extinguisher = {
color: "#bad1e3",
tool: function(pixel) {
if(pixel.burnStart) { delete pixel.burnStart }
pixel.burning = false;
},
category: "tools",
excludeRandom: true,
};