Merge branch 'main' into main
This commit is contained in:
commit
6eaf66adaf
|
|
@ -174,8 +174,8 @@
|
|||
<tr><td>extra_element_info.js</td><td>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>Extra saves slots [KEEP IMPORTANT SAVES AS FILES!!]</td><td>Jayd</td></tr>
|
||||
<tr><td>find.js</td><td>Find mode that highlights a chosen element as pulsating red and yellow <a href="https://github.com/R74nCom/sandboxels/commit/de0dc088ab4d928c77587b9d0e3a7d7663e3f94a">[More Info]</a></td><td>Alice</td></tr>
|
||||
<tr><td>hideandshowtools.js</td><td>Tools to hide elements and show hidden elements</td><td>MicaelNotUsed</td><tr>
|
||||
<tr><td>gasdecay.js</td><td>Gases will slowly decay over time</td><td>nousernamefound</td></tr>
|
||||
<tr><td>hideandshowtools.js</td><td>Tools to hide elements and show hidden elements</td><td>MicaelNotUsed</td><tr>
|
||||
<tr><td>human_friendly_design.js</td><td>Drag and Mix tools don't 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>Extra tools</td><td>Jayd</td></tr>
|
||||
|
|
@ -196,17 +196,17 @@
|
|||
<tr><td>texturepack.js</td><td>Tools that let you create and share custom texture packs</td><td>nousernamefound</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
<tr><td>worldEdit.js</td><td>Selection and editing tools</td><td>RedBirdly</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Adora</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Orchid</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Science & Chemistry</td></tr><!---->
|
||||
<tr><td>alcohol.js</td><td>Methanol, (iso-)propanol, and butanol</td><td>Alice</td></tr>
|
||||
<tr><td>alkahest.js</td><td>The alkahest, a liquid which dissolves anything</td><td>Alice</td></tr>
|
||||
<tr><td>alkali_metal.js</td><td>The missing alkali metals. (Inspired by nobegas.js and halogen.js)</td><td>Cube14yt</td><tr>
|
||||
<tr><td>alkali_metal.js</td><td>The missing alkali metals (Inspired by noblegas.js and halogen.js)</td><td>Cube14yt</td><tr>
|
||||
<tr><td>aScientistsWish.js</td><td>Several things related to science and physics</td><td>Carbon Monoxide, salmonfishy</td></tr>
|
||||
<tr><td>bettermetalscrap.js</td><td>Metal scrap can be melted back into its original material</td><td>nousernamefound</td></tr>
|
||||
<tr><td>bigger_star_spawners.js</td><td>Spawners for larger stars</td><td>Alice</td></tr>
|
||||
<tr><td>biology.js</td><td>Various elements and features that let you build your own organism</td><td>Nekonico</td></tr>
|
||||
<tr><td>bioooze_and_pyrogens.js</td><td>Bio-Ooze from <a herf="https://frackinuniverse.miraheze.org/wiki/Main_Page">Frackin' Universe</a> and several heat-producing materials from various games' mods</td><td>Alice</td></tr>
|
||||
<tr><td>biology.js</td><td>Various elements and features for building large organisms</td><td>Nekonico</td></tr>
|
||||
<tr><td>bioooze_and_pyrogens.js</td><td>Bio-Ooze from <a href="https://frackinuniverse.miraheze.org/wiki/Main_Page" target="_blank">Frackin' Universe</a> and several heat-producing materials from various games' mods</td><td>Alice</td></tr>
|
||||
<tr><td>boiling_things.js</td><td>Various elements can be vaporized</td><td>Alice</td></tr>
|
||||
<tr><td>bouncing_balls.js</td><td>New types of balls that bounce accurately and roll</td><td>Nekonico</td></tr>
|
||||
<tr><td>chalcopyrite.js</td><td>The chalcopyrite ore</td><td>Sophie</td></tr>
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
<tr><td>fire_mod.js</td><td>Various properties to change fire behavior and radioactive fire</td><td>Alice</td></tr>
|
||||
<tr><td>fire_slime.js</td><td>Pyrogenic version of slime</td><td>Alice</td></tr>
|
||||
<tr><td>Gemstones.js</td><td>Gemstones</td><td>Schweeny</td></tr>
|
||||
<tr><td>glenn_gases.js</td><td>Most gases from the <a href="https://www.jamieswhiteshirt.com/minecraft/mods/gases/">Glenn's Gases</a> mod into Sandboxels</td><td>Alice</td></tr>
|
||||
<tr><td>glenn_gases.js</td><td>Most gases from the <a href="https://www.jamieswhiteshirt.com/minecraft/mods/gases/" target="_blank">Glenn's Gases</a> mod into Sandboxels</td><td>Alice</td></tr>
|
||||
<tr><td>grav_mudstones.js</td><td>Various forms of mudstone with different gravities</td><td>Alice</td></tr>
|
||||
<tr><td>halogen.js</td><td>The missing halogens</td><td>nousernamefound</td></tr>
|
||||
<tr><td>hidden_ground.js</td><td>Hides most rock variants from the_ground.js excluding the base rocks and walls</td><td>Melecie</td></tr>
|
||||
|
|
@ -233,8 +233,8 @@
|
|||
<tr><td>mars.js</td><td>Martian materials</td><td>charcoal_afterlife</td></tr>
|
||||
<tr><td>metals.js</td><td>Several metals</td><td>Alice</td></tr>
|
||||
<tr><td>mixture.js</td><td>Many chemicals can be mixed</td><td>lllllllllwith10ls</td></tr>
|
||||
<tr><td>more_gold.js</td><td>Green Gold</td><td>pixelegend4</td></tr>
|
||||
<tr><td>morechemistry.js</td><td>New chemicals, compounds, and machines</td><td>Adora</td></tr>
|
||||
<tr><td>more_gold.js</td><td>Green and Black Gold</td><td>pixelegend4</td></tr>
|
||||
<tr><td>morechemistry.js</td><td>New chemicals, compounds, and machines</td><td>Orchid</td></tr>
|
||||
<tr><td>moreliquids.js</td><td>Various liquids</td><td>te-agma-at</td></tr>
|
||||
<tr><td>neutronium_compressor.js</td><td>Compressor from Minecraft's Avaritia mod that compresses 10,000 pixels of an element into a singularity</td><td>Alice</td></tr>
|
||||
<tr><td>noblegas.js</td><td>The missing noble gases</td><td>nousernamefound</td></tr>
|
||||
|
|
@ -253,6 +253,7 @@
|
|||
<tr><td>colored_lightbulbs.js</td><td>Light bulb that can be painted</td><td>guzzo86, ggod</td></tr>
|
||||
<tr><td>combustion.js</td><td>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>datawire.js</td><td>Wire that transfers data and other operators and machines for it</td><td>Orchid</td></tr>
|
||||
<tr><td>drill.js</td><td>Drills made out of several materials</td><td>Suss</td></tr>
|
||||
<tr><td>ExtraMachines.js</td><td>Sensors, energy resources, materials, and more</td><td>Mecoolnotcool</td></tr>
|
||||
<tr><td>fans.js</td><td>Fans</td><td>Cube14yt</td></tr>
|
||||
|
|
@ -271,6 +272,7 @@
|
|||
<tr><td>pushers.js</td><td>Pixels that push elements away from them</td><td>Alice</td></tr>
|
||||
<tr><td>sandboxels.js</td><td>Digital screen to play a mini version of Sandboxels</td><td>Nekonico</td></tr>
|
||||
<tr><td>schematics.js</td><td>Schematics for logic gates</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>spouts.js</td><td>Spouts for all liquids</td><td>kaeud</td></tr>
|
||||
<tr><td>state_voids.js</td><td>Several elements that delete specific states of matter</td><td>Alice</td></tr>
|
||||
<tr><td>switches.js</td><td>Electrical switches that can be toggled</td><td>Alice</td></tr>
|
||||
|
|
@ -292,7 +294,8 @@
|
|||
<tr><td>meat_rockets.js</td><td>Rockets that create meat when exploding</td><td>Melecie</td></tr>
|
||||
<tr><td>more_breaking.js</td><td>More elements can be broken</td><td>Alice</td></tr>
|
||||
<tr><td>rays.js</td><td>More Ray types</td><td>Alice</td></tr>
|
||||
<tr><td>rays++.js</td><td>Couple more rays</td><td>uptzik</td></tr>
|
||||
<tr><td>rays++.js</td><td>A couple more rays</td><td>uptzik</td></tr>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>subspace.js</td><td>The Subspace Tripmine from Roblox</td><td>nousernamefound</td></tr>
|
||||
<tr><td>war_crimes.js</td><td>Tear gas and more</td><td>voidapex11</td></tr>
|
||||
<tr><td>weapons.js</td><td>Variety of different weapons</td><td>Jayd</td></tr>
|
||||
|
|
@ -351,8 +354,9 @@
|
|||
<tr><td>ocean.js</td><td>Marine life</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>ores.js</td><td>Ore generation along with tools to mine them</td><td>nousernamefound</td></tr>
|
||||
<tr><td>petal_dye.js</td><td>Boil petals to make dye</td><td>Suss</td></tr>
|
||||
<tr><td>plants.js</td><td>Wide variety of new plants and fruits</td><td>Adora</td></tr>
|
||||
<tr><td>plants.js</td><td>Wide variety of new plants and fruits</td><td>Orchid</td></tr>
|
||||
<tr><td>primordial_birthpool.js</td><td>Cross between Primordial Soup and Birthpool. Requires fey_and_more.js</td><td>Alice</td></tr>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>spring.js</td><td>Many nature elements, like sakura trees, butterflies, beehives, and more</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
<tr><td>the_ground_og.js</td><td>Simplified and more stable version of the_ground.js</td><td>Alice</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
|
|
@ -360,14 +364,15 @@
|
|||
<tr><td>volcanic_expansion.js</td><td>Obsidian, Pumice, and Andesite rocks</td><td>Jayd</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
|
||||
<tr><td>3pms_mod.js</td><td>Adds random stuff and tools</td><td>3pm</td></tr>
|
||||
<tr><td>10kelements.js</td><td>Customizable amount of randomly generated elements</td><td>nousernamefound</td></tr>
|
||||
<tr><td>all_around_fillers.js</td><td>Directional Filler variants</td><td>idk73248</td></tr>
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Adora</td></tr>
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Orchid</td></tr>
|
||||
<tr><td>amogus.js</td><td>Small Among Us structure</td><td>Alice</td></tr>
|
||||
<tr><td>bfdi.js</td><td>Several references to Battle for Dream Island</td><td>Taterbob</td></tr>
|
||||
<tr><td>citybuilding.js</td><td>Seeds that create miniature buildings and other city-related items</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>collab_mod.js</td><td>Created by multiple people, adds random things</td><td>mrapple, ilikepizza, stefanblox</td></tr>
|
||||
<tr><td>cubesstuff.js</td><td>Some random stuff like disco ball, pyrite, and nordic gold.</td><td>Cube14yt</td></tr>
|
||||
<tr><td>cubesstuff.js</td><td>Some random stuff like Disco Ball, Pyrite, and Nordic Gold</td><td>Cube14yt</td></tr>
|
||||
<tr><td>doom.js</td><td>As seen on TikTok - Select the Doom element to start [WASD to move]</td><td>ggod</td></tr>
|
||||
<tr><td>elem3.js</td><td>All elements and combinations from Elemental 3 [Very Large]</td><td>Sophie</td></tr>
|
||||
<tr><td>explosionsound.js</td><td>Sound effects for explosions</td><td>nousernamefound</td></tr>
|
||||
|
|
@ -392,6 +397,7 @@
|
|||
<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>Silly elements from a <a href="https://R74n.com/mix/" target="_blank">Mix-Up!</a> game</td><td>stefanblox</td>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>sports_beta.js</td><td>Several sports items</td><td>BluBun5193</td></tr>
|
||||
<tr><td>star_wars.js</td><td>Various items from Star Wars by Disney</td><td>SeaPickle754</td>
|
||||
<tr><td>sus.js</td><td>Among Us crewmate</td><td>Nv7</td></tr>
|
||||
|
|
@ -415,7 +421,7 @@
|
|||
<tr><td>invisible_wall.js</td><td>Element like Wall that takes the color of the background</td><td>Alice</td></tr>
|
||||
<tr><td>lightmap.js</td><td>Light sources glow</td><td>RedBirdly</td></tr>
|
||||
<tr><td>liquid_mixing.js</td><td>Liquids can mix colors dynamically</td><td>Nekonico</td></tr>
|
||||
<tr><td>manyMoreThemes.js</td><td>Adds additional themes</td><td>Jayd</td></tr>
|
||||
<tr><td>manyMoreThemes.js</td><td>Additional themes</td><td>Jayd</td></tr>
|
||||
<tr><td>moreViews.js</td><td>Many new rendering modes</td><td>ggod</td></tr>
|
||||
<tr><td>nicer_flame.js</td><td>Fire is visually pleasing</td><td>RedBirdly</td></tr>
|
||||
<tr><td>occlusion.js</td><td>Realistic shadows, similar to Terraria's lighting</td><td>RedBirdly</td></tr>
|
||||
|
|
@ -443,7 +449,7 @@
|
|||
<tr><td>changeTempReactionParameter.js</td><td>The changeTemp property to modded reactions</td><td>Alice</td></tr>
|
||||
<tr><td>code_library.js</td><td>Functions and variables common to some other mods</td><td>Alice</td></tr>
|
||||
<tr><td>controllable_pixel_test.js</td><td>Pixel that can be controlled with the keyboard keys <a href="https://github.com/R74nCom/sandboxels/commit/58dfa9477f2ed7ec9c44b00a35162e7c63bc129c">[More Info]</a> [PC ONLY]</td><td>Alice</td></tr>
|
||||
<tr><td>customexplosion.js</td><td>Added a custom explosion element and interface for it. check out its <a href="https://sandboxels-mods.the-enchanteden.repl.co/Mods/customexplosion.js">source code</a> for how modders can use it</td><td>Alex</td></tr>
|
||||
<tr><td>customexplosion.js</td><td>Custom explosion element and interface for it</td><td>Orchid</td></tr>
|
||||
<tr><td>date_test.js</td><td>K-pop idol birthday testing stuff</td><td>Alice</td></tr>
|
||||
<tr><td>drawPixels_change_test.js</td><td>Test of altering drawPixels(). Gives burning pixels a red overlay similar to the yellow overlay for charged pixels</td><td>Alice</td></tr>
|
||||
<tr><td>example_mod.js</td><td>Example mod for new modders</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
|
|
@ -458,7 +464,9 @@
|
|||
<tr><td>modlangs.js</td><td>Customisable property in an element to allow for translations in mods. See the file for instructions on how to implement</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>nested_for_reaction_example.js</td><td>Example of using a nested for loop to add reactions. It makes various things kill plants</td><td>Alice</td></tr>
|
||||
<tr><td>nv7.js</td><td>Giant Nv7 image [Large]</td><td>Nv7</td></tr>
|
||||
<tr><td>orchidslibrary.js</td><td>Library used by morechemistry.js, plants.js, and datawire.js</td><td>Orchid</td></tr>
|
||||
<tr><td>place_all_elements.js</td><td>Experimental function that places every pixel</td><td>Alice</td></tr>
|
||||
<tr><td>PRNGworldgenlib.js</td><td>World generation library with seeded randomness</td><td>Orchid</td></tr>
|
||||
<tr><td>randomness_but_tick.js</td><td>Random experimental elements using the tick function feature</td><td>Alice</td></tr>
|
||||
<tr><td>randomness_but_tool.js</td><td>Random experimental elements using the tool function feature</td><td>Alice</td></tr>
|
||||
<tr><td>randomness.js</td><td>Random experimental elements</td><td>Alice</td></tr>
|
||||
|
|
@ -467,8 +475,8 @@
|
|||
<tr><td>structure_test.js</td><td>Test for implementing structures into Sandboxels</td><td>Alice</td></tr>
|
||||
<tr><td>test.js</td><td>Test that adds mayo :)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
<tr><td>tool_pixel_behavior.js</td><td>Gives unique behaviors to tools if placed with cheats</td><td>Alice</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Adora</td></tr>
|
||||
<tr><td>worldgen_test.js</td><td>Element that generates a save with a grass layer, dirt layer, rock layer, and a pond</td><td>Alice</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Orchid</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Broken or Deprecated</td></tr><!---->
|
||||
<tr class="deprecated"><td>a_mod_by_alice.js</td><td>Combination of most of Alice's mods, and some other things</td><td>Alice</td></tr>
|
||||
|
|
@ -501,7 +509,8 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8485284630785740"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-93720349-9"></script>
|
||||
|
|
|
|||
123
mods/3pms_mod.js
123
mods/3pms_mod.js
|
|
@ -1,43 +1,37 @@
|
|||
// mod moment
|
||||
// also made by 3pm
|
||||
// made by 3pm
|
||||
|
||||
// starting the initiation
|
||||
version = "0.0.1"
|
||||
subversion = "0.0.12"
|
||||
versionname = "Gullible On The Ceilling"
|
||||
version = "0.0.2"
|
||||
subversion = "0.0.21"
|
||||
versionname = "Let's take a look..."
|
||||
|
||||
console.log("3pms_mod.js " + version + " \"" + versionname + "\"")
|
||||
console.log("3pms_mod.js | Initiating...")
|
||||
|
||||
// bypassing the tps limit
|
||||
// nvm this is useless
|
||||
// whatever im keeping it
|
||||
|
||||
setTimeout(() => {
|
||||
const tpsbutton = document.getElementById("tpsButton");
|
||||
tpsbutton.onclick = () => {
|
||||
var tpsprompt = prompt(
|
||||
"Enter the new simulation Ticks Per Second (TPS). This is how many updates per second the simulation will run.\n\n" +
|
||||
"The default is 30.\n\nThe current TPS is " + tps + ".\n\nNOTE: 3pms_mod.js removes the TPS limit.\n" +
|
||||
"Any TPS higher than 1000 isn\'t recommended.\n\n"
|
||||
);
|
||||
|
||||
var newtps = parseInt(tpsprompt);
|
||||
if (tpsprompt !== null) {
|
||||
if (isNaN(newtps) || newtps == "") {
|
||||
alert("You did not enter a valid TPS.");
|
||||
} else {
|
||||
tps = parseInt(newtps);
|
||||
if (isNaN(tps) || tps <= 0) {
|
||||
alert("You did not enter a valid TPS.");
|
||||
tps = 30;
|
||||
function tpsPrompt() {
|
||||
promptInput("Enter the new simulation Ticks Per Second (TPS). This is how many updates per second the simulation will run.\n\nThe default is 30.\n\nThe current TPS is " + tps + ".\n\nNOTE: 3pms_mod.js removes the TPS limit.\nAny TPS higher than 1000 isn't recommended.\n\n",
|
||||
(r) => {
|
||||
var newtps = parseInt(r);
|
||||
if (r !== null) {
|
||||
if (isNaN(newtps) || newtps == "") logMessage("You did not enter a valid TPS.");
|
||||
else {
|
||||
newtps = parseInt(newtps);
|
||||
if (isNaN(newtps) || newtps <= 0) {
|
||||
logMessage("You did not enter a valid TPS.");
|
||||
}
|
||||
else {
|
||||
tps = newtps;
|
||||
delete currentSaveData.oldTps;
|
||||
}
|
||||
}
|
||||
resetInterval(tps);
|
||||
}
|
||||
focusGame();
|
||||
};
|
||||
}, 1000);
|
||||
},
|
||||
"Change TPS"
|
||||
)
|
||||
}
|
||||
|
||||
// more settings
|
||||
|
||||
|
|
@ -60,7 +54,7 @@ setTimeout(() => {
|
|||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
const menuText = document.getElementsByClassName("menuText")[6]
|
||||
const menuText = document.getElementsByClassName("menuText")[9]
|
||||
const newButton = document.createElement("button")
|
||||
newButton.innerText = "More Settings"
|
||||
newButton.className = "settingsButton"
|
||||
|
|
@ -73,7 +67,7 @@ setTimeout(() => {
|
|||
|
||||
// elements
|
||||
|
||||
elements.calcium_oxide = { // most of this is taken off calcium
|
||||
elements.calcium_oxide = {
|
||||
color: ["#544E45","#6A635E","#6E6A61","#756F62","#918A7B"],
|
||||
tick: function(pixel) {
|
||||
behaviors.POWDER(pixel);
|
||||
|
|
@ -95,39 +89,56 @@ elements.calcium_oxide = { // most of this is taken off calcium
|
|||
fireColor: "#ff6b21"
|
||||
}
|
||||
|
||||
elements.eeraser = { // finally integrating it after over a year
|
||||
elements.eeraser = {
|
||||
color: "#FFFF00",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorON: [
|
||||
"DL|DL|DL",
|
||||
"DL|DL|DL",
|
||||
behaviorOn: [
|
||||
"DL|XX|DL",
|
||||
"DL|XX|DL",
|
||||
"DL|DL|DL",
|
||||
],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
conduct: 0.5,
|
||||
category: "machines",
|
||||
insulate: elements.wire.insulate,
|
||||
conduct: elements.wire.conduct,
|
||||
noMix: elements.wire.noMix
|
||||
state: "solid",
|
||||
};
|
||||
|
||||
// stopping the initiation
|
||||
// tools
|
||||
elements.replace_all_of_element = {
|
||||
color: ["#ff3030", "#800000"],
|
||||
name: "replace all of element",
|
||||
onSelect: async function() {
|
||||
promptInput(
|
||||
"Enter the element to be replaced.",
|
||||
(r) => {
|
||||
if (r in elements) {
|
||||
elements.replace_all_of_element.tool = function(pixel) {
|
||||
elementbefore = pixel.element
|
||||
for (var i = 0; i <= width; i++) {
|
||||
for (var j = 0; j <= height; j++) {
|
||||
if (!isEmpty(i,j,true)) {
|
||||
if(pixelMap[i][j].element == elementbefore) {
|
||||
changePixel(pixelMap[i][j], r)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logMessage("You did not enter an existing element.");
|
||||
}
|
||||
},
|
||||
"3pms_mod.js"
|
||||
);
|
||||
},
|
||||
category: "tools",
|
||||
};
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("3pms_mod.js | Initiated. Thank you.")
|
||||
}, 1000);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const thing=document.createElement("p");thing.innerText="MY NAME 📛 IS DAVID 👨🎤 DAD 👨👩👧👦👨👩👧👧 I ℹ️ WANT SOME ICE 🧊🇦🇶 CREAM 🧴🧴 DAVID 👨🎤 THAT IS MY NAME 📛 DAVID 👨🎤👨🎤 I ℹ️ WANT ANOTHER WHERE ❔❓ IS MY BALL 🏈🏈 I’M RUNNING 🏃♂️🏃♀️ OUT ON 🔛 THE ROAD 🚧 THERE IS A 🅰️ CAR 🚔🚖 AND IT IS GOING TO HIT 👊 ME 🖐🙋♀️ HEEEEEEEEELP HELP 💁 MEEEEEEE HEEEEEEEEEEEEEEEEELP\n\nthanks for using 3pms_mod.js :3";document.body.appendChild(thing)
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
/*Version 1.0.0 Pseudorandom world generator*/
|
||||
function pseudorandom(key, max = 10){
|
||||
let num = max;
|
||||
for(let i = 0; i < key; i++){
|
||||
num = ((num+(max*0.6))**1.8312312-2) % (max+1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
eLists.STONEELEMS = ["rock", "gravel", "tuff", "basalt", "rock_wall"];
|
||||
let oreChances = {
|
||||
diamond: 0.045,
|
||||
gold: 0.1,
|
||||
silver: 0.2,
|
||||
tungsten: 0.3,
|
||||
iron: 0.4,
|
||||
copper: 0.6,
|
||||
charcoal: 0.8,
|
||||
uranium: 0.805,
|
||||
aluminum: 1
|
||||
}
|
||||
class biome {
|
||||
constructor(layersArr, yLevels, properties, afterFunc = false){
|
||||
this.layers = layersArr;
|
||||
this.yLevels = yLevels;
|
||||
this.vMulti = 1;
|
||||
for(let item in properties){
|
||||
this[item] = properties[item];
|
||||
}
|
||||
this.generate = function(seed){
|
||||
autoResizeCanvas();
|
||||
if(!paused){togglePause();}
|
||||
let fraction = seed/(2**32);
|
||||
for(let level of this.yLevels){
|
||||
for(let x = 0; x <= width; x++){
|
||||
let heightIncrease = (fraction < 0.5) ? -3*(pseudorandom(((1-fraction)*x)*100)/11) : 3*(pseudorandom((fraction*x)*100)/11);
|
||||
let h = level + heightIncrease;
|
||||
for(let y = 0; y <= h; y++){
|
||||
let elementsArr = this.layers[this.yLevels.indexOf(level)];
|
||||
let elem = elementsArr[Math.floor(((fraction < 0.5) ? elementsArr.length*pseudorandom(((1-fraction)*((x*y)*13))/11) : elementsArr.length*(pseudorandom((fraction*(x*y*17)))/11))%elementsArr.length)];
|
||||
let placed = tryCreate(elem, x, height-y);
|
||||
if(placed != null && this.temp != null){
|
||||
placed.temp = this.temp;
|
||||
}
|
||||
if(elem == "sapling" && placed){
|
||||
if(this.wc != null){
|
||||
if(Array.isArray(this.wc)){
|
||||
let c = this.wc[Math.round(Math.random()*this.wc.length)];
|
||||
while(c == undefined){
|
||||
c = this.wc[Math.round(Math.random()*this.wc.length)];
|
||||
}
|
||||
placed.wc = c;
|
||||
} else {
|
||||
placed.wc = this.wc;
|
||||
}
|
||||
}
|
||||
if(this.lc != null){
|
||||
if(Array.isArray(this.lc)){
|
||||
let c = this.lc[Math.round(Math.random()*this.lc.length)];
|
||||
while(c == undefined){
|
||||
c = this.lc[Math.round(Math.random()*this.lc.length)];
|
||||
}
|
||||
placed.lc = c;
|
||||
} else {
|
||||
placed.lc = this.lc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.generateOreVeins(seed, this.vMulti);
|
||||
};
|
||||
}
|
||||
|
||||
generateOreVeins(seed, multi = 1){
|
||||
for(let x = 0; x <= width; x++){
|
||||
for(let y = 0; y <= height; y++){
|
||||
let c = pseudorandom((seed/2**32)*x*y)/11;
|
||||
if(c <= 0.3){
|
||||
let c2 = pseudorandom((seed/2**32)*(x*y)*3)/11;
|
||||
let ore;
|
||||
for(let e in oreChances){
|
||||
if(c2 <= oreChances[e]){
|
||||
ore = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let p = getPixel(x,y);
|
||||
if(p != null && eLists.STONEELEMS.includes(p.element)){
|
||||
tryCreate(ore, x, y, true);
|
||||
let a = true;
|
||||
let x2 = x, y2 = y;
|
||||
while(a){
|
||||
let hasStone = false;
|
||||
for(let coords of squareCoords){
|
||||
x2 += coords[0];
|
||||
y2 += coords[1];
|
||||
let p2 = getPixel(x2,y2);
|
||||
if(p2 != null && eLists.STONEELEMS.includes(p2.element) && (pseudorandom((seed/2**32)*x2*y2)/11) < (0.35*multi)){
|
||||
hasStone = true;
|
||||
tryCreate(ore, x2, y2, true);
|
||||
}
|
||||
if((pseudorandom((seed/2**32)*(x2*y2)*8)/11) < 0.15){
|
||||
a = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
a = (hasStone) ? a : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.afterFunc != null){
|
||||
this.afterFunc(seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
let biomes = {
|
||||
plains: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "dirt", "dirt", "mud", "gravel"], ["grass","flower_seed","grass","grass","grass","grass","sapling","grass","grass","grass","grass","grass","grass","grass","grass"]], [25, 38, 40]),
|
||||
desert: new biome([["rock", "rock", "rock", "gravel"], ["rock", "packed_sand","rock", "packed_sand", "sand"], ["sand"], [null, null, null, null, null, null, null, null, null, "cactus"]], [17, 26, 40, 42]),
|
||||
savanna: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "clay_soil", "dirt", "dirt"], ["grass",null,null, null, null, null, "sapling",null,null,null,null]], [25, 38, 40], {lc: ["#6fde26", "#8eed34", "#8cdb42", "#7bd12a", "#96e81c", "#a9e64e", "#a0d94c", "#a9d63e"], wc: ["#bdab7e", "#b09c6a", "#ab996d", "#998a63", "#917959", "#877051"]}),
|
||||
tundra: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "rock", "permafrost"], ["permafrost", "permafrost", "permafrost", "permafrost", "permafrost", "permafrost", "ice", "snow"], [null,null,null,null,null,"pinecone",null,null,null,null,null,null]], [25, 30, 38, 40], {temp: -15}),
|
||||
}
|
||||
let seed = Math.random()*(2**32);
|
||||
enabledMods.forEach((item)=>{
|
||||
if(item.includes("plants.js")){
|
||||
biomes.orchard = new biome([["rock","rock","rock","gravel"], ["dirt", "dirt", "dirt", "rock", "gravel"], ["dirt", "dirt", "dirt", "dirt", "mud", "clay_soil", "gravel"]], [25, 30, 38], {afterFunc: (seed)=>{
|
||||
for(let i = 0; i < width; i++){
|
||||
console.log(i, width);
|
||||
let elem = ((pseudorandom((seed/2**32)*i)/11) < 0.15) ? plants.tree[(Math.round(Math.random()*plants.tree.length)) % plants.tree.length] : "grass";
|
||||
if(elem != undefined && elem != "grass"){elem += "_seed"};
|
||||
elem = (elem == undefined) ? "apple_seed" : elem;
|
||||
tryCreate(elem, i, 42);
|
||||
}
|
||||
}});
|
||||
}
|
||||
});
|
||||
elements.PRNGgenerate = {
|
||||
category: "tools",
|
||||
onSelect: function(){
|
||||
let arr = [];
|
||||
Object.keys(biomes).forEach(function(b){arr.push(b);})
|
||||
promptInput("Leave blank to generate new seed. Your current seed is: " + seed, function(i){
|
||||
seed = parseInt(i) || Math.random()*(2**32);
|
||||
seed = seed % (2**32);
|
||||
promptChoose("", arr, (choice)=>{
|
||||
biomes[choice].generate(seed);
|
||||
promptText("World generation complete.");
|
||||
selectElement('dirt');
|
||||
}, "Select a biome to generate: ");
|
||||
}, "Enter seed:");
|
||||
}
|
||||
}
|
||||
elements.view_seed = {
|
||||
category: "tools",
|
||||
onSelect: function(){
|
||||
alert(seed);
|
||||
selectElement("dirt");
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
// https://github.com/SquareScreamYT/
|
||||
// https://youtube.com/@sqec
|
||||
|
||||
version = "v2.1.0"
|
||||
version = "v2.1.1"
|
||||
|
||||
runAfterLoad(function() {
|
||||
console.log("Current aChefsDream version: "+version)
|
||||
|
|
@ -595,4 +595,147 @@ elements.pistachio_powder = {
|
|||
hidden: true
|
||||
}
|
||||
|
||||
elements.pumpkin_mash = {
|
||||
color: ["#f59c2f", "#efa810", "#e38f1a"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 125,
|
||||
stateHigh: ["pumpkin_spice","pumpkin_spice","smoke"],
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
density: 500,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
elements.pumpkin.breakInto = ["pumpkin_seed", "pumpkin_mash", "pumpkin_mash", "pumpkin_mash", "pumpkin_mash", null];
|
||||
|
||||
elements.pumpkin_spice = {
|
||||
color: ["#95570b", "#ba7f36"],
|
||||
behavior: behaviors.POWDER,
|
||||
tempHigh: 400,
|
||||
stateHigh: ["smoke","smoke","smoke","smoke","ash"],
|
||||
category: "food",
|
||||
state: "solid",
|
||||
density: 500,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
elements.cinnamon_powder.reactions.nutmeg_powder = { elem1: "pumpkin_spice", elem2: null, chance: 0.5 };
|
||||
|
||||
elements.coffee.reactions.pumpkin_mash = { elem2: null, color1: "#7e3c09", chance: 0.005 };
|
||||
elements.coffee.reactions.pumpkin_spice = { elem2: null, color1: "#7e3c09", chance: 0.005 };
|
||||
|
||||
elements.nutmeg_tree = {
|
||||
color: "#6B4226",
|
||||
behavior: behaviors.WALL,
|
||||
tempHigh: 400,
|
||||
stateHigh: ["ember", "charcoal", "fire"],
|
||||
category: "solids",
|
||||
burn: 5,
|
||||
burnTime: 300,
|
||||
burnInto: ["ember", "charcoal", "fire"],
|
||||
state: "solid",
|
||||
hardness: 0.2,
|
||||
breakInto: "sawdust",
|
||||
hidden: true
|
||||
};
|
||||
|
||||
elements.nutmeg_branch = {
|
||||
color: "#5c3b23",
|
||||
behavior: [
|
||||
"CR:nutmeg_leaves,nutmeg_branch%2|CR:nutmeg_leaves,nutmeg_branch%2|CR:nutmeg_leaves,nutmeg_branch%2",
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
tempHigh: 100,
|
||||
stateHigh: "nutmeg_tree",
|
||||
tempLow: -30,
|
||||
stateLow: "nutmeg_tree",
|
||||
category: "life",
|
||||
burn: 30,
|
||||
burnTime: 60,
|
||||
burnInto: ["sap", "ember"],
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 1400,
|
||||
breakInto: ["sap", "sawdust"]
|
||||
};
|
||||
|
||||
elements.nutmeg_leaves = {
|
||||
color: ["#4b7d3d", "#558c40"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|CR:nutmeg_fruit%0.1|XX",
|
||||
],
|
||||
reactions: {
|
||||
"vinegar": { elem1: "dead_plant", chance: 0.035 },
|
||||
"baking_soda": { elem1: "dead_plant", chance: 0.01 },
|
||||
"bleach": { elem1: "dead_plant", chance: 0.05 },
|
||||
"alcohol": { elem1: "dead_plant", chance: 0.035 },
|
||||
},
|
||||
category: "life",
|
||||
tempHigh: 90,
|
||||
stateHigh: "dead_plant",
|
||||
tempLow: -1.5,
|
||||
stateLow: "frozen_plant",
|
||||
burn: 60,
|
||||
burnTime: 60,
|
||||
burnInto: "dead_plant",
|
||||
state: "solid",
|
||||
density: 1050,
|
||||
hidden: true
|
||||
};
|
||||
|
||||
elements.nutmeg_fruit = {
|
||||
color: ["#c0a25d", "#ddb86c"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
tempHigh: 100,
|
||||
stateHigh: "dead_plant",
|
||||
burn: 60,
|
||||
burnTime: 60,
|
||||
cutInto: ["mace", "nutmeg", "nutmeg"],
|
||||
breakInto: ["mace", "nutmeg", "nutmeg"],
|
||||
state: "solid",
|
||||
density: 1050
|
||||
};
|
||||
|
||||
elements.mace = {
|
||||
color: ["#e04e1b", "#cc3614"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
tempHigh: 250,
|
||||
stateHigh: ["ash", "smoke"],
|
||||
isFood: true,
|
||||
state: "solid",
|
||||
density: 900,
|
||||
hidden: false
|
||||
};
|
||||
|
||||
elements.nutmeg = {
|
||||
color: ["#8b5a2b", "#A0522D"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
tempHigh: 250,
|
||||
stateHigh: ["ash", "smoke"],
|
||||
isFood: true,
|
||||
state: "solid",
|
||||
density: 1000,
|
||||
breakInto: "nutmeg_powder",
|
||||
};
|
||||
|
||||
elements.nutmeg_powder = {
|
||||
color: "#C58940",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
tempHigh: 250,
|
||||
stateHigh: ["ash", "smoke"],
|
||||
isFood: true,
|
||||
state: "solid",
|
||||
density: 950,
|
||||
hidden: false
|
||||
};
|
||||
|
||||
},true)
|
||||
|
|
@ -0,0 +1,394 @@
|
|||
async function _modprompt(message, defaultValue = "") { // thanks to ggod for this prompt function. Taken from nousersthings.js
|
||||
return new Promise(resolve => {
|
||||
promptInput(message, (result) => {
|
||||
resolve(result);
|
||||
}, "bf.js is asking you...", defaultValue);
|
||||
})
|
||||
}
|
||||
|
||||
class Interpreter {
|
||||
constructor() {
|
||||
this.map = new Array(64).fill(0)
|
||||
this.index = 0
|
||||
this.ci = 0
|
||||
this.loops = []
|
||||
this.code = ""
|
||||
this.tsay = ""
|
||||
}
|
||||
|
||||
async run(px, code = this.code) {
|
||||
this.ci = 0
|
||||
while (this.ci < code.length) {
|
||||
const token = code[this.ci]
|
||||
|
||||
switch (token) {
|
||||
case ">":
|
||||
if (this.index + 1 == this.map.length) {
|
||||
this.map.push(0)
|
||||
}
|
||||
this.index++
|
||||
break
|
||||
|
||||
case "<":
|
||||
if (this.index - 1 != -1) {
|
||||
this.index--
|
||||
}
|
||||
break
|
||||
|
||||
case "+":
|
||||
this.map[this.index]++
|
||||
break
|
||||
|
||||
case "-":
|
||||
this.map[this.index]--
|
||||
break
|
||||
|
||||
case ".":
|
||||
this.tsay += String.fromCharCode(this.map[this.index])
|
||||
break
|
||||
|
||||
case "!":
|
||||
promptText(this.tsay, () => { }, "bf.js")
|
||||
break
|
||||
|
||||
case "/":
|
||||
this.tsay = ""
|
||||
break
|
||||
|
||||
case ",":
|
||||
const ans = await _modprompt("")
|
||||
if (ans.trim().length > 0) {
|
||||
this.map[this.index] = ans[0].charCodeAt(0)
|
||||
}
|
||||
break
|
||||
|
||||
case "[":
|
||||
if (this.map[this.index] === 0) {
|
||||
let open = 1
|
||||
while (open > 0) {
|
||||
this.ci++
|
||||
if (code[this.ci] === "[") open++
|
||||
else if (code[this.ci] === "]") open--
|
||||
}
|
||||
} else {
|
||||
this.loops.push(this.ci)
|
||||
}
|
||||
break
|
||||
|
||||
case "]":
|
||||
if (this.map[this.index] !== 0) {
|
||||
this.ci = this.loops[this.loops.length - 1]
|
||||
} else {
|
||||
this.loops.pop()
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.ci++
|
||||
}
|
||||
|
||||
px.running = false
|
||||
}
|
||||
}
|
||||
|
||||
class RemoteBase {
|
||||
constructor(base) {
|
||||
this.base = base
|
||||
this.code = ""
|
||||
}
|
||||
|
||||
run() {
|
||||
pixelMap[this.base[0]][this.base[1]].interpreter.run(pixelMap[this.base[0]][this.base[1]], this.code)
|
||||
this.code = ""
|
||||
}
|
||||
|
||||
getMap() {
|
||||
return pixelMap[this.base[0]][this.base[1]].interpreter.map
|
||||
}
|
||||
}
|
||||
|
||||
const bftokens = {
|
||||
bf_base: "#00ff00",
|
||||
bf_remote_base: "#008600",
|
||||
">": "#ff7f00",
|
||||
"<": "#ff00ff",
|
||||
"+": "#00ffff",
|
||||
"-": "#800080",
|
||||
"[": "#ff1493",
|
||||
"]": "#1e90ff",
|
||||
".": "#ffd700",
|
||||
",": "#ff4500",
|
||||
"!": "#ff69b4",
|
||||
"split": "#565656",
|
||||
"act": "#ffc400",
|
||||
"bf_gate": "#ffc400",
|
||||
}
|
||||
const bftokenslist = Object.keys(bftokens)
|
||||
|
||||
elements.bf_base = {
|
||||
category: "bf",
|
||||
color: "#00ff00",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.act = false
|
||||
px.interpreter = new Interpreter()
|
||||
px.base = [px.x, px.y]
|
||||
px.running = false
|
||||
}
|
||||
|
||||
if (!(px.interpreter instanceof Interpreter)) {
|
||||
px.interpreter = new Interpreter()
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
let remotebase1 = undefined
|
||||
let bfreader = undefined
|
||||
let bfreader2 = undefined
|
||||
|
||||
elements.bf_remote_base = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
onSelect: async function () {
|
||||
var bfans1 = await _modprompt("Please input in the coordinates of the desired pixel. When it activates, this activates. (X,Y)", "0,0");
|
||||
if (!bfans1) { return }
|
||||
let [x, y] = bfans1.split(",")
|
||||
remotebase1 = [Number(x), Number(y)]
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.act = false
|
||||
px.interpreter = new RemoteBase(pixelMap[remotebase1[0]][remotebase1[1]].base)
|
||||
px.base = [px.x, px.y]
|
||||
if (!pixelMap[remotebase1[0]][remotebase1[1]].remotes) {
|
||||
pixelMap[remotebase1[0]][remotebase1[1]].remotes = []
|
||||
}
|
||||
pixelMap[remotebase1[0]][remotebase1[1]].remotes.push([px.x, px.y])
|
||||
px.parent = remotebase1
|
||||
px.cd = false
|
||||
}
|
||||
},
|
||||
onDelete: (px) => {
|
||||
if (!isEmpty(px.parent[0], px.parent[1]) && pixelMap[px.parent[0]][px.parent[1]].remotes) {
|
||||
pixelMap[px.parent[0]][px.parent[1]].remotes.filter(a => !(a[0] === px.x && a[1] === px.y))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.reader = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
onSelect: async function () {
|
||||
var bfans2 = await _modprompt("Please input in the desired value to activate when read.", "0");
|
||||
if (!bfans2) { return }
|
||||
bfreader = Number(bfans2)
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.tread = bfreader
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.pointer_reader = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
onSelect: async function () {
|
||||
var bfans3 = await _modprompt("Please input in the desired pointer and value to activate when read. (pointer,value)", "0,0");
|
||||
if (!bfans3) { return }
|
||||
let [x, y] = bfans3.split(",")
|
||||
bfreader2 = [Number(x), Number(y)]
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.tread = bfreader2
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.bf_runner = {
|
||||
category: "bf",
|
||||
color: "#ababab",
|
||||
tool: (px) => {
|
||||
if (px.element == "bf_base" && !px.running) {
|
||||
px.running = true
|
||||
px.act = true
|
||||
px.interpreter.map.fill(0)
|
||||
px.interpreter.code = ""
|
||||
px.interpreter.index = 0
|
||||
px.interpreter.ci = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependOn("logicgates.js", () => {
|
||||
elements.bf_gate = {
|
||||
category: "bf",
|
||||
color: "#ffc400",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
tick: (px) => {
|
||||
if (!px.base) {
|
||||
px.act = false
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0) {
|
||||
if (!isEmpty(px.x - 1, px.y)) {
|
||||
const left = ns[0]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
px.base = left.base
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (px.act) {
|
||||
px.color = "#00ff00"
|
||||
} else {
|
||||
px.color = "#ffc400"
|
||||
}
|
||||
var countNeighborsResult = countNeighbors(pixel)
|
||||
if (countNeighborsResult.charged > 0) {
|
||||
px.can = true
|
||||
} else {
|
||||
px.can = false
|
||||
}
|
||||
|
||||
if (!isEmpty(px.x - 1, px.y)) {
|
||||
const left = pixelMap[px.x - 1][px.y]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
if (left.act && !px.act && px.can) {
|
||||
left.act = false
|
||||
px.act = true
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.code += "g"
|
||||
if (isEmpty(px.x + 1, px.y) || !pixelMap[px.x][px.y].base || (pixelMap[px.x][px.y].element == "bf_gate" && !pixelMap[px.x][px.y].can)) {
|
||||
px.act = false
|
||||
}
|
||||
if (px.remotes) {
|
||||
px.remotes.forEach(remote => {
|
||||
pixelMap[remote[0]][remote[1]].act = true
|
||||
})
|
||||
} else {
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.run(pixelMap[px.base[0]][px.base[1]])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ns = getNeighbors(px)
|
||||
ns.forEach(n => {
|
||||
if (pixelMap[px.base[0]][px.base[1]].interpreter instanceof Interpreter) {
|
||||
if (n.element == "reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[pixelMap[px.base[0]][px.base[1]].interpreter.index] == n.tread) {
|
||||
n.charge = 1
|
||||
} else if (n.element == "pointer_reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[n.tread[0]] == n.tread[1]) {
|
||||
n.charge = 1
|
||||
}
|
||||
} else {
|
||||
if (n.element == "reader" && pixelMap[px.base[0]][px.base[1]].interpreter.getMap()[pixelMap[px.base[0]][px.base[1]].interpreter.index] == n.tread) {
|
||||
n.charge = 1
|
||||
} else if (n.element == "pointer_reader" && pixelMap[px.base[0]][px.base[1]].interpreter.getMap()[n.tread[0]] == n.tread[1]) {
|
||||
n.charge = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (isEmpty(px.x + 1, px.y) || !pixelMap[px.x + 1][px.y].base || (pixelMap[px.x + 1][px.y].element == "bf_gate" && !pixelMap[px.x + 1][px.y].can)) {
|
||||
px.act = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}, true)
|
||||
|
||||
for (let token of bftokenslist) {
|
||||
if (token == "bf_base" || token == "bf_remote_base" || token == "bf_gate") { continue }
|
||||
elements[token] = {
|
||||
category: "bf",
|
||||
color: bftokens[token],
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
tick: (px) => {
|
||||
if (!px.base) {
|
||||
px.act = false
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0) {
|
||||
if (!isEmpty(px.x - 1, px.y)) {
|
||||
const left = ns[0]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
px.base = left.base
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (px.act) {
|
||||
px.color = "#00ff00"
|
||||
} else {
|
||||
px.color = bftokens[token]
|
||||
}
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0 && !isEmpty(px.x - 1, px.y)) {
|
||||
const left = pixelMap[px.x - 1][px.y]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
if (left.act && !px.act) {
|
||||
left.act = false
|
||||
px.act = true
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.code += token
|
||||
if (px.remotes) {
|
||||
px.remotes.forEach(remote => {
|
||||
pixelMap[remote[0]][remote[1]].act = true
|
||||
console.log(pixelMap[remote[0]][remote[1]].act)
|
||||
})
|
||||
} else {
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.run(pixelMap[px.base[0]][px.base[1]])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ns.length >= 2) {
|
||||
ns.forEach(n => {
|
||||
if (pixelMap[px.base[0]][px.base[1]].interpreter instanceof Interpreter) {
|
||||
if (n.element == "reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[pixelMap[px.base[0]][px.base[1]].interpreter.index] == n.tread) {
|
||||
n.charge = 1
|
||||
} else if (n.element == "pointer_reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[n.tread[0]] == n.tread[1]) {
|
||||
n.charge = 1
|
||||
}
|
||||
} else {
|
||||
if (n.element == "reader" && pixelMap[px.base[0]][px.base[1]].interpreter.getMap()[pixelMap[px.base[0]][px.base[1]].interpreter.index] == n.tread) {
|
||||
n.charge = 1
|
||||
} else if (n.element == "pointer_reader" && pixelMap[px.base[0]][px.base[1]].interpreter.getMap()[n.tread[0]] == n.tread[1]) {
|
||||
n.charge = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (isEmpty(px.x + 1, px.y) || !pixelMap[px.x + 1][px.y].base || (pixelMap[px.x + 1][px.y].element == "bf_gate" && !pixelMap[px.x + 1][px.y].can)) {
|
||||
px.act = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.act.conduct = 0.1
|
||||
const oldact = elements.act.tick
|
||||
elements.act.tick = (px) => {
|
||||
oldact(px)
|
||||
|
||||
if (px.charge && !px.act) {
|
||||
px.act = true
|
||||
px.charge = 0
|
||||
} else {
|
||||
px.charge = 0
|
||||
}
|
||||
}
|
||||
965
mods/biology.js
965
mods/biology.js
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,377 @@
|
|||
runAfterLoad(function() {
|
||||
console.log("Thanks for using bojithekings_mod.js! This is 1.0v")
|
||||
})
|
||||
|
||||
elements.ultronium = {
|
||||
color: ["#3a293a", "#77337c"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%20 AND CR:neutron%10|XX",
|
||||
"CR:radiation%20 AND CR:neutron%10|XX|CR:radiation%20 AND CR:neutron%10",
|
||||
"XX|CR:radiation%20 AND CR:neutron%10|XX"
|
||||
],
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"neutron": {elem1: "n_explosion", elem2: null, chance: 0.01, tempMin: 600 }
|
||||
},
|
||||
temp: 500,
|
||||
tempHigh: 10000,
|
||||
stateHigh: "ultronium_gas",
|
||||
renderer: renderPresets.HEATGLOW,
|
||||
tick: function(pixel) {
|
||||
if (Math.random()<0.01 && pixel.temp < 500) {
|
||||
changePixel(pixel, "stable_ultronium")
|
||||
}
|
||||
},
|
||||
category: "solids",
|
||||
density: 25000, //in kg/m³
|
||||
hardness: 0.80
|
||||
|
||||
}
|
||||
|
||||
elements.ultronium_gas = {
|
||||
color: ["#b45bb4", "#722478"],
|
||||
behavior: [
|
||||
"M2|CR:radiation%20 AND CR:neutron%10 AND M1|M2",
|
||||
"CR:radiation%20 AND CR:neutron%10 AND M1|XX|CR:radiation%20 AND CR:neutron%10 AND M1",
|
||||
"M2|CR:radiation%20 AND CR:neutron%10 AND M1|M2"
|
||||
],
|
||||
state: "gas",
|
||||
reactions: {
|
||||
"neutron": {elem1: "n_explosion", elem2: null, chance: 0.05}
|
||||
},
|
||||
temp: 12500,
|
||||
tempLow: 9000,
|
||||
stateLow: "ultronium",
|
||||
category: "gases",
|
||||
density: 12000
|
||||
|
||||
}
|
||||
|
||||
elements.stable_ultronium = {
|
||||
color: ["#362236", "#492a4c"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%10|XX",
|
||||
"CR:radiation%10|XX|CR:radiation%10",
|
||||
"XX|CR:radiation%10|XX"
|
||||
],
|
||||
state: "solid",
|
||||
tempHigh: 1200,
|
||||
stateHigh: "ultronium",
|
||||
reactions: {
|
||||
"neutron": {elem1: "depleted_ultronium", elem2: null, chance: 0.05, tempMin: 400}
|
||||
},
|
||||
category: "solids",
|
||||
density: 22550, //in kg/m³,
|
||||
hardness: 0.80
|
||||
|
||||
}
|
||||
|
||||
elements.depleted_ultronium = {
|
||||
color: ["#464646", "#b1a4b5"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
state: "solid",
|
||||
tempHigh: 4000,
|
||||
renderer: renderPresets.HEATGLOW,
|
||||
stateHigh: "depleted_gas_ultronium",
|
||||
category: "solids",
|
||||
density: 22300, //in kg/m³
|
||||
hardness: 0.80
|
||||
}
|
||||
|
||||
elements.depleted_gas_ultronium = {
|
||||
color: ["#3a293a", "#837c84"],
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
tempLow: 3990,
|
||||
stateLow: "depleted_ultronium",
|
||||
temp: 4250,
|
||||
category: "gases",
|
||||
density: 13000
|
||||
}
|
||||
|
||||
elements.supernova.hidden = false
|
||||
elements.supernova.category = "energy"
|
||||
elements.n_explosion.hidden = false
|
||||
elements.n_explosion.category = "energy"
|
||||
|
||||
elements.steam.reactions["oxygen"] = {elem1: "humid_air", elem2: null}
|
||||
|
||||
elements.humid_air = {
|
||||
color: "#9cb8c9",
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
temp: 40,
|
||||
tempLow: 20,
|
||||
stateLow: ["water", "oxygen"],
|
||||
category: "gases",
|
||||
density: 1.4
|
||||
}
|
||||
|
||||
|
||||
elements.heat_to_infinity = {
|
||||
color: "#000000",
|
||||
tool: function(pixel) {
|
||||
pixel.temp += 1e309
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.super_heat = {
|
||||
color: "#9c1717",
|
||||
tool: function(pixel) {
|
||||
pixel.temp += 100000
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
elements.super_cool = {
|
||||
color: "#9c1717",
|
||||
tool: function(pixel) {
|
||||
pixel.temp -= 100000
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.diamond.tempHigh = 3550
|
||||
elements.diamond.stateHigh = "carbon_dioxide"
|
||||
|
||||
elements.sulfur_gas.reactions["oxygen"] = {elem1: "sulfur_dioxide", elem2: null}
|
||||
|
||||
elements.sulfur_dioxide = {
|
||||
color: ["#cfd5d8","#d5dbde","#c9d0d3"],
|
||||
behavior: behaviors.GAS,
|
||||
category: "gases",
|
||||
state: "gas",
|
||||
density: 2.6,
|
||||
stateLow: "liquid_sulfur_dioxide",
|
||||
tempLow: -10,
|
||||
}
|
||||
|
||||
elements.liquid_sulfur_dioxide = {
|
||||
color: ["#bfc7cb","#b9c2c7"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1.4,
|
||||
stateHigh: "sulfur_dioxide",
|
||||
tempHigh: -10
|
||||
}
|
||||
|
||||
elements.magma.tempHigh = 2500
|
||||
elements.magma.stateHigh = ["sulfur_dioxide", "carbon_dioxide"]
|
||||
|
||||
elements.molten_glass.tempHigh = 2500
|
||||
elements.molten_glass.stateHigh = ["silicon_gas", "oxygen"]
|
||||
|
||||
elements.molten_dirt.tempHigh = 2500
|
||||
elements.molten_dirt.stateHigh = ["silicon_gas", "carbon_dioxide"]
|
||||
|
||||
elements.molten_salt.tempHigh = 2500
|
||||
elements.molten_salt.stateHigh = ["sodium_gas", "chlorine"]
|
||||
|
||||
elements.silicon_gas = {
|
||||
color: "#c0c0c0",
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
category: "gases",
|
||||
density: 0.5,
|
||||
temp: 1500
|
||||
}
|
||||
|
||||
elements.firebal = {
|
||||
color: "#fff200",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:30>plasma|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
state: "gas",
|
||||
temp: 100000
|
||||
}
|
||||
|
||||
elements.chromium = {
|
||||
color: ["#beebf0", "#87c0cc"],
|
||||
behavior: behaviors.SOLID,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
density: 7140,
|
||||
conduct: 0.6,
|
||||
hardness: 0.85,
|
||||
tempHigh: 1907,
|
||||
stateHigh: "molten_chromium"
|
||||
}
|
||||
|
||||
elements.molten_chromium = {
|
||||
color: ["#ffd500", "#ffae00", "#ff0000"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
density: 6500,
|
||||
tempLow: 1907,
|
||||
stateLow: "chromium",
|
||||
viscosity: 100,
|
||||
reactions: {
|
||||
"molten_steel": {elem1: "molten_stainless_steel", elem2: null}
|
||||
}
|
||||
}
|
||||
|
||||
elements.stainless_steel = {
|
||||
color: "#c0c0c0",
|
||||
colorKey: {
|
||||
"L":"#bababa",
|
||||
"B":"#6c6c6c"
|
||||
},
|
||||
colorPattern: [
|
||||
"BBLB",
|
||||
"BBBL",
|
||||
"BLBB",
|
||||
"LBBB"
|
||||
],
|
||||
behavior: behaviors.SOLID,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
density: 8000,
|
||||
conduct: 0.42,
|
||||
hardness: 0.85,
|
||||
tempHigh: 1450,
|
||||
stateHigh: "molten_stainless_steel",
|
||||
breakInto: "stainless_steel_dust",
|
||||
}
|
||||
|
||||
elements.molten_stainless_steel = {
|
||||
color: ["#fff942", "#f49e1d", "#ff4400"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
density: 8000,
|
||||
tempLow: 1450,
|
||||
stateLow: "stainless_steel",
|
||||
viscosity: 120,
|
||||
conduct: 1,
|
||||
}
|
||||
|
||||
elements.infinite_burn = {
|
||||
color: "#a16868",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
burn: 100,
|
||||
burnTime: 1e9, //more then one irl year
|
||||
fireColor: "#eaff00"
|
||||
}
|
||||
|
||||
|
||||
elements.h_bomb.behavior = [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:90>plasma,plasma,plasma,plasma,fire,neutron,helium|M2",
|
||||
]
|
||||
|
||||
elements.hydrogen.reactions["hydrogen"] = {
|
||||
elem1: "h_explosion" , elem2: null, tempMin: 70000
|
||||
}
|
||||
|
||||
elements.h_explosion = {
|
||||
color: "#aeff00",
|
||||
state: "gas",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:90>plasma,plasma,plasma,plasma,fire,neutron,helium|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
alias: "thermonuclear explosion",
|
||||
category: "fusion_explsosion"
|
||||
}
|
||||
|
||||
elements.short_super_heater = {
|
||||
color: "#c14a4a",
|
||||
behavior: [
|
||||
"XX|HT:5000|XX",
|
||||
"HT:5000|DL%10|HT:5000",
|
||||
"XX|HT:5000|XX"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
elements.cluster_bomb = {
|
||||
color: "#9b9b9b",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>bomb|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_squared = {
|
||||
color: "#6f6f6f",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:25>cluster_bomb|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_cubed = {
|
||||
color: "#737373",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:50>cluster_bomb_squared|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_fourth = {
|
||||
color: "#525252",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:100>cluster_bomb_cubed|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_final = {
|
||||
color: "#525252",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:250>cluster_bomb_fourth|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.compress_to_a_star = {
|
||||
color: "#e5ff00",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element=="hydrogen" && pixel.temp >= 10000) {
|
||||
changePixel(pixel, "sun")
|
||||
}
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.brown_dwarf = {
|
||||
color: "#502606",
|
||||
state: "gas",
|
||||
behavior: behaviors.WALL,
|
||||
temp: 2226,
|
||||
tempHigh: 2726,
|
||||
stateHigh: "sun",
|
||||
tempLow: -23,
|
||||
stateLow: "hydrogen",
|
||||
category: "special"
|
||||
}
|
||||
|
||||
elements.sun.tempLow = 2225
|
||||
elements.sun.stateLow = "brown_dwarf"
|
||||
|
||||
//to make it more realistic and hoping it doesn't ruin gameplay
|
||||
elements.plasma.behavior = behaviors.GAS
|
||||
elements.plasma.temp = 12500
|
||||
|
||||
// ISOTOPES category is gonna come next in 1.1v
|
||||
1087
mods/cubesstuff.js
1087
mods/cubesstuff.js
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,238 @@
|
|||
/*
|
||||
*Version 1.0.0
|
||||
*/
|
||||
dependOn("orchidslibrary.js", ()=>{
|
||||
elements.data_wire = {
|
||||
desc: "Transfers data.",
|
||||
color: ["#6b1502", "#631402", "#6e1400", "#631200"],
|
||||
properties: {cd: 0, value: null},
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
if(p2.value != null && pixel.cd == 0){
|
||||
pixel.value = p2.value;
|
||||
pixel.cd = 15;
|
||||
};
|
||||
pixel.value = (pixel.cd == 3) ? null : pixel.value;
|
||||
if(elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
pixel.cd -= (pixel.cd == 0) ? 0 : 1;
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
};
|
||||
elements.data_input = {
|
||||
desc: "Holds a data value that can be outputted to any nearby data wire.",
|
||||
color: ["#e06500", "#f57105", "#f06f05", "#e66c09"],
|
||||
value: null,
|
||||
onSelect: function(){
|
||||
promptInput("Enter data info", (input)=>{elements.data_input.value = input;}, "Data Input", elements.data_input.value);
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
properties: {
|
||||
value:null,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.value == null){
|
||||
pixel.value = elements.data_input.value;
|
||||
}
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.toggle_data_input = {
|
||||
desc: "Holds a data value that can be outputted to any nearby data wire when toggled on.",
|
||||
color: ["#6e3302", "#783905", "#823c03", "#7d3a02"],
|
||||
value: null,
|
||||
onSelect: function(){
|
||||
promptInput("Enter data info", (input)=>{elements.data_input.value = input;}, "Data Input", elements.data_input.value);
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
properties: {
|
||||
value:null,
|
||||
val: null,
|
||||
toggle: false,
|
||||
clickCd: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.val == null){
|
||||
pixel.val = elements.data_input.value;
|
||||
}
|
||||
pixel.value = (pixel.toggle) ? pixel.val : null;
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
if(pixel.clickCd == 0){
|
||||
pixel.clickCd = 20;
|
||||
pixel.toggle = !pixel.toggle;
|
||||
if(pixel.toggle){
|
||||
pixel.color = noiseify("#edba00", 8);
|
||||
} else {
|
||||
pixel.color = noiseify("#6e3302", 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.join = {
|
||||
desc: "Combines multiple data inputs. Click to reset value.",
|
||||
color: ["#046e00", "#067a02", "#097006", "#065904", "#056602"],
|
||||
properties: {val: null, clickCd: 0},
|
||||
dataInFunc: function(pixel, value){
|
||||
if(pixel.val != null && !pixel.val.includes(value)){
|
||||
pixel.val += value;
|
||||
}
|
||||
if(pixel.val == null){
|
||||
pixel.val = value;
|
||||
}
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let p2 = getPixel(pixel.x+1, pixel.y);
|
||||
if(p2 != null && p2.element == "data_wire"){
|
||||
p2.value = pixel.val;
|
||||
}
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
if(pixel.clickCd == 0){
|
||||
pixel.clickCd = 20;
|
||||
pixel.val = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.data_sensor = {
|
||||
desc: "Scans adjacent pixels for a target property and outputs them, uses \"element\" by default. Click on pixel to change properties.",
|
||||
color: ["#3d3c28", "#4d4b32", "#4a482f", "#403e28"],
|
||||
properties: {
|
||||
value: null,
|
||||
property: "element",
|
||||
clickCd: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && !["data_wire"].includes(p2.element)){
|
||||
pixel.value = p2[pixel.property];
|
||||
}
|
||||
};
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
let propertyArr = [];
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
for(let property in p2){
|
||||
if(typeof p2[property] != "function" && !propertyArr.includes(property)){
|
||||
propertyArr.push(property);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
promptChoose("Choose property this data sensor detects:", propertyArr, (input)=>{pixel.property = input || pixel.property;}, "Property to Detect");
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
}
|
||||
elements.if = {
|
||||
desc: "Takes 3 inputs, conditon (1 (true) or 0 (false), x-1), ifTrue (output if true, y-1 (pixel above)), and ifFalse (output if false, y+1 (pixel below)).",
|
||||
color: ["#00574b", "#005247", "#02594e", "#025c50"],
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let conditionPixel = getPixel(pixel.x-1, pixel.y), truePixel = getPixel(pixel.x, pixel.y-1), falsePixel = getPixel(pixel.x, pixel.y+1);
|
||||
let condition = (conditionPixel != null &&conditionPixel.value != undefined) ? parseInt(conditionPixel.value) : false;
|
||||
let trueOut = (truePixel != null && truePixel.value != undefined) ? truePixel.value : 1;
|
||||
let falseOut = (falsePixel != null && falsePixel.value != undefined) ? falsePixel.value : 0;
|
||||
let outPixel = getPixel(pixel.x+1, pixel.y);
|
||||
if(outPixel != null && outPixel.value !== undefined){
|
||||
outPixel.value = (condition) ? trueOut : falseOut;
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.equals = {
|
||||
desc: "Takes 2 inputs, A (y-1 (pixel above)) and B (y+1 (pixel below), returns 1 if they are equal and 0 if they are not.",
|
||||
color: ["#12ccb3", "#15ebce", "#0bd6bb", "#14dec3"],
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let a = getPixel(pixel.x, pixel.y-1), b = getPixel(pixel.x, pixel.y+1);
|
||||
if(a != null && b != null){
|
||||
let aVal = (a.value != undefined) ? a.value : 1;
|
||||
let bVal = (b.value != undefined) ? b.value : 0;
|
||||
let outPixel = getPixel(pixel.x+1, pixel.y);
|
||||
if(outPixel != null && outPixel.value !== undefined){
|
||||
outPixel.value = (aVal == bVal) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.prop_setter = {
|
||||
category: "data",
|
||||
properties: {
|
||||
val: null,
|
||||
},
|
||||
dataInFunc: function(pixel, value){
|
||||
pixel.val = value;
|
||||
},
|
||||
color: ["#deb150", "#ebba52", "#ebba52", "#e3b44d", "#dbab44"],
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
if(pixel.val != null){
|
||||
let valArr = pixel.val.split(":");
|
||||
let prop = valArr[0], value = valArr[1];
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && p2[prop] != undefined && elements[p2.element].category != "data"){
|
||||
if(prop == "element"){
|
||||
changePixel(p2, value);
|
||||
} else if (prop == "x" || prop == "y"){
|
||||
let x = (prop == "x") ? value : p2.x, y = (prop == "y") ? value : p2.y;
|
||||
tryMove(p2, parseInt(x), parseInt(y), null, true);
|
||||
} else {
|
||||
if(typeof p2[prop] == "number"){
|
||||
p2[prop] = parseInt(value);
|
||||
} else if(typeof p2[prop] == "boolean"){
|
||||
p2[prop] = value.includes("true");
|
||||
} else if(typeof p2[prop] == "string"){
|
||||
p2[prop] = value;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}, true);
|
||||
|
|
@ -74,3 +74,63 @@ elements.tea_powder = {
|
|||
hidden: true
|
||||
}
|
||||
elements.water.reactions.tea_powder = { elem1:"tea", chance:0.0002 }
|
||||
|
||||
elements.pumpkin.breakInto = ["pumpkin_seed","pumpkin_mash","pumpkin_mash","pumpkin_mash",null];
|
||||
|
||||
elements.pumpkin_mash = {
|
||||
color: ["#DF7E06","#eba100"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 125,
|
||||
stateHigh: ["pumpkin_spice","pumpkin_spice",null],
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
density: 490.3,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
elements.pumpkin_seed.tempHigh = 125;
|
||||
elements.pumpkin_seed.stateHigh = ["pumpkin_spice","pumpkin_spice",null];
|
||||
|
||||
elements.pumpkin_spice = {
|
||||
color: "#8d4f03",
|
||||
grain: 1.5,
|
||||
behavior: behaviors.POWDER,
|
||||
tempHigh: 400,
|
||||
stateHigh: ["smoke","smoke","smoke","smoke","ash"],
|
||||
category: "food",
|
||||
state: "solid",
|
||||
density: 490.3,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
elements.coffee.reactions.pumpkin_spice = { elem2:null, color1:"#6A2F03", chance:0.005 };
|
||||
elements.coffee.reactions.pumpkin_mash = { elem2:null, color1:"#6A2F03", chance:0.005 };
|
||||
|
||||
elements.apple = {
|
||||
color: ["#b22424","#f5c517","#66b447"],
|
||||
grain: 2,
|
||||
behavior: behaviors.POWDER,
|
||||
// singleColor: true,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
density: 750,
|
||||
isFood: true,
|
||||
breakInto: "juice",
|
||||
tempHigh: 175,
|
||||
stateHigh: ["applesauce",null]
|
||||
}
|
||||
|
||||
elements.applesauce = {
|
||||
color: "#E7C45A",
|
||||
behavior: behaviors.LIQUID,
|
||||
viscosity: 50000,
|
||||
tempHigh: 400,
|
||||
stateHigh: "smoke",
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
density: 750,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
elements.light.insulate = false;
|
||||
elements.light.tempLow = -200;
|
||||
elements.liquid_light.tempHigh = -200;
|
||||
elements.light.tempHigh = 2500;
|
||||
elements.light.stateHigh = "photonic_steam";
|
||||
elements.laser.stateHigh = "photonic_steam";
|
||||
elements.laser.tempHigh = 2500;
|
||||
elements.dirty_water.density=1600
|
||||
|
||||
if (!elements.zinc.reactions) elements.zinc.reactions = {};
|
||||
elements.zinc.reactions["sulfur"] = { elem1:"zinc_sulfide", elem2:null };
|
||||
|
||||
|
||||
elements.photonic_steam = {
|
||||
color: ["#fffccc", "#fff9aa"],
|
||||
behavior: [
|
||||
"M2|M1|M2",
|
||||
"M2|XX|M2",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 0.08,
|
||||
temp: 2500,
|
||||
emit: 4,
|
||||
emitColor: "#fff8aa",
|
||||
tick: function(pixel) {
|
||||
|
||||
if (Math.random() < 0.08) {
|
||||
let x = pixel.x + (Math.floor(Math.random() * 3) - 1);
|
||||
let y = pixel.y + (Math.floor(Math.random() * 3) - 1);
|
||||
if (!outOfBounds(x, y) && isEmpty(x, y, true)) {
|
||||
createPixel("cherenkov_radiation", x, y);
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.random() < 0.01) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
return;
|
||||
}
|
||||
|
||||
doHeat(pixel);
|
||||
doBurning(pixel);
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.cherenkov_radiation = {
|
||||
color: ["#66ccff", "#99ddff", "#44aaff"],
|
||||
behavior: behaviors.SUPERDFLUID,
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 0.05,
|
||||
temp: 500,
|
||||
emit: 3,
|
||||
emitColor: "#66ccff",
|
||||
tick: function(pixel) {
|
||||
for (let [dx, dy] of [[1,0], [-1,0], [0,1], [0,-1]]) {
|
||||
let x = pixel.x + dx, y = pixel.y + dy;
|
||||
if (outOfBounds(x, y)) continue;
|
||||
let other = pixelMap[x]?.[y];
|
||||
if (!other) continue;
|
||||
|
||||
let def = elements[other.element];
|
||||
if (def?.category === "life") {
|
||||
if (Math.random() < 0.35) changePixel(other, "ash");
|
||||
else other.color = "#88ccff";
|
||||
}
|
||||
}
|
||||
if (Math.random() < 0.25) {
|
||||
changePixel(pixel, "light");
|
||||
pixel.color = "#66ccff"
|
||||
return;
|
||||
}
|
||||
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.charged_phosphor = {
|
||||
color: ["#d0ff7f", "#e6ff99", "#f0ffa6"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
tick: function(pixel) {
|
||||
pixel.charged = true;
|
||||
|
||||
let dirs = [[0,-1],[1,0],[-1,0],[0,1],[1,1],[1,-1],[-1,1],[-1,-1]];
|
||||
let dir = dirs[Math.floor(Math.random() * dirs.length)];
|
||||
let nx = pixel.x + dir[0];
|
||||
let ny = pixel.y + dir[1];
|
||||
|
||||
if (!outOfBounds(nx, ny) && isEmpty(nx, ny)) {
|
||||
createPixel("light", nx, ny);
|
||||
pixel.charged=false;
|
||||
}
|
||||
|
||||
if (pixel.charged==false) {
|
||||
changePixel(pixel, "phosphor");
|
||||
}
|
||||
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.phosphor = {
|
||||
color: ["#66ff88", "#88ffaa", "#aaffcc"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
reactions: {
|
||||
"light": { elem1:"charged_phosphor", elem2:null },
|
||||
"liquid_light": { elem1:"charged_phosphor", elem2:null },
|
||||
"laser": { elem1:"charged_phosphor", elem2:null },
|
||||
"photonic_steam": { elem1:"charged_phosphor", elem2:null },
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
elements.zinc_sulfide= {
|
||||
color: ["#f8f8f8","#ffffff","#eeeeee"],
|
||||
behavior:behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
reactions: {
|
||||
"copper": { elem1:"phosphor", elem2:null}
|
||||
},
|
||||
};
|
||||
|
||||
elements.bioluminescent_cell = {
|
||||
behavior: behaviors.SUPPORT,
|
||||
color: ["#81ec75","#5fec87","#3ca365"],
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam","steam","steam","sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice","ice","ice","sugar_ice"],
|
||||
breakInto: ["water","dna","phosphor"],
|
||||
reactions: {
|
||||
"sugar_water": { elem2:["bio_seed","dirty_water"], chance:0.06, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"sugar":{ elem2:["bio_seed","dirty_water"], chance:0.08, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"water":{ elem2:["bio_seed","dirty_water"], chance:0.04, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"salt_water": { elem2:["bio_seed","dirty_water"], chance:0.02, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"oxygen": { elem1:"bioluminescent_cell", elem2:"light" },
|
||||
"infection": { elem1:"infection", chance:0.015 },
|
||||
"blood": { elem1:"blood", chance:0.01 },
|
||||
"antibody": { elem1:"antibody", chance:0.01 },
|
||||
"alcohol": { elem1:[null,"dna"], chance:0.02 },
|
||||
"poison": { elem1:null, chance:0.02 },
|
||||
"plague": { elem1:null, chance:0.02 },
|
||||
"mercury": { elem1:null, chance:0.02 },
|
||||
"chlorine": { elem1:null, chance:0.02 },
|
||||
"cyanide": { elem1:null, chance:0.02 },
|
||||
"soap": { elem1:null, chance:0.015 },
|
||||
"ammonia": { elem2:"nitrogen", chance:0.05 },
|
||||
"oil": { elem2:"methane", chance:0.001 },
|
||||
"milk": { elem2:"yogurt", chance:0.01 },
|
||||
"cream": { elem2:"yogurt", chance:0.01 },
|
||||
"chocolate_milk": { elem2:"yogurt", chance:0.01, color2:"#4c392c" },
|
||||
"fruit_milk": { elem2:"yogurt", chance:0.01, color2:"#977871" },
|
||||
"pilk": { elem2:"yogurt", chance:0.01, color2:"#bba789" },
|
||||
"eggnog": { elem2:"yogurt", chance:0.01, color2:"#ae9a7e" }
|
||||
}
|
||||
};
|
||||
|
||||
elements.bio_seed = {
|
||||
color: "#55cc77",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 900,
|
||||
hidden:1,
|
||||
behavior: behaviors.POWDER,
|
||||
tick: function(pixel) {
|
||||
if (Math.random() < 0.1) {
|
||||
changePixel(pixel,"bioluminescent_cell");
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
};
|
||||
|
||||
elements.solar_panel = {
|
||||
behavior:behaviors.WALL,
|
||||
color:["#2b6fb0","#2f73bd","#1f4f86"],
|
||||
tick:function(pixel){
|
||||
var adj = [[1,0],[-1,0],[0,1],[0,-1],[1,1],[-1,-1],[-1,1],[1,-1]];
|
||||
for(var i=0;i<adj.length;i++){
|
||||
var x = pixel.x+adj[i][0], y = pixel.y+adj[i][1];
|
||||
if(outOfBounds(x,y)) continue;
|
||||
var sensed = pixelMap[x]?.[y];
|
||||
if(!sensed) continue;
|
||||
if(["light","liquid_light","photonic_steam","laser"].includes(sensed.element)){
|
||||
deletePixel(x,y);
|
||||
pixel.charge = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
conduct:1,
|
||||
movable:false,
|
||||
category:"machines",
|
||||
darkText:true,
|
||||
hardness:2,
|
||||
material:"steel"
|
||||
};
|
||||
|
||||
elements.wire = elements.wire || {};
|
||||
elements.wire.reactions = elements.wire.reactions || {};
|
||||
elements.wire.reactions.solar_panel = { elem1:"wire", charge1:1 };
|
||||
|
|
@ -296,37 +296,34 @@ elements.E2L_button = {
|
|||
state: "solid",
|
||||
category: "logic",
|
||||
tick: function(pixel){
|
||||
if (typeof pixel.db == "undefined"){pixel.db = 0}
|
||||
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,true)) {
|
||||
if ((pixelMap[x][y].charge || pixelMap[x][y].chargeCD)){
|
||||
for (var j = 0; j < adjacentCoords.length; j++) {
|
||||
var coord = adjacentCoords[j];
|
||||
if (!isEmpty(x, y, true)){
|
||||
let newPixel = pixelMap[x][y]
|
||||
if (newPixel.charge || newPixel.chargeCD){
|
||||
pixel.db = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
pixel.db--
|
||||
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,true)) {
|
||||
if (pixelMap[x][y].element == "logic_wire"){
|
||||
if (pixel.db > 0){
|
||||
pixelMap[x][y].lstate = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
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,true)) {
|
||||
if (pixelMap[x][y].element == "logic_wire" && pixelMap[x][y].lstate > 0){
|
||||
} else {
|
||||
pixelMap[x][y].lstate = -2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.L2E_constant = {
|
||||
color: "#b2ba75",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,278 @@
|
|||
elements.explorder = {
|
||||
color: "#ff6600",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|CH:water>explosion|XX",
|
||||
"M2|M1|M2"
|
||||
],
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"water": { elem1: "supernova", elem2: null }
|
||||
},
|
||||
desc: 'Unstable element that creates a massive explosion when it comes into contact with water.'
|
||||
};
|
||||
|
||||
elements.netrinth = {
|
||||
color: "#0066ff",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'Highly radioactive element that twists structure of atom particles, making them part of radiation, energy can be extracted from it.',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 900) + 1 === 1) {
|
||||
tryCreate('radiation', pixel.x, pixel.y+1)
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"proton": { elem1: "radiation", elem2: null},
|
||||
"neutron": { elem1: "radiation", elem2: null},
|
||||
"electric": { elem1: "radiation", elem2: null}
|
||||
},
|
||||
tempHigh: 1000,
|
||||
stateHigh: "liquid_netrinth"
|
||||
};
|
||||
|
||||
elements.liquid_netrinth = {
|
||||
color: "#0066ff",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M3%15|XX|M3%15",
|
||||
"M2%15|M1|M2%15"
|
||||
],
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'ok nub did you expect liquid netrinth be billion times dangerous and more evil? this damages the atom structure of this element, making it less radioactive, harder to extract energy.',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1800) + 1 === 1) {
|
||||
tryCreate('radiation', pixel.x, pixel.y+1)
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"proton": { elem1: "radiation", elem2: null},
|
||||
"neutron": { elem1: "radiation", elem2: null},
|
||||
"electric": { elem1: "radiation", elem2: null}
|
||||
},
|
||||
tempLow:500,
|
||||
stateLow: "netrinth",
|
||||
tempHigh: 6000,
|
||||
stateHigh: "gas_netrinth",
|
||||
temp: 1001
|
||||
};
|
||||
|
||||
elements.gas_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: behaviors.GAS,
|
||||
category: 'states',
|
||||
state: 'gas',
|
||||
desc: 'the element atom structure is completely destroyed, making it non radioactive, even after solidifying, no longer extractable energy, and giving it brigher color, also now completely safe.',
|
||||
tempLow: 6000,
|
||||
stateLow: "safe_liquid_nentrinth",
|
||||
temp: 6001
|
||||
}
|
||||
|
||||
elements.safe_liquid_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M3%15|XX|M3%15",
|
||||
"M2%15|M1|M2%15"
|
||||
],
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'what do you expect this to be',
|
||||
tempLow:500,
|
||||
stateLow: "safe_netrinth",
|
||||
tempHigh: 6000,
|
||||
stateHigh: "gas_netrinth",
|
||||
temp: 1001
|
||||
};
|
||||
|
||||
elements.safe_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: ':/',
|
||||
tempHigh: 1000,
|
||||
stateHigh: "safe_liquid_netrinth"
|
||||
};
|
||||
|
||||
elements.mercurium = {
|
||||
color: ["#740000","#2e2e2e","#1b0047"],
|
||||
behavior: behaviors.SUPPORT,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'Very rare and sticky element, DO NOT MISTAKE WITH MERCURY, will explode on high temperatures',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
tempHigh: 4000,
|
||||
stateHigh: "supernova"
|
||||
};
|
||||
|
||||
elements.magnetite = {
|
||||
color: ["#3a3a3a", "#535353", "#a200d3"],
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'A very dense and heavy magnetic element, it can attract and repel other metals.',
|
||||
reactions: {
|
||||
"iron": { elem1: "magnetite", elem2: null },
|
||||
"steel": { elem1: "magnetite", elem2: null },
|
||||
"gold": { elem1: "magnetite", elem2: null },
|
||||
"copper": { elem1: "magnetite", elem2: null },
|
||||
"aluminum": { elem1: "magnetite", elem2: null },
|
||||
"lead": { elem1: "magnetite", elem2: null },
|
||||
"tungsten": { elem1: "magnetite", elem2: null },
|
||||
},
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
tempHigh: 3000,
|
||||
stateHigh: "molten_magnetite",
|
||||
breakInto: "magnetite_powder"
|
||||
}
|
||||
|
||||
elements.molten_magnetite = {
|
||||
color: ["#e4e4e4", "#535353", "#e180ff"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'magnetite but liquid, and also explodes in electricity during high temperatures',
|
||||
tempLow: 3000,
|
||||
stateLow: "magnetite",
|
||||
temp: 3000,
|
||||
tempHigh: 6000,
|
||||
stateHigh: 'lightning',
|
||||
}
|
||||
|
||||
elements.netrinth_receiver = {
|
||||
color: "#00ffcc",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'machines',
|
||||
state: 'solid',
|
||||
desc: 'A device that absorbs radiation from netrinth and converts it into electricity, hoewer destroys the netrinth in the process.',
|
||||
conduct: 1,
|
||||
tick: function(pixel) {
|
||||
// Check adjacent pixels for netrinth or liquid_netrinth
|
||||
let dirs = [
|
||||
[0, -1], [1, 0], [0, 1], [-1, 0]
|
||||
];
|
||||
for (let d = 0; d < dirs.length; d++) {
|
||||
let nx = pixel.x + dirs[d][0];
|
||||
let ny = pixel.y + dirs[d][1];
|
||||
if (isEmpty(nx, ny)) continue;
|
||||
let np = pixelMap[nx][ny];
|
||||
if (!np) continue;
|
||||
if (np.element === "netrinth" || np.element === "liquid_netrinth") {
|
||||
// Remove netrinth and create electric
|
||||
changePixel(np, "electric");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.magnetite_powder = {
|
||||
color: ["#3a3a3a", "#535353", "#a200d3"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1|M2"
|
||||
],
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'tottaly not the same magnetite as the previous one',
|
||||
reactions: {
|
||||
"iron": { elem1: "magnetite_powder", elem2: null },
|
||||
"steel": { elem1: "magnetite_powder", elem2: null },
|
||||
"gold": { elem1: "magnetite_powder", elem2: null },
|
||||
"copper": { elem1: "magnetite_powder", elem2: null },
|
||||
"aluminum": { elem1: "magnetite_powder", elem2: null },
|
||||
"lead": { elem1: "magnetite_powder", elem2: null },
|
||||
"tungsten": { elem1: "magnetite_powder", elem2: null },
|
||||
},
|
||||
tempHigh: 3000,
|
||||
stateHigh: "molten_magnetite",
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.side_gravity_powder = {
|
||||
color: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
fireColor: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
behavior: [
|
||||
"M2|XX|XX",
|
||||
"M1|XX|XX",
|
||||
"M2|XX|XX"
|
||||
],
|
||||
desc: "Powder that falls sideways, isnt that cool?, NO PLEASE DONT THROW TOMATOES AT ME I DONT SUPPORT LGBTQ+",
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
burn: 20,
|
||||
}
|
||||
|
||||
elements.side_gravity_powder_but_not_directly_sideways = {
|
||||
color: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
fireColor: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M2|XX|XX",
|
||||
"M1|M2|XX"
|
||||
],
|
||||
desc: "Powder that falls sideways, isnt that cool?, NO PLEASE DONT THROW TOMATOES AT ME I DONT SUPPORT LGBTQ+",
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
burn: 20,
|
||||
}
|
||||
|
||||
elements.explosive_gas = {
|
||||
color: "#ff0000",
|
||||
behavior: behaviors.GAS,
|
||||
category: "evilness",
|
||||
state: "gas",
|
||||
reactions: {
|
||||
"fire": { elem1: "explosion", elem2: null },
|
||||
"plasma": { elem1: "supernova", elem2: null},
|
||||
"laser": { elem1: "explosion", elem2: null },
|
||||
"flash": { elem1: "explosion", elem2: null },
|
||||
},
|
||||
desc: "boom",
|
||||
tempHigh: 21,
|
||||
stateHigh: "explosion",
|
||||
tempLow: 19,
|
||||
stateLow: "explosion",
|
||||
}
|
||||
|
||||
elements.neutronium = {
|
||||
color: ["#00ffdd", "#00098b", "rgba(71, 71, 71, 1)"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: 'evilness',
|
||||
glow: true,
|
||||
state: 'solid',
|
||||
desc: 'A very dense and heavy element, made entirely out of neutrons, it is incredibly rare and valuable, but also very unstable.',
|
||||
tempHigh: 1000,
|
||||
stateHigh: "neutron",
|
||||
density: 10000,
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 600) + 1 === 1) {
|
||||
tryCreate('neutron', pixel.x, pixel.y-1)
|
||||
};
|
||||
if (Math.floor(Math.random() * 800) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
};
|
||||
},
|
||||
unbreakable: true,
|
||||
reactions: {
|
||||
"proton": { elem1: "neutron", elem2: null},
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -3901,6 +3901,13 @@ elements.false_vacuum = {
|
|||
if (!pixel.timeAlive){
|
||||
pixel.timeAlive = 0
|
||||
}
|
||||
if (!pixel.generations){
|
||||
pixel.generations = 0
|
||||
}
|
||||
if (pixel.generations > Math.max(width, height)){
|
||||
deletePixel(pixel.x, pixel.y)
|
||||
return
|
||||
}
|
||||
pixel.color = `rgb(${180/(pixel.timeAlive+2)}, ${27/(pixel.timeAlive+2)}, ${27/(pixel.timeAlive+2)})`
|
||||
if (pixel.timeAlive === 0){
|
||||
for (i = 0; i < squareCoords.length; i++){
|
||||
|
|
@ -3910,9 +3917,11 @@ elements.false_vacuum = {
|
|||
if (pixelMap[x][y].element !== "false_vacuum"){
|
||||
deletePixel(x, y)
|
||||
createPixel("false_vacuum", x, y)
|
||||
pixelMap[x][y].generations = pixel.generations + 1
|
||||
}
|
||||
} else if (isEmpty(x, y)){
|
||||
createPixel("false_vacuum", x, y)
|
||||
pixelMap[x][y].generations = pixel.generations + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
*Version 1.0.0
|
||||
*/
|
||||
function noiseify(color, range){
|
||||
if(color.startsWith("#")){
|
||||
color = hexToRGB(color);
|
||||
} else {
|
||||
color = getRGB(color);
|
||||
}
|
||||
let num = Math.round(Math.random()*(range*2))-range;
|
||||
for(let value in color){
|
||||
color[value] += num;
|
||||
}
|
||||
return `rgb(${color.r},${color.g},${color.b})`;
|
||||
}
|
||||
|
||||
function is2d(arr){
|
||||
return arr.some(item => Array.isArray(item));
|
||||
}
|
||||
|
||||
function colorMix(p1, p2, bias = 0.5){
|
||||
c1 = p1.color;
|
||||
p1.color = interpolateRgb(getRGB(p1.color), getRGB(p2.color), bias);
|
||||
p2.color = interpolateRgb(getRGB(c1), getRGB(p2.color), bias);
|
||||
}
|
||||
|
||||
function interpolateRgb(rgb1, rgb2, ratio = 0.5) {
|
||||
const interpolatedRgb = {
|
||||
r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio),
|
||||
g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio),
|
||||
b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio),
|
||||
};
|
||||
return normalize(interpolatedRgb);
|
||||
}
|
||||
|
||||
function getRGB(rgb){
|
||||
if(rgb.startsWith("rgb(")){
|
||||
let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r")
|
||||
return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) };
|
||||
} else {
|
||||
return hexToRGB(rgb2);
|
||||
}
|
||||
}
|
||||
function pixelToggle(pixel, multi = {r:1,g:1,b:1}){
|
||||
if(pixel.toggle != undefined){
|
||||
pixel.toggle = !pixel.toggle;
|
||||
let rgb;
|
||||
if(Array.isArray(elements[pixel.element].color)){
|
||||
let elemColor = elements[pixel.element].color[Math.round(Math.random()*elements[pixel.element].color.length)];
|
||||
rgb = hexToRGB(elemColor) || getRGB(elemColor);
|
||||
} else {
|
||||
let elemColor = elements[pixel.element].color;
|
||||
rgb = hexToRGB(elemColor) || getRGB(elemColor);
|
||||
}
|
||||
let num = 5 - Math.round(Math.random()*10);
|
||||
if(pixel.toggle){
|
||||
for(let key in rgb){
|
||||
rgb[key] += (100*multi[key]);
|
||||
rgb[key] = Math.round(Math.max(Math.min(rgb[key], 255), 0));
|
||||
}
|
||||
pixel.color = `rgb(${rgb.r+num},${rgb.g+num},${rgb.b+num})`;
|
||||
}
|
||||
else {
|
||||
pixel.color = `rgb(${rgb.r+num},${rgb.g+num},${rgb.b+num})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
function normalize(obj){
|
||||
return `rgb(${obj.r},${obj.g},${obj.b})`;
|
||||
}
|
||||
|
|
@ -0,0 +1,915 @@
|
|||
// heavily inspired by biology.js, go try it out too!
|
||||
viewInfo[4] = {
|
||||
name: "enrg",
|
||||
pixel: function (pixel, ctx) {
|
||||
if (elements[pixel.element].isCell === true) {
|
||||
var stat = pixel.energy
|
||||
var ratio = stat / 3000
|
||||
if (ratio < 0) ratio = 0
|
||||
if (ratio > 1) ratio = 1
|
||||
var hue = Math.round(ratio * 180)
|
||||
drawSquare(ctx, `hsl(${hue},100%,50%)`, pixel.x, pixel.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewInfo[5] = {
|
||||
name: "brth",
|
||||
pixel: function (pixel, ctx) {
|
||||
if (elements[pixel.element].isCell === true) {
|
||||
var stat = pixel.breath
|
||||
var ratio = stat / 3000
|
||||
if (ratio < 0) ratio = 0
|
||||
if (ratio > 1) ratio = 1
|
||||
var hue = Math.round(ratio * 180)
|
||||
drawSquare(ctx, `hsl(${hue},100%,50%)`, pixel.x, pixel.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewInfo[6] = {
|
||||
name: "wste",
|
||||
pixel: function (pixel, ctx) {
|
||||
if (elements[pixel.element].properties?.waste !== undefined) {
|
||||
let stat = pixel.waste || 1
|
||||
let ratio = Math.log(stat) / Math.log(500)
|
||||
if (ratio < 0) ratio = 0
|
||||
if (ratio > 1) ratio = 1
|
||||
let hue = 120 - Math.round(ratio * 120)
|
||||
drawSquare(ctx, `hsl(${hue},100%,50%)`, pixel.x, pixel.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function baseCellTick(px) {
|
||||
if (!elements[px.element].isCell) { return }
|
||||
|
||||
if (px.energy > 3000) { px.energy = 3000 }
|
||||
if (px.breath > 3000) { px.breath = 3000 }
|
||||
|
||||
if (!px.static && Math.random() < 0.115) {
|
||||
px.energy -= 2
|
||||
px.breath -= 2
|
||||
}
|
||||
|
||||
if (px.energy < 1 || px.breath < 1 || (px.waste > 500 && px.element !== "urocyte") || px.waste > 3000) {
|
||||
changePixel(px, "infection")
|
||||
return
|
||||
}
|
||||
|
||||
const ns = getNeighbors(px)
|
||||
ns.forEach(n => {
|
||||
if (!elements[n.element].isCell) { return }
|
||||
|
||||
if (n.energy < px.energy) {
|
||||
let transfer = (px.energy - n.energy) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.energy -= transfer
|
||||
n.energy += transfer
|
||||
} else if (n.energy > px.energy) {
|
||||
let transfer = (n.energy - px.energy) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.energy += transfer
|
||||
n.energy -= transfer
|
||||
}
|
||||
|
||||
if (n.breath < px.breath) {
|
||||
let transfer = (px.breath - n.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath -= transfer
|
||||
n.breath += transfer
|
||||
} else if (n.breath > px.breath) {
|
||||
let transfer = (n.breath - px.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath += transfer
|
||||
n.breath -= transfer
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
elements.chlorocyte = { // generates energy per air pixel next to it
|
||||
color: ["#00ff00", "#00a500", "#008a00", "#26a026", "#3eff3e"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 1
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
px.energy += (4 - getNeighbors(px).length) * 3
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "nutrients",
|
||||
breakInto: ["water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.fermentocyte = { // stores and ferments sugar into energy
|
||||
color: "#FF6F3C",
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 1,
|
||||
waste: 0,
|
||||
sugar: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (px.sugar + 1 < 5) {
|
||||
const ns = getNeighbors(px)
|
||||
for (let n of ns) {
|
||||
if (n.element == "sugar") {
|
||||
deletePixel(n.x, n.y)
|
||||
px.sugar++
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (px.sugar) {
|
||||
px.sugar -= 0.0034
|
||||
px.energy += 50
|
||||
px.waste += 0.5
|
||||
if (px.sugar < 0) { px.sugar = 0 }
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "nutrients",
|
||||
breakInto: ["sugar_water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.urocyte = {
|
||||
color: "#927d07",
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
waste: 0,
|
||||
inWaste: true,
|
||||
transfer: 1
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (px.waste >= 400) {
|
||||
if (isEmpty(px.x, px.y + 1)) {
|
||||
createPixel("waste", px.x, px.y + 1)
|
||||
px.waste -= 400
|
||||
} else if (isEmpty(px.x + 1, px.y)) {
|
||||
createPixel("waste", px.x + 1, px.y)
|
||||
px.waste -= 400
|
||||
} else if (isEmpty(px.x - 1, px.y)) {
|
||||
createPixel("waste", px.x - 1, px.y)
|
||||
px.waste -= 400
|
||||
}
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "waste",
|
||||
breakInto: ["water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.root = { // stores water and converts it into energy
|
||||
color: ["#fff0c0", "#bba86c"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 2,
|
||||
water: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
const ns = getNeighbors(px)
|
||||
ns.forEach(n => {
|
||||
if (n.element == "water") {
|
||||
deletePixel(n.x, n.y)
|
||||
px.water += 2
|
||||
} else if (n.element == "root") {
|
||||
if (n.energy < px.energy) {
|
||||
let transfer = (px.energy - n.energy) / 4
|
||||
transfer = Math.floor(Math.min(transfer, 40 / 2))
|
||||
px.energy -= transfer
|
||||
n.energy += transfer
|
||||
} else if (n.energy > px.energy) {
|
||||
let transfer = (n.breath - px.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.energy += transfer
|
||||
n.energy -= transfer
|
||||
}
|
||||
|
||||
if (n.breath < px.breath) {
|
||||
let transfer = (px.breath - n.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath -= transfer
|
||||
n.breath += transfer
|
||||
} else if (n.breath > px.breath) {
|
||||
let transfer = (n.breath - px.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath += transfer
|
||||
n.breath -= transfer
|
||||
}
|
||||
} else if (n.element == "sugar_water") {
|
||||
deletePixel(n.x, n.y)
|
||||
px.water += 3
|
||||
} else if (n.element == "mud") {
|
||||
changePixel(n, "dirt")
|
||||
px.water += 5
|
||||
} else if (n.element == "wet_sand") {
|
||||
changePixel(n, "sand")
|
||||
px.water += 5
|
||||
} else if (n.element == "dirt" && Math.random() < 0.075) {
|
||||
px.water += 1
|
||||
} else if (n.element == "sand" && Math.random() < 0.025) {
|
||||
px.water += 1
|
||||
}
|
||||
})
|
||||
if (px.water > 0 && Math.random() < 0.185) {
|
||||
px.water -= 1
|
||||
px.energy += 15
|
||||
if (px.water < 0) { px.water = 0 }
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "nutrients",
|
||||
breakInto: ["sugar_water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false,
|
||||
isFood: true
|
||||
}
|
||||
|
||||
elements.lipocyte = { // stores excess energy for later use
|
||||
color: "#FFE680",
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 30,
|
||||
fat: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (px.energy >= 1300 && px.fat < 18) {
|
||||
px.energy -= 1000
|
||||
px.fat += 1
|
||||
} else if (px.energy <= 300 && px.fat > 0 && Math.random() < 0.1875) {
|
||||
px.fat -= 1
|
||||
px.energy += 1000
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "nutrients",
|
||||
breakInto: ["sugar_water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.aerocyte = { // generates breath out of energy
|
||||
color: "#66ccff",
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
waste: 0,
|
||||
transfer: 30,
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (px.energy >= 305 && px.breath <= 1995) {
|
||||
px.energy -= 5
|
||||
px.breath += 5
|
||||
px.waste += 0.075
|
||||
}
|
||||
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "breathing",
|
||||
breakInto: ["sugar_water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.respira = { // just like chlorocyte, but for breath
|
||||
color: ["#8888ff"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 1
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
px.breath += (4 - getNeighbors(px).length) * 3
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "steam", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
category: "breathing",
|
||||
breakInto: ["water", "dna", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.vena = { // transfers energy when powered
|
||||
color: ["#a85e5e"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 0,
|
||||
static: false,
|
||||
waste: 0
|
||||
},
|
||||
conduct: 1,
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (px.charge) {
|
||||
px.transfer = 500
|
||||
px.static = true
|
||||
} else {
|
||||
px.transfer = 0
|
||||
px.static = false
|
||||
}
|
||||
|
||||
if (px.energy > 3000) { px.energy = 3000 }
|
||||
if (px.breath > 3000) { px.breath = 3000 }
|
||||
|
||||
if (!px.static && Math.random() < 0.115) {
|
||||
px.energy -= 2
|
||||
px.breath -= 2
|
||||
}
|
||||
|
||||
if (px.energy < 1 || px.breath < 1 || (px.waste > 500 && px.element !== "urocyte") || px.waste > 3000) {
|
||||
changePixel(px, "infection")
|
||||
return
|
||||
}
|
||||
|
||||
const ns = getNeighbors(px)
|
||||
ns.forEach(n => {
|
||||
if (!elements[n.element].isCell) { return }
|
||||
|
||||
if (n.energy < px.energy) {
|
||||
let transfer = (px.energy - n.energy) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.energy -= transfer
|
||||
n.energy += transfer
|
||||
} else if (n.energy > px.energy) {
|
||||
let transfer = (n.energy - px.energy) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.energy += transfer
|
||||
n.energy -= transfer
|
||||
}
|
||||
|
||||
if (n.breath < px.breath) {
|
||||
let transfer = (px.breath - n.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath -= transfer
|
||||
n.breath += transfer
|
||||
} else if (n.breath > px.breath) {
|
||||
let transfer = (n.breath - px.breath) / 4
|
||||
transfer = Math.floor(Math.min(transfer, (px.transfer + n.transfer) / 2))
|
||||
px.breath += transfer
|
||||
n.breath -= transfer
|
||||
}
|
||||
|
||||
if (n.waste !== undefined) {
|
||||
if (n.inWaste) {
|
||||
let transfer = Math.max(1, Math.floor(Math.min(px.waste / 4, (px.transfer + n.transfer) / 2)))
|
||||
if (px.waste >= transfer) {
|
||||
px.waste -= transfer
|
||||
n.waste += transfer
|
||||
}
|
||||
} else {
|
||||
if (n.waste < px.waste) {
|
||||
let transfer = Math.max(1, Math.min((px.waste - n.waste) / 4, (px.transfer + n.transfer) / 2))
|
||||
px.waste -= transfer
|
||||
n.waste += transfer
|
||||
} else if (n.waste > px.waste) {
|
||||
let transfer = Math.max(1, Math.min((n.waste - px.waste) / 4, (px.transfer + n.transfer) / 2))
|
||||
px.waste += transfer
|
||||
n.waste -= transfer
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "sugar_water", "sugar_water"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "sugar_ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1010,
|
||||
category: "structural",
|
||||
breakInto: ["sugar_water", "sugar_water", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.neurocell = { // powers up venas
|
||||
color: ["#5e5fa8"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 50,
|
||||
cd: 1
|
||||
},
|
||||
conduct: 1,
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
px.cd--
|
||||
if (px.cd < 1) {
|
||||
px.cd = 20
|
||||
px.charge = 1
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "sugar_water", "sugar_water"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "sugar_ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1010,
|
||||
category: "structural",
|
||||
breakInto: ["sugar_water", "sugar_water", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.waste = { // urocyte excretes this
|
||||
color: "#5f9102",
|
||||
behavior: behaviors.LIQUID,
|
||||
state: "liquid",
|
||||
category: "waste",
|
||||
stateHigh: "stench",
|
||||
burn: 20,
|
||||
isFood: true,
|
||||
burnTime: 150,
|
||||
burnInto: "stench",
|
||||
tempHigh: 120,
|
||||
stateLow: "slime_ice",
|
||||
tempLow: 0,
|
||||
density: 1465,
|
||||
viscosity: 5000
|
||||
}
|
||||
|
||||
elements.mucus = { // light protective layer
|
||||
color: "#aff036",
|
||||
behavior: [
|
||||
"XX|SA|XX",
|
||||
"SA|DL%1|XX",
|
||||
"XX AND M2|SA AND M1|XX AND M2"
|
||||
],
|
||||
state: "liquid",
|
||||
category: "protection",
|
||||
stateHigh: "steam",
|
||||
tempHigh: 120,
|
||||
stateLow: "slime_ice",
|
||||
tempLow: 0,
|
||||
density: 1400,
|
||||
viscosity: 5000
|
||||
}
|
||||
|
||||
elements.toxic_mucus = { // toxic protective layer, eats bugs for energy
|
||||
color: "#58046d",
|
||||
behavior: [
|
||||
"XX|SA|XX",
|
||||
"SA|DL%1|XX",
|
||||
"XX AND M2|SA AND M1|XX AND M2"
|
||||
],
|
||||
tick: (px) => {
|
||||
const ns = getNeighbors(px)
|
||||
energy = 0
|
||||
ns.forEach(n => {
|
||||
if (["ant", "fly", "spider", "worm", "flea", "rat", "frog", "tadpole", "fish", "slug", "snail"].includes(n.element)) {
|
||||
deletePixel(n.x, n.y)
|
||||
energy++
|
||||
} else if (n.element == "mucotoxin" && energy > 0) {
|
||||
energy--
|
||||
n.waste += 0.6
|
||||
n.energy += 3000
|
||||
}
|
||||
})
|
||||
},
|
||||
state: "liquid",
|
||||
category: "protection",
|
||||
stateHigh: "steam",
|
||||
tempHigh: 120,
|
||||
stateLow: "slime_ice",
|
||||
tempLow: 0,
|
||||
density: 1400,
|
||||
viscosity: 5000
|
||||
}
|
||||
|
||||
elements.slimecoat = { // generates mucus
|
||||
color: ["#5a4606"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
const ns = getNeighbors(px)
|
||||
let change = (ns.length == 4)
|
||||
if (change) {
|
||||
ns.forEach(n => {
|
||||
if (n.element == ("mucus" || "toxic_mucus" || "slimecoat")) {
|
||||
change = false
|
||||
}
|
||||
})
|
||||
}
|
||||
if (change) {
|
||||
changePixel(px, "stem_cell")
|
||||
return
|
||||
}
|
||||
if (isEmpty(px.x - 1, px.y)) {
|
||||
createPixel("mucus", px.x - 1, px.y)
|
||||
}
|
||||
if (isEmpty(px.x + 1, px.y)) {
|
||||
createPixel("mucus", px.x + 1, px.y)
|
||||
}
|
||||
if (isEmpty(px.x, px.y - 1)) {
|
||||
createPixel("mucus", px.x, px.y - 1)
|
||||
}
|
||||
if (isEmpty(px.x, px.y + 1)) {
|
||||
createPixel("mucus", px.x, px.y + 1)
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 250,
|
||||
stateHigh: "steam",
|
||||
state: "solid",
|
||||
density: 1800,
|
||||
insulate: true,
|
||||
category: "protection",
|
||||
breakInto: ["tin", "dna", "dna"],
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.mucotoxin = { // generates toxic mucus
|
||||
color: ["#5a2806"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
waste: 0,
|
||||
transfer: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
const ns = getNeighbors(px)
|
||||
let change = (ns.length == 4)
|
||||
if (change) {
|
||||
ns.forEach(n => {
|
||||
if (n.element == ("mucus" || "toxic_mucus" || "mucotoxin")) {
|
||||
change = false
|
||||
}
|
||||
})
|
||||
}
|
||||
if (isEmpty(px.x - 1, px.y)) {
|
||||
createPixel("toxic_mucus", px.x - 1, px.y)
|
||||
}
|
||||
if (isEmpty(px.x + 1, px.y)) {
|
||||
createPixel("toxic_mucus", px.x + 1, px.y)
|
||||
}
|
||||
if (isEmpty(px.x, px.y - 1)) {
|
||||
createPixel("toxic_mucus", px.x, px.y - 1)
|
||||
}
|
||||
if (isEmpty(px.x, px.y + 1)) {
|
||||
createPixel("toxic_mucus", px.x, px.y + 1)
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 250,
|
||||
stateHigh: "molten_tin",
|
||||
state: "solid",
|
||||
density: 1800,
|
||||
insulate: true,
|
||||
category: "protection",
|
||||
breakInto: ["tin", "dna", "dna"],
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.carapace = { // heat-resistant, cancer/infection proof shell
|
||||
color: ["#46065a"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (pixel) => {
|
||||
if (getNeighbors(pixel).length == 4) { changePixel(pixel, "stem_cell"); return }
|
||||
baseCellTick(pixel)
|
||||
doDefaults(pixel)
|
||||
if (!isEmpty(pixel.x, pixel.y - 1, true)) { // Everything after this in the tick function is from biology.js, make sure to check it out too!
|
||||
var hitPixel = pixelMap[pixel.x][pixel.y - 1]
|
||||
if (elements[hitPixel.element].isCell != true && Math.random() > 0.5) {
|
||||
if (hitPixel.temp > pixel.temp) {
|
||||
hitPixel.temp--
|
||||
pixel.temp++
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isEmpty(pixel.x, pixel.y + 1, true)) {
|
||||
var hitPixel = pixelMap[pixel.x][pixel.y + 1]
|
||||
if (elements[hitPixel.element].isCell != true && Math.random() > 0.5) {
|
||||
if (hitPixel.temp > pixel.temp) {
|
||||
hitPixel.temp--
|
||||
pixel.temp++
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isEmpty(pixel.x - 1, pixel.y, true)) {
|
||||
var hitPixel = pixelMap[pixel.x - 1][pixel.y]
|
||||
if (elements[hitPixel.element].isCell != true && Math.random() > 0.5) {
|
||||
if (hitPixel.temp > pixel.temp) {
|
||||
hitPixel.temp--
|
||||
pixel.temp++
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isEmpty(pixel.x + 1, pixel.y, true)) {
|
||||
var hitPixel = pixelMap[pixel.x + 1][pixel.y]
|
||||
if (elements[hitPixel.element].isCell != true && Math.random() > 0.5) {
|
||||
if (hitPixel.temp > pixel.temp) {
|
||||
hitPixel.temp--
|
||||
pixel.temp++
|
||||
}
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
if (pixel.temp > 250) {
|
||||
changePixel(pixel, "molten_tin", 250)
|
||||
}
|
||||
},
|
||||
tempHigh: 250,
|
||||
stateHigh: "steam",
|
||||
state: "solid",
|
||||
density: 1800,
|
||||
insulate: true,
|
||||
category: "protection",
|
||||
breakInto: ["tin", "dna", "dna"],
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.phagocyte = { // turns cancer and infection into stem cells
|
||||
color: ["#a3d9a6"],
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
properties: {
|
||||
energy: 300,
|
||||
breath: 300,
|
||||
transfer: 0
|
||||
},
|
||||
isCell: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
if (Math.random() < 0.35) {
|
||||
const coords = circleCoords(px.x, px.y, 3)
|
||||
coords.forEach(coord => {
|
||||
if (!isEmpty(coord.x, coord.y)) {
|
||||
const n = pixelMap[coord.x][coord.y]
|
||||
if (n.element === "infection" || n.element === "cancer" || n.element === "poison") {
|
||||
if (Math.random() < 0.35) {
|
||||
changePixel(n, "stem_cell")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
baseCellTick(px)
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "sugar", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "sugar_ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1010,
|
||||
category: "protection",
|
||||
breakInto: ["dna", "sugar", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem2: "stem_cell", chance: 0.055 },
|
||||
infection: { elem2: "stem_cell", chance: 0.075 },
|
||||
poison: { elem2: "stem_cell", chance: 0.025 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
},
|
||||
movable: false
|
||||
}
|
||||
|
||||
elements.stem_cell = { // turns into the first cell it touches
|
||||
color: ["#c0c0c0"],
|
||||
behavior: behaviors.LIQUID,
|
||||
noMix: true,
|
||||
hoverStat: function (px) {
|
||||
return `E:${px.energy} B:${px.breath}`
|
||||
},
|
||||
tick: (px) => {
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0) {
|
||||
const elem = ns[Math.floor(Math.random() * ns.length)].element
|
||||
if (elements[elem].isCell && elem !== "phagocyte") {
|
||||
changePixel(px, elem)
|
||||
}
|
||||
}
|
||||
doDefaults(px)
|
||||
},
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam", "steam", "sugar", "sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice", "ice", "sugar_ice", "sugar_ice"],
|
||||
state: "solid",
|
||||
density: 1010,
|
||||
category: "structural",
|
||||
breakInto: ["dna", "sugar", "dna", "dna"],
|
||||
reactions: {
|
||||
...elements.cell.reactions,
|
||||
cancer: { elem1: "cancer", chance: 0.005 },
|
||||
sugar: undefined,
|
||||
sugar_water: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
elements.cancer.reactions.chlorocyte = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.respira = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.neurocell = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.vena = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.fermentocyte = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.root = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.lipocyte = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.slimecoat = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.mucotoxin = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.aerocyte = { elem2: "cancer", chance: 0.005 }
|
||||
elements.cancer.reactions.urocyte = { elem2: "cancer", chance: 0.005 }
|
||||
|
||||
elements.infection.reactions.chlorocyte = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.respira = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.neurocell = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.vena = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.fermentocyte = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.lipocyte = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.root = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.slimecoat = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.mucotoxin = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.aerocyte = { elem2: "infection", chance: 0.0015 }
|
||||
elements.infection.reactions.urocyte = { elem2: "infection", chance: 0.0015 }
|
||||
|
||||
elements.ant.reactions.waste = { elem2: null, chance: 0.035, func: behaviors.FEEDPIXEL }
|
||||
524
mods/plants.js
524
mods/plants.js
|
|
@ -1,22 +1,9 @@
|
|||
/*
|
||||
Version 2.2.0
|
||||
*Version 2.2.1
|
||||
*/
|
||||
function noiseify(color, range){
|
||||
if(color.startsWith("#")){
|
||||
color = hexToRGB(color);
|
||||
} else {
|
||||
color = getRGB(color);
|
||||
}
|
||||
let num = Math.round(Math.random()*(range*2))-range;
|
||||
for(let value in color){
|
||||
color[value] += num;
|
||||
}
|
||||
return `rgb(${color.r},${color.g},${color.b})`;
|
||||
}
|
||||
let is2d = (arr)=>{
|
||||
return arr.some(item => Array.isArray(item));
|
||||
}
|
||||
class growInterval {
|
||||
let plants;
|
||||
dependOn("orchidslibrary.js", ()=>{
|
||||
class growInterval {
|
||||
constructor(seedPixel, pattern, basePos, c = 0.025, dieAfter = undefined, fruit = undefined, elems = undefined){
|
||||
let currentLength = 0;
|
||||
let chance = c;
|
||||
|
|
@ -54,22 +41,22 @@ class growInterval {
|
|||
}, 1000/tps);
|
||||
this.interval = interval;
|
||||
}
|
||||
}
|
||||
let flowerExclude = ["pineapple"];
|
||||
let vineGrow = ["wood", "rock_wall", "straw", "wall", "ewall", "bush_cane", "bush_base", "fruit_branch"];
|
||||
let plants = {
|
||||
}
|
||||
let flowerExclude = ["pineapple"];
|
||||
let vineGrow = ["wood", "rock_wall", "straw", "wall", "ewall", "bush_cane", "bush_base", "fruit_branch"];
|
||||
plants = {
|
||||
tree: [],
|
||||
vine: ["grape", "tomato"],
|
||||
bush: [],
|
||||
other: ["pineapple", "watermelon", "banana"],
|
||||
other: ["pineapple", "watermelon", "banana", "onion"],
|
||||
includes: function(target){
|
||||
for(item in this){
|
||||
if(this[item] && Array.isArray(this[item]) && this[item].includes(target)){return true;}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
let growthPatterns = {
|
||||
}
|
||||
let growthPatterns = {
|
||||
pineapple1: [[-1,-1],[-2,-2],[1,-1],[2,-2],[0,-1],[0,-2],[0,-3],[0,-4],[0,-5],[0,-6],[-1,-6],[1,-6],[-1,-5],[1,-5],[-1,-4],[1,-4],[-1,-3],[1,-3],[0,-7],[-1,-8],[1,-8]],
|
||||
pineapple2: [[[-1,-1],[1,-1]],[[-2,-2],[2,-2]], [0,-1],[0,-2],[0,-3],[0,-4],[0,-5],[0,-6],[[-1,-6],[1,-6]],[[-1,-5],[1,-5]],[[-1,-4],[1,-4]],[[-1,-3],[1,-3]],[[-1,-2],[1,-2]],[0,-7],[-1,-8],[1,-8]],
|
||||
pineapple3: [[-1,0],[-2,-1],[-3,-2],[1,0],[2,-1],[-4,-3],[3,-2],[4,-3],[-5,-4],[5,-4],[0,-1],[0,-2],[0,-3],[0,-4],[0,-5],[0,-6],[0,-7],[0,-8],[0,-9],[0,-10],[-1,-10],[1,-10],[-1,-9],[1,-9],[-1,-8],[1,-8],[-1,-7],[1,-7],[-1,-6],[1,-6],[-1,-5],[1,-5],[-1,-4],[1,-4],[-2,-9],[2,-9],[-2,-8],[2,-8],[2,-7],[-2,-7],[-2,-6],[2,-6],[2,-5],[-2,-5],[0,-11],[-1,-12],[1,-12],[2,-13],[-2,-13]],
|
||||
|
|
@ -137,8 +124,8 @@ let growthPatterns = {
|
|||
}
|
||||
return res;
|
||||
},
|
||||
};
|
||||
let growthElems = {
|
||||
};
|
||||
let growthElems = {
|
||||
pineapple1: ["fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","fruit_leaves","fruit_leaves","fruit_leaves"],
|
||||
pineapple2: ["fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","fruit_leaves","fruit_leaves","fruit_leaves"],
|
||||
pineapple3: ["fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves"],
|
||||
|
|
@ -154,8 +141,8 @@ let growthElems = {
|
|||
"palm_5-2":["fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower"],
|
||||
"coconut_5-1": ["fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","fruit_leaves"],
|
||||
"coconut_5-2": ["fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","fruit_leaves","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower","flower"],
|
||||
}
|
||||
let ethyleneChance = {
|
||||
}
|
||||
let ethyleneChance = {
|
||||
tomato: 0.000055,
|
||||
orange: 0.000005,
|
||||
strawberry: 0.000005,
|
||||
|
|
@ -175,16 +162,16 @@ let ethyleneChance = {
|
|||
get: function(name){
|
||||
return this[name] || 0.00000035;
|
||||
}
|
||||
}
|
||||
elements.tomato.properties = {
|
||||
}
|
||||
elements.tomato.properties = {
|
||||
type: "fruit",
|
||||
fruit: "tomato",
|
||||
};
|
||||
elements.grape.properties = {
|
||||
};
|
||||
elements.grape.properties = {
|
||||
type: "fruit",
|
||||
fruit: "grape",
|
||||
};
|
||||
class vineSeed {
|
||||
};
|
||||
class vineSeed {
|
||||
category = "life";
|
||||
behavior = behaviors.POWDER;
|
||||
tick = function(pixel){
|
||||
|
|
@ -201,9 +188,9 @@ class vineSeed {
|
|||
this.color = color;
|
||||
this.low = low;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class treeSeed {
|
||||
class treeSeed {
|
||||
properties = {
|
||||
age: 0,
|
||||
fruit: "",
|
||||
|
|
@ -250,9 +237,9 @@ class treeSeed {
|
|||
this.properties.fruit = fruit;
|
||||
this.color = colours;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class fruit {
|
||||
class fruit {
|
||||
category = "food";
|
||||
behavior = [["XX", "ST:fruit_leaves AND ST:fruit_branch AND ST:wood", "XX"],["ST:fruit_leaves AND ST:fruit_branch AND ST:wood", "XX", "ST:fruit_leaves AND ST:fruit_branch AND ST:wood"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND ST:wood AND M1", "M2"]];
|
||||
breakInto = "juice";
|
||||
|
|
@ -290,8 +277,8 @@ class fruit {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.tomato.tick = function(pixel){
|
||||
}
|
||||
elements.tomato.tick = function(pixel){
|
||||
let chance = ethyleneChance.get(pixel.fruit);
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
|
|
@ -299,8 +286,8 @@ elements.tomato.tick = function(pixel){
|
|||
createPixel("ethylene", x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.grape.tick = function(pixel){
|
||||
}
|
||||
elements.grape.tick = function(pixel){
|
||||
let chance = ethyleneChance.get(pixel.fruit);
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
|
|
@ -308,10 +295,112 @@ elements.grape.tick = function(pixel){
|
|||
createPixel("ethylene", x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.wood.properties = {age: 0, fruit: ""};
|
||||
}
|
||||
elements.wood.properties = {age: 0, fruit: ""};
|
||||
|
||||
elements.fruit_branch = {
|
||||
elements.nutrient_agar = {
|
||||
category: "life",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
properties: {
|
||||
value: null,
|
||||
},
|
||||
state: "solid",
|
||||
color: ["#edeae4", "#f2f0eb", "#e8e7e3", "#f5f1e9"],
|
||||
tick: function(pixel) {
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
if(["wine", "yeast", "grape", "apple", "plum"].includes(p2.element) && pixel.value == null){
|
||||
pixel.value = "yeast";
|
||||
} else if(p2.element == "mold" && pixel.value == null){
|
||||
pixel.value = "mold";
|
||||
}else if(p2.element == "mushroom_spore" && pixel.value == null){
|
||||
pixel.value = "mushroom_spore";
|
||||
}else if (p2.element == pixel.element && p2.value != null && pixel.value == null && Math.random()<0.0035){
|
||||
pixel.value = p2.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Math.random() < 0.00075){
|
||||
if(pixel.value == null && Math.random() < 0.025){
|
||||
let elems = ["mold", "mold", "mushroom_spore"];
|
||||
let elem = elems[Math.round(Math.random()*elems.length)];
|
||||
while(elem == undefined){
|
||||
elem = elems[Math.round(Math.random()*elems.length)];
|
||||
}
|
||||
changePixel(pixel, elem);
|
||||
} else {
|
||||
changePixel(pixel, pixel.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.mold = {
|
||||
category: "life",
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#33402a", "#303d25", "#2b4f39", "#254231"],
|
||||
reactions: {
|
||||
cheese: {elem2: ["rotten_cheese", "rotten_cheese", "mold"], chance: 0.075},
|
||||
meat: {elem2: ["rotten_meat", "rotten_meat", "mold"], chance: 0.075},
|
||||
},
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1], p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
if(plants.includes(p2.element) && Math.random() < 0.025){
|
||||
let elems = ["mold", "rotten_fruit", "rotten_fruit"];
|
||||
let elem = elems[Math.round(Math.random()*elems.length)];
|
||||
while(elem == undefined){
|
||||
elem = elems[Math.round(Math.random()*elems.length)];
|
||||
}
|
||||
changePixel(p2, elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.rotten_fruit = {
|
||||
color: ["#5e3d00", "#5c3c01", "#4a3205", "#634102"],
|
||||
category: "life",
|
||||
behavior: behaviors.POWDER,
|
||||
reactions: {
|
||||
cheese: {elem2: ["rotten_cheese", "rotten_cheese", "mold"], chance: 0.075},
|
||||
meat: {elem2: ["rotten_meat", "rotten_meat", "mold"], chance: 0.075},
|
||||
},
|
||||
state: "solid",
|
||||
};
|
||||
|
||||
elements.yeast = {
|
||||
color: ["#e3d3a6", "#f2dea7", "#e3cf98", "#f2dfaa"],
|
||||
category: "life",
|
||||
density: 1033,
|
||||
behavior: behaviors.POWDER,
|
||||
reactions: {
|
||||
sugar_water: {elem2: "wine", color2: ["#6e85b5", "#6d81ab"], chance: 0.00025},
|
||||
water: {elem2: "seltzer", chance: 0.00005},
|
||||
},
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1], p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
if(p2.element == "juice" && Math.random() < 0.00025){
|
||||
let rgb = getRGB(p2.color);
|
||||
for(key in rgb){
|
||||
rgb[key] = Math.max(rgb[key] - 10, 0);
|
||||
}
|
||||
changePixel(p2, "wine");
|
||||
p2.color = normalize(rgb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.fruit_branch = {
|
||||
color: elements.tree_branch.color,
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
|
|
@ -361,8 +450,8 @@ elements.fruit_branch = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.fruit_leaves = {
|
||||
}
|
||||
elements.fruit_leaves = {
|
||||
color: elements.plant.color,
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
|
|
@ -552,11 +641,11 @@ elements.fruit_leaves = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class bushSeed{
|
||||
class bushSeed{
|
||||
behavior = behaviors.STURDYPOWDER;
|
||||
category = "life";
|
||||
properties = {
|
||||
|
|
@ -585,8 +674,8 @@ class bushSeed{
|
|||
this.properties.fruit = fruit;
|
||||
this.color = colour;
|
||||
}
|
||||
}
|
||||
elements.bush_base = {
|
||||
}
|
||||
elements.bush_base = {
|
||||
color: elements.wood.color,
|
||||
behavior: [
|
||||
["CR:bush_cane%25", "XX", "CR:bush_cane%25"],
|
||||
|
|
@ -614,8 +703,8 @@ elements.bush_base = {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
elements.bush_cane = {
|
||||
};
|
||||
elements.bush_cane = {
|
||||
color: elements.wood.color,
|
||||
tick: function(pixel){
|
||||
if(pixel.age < 200 && Math.floor(Math.random() * 40) == 1){
|
||||
|
|
@ -649,10 +738,10 @@ elements.bush_cane = {
|
|||
category: "life",
|
||||
tempLow: -2,
|
||||
stateLow: "frozen_plant",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
elements.low_fruit_vine = {
|
||||
elements.low_fruit_vine = {
|
||||
color: elements.plant.color,
|
||||
behavior: behaviors.WALL,
|
||||
category: "life",
|
||||
|
|
@ -675,12 +764,12 @@ elements.low_fruit_vine = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
let str = "";
|
||||
for(let i = 0; i < vineGrow.length; i++){
|
||||
}
|
||||
let str = "";
|
||||
for(let i = 0; i < vineGrow.length; i++){
|
||||
str += (i == vineGrow.length-1) ? `ST:${vineGrow[i]}` : `ST:${vineGrow[i]} AND `;
|
||||
}
|
||||
elements.fruit_vine = {
|
||||
}
|
||||
elements.fruit_vine = {
|
||||
category: "life",
|
||||
color: elements.plant.color,
|
||||
behavior: [["XX", str, "XX"], [str, "XX", str], ["XX", str + " AND M1", "XX"]],
|
||||
|
|
@ -729,97 +818,78 @@ elements.fruit_vine = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
behaviors.VINEFRUIT = ["XX|ST:fruit_vine AND ST:low_fruit_vine|XX",
|
||||
"ST:fruit_vine AND ST:low_fruit_vine|XX|ST:fruit_vine AND ST:low_fruit_vine",
|
||||
"M2|M1|M2"];
|
||||
elements.grape.behavior = behaviors.VINEFRUIT;
|
||||
elements.tomato.behavior = behaviors.VINEFRUIT;
|
||||
elements.grape_seed = new vineSeed("grape",["#281B01", "#2D1F06", "#2D1F06"]);
|
||||
elements.tomato_seed = new vineSeed("tomato", ["#F8F5D1","#E7E5CF","#E3E1C5"]);
|
||||
elements.apple = new fruit("apple", ["#FF0507", "#EC0A0D", "#F22426", "#DC2C2E"], ["#F9C497", "#EED3BB", "#EEDEBB"]);
|
||||
elements.apple.bloomColor = ["#fff0f7", "#fcebf3", "#fff0f7", "#ffe6f2", "#fff7fb"];
|
||||
elements.apple_seed = new treeSeed("apple", ["#3B1C01", "#3E2107", "#3A1C02"]);
|
||||
function colorMix(p1, p2, bias = 0.5){
|
||||
p1.color = interpolateRgb(getRGB(p1.color), getRGB(p2.color), bias);
|
||||
p2.color = interpolateRgb(getRGB(p1.color), getRGB(p2.color), bias);
|
||||
}
|
||||
function interpolateRgb(rgb1, rgb2, ratio = 0.5) {
|
||||
const interpolatedRgb = {
|
||||
r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio),
|
||||
g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio),
|
||||
b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio),
|
||||
};
|
||||
return normalize(interpolatedRgb);
|
||||
}
|
||||
function getRGB(rgb){
|
||||
let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r")
|
||||
return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) };
|
||||
}
|
||||
behaviors.VINEFRUIT = ["XX|ST:fruit_vine AND ST:low_fruit_vine|XX",
|
||||
"ST:fruit_vine AND ST:low_fruit_vine|XX|ST:fruit_vine AND ST:low_fruit_vine",
|
||||
"M2|M1|M2"];
|
||||
elements.grape.behavior = behaviors.VINEFRUIT;
|
||||
elements.tomato.behavior = behaviors.VINEFRUIT;
|
||||
elements.grape_seed = new vineSeed("grape",["#281B01", "#2D1F06", "#2D1F06"]);
|
||||
elements.tomato_seed = new vineSeed("tomato", ["#F8F5D1","#E7E5CF","#E3E1C5"]);
|
||||
elements.apple = new fruit("apple", ["#FF0507", "#EC0A0D", "#F22426", "#DC2C2E"], ["#F9C497", "#EED3BB", "#EEDEBB"]);
|
||||
elements.apple.bloomColor = ["#fff0f7", "#fcebf3", "#fff0f7", "#ffe6f2", "#fff7fb"];
|
||||
elements.apple_seed = new treeSeed("apple", ["#3B1C01", "#3E2107", "#3A1C02"]);
|
||||
|
||||
elements.juice.tick = function(pixel){
|
||||
elements.juice.tick = function(pixel){
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y) && pixelMap[x][y].element == pixel.element && Math.random() < 0.005){
|
||||
colorMix(pixel, pixelMap[x][y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.juice.onMix = function(pixel){
|
||||
}
|
||||
elements.juice.onMix = function(pixel){
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y) && pixelMap[x][y].element == pixel.element && Math.random() < 0.5){
|
||||
colorMix(pixel, pixelMap[x][y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.fruit_milk.tick = function(pixel){
|
||||
}
|
||||
elements.fruit_milk.tick = function(pixel){
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y) && pixelMap[x][y].element == pixel.element && Math.random() < 0.005){
|
||||
colorMix(pixel, pixelMap[x][y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.fruit_milk.onMix = function(pixel){
|
||||
}
|
||||
elements.fruit_milk.onMix = function(pixel){
|
||||
for(let i = 0; i < squareCoords.length; i++){
|
||||
let x = pixel.x+squareCoords[i][0], y = pixel.y+squareCoords[i][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y) && pixelMap[x][y].element == pixel.element && Math.random() < 0.5){
|
||||
colorMix(pixel, pixelMap[x][y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
function normalize(obj){
|
||||
return `rgb(${obj.r},${obj.g},${obj.b})`;
|
||||
}
|
||||
}
|
||||
|
||||
elements.milk.reactions.juice = {func: function(p1, p2){
|
||||
elements.milk.reactions.juice = {func: function(p1, p2){
|
||||
let rgb = interpolateRgb(getRGB(p1.color), getRGB(p2.color), 0.25);
|
||||
changePixel(p1, "fruit_milk");
|
||||
changePixel(p2, "fruit_milk");
|
||||
p1.color = rgb;
|
||||
p2.color = rgb;
|
||||
}
|
||||
};
|
||||
elements.juice.reactions.carbon_dioxide = { func: function(p1,p2){
|
||||
};
|
||||
elements.juice.reactions.carbon_dioxide = { func: function(p1,p2){
|
||||
let rgb = interpolateRgb(getRGB(p1.color), getRGB(elements.water.color), 0.2);
|
||||
changePixel(p1, "soda");
|
||||
changePixel(p2, "foam");
|
||||
p1.color = rgb;
|
||||
p2.color = rgb;
|
||||
}
|
||||
}
|
||||
elements.juice.reactions.seltzer = { func: function(p1,p2){
|
||||
}
|
||||
elements.juice.reactions.seltzer = { func: function(p1,p2){
|
||||
let rgb = interpolateRgb(getRGB(p1.color), getRGB(p2.color), 0.5);
|
||||
changePixel(p1, "soda");
|
||||
changePixel(p2, "foam");
|
||||
p1.color = rgb;
|
||||
p2.color = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.milk.reactions.soda = {
|
||||
elements.milk.reactions.soda = {
|
||||
func: function(p1,p2){
|
||||
let rgb = interpolateRgb(getRGB(p1.color), getRGB(p2.color), 0.5);
|
||||
changePixel(p1, "pilk");
|
||||
|
|
@ -827,9 +897,9 @@ elements.milk.reactions.soda = {
|
|||
p1.color = rgb;
|
||||
p2.color = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.seed_maker = {
|
||||
elements.seed_maker = {
|
||||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
tick: function(pixel){
|
||||
|
|
@ -846,9 +916,9 @@ elements.seed_maker = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.ethylene = {
|
||||
elements.ethylene = {
|
||||
behavior: behaviors.GAS,
|
||||
category: "gases",
|
||||
reactionCatalysts: {
|
||||
|
|
@ -880,8 +950,8 @@ elements.ethylene = {
|
|||
pixel.color = ["#fffffc", "#f7f7f2", "#eaebe6", "#ededed", "#f7f7f2", "#f2f2f2"][Math.floor(Math.random()*6)];
|
||||
};
|
||||
},
|
||||
}
|
||||
elements.propylene = {
|
||||
}
|
||||
elements.propylene = {
|
||||
behavior: behaviors.GAS,
|
||||
category: "gases",
|
||||
reactionCatalysts: {
|
||||
|
|
@ -909,15 +979,15 @@ elements.propylene = {
|
|||
pixel.color = ["#fffffc", "#f7f7f2", "#eaebe6", "#ededed", "#f7f7f2", "#f2f2f2"][Math.floor(Math.random()*6)];
|
||||
};
|
||||
},
|
||||
}
|
||||
elements.propane.reactionCatalysts = {
|
||||
}
|
||||
elements.propane.reactionCatalysts = {
|
||||
aluminum: {e2: "hydrogen", product: "propylene", chance: 0.035},
|
||||
gallium: {e2: "hydrogen", product: "propylene", chance: 0.025},
|
||||
};
|
||||
elements.propane.tick = function(pixel){
|
||||
};
|
||||
elements.propane.tick = function(pixel){
|
||||
catalyse(pixel);
|
||||
}
|
||||
runAfterAutogen(()=>{
|
||||
}
|
||||
runAfterAutogen(()=>{
|
||||
let r;
|
||||
if(settings.cleargases){
|
||||
if(settings.bg != undefined){
|
||||
|
|
@ -928,8 +998,8 @@ runAfterAutogen(()=>{
|
|||
};
|
||||
elements.ethylene.color = r;
|
||||
elements.propylene.color = r;
|
||||
})
|
||||
function catalyse(pixel){
|
||||
})
|
||||
function catalyse(pixel){
|
||||
let rC = elements[pixel.element].reactionCatalysts;
|
||||
let neighbors = [];
|
||||
let p = [];
|
||||
|
|
@ -961,30 +1031,30 @@ function catalyse(pixel){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.orange = new fruit("orange", ['#FA9A14', '#E88D0F', '#F0963D', '#F4810E'], ['#FFDA0B', '#FFEA09', '#FFD609', '#FCC921'], "tree");
|
||||
elements.orange_seed = new treeSeed("orange", ['#EEE9C7', '#F4F1D0', '#E8E4C4', '#DBD5AF']);
|
||||
elements.kiwi = new fruit("kiwi", ['#886002', '#7D5B0D', '#876412', '#97620F'], ['#7DB410', '#86BC1B', '#95CE22', '#91CF12'], "vine");
|
||||
elements.kiwi_seed = new vineSeed("kiwi", ['#3E2A01', '#392804', '#473307', '#1E1500']);
|
||||
elements.raspberry = new fruit("raspberry", ['#FF201C', '#EF3D3A', '#FA5350', '#DF3E3B'], ['#FF4450', '#F43643', '#DF2C38', '#E92344'], "bush");
|
||||
elements.raspberry_seed = new bushSeed("raspberry", ['#572600', '#4C2506', '#592E0D', '#5E3211']);
|
||||
elements.blueberry = new fruit("blueberry", ['#322954', '#3F3366', '#2B1B5E', '#4C3C81'], ['#51042C', '#550E33', '#420D28', '#520F32'], "bush", ['#78573A', '#72492D', '#7D5438', '#704F3A']);
|
||||
elements.blackberry = new fruit("blackberry", ['#1A013A', '#1E073A', '#3D0A49', '#33043F'], ['#DC5F5F', '#D76D6D', '#BF6363', '#B05D5D'], "bush", ['#DA7878', '#C87B7B', '#AD6161', '#915656']);
|
||||
elements.blackberry.bloomColor = ["#f5f5f5", "#ede8ec", "#ebdfe8", "#f7f2f6", "#ffffff"];
|
||||
elements.strawberry = new fruit("strawberry", ['#FE3030', '#E93030', '#DE1F1F', '#CE0B0B'], ['#EA5C46', '#E24B34', '#CE5A48', '#E7604B'], "vine", ['#B27F65', '#AA7358', '#A27553', '#AF8B62'], false, true);
|
||||
elements.pear = new fruit("pear", ["#F1F8A7", "#DCE398", "#E3EE7E", "#D6E07F"], ["#F6F9D5", "#F6F9D5", "#E8ECC6", "#E8ECC0"], "tree", ["#3B1C01", "#3E2107", "#3A1C02"]);
|
||||
elements.mango = new fruit("mango", ["#F74E3E", "#E95D51", "#EE853B", "#D77026", "#F8BF46", "#F8B524", "#95C408", "#A5CD2D"], ["#FFC905", "#FFD605", "#FFE205", "#FFF305", "#FCE118"], "tree", ["#E8EABB", "#E3E5BA", "#EAEDC0", "#E8EAB1", "#D8DBA5"]);
|
||||
elements.lemon = new fruit("lemon", ["#FCF924", "#FCF924", "#EEEA1A", "#F6F212", "#FBF70B"], ["#F6F373", "#EEEC77", "#E3E267", "#F3F18B"], "tree", ["#F8F7B2", "#E9E9B1", "#E9E8A7", "#F1EFA4"]);
|
||||
elements.plum = new fruit("plum", ["#67486E", "#705476", "#634A69", "#785281"], ["#D58D77", "#DC9984", "#CA8D7A", "#CF816A"], "tree", ["#A08C5D", "#907D50", "#9B8551", "#AA9563"]);
|
||||
elements.plum.bloomColor = ["#ffb3df", "#ffa6da", "#ffbde3", "#ffd1ec"];
|
||||
elements.peach = new fruit("peach", ["#F76856", "#EA5D4A", "#EA6D4A", "#E5785A", "#FE824A", "#EE7A45", "#FAA543", "#F59D39", "#FF744D"], ["#F86F1F", "#EC742F", "#EC832F", "#EC9A2F", "#ECA62F"], "tree", ["#735940", "#7B5C3D", "#7D5935"]);
|
||||
elements.peach.bloomColor = ["#ffb3df", "#ffa6da", "#ffbde3", "#ffd1ec"];
|
||||
elements.apricot = new fruit("apricot", ["#F5A61F", "#F5A61F", "#EA9B12", "#F8A109"], ["#F2B016", "#F2AD0C", "#FBB81E", "#FFB301"], "tree", ["#735940", "#7B5C3D", "#7D5935"]);
|
||||
elements.apricot.bloomColor = ["#fff0fb", "#ffffff", "#fadef3", "#fcd9f4"];
|
||||
elements.avocado = new fruit("avocado", ["#3c9419", "#348514", "#367a1b", "#2f7d10"], ["#cff74a", "#caf244", "#c1e649", "#b3d640"], "tree", ["#4d290a", "#4d2b0d", "#63360f", "#572d09"]);
|
||||
elements.avocado.bloomColor = ["#e3ff9c", "#e1ff96", "#e6ffa6", "#e1faa2"];
|
||||
elements.avocado.breakInto = "guacamole";
|
||||
elements.guacamole = {
|
||||
}
|
||||
elements.orange = new fruit("orange", ['#FA9A14', '#E88D0F', '#F0963D', '#F4810E'], ['#FFDA0B', '#FFEA09', '#FFD609', '#FCC921'], "tree");
|
||||
elements.orange_seed = new treeSeed("orange", ['#EEE9C7', '#F4F1D0', '#E8E4C4', '#DBD5AF']);
|
||||
elements.kiwi = new fruit("kiwi", ['#886002', '#7D5B0D', '#876412', '#97620F'], ['#7DB410', '#86BC1B', '#95CE22', '#91CF12'], "vine");
|
||||
elements.kiwi_seed = new vineSeed("kiwi", ['#3E2A01', '#392804', '#473307', '#1E1500']);
|
||||
elements.raspberry = new fruit("raspberry", ['#FF201C', '#EF3D3A', '#FA5350', '#DF3E3B'], ['#FF4450', '#F43643', '#DF2C38', '#E92344'], "bush");
|
||||
elements.raspberry_seed = new bushSeed("raspberry", ['#572600', '#4C2506', '#592E0D', '#5E3211']);
|
||||
elements.blueberry = new fruit("blueberry", ['#322954', '#3F3366', '#2B1B5E', '#4C3C81'], ['#51042C', '#550E33', '#420D28', '#520F32'], "bush", ['#78573A', '#72492D', '#7D5438', '#704F3A']);
|
||||
elements.blackberry = new fruit("blackberry", ['#1A013A', '#1E073A', '#3D0A49', '#33043F'], ['#DC5F5F', '#D76D6D', '#BF6363', '#B05D5D'], "bush", ['#DA7878', '#C87B7B', '#AD6161', '#915656']);
|
||||
elements.blackberry.bloomColor = ["#f5f5f5", "#ede8ec", "#ebdfe8", "#f7f2f6", "#ffffff"];
|
||||
elements.strawberry = new fruit("strawberry", ['#FE3030', '#E93030', '#DE1F1F', '#CE0B0B'], ['#EA5C46', '#E24B34', '#CE5A48', '#E7604B'], "vine", ['#B27F65', '#AA7358', '#A27553', '#AF8B62'], false, true);
|
||||
elements.pear = new fruit("pear", ["#F1F8A7", "#DCE398", "#E3EE7E", "#D6E07F"], ["#F6F9D5", "#F6F9D5", "#E8ECC6", "#E8ECC0"], "tree", ["#3B1C01", "#3E2107", "#3A1C02"]);
|
||||
elements.mango = new fruit("mango", ["#F74E3E", "#E95D51", "#EE853B", "#D77026", "#F8BF46", "#F8B524", "#95C408", "#A5CD2D"], ["#FFC905", "#FFD605", "#FFE205", "#FFF305", "#FCE118"], "tree", ["#E8EABB", "#E3E5BA", "#EAEDC0", "#E8EAB1", "#D8DBA5"]);
|
||||
elements.lemon = new fruit("lemon", ["#FCF924", "#FCF924", "#EEEA1A", "#F6F212", "#FBF70B"], ["#F6F373", "#EEEC77", "#E3E267", "#F3F18B"], "tree", ["#F8F7B2", "#E9E9B1", "#E9E8A7", "#F1EFA4"]);
|
||||
elements.plum = new fruit("plum", ["#67486E", "#705476", "#634A69", "#785281"], ["#D58D77", "#DC9984", "#CA8D7A", "#CF816A"], "tree", ["#A08C5D", "#907D50", "#9B8551", "#AA9563"]);
|
||||
elements.plum.bloomColor = ["#ffb3df", "#ffa6da", "#ffbde3", "#ffd1ec"];
|
||||
elements.peach = new fruit("peach", ["#F76856", "#EA5D4A", "#EA6D4A", "#E5785A", "#FE824A", "#EE7A45", "#FAA543", "#F59D39", "#FF744D"], ["#F86F1F", "#EC742F", "#EC832F", "#EC9A2F", "#ECA62F"], "tree", ["#735940", "#7B5C3D", "#7D5935"]);
|
||||
elements.peach.bloomColor = ["#ffb3df", "#ffa6da", "#ffbde3", "#ffd1ec"];
|
||||
elements.apricot = new fruit("apricot", ["#F5A61F", "#F5A61F", "#EA9B12", "#F8A109"], ["#F2B016", "#F2AD0C", "#FBB81E", "#FFB301"], "tree", ["#735940", "#7B5C3D", "#7D5935"]);
|
||||
elements.apricot.bloomColor = ["#fff0fb", "#ffffff", "#fadef3", "#fcd9f4"];
|
||||
elements.avocado = new fruit("avocado", ["#3c9419", "#348514", "#367a1b", "#2f7d10"], ["#cff74a", "#caf244", "#c1e649", "#b3d640"], "tree", ["#4d290a", "#4d2b0d", "#63360f", "#572d09"]);
|
||||
elements.avocado.bloomColor = ["#e3ff9c", "#e1ff96", "#e6ffa6", "#e1faa2"];
|
||||
elements.avocado.breakInto = "guacamole";
|
||||
elements.guacamole = {
|
||||
color: ["#cff74a", "#caf244", "#c1e649", "#b3d640"],
|
||||
behavior: behaviors.LIQUID,
|
||||
viscosity: 1350,
|
||||
|
|
@ -1005,38 +1075,38 @@ elements.guacamole = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runAfterAutogen(()=>{settingsMenu.innerHTML += `
|
||||
<span setting="cleargases" class="setting-span multisetting" title="Default: ON">
|
||||
}
|
||||
runAfterAutogen(()=>{settingsMenu.innerHTML += `
|
||||
<span setting="cleargases" class="setting-span multisetting" title="Default: ON">
|
||||
<input type="button" value="Clear Gases" id="settingLabel-clearGases" class="toggleInput" onclick="toggleInput(this,'cleargases',false); r = undefined;" state="1">
|
||||
</span>`;});
|
||||
elements.cocoa = new fruit("cocoa", ["#b09533", "#ad9439", "#b39736", "#99732c", "#ab8338", "#ad8231"], ["#826a3e", "#634f28", "#634b1f", "#5c461c"], "tree", ["#826a3e", "#634f28", "#634b1f", "#5c461c"]);
|
||||
elements.cocoa.breakInto = "cocoa_seed";
|
||||
elements.cocoa_seed.name = "CocoaBean";
|
||||
elements.cocoa_seed.breakInto = undefined;
|
||||
elements.cocoa_seed.tempHigh = 125;
|
||||
elements.cocoa_seed.stateHigh = "roasted_cocoa_bean";
|
||||
elements.roasted_cocoa_bean = {
|
||||
</span>`;});
|
||||
elements.cocoa = new fruit("cocoa", ["#b09533", "#ad9439", "#b39736", "#99732c", "#ab8338", "#ad8231"], ["#826a3e", "#634f28", "#634b1f", "#5c461c"], "tree", ["#826a3e", "#634f28", "#634b1f", "#5c461c"]);
|
||||
elements.cocoa.breakInto = "cocoa_seed";
|
||||
elements.cocoa_seed.name = "CocoaBean";
|
||||
elements.cocoa_seed.breakInto = undefined;
|
||||
elements.cocoa_seed.tempHigh = 125;
|
||||
elements.cocoa_seed.stateHigh = "roasted_cocoa_bean";
|
||||
elements.roasted_cocoa_bean = {
|
||||
category: "food",
|
||||
behavior: behaviors.POWDER,
|
||||
extract: "melted_cocoa_butter",
|
||||
color: ["#2b1b01", "#291a02", "#211503", "#211503"],
|
||||
breakInto: "cocoa_powder",
|
||||
}
|
||||
elements.cocoa_powder = {
|
||||
}
|
||||
elements.cocoa_powder = {
|
||||
category: "food",
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#3b2604", "#332104", "#402802", "#301e01"],
|
||||
}
|
||||
elements.cocoa_butter = {
|
||||
}
|
||||
elements.cocoa_butter = {
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 36,
|
||||
color: ["#feffe8", "#f4f5dc", "#fcfce1", "#feffed", "#feffd6"],
|
||||
category: "food",
|
||||
isFood: true,
|
||||
stateHigh: "melted_cocoa_butter",
|
||||
}
|
||||
elements.melted_cocoa_butter = {
|
||||
}
|
||||
elements.melted_cocoa_butter = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: ["#fff082", "#e3d676", "#f2e57e", "#fff07d"],
|
||||
tempLow: 35,
|
||||
|
|
@ -1048,8 +1118,8 @@ elements.melted_cocoa_butter = {
|
|||
isFood: true,
|
||||
viscosity: 750,
|
||||
temp: 36,
|
||||
};
|
||||
elements.extractor = {
|
||||
};
|
||||
elements.extractor = {
|
||||
category: "machines",
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
|
|
@ -1061,8 +1131,8 @@ elements.extractor = {
|
|||
}
|
||||
},
|
||||
movable: false,
|
||||
}
|
||||
elements.pineapple_seed = {
|
||||
}
|
||||
elements.pineapple_seed = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#242000", "#1f1c00", "#1a1701", "#1f1c01"],
|
||||
category: "life",
|
||||
|
|
@ -1084,8 +1154,8 @@ elements.pineapple_seed = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.unripe_fruit = {
|
||||
}
|
||||
elements.unripe_fruit = {
|
||||
category: "life",
|
||||
breakInto: ["poison", "sugar_water", "dirty_water"],
|
||||
color: ["#7ed934", "#78d42c", "#7cdb2e", "#7bde2a"],
|
||||
|
|
@ -1100,16 +1170,16 @@ elements.unripe_fruit = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.pineapple = {
|
||||
}
|
||||
elements.pineapple = {
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
bloomColor: ["#ff6682", "#ff6e88", "#ff6198", "#de73a5"],
|
||||
color: ["#ffe712", "#f0d802", "#f2db05", "#d9c409"],
|
||||
breakIntoColor: ["#fafa2a", "#f2f23d", "#f7f748", "#eded26"],
|
||||
isFood: true,
|
||||
}
|
||||
elements.sugarcane = {
|
||||
}
|
||||
elements.sugarcane = {
|
||||
category: "life",
|
||||
extract: "sugar_water",
|
||||
color: ["#60d10f", "#5abf11", "#66cc1d", "#78ed24"],
|
||||
|
|
@ -1141,8 +1211,8 @@ elements.sugarcane = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.sugarcane_seed = {
|
||||
}
|
||||
elements.sugarcane_seed = {
|
||||
category: "life",
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#f0e07a", "#e0d277", "#e3ca71", "#d9ba77"],
|
||||
|
|
@ -1158,11 +1228,11 @@ elements.sugarcane_seed = {
|
|||
}
|
||||
pixel.age++;
|
||||
},
|
||||
}
|
||||
elements.watermelon = new fruit("watermelon", ["#0e6614", "#065c0c", "#03700b", "#109119", "#098f12"], ["#ff4242", "#ed2f2f", "#ff2e2e", "#ed2828"]);
|
||||
elements.watermelon.bloomColor = ["#e9ed11", "#f1f50a", "#fbff19", "#fbff29"];
|
||||
elements.watermelon.behavior = behaviors.WALL;
|
||||
elements.watermelon_seed = {
|
||||
}
|
||||
elements.watermelon = new fruit("watermelon", ["#0e6614", "#065c0c", "#03700b", "#109119", "#098f12"], ["#ff4242", "#ed2f2f", "#ff2e2e", "#ed2828"]);
|
||||
elements.watermelon.bloomColor = ["#e9ed11", "#f1f50a", "#fbff19", "#fbff29"];
|
||||
elements.watermelon.behavior = behaviors.WALL;
|
||||
elements.watermelon_seed = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#5e4a22", "#423417", "#241b0b", "#1f1709", "#120e05"],
|
||||
category: "life",
|
||||
|
|
@ -1192,9 +1262,9 @@ elements.watermelon_seed = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.tomato.bloomColor = ["#edd93e", "#fae334", "#e6dc22", "#f5ec3d"];
|
||||
elements.banana_seed = {
|
||||
}
|
||||
elements.tomato.bloomColor = ["#edd93e", "#fae334", "#e6dc22", "#f5ec3d"];
|
||||
elements.banana_seed = {
|
||||
behavior: [['XX', 'XX', 'XX'],['XX', 'XX', 'XX'],['M2', 'M1 AND ST:wood', 'M2']],
|
||||
color: ["#121211", "#121211", "#0f0f0e", "#171716"],
|
||||
category: "life",
|
||||
|
|
@ -1240,17 +1310,17 @@ elements.banana_seed = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.dead_plant.behavior = [["XX","XX","XX"],["XX","CH:dirt%0.015","XX"],["M2","M1","M2"]];
|
||||
elements.banana = {
|
||||
}
|
||||
elements.dead_plant.behavior = [["XX","XX","XX"],["XX","CH:dirt%0.015","XX"],["M2","M1","M2"]];
|
||||
elements.banana = {
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
bloomColor: ["#6e2942", "#63293e", "#703249", "#82314f"],
|
||||
color: ["#e8de20", "#f2e824", "#f0e626", "#ebe01c", "#f0e51a"],
|
||||
breakIntoColor: ["#f2f0cb", "#f0eec5", "#f2f0c4"],
|
||||
isFood: true,
|
||||
};
|
||||
elements.coconut = {
|
||||
};
|
||||
elements.coconut = {
|
||||
behavior: [['XX', 'XX', 'XX'],['XX', 'XX', 'XX'],['M2', 'M1 AND ST:wood', 'M2']],
|
||||
color: ["#291706", "#382007", "#2e1905", "#361d05", "#361e06"],
|
||||
category: "food",
|
||||
|
|
@ -1305,8 +1375,8 @@ elements.coconut = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.coconut_oil = {
|
||||
}
|
||||
elements.coconut_oil = {
|
||||
behavior: behaviors.SOLID,
|
||||
color: ["#f0efed", "#edeceb", "#e6e4e3", "#ebe9e8"],
|
||||
category: "food",
|
||||
|
|
@ -1318,8 +1388,8 @@ elements.coconut_oil = {
|
|||
tempHigh: 24,
|
||||
stateHigh: "melted_coconut_oil",
|
||||
state: "solid",
|
||||
}
|
||||
elements.melted_coconut_oil = {
|
||||
}
|
||||
elements.melted_coconut_oil = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: ["#f0f0eb", "#e6e5d5", "#f5f4e6", "#f7f7e6", "#ededdd"],
|
||||
viscosity: 750,
|
||||
|
|
@ -1332,8 +1402,8 @@ elements.melted_coconut_oil = {
|
|||
},
|
||||
tempLow: 23,
|
||||
stateLow: "coconut_oil"
|
||||
}
|
||||
elements.coconut_water = {
|
||||
}
|
||||
elements.coconut_water = {
|
||||
color: ["#8dd6d9", "#8cd9db", "#82d6d9"],
|
||||
behavior: behaviors.LIQUID,
|
||||
isFood: true,
|
||||
|
|
@ -1341,8 +1411,8 @@ elements.coconut_water = {
|
|||
state: "liquid",
|
||||
tempHigh: 100,
|
||||
stateHigh: ["sugar", "steam", "steam", "steam", "potassium_salt", "salt", "epsom_salt", "steam", "steam", "steam"]
|
||||
}
|
||||
elements.morning_glory_seed = {
|
||||
}
|
||||
elements.morning_glory_seed = {
|
||||
behavior: behaviors.VINEFRUIT,
|
||||
bloomColors: [["#f783f0", "#fa8cf3", "#fa96f3", "#f590ee"], ["#8d40f7", "#9a52ff", "#8041d9", "#7e3ade"], ["#ed5365", "#f0485b", "#f55b6d", "#eb3d51"], ["#f53d49", "#fa4652", "#f54e59", "#f23a46"], ["#f53d49", "#fa8cf3", "#f55b6d", "#f23a46"]],
|
||||
color: ["#5c5036", "#473e29", "#4f4631", "#fcf2b8"],
|
||||
|
|
@ -1376,10 +1446,10 @@ elements.morning_glory_seed = {
|
|||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
elements.apricot_seed.tempHigh = 175;
|
||||
elements.apricot_seed.stateHigh = "almond";
|
||||
elements.almond = {
|
||||
}
|
||||
elements.apricot_seed.tempHigh = 175;
|
||||
elements.apricot_seed.stateHigh = "almond";
|
||||
elements.almond = {
|
||||
color: ["#ab9450", "#b3994d", "#a18943", "#a18c43", "#a18d47"],
|
||||
behavior: behaviors.POWDER,
|
||||
state: "solid",
|
||||
|
|
@ -1398,8 +1468,8 @@ elements.almond = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.almond_extract = {
|
||||
}
|
||||
elements.almond_extract = {
|
||||
color: ["#cfccbe", "#d6d4c7", "#c9c7bb", "#ccc9b8"],
|
||||
behavior: behaviors.LIQUID,
|
||||
isFood: true,
|
||||
|
|
@ -1414,8 +1484,8 @@ elements.almond_extract = {
|
|||
burnTime: 15,
|
||||
fireColor: ['#80acf0', '#96cdfe', '#bee6d4'],
|
||||
burnInto: ["fragrance", "smoke", "smoke"],
|
||||
}
|
||||
elements.frozen_almond_extract = {
|
||||
}
|
||||
elements.frozen_almond_extract = {
|
||||
color: ["#cfccbe", "#d6d4c7", "#c9c7bb", "#ccc9b8"],
|
||||
behavior: behaviors.SOLID,
|
||||
isFood: true,
|
||||
|
|
@ -1424,9 +1494,9 @@ elements.frozen_almond_extract = {
|
|||
density: 865,
|
||||
tempHigh: -117,
|
||||
stateHigh: "almond_extract",
|
||||
}
|
||||
}
|
||||
|
||||
elements.onion = {
|
||||
elements.onion = {
|
||||
category: "food",
|
||||
color: ["#dbaa5a", "#cc9b4b", "#bd9048", "#faebb4", "#fcf5d9", "#f2e9c7", "#7d2d50", "#ad3d6e", "#c25182"],
|
||||
state: "solid",
|
||||
|
|
@ -1482,8 +1552,8 @@ elements.onion = {
|
|||
}
|
||||
pixel.age++;
|
||||
},
|
||||
}
|
||||
elements.onion_seed = {
|
||||
}
|
||||
elements.onion_seed = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: ["#0f0f0f", "#0f0f0f", "#0a0a0a", "#0a0a0a"],
|
||||
category: "life",
|
||||
|
|
@ -1501,4 +1571,46 @@ elements.onion_seed = {
|
|||
changePixel(pixel, "onion");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.grape.reactions.sugar_water = {elem2: "wine", chance: 0.0006};
|
||||
elements.grape.reactions.water = {elem2: "wine", chance: 0.00006};
|
||||
elements.wine = {
|
||||
density: 992,
|
||||
color: ["#381b30", "#402137", "#261321", "#38192f"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
properties: {
|
||||
alcChance: 0.13,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(Math.random() < 0.00025){
|
||||
pixel.alcChance += 0.01;
|
||||
}
|
||||
if(pixel.temp >70){
|
||||
let chanceMulti = (pixel.temp-70)/20;
|
||||
let chance = (pixel.alcChance/100)*chanceMulti;
|
||||
for(let coords of squareCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
if(isEmpty(x,y) && !outOfBounds(x,y) && Math.random() < chance){
|
||||
createPixel("alcohol_gas", x,y);
|
||||
if(Math.random() < 0.5){
|
||||
let rgb = getRGB(pixel.color);
|
||||
for(let key in rgb){
|
||||
rgb[key] += 10;
|
||||
rgb[key] = Math.max(rgb[key], 0);
|
||||
}
|
||||
changePixel(pixel, "juice");
|
||||
|
||||
pixel.color = noiseify(RGBToHex(rgb), 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tempHigh: 100,
|
||||
stateHigh: ["sugar", "carbon_dioxide", "steam", "alcohol_gas"],
|
||||
};
|
||||
|
||||
|
||||
}, true);
|
||||
|
|
|
|||
6834
mods/scp.js
6834
mods/scp.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue