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>
|
||||
|
|
|
|||
133
mods/3pms_mod.js
133
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);
|
||||
}
|
||||
}
|
||||
resetInterval(tps);
|
||||
}
|
||||
focusGame();
|
||||
};
|
||||
}, 1000);
|
||||
focusGame();
|
||||
},
|
||||
"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)
|
||||
}, 1000);
|
||||
|
|
@ -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);
|
||||
|
|
@ -73,4 +73,64 @@ elements.tea_powder = {
|
|||
isFood: true,
|
||||
hidden: true
|
||||
}
|
||||
elements.water.reactions.tea_powder = { elem1:"tea", chance:0.0002 }
|
||||
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,33 +296,30 @@ 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)){
|
||||
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].charge || pixelMap[x][y].chargeCD)){
|
||||
for (var j = 0; j < adjacentCoords.length; j++) {
|
||||
var coord = adjacentCoords[j];
|
||||
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 = 2
|
||||
}
|
||||
}
|
||||
if (pixelMap[x][y].element == "logic_wire"){
|
||||
if (pixel.db > 0){
|
||||
pixelMap[x][y].lstate = 2
|
||||
} else {
|
||||
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){
|
||||
pixelMap[x][y].lstate = -2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
2882
mods/plants.js
2882
mods/plants.js
File diff suppressed because it is too large
Load Diff
7418
mods/scp.js
7418
mods/scp.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue