From 40c8b84e624f14bad9a79d33f699e4be4daae42b Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Thu, 23 Feb 2023 09:05:19 -0500 Subject: [PATCH] neutron star fix --- mods/the_ground.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/the_ground.js b/mods/the_ground.js index 1de9032c..661a6338 100644 --- a/mods/the_ground.js +++ b/mods/the_ground.js @@ -72,18 +72,21 @@ Proper classification of limestone within these code comments } }; + ferromagneticMaterials = ["iron", "cobalt", "nickel", "steel", "hematite"]; + function neutronStarLightAndConduction(pixel,c,whitelist=["neutron_star"]) { for (var i = 0; i < adjacentCoords.length; i++) { var x = pixel.x+adjacentCoords[i][0]; var y = pixel.y+adjacentCoords[i][1]; if (isEmpty(x,y)) { if (Math.random() <= c) { - createPixel(Math.random() < 0.8 ? "light" : "neutron", x, y); + createPixel(Math.random() < 0.995 ? "light" : "neutron", x, y); pixelMap[x][y].color = pixel.color; }; } else if (!outOfBounds(x,y)) { var newPixel = pixelMap[x][y]; - if(Math.random() < 0.1 && newPixel.conduct) { newPixel.charge = 3 }; //no magnetism in sb + //console.log(elements[newPixel.element].conduct); + if(ferromagneticMaterials.includes(newPixel.element) && (Math.random() < 0.1)) { newPixel.charge = 20 }; //no magnetism in sb //console.log(whitelist,newPixel.element,whitelist.includes(newPixel.element)); if (pixel.temp!==newPixel.temp && whitelist.includes(newPixel.element)) { var avg = (pixel.temp + newPixel.temp)/2;