forgor
This commit is contained in:
parent
97db25310a
commit
36498269a3
|
|
@ -215,21 +215,24 @@ elements.polusium = {
|
||||||
state: "solid",
|
state: "solid",
|
||||||
category: "solids",
|
category: "solids",
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
|
var emptyNeighbors = [];
|
||||||
for(i = 0; i < neighbors.length; i++) {
|
for(i = 0; i < adjacentCoords.length; i++) {
|
||||||
if(isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) {
|
if(isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) {
|
||||||
|
emptyNeighbors.push(adjacentCoords[i]);
|
||||||
|
};
|
||||||
|
};
|
||||||
if(Math.random() < 0.002) {
|
if(Math.random() < 0.002) {
|
||||||
|
if(emptyNeighbors.length > 0) {
|
||||||
|
var randomEmptyNeighbor = emptyNeighbors[Math.floor(Math.random() * emptyNeighbors.length)];
|
||||||
changePixel(pixel,"polusium_oxide")
|
changePixel(pixel,"polusium_oxide")
|
||||||
}
|
createPixel("nitrogen",pixel.x+randomEmptyNeighbor[0],pixel.y+randomEmptyNeighbor[1])
|
||||||
}
|
};
|
||||||
if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) {
|
};
|
||||||
if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == "salt_water") {
|
},
|
||||||
if(Math.random() < 0.006) {
|
reactions: {
|
||||||
changePixel(pixel,"polusium_oxide")
|
water: { elem1: "polusium_oxide", elem2: ["water","water","water","water","hydrogen"], chance: 0.006 },
|
||||||
}
|
salt_water: { elem1: "polusium_oxide", elem2: ["salt_water","salt_water","salt_water","salt","hydrogen"], chance: 0.012 },
|
||||||
}
|
bleach: { elem1: "polusium_oxide", chance: 0.02 }
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue