Merge branch 'main' of https://github.com/slweeb/sandboxels
This commit is contained in:
commit
8c216bf721
|
|
@ -420,13 +420,13 @@ behavior: behaviors.LIQUID,
|
||||||
category: "liquids",
|
category: "liquids",
|
||||||
reactions: {
|
reactions: {
|
||||||
"chlorine": { "elem1": "titanium_tetrachloride", "elem2":null },
|
"chlorine": { "elem1": "titanium_tetrachloride", "elem2":null },
|
||||||
density: 10000
|
|
||||||
},
|
},
|
||||||
density: 4230,
|
density: 4230,
|
||||||
state: "liquid",
|
state: "liquid",
|
||||||
temp: 2000,
|
temp: 2000,
|
||||||
tempLow: 1843,
|
tempLow: 1843,
|
||||||
stateLow: "rutile"
|
stateLow: "rutile",
|
||||||
|
viscosity: 10000
|
||||||
};
|
};
|
||||||
elements.titanium_tetrachloride = {
|
elements.titanium_tetrachloride = {
|
||||||
color: "#d9d7b2",
|
color: "#d9d7b2",
|
||||||
|
|
@ -494,13 +494,13 @@ behavior: behaviors.LIQUID,
|
||||||
category: "liquids",
|
category: "liquids",
|
||||||
reactions: {
|
reactions: {
|
||||||
"molten_mithril": { "elem1": "molten_mythril_mithril_alloy", "elem2":null },
|
"molten_mithril": { "elem1": "molten_mythril_mithril_alloy", "elem2":null },
|
||||||
viscosity: 10000
|
|
||||||
},
|
},
|
||||||
density: 6855,
|
density: 6855,
|
||||||
state: "liquid",
|
state: "liquid",
|
||||||
tempLow: 2500,
|
tempLow: 2500,
|
||||||
stateLow: "mythril",
|
stateLow: "mythril",
|
||||||
temp: 3000
|
temp: 3000,
|
||||||
|
viscosity: 10000
|
||||||
};
|
};
|
||||||
elements.argon = {
|
elements.argon = {
|
||||||
color: "#92dec7",
|
color: "#92dec7",
|
||||||
|
|
@ -939,11 +939,128 @@ stateLow: "carbon",
|
||||||
tempLow: 3550,
|
tempLow: 3550,
|
||||||
temp: 5000,
|
temp: 5000,
|
||||||
density: 1.2,
|
density: 1.2,
|
||||||
|
viscosity: 10000,
|
||||||
|
};
|
||||||
|
elements.titanium = {
|
||||||
|
color: "#e3e5e6",
|
||||||
|
category: "solids",
|
||||||
|
state: "solid",
|
||||||
|
behavior: behaviors.WALL,
|
||||||
|
stateHigh: "molten_titanium",
|
||||||
|
tempHigh: 1668,
|
||||||
|
conduct: 0.5,
|
||||||
|
};
|
||||||
|
elements.molten_titanium = {
|
||||||
|
color: ["#e0921d", "#e89e2e", "#f7b24a", "#fce168", "#fceca2", "#fffcf0"],
|
||||||
|
category: "liquids",
|
||||||
|
state: "liquid",
|
||||||
|
behavior: behaviors.LIQUID,
|
||||||
|
stateLow: "titanium",
|
||||||
|
tempLow: 1668,
|
||||||
|
temp: 2000,
|
||||||
|
viscosity: 10000
|
||||||
|
};
|
||||||
|
elements.toxin = {
|
||||||
|
color: "#07f71b",
|
||||||
|
category: "liquids",
|
||||||
|
state: "liquid",
|
||||||
|
behavior: behaviors.LIQUID,
|
||||||
|
stateLow: "toxic_ice",
|
||||||
|
tempLow: -10,
|
||||||
|
stateHigh: "toxic_gas",
|
||||||
|
tempHigh: 115,
|
||||||
|
reactions: {
|
||||||
|
"water": { "elem1":null, "elem2":"toxic_water" },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
lifeArray = ["plant", "dead_plant", "frozen_plant", "grass", "algae", "cell", "cancer", "flea", "termite", "ant", "worm", "fly", "firefly", "bee", "human", "body", "head", "rat", "frog", "frozen_frog", "fish", "slug", "snail", "bone_marrow", "sapling", "seeds", "grass_seed", "wheat_seed", "wheat", "pollen", "flower_seed", "pistil", "petal", "vine", "bamboo", "bamboo_plant", "mushroom_spore", "mushroom_stalk", "mushroom_gills", "mushroom_cap", "hyphae", "lichen", "cellulose", "corn_seed", "potato_seed", "root", "berry_seed", "old_berry_leaf", "berry_leaf", "berry", "slime", "blood", "antibody", "infection", "meat", "rotten_meat", "frozen_meat", "yeast"]
|
||||||
|
if(!elements.toxin.reactions) {
|
||||||
|
elements.toxin.reactions = {}
|
||||||
|
}
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.toxin.reactions[lifeArray[i]] = { "elem1":null, "elem2":"dead" }
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
// (Ignore this comment if it's not in another comment anymore) this whole area is a comment only because I don't want the game to try using useless code and (possibly) error out.
|
||||||
|
if(!elements.toxic_gas.reactions) {
|
||||||
|
elements.toxic_gas.reactions = {}
|
||||||
|
}
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.toxic_gas.reactions[lifeArray[i]] = { "elem1":null, "elem2":"dead" }
|
||||||
|
};
|
||||||
|
if(!elements.toxic_ice.reactions) {
|
||||||
|
elements.toxic_ice.reactions = {}
|
||||||
|
}
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.toxic_ice.reactions[lifeArray[i]] = { "elem1":null, "elem2":"dead" }
|
||||||
|
};
|
||||||
|
if(!elements.toxic_water.reactions) {
|
||||||
|
elements.toxic_water.reactions = {}
|
||||||
|
}
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.toxic_water.reactions[lifeArray[i]] = { "elem1":null, "elem2":"dead" }
|
||||||
|
}; */
|
||||||
|
elements.laser_emitter = {
|
||||||
|
color: "#8a8886",
|
||||||
|
category: "machines",
|
||||||
|
state: "solid",
|
||||||
|
behavior: behaviors.LASEREMITTER
|
||||||
|
};
|
||||||
|
behaviors.LASEREMITTER = [
|
||||||
|
"CR:laser|CR:laser|CR:laser",
|
||||||
|
"CR:laser|XX|CR:laser",
|
||||||
|
"CR:laser|CR:laser|CR:laser",
|
||||||
|
];
|
||||||
|
elements.e_laser_emitter = {
|
||||||
|
color: "#8a8886",
|
||||||
|
colorOn: "#db5b0b",
|
||||||
|
category: "machines",
|
||||||
|
state: "solid",
|
||||||
|
behavior: behaviors.WALL,
|
||||||
|
behaviorOn: behaviors.LASEREMITTER,
|
||||||
|
conduct: 1,
|
||||||
|
};
|
||||||
|
elements.dead = {
|
||||||
|
color: "#a5a683",
|
||||||
|
category: "life",
|
||||||
|
state: "solid",
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
density: 10,
|
||||||
|
};
|
||||||
|
elements.ilitium = {
|
||||||
|
color: "#97baa7",
|
||||||
|
category: "solids",
|
||||||
|
state: "solid",
|
||||||
|
behavior: [
|
||||||
|
"XX|M2%0.001|XX",
|
||||||
|
"M1%0.1|XX|M1%0.1",
|
||||||
|
"XX|M2%0.0015|XX",
|
||||||
|
],
|
||||||
|
};
|
||||||
|
elements.quartz = {
|
||||||
|
color: ["#f2f0e4", "#f7f7f2", "#bdb69f"],
|
||||||
|
category: "solids",
|
||||||
|
state: "solid",
|
||||||
|
behavior: behaviors.WALL,
|
||||||
|
tempHigh: 1715,
|
||||||
|
stateHigh: "molten_quartz"
|
||||||
|
};
|
||||||
|
elements.molten_quartz = {
|
||||||
|
color: ["#e0960b", "#edb92b", "#f7d748", "#ffe675", "#ede2af", "#fffdf2"],
|
||||||
|
category: "liquids",
|
||||||
|
state: "liquid",
|
||||||
|
behavior: behaviors.LIQUID,
|
||||||
|
tempLow: 1715,
|
||||||
|
stateLow: "quartz",
|
||||||
|
temp: 2000,
|
||||||
|
viscosity: 10000,
|
||||||
|
density: 2.65
|
||||||
};
|
};
|
||||||
/* Unfinished:
|
/* Unfinished:
|
||||||
magnesium
|
magnesium
|
||||||
hematite mixture
|
hematite mixture
|
||||||
molten magnesium
|
molten magnesium
|
||||||
titanium
|
silicon
|
||||||
molten titanium
|
molten silicon
|
||||||
|
silicon dioxide
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,410 @@
|
||||||
|
//Glenn's Gases is licensed under the GNU LGPL.
|
||||||
|
//http://www.gnu.org/licenses/lgpl.html
|
||||||
|
//https://www.jamieswhiteshirt.com/minecraft/mods/gases/information/?Licensing
|
||||||
|
|
||||||
|
//This works best with the Neutronium Mod because I really don't feel like remaking coal and chlorine.
|
||||||
|
|
||||||
|
//Steam exists.
|
||||||
|
|
||||||
|
//Coal only exists in the Neutronium Mod.
|
||||||
|
elements.coal_dust = {
|
||||||
|
color: "#363023",
|
||||||
|
behavior: behaviors.GAS,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.burning) {
|
||||||
|
explodeAt(pixel.x,pixel.y,11,"fire,ignited_gas")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 561,
|
||||||
|
state: "gas",
|
||||||
|
burn: 132,
|
||||||
|
burnTime: 10,
|
||||||
|
burnInto: ["ash", "fire", "carbon_dioxide"],
|
||||||
|
};
|
||||||
|
|
||||||
|
//Chlorine only exists in the Neutronium Mod and I don't feel like recreating it, so enable NM for the full experience.
|
||||||
|
|
||||||
|
//Natural gas is mostly ammonia, which exists.
|
||||||
|
|
||||||
|
elements.red_gas = {
|
||||||
|
color: "#c74c52",
|
||||||
|
behavior: [
|
||||||
|
"M2%50|M1%50|M2%50",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.burning) {
|
||||||
|
explodeAt(pixel.x,pixel.y,12,"fire,ignited_gas")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.5,
|
||||||
|
state: "gas",
|
||||||
|
burn: 300,
|
||||||
|
burnTime: 10,
|
||||||
|
burnInto: ["fire", "explosion", "explosion"],
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
elements.nitrous_gas = {
|
||||||
|
color: "#854428",
|
||||||
|
behavior: [
|
||||||
|
"M2%50|M1%50|M2%50",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
reactions: {
|
||||||
|
"water": {"elem1": "acidic_vapour", "elem2": "acidic_vapour"}
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.5,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
elements.acidic_vapour = {
|
||||||
|
color: ["#5282d1", "#4e6fad"],
|
||||||
|
behavior: [
|
||||||
|
"M2|M1 AND DB|M2",
|
||||||
|
"M1 AND DB|XX|M1 AND DB",
|
||||||
|
"M2%50|M1%50 AND DB|M2%50",
|
||||||
|
],
|
||||||
|
ignore: elements.acid.ignore,
|
||||||
|
category: "gases",
|
||||||
|
density: 1.5,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
elements.void_gas = {
|
||||||
|
color: "#111111",
|
||||||
|
behavior: [
|
||||||
|
"M2%50|M1%50|M2%50",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
reactions: {
|
||||||
|
"light": { "elem1": null, "chance": 0.1 },
|
||||||
|
"fire": { "elem1": null, "chance": 0.08 },
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.5,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
elements.electric_gas = {
|
||||||
|
color: ["#3693b3", "#246e64"],
|
||||||
|
behavior: [
|
||||||
|
"M2 AND CR:electric%1|M1 AND CR:electric%1|M2 AND CR:electric%1",
|
||||||
|
"M1 AND CR:electric%1|XX |M1 AND CR:electric%1",
|
||||||
|
"M2 AND CR:electric%1|M1 AND CR:electric%1|M2 AND CR:electric%1",
|
||||||
|
],
|
||||||
|
hardness: 0.6,
|
||||||
|
reactions: {
|
||||||
|
"corrosive_gas": { "elem2": "turquoise_dust", "elem1": "blue_dust", "chance": 0.5 },
|
||||||
|
"blue_dust": { "elem1": null, "elem2": "turquoise_dust", "chance": 0.5 },
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.225,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
corrosiveGasMaxHardness = 0.5
|
||||||
|
|
||||||
|
elements.corrosive_gas = {
|
||||||
|
color: ["#2929e6", "#151cad"],
|
||||||
|
behavior: [
|
||||||
|
"M2|M1|M2",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
hardness: 0.6,
|
||||||
|
tick: function(pixel) {
|
||||||
|
//delete neighbors
|
||||||
|
if(!isEmpty(pixel.x-1,pixel.y) && !outOfBounds(pixel.x-1,pixel.y)) {
|
||||||
|
if(!elements[pixelMap[pixel.x-1][pixel.y].element].hardness || elements[pixelMap[pixel.x-1][pixel.y].element].hardness <= corrosiveGasMaxHardness) {
|
||||||
|
deletePixel(pixel.x-1,pixel.y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isEmpty(pixel.x+1,pixel.y) && !outOfBounds(pixel.x+1,pixel.y)) {
|
||||||
|
if(!elements[pixelMap[pixel.x+1][pixel.y].element].hardness || elements[pixelMap[pixel.x+1][pixel.y].element].hardness <= corrosiveGasMaxHardness) {
|
||||||
|
deletePixel(pixel.x+1,pixel.y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isEmpty(pixel.x,pixel.y-1) && !outOfBounds(pixel.x,pixel.y-1)) {
|
||||||
|
if(!elements[pixelMap[pixel.x][pixel.y-1].element].hardness || elements[pixelMap[pixel.x][pixel.y-1].element].hardness <= corrosiveGasMaxHardness) {
|
||||||
|
deletePixel(pixel.x,pixel.y-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isEmpty(pixel.x,pixel.y+1) && !outOfBounds(pixel.x,pixel.y+1)) {
|
||||||
|
if(!elements[pixelMap[pixel.x][pixel.y+1].element].hardness || elements[pixelMap[pixel.x][pixel.y+1].element].hardness <= corrosiveGasMaxHardness) {
|
||||||
|
deletePixel(pixel.x,pixel.y+1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reactions: {
|
||||||
|
"electric_gas": { "elem2": "blue_dust", "elem1": "turquoise_dust", "chance": 0.5 },
|
||||||
|
"turquoise_dust": { "elem1": null, "elem2": "blue_dust", "chance": 0.5 },
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.225,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
elements.blue_dust = {
|
||||||
|
color: ["#063ca1", "#042d94", "#063ca1", "#042d94", "#1d66ff"],
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
hardness: 0.6,
|
||||||
|
category: "powders",
|
||||||
|
state: "solid",
|
||||||
|
density: 1600,
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.turquoise_dust = {
|
||||||
|
color: ["#12a6a6","#1aa3a3","#12a6a6","#1aa3a3","#00ffff"],
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
hardness: 0.6,
|
||||||
|
category: "powders",
|
||||||
|
state: "solid",
|
||||||
|
density: 1600,
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.black_damp = {
|
||||||
|
color: "#000000",
|
||||||
|
behavior: [
|
||||||
|
"M2|M1|M2",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
reactions: {
|
||||||
|
"fire": { elem2: null },
|
||||||
|
},
|
||||||
|
tick: function(pixel) {
|
||||||
|
backgroundColor = hexToRGB(settings.bg);
|
||||||
|
pixel.rgbValue = "rgb("+backgroundColor.r+","+backgroundColor.g+","+backgroundColor.b+")";
|
||||||
|
pixel.color = pixel.rgbValue;
|
||||||
|
},
|
||||||
|
hardness: 0.6,
|
||||||
|
category: "gases",
|
||||||
|
density: 1.225,
|
||||||
|
state: "gas",
|
||||||
|
};
|
||||||
|
|
||||||
|
if(!elements.torch.reactions) {
|
||||||
|
elements.torch.reactions = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.torch.reactions.black_damp = { elem1: "wood" }
|
||||||
|
|
||||||
|
elements.rock_dust = {
|
||||||
|
color: "#878783",
|
||||||
|
behavior: [
|
||||||
|
"M2%50|M1%50|M2%50",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
reactions: {
|
||||||
|
"water": {"elem1": "dirty_water", "elem2": null }
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.225,
|
||||||
|
state: "gas",
|
||||||
|
tempHigh: 950,
|
||||||
|
stateHigh: "magma",
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.rock.breakInto.push("rock_dust")
|
||||||
|
|
||||||
|
lightArray = ["fire", "plasma", "cold_fire", "light", "laser", "electric", "radiation", "mystic_fire", "liquid_fire", "liquid_plasma", "liquid_cold_fire", "le_liquid_light", "liquid_laser", "liquid_electric", "liquid_radiation", "liquid_mystic_fire", "magma", "liquid_light", "solid_light"]
|
||||||
|
|
||||||
|
ledArray = ["led_r", "led_g", "led_b"]
|
||||||
|
|
||||||
|
elements.iocalfaeus_gas = {
|
||||||
|
color: ["#562173", "#481b61"],
|
||||||
|
behavior: [
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
"M2%50|M1%50|M2%50",
|
||||||
|
],
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(!pixel.hot) {
|
||||||
|
pixel.hot = false
|
||||||
|
}
|
||||||
|
for (let i = -2; i < 3; i++) {
|
||||||
|
for (let j = -2; j < 3; j++) {
|
||||||
|
if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) {
|
||||||
|
if ((lightArray.includes(pixelMap[pixel.x+j][pixel.y+i].element)) || (pixelMap[pixel.x+j][pixel.y+i].element.includes("molten_")) || (pixelMap[pixel.x+j][pixel.y+i].element.includes("vaporized_")) || (ledArray.includes(pixelMap[pixel.x+j][pixel.y+i].element) && pixelMap[pixel.x+j][pixel.y+i].charge)) {
|
||||||
|
pixel.hot = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(pixel.hot == true) {
|
||||||
|
pixel.temp += 16
|
||||||
|
}
|
||||||
|
if(pixel.hot == true && Math.random() < 0.02) {
|
||||||
|
pixel.hot = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.2,
|
||||||
|
state: "gas",
|
||||||
|
}
|
||||||
|
|
||||||
|
//Helium exists.
|
||||||
|
|
||||||
|
finineRange = 6
|
||||||
|
|
||||||
|
elements.finine = {
|
||||||
|
color: ["#ffffec", "#fafade", "#ebebd5", "#c9c9b7", "#80806f"],
|
||||||
|
behavior: [
|
||||||
|
"M2|M1|M2",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2|M1|M2",
|
||||||
|
],
|
||||||
|
tick: function(pixel) {
|
||||||
|
for (let i = -2; i < 3; i++) {
|
||||||
|
for (let j = -2; j < 3; j++) {
|
||||||
|
if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) {
|
||||||
|
if (lifeArray.includes(pixelMap[pixel.x+j][pixel.y+i].element)) {
|
||||||
|
pixel.eeex = pixel.x + Math.floor(Math.random() * ((2 * finineRange) + 1)) - finineRange
|
||||||
|
pixel.eeey = pixel.y + Math.floor(Math.random() * ((2 * finineRange) + 1)) - finineRange
|
||||||
|
//if human
|
||||||
|
//handle heads
|
||||||
|
if(pixelMap[pixel.x+j][pixel.y+i].element == "head") {
|
||||||
|
if(isEmpty(pixel.eeex,pixel.eeey) && !outOfBounds(pixel.eeex,pixel.eeey) && isEmpty(pixel.eeex,pixel.eeey+1) && !outOfBounds(pixel.eeex,pixel.eeey+1)) {
|
||||||
|
tryMove(pixelMap[pixel.x+j][pixel.y+i],pixel.eeex,pixel.eeey)
|
||||||
|
tryMove(pixelMap[pixel.x+j][pixel.y+i+1],pixel.eeex,pixel.eeey+1)
|
||||||
|
}
|
||||||
|
} else if(pixelMap[pixel.x+j][pixel.y+i].element == "body") {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(isEmpty(pixel.eeex,pixel.eeey) && !outOfBounds(pixel.eeex,pixel.eeey)) {
|
||||||
|
tryMove(pixelMap[pixel.x+j][pixel.y+i],pixel.eeex,pixel.eeey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "gases",
|
||||||
|
density: 1.225,
|
||||||
|
state: "gas",
|
||||||
|
}
|
||||||
|
|
||||||
|
//Smoke exists.
|
||||||
|
|
||||||
|
elements.ignited_gas = {
|
||||||
|
color: ["#fc9a58", "#faae3c", "#ffef3d"],
|
||||||
|
behavior: [
|
||||||
|
"M2|M1 AND CR:fire%0.5|M2",
|
||||||
|
"M1 AND CR:fire%0.5|XX|M1 AND CR:fire%0.5",
|
||||||
|
"M2|M1 AND CR:fire%0.5|M2",
|
||||||
|
],
|
||||||
|
category: "gases",
|
||||||
|
state: "gas",
|
||||||
|
density: 0.306,
|
||||||
|
burning: true,
|
||||||
|
burnTime: 30,
|
||||||
|
temp: elements.fire.temp,
|
||||||
|
burnInto: ["fire","smoke"],
|
||||||
|
hidden: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
//Diabaline
|
||||||
|
|
||||||
|
elements.diabaline = {
|
||||||
|
color: "#7e4e9c",
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(!pixel.glow) {
|
||||||
|
pixel.glow = false
|
||||||
|
}
|
||||||
|
if(!pixel.oldColor) {
|
||||||
|
pixel.oldColor = pixel.color
|
||||||
|
}
|
||||||
|
if(!pixel.rA) {
|
||||||
|
pixel.rA = 0
|
||||||
|
}
|
||||||
|
if(!pixel.gA) {
|
||||||
|
pixel.gA = 0
|
||||||
|
}
|
||||||
|
if(!pixel.bA) {
|
||||||
|
pixel.bA = 0
|
||||||
|
}
|
||||||
|
if(!pixel.rB) {
|
||||||
|
pixel.rB = 0
|
||||||
|
}
|
||||||
|
if(!pixel.gB) {
|
||||||
|
pixel.gB = 0
|
||||||
|
}
|
||||||
|
if(!pixel.bB) {
|
||||||
|
pixel.bB = 0
|
||||||
|
}
|
||||||
|
if(!pixel.finalR) {
|
||||||
|
pixel.finalR = 0
|
||||||
|
}
|
||||||
|
if(!pixel.finalG) {
|
||||||
|
pixel.finalG = 0
|
||||||
|
}
|
||||||
|
if(!pixel.finalB) {
|
||||||
|
pixel.finalB = 0
|
||||||
|
}
|
||||||
|
if(!pixel.finalColor) {
|
||||||
|
pixel.finalColor = ""
|
||||||
|
}
|
||||||
|
for (let i = -1; i < 2; i++) {
|
||||||
|
for (let j = -1; j < 2; j++) {
|
||||||
|
if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) {
|
||||||
|
if (elements[pixelMap[pixel.x+j][pixel.y+i].element].category == "gases") {
|
||||||
|
pixel.glow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(pixel.glow == true) {
|
||||||
|
pixel.rA = pixel.oldColor.split(",")[0].slice(4)
|
||||||
|
pixel.gA = pixel.oldColor.split(",")[1]
|
||||||
|
pixel.bA = pixel.oldColor.split(",")[2].slice(0,-1)
|
||||||
|
pixel.finalR = parseInt(pixel.rA) + 86
|
||||||
|
pixel.finalG = parseInt(pixel.gA) + 93
|
||||||
|
pixel.finalB = parseInt(pixel.bA) + 81
|
||||||
|
pixel.finalColor = "rgb(" + pixel.finalR + "," + pixel.finalG + "," + pixel.finalB + ")"
|
||||||
|
pixel.color = pixel.finalColor
|
||||||
|
}
|
||||||
|
if(pixel.glow == true && Math.random() < 0.02) {
|
||||||
|
pixel.glow = false
|
||||||
|
}
|
||||||
|
if(pixel.glow == false) {
|
||||||
|
pixel.color = pixel.oldColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "solids",
|
||||||
|
density: 1500,
|
||||||
|
state: "solid",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
runAfterLoad(function() {
|
||||||
|
lifeArray = Object.keys(elements).filter(function(e) {
|
||||||
|
return elements[e].category == "life";
|
||||||
|
});
|
||||||
|
if(!elements.void_gas.reactions) {
|
||||||
|
elements.void_gas.reactions = {}
|
||||||
|
};
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.void_gas.reactions[lifeArray[i]] = { "elem2": null, "chance": 0.7 }
|
||||||
|
};
|
||||||
|
for(i = 0; i < lifeArray.length; i++) {
|
||||||
|
elements.black_damp.reactions[lifeArray[i]] = { "elem2": null, "chance": 0.7 }
|
||||||
|
};
|
||||||
|
elements.acidic_vapour.ignore = elements.acid.ignore
|
||||||
|
if(enabledMods.includes("mods/Neutronium Mod.js")) {
|
||||||
|
elements.coal.breakInto = "coal_dust"
|
||||||
|
}
|
||||||
|
if(enabledMods.includes("mods/boiling_rock.js")) {
|
||||||
|
elements.rock_dust.tempHigh = 3000
|
||||||
|
elements.rock_dust.stateHigh = "vaporized_rock"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
arrayNameA = ["radiation", "alcohol", "soap", "acid", "ammonia", "acid_gas"]
|
||||||
|
arrayNameB = ["plant", "frozen_plant", "grass", "algae", "sapling", "seeds", "grass_seed", "wheat_seed", "wheat", "flower_seed", "pistil", "petal", "vine", "bamboo", "bamboo_plant", "corn_seed", "potato_seed", "root", "berry_seed", "old_berry_leaf", "berry_leaf", "berry"]
|
||||||
|
for(i = 0; i < arrayNameA.length; i++) {
|
||||||
|
if(!elements[arrayNameA[i]].reactions) {
|
||||||
|
elements[arrayNameA[i]].reactions = {}
|
||||||
|
}
|
||||||
|
for(j = 0; j < arrayNameB.length; j++) {
|
||||||
|
elements[arrayNameA[i]].reactions[arrayNameB[j]] = { "elem1":null, "elem2":"dead_plant" }
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -1059,6 +1059,173 @@ elements.vanishing_wall = {
|
||||||
insulate: true,
|
insulate: true,
|
||||||
conduct: 1,
|
conduct: 1,
|
||||||
extraInfo: "It disappears when charged.",
|
extraInfo: "It disappears when charged.",
|
||||||
|
},
|
||||||
|
|
||||||
|
elements.polka_dotted_powder = {
|
||||||
|
color: ["#000000","#000000","#7f7f7f","#ffffff","#ffffff"],
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
category: "powders",
|
||||||
|
state: "solid",
|
||||||
|
density: 1400,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.y % 6 == 0) {
|
||||||
|
if(pixel.x % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#000000") {
|
||||||
|
pixel.color = "rgb(15,15,15)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(0,0,0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if((pixel.y + 3) % 6 == 0) {
|
||||||
|
if((pixel.x + 3) % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#000000") {
|
||||||
|
pixel.color = "rgb(15,15,15)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(0,0,0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#000000") {
|
||||||
|
pixel.color = "rgb(15,15,15)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(0,0,0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tempHigh: 800,
|
||||||
|
},
|
||||||
|
|
||||||
|
elements.molten_polka_dotted_powder = {
|
||||||
|
color: ["#ff7f00","#ff7f00","#ff9f00","#ffbf00","#ffbf00"],
|
||||||
|
density: 1100,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.y % 6 == 0) {
|
||||||
|
if(pixel.x % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,191,0)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ff7f00") {
|
||||||
|
pixel.color = "rgb(255,143,16)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,127,16)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if((pixel.y + 3) % 6 == 0) {
|
||||||
|
if((pixel.x + 3) % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,191,0)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ff7f00") {
|
||||||
|
pixel.color = "rgb(255,143,16)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,127,16)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ff7f00") {
|
||||||
|
pixel.color = "rgb(255,143,16)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,127,16)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
temp: 850,
|
||||||
|
tempLow: 800,
|
||||||
|
stateLow: "polka_dotted_powder",
|
||||||
|
tempHigh: 2000,
|
||||||
|
stateHigh: "vaporized_polka_dotted_powder",
|
||||||
|
viscosity: 6,
|
||||||
|
hidden: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
elements.vaporized_polka_dotted_powder = {
|
||||||
|
color: ["#ffdf7f","#ffdf7f","#ffefbf","#ffffff","#ffffff"],
|
||||||
|
behavior: behaviors.GAS,
|
||||||
|
category: "gases",
|
||||||
|
state: "gas",
|
||||||
|
density: 550,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.y % 6 == 0) {
|
||||||
|
if(pixel.x % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ffdf7f") {
|
||||||
|
pixel.color = "rgb(255,233,137)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,223,127)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if((pixel.y + 3) % 6 == 0) {
|
||||||
|
if((pixel.x + 3) % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ffdf7f") {
|
||||||
|
pixel.color = "rgb(255,143,16)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,233,137)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#ffdf7f") {
|
||||||
|
pixel.color = "rgb(255,233,137)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,223,127)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
temp: 2200,
|
||||||
|
tempLow: 2000,
|
||||||
|
stateLow: "molten_polka_dotted_powder",
|
||||||
|
tempHigh: 8000,
|
||||||
|
stateHigh: "ionized_polka_dotted_powder",
|
||||||
|
hidden: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
elements.ionized_polka_dotted_powder = {
|
||||||
|
color: ["#fffff0","#fffff0","#fffff7","#ffffff","#ffffff"],
|
||||||
|
behavior: [
|
||||||
|
"M2 AND CR:plasma%0.3|M1|M2 AND CR:plasma%0.3",
|
||||||
|
"M1|XX|M1",
|
||||||
|
"M2 AND CR:plasma%0.3|M1|M2 AND CR:plasma%0.3",
|
||||||
|
],
|
||||||
|
category: "gases",
|
||||||
|
state: "gas",
|
||||||
|
density: 0.02,
|
||||||
|
tick: function(pixel) {
|
||||||
|
if(pixel.y % 6 == 0) {
|
||||||
|
if(pixel.x % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#fffff0") {
|
||||||
|
pixel.color = "rgb(255,255,247)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,255,240)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if((pixel.y + 3) % 6 == 0) {
|
||||||
|
if((pixel.x + 3) % 6 == 0) {
|
||||||
|
pixel.color = "rgb(255,255,255)"
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#fffff0") {
|
||||||
|
pixel.color = "rgb(255,255,247)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,255,240)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!settings.bg || settings.bg == "#fffff0") {
|
||||||
|
pixel.color = "rgb(255,255,247)"
|
||||||
|
} else {
|
||||||
|
pixel.color = "rgb(255,255,240)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
temp: 8500,
|
||||||
|
tempLow: 8000,
|
||||||
|
stateLow: "vaporized_polka_dotted_powder",
|
||||||
|
hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
runAfterLoad(function() {
|
runAfterLoad(function() {
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,7 @@ elements.tc = { //temperature checker
|
||||||
|
|
||||||
elements.color_temp_test = {
|
elements.color_temp_test = {
|
||||||
color: "#111111",
|
color: "#111111",
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
if(!pixel.oldColor) {
|
if(!pixel.oldColor) {
|
||||||
pixel.oldColor = pixel.color
|
pixel.oldColor = pixel.color
|
||||||
|
|
@ -487,5 +488,6 @@ elements.color_temp_test = {
|
||||||
doHeat(pixel);
|
doHeat(pixel);
|
||||||
},
|
},
|
||||||
category: "special",
|
category: "special",
|
||||||
temp: -273,
|
state: "solid",
|
||||||
|
temp: 20,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue