add nich tick to mnich

This commit is contained in:
Laetitia (O-01-67) 2023-02-06 18:54:00 -05:00 committed by GitHub
parent d608af8060
commit 922a1bb4ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -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 = {