cursed shock tool
This commit is contained in:
parent
2ae92dcb9a
commit
2e07fc1e04
|
|
@ -17,3 +17,37 @@ elements.extinguisher = {
|
||||||
category: "tools",
|
category: "tools",
|
||||||
excludeRandom: true,
|
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,
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue