From 922a1bb4ede5dc5114ba39d4080704cfc54db3e5 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:54:00 -0500 Subject: [PATCH] add nich tick to mnich --- mods/metals.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mods/metals.js b/mods/metals.js index 51a2ca4d..ff8a27cd 100644 --- a/mods/metals.js +++ b/mods/metals.js @@ -70,6 +70,20 @@ if(enabledMods.includes(changeTempMod) && enabledMods.includes(runAfterAutogenMo reactions: { //(test.hello ??= {}).world molten_nickel: { elem1: "molten_nickel", elem2: "molten_nichrome", chance: 0.4, changeTemp: false, oneway: true }, }, + tick: function(pixel) { + if(nichromeDoNeighborCount) { + var neighbors = 0; + for(i = 0; i < adjacentCoords.length; i++) { + if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) { + var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]]; + if(elements[newPixel.element].conduct) { neighbors++ }; + }; + }; + }; + if(pixel.charge) { + pixel.temp += ((1.1 + nichromeNeighborLogic(neighbors)) * pixel.charge); + }; + }, }; worldgentypes.test = {