Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
aa254fd498
|
|
@ -397,28 +397,6 @@ runAfterLoad(function(){
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (currentElement === "shock") {
|
||||
if (!isEmpty(x,y,true)) {
|
||||
// One loop that repeats 5 times if shiftDown else 1 time
|
||||
for (var j = 0; j < (shiftDown ? 5 : 1); j++) {
|
||||
var pixel = pixelMap[x][y];
|
||||
var con = elements[pixel.element].conduct;
|
||||
if (con == undefined) {continue}
|
||||
if (Math.random() < con) { // If random number is less than conductivity
|
||||
if (!pixel.charge && !pixel.chargeCD) {
|
||||
pixel.charge = 1;
|
||||
if (elements[pixel.element].colorOn) {
|
||||
pixel.color = pixelColorPick(pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (elements[pixel.element].insulate != true) { // Otherwise heat the pixel (Resistance simulation)
|
||||
pixel.temp += 0.25;
|
||||
pixelTempCheck(pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) {
|
||||
// run the tool function on the pixel
|
||||
if (!isEmpty(x,y,true)) {
|
||||
|
|
@ -434,7 +412,7 @@ runAfterLoad(function(){
|
|||
if (survivalCount(currentElement) < 1 && elements[currentElement].category !== "tools") {
|
||||
return;
|
||||
}
|
||||
currentPixels.push(new Pixel(x, y, currentElement));
|
||||
createPixel(currentElement,x,y);
|
||||
if (elements[currentElement].customColor || elements[currentElement].singleColor) {
|
||||
pixelMap[x][y].color = pixelColorPick(currentElement,currentColor);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue