fixed long-standing bug, revamped petrotheum
This commit is contained in:
parent
388238ead8
commit
63a45557cf
|
|
@ -25,9 +25,9 @@ elements.blazing_pyrotheum = {
|
||||||
elements.gelid_cryotheum = {
|
elements.gelid_cryotheum = {
|
||||||
color: "#00ddff",
|
color: "#00ddff",
|
||||||
behavior: [
|
behavior: [
|
||||||
" AND CR:snow%0.35HT:10%2|HT:10%2| AND CR:snow%0.35HT:10%2",
|
" AND CR:snow%0.35CR:10%2|CR:10%2| AND CR:snow%0.35CR:10%2",
|
||||||
"M2 AND CR:snow%0.35 AND HT:10%2|HT:10%2|M2 AND CR:snow%0.35 AND HT:10%2",
|
"M2 AND CR:snow%0.35 AND CR:10%2|CR:10%2|M2 AND CR:snow%0.35 AND CR:10%2",
|
||||||
"M1 AND HT:10%2|M1 AND CR:snow%0.25 AND HT:10%2|M1 AND HT:10%2",
|
"M1 AND CR:10%2|M1 AND CR:snow%0.25 AND CR:10%2|M1 AND CR:10%2",
|
||||||
],
|
],
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
if(pixel.temp >= -223) { //temperature maximum of -223
|
if(pixel.temp >= -223) { //temperature maximum of -223
|
||||||
|
|
@ -51,21 +51,29 @@ elements.tectonic_petrotheum = {
|
||||||
"M2|XX|M2",
|
"M2|XX|M2",
|
||||||
"M1|M1|M1",
|
"M1|M1|M1",
|
||||||
],
|
],
|
||||||
reactions: {
|
tick: function(pixel) { //Code from R74n/vanilla "smash" tool
|
||||||
"rock": { "elem2": "gravel" },
|
neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
|
||||||
"mudstone": { "elem2": "mud" }, //i took creative liberties with what it breaks :eggTF:
|
for(i = 0; i < neighbors.length; i++) {
|
||||||
"packed_sand": { "elem2": "sand" }, //stone->gravel is explicitly shown and chalcopyrite_ore->
|
if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) {
|
||||||
"ice": { "elem2": "snow" }, //chalcopyrite_dust is implied, the rest of this section
|
if (typeof(elements[ pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element ].breakInto) !== "undefined") {
|
||||||
"packed_snow": { "elem2": "snow" }, //isn't thermal foundation canon*/
|
var hardness = null;
|
||||||
"basalt": { "elem2": "basalt_gravel" },
|
if (typeof(elements[ pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element ].hardness) === "number") {
|
||||||
"limestone": { "elem2": "limestone_gravel" },
|
hardness = elements[ pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element ].hardness
|
||||||
"concrete": { "elem2": "dust" },
|
} else {
|
||||||
"brick": { "elem2": "brick_rubble" },
|
hardness = 1
|
||||||
"wood": { "elem2": "sawdust" },
|
}
|
||||||
"glass": { "elem2": "glass_shard" },
|
if (Math.random() < hardness) {
|
||||||
"ruins": { "elem2": "dust" },
|
var breakInto = elements[ pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element ].breakInto;
|
||||||
"chalcopyrite_ore": { "elem2": "chalcopyrite_dust" }
|
// if breakInto is an array, pick one
|
||||||
},
|
if (Array.isArray(breakInto)) {
|
||||||
|
breakInto = breakInto[Math.floor(Math.random() * breakInto.length)];
|
||||||
|
};
|
||||||
|
changePixel( pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]] ,breakInto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
temp: 120,
|
temp: 120,
|
||||||
viscosity: 1.5**4,
|
viscosity: 1.5**4,
|
||||||
category: "liquids",
|
category: "liquids",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue