This commit is contained in:
slweeb 2025-03-30 22:28:46 -04:00
commit 6a67fc7608
16 changed files with 4125 additions and 810 deletions

View File

@ -158,6 +158,7 @@
<tr><td>extra_element_info.js</td><td>Adds descriptions to various vanilla elements. Used to provide the functionality that desc now does before it was added to vanilla</td><td>Melecie</td></tr>
<tr><td>extrasaveslots.js</td><td>Adds extra saves slots !SAVE IMPORTANT SAVES AS FILES!</td><td>Jayd</td></tr>
<tr><td>find.js</td><td>Adds a find mode that highlights a chosen element as pulsating red and yellow <a href="https://github.com/R74nCom/sandboxels/commit/de0dc088ab4d928c77587b9d0e3a7d7663e3f94a">(read commit description)</a></td><td>Alice</td></tr>
<tr><td>human_friendly_design.js</td><td>Makes the drag and mix tools not kill humans.</td><td>Nekonico</td></tr>
<tr><td>insane_random_events.js</td><td>Massively buffs random events</td><td>Alice</td></tr>
<tr><td>jaydsfunctions.js</td><td>Adds extra tools</td><td>Jayd</td></tr>
<tr><td>moretools.js</td><td>Adds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)</td><td>Sightnado</td></tr>
@ -230,12 +231,14 @@
<tr><td>colored_lightbulbs.js</td><td>Adds a light bulb that can be painted.</td><td>guzzo86, ggod</td></tr>
<tr><td>combustion.js</td><td>Adds components necessary for combustion engines</td><td>uptzik</td></tr>
<tr><td>conveyance.js</td><td>Conveyors, operated with and without electricity</td><td>Melecie</td></tr>
<tr><td>drill.js</td><td>Adds drills made out of several materials</td><td>Suss</td></tr>
<tr><td>ExtraMachines.js</td><td>Adds sensors, energy resources, materials, and more</td><td>Mecoolnotcool</td></tr>
<tr><td>fine_tuned_cloner.js</td><td>Adds a cloner that can spawn at different rates and prevent unwated cloning</td><td>BatteRaquette58</td></tr>
<tr><td>flipflop.js</td><td>Toggleable switches; <a href="https://github.com/R74nCom/sandboxels/pull/134">Explanation</a></td><td>Flix</td></tr>
<tr><td>fueled_generators.js</td><td>Fuel powered generators.</td></tr>
<tr><td>gameOfLife.js</td><td>Conway's Game of Life on a screen</td><td>ggod</td></tr>
<tr><td>heatshield.js</td><td>adds heatshields, makes plasma cooler</td></td><td>Taterbob</td></tr>
<tr><td>human_friendly_design.js</td><td>Makes pipes and portals not kill humans, as well as making drag and mix not kill humans.</td><td>Nekonico</td></tr>
<tr><td>logicgates.js</td><td>Adds predictable electricity and logic gates</td><td>nousernamefound</td></tr>
<tr><td>note_block.js</td><td>Adds musical Note Blocks</td><td>Alice</td></tr>
<tr><td>nousersthings.js</td><td>Destroyable machines, pipe variants, filters, and more</td><td>nousernamefound</td></tr>
@ -287,6 +290,7 @@
<!----><tr><td class="modCat" colspan="3">Life & Nature</td></tr><!---->
<tr><td>apioforms_pre.js</td><td>An incomplete implementation of elements from the <a href="https://osmarks.net/apioform/">Apioform Game</a></td><td>Alice</td></tr>
<tr><td>baby.js</td><td>Adds various babies</td><td>Suss</td></tr>
<tr><td>bacteria_mod.js</td><td>Adds content from the <a href="https://www.curseforge.com/minecraft/mc-mods/bacterium">Bacterium Mod</a>: (Bacteria, Replacer B., Jammer Block)</td><td>Alice</td></tr>
<tr><td>bananas.js</td><td>Adds bananas and banana plants</td><td>Alice</td></tr>
<tr><td>biology.js</td><td>Adds various elements and functions that let you build your own organism.</td><td>Nekonico</td></tr>
@ -351,11 +355,12 @@
<tr><td>minecraft.js</td><td>Adds several things from Minecraft</td><td>StellarX20, nousernamefound</td></tr>
<tr><td>minesweeper.js</td><td>A subpar implementation of Minesweeper</td><td>Alice</td></tr>
<tr><td>musicalfruit.js</td><td>Humans get gas from eating Beans</td><td>mollthecoder</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite, oobleck, and red ice</td><td>Nekonico</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Random stuff like graphite, oobleck, and red ice, as well as many machines.</td><td>Nekonico</td></tr>
<tr><td>prideflags.js</td><td>Adds some pride flags to the game</td><td>Adora</td></tr>
<tr><td>random_elems.js</td><td>Curated randomly generated elements</td><td>Alice</td></tr>
<tr><td>random_liquids.js</td><td>Randomly generates liquids on game load</td><td>Alice</td></tr>
<tr><td>sbmixup.js</td><td>Adds silly elements from a <a href="https://R74n.com/mix/" target="_blank">Mix-Up!</a> game</td><td>stefanblox</td>
<tr><td>sports_beta.js</td><td>Adds several sports items</td><td>BluBun5193</td></tr>
<tr><td>star_wars.js</td><td>Adds various items from Star Wars by Disney</td><td>SeaPickle754</td>
<tr><td>sus.js</td><td>Adds an Among Us crewmate</td><td>Nv7</td></tr>
<tr><td>triggerable_random_powders.js</td><td>Adds powders with different abilities, such as heating and cooling</td><td>Alice</td></tr>

334
mods/MarkusFoodMod.js Normal file
View File

@ -0,0 +1,334 @@
elements.paprika = {
color: "#b22222",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
density: 0.4,
isFood: true,
};
elements.spicy_sauce = {
color: "#a52a2a",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
density: 1.0,
tempHigh: 150,
stateHigh: "smoke",
isFood: true,
};
elements.black_pepper = {
color: "#2f1b0c",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
density: 0.7,
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.chicken_meat = {
color: "#e8a07c",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 75,
stateHigh: "cooked_chicken",
tempLow: -5,
stateLow: "frozen_chicken",
isFood: true,
};
elements.cooked_chicken = {
color: "#c18251",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.frozen_chicken = {
color: "#d1e1ed",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 0,
stateHigh: "chicken_meat",
isFood: true,
};
elements.pork_meat = {
color: "#e89a8b",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 75,
stateHigh: "cooked_pork",
tempLow: -5,
stateLow: "frozen_pork",
isFood: true,
};
elements.cooked_pork = {
color: "#af7f5d",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.frozen_pork = {
color: "#c0d4e1",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 0,
stateHigh: "pork_meat",
isFood: true,
};
elements.breadcrumbs = {
color: "#e6c27a",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
density: 0.4,
tempHigh: 250,
stateHigh: "ash",
isFood: true,
};
elements.fried_chicken = {
color: ["#c0894f", "#a86a3a", "#d19b52"],
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 350,
stateHigh: "ash",
isFood: true,
};
elements.breaded_chicken = {
color: "#deb887",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 180,
stateHigh: "fried_chicken",
isFood: true,
};
elements.chicken_meat.reactions = {
breadcrumbs: { elem1: "breaded_chicken" }
};
const newFoods = {
cinnamon: "#8B5A2B",
garlic: "#FFF5E1",
onion: "#D4A76A",
tomato: "#FF6347",
lettuce: "#32CD32",
potato: "#D2B48C",
cooked_potato: "#E3C16F",
chili_powder: "#FF4500",
carrot: "#FFA500",
cucumber: "#4CAF50",
salt: "#FFFFFF",
sugar: "#FFF5EE",
honey: "#FFD700",
cheese: "#FFD700",
butter: "#FFDD44",
egg: "#FFF5C3",
cooked_egg: "#F4C542",
banana: "#FFE135",
apple: "#FF0000",
blueberry: "#4B0082",
strawberry: "#FF4D4D",
watermelon: "#FF6666",
grapes: "#6A0DAD",
avocado: "#568203",
basil: "#228B22",
oregano: "#6B8E23",
ginger: "#D2691E",
turmeric: "#E49B0F",
nutmeg: "#8B4513",
clove: "#5C4033",
cabbage: "#4CBB17",
cauliflower: "#FFFAF0",
mushroom: "#8B4513",
spinach: "#2E8B57",
radish: "#F5A9B8",
broccoli: "#228B22",
green_peas: "#7CFC00",
bell_pepper: "#32CD32",
sweet_potato: "#FF7F50",
coconut: "#FFF8DC",
lemon: "#FFFACD",
lime: "#98FB98",
kiwi: "#32CD32",
pear: "#9ACD32",
peach: "#FFDAB9",
plum: "#8E4585",
pomegranate: "#8B0000",
fig: "#8B4513",
date: "#A52A2A",
raisin: "#6B4226",
apricot: "#FBCEB1",
coconut_milk: "#FFF0F5",
yogurt: "#F5FFFA",
cream: "#FFF8DC",
peanut_butter: "#C8A2A8",
sesame_seeds: "#FFF5EE",
tahini: "#F4A460",
almond: "#D2691E",
walnut: "#8B4513",
pistachio: "#4B8A3D",
cashew: "#D2B48C",
hazelnut: "#8B5A2B",
macadamia: "#E1C699",
pine_nuts: "#FFDDC1",
sunflower_seeds: "#FFF8DC",
chia_seeds: "#D2691E",
flaxseeds: "#8B4513",
};
for (const [name, color] of Object.entries(newFoods)) {
elements[name] = {
color,
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
isFood: true,
};
}
const newLiquids = {
water: "#00BFFF",
milk: "#FFFFFF",
orange_juice: "#FFA500",
apple_juice: "#FF4500",
grape_juice: "#6A0DAD",
lemon_juice: "#FFFACD",
coconut_water: "#BFD8B8",
tomato_juice: "#FF6347",
coffee: "#6F4F1F",
tea: "#D3D3D3",
cola: "#6B3F2F",
wine: "#800000",
beer: "#F4A300",
whiskey: "#B86B38",
rum: "#C39A6E",
vodka: "#F0F8FF",
fruit_punch: "#FF69B4",
smoothie: "#FFB6C1",
soy_milk: "#F5F5DC",
coconut_milk: "#FFF0F5",
};
for (const [name, color] of Object.entries(newLiquids)) {
elements[name] = {
color,
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
}
elements.carbonated_water = {
color: "#B0E0E6",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
density: 1.0,
};
elements.fanta_syrup = {
color: "#FF7F00",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.cola_syrup = {
color: "#301a10",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.sprite_syrup = {
color: "#A8F0A5",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.soda = {
color: "#FFD700",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.fanta = {
color: "#FF7F00",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.cola = {
color: "#261710",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.sprite = {
color: "#A8F0A5",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.soda.reactions = {
fanta_syrup: { elem1: "fanta" },
cola_syrup: { elem1: "cola" },
sprite_syrup: { elem1: "sprite" },
};
// Adding the recipes for sodas
elements.fanta_syrup.reactions = {
carbonated_water: { elem1: "fanta" },
};
elements.cola_syrup.reactions = {
carbonated_water: { elem1: "cola" },
};
elements.sprite_syrup.reactions = {
carbonated_water: { elem1: "sprite" },
};

View File

@ -3,7 +3,6 @@
runAfterLoad(function() {
console.log("Thanks for using aChefsDream2.js! -sqec")
console.log("You may find the prequel at aChefsDream.js")
})
var mods_to_include = ["mods/aChefsDream.js"]
@ -248,6 +247,8 @@ elements.saffron = {
stateHigh: ["ash", "smoke"],
}
// sugarcane
elements.sugarcane_plant = {
color: ["#fbc852","#dfad54"],
behavior: [
@ -324,4 +325,69 @@ elements.tea_leaves = {
state: "solid",
density: 1400,
isFood: true,
}
}
elements.cinnamon = {
color: "#986544",
reactions: {
"stench": { elem2:null, chance:0.25 },
"steam": { elem2:"fragrance", chance:0.1 },
"flea": { elem2:null, chance:0.01 },
"termite": { elem2:null, chance:0.01 },
"fly": { elem2:null, chance:0.01 },
"ant": { elem2:null, chance:0.01 },
"stink_bug": { elem2:null, chance:0.01 },
},
behavior: behaviors.STURDYPOWDER,
tempHigh: 300,
stateHigh: ["fire","smoke","smoke","smoke","ash"],
burn:10,
burnTime:300,
burnInto: ["fire","smoke","smoke","smoke","fragrance"],
category:"food",
state: "solid",
density: 1400,
isFood: true,
breakInto: "cinnamon_powder"
}
elements.cinnamon_powder = {
color: "#D2691E",
reactions: {
"stench": { elem2:null, chance:0.25 },
"steam": { elem2:"fragrance", chance:0.1 },
"flea": { elem2:null, chance:0.01 },
"termite": { elem2:null, chance:0.01 },
"fly": { elem2:null, chance:0.01 },
"ant": { elem2:null, chance:0.01 },
"stink_bug": { elem2:null, chance:0.01 },
},
behavior: behaviors.POWDER,
tempHigh: 300,
stateHigh: ["fire","smoke","smoke","smoke","ash"],
burn:10,
burnTime:300,
burnInto: ["fire","smoke","smoke","smoke","smoke","smoke","smoke","fragrance"],
category:"food",
state: "solid",
density: 1400,
isFood: true,
}
elements.cola_syrup = {
color: "#4f0e0e",
behavior: behaviors.LIQUID,
tempHigh: 170,
stateHigh: ["sugar","smoke","smoke"],
tempLow: -15,
category:"liquids",
state: "liquid",
viscosity: 15,
hidden: true,
density: 1400,
reactions: {
"seltzer": { elem1: ["cola_syrup", "cola_syrup", "foam"], elem2:"soda"},
"soda": { elem1: "foam", chance:0.001},
},
}
if (!elements.sugar_water.reactions) elements.sugar_water.reactions = {};
elements.sugar_water.reactions.lemon_juice = { elem1: "sugar_water", elem2: null, color1: "#fff7ba" }
if (!elements.sugar_water.reactions) elements.sugar_water.reactions = {};
elements.sugar_water.reactions.cinnamon_powder = { elem1: "cola_syrup", elem2: null }

View File

@ -1,14 +1,8 @@
//Hello, this is are a science mod, we're made several things that related to science, examples like...electron, particle accelerator, and of course, carbon monoxide! :D
//We made some things not scientific, so this mod is not too boring. ;)
//we're normal people, who is not as smart as a real scientist. so if you have suggestion, feedback, or criticism, please let us know, so we can make this mod being more accurate. ><
// discord account |
// |
// |
// v
// creator,leader,supervisor,coder,uploader = @carbon_monoxides6
// co-creator,co-coder,assistant,debugger = @salmonfishy (has exited from this mod project)
//Main version
//reminder for creator: human code is on index.html line 3242.
elements.carbon_monoxide = {
color: "#b5b5b5",
color: ["#b5b5b5", "#404040", "#2b2b2b",],
behavior: behaviors.GAS,
behaviorOn: [
"XX|XX|XX",
@ -24,16 +18,35 @@ elements.carbon_monoxide = {
tempLow: -192,
stateLow: "liquid_carbon_monoxide",
burntime: 5,
fireColor: ["#ff8833", "#ffad33", "#ffbe26", "#26baff", "#26e9ff", ],
burnInto: "carbon_dioxide", chance: 0.3,
darkText: true,
fireColor: "#ebba34",
reactions: {
"head": { elem2:"rotten_meat", chance:0.5 },
"body": { elem2:"rotten_meat", chance:0.5 },
"human": { elem2:"rotten_meat", chance:0.5 },
}
"head": { elem2: "rotten_meat", chance: 0.5, },
"body": { elem2:"rotten_meat", chance:0.5 },
"human": { elem2:"rotten_meat", chance:0.5 },
"worm": { elem2: "rotten_meat", chance:0.5 },
"bee": { elem2: "dead_bug", chance: 0.5 },
"ant": { elem2: "dead_bug", chance: 0.5 },
"flea": { elem2: "dead_bug", chance: 0.5 },
"spider": { elem2: "dead_bug", chance: 0.5 },
"fly": { elem2: "dead_bug", chance: 0.5 },
"stink_bug": { elem2: "dead_bug", chance: 0.5 },
"bird": { elem2: "rotten_meat", chance: 0.5 },
"frog": { elem2: "slime", chance: 0.5 },
"rat": { elem2: ["rotten_meat", "plague"], chance: 0.5 },
"fish": { elem2: "rotten_meat", chance: 0.5 },
"tadpole" : { elem2: "rotten_meat", chance: 0.5 },
"slug": { elem2: "slime", chance: 0.5 },
"snail": { elem2: "slime", chance: 0.5 },
"grass": { elem2: "dead_plant", chance: 0.5 },
"plant": { elem2: "dead_plant", chance: 0.5 },
"cactus": { elem2: "dead_plant", chance: 0.5 },
"petal": { elem2: "dead_plant", chance: 0.5 },
}
};
elements.liquid_carbon_monoxide = {
color: "#b5b5b5",
color: ["#b5b5b5", "#404040", "#2b2b2b",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
@ -47,7 +60,7 @@ elements.liquid_carbon_monoxide = {
stateHigh: "carbon_monoxide",
};
elements.ice_carbon_monoxide = {
color: "#b5b5b5",
color: ["#b5b5b5", "#404040", "#2b2b2b",],
behavior: behaviors.WALL,
category: "solids",
state: "solid",
@ -59,8 +72,7 @@ elements.ice_carbon_monoxide = {
};
elements.carbon_monoxide_detector = {
behavior: behaviors.WALL,
desc: "give red light and electric when found Carbon Monoxide touch",
color: "#ffffff",
color: [ "#ffffff", "#e0e0e0", "#cccbca", ],
reactions: {
"carbon_monoxide": {"charge1":1},
},
@ -75,144 +87,131 @@ elements.carbon_monoxide_detector = {
darkText: true,
hardness: 1,
};
elements.electrons = {
color: "#b80606",
behavior: [
"XX|SH|XX", // shocks (adds charge)
"SH|DL%0.25|SH",
"XX|SH|XX",
],
tick: behaviors.BOUNCY,
temp: 20,
category: "energy",
state: "gas",
density: 0.000003,
ignoreAir: true,
};
elements.gelatin = {
behavior: behaviors.SOLID,
category: "food",
state: "solid",
color: "#faf8ca",
state: "powder",
density: 1.2,
color: ["#ffe7b8","#fce2ac","#fcf2dc"],
breakInto: "gelatin_powder",
ignoreAir: true,
isFood: true,
reactions: {
"water": { elem2: "jelly", },
"pool_water": { elem2: "jelly", },
"salt_water": { elem2: "jelly", }
}
};
elements.gelatin_powder = {
behavior: behaviors.POWDER,
category: "food",
state: "powder",
density: 1.2,
state: ["#ffe7b8","#fce2ac","#fcf2dc"],
color: "#edeb9f",
hidden: true,
ignoreAir: true,
isFood: true,
};
elements.blueberries = {
behavior: behaviors.POWDER,
category: "food",
state: "solid",
color: ["#464196","#2e2b64"],
breakInto: "blueberries_juice",
ignoreAir: true,
isFood: true,
reactions: {
"sugar": { elem1: "blueberries_jam" },
},
};
elements.blueberries_juice = {
behavior: behaviors.LIQUID,
category: "food",
state: "liquid",
color: "#1f1c42",
hidden: true,
tempHigh: 170,
stateHigh: ["steam","sugar"],
reactions: {
ignoreAir: true,
isFood: true,
"gelatin": { elem1: "blueberries_jelly", elem2: null },
"gelatin_powder": { elem1: "blueberries_jelly", elem2: null },
},
};
elements.blueberries_jam = {
behavior: behaviors.LIQUID,
category: "food",
viscosity: 5000,
state: "liquid",
tempHigh: 200,
stateHigh: ["smoke","sugar"],
color: "#080629",
hidden: true,
ignoreAir: true,
isFood: true,
};
elements.blueberries_jelly = {
behavior: behaviors.LIQUID,
category: "food",
viscosity: 200000,
state: "liquid",
color: "#59559e",
hidden: true,
tempHigh: 200,
stateHigh: ["smoke","sugar"],
tempLow: -5,
stateLow: ["sugar_ice","sugar_ice","juice_ice"],
ignoreAir: true,
isFood: true,
};
reactions: {
"water": { elem2: "jelly", },
"pool_water": { elem2: "jelly", },
"salt_water": { elem2: "jelly", }
}
};
elements.fallout_drum = {
behavior: behaviors.WALL,
behavior: [
["XX","CR:radiation%25","XX"],
["CR:radiation%25","XX","CR:radiation%25"],
["XX","CR:radiation%25","XX"]
],
category: "radiated",
state: "solid",
density: 9000,
color: "#e3cc34",
conduct: 1,
tempHigh: 2500,
stateHigh: ["aluminum","radiated_water","radiated_water","fallout"],
breakInto: ["fallout","fallout"],
reactions: {
"water": { elem1:"fallout_drum", elem2:"radiated_water" },
"water": { elem1:"fallout_drum", elem2:"radiated_water" },
"dna": { elem2: "cancer", },
"cell": { elem2: "cancer", },
}
};
elements.radiated_water = {
behavior: behaviors.LIQUID,
behavior: [
"XX|CR:radiation%2.5|XX",
"M2 AND CR:radiation%2.5|CH:radiation%0.2|M2 AND CR:radiation%2.5",
"M1|M1|M1",
],
category: "radiated",
state:"liquid",
density :1300,
color: ["#23d959","#29d65d"],
hidden: true,
tempHigh: 140,
stateHigh: "polluted_air",
conduct: 1,
stateHigh: "radiated_air",
tempLow: -6,
stateLow: "rad_ice",
reactions: {
"human": { elem2:"rotten_meat" },
"body": { elem2:"rotten_meat" },
"head": { elem2:"ash" },
"bird": { elem2:"rotten_meat"},
"cell": { elem2:"cancer"},
"worm": { elem2:"rotten_meat"},
"head": { elem2: ["rotten_meat","ash","plague"], },
"body": { elem2:"rotten_meat", },
"human": { elem2:"rotten_meat", },
"worm": { elem2: "rotten_meat", },
"bee": { elem2: "dead_bug", },
"ant": { elem2: "dead_bug", },
"flea": { elem2: "dead_bug", },
"spider": { elem2: "dead_bug", },
"fly": { elem2: "dead_bug", },
"stink_bug": { elem2: "dead_bug", },
"bird": { elem2: "rotten_meat", },
"frog": { elem2: "slime", },
"rat": { elem2: ["rotten_meat", "plague"], },
"fish": { elem2: "rotten_meat", },
"tadpole" : { elem2: "rotten_meat", },
"slug": { elem2: "slime", },
"snail": { elem2: "slime", },
"grass": { elem2: "dead_plant", },
"plant": { elem2: "dead_plant", },
"cactus": { elem2: "dead_plant", },
"petal": { elem2: "dead_plant", },
"cell": { elem2: "cancer", },
"dna": { elem2: null, },
}
};
elements.polluted_air = {
elements.radiated_air = {
behavior: behaviors.DGAS,
category: "radiated",
state:"gas",
density :10,
color: ["#60f53b","#65ba50"],
reactions: {
"body": { elem2:"rotten_meat" },
"head": { elem2:"rotten_meat" },
"human": { elem2:"rotten_meat" },
"bird": { elem2:"rotten_meat" },
"cell": { elem2:"cancer" },
"water": { elem1: null, elem2: "radiated_water" },
"worm": { elem2: ["ash","cancer"] },
"flea": { elem2: "ash" },
"seed": {elem2: "dead_plant" },
"plant": {elem1: null, chance:0.5, elem2: "dead_plant", chance:0.5 },
"head": { elem2: ["rotten_meat","ash","plague"], },
"body": { elem2:"rotten_meat", },
"human": { elem2:"rotten_meat", },
"worm": { elem2: "rotten_meat", },
"bee": { elem2: "dead_bug", },
"ant": { elem2: "dead_bug", },
"flea": { elem2: "dead_bug", },
"spider": { elem2: "dead_bug", },
"fly": { elem2: "dead_bug", },
"stink_bug": { elem2: "dead_bug", },
"bird": { elem2: "rotten_meat", },
"frog": { elem2: "slime", },
"rat": { elem2: ["rotten_meat", "plague"], },
"fish": { elem2: "rotten_meat", },
"tadpole" : { elem2: "rotten_meat", },
"slug": { elem2: "slime", },
"snail": { elem2: "slime", },
"grass": { elem2: "dead_plant", },
"plant": { elem2: "dead_plant", },
"cactus": { elem2: "dead_plant", },
"petal": { elem2: "dead_plant", },
"cell": { elem2: "cancer", },
"dna": { elem2: null, },
},
};
@ -226,7 +225,7 @@ color: "#808080",
reactions: {
"fallout": {"charge1":1},
"radiated_water": {"charge1":1},
"polluted_air": {"charge1":1},
"radiated_air": {"charge1":1},
"radiation": {"charge1":1},
"rad_snow": {"charge1":1},
"rad_rock": {"charge1":1},
@ -234,10 +233,15 @@ reactions: {
};
elements.radiated_metal = {
behavior: behaviors.WALL,
behavior: [
["XX","CR:radiation%25","XX"],
["CR:radiation%25","XX","CR:radiation%25"],
["XX","CR:radiation%25","XX"]
],
category: "radiated",
state:"solid",
density :2045,
conduct: 1,
color: ["#5e705a","#83ab7b","#474747"],
tempHigh: 1440,
stateHigh: ["molten_nickel","molten_iron","molten_tin","fallout"],
@ -248,7 +252,11 @@ reactions: {
};
elements.rad_ice = {
behavior: behaviors.WALL,
behavior: [
["XX","CR:radiation%25","XX"],
["CR:radiation%25","XX","CR:radiation%25"],
["XX","CR:radiation%25","XX"]
],
category: "radiated",
state:"solid",
density: 1905,
@ -264,7 +272,10 @@ reactions: {
}
elements.rad_snow = {
behavior: behaviors.POWDER,
behavior: [
"XX|CR:radiation%2|XX",
"CR:radiation%2|XX|CR:radiation%2",
"M2|M1|M2", ],
category: "radiated",
state:"powder",
density: 1500,
@ -275,7 +286,10 @@ stateHigh: "radiated_water",
};
elements.rad_rock = {
behavior: behaviors.POWDER,
behavior: [
"XX|CR:radiation%2|XX",
"CR:radiation%2|XX|CR:radiation%2",
"M2|M1|M2", ],
category: "land",
state: "powder",
density: 2790,
@ -312,267 +326,14 @@ tempHigh: 1250,
stateHigh: ["fallout","molten_plastic","steam"],
reactions: {
"radiated_water": {elem2:"water" },
"polluted_air": {elem2: "oxygen"},
"radiated_air": {elem2: "oxygen"},
"rad_snow": {elem2: "snow"},
"rad_rock": {elem2: "rock"},
"radiated_metal": {elem2: ["nickel","tin","iron"], },
"fallout": {elem2: "rock", },
"radiation": { elem2: null, },
}
};
elements.rad_meat = {
behavior: behaviors.STURDYPOWDER,
category: "food",
state: "solid",
density: 1500,
color: ["#e8fc03","#f0b446","#92f046"],
tempHigh: 120,
stateHigh: ["rotten_meat","fallout"],
tempLow:-12,
stateLow: ["frozen_meat","radiation"],
reactions: {
"water": {elem2: "radiated_water", chance:0.4},
"salt_water": { elem2: "radiated_water" },
}
};
elements.lemon = {
behavior: behaviors.POWDER,
category: "food",
state: "powder",
density: 800,
color: ["#f9f934", "#f1ee20",],
tempHigh: 90,
stateHigh: "hot_lemon",
tempLow: -2,
stateLow: "wrinkled_lemon",
burn: 120,
burntime: 600,
burnInto: "ash",
breakInto: [ "lemon_water", "lemon_zest", ],
reactions: {
"water": { elem2: "lemon_water", chance:0.2},
"salt_water": { elem2: [ "lemon_water", "water",] },
"dirty_water": { elem1: "rotten_lemon", },
"soda": { elem2: "lemon_soda", },
"head": { elem1: "saliva", chance:0.75},
"milk": { elem2: "lemon_milk", },
"tea": { elem2: "lemon_tea", },
"poison": { elem2: "rotten_lemon", },
}
};
elements.hot_lemon = {
behavior: behaviors.POWDER,
state: "powder",
category: "food",
hidden: true,
density: 820,
color: ["#8a6d1e","#70661a",],
hidden: true,
temp: 90,
tempHigh: 200,
stateHigh: "fire",
tempLow: 30,
stateLow: "wrinkled_lemon",
burn: 120,
burntime: 600,
burnInto: "ash",
reactions: {
"water": { elem2: "lemon_water", },
}
};
elements.wrinkled_lemon = {
behavior: behaviors.POWDER,
color: ["#999543","#a6a03a",],
state: "powder",
category: "food",
tempHigh: 90,
stateHigh: "hot_lemon",
hidden: true,
burn: 120,
burntime: 600,
burnInto: "ash",
reactions: {
"water": { elem2: "lemon_water", chance: 0.2,
}
}
};
elements.coolant = {
color: "#0eebeb",
behavior: [
"XX|CO:4|XX",
"CO:4|HT:1|CO:4",
"XX|CO:4|XX",
],
category: "liquids",
state: "liquid",
insulate: true,
density: 1000,
darkText: false,
tempHigh: 500,
hidden: true,
stateHigh: "steam",
};
elements.arkycite = {
color: "#46ab63",
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 997,
darkText: false,
tempHigh: 400,
hidden: true,
burn: 40,
stateHigh: "fire",
burntime: 500,
};
elements.lemon_water = {
color: ["#faec52","#faee69",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 900,
tempHigh: 100,
stateHigh: ["steam","fragrance",],
hidden: true,
tempLow: -10,
stateLow: "lemon_ice",
reactions: {
"balloon": { elem2: "helium", chance: 0.5, },
"head": { elem1: "saliva", chance: 0.2, },
}
};
elements.lemon_zest = {
color: ["#ded254","#ccc03d",],
behavior: behaviors.POWDER,
category: "trashes",
state: "powder",
density: 1000,
hidden: true,
tempHigh: 350,
stateHigh: "fire",
breakInto: "lemon_water",
burn: 60,
burntime: 200,
burnInto: "smoke"
};
elements.saliva = {
color: ["#a6f5f0","#b6f0ec",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1280,
tempHigh: 105,
stateHigh: ["steam","fragrance"],
tempLow: -5,
stateHigh: "saliva_ice",
reactions: {
"water": { elem1: null, chance: 0.5, elem2: "dirty_water", chance: 0.5,
}
}
};
elements.lemon_milk = {
color: ["#f5f2c4","#f7f4b2",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1002,
tempHigh: 500,
stateHigh: "smoke",
tempLow: -2,
stateLow: "frozen_yogurt",
stateLowColor: ["#f5f3cb","#f7f5bc"],
reactions: {
"cell": { elem1: "yogurt", },
}
};
elements.lemon_soda = {
color: ["#f5c842","#edcc68",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1240,
tempHigh: 140,
stateHigh: ["carbon_dioxide", "smoke",],
reactions: {
"poison": { elem1: null, }
}
};
elements.saliva_ice = {
color: ["#97fcfb","#bcf7f6",],
behavior: behaviors.SOLID,
category: "states",
state: "solid",
density: 1300,
tempHigh: 5,
stateHigh: "saliva",
};
elements.lemon_tea = {
color: ["#dec85b","#edd351",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1580,
tempHigh: 280,
stateHigh: ["fragrance","smoke","smoke",],
tempLow: -2,
stateLowColor: ["#e8cf8b","#f0dca5",],
stateLow: "tea_ice",
reactions: {
"sugar": { elem2: null, },
}
};
elements.rotten_lemon = {
color: ["#e3f283","#cdcf6b"],
behavior: behaviors.POWDER,
category: "food",
state: "powder",
density: 1890,
tempHigh: 200,
stateHigh: ["stench","ash",],
reactions: {
"water": { elem2: "dirty_water" },
}
};
elements.cow = {
color: ["#d9d9d9","#616161",],
behavior: [
"XX|XX|XX",
"XX|FX%5.0|M2%5.0 AND BO",
"XX|M1|XX",],
category: "life",
state: "powder",
density: 2800,
tempHigh: 250,
stateHigh: "cooked_meat",
tempLow: -10,
stateLow: "frozen_meat",
reactions: {
"water": { elem2: null, chance: 0.2,},
"milk": { elem2: null, chance: 0.1, },
"alcohol": { elem2: null, chance: 0.21, },
"poison": { elem1: "rotten_meat", elem2: null, },
"grass": { elem2: null, },
"plague": { elem1: "rotten_meat", chance: 0.3, },
"worm": { elem2: null, },
"flea": { elem2: null, },
}
};
elements.hazmat_head = {
color: ["#404040","#1a1a1a","#737373"],
category: "life",
@ -581,7 +342,7 @@ elements.hazmat_head = {
state: "solid",
conduct: .05,
temp: 39,
tempHigh: 6500,
tempHigh: 3500,
stateHigh: ["ash","iron",],
tempLow: -180,
stateLow: "frozen_meat",
@ -701,7 +462,7 @@ elements.hazmat_body = {
state: "solid",
conduct: .25,
temp: 39,
tempHigh: 6500,
tempHigh: 3500,
stateHigh: ["metal_scrap","ash"],
tempLow: -180,
stateLow: "frozen_meat",
@ -721,7 +482,6 @@ elements.hazmat_body = {
"grass_seed": { elem2:null, chance:0.05 },
"gold_coin": { elem2:null, chance:0.05 },
"diamond": { elem2:null, chance:0.05 },
"sun": { elem1:"molten_tin", },
},
properties: {
dead: false,
@ -1092,9 +852,9 @@ elements.particle_accelerator_right = {
elements.accelerated_matter_left = {
color: ["#c0ecf0","#a8f8ff",],
behavior: [
"M2|XX|XX",
"M1 AND XX|XX|XX",
"M2|XX|XX",
"M2|EX:10|XX",
"M1 AND EX:10|XX|EX:10",
"M2|EX:10|XX",
],
hidden: true,
state: "gas",
@ -1110,9 +870,9 @@ elements.accelerated_matter_left = {
elements.accelerated_matter_right = {
color: ["#c0ecf0","#a8f8ff",],
behavior: [
"XX|XX|M2",
"XX|XX|M1 AND XX",
"XX|XX|M2",
"XX|EX:10|M2",
"EX:10|XX|M1 AND EX:10",
"XX|EX:10|M2",
],
hidden: true,
state: "gas",
@ -1126,3 +886,79 @@ elements.accelerated_matter_right = {
}
};
elements.phosgene = {
color: ["#dbdbdb","#f2f2f2","#c2c2c2", ],
behavior: behaviors.GAS,
state: "gas",
category: "gases",
density: 4.25,
tempLow: 7,
stateLow: "liquid_phosgene",
tempHigh: 300,
stateHigh: ["carbon_monoxide","chlorine",],
reactions: {
"head": { elem2: "rotten_meat", chance: 0.5, },
"body": { elem2:"rotten_meat", chance:0.5 },
"human": { elem2:"rotten_meat", chance:0.5 },
"worm": { elem2: "rotten_meat", chance:0.5 },
"bee": { elem2: "dead_bug", chance: 0.5 },
"ant": { elem2: "dead_bug", chance: 0.5 },
"flea": { elem2: "dead_bug", chance: 0.5 },
"spider": { elem2: "dead_bug", chance: 0.5 },
"fly": { elem2: "dead_bug", chance: 0.5 },
"stink_bug": { elem2: "dead_bug", chance: 0.5 },
"bird": { elem2: "rotten_meat", chance: 0.5 },
"frog": { elem2: "slime", chance: 0.5 },
"rat": { elem2: ["rotten_meat", "plague"], chance: 0.5 },
"fish": { elem2: "rotten_meat", chance: 0.5 },
"tadpole" : { elem2: "rotten_meat", chance: 0.5 },
"slug": { elem2: "slime", chance: 0.5 },
"snail": { elem2: "slime", chance: 0.5 },
"grass": { elem2: "dead_plant", chance: 0.5 },
"plant": { elem2: "dead_plant", chance: 0.5 },
"cactus": { elem2: "dead_plant", chance: 0.5 },
"petal": { elem2: "dead_plant", chance: 0.5 },
"water": { elem2: ["acid", "carbon_dioxide",] },
"salt_water": { elem2: ["acid", "carbon_dioxide",] },
}
}
elements.liquid_phosgene = {
color: ["#dbdbdb","#f2f2f2","#c2c2c2", ],
behavior: behaviors.LIQUID,
state: "liquid",
category: "states",
density: 7.50,
tempLow: -118,
temp: -10,
stateLow: "solid_phosgene",
tempHigh: 8,
stateHigh: "phosgene",
}
elements.solid_phosgene = {
color: ["#dbdbdb","#f2f2f2","#c2c2c2", ],
behavior: behaviors.WALL,
state: "solid",
category: "states",
density: 12.45,
temp: -150,
tempHigh: -117,
stateHigh: "liquid_phosgene",
}
elements.chlorophyll = {
color: ["#208556","#2fa16b"],
behavior: behaviors.POWDER,
state: "powder",
category: "powders",
density: 1.1,
tempHigh: 250,
stateHigh: "carbon_dioxide",
burn: 10,
burnTime: 500,
burnInto: "carbon_dioxide",
tempLow: -114,
stateLow: "dead_plant",
reactions: {
"light": { elem1: null, chance: 0.2, elem2: null, chance: 0.2, },
"acid": { elem1: ["magnesium"], }
}
}

65
mods/baby.js Normal file
View File

@ -0,0 +1,65 @@
// mod by suss
// this took me a tiny bit to make
// also, why are you even reading the comments unless youre viewing the pr or smth
// guh
elements.baby = {
color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"],
behavior: [
"XX|XX|XX",
"M2%3|XX|M2%3",
"XX|M1|XX",
],
category: "life",
breakInto: ["meat", "meat", "blood"],
state: "solid",
tempHigh: 120,
tempLow: -20,
stateHigh: "ash_baby",
stateLow: "frozen_meat",
density: 1050,
reactions: {
"infection": {func: function(pixel1, pixel2){pixel2.element = "coughing_baby"}},
"cancer": {func: function(pixel1, pixel2){pixel2.element = "coughing_baby"}},
"plague": {func: function(pixel1, pixel2){pixel2.element = "coughing_baby"}},
"magical_growth_stuff_that_sometimes_also_changes_the_humans_race": { "elem1":null, "elem2":"human" },
"milk": { "elem2":null }
}
};
// hydrogen bomb versus coughing baby
elements.coughing_baby = {
color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"],
behavior: [
"XX|XX|XX",
"M2%3|EX:10>infection,plague,cancer%0.1|M2%3",
"XX|M1|XX",
],
category: "life",
breakInto: ["meat", "blood", "blood", "meat", "meat", "infection", "plague", "cancer"],
state: "solid",
density: 1050,
hidden: true,
reactions: {
"antibody": {func: function(pixel1, pixel2){pixel2.element = "baby"}},
"magical_growth_stuff_that_sometimes_also_changes_the_humans_race": { "elem1":null, "elem2":"explosion" }
}
};
elements.magical_growth_stuff_that_sometimes_also_changes_the_humans_race = {
color: ["#b5ffe1","#93e5ab","#65b981","d8f3dc"],
behavior: behaviors.POWDER,
category: "life",
density: 6969,
state: "solid",
};
// peak
elements.ash_baby = {
color: "#333333",
behavior: behaviors.POWDER,
state: "solid",
tempHigh: 121,
stateHigh: "ash",
category: "life",
density: 1050,
hidden: true,
};

View File

@ -3729,7 +3729,7 @@ elements.brain = {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3757,7 +3757,7 @@ elements.brain = {
hitPixel.darkcharge = true
}
}
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3768,7 +3768,7 @@ elements.brain = {
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3779,7 +3779,7 @@ elements.brain = {
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3920,7 +3920,7 @@ elements.hypothalamus = {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3931,7 +3931,7 @@ elements.hypothalamus = {
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3942,7 +3942,7 @@ elements.hypothalamus = {
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}
@ -3953,7 +3953,7 @@ elements.hypothalamus = {
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed - pixel.alcoDepri) / 2050))) {
if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
pixel.chargeCD = 16
hitPixel.charge = 0.5
}

View File

@ -10,17 +10,14 @@ clouds_settingsTab.registerSettings("Real time", cloud_count_setting);
settingsManager.registerTab(clouds_settingsTab);
// Biased random
function randomGaussian(A, B, biasFactor=2) {
let u = Math.random();
let v = Math.random();
let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
function biasedRandom(A, B, samples) {
var sum = 0;
for (var i = 0;i < samples;i++) {
sum += Math.random();
}
var average = sum / samples;
let mean = (A + B) / 2;
let stdDev = (B - A) / biasFactor;
let result = mean + num * stdDev;
return Math.min(Math.max(result, A), B);
return A + average * (B - A);
}
function randomBetween(A, B) {
@ -32,7 +29,7 @@ function initClouds(amount) {
var w = randomBetween(6, 17);
var h = randomBetween(4, 10);
var x = randomBetween(0, width - w);
var y = randomGaussian(0, height * 0.75, 4);
var y = biasedRandom(0, height * 0.75, 4);
// Higher clouds move faster
var speedBoost = 1 - (y / (height * 0.75));

View File

@ -125,7 +125,7 @@ elements.microplastic_water = {
"mudstone": { elem2: ["mud","mud","clay"], chance: 0.00035 },
"glass_shard": { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0005 },
"rad_shard": { elem2: "glass_pebble", color2:"#AECB83", chance: 0.00025 },
"glass": { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.00005 },
"glass": { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0000025 },
"rad_glass": { elem2: "glass_pebble", color2:"#AECB83", chance: 0.000025 },
"rust": { elem1:"dirty_water", elem2: "rust_dust", chance: 0.0025 },
"plastic": { elem2: ["microplastic",null,null], chance: 0.00005 },
@ -186,6 +186,7 @@ elements.silver_debris = {
color: "#cacaca",
behavior: behaviors.SUPPORT,
tempHigh: 961.8,
stateHigh: "molten_silver",
category: "powders",
density: 9297,
conduct: 0.99,
@ -216,6 +217,7 @@ elements.iron_debris = {
},
breakInto: "iron_dust",
tempHigh: 1538,
stateHigh: "molten_iron",
category: "powders",
density: 7660,
conduct: 0.47,
@ -248,6 +250,7 @@ elements.steel_debris = {
},
breakInto: "iron_debris",
tempHigh: 1455.5,
stateHigh: "molten_steel",
category: "powders",
density: 7750,
conduct: 0.42,
@ -1060,7 +1063,7 @@ elements.water.reactions.glass_shard = { elem2: "glass_pebble", color2:"#7BAECB"
elements.water.reactions.rad_shard = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.00025 }
elements.water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.00005 }
elements.water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0000025 }
elements.water.reactions.rad_glass = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.000025 }
@ -1068,7 +1071,7 @@ elements.water.reactions.rust = { elem1:"dirty_water", elem2: "rust_dust", chanc
elements.water.reactions.rust_dust = { elem1:"dirty_water", chance: 0.0025 }
elements.water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.00005 }
elements.water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.000005 }
elements.salt_water.reactions.mudstone = { elem2: ["mud","mud","clay"], chance: 0.00035 }
@ -1076,7 +1079,7 @@ elements.salt_water.reactions.glass_shard = { elem2: "glass_pebble", color2:"#7B
elements.salt_water.reactions.rad_shard = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.00025 }
elements.salt_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.00005 }
elements.salt_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0000025 }
elements.salt_water.reactions.rad_glass = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.000025 }
@ -1084,7 +1087,7 @@ elements.salt_water.reactions.rust = { elem1:"dirty_water", elem2: "rust_dust",
elements.salt_water.reactions.rust_dust = { elem1:"dirty_water", chance: 0.0025 }
elements.salt_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.00005 }
elements.salt_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.000005 }
elements.sugar_water.reactions.mudstone = { elem2: ["mud","mud","clay"], chance: 0.00035 }
@ -1092,7 +1095,7 @@ elements.sugar_water.reactions.glass_shard = { elem2: "glass_pebble", color2:"#7
elements.sugar_water.reactions.rad_shard = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.00025 }
elements.sugar_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.00005 }
elements.sugar_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0000025 }
elements.sugar_water.reactions.rad_glass = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.000025 }
@ -1100,7 +1103,7 @@ elements.sugar_water.reactions.rust = { elem1:"dirty_water", elem2: "rust_dust",
elements.sugar_water.reactions.rust_dust = { elem1:"dirty_water", chance: 0.0025 }
elements.sugar_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.00005 }
elements.sugar_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.000005 }
elements.dirty_water.reactions.mudstone = { elem2: ["mud","mud","clay"], chance: 0.00035 }
@ -1108,13 +1111,13 @@ elements.dirty_water.reactions.glass_shard = { elem2: "glass_pebble", color2:"#7
elements.dirty_water.reactions.rad_shard = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.00025 }
elements.dirty_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.00005 }
elements.dirty_water.reactions.glass = { elem2: "glass_pebble", color2:"#7BAECB", chance: 0.0000025 }
elements.dirty_water.reactions.rad_glass = { elem2: "glass_pebble", color2:"#AECB83", chance: 0.000025 }
elements.dirty_water.reactions.rust = { elem1:"dirty_water", elem2: "rust_dust", chance: 0.0025 }
elements.dirty_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.00005 }
elements.dirty_water.reactions.plastic = { elem1: "microplastic_water", elem2: ["microplastic",null,null], chance: 0.000005 }
elements.smash.tool = function(pixel) {
let old = pixel.element;

247
mods/drill.js Normal file
View File

@ -0,0 +1,247 @@
elements.iron_drill = {
color: ["#474747","#2b2b2b","#636363"],
behavior: [
"DL%5 AND MX|CR:drill_base|DL%5 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%10 AND MX|MX",
],
category: "machines",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
};
elements.drill_base = {
color: "#808080",
behavior: [
"XX|CR:drill_support AND CH:drill_support|XX",
"XX|XX|XX",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_support = {
color: "#323232",
behavior: [
"XX|CR:drill_top|XX",
"XX|XX|XX",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_top = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side1",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side1 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side2",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side2 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side3",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side3 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side4",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side4 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side5%35 AND CR:drill_side4%65",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side5 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|CR:drill_support_down|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_support_down = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|CR:drill_support_down|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.gold_drill = {
color: ["#f7c736","#ffe596","#d1a41d"],
behavior: [
"DL%7 AND MX|CR:drill_base|DL%7 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%25 AND MX|MX",
],
category: "machines",
breakInto: "gold_coin",
state: "solid",
tempHigh: 1064,
stateHigh: "molten_gold",
density: 19300,
noMix: true,
darkText: false,
};
elements.brass_drill = {
color: ["#ad7f47","#874a00"],
behavior: [
"DL%6 AND MX|CR:drill_base|DL%6 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%15 AND MX|MX",
],
category: "machines",
state: "solid",
tempHigh: 927,
stateHigh: "molten_brass",
density: 8550,
noMix: true,
darkText: false,
};
elements.egg_drill = {
color: "#ffe69c",
behavior: [
"DL%1 AND MX|CR:drill_base|DL%1 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%1 AND MX|MX",
],
category: "machines",
breakInto: "yolk",
state: "solid",
tempHigh: 1500,
stateHigh: "steam",
density: 1031,
noMix: true,
darkText: true,
};
elements.glass_drill = {
color: "#5e807d",
behavior: [
"DL%10 AND MX|CR:drill_base|DL%10 AND MX",
"MX|LB:drill_base AND SM%1|MX",
"MX|M1 AND SM%40 AND MX|MX",
],
category: "machines",
breakInto: "glass_shard",
state: "solid",
tempHigh: 1500,
stateHigh: "molten_glass",
density: 2500,
noMix: true,
darkText: false,
};
elements.void_drill = {
color: "#000000",
behavior: [
"DL|CR:drill_base|DL",
"DL|LB:drill_base|DL",
"DL|M1 AND DL|DL",
],
category: "machines",
state: "solid",
density: 999999999999999,
noMix: true,
darkText: false,
};

View File

@ -0,0 +1,899 @@
elements.human.tick = function(pixel) {
if (isEmpty(pixel.x, pixel.y+1)) {
createPixel("body", pixel.x, pixel.y+1);
var color = pixel.color;
changePixel(pixel,"head");
pixel.color = color;
if (pixel.bodyColor) {
pixelMap[pixel.x][pixel.y+1].color = pixel.bodyColor;
}
}
else if (isEmpty(pixel.x, pixel.y-1)) {
createPixel("head", pixel.x, pixel.y-1);
pixelMap[pixel.x][pixel.y-1].color = pixel.color;
changePixel(pixel,"body");
if (pixel.bodyColor) {
pixel.color = pixel.bodyColor;
}
}
}
elements.body.tick = function(pixel) {
if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall
if (!isEmpty(pixel.x, pixel.y-2, true)) { // Drag head down
var headpixel = pixelMap[pixel.x][pixel.y-2];
if (headpixel.element === "head") {
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]);
}
}
}
}
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
}
// Find the head
if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") {
var head = pixelMap[pixel.x][pixel.y-1];
if (head.dead) { // If head is dead, kill body
pixel.dead = head.dead;
}
else if (head.panic > 0) {
pixel.panic = head.panic;
delete head.panic;
}
}
else { var head = null }
if (head && Math.random() < 0.25) {
let y = Math.random() < 0.5 ? 0 : -1;
for (let x = 1; x < 10; x++) {
let x2 = pixel.x+(x*pixel.dir);
let y2 = pixel.y+y;
if (!isEmpty(x2,y2,true)) {
let seenPixel = pixelMap[x2][y2];
if (elements.human.reactions[seenPixel.element] && elements.human.reactions[seenPixel.element].attr1 && elements.human.reactions[seenPixel.element].attr1.panic) {
pixel.panic += elements.human.reactions[seenPixel.element].attr1.panic;
pixel.dir *= -1;
break;
}
else if (seenPixel.dead || seenPixel.temp > 200) {
pixel.panic += 5;
pixel.dir *= -1;
if (seenPixel.panic) delete seenPixel.panic;
break;
}
}
}
}
if (pixel.burning) {
pixel.panic += 0.1;
if (head && pixelTicks-pixel.burnStart > 240) {
pixel.color = head.color;
}
}
if (pixel.charge) {
pixel.panic += 1;
}
else if (pixel.panic > 0) {
pixel.panic -= 0.1;
if (pixel.panic < 0) { pixel.panic = 0; }
else if (pixel.panic > 50) { pixel.panic = 50; }
}
if (isEmpty(pixel.x, pixel.y-1)) {
// create blood if decapitated 10% chance
if (Math.random() < 0.1 && !pixel.charge) {
createPixel("blood", pixel.x, pixel.y-1);
// set dead to true 15% chance
if (Math.random() < 0.15) {
pixel.dead = pixelTicks;
}
}
}
else if (head === null) { return }
else 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],
];
let moved = false;
// 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) {
movePixel(head, head.x+move[0], head.y+move[1]);
moved = true;
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 === "body" || hitPixel.element === "head" && hitPixel.panic < pixel.panic) {
// interact with other human
hitPixel.panic = pixel.panic;
}
}
}
// 15% chance to change direction
if (Math.random() < 0.15 || !moved) {
pixel.dir *= -1;
}
// homeostasis
if (pixel.temp > 37) { pixel.temp -= 1; }
else if (pixel.temp < 37) { pixel.temp += 1; }
}
}
elements.portal_in.tick = function(pixel) {
// if (Math.random() > 0.1) return;
if (!ticktemp.portal_out) ticktemp.portal_out = {};
let channel = parseInt(pixel.channel) || 0;
if (!ticktemp.portal_out[channel]) {
ticktemp.portal_out[channel] = currentPixels.filter((p) => {
return elements[p.element].id === elements.portal_out.id && (
isEmpty(p.x,p.y+1) || isEmpty(p.x,p.y-1) ||
isEmpty(p.x+1,p.y) || isEmpty(p.x-1,p.y)
) &&
(parseInt(p.channel) || 0) === parseInt(channel)
});
}
if (ticktemp.portal_out[channel].length) {
shuffleArray(squareCoordsShuffle);
let r;
for (var i = 0; i < squareCoordsShuffle.length; i++) {
var coord = squareCoordsShuffle[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable) {
r = pixelMap[x][y];
break;
}
}
if (r !== undefined || pixel.charge) {
let portal_out = choose(ticktemp.portal_out[channel]);
if (portal_out.del) return;
if (r !== undefined) {
shuffleArray(squareCoordsShuffle);
for (var j = 0; j < squareCoordsShuffle.length; j++) {
var coord2 = squareCoordsShuffle[j];
var x2 = portal_out.x+coord2[0];
var y2 = portal_out.y+coord2[1];
if (isEmpty(x2,y2) && r.element !== "head" && r.element !== "body") {
tryMove(r,x2,y2);
}
else if (isEmpty(x2,y2) && (r.element === "head" || r.element === "body")) {
if (r.element === "head" && !isEmpty(r.x,r.y+1)) {
if (pixelMap[r.x][r.y+1].element === "body") {
r.element = "human"
r.bodyColor = pixelMap[r.x][r.y+1].color
deletePixel(r.x,r.y+1)
tryMove(r,x2,y2);
}
else {
tryMove(r,x2,y2);
}
}
else if (r.element === "body" && !isEmpty(r.x,r.y-1)) {
if (pixelMap[r.x][r.y-1].element === "head") {
r.element = "human"
r.bodyColor = r.color
r.color = pixelMap[r.x][r.y-1].color
deletePixel(r.x,r.y-1)
tryMove(r,x2,y2);
}
else {
tryMove(r,x2,y2);
}
}
}
break;
}
}
if (pixel.charge && !portal_out.charge && !portal_out.chargeCD) {
portal_out.charge = pixel.charge;
}
}
};
doElectricity(pixel);
}
elements.pipe.tick = function(pixel) {
if (!pixel.stage && pixelTicks-pixel.start > 60) {
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) && elements[pixelMap[x][y].element].movable) {
deletePixel(x,y)
}
if (isEmpty(x,y)) {
createPixel("pipe_wall",x,y);
}
}
pixel.stage = 1;
}
else if (pixel.stage === 1 && pixelTicks-pixel.start > 70) { //uninitialized
for (var i = 0; i < adjacentCoords.length; i++) {
var coord = adjacentCoords[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
pixel.stage = 2; //blue
pixel.color = pixelColorPick(pixel,"#000036");
break;
}
}
}
else if (pixel.stage > 1 && pixelTicks % 3 === pixel.stage-2) { //initialized
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) && pixelMap[x][y].element === "pipe") {
var newPixel = pixelMap[x][y];
if (newPixel.stage === 1) {
var newColor;
switch (pixel.stage) {
case 2: newPixel.stage = 3; newColor = "#003600"; break; //green
case 3: newPixel.stage = 4; newColor = "#360000"; break; //red
case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue
}
newPixel.color = pixelColorPick(newPixel,newColor);
}
}
}
var moved = false;
shuffleArray(squareCoordsShuffle);
for (var i = 0; i < squareCoordsShuffle.length; i++) {
var coord = squareCoordsShuffle[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
if (newPixel.element === "pipe") {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
pixel.con = null;
moved = true;
break;
}
}
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element !== "head" && newPixel.element !== "body") { //suck up pixel
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
else if (!pixel.con && elements[newPixel.element].movable && (newPixel.element === "head" || newPixel.element === "body")) {
if (newPixel.element === "head") {
if (!isEmpty(newPixel.x,newPixel.y+1)) {
if (pixelMap[newPixel.x][newPixel.y+1].element === "body") {
newPixel.element = "human"
newPixel.bodyColor = pixelMap[newPixel.x][newPixel.y+1].color
deletePixel(newPixel.x,newPixel.y+1)
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
else {
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
}
else {
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
}
else if (newPixel.element === "body") {
if (!isEmpty(newPixel.x,newPixel.y-1)) {
if (pixelMap[newPixel.x][newPixel.y-1].element === "head") {
newPixel.element = "human"
newPixel.bodyColor = newPixel.color
newPixel.color = pixelMap[newPixel.x][newPixel.y-1].color
deletePixel(newPixel.x,newPixel.y-1)
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
else {
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
}
else {
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
}
else {
pixel.con = newPixel;
deletePixel(newPixel.x,newPixel.y);
pixel.con.x = pixel.x;
pixel.con.y = pixel.y;
pixel.con.del;
moved = true;
break;
}
}
}
}
if (pixel.con && !moved) { // move to same stage if none other
for (var i = 0; i < squareCoordsShuffle.length; i++) {
var coord = squareCoordsShuffle[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
delete pixel.con.del;
pixel.con.x = x;
pixel.con.y = y;
pixelMap[x][y] = pixel.con;
currentPixels.push(pixel.con);
pixel.con = null;
break;
}
if (!isEmpty(x,y,true) && pixelMap[x][y].element === "pipe") {
var newPixel = pixelMap[x][y];
if (pixel.con && !newPixel.con && newPixel.stage === pixel.stage) {
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
pixel.con = null;
break;
}
}
}
}
}
doDefaults(pixel);
}
elements.drag.tool = function(pixel) {
if (dragStart === null) {
dragStart = pixelTicks;
draggingPixels = [];
}
if (pixelTicks === dragStart && !pixel.drag && (elements[pixel.element].movable || shiftDown) && pixel.element !== "head") {
pixel.drag = true;
draggingPixels.push(pixel);
}
}
elements.drag.perTick = function() {
if (!draggingPixels) { return; }
for (var j = 0; j < (shiftDown ? 3 : 1); j++) {
for (var i = 0; i < draggingPixels.length; i++) {
var pixel = draggingPixels[i];
if (pixel.del) { continue }
const x = pixel.x;
const y = pixel.y;
const [mX, mY] = [mousePos.x, mousePos.y];
const empty = checkForEmptyPixels(x, y);
let bestVal = Math.sqrt(Math.pow(mX - x, 2) + Math.pow(mY - y, 2));
let best = null;
for (const pixelPair of empty) {
const x_ = x + pixelPair[0];
const y_ = y + pixelPair[1];
const c = Math.sqrt(Math.pow(mX - x_, 2) + Math.pow(mY - y_, 2));
if (c < bestVal) {
bestVal = c;
best = pixelPair;
}
}
if (best) {
if (pixel.element !== "body") {
tryMove(pixel, x + best[0], y + best[1], undefined, true);
}
else if (pixel.element === "body") {
if (!isEmpty(pixel.x,pixel.y-1)) {
var headPixel = pixelMap[pixel.x][pixel.y-1]
if (headPixel.element === "head") {
if (isEmpty(x + best[0], y + best[1] - 1)) {
tryMove(headPixel, x + best[0], y + best[1] - 1, undefined, true);
tryMove(pixel, x + best[0], y + best[1], undefined, true);
}
}
}
else {tryMove(pixel, x + best[0], y + best[1], undefined, true);}
}
}
}
}
}
mouse1Action = function(e,mouseX=undefined,mouseY=undefined,startPos) {
if (currentElement === "erase") { mouse2Action(e,mouseX,mouseY,startPos); return; }
else if (currentElement === "pick") { mouseMiddleAction(e,mouseX,mouseY); return; }
// If x and y are undefined, get the mouse position
if (mouseX === undefined && mouseY === undefined) {
// var canvas = document.getElementById("game");
// var ctx = canvas.getContext("2d");
lastPos = mousePos;
mousePos = getMousePos(canvas, e);
var mouseX = mousePos.x;
var mouseY = mousePos.y;
}
var cooldowned = false;
if (mouseSize===1 && elements[currentElement].cooldown && !paused) {
if (pixelTicks-lastPlace < elements[currentElement].cooldown) {
return;
}
cooldowned = true;
}
lastPlace = pixelTicks;
if (cooldowned && !startPos) {
var coords = mouseRange(mouseX,mouseY);
}
else {
startPos = startPos || lastPos
var coords = lineCoords(startPos.x,startPos.y,mouseX,mouseY);
}
// if (!((cooldowned && startPos.x===lastPos.x && startPos.y===lastPos.y) || ((elements[currentElement].tool || elements[currentElement].category==="tools") && !elements[currentElement].canPlace))) {
// }
// else { var coords = mouseRange(mouseX,mouseY); }
var element = elements[currentElement];
var mixList = [];
// For each x,y in coords
var done = {};
for (var i = 0; i < coords.length; i++) {
var x = coords[i][0];
var y = coords[i][1];
if (!done[x]) {
done[x] = {}
}
if (done[x][y]) { continue; }
done[x][y] = true;
if (mode === "replace" && (!elements[currentElement].tool || elements[currentElement].canPlace)) {
if (outOfBounds(x,y)) {
continue;
}
// Remove pixel at position from currentPixels
if (!isEmpty(x,y,true)) {
if (!(currentElement === pixelMap[x][y].element && pixelMap[x][y].start === pixelTicks-1)) {
deletePixel(x,y);
}
}
}
if (currentElement === "mix") {
if (!isEmpty(x,y,true)) {
var pixel = pixelMap[x][y];
if (!(elements[pixel.element].movable !== true || elements[pixel.element].noMix === true) || shiftDown) {
mixList.push(pixel);
}
}
continue;
}
else if (elements[currentElement].tool && !(elements[currentElement].canPlace && isEmpty(x,y))) {
// run the tool function on the pixel
if (!isEmpty(x,y,true)) {
var pixel = pixelMap[x][y];
// if the current element has an ignore property and the pixel's element is in the ignore property, don't do anything
if (elements[currentElement].ignore && elements[currentElement].ignore.indexOf(pixel.element) !== -1) {
continue;
}
elements[currentElement].tool(pixel);
}
continue;
}
if (isEmpty(x, y)) {
if (currentPixels.length < maxPixelCount) {
createPixel(currentElement,x,y);
if (pixelMap[x][y] && currentElement === pixelMap[x][y].element && (elements[currentElement].customColor || elements[currentElement].singleColor)) {
pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],currentColorMap[currentElement]);
}
if (currentElementProp) {
for (var key in currentElementProp) {
pixelMap[x][y][key] = currentElementProp[key]
}
}
}
}
else if (!outOfBounds(x,y)) {
if (elements[currentElement].extinguish) {
var pixel = pixelMap[x][y];
if (pixel.burning && elements[pixel.element].burning !== true) {
delete pixel.burning;
delete pixel.burnStart;
}
}
}
}
if (currentElement === "mix") {
// 1. repeat for each pixel in mixList
// 2. choose 2 random pixels and swap their x and y
// 3. remove pixel from mixList
for (var i = 0; i < mixList.length; i++) {
var pixel1 = mixList[Math.floor(Math.random()*mixList.length)];
var pixel2 = mixList[Math.floor(Math.random()*mixList.length)];
if (pixel1.element !== "head" && pixel2.element !== "head" && pixel1.element !== "body" && pixel2.element !== "body") {
swapPixels(pixel1,pixel2);
}
else if (pixel1.element !== "head" && pixel2.element !== "head" && (pixel1.element === "body" || pixel2.element === "body")) {
if (pixel1.element === "body") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel1 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(pixel2.x,pixel2.y-1, true)) {
var headPixel2 = pixelMap[pixel2.x][pixel2.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
swapPixels(pixel1,pixel2);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(pixel2.x,pixel2.y-1)) {
swapPixels(pixel1,pixel2)
tryMove(headPixel1, pixel1.x, pixel1.y-1)
}
}
}
}
else if (pixel2.element === "body") {
if (!isEmpty(pixel2.x,pixel2.y-1, true)) {
var headPixel1 = pixelMap[pixel2.x][pixel2.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel2 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
swapPixels(pixel1,pixel2);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(pixel1.x,pixel1.y-1)) {
swapPixels(pixel1,pixel2);
tryMove(headPixel1, pixel2.x,pixel2.y-1)
}
}
}
}
}
mixList.splice(mixList.indexOf(pixel1),1);
mixList.splice(mixList.indexOf(pixel2),1);
if (elements[pixel1.element].onMix) {
elements[pixel1.element].onMix(pixel1,pixel2);
}
if (elements[pixel2.element].onMix) {
elements[pixel2.element].onMix(pixel2,pixel1);
}
}
}
}
pixelTick = function(pixel,custom=null) {
if (pixel.start === pixelTicks) {return}
btemp = {};
if (elements[pixel.element] === undefined) {
pixel.invalidElement = pixel.element;
changePixel(pixel,"unknown");
return;
}
var info = elements[pixel.element];
btemp.info = info;
btemp.pixel = pixel;
if (custom) { var behavior = custom; }
else if (pixel.charge && info.behaviorOn) { var behavior = info.behaviorOn; }
else { var behavior = info.behavior; }
if (pixel.flipX) { behavior = flipBehavior(behavior,"x"); }
if (pixel.flipY) { behavior = flipBehavior(behavior,"y"); }
if (pixel.r) { behavior = rotateBehavior(behavior,pixel.r); }
var x = pixel.x;
var y = pixel.y;
var move1Spots = []; btemp.move1Spots = move1Spots;
var move2Spots = []; btemp.move2Spots = move2Spots;
var supportSpots = []; btemp.supportSpots = supportSpots;
var swapSpots = []; btemp.swapSpots = swapSpots;
btemp.mixSpots = [];
btemp.move = true;
// Parse behavior
var height = behavior.length;
for (var by = 0; by < behavior.length; by++) {
var behaviorby = behavior[by];
var width = behaviorby.length;
for (var bx = 0; bx < behaviorby.length; bx++) {
var b0 = behaviorby[bx];
if (b0 === "XX") {continue}
//if (b.includes(" OR ")) {
// b = b.split(" OR ")[Math.floor(Math.random()*b.split(" OR ").length)];
//}
// Loop through b0.split(" AND ")
if (b0.indexOf(" AND ") !== -1) { var andsplit = b0.split(" AND "); }
else { var andsplit = [b0]; }
for (var i = 0; i < andsplit.length; i++) {
var b = andsplit[i];
if (b.indexOf(":") !== -1) {
var arg = b.split(":")[1].split(/[\:\%]/)[0];
if (b.indexOf("%") === -1) {
b = b.split(/[\:\%]/)[0];
}
}
else { var arg = null;}
btemp.arg = arg;
// If b has "%" followed by a number in it, it's a chance to move
if (b.indexOf("%") !== -1) {
// Split the string at the "%" and use the second half as the chance (float)
var chance = parseFloat(b.split("%")[1]);
//console.log(b+": "+(Math.random()*100 < chance));
b = b.split(/[\:\%]/)[0];
}
else { var chance = 100; }
if (chance===100 || Math.random()*100 < chance) {
var newCoords = behaviorCoords(x,y,bx,by,width,height);
btemp.newCoords = newCoords;
if (behaviorRules[b]) {
behaviorRules[b]();
continue;
}
}
}
}
}
if (btemp.deleted) {return;}
if (supportSpots.length > 0) {
var supportCount = 0;
var allEmpty = true;
for (var i = 0; i < supportSpots.length; i++) {
var bx = supportSpots[i].x;
var by = supportSpots[i].y;
var arg = supportSpots[i].arg;
if (!isEmpty(bx,by,true)) {
if (info.ignore && info.ignore.indexOf(pixelMap[bx][by].element) !== -1) {continue;}
if ((arg === null && !validDensitySwaps[info.state][elements[pixelMap[bx][by].element].state]) || pixelMap[bx][by].element == arg) {
supportCount++;
}
}
}
if (supportCount == supportSpots.length) {
btemp.move = false;
}
}
var moved = false;
if (swapSpots.length > 0) {
var coords = swapSpots[Math.floor(Math.random()*swapSpots.length)];
if (pixelMap[coords.x][coords.y] !== undefined) {
swapPixels(pixel,pixelMap[coords.x][coords.y]);
btemp.move = false;
moved = true;
}
}
if (btemp.mixSpots.length > 0) {
for (var i = 0; i < btemp.mixSpots.length; i++) {
var coord1 = choose(btemp.mixSpots);
var coord2 = choose(btemp.mixSpots);
var exists1 = !isEmpty(coord1.x,coord1.y,true);
var exists2 = !isEmpty(coord2.x,coord2.y,true);
if (isEmpty(coord1.x,coord1.y) && exists2) {
var pixel1 = pixelMap[coord2.x][coord2.y]
if (pixel1.element !== "head" && pixel1.element !== "body") {
tryMove(pixel1,coord1.x,coord1.y);
}
else if (pixel1.element !== "head" && pixel1.element === "body") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel1 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(coord1.x,coord1.y-1, true)) {
var headPixel2 = pixelMap[coord1.x][coord1.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
tryMove(pixel1,coord1.x,coord1.y);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(coord1.x,coord1.y-1)) {
tryMove(pixel1,coord1.x,coord1.y);
tryMove(headPixel1, pixel1.x, pixel1.y-1)
}
}
}
}
}
else if (exists1 && isEmpty(coord2.x,coord2.y)) {
var pixel1 = pixelMap[coord1.x][coord1.y]
if (pixel1.element !== "head" && pixel1.element !== "body") {
tryMove(pixel1,coord2.x,coord2.y);
}
else if (pixel1.element !== "head" && pixel1.element === "body") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel1 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(coord2.x,coord2.y-1, true)) {
var headPixel2 = pixelMap[coord2.x][coord2.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
tryMove(pixel1,coord2.x,coord2.y);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(coord2.x,coord2.y-1)) {
tryMove(pixel1,coord2.x,coord2.y);
tryMove(headPixel1, pixel1.x, pixel1.y-1)
}
}
}
}
}
else if (exists1 && exists2) {
var pixel1 = pixelMap[coord1.x][coord1.y];
var pixel2 = pixelMap[coord2.x][coord2.y];
if (pixel1.element !== "head" && pixel2.element !== "head" && pixel1.element !== "body" && pixel2.element !== "body") {
swapPixels(pixel1,pixel2);
}
else if (pixel1.element !== "head" && pixel2.element !== "head" && (pixel1.element === "body" || pixel2.element === "body")) {
if (pixel1.element === "body") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel1 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(pixel2.x,pixel2.y-1, true)) {
var headPixel2 = pixelMap[pixel2.x][pixel2.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
swapPixels(pixel1,pixel2);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(pixel2.x,pixel2.y-1)) {
swapPixels(pixel1,pixel2)
tryMove(headPixel1, pixel1.x, pixel1.y-1)
}
}
}
}
else if (pixel2.element === "body") {
if (!isEmpty(pixel2.x,pixel2.y-1, true)) {
var headPixel1 = pixelMap[pixel2.x][pixel2.y-1]
if (headPixel1.element === "head") {
if (!isEmpty(pixel1.x,pixel1.y-1, true)) {
var headPixel2 = pixelMap[pixel1.x][pixel1.y-1]
if (headPixel2.element !== "body" && !(elements[headPixel2.element].movable !== true || elements[headPixel2.element].noMix === true)) {
swapPixels(pixel1,pixel2);
swapPixels(headPixel1,headPixel2);
}
}
else if (isEmpty(pixel1.x,pixel1.y-1)) {
swapPixels(pixel1,pixel2);
tryMove(headPixel1, pixel2.x,pixel2.y-1)
}
}
}
}
}
if (elements[pixel1.element].onMix) {
elements[pixel1.element].onMix(pixel1,pixel2);
}
if (elements[pixel2.element].onMix) {
elements[pixel2.element].onMix(pixel2,pixel1);
}
}
}
}
if (btemp.sticking) {
btemp.move = false;
}
// Move First Priority
if (btemp.move) {
if (move1Spots.length > 0) {
// While move1Spots is not empty
while (move1Spots.length > 0) {
// coords = random item of move1Spots
var j = Math.floor(Math.random()*move1Spots.length);
var coords = move1Spots[j];
var nx = coords.x;
var ny = coords.y;
moved = tryMove(pixel,nx,ny,btemp.leaveBehind1 || btemp.leaveBehind);
if (moved) {
break;
}
else {
// remove coords from move1Spots
move1Spots.splice(j,1);
}
}
}
// Move Second Priority
if (!moved && move2Spots.length > 0) {
// While move2Spots is not empty
while (move2Spots.length > 0) {
// coords = random item of move2Spots
var j = Math.floor(Math.random()*move2Spots.length);
var coords = move2Spots[j];
var nx = coords.x;
var ny = coords.y;
moved = tryMove(pixel,nx,ny,btemp.leaveBehind2 || btemp.leaveBehind);
if (moved) {
if (btemp.C2 && elements[btemp.C2]) {
changePixel(pixel,btemp.C2);
}
break;
}
else {
// remove coords from move2Spots
move2Spots.splice(j,1);
}
}
}
}
doAirDensity(pixel);
// Change tempearture if needed (unused)
/*if (info.tempChange != undefined) {
pixel.temp += info.tempChange;
pixelTempCheck(pixel);
}*/
// Burning
doBurning(pixel);
// Heat Transfer
if (info.insulate !== true) {
doHeat(pixel);
}
// Electricity Transfer
doElectricity(pixel);
// Staining
if (info.stain) {
doStaining(pixel);
}
}

View File

@ -2,49 +2,63 @@
elements.mars_gunk = {
color: "#121212",
behavior: behaviors.DGAS,
category: "archived",
category: "mars",
state: "gases",
extraInfo: "GUNK",
stain: 0.7
}
elements.mars_dust = {
color: ["#ab2a20","#c53227"],
behavior: behaviors.POWDER,
category: "mars",
state: "solid",
density: 1602,
tempHigh: 500,
hardness: 0.975,
stateHigh: "molten_mars",
tempLow: -170,
stateLow: "mars_rock",
color: ["#ab2a20", "#c53227"],
behavior: behaviors.POWDER,
category: "mars",
state: "solid",
density: 1602,
tempHigh: 500,
hardness: 0.975,
stateHigh: "molten_mars",
tempLow: -170,
stateLow: "mars_rock",
extraInfo: "Dust Samples from mars. Can freeze into Mars Rock.",
hardness: 0.991,
breakInto: "mars_debris"
}
elements.mars_basalt = {
color: ["#1C1B1C", "#CECECE", "#70703d", "#828282"],
behavior: behaviors.POWDER,
category: "mars",
state: "solid",
density: 5000,
extraInfo: "Woah",
tempHigh: "molten_mars",
stateHigh: "600",
hardness: 0.7,
breakInto: ["mars_dust", "mars_rock", "mars_rock", "mars_rock", "molten_mars", "mars_debris", "mars_debris", "gunk", "mars_rock_wall"]
}
elements.molten_mars = {
color: "#ffc338",
behavior: behaviors.MOLTEN,
category: "mars",
state: "liquid",
hidden: "true",
color: "#ffc338",
behavior: behaviors.MOLTEN,
category: "mars",
state: "liquid",
hidden: "true",
extraInfo: "The Result of Burnt-up mars stuff. Some turn into this faster more than others.",
temp: 2500,
density: 1150
density: 1150,
tempLow: -50,
stateLow: "mars_basalt"
}
elements.mars_rock = {
color: ["#a51002","#bd1102"],
behavior: behaviors.STURDYPOWDER,
category: "mars",
state: "solid",
density: 1605,
tempHigh: 800,
hardness: 0.75,
stateHigh: "molten_mars",
breakInto: "mars_dust",
tempLow: -273,
stateLow: "mars_rock_wall",
extraInfo: "The Freezing of Mars Dust. Can be used for normal land."
color: ["#a51002", "#bd1102"],
behavior: behaviors.STURDYPOWDER,
category: "mars",
state: "solid",
density: 1605,
tempHigh: 800,
hardness: 0.75,
stateHigh: "molten_mars",
breakInto: "mars_dust",
tempLow: -273,
stateLow: "mars_rock_wall",
extraInfo: "The Freezing of Mars Dust. Can be used for normal land."
}
elements.mars_debris = {
color: "#ff9999",
@ -54,32 +68,35 @@ elements.mars_debris = {
density: 1605,
burn: 94,
burnTime: 45,
burnInto: "ash"
burnInto: "ash",
tempHigh: 0,
stateHigh: "fire",
temp: -0.875
}
elements.support_mars_rock = {
color: ["#a51002","#bd1102"],
behavior: behaviors.SUPPORTPOWDER,
category: "mars",
state: "solid",
density: 800,
tempHigh: 150,
hardness: 0.9,
stateHigh: "molten_mars",
breakInto: "mars_rock",
hidden: "true",
extraInfo: "Mars Rock but Support Powder."
color: ["#a51002", "#bd1102"],
behavior: behaviors.SUPPORTPOWDER,
category: "mars",
state: "solid",
density: 800,
tempHigh: 150,
hardness: 0.9,
stateHigh: "molten_mars",
breakInto: "mars_rock",
hidden: "true",
extraInfo: "Mars Rock but Support Powder."
}
elements.mars_rock_wall = {
color: ["#591813","#bd1102"],
behavior: behaviors.WALL,
category: "mars",
state: "solid",
density: 20,
tempHigh: 2500,
hardness: 0.35,
stateHigh: "mars_dust",
breakInto: "mars_rock",
extraInfo: "The Freezing of Mars Rock. A wall that keeps the Earthlings Away!"
color: ["#591813", "#bd1102"],
behavior: behaviors.WALL,
category: "mars",
state: "solid",
density: 20,
tempHigh: 2500,
hardness: 0.35,
stateHigh: "mars_dust",
breakInto: "mars_rock",
extraInfo: "The Freezing of Mars Rock. A wall that keeps the Earthlings Away!"
}
elements.mars_ironheart_ore = {
color: ["#e8e8e8", "#bd1102"],
@ -108,11 +125,11 @@ elements.mars_ironheart = {
reactions: {
"mars_furnace": { elem1: "ironheart", elem2: "ironheart" },
"nosmoker": { elem1: "ironheart", elem2: "ironheart" },
"ironheart": { elem1: "ironheart", elem2: "ironheart" , chance:0.1 }
},
"ironheart": { elem1: "ironheart", elem2: "ironheart", chance: 0.1 }
},
}
elements.mars_furnace = {
color: ["#870002","#870507"],
color: ["#870002", "#870507"],
behavior: [
"XX|CR:mars_gunk%8|XX",
"XX|XX|XX",
@ -140,15 +157,18 @@ elements.nosmoker = {
elements.ironheart = {
color: "#e9825a",
behavior: [
"SA|XX|SA|",
"XX|XX|XX|",
"M1|M1|M1|",
"XX|XX|XX|",
"M2|M1|M2|",
],
category: "mars",
density: 1450,
state: "solid",
stateHigh: "molten_mars",
extraInfo: "Very Sturdy."
extraInfo: "Very Sturdy.",
reactions: {
"electric": { elem1: "smint", elem2: "null" },
},
}
elements.antigunk = {
color: "#cecece",
@ -195,7 +215,64 @@ elements.mars_water = {
behavior: behaviors.LIQUID,
category: "mars",
state: "liquid",
density: 997
density: 997,
tempLow: -30,
stateLow: "mars_ice",
stain: 0.05,
tempHigh: 300,
stateHigh: "mars_steam",
temp: 10
}
elements.mars_coal = {
color: "#290407",
behavior: [
"XX|CR:mars_gunk%1|XX",
"XX|XX|XX",
"M1|XX|M1",
],
category: "mars",
state: "solid",
density: 997,
tempLow: -30,
stateLow: "mars_basalt",
stain: 0.3,
tempHigh: 300,
stateHigh: "molten_mars",
temp: 10,
reactions: {
"electric": { elem2: "useless", chance: 0.01 },
}
}
elements.mars_ice = {
color: "#f2b5c0",
behavior: behaviors.WALL,
category: "mars",
state: "solid",
density: 997,
tempHigh: 35,
stateHigh: "mars_water",
hardness: 0.5,
breakInto: "mars_water",
extraInfo: "its rock solid!",
temp: 0
}
elements.smint = {
color: "#EFC905",
behavior: behaviors.SELFDELETE,
category: "archived",
state: "gas",
extraInfo: "boo",
temp: 0
}
elements.mars_steam = {
color: "#ffffff",
behavior: behaviors.DGAS,
category: "mars",
state: "gas",
tempLow: -100,
stateLow: "mars_water",
extraInfo: "choo choo",
temp: 500
}
elements.testy = {
color: "#FFFFFF",
@ -204,10 +281,11 @@ elements.testy = {
state: "solid",
extraInfo: "Don't mind me, just a test. Removed 06/02/25?"
}
elements.o2_tank = {
color: "#98F5F9",
behavior: [
"CR:oxygen%3|XX|XX",
"CR:oxygen%2|XX|XX",
"XX|XX|XX",
"XX|XX|XX",
],
@ -217,8 +295,66 @@ elements.o2_tank = {
stateHigh: "molten_copper",
breakInto: ["copper", "oxygen"]
}
// 1.7.12
elements.solar_core = {
color: "#FFDE59",
behavior: [
"XX|CH:light>electric%50|XX",
"XX|XX|XX",
"XX|XX|XX",
],
category: "cores",
state: "solid",
tempHigh: "600",
stateHigh: "molten_zinc",
breakInto: "zinc",
conduct: 1,
extraInfo: "Not The Best Option, but the easiest."
}
elements.hydro_core = {
color: "#17A4A9",
behavior: [
"XX|CH:mars_water>electric%75|XX",
"XX|XX|XX",
"XX|XX|XX",
],
category: "cores",
state: "solid",
tempHigh: "600",
stateHigh: "molten_zinc",
breakInto: "zinc",
conduct: 1
}
elements.coal_core = {
color: "#FFA4A9",
behavior: [
"XX||CH:mars_coal>electric%3|XX",
"XX|XX|XX",
"XX|XX|XX",
],
category: "cores",
state: "solid",
tempHigh: "600",
stateHigh: "molten_zinc",
breakInto: "zinc",
conduct: 1,
extraInfo: "Put In some Coal and watch the battery drain."
}
elements.ironheart_core = {
color: "#FFA4A9",
behavior: [
"XX||CH:ironheart>electric%0.5|",
"XX|XX|XX",
"XX|XX|XX",
],
category: "cores",
state: "solid",
tempHigh: "800",
stateHigh: "molten_zinc",
breakInto: "zinc",
conduct: 1,
extraInfo: "wha"
}
// 2.9.17.1
// most elements done :D
// iron heart ore
// iron heart
@ -239,3 +375,17 @@ elements.o2_tank = {
// O2 BE YOU
// mars water
// removed legacy liquid mars dust
// mars water 2
// so like a week ago i made smelting ironheart easier
// basalt and stuff
// wow! mars ice
// and steam
// also mars_debris got updated
// they burn a lot
// added cores that emit electricity
// its like plants
// dumbed down ironheart a bit, im thinking about its behaviour
// Creditssss
// Ghanisma - idea for 2.9.16

View File

@ -5,38 +5,6 @@ behaviors.SOLIDIFY = function(pixel) {
var colorOne = "#ffffff"
var colorTwo = "#000000"
viewInfo[8] = { // Neon View
name: "neon",
pixel: function(pixel,ctx) {
if (elements[pixel.element].isColor === true) {
var color = pixel.gradient;
if (color < 0) {color = 0}
if (color > 60) {color = 60}
// logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees)
var hue = Math.round(225 - (Math.log(color)/Math.log(60))*225);
if (hue < 0) {hue = 0}
if (hue > 225) {hue = 225}
drawSquare(ctx,"hsl("+hue+",50%,50%)",pixel.x,pixel.y)
}
}
}
elements.red = {
color: "#AD1300",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|XX|XX",
],
tool: function(pixel) {
if (elements[pixel.element].isColor == true) {
pixel.gradient += 1
}
},
canPlace: false,
category: "tools",
}
elements.colorOne = {
tick: function(pixel) {
if (pixel.color != colorOne) {
@ -190,9 +158,6 @@ elements.desand = {
changePixel(pixel,"water")
}
}
else if ([pixel.element].startsWith("sand_")) {
deletePixel(pixel.x,pixel.y)
}
},
category: "tools",
}
@ -284,6 +249,16 @@ elements.red_ice = {
"XX|M1|XX",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
@ -313,6 +288,7 @@ elements.red_ice = {
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
breakInto: "red_snow",
tempLow: 0,
stateLow: "red_water",
category: "solids",
@ -320,14 +296,132 @@ elements.red_ice = {
density: 917,
}
elements.red_snow = {
color: "#D64765",
behavior: behaviors.POWDER,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.25},
"salt_water":{elem2:"red_ice", chance:0.25},
"sugar_water":{elem2:"red_ice", chance:0.25},
"dirty_water":{elem2:"red_ice", chance:0.25},
"pool_water":{elem2:"red_ice", chance:0.25},
"slush":{elem2:"red_ice", chance:0.25},
"seltzer":{elem2:"red_ice", chance:0.25},
"juice":{elem2:"red_ice", chance:0.25},
"soda":{elem2:"red_ice", chance:0.25},
"milk":{elem2:"red_ice", chance:0.25},
"slime":{elem2:"red_ice", chance:0.25},
"tea":{elem2:"red_ice", chance:0.25},
"coffee":{elem2:"red_ice", chance:0.25},
"neutral_acid":{elem2:"red_ice", chance:0.25},
"infection":{elem2:"red_ice", chance:0.25},
"meat":{elem2:"red_ice_meat", chance:0.15},
"skin":{elem2:"red_ice_meat", chance:0.075},
"body":{elem2:"red_ice_meat", chance:0.04},
"head":{elem2:"red_ice_meat", chance:0.05},
"frozen_meat":{elem2:"red_ice_meat", chance:0.15},
"fish":{elem2:"red_ice_meat", chance:0.15},
"bird":{elem2:"red_ice_meat", chance:0.15},
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
temp: 5,
tempLow: -18,
tempHigh: 100,
stateHigh: "packed_red_snow",
stateLow: "red_water",
category: "land",
state: "solid",
density: 100
}
elements.packed_red_snow = {
color: "#CC3F5F",
behavior: behaviors.SUPPORTPOWDER,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.25},
"salt_water":{elem2:"red_ice", chance:0.25},
"sugar_water":{elem2:"red_ice", chance:0.25},
"dirty_water":{elem2:"red_ice", chance:0.25},
"pool_water":{elem2:"red_ice", chance:0.25},
"slush":{elem2:"red_ice", chance:0.25},
"seltzer":{elem2:"red_ice", chance:0.25},
"juice":{elem2:"red_ice", chance:0.25},
"soda":{elem2:"red_ice", chance:0.25},
"milk":{elem2:"red_ice", chance:0.25},
"slime":{elem2:"red_ice", chance:0.25},
"tea":{elem2:"red_ice", chance:0.25},
"coffee":{elem2:"red_ice", chance:0.25},
"neutral_acid":{elem2:"red_ice", chance:0.25},
"infection":{elem2:"red_ice", chance:0.25},
"meat":{elem2:"red_ice_meat", chance:0.15},
"skin":{elem2:"red_ice_meat", chance:0.075},
"body":{elem2:"red_ice_meat", chance:0.04},
"head":{elem2:"red_ice_meat", chance:0.05},
"frozen_meat":{elem2:"red_ice_meat", chance:0.15},
"fish":{elem2:"red_ice_meat", chance:0.15},
"bird":{elem2:"red_ice_meat", chance:0.15},
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
temp: 5,
tempLow: -20,
tempHigh: 200,
stateHigh: "red_ice",
stateLow: "red_water",
breakInto: "red_snow",
category: "land",
state: "solid",
density: 400,
hidden: true
}
elements.red_ice_meat = {
color: "#AC3536",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|M1|XX",
"XX|CH:frozen_meat,meat>red_ice_meat%1|XX",
"CH:frozen_meat,meat>red_ice_meat%1|XX|CH:frozen_meat,meat>red_ice_meat%1",
"XX|M1 AND CH:frozen_meat,meat>red_ice_meat%1|XX",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
@ -357,8 +451,8 @@ elements.red_ice_meat = {
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
tempHigh: 0,
stateHigh: "meat",
tempLow: -100,
stateLow: "meat",
category:"food",
hidden:true,
state: "solid",
@ -366,10 +460,131 @@ elements.red_ice_meat = {
isFood: true
}
elements.red_ice_plant = {
color: "#735958",
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.025},
"salt_water":{elem2:"red_ice", chance:0.025},
"sugar_water":{elem2:"red_ice", chance:0.025},
"dirty_water":{elem2:"red_ice", chance:0.025},
"pool_water":{elem2:"red_ice", chance:0.025},
"slush":{elem2:"red_ice", chance:0.025},
"seltzer":{elem2:"red_ice", chance:0.025},
"juice":{elem2:"red_ice", chance:0.025},
"soda":{elem2:"red_ice", chance:0.025},
"milk":{elem2:"red_ice", chance:0.025},
"slime":{elem2:"red_ice", chance:0.025},
"tea":{elem2:"red_ice", chance:0.025},
"coffee":{elem2:"red_ice", chance:0.025},
"neutral_acid":{elem2:"red_ice", chance:0.025},
"infection":{elem2:"red_ice", chance:0.025},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
behavior: behaviors.WALL,
category:"life",
tempHigh: 300,
stateHigh: "fire",
burn:85,
burnTime:45,
temp: 2.66,
tempLow: -7,
stateLow: "red_plant",
state: "solid",
density: 1050,
hidden: true
}
elements.red_plant = {
color: ["#AA3527","#AA3227","#AA2C27","#A11D1D"],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.025},
"salt_water":{elem2:"red_ice", chance:0.025},
"sugar_water":{elem2:"red_ice", chance:0.025},
"dirty_water":{elem2:"red_ice", chance:0.025},
"pool_water":{elem2:"red_ice", chance:0.025},
"slush":{elem2:"red_ice", chance:0.025},
"seltzer":{elem2:"red_ice", chance:0.025},
"juice":{elem2:"red_ice", chance:0.025},
"soda":{elem2:"red_ice", chance:0.025},
"milk":{elem2:"red_ice", chance:0.025},
"slime":{elem2:"red_ice", chance:0.025},
"tea":{elem2:"red_ice", chance:0.025},
"coffee":{elem2:"red_ice", chance:0.025},
"neutral_acid":{elem2:"red_ice", chance:0.025},
"infection":{elem2:"red_ice", chance:0.025},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1|M2",
],
category:"life",
tempHigh: 2,
stateHigh: "red_ice_plant",
state: "solid",
density: 1050,
hidden: true
}
elements.red_water = {
color: "#880808",
behavior: behaviors.LIQUID,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
@ -398,20 +613,37 @@ elements.red_water = {
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
temp: -20,
tempHigh: 0,
stateHigh: "red_ice",
tempLow: -100,
stateLow: "red_steam",
tempHigh: 0,
stateHigh: "red_ice",
category: "liquids",
state: "liquid",
density: 997,
conduct: 0.02,
temp: -20,
stain: -0.5,
extinguish: true
}
elements.red_steam = {
color: "#F88379",
behavior: behaviors.GAS,
reactions: {
"red_steam": { elem1: "red_cloud", elem2: "red_cloud", chance:0.05, "y":[0,15], "setting":"clouds" },
"red_rain": { elem1: "red_rain", chance:0.4, "y":[0,12], "setting":"clouds" },
"red_cloud": { elem1: "red_cloud", chance:0.4, "y":[0,12], "setting":"clouds" },
"red_snow_cloud": { elem1: "red_rain_cloud", chance:0.4, "y":[0,12], "setting":"clouds" },
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
@ -448,6 +680,165 @@ elements.red_steam = {
density: 0.6,
}
elements.red_cloud = {
color: "#E8ABAB",
behavior: [
"XX|XX|XX",
"XX|CO:1%5|M1%2.5 AND BO",
"XX|XX|XX",
],
reactions: {
"red_rain": { elem1:"red_rain", temp1: 20 },
"red_cloud": { elem1:"red_rain", elem2:"red_rain", temp1:20, temp2:20, charged:true },
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
category:"gases",
temp: -110,
tempHigh: -100,
stateHigh: "red_rain",
state: "gas",
breakInto: "red_rain",
density: 0.4,
ignoreAir: true,
conduct: 0.03
}
elements.red_rain = {
color: "#C27A79",
behavior: [
"XX|XX|XX",
"XX|CH:red_water%0.05|M1%2.5 AND BO",
"CR:electric%0.05|CR:electric%0.05|CR:electric%0.05",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
category:"gases",
temp: -70,
tempLow: -100,
stateLow: "red_cloud",
breakInto: "water",
tempHigh: 0,
stateHigh: "red_snow_cloud",
state: "gas",
density: 0.5,
ignoreAir: true,
conduct: 0.03
}
elements.red_snow_cloud = {
color: "#CC8482",
behavior: [
"XX|XX|XX",
"XX|CH:red_snow%0.05|M1%2.5 AND BO",
"XX|XX|XX",
],
category:"gases",
temp: 10,
tempLow: -30,
stateLow: "red_rain",
state: "gas",
density: 0.55,
ignoreAir: true,
conduct: 0.01,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
}
elements.graphite = {
color: "#2F2F33",
colorKey: {
@ -763,3 +1154,406 @@ elements.graphite_dust = {
density: 1830,
stain: 0.6
}
scaleLimit = 0
elements.pixel_scale = {
color: "#89796C",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
density: 7850,
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired pixel limit of this scale. It will not work if you place multiple limits while paused.",(scaleLimit||undefined));
if (!answer1) { return }
scaleLimit = (answer1);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = scaleLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabPixels(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.top - 1));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabPixels(pixel);
pixel.scaleSum += (distance.top - 1)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
kiloLimit = 0
elements.weight_scale = {
color: "#7A7977",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired kilogram limit of this scale. It will not work if you place multiple limits while paused.",(kiloLimit||1602));
if (!answer1) { return }
kiloLimit = (answer1);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = kiloLimit
}
if (isEmpty(pixel.x-1,pixel.y) || !outOfBounds(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabWeights(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.weight));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabWeights(pixel);
pixel.scaleSum += (distance.weight)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
scanLimit = 0
scanningLimit = 0
elements.pixel_scanner = {
color: "#799187",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: ["molten_steel","molten_steel","molten_steel","flash"],
density: 7850,
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired pixel limit of this scanner. It will not work if you place multiple limits while paused.",(scanLimit||5));
if (!answer1) { return }
scanLimit = (answer1);
var answer2 = prompt("Input the desired scanning limit of this scanner. It will not work if you place multiple limits while paused.",(scanningLimit||10));
if (!answer2) { return }
scanningLimit = (answer2);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = scanLimit
pixel.scanningLimit = scanningLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabAllPixels(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.pixels - 1));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabAllPixels(pixel);
pixel.scaleSum += (distance.pixels - 1)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
kiloScanLimit = 0
kiloScanningLimit = 0
elements.weight_scanner = {
color: "#6D9190",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired kilogram limit of this scanner. It will not work if you place multiple limits while paused.",(kiloScanLimit||1602));
if (!answer1) { return }
kiloScanLimit = (answer1);
var answer2 = prompt("Input the desired scanning limit of this scanner. It will not work if you place multiple limits while paused.",(kiloScanningLimit||10));
if (!answer2) { return }
kiloScanningLimit = (answer2);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = kiloScanLimit
pixel.scanningLimit = kiloScanningLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabAllWeights(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.weight));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabAllWeights(pixel);
pixel.scaleSum += (distance.weight)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
grabPixels = function(pixel){
let element = pixel.element
let results = {}
for (let i = 0; i < height; i++) {
if (isEmpty(pixel.x, pixel.y-i, true)){
results.top = i
break;
}
}
return results
}
grabAllPixels = function(pixel){
let element = pixel.element
let results = {}
results.pixels = 0
for (let i = 0; i < height; i++) {
if (!isEmpty(pixel.x, pixel.y-i, true)){
results.pixels += 1
}
if (i > (pixel.scanningLimit - 1)){
break;
}
}
return results
}
grabWeights = function(pixel){
let element = pixel.element
let results = {}
let weight = 0
for (let i = 0; i < height; i++){
if (!isEmpty(pixel.x, pixel.y-i, true)){
if (elements[pixelMap[pixel.x][pixel.y-i].element].density && !weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (elements[pixelMap[pixel.x][pixel.y-i].element].density && weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (!elements[pixelMap[pixel.x][pixel.y-i].element].density) {
let result;
if (elements[pixelMap[pixel.x][pixel.y-i].element].breakInto !== undefined) {
if (Array.isArray(elements[pixelMap[pixel.x][pixel.y-i].element].breakInto)) {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto[Math.floor(Math.random() * elements[pixel.element].breakInto.length)];
weight += elements.result.density
}
else {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto;
weight += elements.result.density
}
}
}
}
if (isEmpty(pixel.x, pixel.y-i, true)){
results.top = i
if (isEmpty(pixel.x, pixel.y-i, true)){
results.topelement = "air"
} else {
results.topelement = pixelMap[pixel.x][pixel.y-i].element
}
break;
}
}
results.weight = weight
return results
}
grabAllWeights = function(pixel){
let element = pixel.element
let results = {}
let weight = 0
for (let i = 0; i < height; i++){
if (!isEmpty(pixel.x, pixel.y-i, true)){
if (elements[pixelMap[pixel.x][pixel.y-i].element].density && !weight) {
weight = elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (elements[pixelMap[pixel.x][pixel.y-i].element].density && weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (!elements[pixelMap[pixel.x][pixel.y-i].element].density) {
let result;
if (elements[pixelMap[pixel.x][pixel.y-i].element].breakInto !== undefined) {
if (Array.isArray(elements[pixelMap[pixel.x][pixel.y-i].element].breakInto)) {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto[Math.floor(Math.random() * elements[pixel.element].breakInto.length)];
weight += elements.result.density
}
else {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto;
weight += elements.result.density
}
}
}
}
if (i > (pixel.scanningLimit - 1)){
break;
}
}
results.weight = weight
return results
}
/*elements.Cherries_Ceri_Moji = {
color: "#fcd1d7",
category: Student,
state: High_School,
behavior: [Shy, Introverted, Easily_Excited, Kind],
pronouns: [She,Her,Herself],
sexuality: [Panromantic, Asexual],
desc: "Ceri is a 16 year old high school student who loves cats"
}*/

File diff suppressed because it is too large Load Diff

62
mods/sports_beta.js Normal file
View File

@ -0,0 +1,62 @@
elements.softball = {
color: "#ffe300",
behavior: behaviors.BOUNCY,
category: "softball",
state: "solid",
};
elements.baseball = {
color: "#eae7dc",
behavior: behaviors.BOUNCY,
category: "baseball",
state: "solid",
};
elements.basketball = {
color: "#e77f1c",
behavior: behaviors.BOUNCY,
category: "basketball",
state: "solid",
};
elements.football = {
color: "#ac5541",
behavior: behaviors.BOUNCY,
category: "football",
state: "solid",
};
elements.soccer_ball = {
color: "#f9fbfa",
behavior: behaviors.BOUNCY,
category: "soccer",
state: "solid",
};
elements.tennis_ball = {
color: "#9ab973",
behavior: behaviors.BOUNCY,
category: "tennis",
state: "solid",
};
elements.puck = {
color: "#180902",
behavior: behaviors.BOUNCY,
category: "hockey",
state: "solid",
};
elements.dodge_ball = {
color: "#533d61",
behavior: behaviors.BOUNCY,
category: "gaga_ball",
state: "solid",
};
elements.deodorant = {
color: "#def2fc",
behavior: behaviors.DGAS,
category: "gases",
state: "gas",
};

126
mods/stainless_steel.js Normal file
View File

@ -0,0 +1,126 @@
// obtaining chromite (makes chrome)
elements.magma.stateLow = ["rock", "basalt", "basalt", "basalt", "chromite"];
// chrome
elements.chromite = {
color: ["#372d38", "#6e6e6e"],
behavior: behaviors.POWDER,
state: "solid",
category: "powders",
tempHigh: 2180,
stateHigh: "magma",
};
// stainless steel
elements.stainless_steel = {
color: "#454545",
behavior: behaviors.WALL,
state: "solid",
category: "solids",
tempHigh: 1510,
};
// chrome
elements.chrome = {
color: "#c4c4c4",
behavior: behaviors.WALL,
state: "solid",
category: "solids",
tempHigh: 1900,
reactions: {
"molten_steel": { elem2:"molten_stainless_steel", tempMin:1800, tempMax:2000 }
},
alias: "chromium",
};
// obtaining chrome (makes stainless steel)
elements.molten_aluminum.reactions.chromite = { elem2:"chrome", tempMin:1000, tempMax:1200, chance:0.1 };
// bauxite (makes aluminum)
elements.bauxite = {
color: ["#c4ad9d","#996644"],
behavior: behaviors.WALL,
category: "solids",
state: "solid",
tempHigh: 2072,
breakInto: "crushed_bauxite",
};
// obtaining caustic soda
elements.salt_water.reactions.copper = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0075 };
elements.salt_water.reactions.zinc = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.015 };
elements.salt_water.reactions.steel = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0125 };
elements.salt_water.reactions.aluminum = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0025 };
elements.salt_water.reactions.iron = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0125 };
elements.salt_water.reactions.tin = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.1 };
elements.salt_water.reactions.brass = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.001 };
elements.salt_water.reactions.bronze = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.001 };
elements.salt_water.reactions.silver = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0075 };
elements.salt_water.reactions.gold = { elem1:["hydrogen","hydrogen","oxygen","chlorine","caustic_soda"], charged:true, chance:0.0075 };
// soda lime
elements.soda_lime = {
color: "#dcdcdc",
behavior: behaviors.POWDER,
state: "solid",
category: "powders",
reactions: {
"crushed_bauxite": { elem1:"alumina", chance:50 }
},
alias: "calcium hydroxide",
};
// alumina
elements.alumina = {
color: "#c3d4c3",
behavior: behaviors.WALL,
state: "solid",
category: "solids",
tempHigh: 2072,
stateHigh: "molten_aluminum",
conduct: 1,
alias: "aluminum oxide",
};
// uh
elements.aluminum.alias = "aluminium";
// caustic soda
elements.caustic_soda = {
color: "#ececec",
behavior: behaviors.POWDER,
state: "solid",
category: "powders",
reactions: {
"quicklime": { elem1:"soda_lime" }
},
alias: "sodium hydroxide",
denisity: 3000,
tempHigh: 318,
};
// crushed bauxite (part of the process)
elements.crushed_bauxite = {
color: ["#a28e7b","#774422"],
behavior: behaviors.POWDER,
category: "powders",
tempHigh: 2072,
stateHigh: "molten_bauxite",
};
// Makes Chrome and Stainless Steel more expensive on survival.js
if (enabledMods.includes("mods/survival.js")) {
runAfterLoad(function() {
elementWorth.chrome = 2;
elementWorth.stainless_steel = 5;
});
};
// Obtaining Bauxite (ores.js only)
if (enabledMods.includes("mods/ores.js")) {
runAfterLoad(function() {
eLists.oreSpawnConditions.bauxite = 0.38;
eLists.oreRgb.bauxite = "rgba(140, 109, 88, ";
eLists.idealOreHeight.bauxite = 0.2;
});
};

View File

@ -1,6 +1,19 @@
// by nekonico
elements.true_flashbang = {
isEven = function(num) {
if (num % 2) {
return (true)
}
else {return (false)}
}
isOdd = function(num) {
if (num % 1) {
return (true)
}
else {return (false)}
}
elements.flashy_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.");
@ -16,7 +29,8 @@ elements.true_flashbang = {
tempHigh: 1455.5,
stateHigh: "molten_steel",
excludeRandom: true,
cooldown: defaultCooldown
cooldown: defaultCooldown,
maxSize: 1,
}
elements.flashbang_flash = {
@ -36,7 +50,7 @@ elements.flashbang_flash = {
done = false;
}
}
if ((Math.random() < 0.75 && done) || pixel.alpha < 0.05) {
if ((Math.random() < 0.75 && done) || pixel.alpha < 0.060784314) {
deletePixel(pixel.x, pixel.y)
settings.bg = "#000000";
}
@ -57,5 +71,450 @@ elements.flashbang_flash = {
insulate: true,
hidden: true,
noMix: true,
excludeRandom: true
}
excludeRandom: true,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.flashy_nuke = {
onSelect: function() {
logMessage("Caution: If you have epilepsy or any similar vision issues, do not place this element for your own safety.");
},
color: "#534636",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1 AND EX:65>plasma,plasma,plasma,plasma,radiation,rad_steam,plasma,plasma,plasma,plasma,radiation,rad_steam,plasma,plasma,plasma,plasma,radiation,rad_steam,nuke_flash|M2",
],
category: "weapons",
state: "solid",
density: 1500,
excludeRandom: true,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.nuke_flash = {
color: "#ffffff",
properties: {
delay: 60
},
tick: function(pixel) {
settings.bg = pixel.color;
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#${hex}ff${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.061) {
changePixel(pixel, "nuke_overflash")
}
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,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.nuke_overflash = {
color: "#00ff00",
properties: {
delay: 40
},
tick: function(pixel) {
settings.bg = pixel.color;
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#00${hex}00` // 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.061) {
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,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.flashy_h_bomb = {
onSelect: function() {
logMessage("Caution: If you have epilepsy or any similar vision issues, do not place this element for your own safety.");
},
color: "#533636",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1 AND EX:90>plasma,plasma,plasma,plasma,fire,plasma,plasma,plasma,plasma,fire,plasma,plasma,plasma,plasma,fire,h_bomb_flash|M2",
],
category: "weapons",
state: "solid",
density: 1600,
excludeRandom: true,
alias: "hydrogen bomb",
cooldown: defaultCooldown,
maxSize: 1,
}
elements.h_bomb_flash = {
color: "#ffffff",
properties: {
delay: 30
},
tick: function(pixel) {
settings.bg = pixel.color;
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#ff${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.061) {
changePixel(pixel, "h_bomb_overflash")
}
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,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.h_bomb_overflash = {
color: "#ff0000",
properties: {
delay: 70
},
tick: function(pixel) {
settings.bg = pixel.color;
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#${hex}0000` // 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.061) {
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,
cooldown: defaultCooldown,
maxSize: 1,
}
elements.flashy_firework = {
color: "#c44f45",
onSelect: function() {
logMessage("Caution: If you have epilepsy or any similar vision issues, do not place this element for your own safety.");
},
tick: function(pixel) {
if ((pixel.temp > 1000 || pixel.charge) && !pixel.burning) {
pixel.burning = true;
pixel.burnStart = pixelTicks;
}
if (pixel.burning) {
if (!tryMove(pixel, pixel.x, pixel.y-1)) {
// tryMove again to the top left or top right
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y-1);
}
if (pixelTicks-pixel.burnStart > 50 && Math.random() < 0.1) {
if (Math.random() > 0.5) {
explodeAt(pixel.x, pixel.y, 10, "fw_flash1");
}
else if (Math.random() > 0.5) {
explodeAt(pixel.x, pixel.y, 10, "fw_flash2");
}
else if (Math.random() > 0.5) {
explodeAt(pixel.x, pixel.y, 10, "fw_flash3");
}
else {
explodeAt(pixel.x, pixel.y, 10, "fw_flash4");
}
}
}
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);
},
burn: 90,
burnTime: 100,
properties: { burning:false },
burning: true,
density: 2000,
conduct: 1,
state: "solid",
category: "weapons"
}
elements.fw_flash1 = {
properties: {
delay: 5
},
color: ["#ff00ff","#00ffff"],
behavior: [
"XX|XX|XX",
"XX|DL%25|M2",
"XX|M2|M1",
],
tick: function(pixel) {
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#00${hex}${hex}`
settings.bg = pixel.color;
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.062) {
changePixel(pixel, "smoke")
settings.bg = "#000000";
}
if (pixel.delay) {
pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay)
}
doHeat(pixel);
},
burning: true,
burnInto: "ash",
burnTime: 100,
fireElement: ["smoke","smoke","smoke","smoke","carbon_dioxide"],
rotatable: true,
temp: 649,
tempLow: 0,
stateLow: "carbon_dioxide",
category: "energy",
hidden: true,
state: "gas",
density: 700,
alias: "flashy firework ember"
}
elements.fw_flash2 = {
properties: {
delay: 5
},
color: ["#ff00ff","#00ffff"],
behavior: [
"XX|XX|XX",
"XX|DL%25|M2",
"XX|M2|M1",
],
tick: function(pixel) {
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#${hex}00${hex}`
settings.bg = pixel.color;
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.062) {
changePixel(pixel, "smoke")
settings.bg = "#000000";
}
if (pixel.delay) {
pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay)
}
doHeat(pixel);
},
burning: true,
burnInto: "ash",
burnTime: 100,
fireElement: ["smoke","smoke","smoke","smoke","carbon_dioxide"],
rotatable: true,
temp: 649,
tempLow: 0,
stateLow: "carbon_dioxide",
category: "energy",
hidden: true,
state: "gas",
density: 700,
alias: "flashy firework ember"
}
elements.fw_flash3 = {
properties: {
delay: 5
},
color: ["#ff00ff","#00ffff"],
behavior: [
"XX|XX|XX",
"XX|DL%25|M2",
"XX|M2|M1",
],
tick: function(pixel) {
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#00${hex}00`
settings.bg = pixel.color;
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.062) {
changePixel(pixel, "smoke")
settings.bg = "#000000";
}
if (pixel.delay) {
pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay)
}
doHeat(pixel);
},
burning: true,
burnInto: "ash",
burnTime: 100,
fireElement: ["smoke","smoke","smoke","smoke","carbon_dioxide"],
rotatable: true,
temp: 649,
tempLow: 0,
stateLow: "carbon_dioxide",
category: "energy",
hidden: true,
state: "gas",
density: 700,
alias: "flashy firework ember"
}
elements.fw_flash4 = {
properties: {
delay: 5
},
color: "#ff00ff",
behavior: [
"XX|XX|XX",
"XX|DL%25|M2",
"XX|M2|M1",
],
tick: function(pixel) {
let hex = Math.round(255 * pixel.alpha).toString(16);
pixel.color = `#0000${hex}`
settings.bg = pixel.color;
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.062) {
changePixel(pixel, "smoke")
settings.bg = "#000000";
}
if (pixel.delay) {
pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay)
}
doHeat(pixel);
},
burning: true,
burnInto: "ash",
burnTime: 100,
fireElement: ["smoke","smoke","smoke","smoke","carbon_dioxide"],
rotatable: true,
temp: 649,
tempLow: 0,
stateLow: "carbon_dioxide",
category: "energy",
hidden: true,
state: "gas",
density: 700,
alias: "flashy firework ember"
}