Merge branch 'R74nCom:main' into main

This commit is contained in:
JustAGenericUsername 2024-10-29 16:18:53 -04:00 committed by GitHub
commit 94fd6cabb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 5661 additions and 205 deletions

View File

@ -3251,13 +3251,14 @@ DO_TICK: function(pixel) {
onPlace: function(pixel) {
if (isEmpty(pixel.x, pixel.y+1)) {
createPixel("body", pixel.x, pixel.y+1);
pixel.element = "head";
var color = pixel.color;
changePixel(pixel,"head");
pixel.color = color;
}
else if (isEmpty(pixel.x, pixel.y-1)) {
createPixel("head", pixel.x, pixel.y-1);
pixelMap[pixel.x][pixel.y-1].color = pixel.color;
pixel.element = "body";
pixel.color = pixelColorPick(pixel)
changePixel(pixel,"body");
}
else {
deletePixel(pixel.x, pixel.y);
@ -12749,7 +12750,9 @@ if (langCode) {
}
delete pixel.origColor; // remove stain
delete pixel.clone;
delete pixel.glow;
if (pixel.glow !== undefined) {
delete pixel.glow;
}
if (pixel.r && !elementInfo.rotatable) {
delete pixel.r;
}

View File

@ -548,5 +548,10 @@
"galvanized_steel": "Acier galvanisé",
"rice": "Le riz",
"midas_touch": "Touche de Midas",
"liquid_ozone": "Ozone liquide"
"liquid_ozone": "Ozone liquide",
"web": "Toile",
"soul": "Âme",
"spider": "Araignée",
"ectoplasm": "Ectoplasme",
"tombstone": "Pierre tombale"
}

View File

@ -549,5 +549,10 @@
"galvanized_steel": "Thép mạ kẽm",
"rice": "Gạo",
"midas_touch": "Bàn tay của Midas",
"liquid_ozone": "Ozone lỏng"
"liquid_ozone": "Ozone lỏng",
"web": "Tơ Nhện",
"soul": "Linh hồn",
"spider": "Nhện",
"ectoplasm": "Ngoại chất",
"tombstone": "Bia mộ"
}

View File

@ -277,6 +277,7 @@
<tr><td>bananas.js</td><td>Adds bananas and banana plants</td><td>Alice</td></tr>
<tr><td>cat.js</td><td>Adds cats and cat food</td><td>SquareScreamYT</td></tr>
<tr><td>cells.js</td><td>Adds several experimental edits of the Cell element</td><td>Alice</td></tr>
<tr><td>colonies.js</td><td>Adds rockets that contain settlers to terraform a planet.</td><td>Nekonico</td></tr>
<tr><td>crimson.js</td><td>Adds elements relating to the Crimson from Terraria</td><td>Alice</td></tr>
<tr><td>dogs.js</td><td>Adds a simple dog and dog food</td><td>hedera-ivy</td></tr>
<tr><td>fairy_chain.js</td><td>Adds way too many fairies to fey_and_more.js</td><td>Alice</td></tr>
@ -340,6 +341,7 @@
<!----><tr><td class="modCat" colspan="3">Visual Effects</td></tr><!---->
<tr><td>acid_and_shapes.js</td><td>Weird visual effects. Enable in Settings</td><td>Alice</td></tr>
<tr><td>customBackground.js</td><td>Set your background to an image link</td><td>Jayd</td></tr>
<tr><td>heatglow.js</td><td>Red glowing effect for hot metals</td><td>nousernamefound</td></tr>
<tr><td>invisible_dye.js</td><td>Adds elements like Dye and Spray Paint that take the color of the background</td><td>Alice</td></tr>
<tr><td>invisible_wall.js</td><td>Adds an element like Wall that takes the color of the background</td><td>Alice</td></tr>
@ -351,6 +353,9 @@
<tr><td>shader_by_jayd.js</td><td>Adds a glow around light elements</td><td>Jayd</td></tr>
<tr><td>Shroomboxels.js</td><td>A variant of acid_and_shapes.js that uses a different trigonometric function</td><td>Alice</td></tr>
<tr><td>singleColor.js</td><td>Makes all elements pick one color each time they're drawn</td><td>stefanblox</td></tr>
<tr><td>texture_pack_by_jayd.js</td><td>Adds a cool background</td><td>Jayd</td></tr>
<tr><td>UwUify.js</td><td>Adds an "UwU" background</td><td>Jayd</td></tr>
<!----><tr><td class="modCat" colspan="3">Compilations</td></tr><!---->
<tr><td>a_mod_by_alice.js</td><td>A mod combining most of Alices mods, and some other things</td><td>Alice</td></tr>

View File

@ -24,7 +24,7 @@ elements.change_count = {
var choosebehaviors = behaviors
delete choosebehaviors.KILLPIXEL2
delete choosebehaviors.KILLPIXEL1
if (!settings.randomcount){settings.randomcount = 10000; saveSettings()}
if (!settings.randomcount || settings.randomcount > 50000){settings.randomcount = 10000; saveSettings()}
var color = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e","f"]
var states = ["solid", "liquid", "gas"]
var essentialelements = ["molten_gallium", "gallium", "gallium_gas", "change_count"]
@ -162,4 +162,4 @@ document.getElementById("extraInfo").querySelectorAll("small")[1].replaceChildre
}
}
})
}
}

View File

@ -467,18 +467,7 @@ elements.mushy_mud = {
density: 1200,
stain: 0.3
};
elements.mud = {
color: "#8B4513",
behavior: elements.slime.behavior,
viscosity: 1050,
tempHigh: 58,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1000,
stain: 0.3
};
elements.quicksand_mud = {
color: "#DAA520",
behavior: elements.slime.behavior,
@ -515,7 +504,7 @@ elements.sticky_quicksand = {
density: 1100,
stain: 0.25
};
elements.fluff_mud = {
elements.pluff_mud = {
color: "#964B00",
behavior: elements.slime.behavior,
viscosity: 10000,
@ -527,55 +516,6 @@ elements.fluff_mud = {
density: 1300,
stain: 0.2
};
elements.bog = {
color: "#556B2F",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 45,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1400,
stain: 0.25
};
elements.mire = {
color: "#2E8B57",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 50,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1500,
stain: 0.3
};
elements.oobleck = {
color: "#008000",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 25,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1600,
stain: 0.15
};
elements.spiderwebs = {
color: "#D3D3D3",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 20,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1700,
stain: 0.1
};
elements.silt_quicksand = {
color: "#DAA520",
behavior: elements.slime.behavior,
@ -1104,3 +1044,312 @@ elements.murky_marsh_mixture = {
density: 1900,
stain: 0.2
};
elements.mud = {
color: "#8B4513",
reactions: {
"water": { "elem1": "wet_mud" },
"mire": { "elem1": "mire_mud" },
"dirt": { "elem1": "thick_mud" },
"plant": { "elem1": "pluff_mud" },
"bog": { "elem1": "boggy_mud" },
"sand": { "elem1": "sandy_mud" },
},
behavior: elements.slime.behavior,
viscosity: 1050,
tempHigh: 58,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1000,
stain: 0.3
};
elements.marsh = {
color: "#556B2F",
behavior: elements.slime.behavior,
reactions: {
"slime": { "elem1": "marshy_slime" },
},
viscosity: 13500,
tempHigh: 75,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1900,
stain: 0.2
};
elements.peat = {
color: "#556B2F",
behavior: elements.slime.behavior,
viscosity: 13500,
tempHigh: 75,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1900,
stain: 0.2
};
elements.goo = {
color: "#556B2F",
behavior: behavior.POWDER,
viscosity: 13500,
tempHigh: 75,
stateHigh: "powder",
tempLow: 0,
category: "powders",
state: "powder",
density: 1900,
stain: 0.2
};
elements.ooze = {
color: "#556B2F",
behavior: elements.slime.behavior,
viscosity: 13500,
tempHigh: 75,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1900,
stain: 0.2
};
elements.spiderwebs = {
color: "#D3D3D3",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 20,
stateHigh: "liquid",
reactions: {
"ooze": { "elem1": "sticky_spider_ooze" },
"goo": { "elem1": "sticky_spider_goo" },
},
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1700,
stain: 0.1
};
elements.bog = {
color: "#556B2F",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 45,
stateHigh: "liquid",
tempLow: 0,
reactions: {
"quicksand": { "elem1": "bog_quicksand" },
},
category: "liquids",
state: "liquid",
density: 1400,
stain: 0.25
};
elements.mire = {
color: "#2E8B57",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 50,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1500,
stain: 0.3
};
elements.oobleck = {
color: "#008000",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 25,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1600,
stain: 0.15
};
elements.quicksand = {
color: "#8B4513",
behavior: elements.slime.behavior,
viscosity: 1050,
tempHigh: 58,
stateHigh: "liquid",
reactions: {
"water": { "elem1": "wet_quicksand" },
"peat": { "elem1": "peat_quicksand" },
"mud": { "elem1": "quicksand_mud" },
},
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1574,
stain: 0.3
};
elements.gel = {
color: "#008000",
behavior: elements.slime.behavior,
viscosity: 10000,
tempHigh: 25,
reactions: {
"spider_webbing": { "elem1": "webbing_gel" },
},
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1600,
stain: 0.15
};
elements.silly_putty = {
color: "#FFD700",
behavior: behaviors.LIQUID,
viscosity: 4000,
tempHigh: 50,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 900, // Adjusted density
stain: 0.1
};
elements.kinetic_sand = {
color: "#FFD700",
behavior: behaviors.LIQUID,
viscosity: 5000,
tempHigh: 55,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1200, // Adjusted density
stain: 0.15
};
elements.gak = {
color: "#FF69B4",
behavior: behaviors.LIQUID,
viscosity: 6000,
tempHigh: 60,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 950,
stain: 0.2
};
elements.flubber = {
color: "#FF4500",
behavior: behaviors.LIQUID,
viscosity: 3000,
tempHigh: 65,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 800,
stain: 0.1
};
elements.play_doh = {
color: "#FFC0CB",
behavior: behaviors.LIQUID,
viscosity: 5000,
tempHigh: 55,
reactions: {
"sand": { "elem1": "sandy_play_doh" },
},
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 950,
stain: 0.2
};
elements.floam = {
color: "#98FB98",
behavior: behaviors.LIQUID,
viscosity: 4000,
tempHigh: 60,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1000,
stain: 0.15
};
elements.moon_sand = {
color: "#D3D3D3",
behavior: behaviors.LIQUID,
viscosity: 4500,
tempHigh: 60,
reactions: {
"water": { "elem1": "moon_quicksand" },
"kinetic_sand": { "elem1": "moon_kinetic_sand" },
},
stateHigh: "liquid",
tempLow: 0,
category: "powders",
state: "powder",
density: 950,
stain: 0.1
};
elements.moon_quicksand = {
color: "#98FB98",
behavior: behaviors.LIQUID,
viscosity: 4000,
tempHigh: 60,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1000,
stain: 0.15
};
elements.moon_kinetic_sand = {
color: "#D3D3D3",
behavior: behaviors.LIQUID,
viscosity: 4500,
tempHigh: 60,
reactions: {
"water": { "elem1": "kinetic_moon_quicksand" },
},
stateHigh: "liquid",
tempLow: 0,
category: "powders",
state: "powder",
density: 950,
stain: 0.1
};
elements.kinetic_moon_quicksand = {
color: "#98FB98",
behavior: behaviors.LIQUID,
viscosity: 4000,
tempHigh: 60,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 1000,
stain: 0.15
};
elements.sandy_play_doh = {
color: "#FFC0CB",
behavior: behaviors.LIQUID,
viscosity: 5000,
tempHigh: 55,
stateHigh: "liquid",
tempLow: 0,
category: "liquids",
state: "liquid",
density: 950,
stain: 0.2
};

View File

@ -1,4 +1,4 @@
document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")';
document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/image/uwuify.png")';
document.body.style.backgroundSize = 'cover';
gameDiv.style.border = "1px solid #ffffff00";
window.addEventListener("load",function(){
@ -80,4 +80,4 @@ function pixelColorPick(pixel,customColor=null) {
}
}*/
return color;
}
}

View File

@ -26,7 +26,7 @@ function updateStatsNew() {
if (pixelMap[mousePos.x] != undefined) {
var currentPixel = pixelMap[mousePos.x][mousePos.y];
if (currentPixel != undefined) {
stats += "<span id='stat-element' class='stat'>Elem:" + (elements[currentPixel.element].name || currentPixel.element).toUpperCase() + "</span>";
stats += "<span id='stat-element' class='stat'>Elem:" + (elements[currentPixel.element].name || currentPixel.element).toString().toUpperCase() + "</span>";
stats += "<span id='stat-temperature' class='stat'>Temp:" + formatTemp(currentPixel.temp) + "</span>";
if (currentPixel.charge) {
stats += "<span id='stat-charge' class='stat'>C" + currentPixel.charge + "</span>";
@ -49,7 +49,7 @@ function updateStatsNew() {
}
// If the view is not null, show the view in all caps
if (view != null) {
stats += "<span id='stat-view' class='stat'>" + viewKey[view].toUpperCase() + "</span>";
stats += "<span id='stat-view' class='stat'>" + viewKey[view].toString().toUpperCase() + "</span>";
}
statsDiv.innerHTML = stats;
}

43
mods/chemFormula.js Normal file
View File

@ -0,0 +1,43 @@
const styleElement = document.createElement('style');
styleElement.innerHTML = `
.tooltip {
z-index: 1000;
position: relative;
}
.tooltip .tooltiptext {
visibility: hidden;
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
text-align: center;
padding: 0.5em;
border-radius: 0.5em;
position: absolute;
z-index: 1000;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
pointer-events: none;
text-shadow: none;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
`
document.head.appendChild(styleElement);
runAfterLoad(async () => {
const data = await fetch('mods/chemFormulas.json').then((res) => res.json());
for (const element in data) {
if (elements[element]) {
elements[element].hoverStat = () => data[element].length > 1 ? "Multiple compounds" : data[element][0].replace(/\<\/?su[bp]\>/g, "");
document.querySelector(`button[element='${element}']`)?.classList.add('tooltip');
const span = document.createElement('span');
span.classList.add('tooltiptext');
span.innerHTML = data[element].join("<br>");
document.querySelector(`button[element='${element}']`)?.appendChild(span);
}
}
});

241
mods/chemFormulas.json Normal file
View File

@ -0,0 +1,241 @@
{
"sand": ["SiO<sub>2</sub>"],
"dirt": ["Organic matter"],
"mud": ["H<sub>2</sub>O", "Organic matter"],
"wet_sand": ["SiO<sub>2</sub>", "H<sub>2</sub>O"],
"rock": ["SiO<sub>2</sub>"],
"rock_wall": ["SiO<sub>2</sub>"],
"mudstone": ["SiO<sub>2</sub>", "H<sub>2</sub>O", "Organic matter"],
"packed_sand": ["SiO<sub>2</sub>"],
"snow": ["H<sub>2</sub>O"],
"packed_snow": ["H<sub>2</sub>O"],
"gravel": ["SiO<sub>2</sub>"],
"clay": ["Al<sub>2</sub>Si<sub>2</sub>O<sub>5</sub>(OH)<sub>4</sub>", "H<sub>2</sub>O"],
"clay_soil": ["Al<sub>2</sub>Si<sub>2</sub>O<sub>5</sub>(OH)<sub>4</sub>", "H<sub>2</sub>O", "Organic matter"],
"permafrost": ["Organic matter", "SiO<sub>2</sub>", "H<sub>2</sub>O"],
"mycelium": ["Organic matter"],
"mulch": ["Organic matter"],
"basalt": ["SiO<sub>2</sub>", "FeO", "CaO"],
"tuff": ["SiO<sub>2</sub>", "Al<sub>2</sub>O<sub>3</sub>", "CaO", "K<sub>2</sub>O"],
"limestone": ["CaCO<sub>3</sub>"],
"quicklime": ["CaO"],
"slaked_lime": ["Ca(OH)<sub>2</sub>"],
"water": ["H<sub>2</sub>O"],
"salt_water": ["H<sub>2</sub>O", "NaCl"],
"sugar_water": ["H<sub>2</sub>O", "C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"seltzer": ["H<sub>2</sub>O", "CO<sub>2</sub>"],
"dirty_water": ["H<sub>2</sub>O", "Impurities"],
"pool_water": ["H<sub>2</sub>O", "Cl<sub>2</sub>"],
"slush": ["H<sub>2</sub>O"],
"magma": ["SiO<sub>2</sub>", "FeO", "CaO"],
"slime": ["H<sub>2</sub>O", "Organic matter"],
"cement": ["CaO", "SiO<sub>2</sub>", "Al<sub>2</sub>O<sub>3</sub>"],
"oil": ["C<sub>5</sub>H<sub>12</sub>", "C<sub>6</sub>H<sub>14</sub>", "C<sub>7</sub>H<sub>16</sub>", "C<sub>8</sub>H<sub>18</sub>", "C<sub>9</sub>H<sub>20</sub>", "C<sub>10</sub>H<sub>22</sub>", "C<sub>11</sub>H<sub>24</sub>", "C<sub>12</sub>H<sub>26</sub>"],
"lamp_oil": ["C<sub>12</sub>H<sub>26</sub>", "C<sub>13</sub>H<sub>28</sub>", "C<sub>14</sub>H<sub>30</sub>", "C<sub>15</sub>H<sub>32</sub>", "C<sub>16</sub>H<sub>34</sub>"],
"acid": ["HCl"],
"neutral_acid": ["H<sub>2</sub>O", "HCl"],
"glue": ["C<sub>4</sub>H<sub>6</sub>O<sub>2</sub>"],
"soda": ["H<sub>2</sub>O", "C<sub>6</sub>H<sub>12</sub>O<sub>6</sub>", "CO<sub>2</sub>"],
"melted_wax": ["C<sub>25</sub>H<sub>52</sub>"],
"vinegar": ["H<sub>2</sub>O", "C<sub>2</sub>H<sub>4</sub>O<sub>2</sub>"],
"alcohol": ["C<sub>2</sub>H<sub>5</sub>OH"],
"soap": ["C<sub>17</sub>H<sub>35</sub>COONa"],
"bleach": ["NaClO"],
"mercury": ["Hg"],
"tea": ["H<sub>2</sub>O", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>"],
"coffee": ["H<sub>2</sub>O", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>"],
"honey": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"sap": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"caramel": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"molasses": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"liquid_oxygen": ["O<sub>2</sub>"],
"liquid_nitrogen": ["N<sub>2</sub>"],
"cyanide": ["CN"],
"concrete": ["CaO", "SiO<sub>2</sub>", "Al<sub>2</sub>O<sub>3</sub>"],
"ash": ["SiO<sub>2</sub>", "CaO", "K<sub>2</sub>O"],
"charcoal": ["C"],
"hail": ["H<sub>2</sub>O"],
"wax": ["C<sub>25</sub>H<sub>52</sub>"],
"sodium": ["Na"],
"calcium": ["Ca"],
"potassium": ["K"],
"magnesium": ["Mg"],
"thermite": ["Al", "Fe<sub>2</sub>O<sub>3</sub>"],
"slag": ["CaSiO<sub>3</sub>"],
"amalgam": ["Hg", "Ag"],
"sulfur": ["S"],
"copper_sulfate": ["CuSO<sub>4</sub>"],
"uranium": ["U"],
"diamond": ["C"],
"gold coin": ["Au"],
"rust": ["Fe<sub>2</sub>O<sub>3</sub>"],
"oxidized_copper": ["CuO"],
"alga": ["AlGa"],
"glass_shard": ["SiO<sub>2</sub>"],
"rad_shard": ["SiO<sub>2</sub>", "U"],
"color_sand": ["SiO<sub>2</sub>", "Fe<sub>2</sub>O<sub>3</sub>"],
"borax": ["Na<sub>2</sub>B<sub>4</sub>O<sub>7</sub>"],
"epsom_salt": ["MgSO<sub>4</sub>"],
"potassium_salt": ["KCl"],
"caustic_potash": ["KOH"],
"sodium_acetate": ["NaC<sub>2</sub>H<sub>3</sub>O<sub>2</sub>"],
"ice": ["H<sub>2</sub>O"],
"rime": ["H<sub>2</sub>O"],
"glass": ["SiO<sub>2</sub>"],
"rad_glass": ["SiO<sub>2</sub>", "U"],
"stained_glass": ["SiO<sub>2</sub>", "Metal oxides"],
"plastic": ["(C<sub>8</sub>H<sub>8</sub>)<sub>n</sub>", "(C<sub>4</sub>H<sub>6</sub>)<sub>n</sub>", "(C<sub>3</sub>H<sub>3</sub>N)<sub>n</sub>"],
"iron": ["Fe"],
"copper": ["Cu"],
"gold": ["Au"],
"steel": ["Fe", "C"],
"galvanized_steel": ["Fe", "Zn"],
"zinc": ["Zn"],
"silver": ["Ag"],
"tin": ["Sn"],
"lead": ["Pb"],
"nickel": ["Ni"],
"aluminum": ["Al"],
"tungsten": ["W"],
"brass": ["Cu", "Zn"],
"bronze": ["Cu", "Sn"],
"sterling": ["Ag", "Cu"],
"gallium": ["Ga"],
"rose_gold": ["Au", "Cu"],
"purple_gold": ["Au", "Al"],
"blue_gold": ["Au", "Ga"],
"electrum": ["Au", "Ag"],
"pyrite": ["FeS<sub>2</sub>"],
"solder": ["Sn", "Pb"],
"dry ice": ["CO<sub>2</sub>"],
"nitrogen_ice": ["N<sub>2</sub>"],
"light": ["γ"],
"liquid_light": ["γ"],
"laser": ["γ"],
"radiation": ["α", "β", "γ"],
"neutron": ["n"],
"proton": ["p"],
"electric": ["e<sup>-</sup>"],
"lightning": ["e<sup>-</sup>"],
"positron": ["e<sup>+</sup>"],
"flash": ["γ"],
"tnt": ["C<sub>7</sub>H<sub>5</sub>N<sub>3</sub>O<sub>6</sub>"],
"c4": ["C<sub>3</sub>H<sub>6</sub>N<sub>6</sub>O<sub>6</sub>"],
"dynamite": ["C<sub>3</sub>H<sub>5</sub>N<sub>3</sub>O<sub>9</sub>"],
"gunpowder": ["KNO<sub>3</sub>", "S", "C"],
"nitro": ["C<sub>3</sub>H<sub>5</sub>N<sub>3</sub>O<sub>9</sub>"],
"steam": ["H<sub>2</sub>O"],
"hydrogen": ["H<sub>2</sub>"],
"oxygen": ["O<sub>2</sub>"],
"nitrogen": ["N<sub>2</sub>"],
"helium": ["He"],
"anesthesia": ["N<sub>2</sub>O"],
"carbon_dioxide": ["CO<sub>2</sub>"],
"bubble": ["CO<sub>2</sub>"],
"ammonia": ["NH<sub>3</sub>"],
"propane": ["C<sub>3</sub>H<sub>8</sub>"],
"methane": ["CH<sub>4</sub>"],
"acid_gas": ["HCl"],
"dioxin": ["C<sub>4</sub>H<sub>4</sub>O<sub>2</sub>"],
"chlorine": ["Cl<sub>2</sub>"],
"neon": ["Ne"],
"smog": ["CO<sub>2</sub>", "CO", "NO<sub>2</sub>", "O<sub>3</sub>"],
"cyanide_gas": ["HCN"],
"ozone": ["O<sub>3</sub>"],
"rad_steam": ["H<sub>2</sub>O", "U"],
"salt": ["NaCl"],
"sugar": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>"],
"chocolate": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>", "C<sub>7</sub>H<sub>8</sub>N<sub>4</sub>O<sub>2</sub>", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>", "C<sub>18</sub>H<sub>36</sub>O<sub>2</sub>", "C<sub>16</sub>H<sub>32</sub>O<sub>2</sub>"],
"baking_soda": ["NaHCO<sub>3</sub>"],
"antipowder": ["Ry<sub>2</sub>O<sub>3</sub>"],
"antimolten": ["Ry<sub>2</sub>O<sub>3</sub>"],
"antiice": ["Ry<sub>7</sub>O<sub>12</sub>"],
"antifluid": ["Ry<sub>7</sub>O<sub>12</sub>"],
"antigas": ["Ry<sub>7</sub>O<sub>12</sub>"],
"molten_glass": ["SiO<sub>2</sub>"],
"molten_rad_glass": ["SiO<sub>2</sub>", "U"],
"molten_salt": ["NaCl"],
"molten_ash": ["SiO<sub>2</sub>", "CaO", "K<sub>2</sub>O"],
"liquid_ammonia": ["NH<sub>3</sub>"],
"liquid_propane": ["C<sub>3</sub>H<sub>8</sub>"],
"liquid_methane": ["CH<sub>4</sub>"],
"molten_stained_glass": ["SiO<sub>2</sub>", "Metal oxides"],
"molten_plastic": ["(C<sub>8</sub>H<sub>8</sub>)<sub>n</sub>", "(C<sub>4</sub>H<sub>6</sub>)<sub>n</sub>", "(C<sub>3</sub>H<sub>3</sub>N)<sub>n</sub>"],
"molten_tungsten": ["W"],
"molten_gallium": ["Ga"],
"gallium_gas": ["Ga"],
"molten_copper": ["Cu"],
"molten_copper_sulfate": ["CuSO<sub>4</sub>"],
"molten_gold": ["Au"],
"molten_silver": ["Ag"],
"molten_iron": ["Fe"],
"molten_nickel": ["Ni"],
"molten_tin": ["Sn"],
"molent_lead": ["Pb"],
"molten_solder": ["Sn", "Pb"],
"alcohol_gas": ["C<sub>2</sub>H<sub>5</sub>OH"],
"molten_tuff": ["SiO<sub>2</sub>", "Al<sub>2</sub>O<sub>3</sub>", "CaO", "K<sub>2</sub>O"],
"liquid_chlorine": ["Cl<sub>2</sub>"],
"mercury_gas": ["Hg"],
"solid_mercury": ["Hg"],
"fat": ["C<sub>55</sub>H<sub>98</sub>O<sub>6</sub>"],
"molten_chocolate": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>", "C<sub>7</sub>H<sub>8</sub>N<sub>4</sub>O<sub>2</sub>", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>", "C<sub>18</sub>H<sub>36</sub>O<sub>2</sub>", "C<sub>16</sub>H<sub>32</sub>O<sub>2</sub>"],
"liquid_hydrogen": ["H<sub>2</sub>"],
"liquid_helium": ["He"],
"molten_sodium": ["Na"],
"sodium_gas": ["Na"],
"molten_calcium": ["Ca"],
"molten_potassium": ["K"],
"potassium_gas": ["K"],
"molten_magnesium": ["Mg"],
"molten_thermite": ["Al", "Fe<sub>2</sub>O<sub>3</sub>"],
"molten_aluminum": ["Al"],
"molten_zinc": ["Zn"],
"liquid_neon": ["Ne"],
"liquid_ozone": ["O<sub>3</sub>"],
"molten_sulfur": ["S"],
"sulfur_gas": ["S"],
"molten_uranium": ["U"],
"molten_slag": ["CaSiO<sub>3</sub>"],
"molten_dirt": ["Organic matter"],
"salt_ice": ["NaCl", "H<sub>2</sub>O"],
"sugar_ice": ["C<sub>12</sub>H<sub>22</sub>O<sub>11</sub>", "H<sub>2</sub>O"],
"seltzer_ice": ["H<sub>2</sub>O", "CO<sub>2</sub>"],
"dirty_ice": ["H<sub>2</sub>O", "Impurities"],
"pool_ice": ["H<sub>2</sub>O", "Cl<sub>2</sub>"],
"antiice_ice": ["Ry<sub>2</sub>O"],
"ammonia_ice": ["NH<sub>3</sub>"],
"propane_ice": ["C<sub>3</sub>H<sub>8</sub>"],
"methane_ice": ["CH<sub>4</sub>"],
"acid_ice": ["HCl"],
"soda_ice": ["H<sub>2</sub>O", "C<sub>6</sub>H<sub>12</sub>O<sub>6</sub>", "CO<sub>2</sub>"],
"molten_steel": ["Fe", "C"],
"molten_galvanized_steel": ["Fe", "Zn"],
"molten_brass": ["Cu", "Zn"],
"molten_bronze": ["Cu", "Sn"],
"molten_sterling": ["Ag", "Cu"],
"molten_rose_gold": ["Au", "Cu"],
"molten_purple_gold": ["Au", "Al"],
"molten_blue_gold": ["Au", "Ga"],
"molten_electrum": ["Au", "Ag"],
"molten_pyrite": ["FeS<sub>2</sub>"],
"frozen_vinegar": ["H<sub>2</sub>O", "C<sub>2</sub>H<sub>4</sub>O<sub>2</sub>"],
"alcohol_ice": ["C<sub>2</sub>H<sub>5</sub>OH"],
"bleach_ice": ["NaClO"],
"chlorine_ice": ["Cl<sub>2</sub>"],
"tea_ice": ["H<sub>2</sub>O", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>"],
"coffee_ice": ["H<sub>2</sub>O", "C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub>"],
"hydrogen_ice": ["H<sub>2</sub>"],
"oxygen_ice": ["O<sub>2</sub>"],
"molten_amalgam": ["Hg", "Ag"],
"neon_ice": ["Ne"],
"cyanide_ice": ["CN"],
"slime_ice": ["H<sub>2</sub>O", "Organic matter"],
"molten_alga": ["AlGa"],
"molten_borax": ["Na<sub>2</sub>B<sub>4</sub>O<sub>7</sub>"],
"molten_epsom_salt": ["MgSO<sub>4</sub>"],
"molten_potassium_salt": ["KCl"],
"molten_caustic_potash": ["KOH"],
"molten_sodium_acetate": ["NaC<sub>2</sub>H<sub>3</sub>O<sub>2</sub>"],
"frozen_nitro": ["C<sub>3</sub>H<sub>5</sub>N<sub>3</sub>O<sub>9</sub>"]
}

574
mods/colonies.js Normal file
View File

@ -0,0 +1,574 @@
var modName = "mods/colonies.js";
var exoplanetMod = "mods/exoplanet.js";
if(enabledMods.includes(exoplanetMod)) {
window.addEventListener("load", () => {
document.getElementById("elementButton-base")?.remove()
})
window.addEventListener("load", () => {
document.getElementById("elementButton-empty_room")?.remove()
})
window.addEventListener("load", () => {
document.getElementById("elementButton-cafeteria")?.remove()
})
window.addEventListener("load", () => {
document.getElementById("elementButton-terraformer_room")?.remove()
})
window.addEventListener("load", () => {
document.getElementById("elementButton-base_door_left")?.remove()
})
window.addEventListener("load", () => {
document.getElementById("elementButton-base_door_right")?.remove()
})
elements.base = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|XX|CR:glass|CR:glass|CR:rocket_gate|CR:rocket_gate|CR:rocket_gate|CR:glass|CR:glass|XX|XX",
"XX|CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass|XX",
"XX|CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX",
"CR:glass|CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass|CR:glass",
"CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass",
"CR:base_door_left,base_door,base_door AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>base_door_left,base_door,base_door|XX|XX|XX|XX|CH:leaving_rocket%25|XX|XX|XX|XX|CR:base_door_right,base_door AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>base_door_right,base_door",
"CR:concrete|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|CR:concrete",
"CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete",
"XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.empty_room = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX|XX",
"XX|CR:glass|CR:glass|XX|XX|XX|CR:glass|CR:glass|XX",
"CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass",
"CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass",
"CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door",
"CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete",
"CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.cafeteria = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX",
"CR:glass|CR:glass|CR:food_dispenser|CR:food_dispenser|CR:air_filter|CR:food_dispenser|CR:food_dispenser|CR:glass|CR:glass",
"CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass",
"CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass",
"CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door",
"CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete",
"CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.terraformer_room = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX|XX",
"XX|CR:glass|CR:glass|XX|XX|XX|CR:glass|CR:glass|XX",
"CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass",
"CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass",
"CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door",
"CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:room_temper AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>room_temper|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:nanobot_terraformers AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>nanobot_terraformers|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:room_temper AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>room_temper|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete",
"CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.air_filter = {
hidden: true,
color: ["#d1c6be","#b5c0ad","#b9b8bc"],
reactions: {
"carbon_dioxide": { elem2:"oxygen" },
"dust_cloud": { elem2:["oxygen",null], },
"exoplanetary_dust": { elem2:null, },
"dust": { elem2:null, },
"radiation": { elem2:"electric", temp1:200 }
},
behavior: [
"XX|ST|XX",
"ST AND CR:oxygen%1|XX|ST AND CR:oxygen%1",
"XX|CR:oxygen%1|XX",
],
tempHigh: 500,
stateHigh: "molten_aluminum",
category: "colonies",
density: 2710,
conduct: 0.73,
hardness: 0.01,
breakInto: "metal_scrap",
fireColor: "#A7B3BF",
superconductAt: -271.95,
state: "solid",
}
elements.rocket_gate = {
hidden: true,
color: ["#d1c6be","#b5c0ad","#b9b8bc"],
behavior: behaviors.WALL,
tempHigh: 500,
stateHigh: "molten_aluminum",
category: "colonies",
density: 2710,
conduct: 0.73,
hardness: 0.05,
breakInto: "metal_scrap",
fireColor: "#A7B3BF",
superconductAt: -271.95,
state: "solid",
}
elements.base_door = {
hidden: true,
color: ["#d1c6be","#b5c0ad","#b9b8bc"],
behavior: behaviors.WALL,
tempHigh: 500,
stateHigh: "molten_aluminum",
category: "colonies",
density: 2710,
conduct: 0.73,
hardness: 0.04,
breakInto: "metal_scrap",
fireColor: "#A7B3BF",
superconductAt: -271.95,
state: "solid",
}
elements.base_door_left = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"CR:empty_room,cafeteria,cafeteria,terraformer_room,terraformer_room|XX|XX|XX|CH:base_door|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.base_door_right = {
hidden: true,
color: "#ff0000",
behavior: [
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|CH:base_door|XX|XX|XX|CR:empty_room,cafeteria,cafeteria,cafeteria,terraformer_room,terraformer_room,terraformer_room",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
"XX|XX|XX|XX|XX|XX|XX|XX|XX",
],
category: "colonies",
state: "solid",
}
elements.settler = {
color: ["#A8A7AB","#878689"],
category: "colonies",
tick: function(pixel) {
if (tryMove(pixel, pixel.x, pixel.y+1)) {} // Fall
doHeat(pixel);
doBurning(pixel);
doElectricity(pixel);
if (pixel.oxygen > 0.1 && Math.random() < 0.025) { pixel.oxygen -= 0.5 } // consume oxygen
else if (pixel.oxygen < 0.1) { pixel.dead = true }
if (pixel.dead) {
// Turn into rotten_meat if pixelTicks-dead > 500
if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) {
if (Math.random() < 0.5) {
changePixel(pixel,"metal_scrap");
}
else {
changePixel(pixel,"rotten_meat");
}
}
return
}
if (pixel.burning) {
pixel.panic += 0.1;
}
else if (pixel.oxygen < 25.1) {
pixel.panic += 0.1;
}
else if (pixel.panic > 0) {
pixel.panic -= 0.1;
if (pixel.panic < 0) { pixel.panic = 0; }
}
if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance
var movesToTry = [
[1*pixel.dir,0],
[1*pixel.dir,-1],
];
// While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break.
while (movesToTry.length > 0) {
var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0];
if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) {
var origx = pixel.x+move[0];
var origy = pixel.y+move[1];
if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) {
break;
}
}
else if (!isEmpty(pixel.x+move[0], pixel.y+move[1], true)) {
var hitPixel = pixelMap[pixel.x+move[0]][pixel.y+move[1]];
if (hitPixel.element === "settler") {
// interact with other settlers
hitPixel.panic = pixel.panic;
}
else if (hitPixel.element === "base_door") {
if (pixel.dir === -1 && Math.random() > 0.5) {
tryMove(pixel,pixel.x-2,pixel.y);
}
else if (pixel.dir === 1 && Math.random() > 0.5) {
tryMove(pixel,pixel.x+2,pixel.y);
}
}
else if (hitPixel.element === "leaving_rocket" && pixel.ogcrew === false) {
if (Math.random() > 0.75) {
deletePixel(pixel.x,pixel.y);
hitPixel.passengers += 1;
}
}
else if (elements[hitPixel.element].state === "gas") {
swapPixels(pixel,hitPixel);
}
else if (elements[hitPixel.element].state === "liquid") {
swapPixels(pixel,pixelMap[hitPixel.x][hitPixel.y-1]);
}
}
}
// 15% chance to change direction
if (Math.random() < 0.15) {
pixel.dir *= -1;
}
// spacesuit A/C
if (pixel.temp > 40) { pixel.temp -= 3; }
else if (pixel.temp < 32) { pixel.temp += 3; }
}
},
foodNeed: 50,
egg: "settler",
density: 2710,
state: "solid",
conduct: .05,
temp: 37,
tempHigh: 300,
stateHigh: ["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"],
tempLow: -75,
stateLow: "frozen_meat",
burn: 10,
burnTime: 250,
burnInto: ["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"],
hardness: 0.02,
breakInto: ["blood","meat","bone","blood","meat","bone","metal_scrap"],
forceSaveColor: true,
reactions: {
"cancer": { elem1:"cancer", chance:0.0005 },
"radiation": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.04 },
"neutron": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.003 },
"fallout": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.003 },
"plague": { elem1:"plague", chance:0.005 },
"oxygen": { func:function(pixel,air){pixel.oxygen += 5}, elem2:"carbon_dioxide", chance:0.5 },
"carbon_dioxide": { func:function(pixel,air){pixel.oxygen -= 1}, chance:0.05 },
"dust_cloud": { func:function(pixel,air){pixel.oxygen -= 5}, elem2:null, chance:0.05 },
"exoplanetary_dust": { elem2:"dust_cloud", chance:0.001 },
"meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"cooked_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"cured_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"sugar": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"broth": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"yolk": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"hard_yolk": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"dough": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"batter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"melted_butter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"chocolate": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"melted_chocolate": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"grape": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"tomato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"herb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"lettuce": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"corn": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"popcorn": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
"potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"baked_potato": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
"bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"toast": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"gingerbread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"baked_batter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"wheat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"candy": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"yogurt": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"frozen_yogurt": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"ice_cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"beans": { elem2:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,"stench"], chance:0.2, func:behaviors.FEEDPIXEL },
"tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"coffee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"soda": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"chocolate_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"fruit_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"pilk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"eggnog": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"juice": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"cheese": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"melted_cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"alcohol": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"antidote": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"honey": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"caramel": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"molasses": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
"ketchup": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"pumpkin_seed": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut_butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"jelly": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"mayo": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"mashed_potato": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"sauce": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"pickle": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"food_container": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"sun": { elem1:["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"] },
"water": { func:function(pixel,water){pixel.oxygen -= 1}, elem2:"bubble", attr2:{"clone":"water"}, chance:0.0002 },
"salt_water": { func:function(pixel,water){pixel.oxygen -= 2}, elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.0002 },
"sugar_water": { func:function(pixel,water){pixel.oxygen -= 2}, elem2:"bubble", attr2:{"clone":"sugar_water"}, chance:0.0002 },
"seltzer": { func:function(pixel,water){pixel.oxygen -= 4}, elem2:"bubble", attr2:{"clone":["seltzer","seltzer","carbon_dioxide"]}, chance:0.0002 },
"pool_water": { func:function(pixel,water){pixel.oxygen -= 1}, elem2:"bubble", attr2:{"clone":"pool_water"}, chance:0.0002 },
"dirty_water": { func:function(pixel,water){pixel.oxygen -= 4}, elem2:"bubble", color2:["#0e824e","#07755a","#0c6934"], attr2:{"clone":"dirty_water"}, chance:0.0003 },
"blood": { func:function(pixel,water){pixel.oxygen -= 5}, elem2:"bubble", color2:["#ff0000","#ee0000","#ff4040"], attr2:{"clone":"blood"}, chance:0.0003 },
},
properties: {
dead: false,
dir: 1,
panic: 0,
oxygen: 100,
ogcrew: false,
},
}
elements.nanobot_terraformers = {
color: "#c0c0c0",
hidden: true,
behavior: [
"CH:exoplanetary_dust>nanobot_terraformers%50|CH:exoplanetary_dust>nanobot_terraformers%50 AND CR:oxygen%5|CH:exoplanetary_dust>nanobot_terraformers%50",
"CH:exoplanetary_dust>nanobot_terraformers%50|XX|CH:exoplanetary_dust>nanobot_terraformers%50",
"CH:exoplanetary_dust,exoplanetary_rock>nanobot_terraformers%50 AND M2|CH:exoplanetary_dust>nanobot_terraformers%50 AND M1|CH:exoplanetary_dust>nanobot_terraformers%50 AND M2",
],
reactions: {
"exoplanetary_rock": { elem2:"nanobot_terraformers", attr2:{"clone":"rock"}},
"dusty_water": { elem2:"nanobot_terraformers", attr2:{"clone":"water"}},
"dusty_ice": { elem2:"nanobot_terraformers", attr2:{"clone":"ice"}},
"exoplanetary_sand": { elem2:"nanobot_terraformers", attr2:{"clone":"sand"} },
},
tick: function(pixel) {
if (pixel.age > 25 || (pixel.clone && isEmpty(pixel.x,pixel.y-1))) {
if (pixel.clone) {
changePixel(pixel,pixel.clone);
return;
}
changePixel(pixel,"dirt");
}
pixel.age ++;
},
properties: {
"age": 0,
},
category: "colonies",
state: "solid",
density: 21450,
excludeRandom: true,
conduct: 0.25,
darkText: true,
tempHigh: 1456,
stateHigh: "molten_steel"
}
elements.room_temper = {
color: "#29632f",
behavior: behaviors.WALL,
tick: function(pixel) {
// from nouserthings.js <3
for (var i = 0; i < squareCoords.length; i++) {
var coord = squareCoords[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (!isEmpty(x,y, true)) {
if(pixelMap[x][y].temp < -230) {
pixelMap[x][y].temp = (pixelMap[x][y].temp + 7)
} else if(pixelMap[x][y].temp > 270) {
pixelMap[x][y].temp = (pixelMap[x][y].temp - 7)
} else if (pixelMap[x][y].temp < 20) {
pixelMap[x][y].temp = (pixelMap[x][y].temp + 2)
} else if (pixelMap[x][y].temp > 20) {
pixelMap[x][y].temp = (pixelMap[x][y].temp - 2)
}
}
}
},
category:"colonies",
state:"solid",
insulate: true,
noMix: true,
movable: false,
};
elements.food_dispenser = {
color: "#606378",
behavior: [
"XX|ST|XX",
"ST|XX|ST",
"XX|XX|XX",
],
tick: function(pixel) {
if (isEmpty(pixel.x, pixel.y+4) && isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.95) {
createPixel("food_container",pixel.x,pixel.y+1);
}
},
category:"colonies",
tempHigh: 1455.5,
stateHigh: "molten_steel",
conduct: 0.42
}
elements.food_container = {
behavior: behaviors.STURDYPOWDER,
category: "colonies",
hidden: true,
state: "solid",
color: ["#2b1107","#5c3322","#2b1107","#5c3322","#2b1107","#5c3322"],
tempHigh: 250,
stateHigh: ["sugar","cooked_meat","dead_plant","ash","ash","charcoal"],
burn: 10,
burnTime: 200,
burnInto: ["sugar","cooked_meat","dead_plant","ash","ash","charcoal"],
breakInto: ["sugar","cooked_meat","dead_plant","sugar","cooked_meat","dead_plant","sugar","cooked_meat","dead_plant","sawdust","sawdust","sawdust","sawdust"],
breakIntoColor: ["#2b1107","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#41770B","#774C35"],
isFood: true
}
elements.leaving_rocket = {
name: "rocket",
hidden: true,
color: "#ff6f47",
tick: function(pixel) {
if (pixel.passengers > 14) {
if (!tryMove(pixel, pixel.x, pixel.y-1)) {
if (outOfBounds(pixel.x,pixel.y-1)) {
deletePixel(pixel.x,pixel.y);
}
else if (pixelMap[pixel.x][pixel.y-1].element === "rocket_gate") {
tryMove(pixel, pixel.x, pixel.y-2);
}
else {
// tryMove again to the top left or top right
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y-1);
}
}
if (Math.random() > 0.5 && isEmpty(pixel.x,pixel.y+1)) {
createPixel("smoke", pixel.x, pixel.y+1);
}
}
else {
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
// tryMove again to the bottom left or bottom right
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1);
}
}
doDefaults(pixel)
},
properties: {
"passengers": 0,
},
conduct: 0.5,
ignore: ["cloner","ecloner","slow_cloner","clone_powder","floating_cloner"],
category: "colonies",
state: "solid",
density: 7300,
cooldown: defaultCooldown
}
elements.arriving_rocket = {
name: "rocket",
color: "#ff6f47",
tick: function(pixel) {
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1);
pixel.age++;
}
if (Math.random() > 0.5 && pixel.age < 10) {
createPixel("smoke", pixel.x, pixel.y-1);
}
if (pixel.age > 250 && pixel.base_established === false) {
if (isEmpty(pixel.x, pixel.y-1)) {
createPixel("base",pixel.x, pixel.y-1);
pixel.base_established = true;
}
}
if (pixel.age > 500 && pixel.passengers > 0) {
if (isEmpty(pixel.x+1, pixel.y-1)) {
createPixel("settler",pixel.x+1, pixel.y-1);
pixelMap[pixel.x+1][pixel.y-1].ogcrew = true;
pixel.passengers -= 1;
}
else if (isEmpty(pixel.x-1, pixel.y-1)) {
createPixel("settler",pixel.x-1, pixel.y-1);
pixelMap[pixel.x-1][pixel.y-1].ogcrew = true;
pixel.passengers -= 1;
}
}
if (pixel.passengers < 1) {
changePixel(pixel,"concrete");
}
},
properties: {
"passengers": 5,
"age": 0,
"base_established": false,
},
conduct: 0.5,
ignore: ["cloner","ecloner","slow_cloner","clone_powder","floating_cloner"],
category: "colonies",
state: "solid",
density: 7300,
cooldown: defaultCooldown
}
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,exoplanetMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${exoplanetMod} mod is required and has been automatically inserted (reload for this to take effect).`)
};

220
mods/exoplanet.js Normal file
View File

@ -0,0 +1,220 @@
elements.dusty_water = {
color: "#7C7C95",
behavior: behaviors.LIQUID,
tempHigh: 105,
stateHigh: ["steam","dust_cloud"],
tempLow: 0,
stateLowName: "dusty_ice",
viscosity: 10,
reactions: {
"rock": { elem2: "wet_sand", chance: 0.0004 },
"exoplanetary_rock": { elem2: "exoplanetary_sand", chance: 0.0004 },
"limestone": { elem2: "wet_sand", chance: 0.0004 },
"plant": { elem1:"water", chance:0.05 },
"algae": { elem1:"water", chance:0.05 },
"kelp": { elem1:"water", chance:0.05 },
"charcoal": { elem1:"water", chance:0.02 },
"gravel": { elem1:"water", chance:0.01 },
"fly": { elem2:"dead_bug", chance:0.1, oneway:true },
"firefly": { elem2:"dead_bug", chance:0.1, oneway:true },
"bee": { elem2:"dead_bug", chance:0.05, oneway:true },
"stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true },
},
hidden: true,
state: "liquid",
density: 1005,
conduct: 0.01,
extinguish: true,
category: "exoplanet",
}
elements.exoplanetary_sand = {
color: ["#A29C7D","#c0c0c0","#808080","#4f4f4f","#808080","#949494","#A29C7D"],
behavior: behaviors.POWDER,
reactions: {
"tornado":{elem1:"sandstorm", oneway:true},
},
tempHigh: 1700,
stateHigh: "molten_exoplanetary_glass",
category: "exoplanet",
state: "solid",
density: 1602
}
elements.exoplanetary_glass = {
color: ["#6F807F","#6F807F","#748F8D","#6F807F","#6F807F"],
colorPattern: textures.GLASS,
colorKey: {
"g": "#6F807F",
"s": "#728886",
"S": "#748F8D"},
behavior: behaviors.WALL,
reactions: {
"radiation": { elem1:"rad_glass", chance:0.33 },
"rad_steam": { elem1:"rad_glass", elem2:null, chance:0.33 },
"fallout": { elem1:"rad_glass", elem2:"radiation", chance:0.1 }
},
tempHigh: 1500,
category: "exoplanet",
state: "solid",
density: 2500,
breakInto: "exoplanetary_sand",
noMix: true,
hidden: true,
}
elements.molten_exoplanetary_glass = {
reactions: {
"radiation": { elem1:"molten_rad_glass", chance:0.66 },
"rad_steam": { elem1:"molten_rad_glass", elem2:null, chance:0.33 },
"molten_uranium": { elem1:"molten_rad_glass", elem2:null },
"fallout": { elem1:"molten_rad_glass", elem2:"radiation" }
},
hidden: true,
category: "exoplanet",
}
elements.dust_cloud = {
color: ["#808080","#2e2e2e","#2e2e2e"],
behavior: [
"XX|M1%0.5|M2%0.5",
"XX|CH:exoplanetary_dust%0.075|M1%2.5 AND BO",
"XX|M1%0.5|M2%0.5",
],
reactions: {
"fireball": { elem1:null, elem2:"fire_cloud", chance:0.25 }
},
category: "exoplanet",
tempHigh: 825,
stateHigh: ["exoplanetary_rock","exoplanetary_rock","fire",],
hidden: true,
state: "gas",
density: 0.7,
ignoreAir: true
}
elements.exoplanetary_dust = {
color: "#808080",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1|M2",
],
reactions: {
"water": { elem2: "dusty_water", elem1: null },
},
category: "exoplanet",
breakInto: ["exoplanetary_dust","exoplanetary_dust","exoplanetary_dust","dust_cloud"],
burn: 10,
burnTime: 1,
tempHigh: 700,
burnInto:"exoplanetary_rock",
stateHigh: "exoplanetary_rock",
state: "solid",
density: 1490
}
elements.exoplanetary_rock = {
color: ["#c0c0c0","#4f4f4f","#949494"],
behavior: behaviors.POWDER,
reactions: {
"fly": { elem2:"dead_bug", chance:0.25, oneway:true },
"firefly": { elem2:"dead_bug", chance:0.2, oneway:true },
"stink_bug": { elem2:"dead_bug", chance:0.15, oneway:true },
"bee": { elem2:"dead_bug", chance:0.1, oneway:true },
"bird": { elem2:"feather", chance:0.025, oneway:true },
"egg": { elem2:"yolk", oneway:true },
"grass": { elem2:null, chance:0.005, oneway:true },
"bone": { elem2:"oil", tempMin:300, chance:0.005, oneway:true },
"dead_plant": { elem2:"charcoal", tempMin:200, chance:0.005, oneway:true },
"charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true },
"sand": { elem2:"packed_sand", tempMin:500, chance:0.005, oneway:true },
"wet_sand": { elem2:"packed_sand", chance:0.005, oneway:true },
},
tempHigh: 950,
stateHigh: "exoplanetary_magma",
category: "exoplanet",
state: "solid",
density: 2550,
hardness: 0.5,
breakInto: ["exoplanetary_sand","exoplanetary_sand","exoplanetary_dust","dust_cloud"]
}
elements.exoplanetary_magma = {
color: ["#ff6f00","#ff8c00","#ff4d00"],
behavior: behaviors.MOLTEN,
reactions: {
"ice": { elem1: "basalt" },
"ash": { elem1: "molten_tuff", "elem2":null },
"molten_ash": { elem1: "molten_tuff", "elem2":null },
"charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true },
},
temp: 1200,
tempLow: 800,
stateLow: ["basalt","exoplanetary_rock","exoplanetary_rock","exoplanetary_rock"],
viscosity: 10000,
state: "liquid",
density: 2725,
alias: "alien lava",
category: "exoplanet",
hidden: true,
}
elements.exoplanetary_rock = {
color: ["#c0c0c0","#4f4f4f","#949494"],
behavior: behaviors.POWDER,
reactions: {
"fly": { elem2:"dead_bug", chance:0.25, oneway:true },
"firefly": { elem2:"dead_bug", chance:0.2, oneway:true },
"stink_bug": { elem2:"dead_bug", chance:0.15, oneway:true },
"bee": { elem2:"dead_bug", chance:0.1, oneway:true },
"bird": { elem2:"feather", chance:0.025, oneway:true },
"egg": { elem2:"yolk", oneway:true },
"grass": { elem2:null, chance:0.005, oneway:true },
"bone": { elem2:"oil", tempMin:300, chance:0.005, oneway:true },
"dead_plant": { elem2:"charcoal", tempMin:200, chance:0.005, oneway:true },
"charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true },
"sand": { elem2:"packed_sand", tempMin:500, chance:0.005, oneway:true },
"wet_sand": { elem2:"packed_sand", chance:0.005, oneway:true },
},
tempHigh: 950,
stateHigh: "exoplanetary_magma",
category: "exoplanet",
state: "solid",
density: 2550,
hardness: 0.5,
breakInto: ["exoplanetary_sand","exoplanetary_sand","exoplanetary_dust","dust_cloud"]
}
worldgentypes.exoplanet = {
layers: [
[0.9, "exoplanetary_dust"],
[0.1, "exoplanetary_sand", 0.15],
[0.2, "dusty_ice", 0.075],
[0.05, "exoplanetary_rock"],
[0, "basalt"],
],
decor: [
["exoplanetary_dust", 0.05],
["dust_cloud", 0.25]
],
baseHeight: 0.5,
temperature: -15
}
worldgentypes.exo_ocean = {
layers: [
[0.99, "exoplanetary_dust"],
[0.40, "dusty_ice"],
[0.25, "bone", 0.01],
[0.25, "dusty_ice"],
[0.1, "exoplanetary_sand"],
[0.03, "exoplanetary_rock", 0.5],
[0.03, "exoplanetary_rock"],
[0, "basalt"],
],
decor: [
["dust_cloud", 0.1, 10],
],
temperature: -15
}

645
mods/flesh_infection.js Normal file
View File

@ -0,0 +1,645 @@
// by Nekonico
eLists.FESTER = ["fleshy_dirt","dirt","rock","rock_wall","basalt","limestone","steel","iron","glass_shard","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"],
elements.fleshy_dirt = {
color: ["#81512F","#895933","#825231","#906159"],
behavior: [
"CH:dirt,mud>fleshy_dirt%1|CH:grass>flesh_mound%0.5 AND CH:root>vein_root%0.5 AND CH:fiber>fibrous_flesh%0.5|CH:dirt,mud>fleshy_dirt%1",
"XX|XX|XX",
"M2 AND CH:dirt,mud>fleshy_dirt%1|M1 AND CH:dirt,mud>fleshy_dirt%0.5|M2 AND CH:dirt,mud>fleshy_dirt%1",
],
category: "flesh",
state: "solid",
density: 2000,
tempHigh: 225,
stateHigh: "dirt",
tempLow: -50,
stateLow: "permafrost",
burn: 20,
burnTime: 40,
burnInto: "dirt",
};
elements.teeth = {
color: "#d9d9d9",
behavior: [
"XX|SM%0.75|XX",
"ST:flesh_mound|XX|ST:flesh_mound",
"XX|ST:flesh_mound AND M1|XX",
],
reactions: {
"acid": { elem1: "quicklime", elem2: null },
"head": { elem2:["flesh_mound",null,null,null], chance:0.01 },
"body": { elem2:["flesh_mound",null,null,null], chance:0.01 },
"frog": { elem2:["flesh_mound",null,null,null], chance:0.05 },
"tadpole": { elem2:["flesh_mound",null,null,null], chance:0.05 },
"fish": { elem2:["flesh_mound",null,null,null], chance:0.05 },
"rat": { elem2:["flesh_mound",null,null,null], chance:0.05 },
"bird": { elem2:["flesh_mound",null,null,null], chance:0.05 },
"worm": { elem2:["flesh_mound",null], chance:0.1 },
"fly": { elem2:["flesh_mound",null], chance:0.1 },
"ant": { elem2:["flesh_mound",null], chance:0.1 },
"frog": { elem2:["flesh_mound",null], chance:0.05 },
"snail": { elem2:["flesh_mound","quicklime"] },
"slug": { elem2:["flesh_mound",null], chance:0.1 },
"meat": { elem2:["flesh_mound",null,null,null], chance:0.1 },
"blood": { elem2:null, chance:0.05 },
"infection": { elem2:null, chance:0.04 },
"bone": { elem2:null, chance:0.1 },
"cooked_meat": { elem2:null, chance:0.1 },
"rotten_meat": { elem2:null, chance:0.1 },
"sugar": { elem2:null, chance:0.1 },
"broth": { elem2:null, chance:0.2 },
"yolk": { elem2:null, chance:0.1 },
"hard_yolk": { elem2:null, chance:0.1 },
"dough": { elem2:null, chance:0.1 },
"batter": { elem2:null, chance:0.2 },
"butter": { elem2:null, chance:0.1 },
"melted_butter": { elem2:null, chance:0.2 },
"chocolate": { elem2:null, chance:0.2 },
"melted_chocolate": { elem2:null, chance:0.3 },
"grape": { elem2:null, chance:0.1 },
"tomato": { elem2:null, chance:0.1 },
"herb": { elem2:null, chance:0.1 },
"lettuce": { elem2:null, chance:0.1 },
"corn": { elem2:null, chance:0.1 },
"popcorn": { elem2:null, chance:0.15 },
"potato": { elem2:null, chance:0.1 },
"baked_potato": { elem2:null, chance:0.15 },
"bread": { elem2:null, chance:0.1 },
"toast": { elem2:null, chance:0.1 },
"gingerbread": { elem2:null, chance:0.1 },
"baked_batter": { elem2:null, chance:0.2 },
"wheat": { elem2:null, chance:0.1 },
"candy": { elem2:null, chance:0.1 },
"yogurt": { elem2:null, chance:0.2 },
"frozen_yogurt": { elem2:null, chance:0.1 },
"ice_cream": { elem2:null, chance:0.2 },
"beans": { elem2:null, chance:0.2 },
"tea": { elem2:null, chance:0.2 },
"coffee": { elem2:null, chance:0.2 },
"milk": { elem2:null, chance:0.2 },
"cream": { elem2:null, chance:0.2 },
"soda": { elem2:null, chance:0.2 },
"chocolate_milk": { elem2:null, chance:0.2 },
"fruit_milk": { elem2:null, chance:0.2 },
"pilk": { elem2:null, chance:0.2 },
"eggnog": { elem2:null, chance:0.2 },
"juice": { elem2:null, chance:0.2 },
"cheese": { elem2:null, chance:0.1 },
"melted_cheese": { elem2:null, chance:0.2 },
"alcohol": { elem2:null, chance:0.2 },
"antidote": { elem2:null, chance:0.2 },
"honey": { elem2:null, chance:0.2 },
"caramel": { elem2:null, chance:0.2 },
"molasses": { elem2:null, chance:0.05 },
"ketchup": { elem2:null, chance:0.1 },
"pumpkin_seed": { elem2:null, chance:0.1 },
"nut": { elem2:null, chance:0.1 },
"nut_meat": { elem2:null, chance:0.1 },
"nut_butter": { elem2:null, chance:0.1 },
"nut_milk": { elem2:null, chance:0.2 },
"jelly": { elem2:null, chance:0.2 },
"mayo": { elem2:null, chance:0.2 },
"mashed_potato": { elem2:null, chance:0.2 },
"sauce": { elem2:null, chance:0.2 },
"pickle": { elem2:null, chance:0.1 },
},
category:"flesh",
tempHigh: 1000,
stateHigh: ["steam","salt","meat","quicklime"],
state: "solid",
density: 2000,
hardness: 0.5,
breakInto: ["flesh_mound","quicklime"],
hidden: true,
excludeRandom: true,
},
elements.flesh_mound = {
color: ["#9e4839","#ba6449","#d2856c","#a14940","#E94336"],
behavior: [
"XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5 AND CR:fleshwood_sapling%0.0001|XX",
"CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5|XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5",
"XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5 AND CH:dirt>fleshy_dirt%0.5|XX",
],
tick: function(pixel) {
if (pixel.start === pixelTicks && pixel.fruit === undefined && !pixel.stop) {
if (Math.random() < 0.95) {
pixel.fruit = Math.random() < 0.75 ? "flesh_beast" : "teeth";
}
else { pixel.fruit = "acidic_bile" }
}
if (!isEmpty(pixel.x-1,pixel.y,true)) {
if (pixelMap[pixel.x-1][pixel.y].fruit === undefined && pixelMap[pixel.x-1][pixel.y].element === "flesh_mound") {
pixelMap[pixel.x-1][pixel.y].fruit = pixel.fruit;
}
}
if (!isEmpty(pixel.x+1,pixel.y,true)) {
if (pixelMap[pixel.x+1][pixel.y].fruit === undefined && pixelMap[pixel.x+1][pixel.y].element === "flesh_mound") {
pixelMap[pixel.x+1][pixel.y].fruit = pixel.fruit;
}
}
if (!isEmpty(pixel.x,pixel.y+1,true)) {
if (pixelMap[pixel.x][pixel.y+1].fruit === undefined && pixelMap[pixel.x][pixel.y+1].element === "flesh_mound") {
pixelMap[pixel.x][pixel.y+1].fruit = pixel.fruit;
}
}
if (!isEmpty(pixel.x,pixel.y-1,true)) {
if (pixelMap[pixel.x][pixel.y-1].fruit === undefined && pixelMap[pixel.x][pixel.y-1].element === "flesh_mound") {
pixelMap[pixel.x][pixel.y-1].fruit = pixel.fruit;
}
}
if (isEmpty(pixel.x,pixel.y-1)) {
pixel.sp = 0; //not supported
}
else if (!outOfBounds(pixel.x,pixel.y-1) && pixelMap[pixel.x][pixel.y-1].element === "flesh_mound" && pixelMap[pixel.x][pixel.y-1].sp === 0) {
pixel.sp = 0;
}
else { pixel.sp = 1 } //supported
if (pixel.stop) {
if (pixel.sp === 0) { tryMove(pixel, pixel.x, pixel.y+1); }
return;
}
if (pixel.sp === 0) { tryMove(pixel, pixel.x, pixel.y+1); }
else {
if (pixel.fert && pixel.stage && Math.random() < 0.01 && isEmpty(pixel.x,pixel.y+1)) {
clonePixel(pixel,pixel.x,pixel.y+1);
pixelMap[pixel.x][pixel.y+1].fert = true;
pixelMap[pixel.x][pixel.y+1].stage = pixel.stage-1;
}
}
if (pixel.fert===undefined) { // able to grow down
pixel.fert = Math.random() < 0.50;
}
if (pixel.stage===undefined) {
pixel.stage = Math.floor(Math.random()*20)+10;
}
if (Math.random() < 0.03 && isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x-1,pixel.y-1) && (outOfBounds(pixel.x-1,pixel.y-1) || pixelMap[pixel.x-1][pixel.y-1].element !== "flesh_mound")) {
createPixel("flesh_mound",pixel.x-1,pixel.y);
pixelMap[pixel.x-1][pixel.y].fruit = pixel.fruit;
}
if (Math.random() < 0.03 && isEmpty(pixel.x+1,pixel.y) && !isEmpty(pixel.x+1,pixel.y-1) && (outOfBounds(pixel.x+1,pixel.y-1) || pixelMap[pixel.x+1][pixel.y-1].element !== "flesh_mound")) {
createPixel("flesh_mound",pixel.x+1,pixel.y);
pixelMap[pixel.x+1][pixel.y].fruit = pixel.fruit;
}
if (Math.random() < 0.03 && isEmpty(pixel.x,pixel.y-1) && (
(!isEmpty(pixel.x-1,pixel.y-1) && (outOfBounds(pixel.x-1,pixel.y-1) || pixelMap[pixel.x-1][pixel.y-1].element !== "flesh_mound")) ||
(!isEmpty(pixel.x+1,pixel.y-1) && (outOfBounds(pixel.x+1,pixel.y-1) || pixelMap[pixel.x+1][pixel.y-1].element !== "flesh_mound")))
) {
createPixel("flesh_mound",pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].fruit = pixel.fruit;
}
if (pixel.fruit && Math.random() < 0.0001) {
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = pixel.x + coords[0];
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel(pixel.fruit,x,y)
break;
}
}
}
if (pixel.h < 2 && Math.random() < 0.0005 && isEmpty(pixel.x,pixel.y-1)) {
createPixel(pixel.element,pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].h = pixel.h+1;
}
var coords = [
[pixel.x+1,pixel.y],
[pixel.x-1,pixel.y],
[pixel.x+1,pixel.y+1],
[pixel.x-1,pixel.y+1],
];
for (var i = 0; i < coords.length; i++) {
if (Math.random() < 0.005 && isEmpty(coords[i][0],coords[i][1])) {
if (!isEmpty(coords[i][0],coords[i][1]+1,true)) {
var soil = pixelMap[coords[i][0]][coords[i][1]+1];
if (eLists.FESTER.indexOf(soil.element) !== -1) {
createPixel(pixel.element,coords[i][0],coords[i][1]);
}
}
}
}
if (Math.random() < 0.0002 && pixel.age > 500 && pixel.temp < 90 && pixel.rooting === false) {
pixel.rooting = true;
}
if (Math.random() < 0.002 && pixel.age > 500 && pixel.temp < 90 && pixel.rooting === true) {
if (!outOfBounds(pixel.x,pixel.y+1)) {
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
if (dirtPixel && (eLists.FESTER.indexOf(dirtPixel.element) !== -1 || dirtPixel.element === "grass")) {
changePixel(dirtPixel,"vein_root");
}
}
}
pixel.age++;
doDefaults(pixel);
},
ignore: ["teeth","flesh_mound","flesh_beast"],
renderer: renderPresets.PLANTCHAR,
properties: {
"h": 0,
"age": 0,
"rooting": false,
"fruit": undefined,
},
reactions: {
"cell": { elem2:"flesh_mound", chance:0.005 },
"skin": { elem2:"flesh_mound", chance:0.005 },
"sugar_water": { elem2:"flesh_mound", chance:0.05 },
"acidic_bile": { elem2:null, chance:0.005 },
"plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 },
"dead_plant": { elem2:"flesh_mound", chance:0.005 },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
"wood": { elem2:"dry_fleshwood", chance:0.005 },
"tree_branch": { elem2:"fleshwood", chance:0.005 },
"head": { elem2:"flesh_mound", chance:0.001},
"body": { elem2:"flesh_mound", chance:0.001 },
"frog": { elem2:"flesh_mound", chance:0.005 },
"tadpole": { elem2:"flesh_mound", chance:0.005 },
"fish": { elem2:"flesh_mound", chance:0.005 },
"rat": { elem2:"flesh_mound", chance:0.005 },
"bird": { elem2:"flesh_mound", chance:0.005 },
},
tempHigh: 100,
stateHigh: "meat",
tempLow: -2,
stateLow: "frozen_meat",
burn:3,
burnTime:20,
breakInto: "meat",
category:"flesh",
state: "solid",
density: 1400,
}
elements.vein_root = {
color: ["#c72114","#8d3728","#a95338","#c72114","#d83225","#c1745b","#903830", "#c72114",],
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005|CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh,fibrous_flesh%0.5|CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005",
],
reactions: {
"rock": { elem2:"sand", chance:0.0008 },
"mud": { elem2:"dirt", chance:0.01 },
"wet_sand": { elem2:"sand", chance:0.01 },
"water": { elem2:null, chance:0.001 },
"blood": { elem2:null, chance:0.01 },
"sugar_water": { elem2:null, chance:0.0025 },
"acidic_bile": { elem2:null, chance:0.0025 }
},
tempHigh: 175,
stateHigh: "meat",
tempLow: -50,
stateLow: "frozen_meat",
burn: 20,
burnTime: 60,
burnInto: "meat",
breakInto: "blood",
category: "flesh",
state: "solid",
density: 1250,
conduct: 0.1,
hidden: true
}
elements.fibrous_flesh = {
color: ["#c72114","#7c2617","#984227","#c72114","#b0634a","#802720","#c72114"],
behavior: behaviors.STURDYPOWDER,
tempHigh:175,
stateHigh: "meat",
tempLow: -50,
stateLow: "frozen_meat",
burn: 20,
burnTime: 60,
burnInto: "meat",
category:"flesh",
hidden: true,
breakInto: "blood",
state: "solid",
density: 462
}
elements.solid_flesh = {
color: ["#7c2617","#984227","#c72114","#b0634a","#802720"],
behavior: behaviors.WALL,
reactions: {
"plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 },
"grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 },
"tree_branch": { elem1:null, elem2:"fleshwood" },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
},
tempHigh:175,
stateHigh: "meat",
tempLow: -50,
stateLow: "frozen_meat",
burn: 20,
burnTime: 60,
burnInto: "meat",
category:"flesh",
hidden: true,
breakInto: ["blood","meat","meat"],
state: "solid",
density: 462
}
elements.flesh_beast = {
color: ["#9e4839","#ba6449","#a14940"],
behavior: [
"XX|CR:acidic_bile%0.05 AND M2%0.5|M2%5 AND SW:acidic_bile,meat,rotten_meat,blood%14",
"XX|FX%2|M2%50 AND BO",
"XX|M1|M2%50 AND SW:acidic_bile,meat,rotten_meat,blood%14",
],
reactions: {
"cell": { elem2:"flesh_mound", chance:0.05, func:behaviors.FEEDPIXEL },
"head": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL },
"body": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL },
"frog": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"tadpole": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"fish": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"rat": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"bird": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"bone": { elem2:"quicklime", chance:0.005, func:behaviors.FEEDPIXEL },
"bone_marrow": { elem2:["flesh_mound","quicklime"], chance:0.005, func:behaviors.FEEDPIXEL },
"skin": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL },
"sugar": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
"sugar_water": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
"plant": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL },
"grass": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL },
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
"meat": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL },
"cooked_meat": { elem2:["flesh_mound",null,null,null], chance:0.1, func:behaviors.FEEDPIXEL },
"rotten_meat": { elem2:["flesh_mound","plague",null,null], chance:0.1, func:behaviors.FEEDPIXEL },
"cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"rotten_cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"melted_cheese": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"tomato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"sauce": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"vine": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"evergreen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"algae": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"grass_seed": { elem2:null, chance:0.3 , func:behaviors.FEEDPIXEL},
"wheat_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"wheat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"potato_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"corn_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"corn": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL},
"lichen": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
"flower_seed": { elem2:null, chance:0.4 , func:behaviors.FEEDPIXEL},
"flour": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL},
"dough": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"toast": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"gingerbread": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
"rice": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL},
"yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
"beans": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
"salt": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"sugar": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"herb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"popcorn": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"candy": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"caramel": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL },
"lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"egg": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"yolk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"eggnog": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"grape": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL },
"batter": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL },
"baked_batter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"butter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"melted_butter": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"lettuce": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"baked_potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"ice_cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"cream": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL },
"pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"pumpkin_seed": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
"coffee_bean": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"coffee_ground": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"nut_butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"jelly": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"worm": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL },
"fly": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL },
"ant": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL },
"frog": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL },
"snail": { elem2:["flesh_mound","quicklime"], chance:0.1, func:behaviors.FEEDPIXEL },
"slug": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
"wood": { elem2:"dry_fleshwood", chance:0.005 },
"tree_branch": { elem2:"fleshwood", chance:0.005 },
},
foodNeed: 2,
egg: "flesh_beast",
category: "flesh",
temp: 37.6,
tempHigh: 120,
stateHigh: "rotten_meat",
tempLow: -18,
stateLow: "frozen_meat",
breakInto: ["acidic_bile","rotten_meat"],
burn:80,
burnTime:150,
state: "solid",
density: 1450,
conduct: 0.25
}
elements.fleshwood_sapling = {
color: ["#7c2617","#984227","#c72114","#b0634a","#802720"],
tick: function(pixel) {
if (!tryMove(pixel,pixel.x,pixel.y+1)) {
if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) {
if (!outOfBounds(pixel.x,pixel.y+1)) {
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
if (dirtPixel && (eLists.FESTER.indexOf(dirtPixel.element) !== -1 || dirtPixel.element === "grass")) {
changePixel(dirtPixel,"vein_root");
}
}
if (isEmpty(pixel.x,pixel.y-1)) {
if (!pixel.wc) {
var c = Math.random();
if (c < 0.01) { pixel.wc="#632e1f"; pixel.lc="#7c2617" }
else if (c < 0.05) { pixel.wc="#9e4839"; pixel.lc="#7c2617" }
else if (c < 0.1) { pixel.wc="#9e4839"; pixel.lc="#984227" }
else if (c < 0.2) { pixel.wc="#a14940"; pixel.lc="#984227" }
else if (c < 0.3) { pixel.wc="#ba6449"; pixel.lc="#c72114" }
else if (c < 0.4) { pixel.wc="#a14940"; pixel.lc="#c72114" }
else if (c < 0.45) { pixel.wc="#ba6449"; pixel.lc="#b0634a" }
else if (c < 0.5) { pixel.wc="#a14940"; pixel.lc="#b0634a" }
else { pixel.wc="#9e4839"; pixel.lc="#802720" }
pixel.color = pixelColorPick(pixel, pixel.lc);
}
movePixel(pixel,pixel.x,pixel.y-1);
createPixel(Math.random() > 0.5 ? "dry_fleshwood" : "fleshwood",pixel.x,pixel.y+1);
pixelMap[pixel.x][pixel.y+1].wc = pixel.wc;
pixelMap[pixel.x][pixel.y+1].lc = pixel.lc;
pixelMap[pixel.x][pixel.y+1].color = pixelColorPick(pixelMap[pixel.x][pixel.y+1], pixel.wc);
}
}
else if (pixel.age > 1000 && Math.random() < 0.05) {
changePixel(pixel,"dry_fleshwood");
pixel.color = pixelColorPick(pixel, pixel.wc);
}
pixel.age++;
}
doDefaults(pixel);
},
properties: {
"age":0
},
tempHigh: 100,
stateHigh: "meat",
tempLow: -25,
stateLow: "meat",
burn: 65,
burnTime: 15,
category: "flesh",
state: "solid",
density: 1500,
cooldown: defaultCooldown,
seed: true
}
elements.fleshwood = {
color: ["#9e4839","#ba6449","#a14940"],
tick: function(pixel) {
if (!pixel.burning) {
if (!pixel.lc) { pixel.lc = "#7c2617" }
if (!pixel.wc) { pixel.wc = "#ba6449" }
if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.02) {
if (Math.random() < 0.55) {
createPixel("solid_flesh",pixel.x-1,pixel.y-1);
pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.lc);
}
else {
createPixel("fleshwood",pixel.x-1,pixel.y-1);
pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.wc);
pixelMap[pixel.x-1][pixel.y-1].wc = pixel.wc;
pixelMap[pixel.x-1][pixel.y-1].lc = pixel.lc;
}
}
if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.02) {
if (Math.random() < 0.55) {
createPixel("solid_flesh",pixel.x+1,pixel.y-1);
pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.lc);
}
else {
createPixel("fleshwood",pixel.x+1,pixel.y-1);
pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.wc);
pixelMap[pixel.x+1][pixel.y-1].wc = pixel.wc;
pixelMap[pixel.x+1][pixel.y-1].lc = pixel.lc;
}
}
if (isEmpty(pixel.x,pixel.y-1) && Math.random() < 0.02) {
if (Math.random() < 0.8) {
createPixel("solid_flesh",pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.lc);
}
else {
createPixel("fleshwood",pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.wc);
pixelMap[pixel.x][pixel.y-1].wc = pixel.wc;
pixelMap[pixel.x][pixel.y-1].lc = pixel.lc;
}
}
}
doDefaults(pixel);
},
renderer: renderPresets.WOODCHAR,
reactions: {
"plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 },
"grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 },
"tree_branch": { elem1:null, elem2:"fleshwood" },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
},
movable: false,
tempHigh: 175,
stateHigh: "meat",
tempLow: -30,
stateLow: "meat",
category: "flesh",
burn: 2,
burnTime: 300,
burnInto: ["blood","ash","cooked_meat","ash"],
hidden: true,
state: "solid",
density: 1500,
hardness: 0.15,
breakInto: ["blood","meat"],
forceSaveColor: true
}
elements.dry_fleshwood = {
color: ["#9e4839","#ba6449","#a14940"],
behavior: behaviors.WALL,
renderer: renderPresets.WOODCHAR,
reactions: {
"plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 },
"grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 },
"tree_branch": { elem1:null, elem2:"fleshwood" },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
},
tempHigh: 400,
stateHigh: ["ash","cooked_meat","fire","fire","fire"],
tempLow: -30,
stateLow: "meat",
category: "solids",
burn: 5,
burnTime: 300,
burnInto: ["ash","cooked_meat","fire"],
state: "solid",
hardness: 0.15,
breakInto: ["blood","meat"],
forceSaveColor: true
}
elements.acidic_bile = {
color: ["#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#439809","#258b08","#118511","#127b12","#136d14"],
behavior: [
"XX|DB%1|XX",
"DB%1 AND M2%25|DL%0.001|DB%1 AND M2%25",
"DB%1 AND M2%25|DB%2 AND M1|DB%1 AND M2%25",
],
ignore: ["flesh_beast","flesh_mound","vein_root","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
"ash": { elem1:null, elem2:null },
"limestone": { elem1:null, elem2:["calcium","carbon_dioxide"] },
"quicklime": { elem1:null, elem2:null },
"slaked_lime": { elem1:null, elem2:null },
"borax": { elem1:null, elem2:null },
"ammonia": { elem1:null, elem2:null },
"bleach": { elem1:null, elem2:null },
"cement": { elem1:null, elem2:null },
"glass": { elem1:null, elem2:"glass_shard", chance:0.05 },
"caustic_potash": { elem1:"water", elem2:"potassium_salt" },
"bone": { elem2:"flesh_mound", chance:0.01 },
"water": { elem1:null, elem2:"dirty_water" },
"salt_water": { elem1:null, elem2:"water" },
"sugar_water": { elem1:null, elem2:"water" },
"plant": { elem2:["dead_plant","flesh_mound"], chance:0.005 },
"grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 },
"tree_branch": { elem1:null, elem2:["dry_fleshwood","dry_fleshwood","dead_plant","fleshwood"] },
"charcoal": { elem1:null, elem2:"carbon_dioxide" },
"rock": { elem1:null, elem2:"sand", chance:0.05 },
"baking_soda": { elem1:"salt_water", elem2:["carbon_dioxide","foam"] },
"calcium": { elem1:"chlorine", elem2:"hydrogen", chance:0.01 },
"zinc": { elem1:"hydrogen", elem2:null, chance:0.03 },
"sugar": { elem1:"steam", elem2:"carbon_dioxide" },
"sapling": { elem2:"fleshwood_sapling", chance:0.005 },
},
tempHigh: 120,
stateHigh: ["steam","steam","salt"],
tempLow: 0,
category:"flesh",
state: "liquid",
density: 1450,
stain: 0.05
}

File diff suppressed because it is too large Load Diff

258
mods/moveable_cubes.js Normal file
View File

@ -0,0 +1,258 @@
elements.steel_cube = {
color: "#71797e",
colorKey: {
"L":"#888f94",
"B":"#71797e"
},
colorPattern: [
"BBLB",
"BBBL",
"BLBB",
"LBBB"
],
reactions: {
"water": { elem1:"rust", chance:0.002 },
"salt_water": { elem1:"rust", chance:0.004 },
"dirty_water": { elem1:"rust", chance:0.03 },
"pool_water": { elem1:"rust", chance:0.03 },
"sugar_water": { elem1:"rust", chance:0.003 },
"seltzer": { elem1:"rust", chance:0.005 },
"salt": { elem1:"rust", chance:0.003 },
"blood": { elem1:"rust", chance:0.002 },
"infection": { elem1:"rust", chance:0.002 },
"antibody": { elem1:"rust", chance:0.002 },
"coffee": { elem1:"rust", chance:0.0002 },
"tea": { elem1:"rust", chance:0.0002 },
"broth": { elem1:"rust", chance:0.0002 },
"juice": { elem1:"rust", chance:0.0002 },
"nut_milk": { elem1:"rust", chance:0.0002 },
},
tempHigh: 1455.5,
stateHigh: "molten_steel",
category: "cubes",
density: 7850,
conduct: 0.42,
hardness: 0.8,
tick: function(pixel) {
if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall
if (!isEmpty(pixel.x, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x][pixel.y-2];
if (cube2.element == "steel") {
if (isEmpty(pixel.x, pixel.y-1)) {
movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x+1, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x+1][pixel.y-1];
if (cube2.element == "steel") {
if (isEmpty(pixel.x+1, pixel.y)) {
movePixel(pixelMap[pixel.x+1][pixel.y-1], pixel.x+1, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x+1][pixel.y-1], pixelMap[pixel.x+1][pixel.y]);
}
}
}
if (!isEmpty(pixel.x+2, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x+2][pixel.y-1];
if (cube2.element == "steel") {
if (isEmpty(pixel.x+2, pixel.y)) {
movePixel(pixelMap[pixel.x+2][pixel.y-1], pixel.x+2, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x+2][pixel.y-1], pixelMap[pixel.x+2][pixel.y]);
}
}
}
if (!isEmpty(pixel.x-1, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x-1][pixel.y-1];
if (cube2.element == "steel") {
if (isEmpty(pixel.x-1, pixel.y)) {
movePixel(pixelMap[pixel.x-1][pixel.y-1], pixel.x-1, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x-1][pixel.y-1], pixelMap[pixel.x-1][pixel.y]);
}
}
}
if (!isEmpty(pixel.x-2, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x-2][pixel.y-1];
if (cube2.element == "steel") {
if (isEmpty(pixel.x-2, pixel.y)) {
movePixel(pixelMap[pixel.x-2][pixel.y-1], pixel.x-2, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x-2][pixel.y-1], pixelMap[pixel.x-2][pixel.y]);
}
}
}
if (!isEmpty(pixel.x+1, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x+1][pixel.y-2];
if (cube2.element == "steel") {
if (isEmpty(pixel.x+1, pixel.y-1)) {
movePixel(pixelMap[pixel.x+1][pixel.y-2], pixel.x+1, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x+1][pixel.y-2], pixelMap[pixel.x+1][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x+2, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x+2][pixel.y-2];
if (cube2.element == "steel") {
if (isEmpty(pixel.x+2, pixel.y-1)) {
movePixel(pixelMap[pixel.x+2][pixel.y-2], pixel.x+2, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x+2][pixel.y-2], pixelMap[pixel.x+2][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x-1, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x-1][pixel.y-2];
if (cube2.element == "steel") {
if (isEmpty(pixel.x-1, pixel.y-1)) {
movePixel(pixelMap[pixel.x-1][pixel.y-2], pixel.x-1, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x-1][pixel.y-2], pixelMap[pixel.x-1][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x-2, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x-2][pixel.y-2];
if (cube2.element == "steel") {
if (isEmpty(pixel.x-2, pixel.y-1)) {
movePixel(pixelMap[pixel.x-2][pixel.y-2], pixel.x-2, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x-2][pixel.y-2], pixelMap[pixel.x-2][pixel.y-1]);
}
}
}
}
}
}
elements.wood_cube = {
color: "#a0522d",
behavior: behaviors.WALL,
renderer: renderPresets.WOODCHAR,
tempHigh: 400,
stateHigh: ["ember","charcoal","fire","fire","fire"],
category: "cubes",
burn: 5,
burnTime: 300,
burnInto: ["ember","charcoal","fire"],
state: "solid",
hardness: 0.15,
breakInto: "sawdust",
forceSaveColor: true,
tick: function(pixel) {
if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall
if (!isEmpty(pixel.x, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x][pixel.y-2];
if (cube2.element == "wood") {
if (isEmpty(pixel.x, pixel.y-1)) {
movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x+1, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x+1][pixel.y-1];
if (cube2.element == "wood") {
if (isEmpty(pixel.x+1, pixel.y)) {
movePixel(pixelMap[pixel.x+1][pixel.y-1], pixel.x+1, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x+1][pixel.y-1], pixelMap[pixel.x+1][pixel.y]);
}
}
}
if (!isEmpty(pixel.x+2, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x+2][pixel.y-1];
if (cube2.element == "wood") {
if (isEmpty(pixel.x+2, pixel.y)) {
movePixel(pixelMap[pixel.x+2][pixel.y-1], pixel.x+2, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x+2][pixel.y-1], pixelMap[pixel.x+2][pixel.y]);
}
}
}
if (!isEmpty(pixel.x-1, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x-1][pixel.y-1];
if (cube2.element == "wood") {
if (isEmpty(pixel.x-1, pixel.y)) {
movePixel(pixelMap[pixel.x-1][pixel.y-1], pixel.x-1, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x-1][pixel.y-1], pixelMap[pixel.x-1][pixel.y]);
}
}
}
if (!isEmpty(pixel.x-2, pixel.y-1, true)) {
var cube2 = pixelMap[pixel.x-2][pixel.y-1];
if (cube2.element == "wood") {
if (isEmpty(pixel.x-2, pixel.y)) {
movePixel(pixelMap[pixel.x-2][pixel.y-1], pixel.x-2, pixel.y);
}
else {
swapPixels(pixelMap[pixel.x-2][pixel.y-1], pixelMap[pixel.x-2][pixel.y]);
}
}
}
if (!isEmpty(pixel.x+1, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x+1][pixel.y-2];
if (cube2.element == "wood") {
if (isEmpty(pixel.x+1, pixel.y-1)) {
movePixel(pixelMap[pixel.x+1][pixel.y-2], pixel.x+1, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x+1][pixel.y-2], pixelMap[pixel.x+1][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x+2, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x+2][pixel.y-2];
if (cube2.element == "wood") {
if (isEmpty(pixel.x+2, pixel.y-1)) {
movePixel(pixelMap[pixel.x+2][pixel.y-2], pixel.x+2, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x+2][pixel.y-2], pixelMap[pixel.x+2][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x-1, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x-1][pixel.y-2];
if (cube2.element == "wood") {
if (isEmpty(pixel.x-1, pixel.y-1)) {
movePixel(pixelMap[pixel.x-1][pixel.y-2], pixel.x-1, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x-1][pixel.y-2], pixelMap[pixel.x-1][pixel.y-1]);
}
}
}
if (!isEmpty(pixel.x-2, pixel.y-2, true)) {
var cube2 = pixelMap[pixel.x-2][pixel.y-2];
if (cube2.element == "wood") {
if (isEmpty(pixel.x-2, pixel.y-1)) {
movePixel(pixelMap[pixel.x-2][pixel.y-2], pixel.x-2, pixel.y-1);
}
else {
swapPixels(pixelMap[pixel.x-2][pixel.y-2], pixelMap[pixel.x-2][pixel.y-1]);
}
}
}
}
}
}

147
mods/single_humans.js Normal file
View File

@ -0,0 +1,147 @@
elements.single_human = {
color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"],
category: "life",
tick: function(pixel) {
if (tryMove(pixel, pixel.x, pixel.y+1)) {} // Fall
doHeat(pixel);
doBurning(pixel);
doElectricity(pixel);
if (pixel.dead) {
// Turn into rotten_meat if pixelTicks-dead > 500
if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) {
changePixel(pixel,"rotten_meat");
}
return
}
if (pixel.panic > 0) {
pixel.panic -= 0.1;
if (pixel.panic < 0) { pixel.panic = 0; }
}
if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance
var movesToTry = [
[1*pixel.dir,0],
[1*pixel.dir,-1],
];
// While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break.
while (movesToTry.length > 0) {
var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0];
if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) {
var origx = pixel.x+move[0];
var origy = pixel.y+move[1];
if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) {
break;
}
}
else if (!isEmpty(pixel.x+move[0], pixel.y+move[1], true)) {
var hitPixel = pixelMap[pixel.x+move[0]][pixel.y+move[1]];
if (hitPixel.element === "single_human") {
// interact with other humans
hitPixel.panic = pixel.panic;
}
}
}
// 15% chance to change direction
if (Math.random() < 0.15) {
pixel.dir *= -1;
}
// homeostasis
if (pixel.temp > 37) { pixel.temp -= 1; }
else if (pixel.temp < 37) { pixel.temp += 1; }
}
},
hidden: true,
density: 1080,
state: "solid",
conduct: .05,
temp: 37,
tempHigh: 200,
stateHigh: "cooked_meat",
tempLow: -30,
stateLow: "frozen_meat",
burn: 10,
burnTime: 250,
burnInto: "cooked_meat",
breakInto: ["blood","meat","bone"],
forceSaveColor: true,
reactions: {
"cancer": { elem1:"cancer", chance:0.005 },
"radiation": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.4 },
"neutron": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.03 },
"fallout": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.03 },
"plague": { elem1:"plague", chance:0.05 },
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
"meat": { elem2:null, chance:0.1 },
"cooked_meat": { elem2:null, chance:0.1 },
"cured_meat": { elem2:null, chance:0.1 },
"sugar": { elem2:null, chance:0.1 },
"broth": { elem2:null, chance:0.2 },
"yolk": { elem2:null, chance:0.1 },
"hard_yolk": { elem2:null, chance:0.1 },
"dough": { elem2:null, chance:0.1 },
"batter": { elem2:null, chance:0.2 },
"butter": { elem2:null, chance:0.1 },
"melted_butter": { elem2:null, chance:0.2 },
"chocolate": { elem2:null, chance:0.2 },
"melted_chocolate": { elem2:null, chance:0.3 },
"grape": { elem2:null, chance:0.1 },
"tomato": { elem2:null, chance:0.1 },
"herb": { elem2:null, chance:0.1 },
"lettuce": { elem2:null, chance:0.1 },
"corn": { elem2:null, chance:0.1 },
"popcorn": { elem2:null, chance:0.15 },
"potato": { elem2:null, chance:0.1 },
"baked_potato": { elem2:null, chance:0.15 },
"bread": { elem2:null, chance:0.1 },
"toast": { elem2:null, chance:0.1 },
"gingerbread": { elem2:null, chance:0.1 },
"baked_batter": { elem2:null, chance:0.2 },
"wheat": { elem2:null, chance:0.1 },
"candy": { elem2:null, chance:0.1 },
"yogurt": { elem2:null, chance:0.2 },
"frozen_yogurt": { elem2:null, chance:0.1 },
"ice_cream": { elem2:null, chance:0.2 },
"beans": { elem2:[null,null,null,null,null,null,null,null,"stench"], chance:0.2 },
"tea": { elem2:null, chance:0.2 },
"coffee": { elem2:null, chance:0.2 },
"milk": { elem2:null, chance:0.2 },
"cream": { elem2:null, chance:0.2 },
"soda": { elem2:null, chance:0.2 },
"chocolate_milk": { elem2:null, chance:0.2 },
"fruit_milk": { elem2:null, chance:0.2 },
"pilk": { elem2:null, chance:0.2 },
"eggnog": { elem2:null, chance:0.2 },
"juice": { elem2:null, chance:0.2 },
"cheese": { elem2:null, chance:0.1 },
"melted_cheese": { elem2:null, chance:0.2 },
"alcohol": { elem2:null, chance:0.2 },
"antidote": { elem2:null, chance:0.2 },
"honey": { elem2:null, chance:0.2 },
"caramel": { elem2:null, chance:0.2 },
"molasses": { elem2:null, chance:0.05 },
"ketchup": { elem2:null, chance:0.1 },
"pumpkin_seed": { elem2:null, chance:0.1 },
"nut": { elem2:null, chance:0.1 },
"nut_meat": { elem2:null, chance:0.1 },
"nut_butter": { elem2:null, chance:0.1 },
"nut_milk": { elem2:null, chance:0.2 },
"jelly": { elem2:null, chance:0.2 },
"mayo": { elem2:null, chance:0.2 },
"mashed_potato": { elem2:null, chance:0.2 },
"sauce": { elem2:null, chance:0.2 },
"pickle": { elem2:null, chance:0.1 },
"sun": { elem1:"cooked_meat" },
"light": { stain1:"#825043" },
"bee": { stain1:"#cc564b", chance:0.2 },
"water": { elem2:"bubble", attr2:{"clone":"water"}, chance:0.001 },
"salt_water": { elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.001 },
"pool_water": { elem2:"bubble", attr2:{"clone":"pool_water"}, chance:0.001 },
},
properties: {
dead: false,
dir: 1,
panic: 0
},
}

View File

@ -47,6 +47,7 @@ elements.soul = {
}
else if (Math.random() < 0.01) {
pixel.glow = false;
delete pixel.glow;
}
if (Math.random() < 0.0002 && isEmpty(pixel.x,pixel.y+1)) {
createPixel("ectoplasm",pixel.x,pixel.y+1);

View File

@ -1,5 +1,5 @@
//texture_pack_by_jayd
document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/1236951076024877107.png")';
document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/image/1236951076024877107.png")';
gameDiv.style.border = "1px solid #ffffff00";
window.addEventListener("load",function(){
document.querySelectorAll(".categoryButton").forEach(e => {
@ -113,4 +113,4 @@ viewInfo[4] = { // Small Pixels
}
else{renderBall(ctx,pixel.color,pixel.x,pixel.y,0,1);}
}
}
}

61
mods/true_flashbang.js Normal file
View File

@ -0,0 +1,61 @@
// by nekonico
elements.true_flashbang = {
color: "#65665c",
onSelect: function() {
logMessage("Caution: If you have epilepsy or any similar vision issues, do not place this element for your own safety.");
},
behavior: [
"XX|EX:20>flashbang_flash%1|XX",
"XX|XX|XX",
"M2|M1 AND EX:20>flashbang_flash%1|M2",
],
category: "weapons",
state: "solid",
density: 1300,
tempHigh: 1455.5,
stateHigh: "molten_steel",
excludeRandom: true,
cooldown: defaultCooldown
}
elements.flashbang_flash = {
color: "#ffffff",
properties: {
delay: 100
},
tick: function(pixel) {
settings.bg = pixel.color;
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#${hex}${hex}${hex}` // credits to therazzler in the R74n discord for this code :3
var done = true;
if (pixel.delay) {
var delayR = pixel.delay % 1;
var delay = pixel.delay - delayR;
if (!(pixelTicks - pixel.start > (pixel.delay||1) && Math.random() < 1-delayR)) {
done = false;
}
}
if ((Math.random() < 0.75 && done) || pixel.alpha < 0.05) {
deletePixel(pixel.x, pixel.y)
settings.bg = "#000000";
}
if (pixel.delay) {
pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay)
}
doHeat(pixel);
},
category: "energy",
temp: 40,
tempLow: -270,
stateLow: ["liquid_light",null],
state: "gas",
category: "energy",
density: 0.00001,
ignoreAir: true,
insulate: true,
hidden: true,
noMix: true,
excludeRandom: true
}