This commit is contained in:
Mnem42 2025-12-07 15:35:11 +00:00
commit 6e17036e1c
38 changed files with 19382 additions and 4991 deletions

View File

@ -19668,7 +19668,7 @@ window.onload = function() {
<div id="categoryControls"></div>
<div id="elementControls"></div>
</div>
<nav id="extraInfo"><small id="extraLinks"><a href="https://sandboxels.r74n.com/changelog" id="changelogButton" target="_blank">Changelog</a> <a href="https://sandboxels.R74n.com/feedback" target="_blank" style="color:lime;" id="feedbackButton">Feedback</a> <a href="https://store.steampowered.com/app/3664820/Sandboxels/" target="_blank" id="steamButton" title="View Sandboxels on Steam" style="color:#2cb4ee;">STEAM<span style="color:red">(NEW)</span></a> <a href="https://sandboxels.wiki.gg/" target="_blank" id="wikiButton" title="Official Sandboxels Wiki - wiki.gg" style="color:white;">Wiki</a> <a id="moreSocial" href="https://twitter.com/R74nCom" rel="me" target="_blank">Twitter</a> <a href="https://discord.gg/ejUc6YPQuS" target="_blank" style="color:#2f60ff;">Discord</a><span id="install-button" style="display:none">&nbsp;<a onclick="deferredPrompt.prompt(); return false" href="#" style="text-shadow: 0px 2px 10px #ff00ff; cursor:pointer">Install Offline</a></span>
<nav id="extraInfo"><small id="extraLinks"><a href="https://sandboxels.r74n.com/changelog" id="changelogButton" target="_blank">Changelog</a> <a href="https://sandboxels.R74n.com/feedback" target="_blank" style="color:lime;" id="feedbackButton">Feedback</a> <a href="https://store.steampowered.com/app/3664820/Sandboxels/" target="_blank" id="steamButton" title="View Sandboxels on Steam" style="color:#2cb4ee;">STEAM</a> <a href="https://sandboxels.wiki.gg/" target="_blank" id="wikiButton" title="Official Sandboxels Wiki - wiki.gg" style="color:white;">Wiki</a> <a id="moreSocial" href="https://twitter.com/R74nCom" rel="me" target="_blank">Twitter</a> <a href="https://discord.gg/ejUc6YPQuS" target="_blank" style="color:#2f60ff;">Discord</a><span id="install-button" style="display:none">&nbsp;<a onclick="deferredPrompt.prompt(); return false" href="#" style="text-shadow: 0px 2px 10px #ff00ff; cursor:pointer">Install Offline</a></span>
<!--<br><br><a style="color:lime" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSeYMbngtbBHZ7hkz8jpbHl7TiAItqukrhtntKgAHjH30fY08A/viewform?usp=sf_link">FILL OUT THE CENSUS<span style="color:red">(NEW)</span></a>-->
<!-- <br><br><a style="color:lime" target="_blank" href="https://store.steampowered.com/app/3664820/Sandboxels/">SANDBOXELS ON STEAM<span style="color:red">(NEW)</span></a> -->
<!--<br><br><a style="color:lime" target="_blank" href="https://r74n.com/">PLAY AD-FREE ON STEAM<span style="color:red">(NEW)</span></a>-->
@ -20066,10 +20066,11 @@ if (document.referrer && document.referrer.indexOf("r74n.") === -1) {
document.cookie = "R74nRef="+refdomain+";max-age=86400;path=/;domain=r74n.com";
}
function loadPlaylight() {
if (!isOnSite) { location.href = "https://r74n.com"; return }
function loadPlaylight(skipDialog=false) {
if (!isOnSite && !skipDialog) { location.href = "https://r74n.com"; return }
if (typeof playlightSDK === "undefined") {
document.getElementById("playlightButton").value = "Loading...";
let button = document.getElementById("playlightButton");
if (button) button.value = "Loading...";
document.head.insertAdjacentHTML("beforeend",`<link rel="stylesheet" href="https://sdk.playlight.dev/playlight-sdk.css">`);
let script = document.createElement("script");
script.setAttribute("type","module");
@ -20084,19 +20085,22 @@ if (document.referrer && document.referrer.indexOf("r74n.") === -1) {
enabled: false
}
});
playlightSDK.setDiscovery(true);
document.getElementById("playlightButton").value = "More Games";
${!skipDialog ? "playlightSDK.setDiscovery(true);" : ""}
${!skipDialog ? "document.getElementById('playlightButton').value = 'More Games';" : "" }
} catch (error) {
console.error("Error loading the Playlight SDK:", error);
document.getElementById("playlightButton").value = "Error...";
${!skipDialog ? "document.getElementById('playlightButton').value = 'Error...';" : "" }
}`;
document.head.appendChild(script);
}
else {
else if (!skipDialog) {
playlightSDK.setDiscovery(true);
}
}
}
if (urlParams.get("utm_source") === "playlight") {
addEventListener("load", function(){ loadPlaylight(true); });
}
</script>
<div id="bottomTopBoxColumns">
<div>
@ -20107,7 +20111,7 @@ if (document.referrer && document.referrer.indexOf("r74n.") === -1) {
</div>
</div>
<div>
<p>Try our NEW GAME: <a href="https://R74n.com/cook/" target="_blank">Infinite Chef</a></p>
<p>More R74n games: <a href="https://R74n.com/gentown/" target="_blank">GenTown <span style="color:red">(NEW)</span>, <a href="https://R74n.com/cook/" target="_blank">Infinite Chef</a></a></p>
<p>Email us at <a href="mailto:contact@R74n.com?subject=%5BSandboxels%5D">contact@R74n.com</a> for advertising, help, or education!</p>
<p>Support development by subscribing on <a href="https://www.patreon.com/R74n" style="color:#f96854" rel="me" target="_blank">our Patreon</a>! Many benefits!!</p>
</div>

View File

@ -131,6 +131,8 @@
<!----><tr><td class="modCat" colspan="3">Official</td></tr><!---->
<tr><td>alchemy.js</td><td>Start with only 4 elements and unlock more by reacting them together (Most are not possible)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>background_changer.js</td><td>Press 'B' to change canvas background to a URL</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>borders.js</td><td>Black borders around pixels (Use bright background)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>building.js</td><td>Building generators and materials</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>classic_explosives.js</td><td>Re-adds 4 explosives removed in v1.9.3</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>classic_textures.js</td><td>Use textures from early versions of the game</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
@ -145,8 +147,10 @@
<tr><td>glow.js</td><td>[CHROME ONLY] Adds a cool lighting effect to many emissive pixels, like Fire</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>gravity_test.js</td><td>Test for altered gravity, makes all pixels move inward</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>mustard.js</td><td>Mustard and Mustard Seeds</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>no_blood.js</td><td>Effectively removes Blood and related elements</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>rainbow_cursor.js</td><td>Makes your cursor multicolored</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>random_everything.js</td><td>Allows every element to be spawned with Random</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>rich_grain.js</td><td>Changes pixel grain to create richer colors</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>smooth_water.js</td><td>Changes water mechanics so that it flows in one direction until it bounces off of something</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>souls.js</td><td>Human Souls, Ectoplasm, and Tombstones</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></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>
@ -174,8 +178,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 +200,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>
@ -216,11 +220,11 @@
<tr><td>clf3.js</td><td>Chlorine Trifluoride</td><td>Alice</td></tr>
<tr><td>cmur.js</td><td>CharsonsModUno (???)</td><td>CharsonBurensen</td></tr>
<tr><td>debrisable.js</td><td>Expands the number of breakable elements, changes erosion, and adds way to craft certain elements from breaking other elements</td><td>Nekonico</td></tr>
<tr><td>eklegems.js</td><td>Large amouunt of gemstones and other crystals</td><td>ekle24</td></tr>
<tr><td>fire_extinguisher.js</td><td>Fire extinguisher blocks and realistic firefighting foam to put out nearly anything</td><td>Dr_Lego</td></tr>
<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 +237,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>
@ -243,6 +247,7 @@
<tr><td>radioactive.js</td><td>Radioactive elements on the periodic table [WIP]</td><td>kaeud</td></tr>
<tr><td>random_rocks.js</td><td>Randomly generates rocks on game load</td><td>Alice</td></tr>
<tr><td>roseyiede.js</td><td>Several variants of a substance called roseyiede</td><td>Alice</td></tr>
<tr><td>solubility.js</td><td>Adds solubility and a simple-to-use format for other mods to use with it</td><td>Orchid</td></tr>
<tr><td>some_tf_liquids.js</td><td>Various liquids from the Thermal Foundation Minecraft mod</td><td>Alice</td></tr>
<tr><td>stickystuff.js</td><td>Slime, Honey, and others can stick to other elements</td><td>Suss</td></tr>
<tr><td>the_ground.js</td><td>Several rocks, worldgen types, and gemstones</td><td>Alice</td></tr>
@ -253,6 +258,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>
@ -262,6 +268,7 @@
<tr><td>gameOfLife.js</td><td>Conway's Game of Life on a screen</td><td>ggod</td></tr>
<tr><td>heatshield.js</td><td>Heatshields, makes Plasma cooler</td></td><td>Taterbob</td></tr>
<tr><td>human_friendly_design.js</td><td>Pipes, Portals, Drag, and Mix don't kill humans</td><td>Nekonico</td></tr>
<tr><td>industry.js</td><td>Conveyors and emitters for most energy types</td><td>pogdog</td></tr>
<tr><td>logicgates.js</td><td>Predictable electricity and logic gates</td><td>nousernamefound</td></tr>
<tr><td>note_block_advanced.js</td><td>Edit of Alice's note_block.js, adds different blocks with different frequencies</td><td>CharsonBurensen</td></tr>
<tr><td>note_block.js</td><td>Musical Note Blocks</td><td>Alice</td></tr>
@ -271,6 +278,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>
@ -279,7 +287,7 @@
<tr><td>video.js</td><td>Video player</td><td>ggod</td></tr>
<tr><td>waterspout.js</td><td>Re-adds the old Water Spout</td><td>mollthecoder</td></tr>
<tr><td>WhisperingTheory.js</td><td>Many more variants of heater and cooler</td><td>kaeud</td></tr>
<tr><td>wifi_draw.js</td><td>Draws connections between WiFi in wifi.js and logicgates.js</td><td>RedBirdly</td></tr>
<tr><td>wifi_draw.js</td><td>Connections between WiFi in wifi.js and logicgates.js</td><td>RedBirdly</td></tr>
<!----><tr><td class="modCat" colspan="3">Weapons</td></tr><!---->
<tr><td>aircrafts.js</td><td>Aircrafts and aircraft parts</td><td>Jayd</td></tr>
@ -291,7 +299,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>
@ -329,6 +338,7 @@
<tr><td>colonies.js</td><td>Rockets that contain settlers to terraform a planet</td><td>Nekonico</td></tr>
<tr><td>crimson.js</td><td>Elements relating to the Crimson from Terraria</td><td>Alice</td></tr>
<tr><td>dogs.js</td><td>Simple dog and dog food</td><td>hedera-ivy</td></tr>
<tr><td>eklegems.js</td><td>Large amouunt of gemstones and other crystals</td><td>ekle24</td></tr>
<tr><td>fairy_chain.js</td><td>Way too many fairies to fey_and_more.js</td><td>Alice</td></tr>
<tr><td>fantastic_creatures.js</td><td>Various animals</td><td>Melecie</td></tr>
<tr><td>fantasy_elements.js</td><td>Fantasy creatures and substances</td><td>pixelegend4</td></tr>
@ -344,14 +354,16 @@
<tr><td>miscible_psoup_and_birthpool.js</td><td>Primordial Soup and Birthpool can mix (fey_and_more.js)</td><td>Alice</td></tr>
<tr><td>mobs.js</td><td>Creepers, Zombies, and Skeletons</td><td>Alice</td></tr>
<tr><td>moretrees.js</td><td>25 more tree and wood types</td><td>guzzo86</td></tr>
<tr><td>no_blood.js</td><td>Effectively removes Blood and related elements</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>nocancer.js</td><td>Removes cancer one tick after it is created</td><td>mollthecoder</td></tr>
<tr><td>nocancer2.js</td><td>Removes cancer from the game altogether; May be incompatible with other mods that spawn cancer</td><td>mollthecoder</td></tr>
<tr><td>nograssgrow.js</td><td>Prevents Grass from growing</td><td>mollthecoder</td></tr>
<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>
@ -359,14 +371,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>
@ -391,6 +404,8 @@
<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>sensitive.js</td><td>Makes all elements sensitive to air</td><td>pogdog</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>
@ -399,9 +414,12 @@
<tr><td>troll.js</td><td>Various dumb elements that iterate randomly on the entire screen</td><td>Alice</td></tr>
<tr><td>WhisperingTheory.js</td><td>Powder and gas variant of heater and cooler</td><td>kaeud</td></tr>
<!----><tr><td class="modCat" colspan="3">Visual Effects</td></tr><!---->
<tr><td>acid_and_shapes.js</td><td>Weird visual effects enabled in settings</td><td>Alice</td></tr>
<tr><td>asciiboxels.js</td><td>Renders pixels as ASCII characters</td><td>Nekonico</td></tr>
<tr><td>background_changer.js</td><td>Press 'B' to change canvas background to a URL</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>borders.js</td><td>Black borders around pixels (Use bright background)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>clouds.js</td><td>Moving clouds, sky.js recommended</td><td>RedBirdly</td></tr>
<tr><td>customBackground.js</td><td>Set your background to an image link</td><td>Jayd</td></tr>
<tr><td>fast_lightmap.js</td><td>Light sources glow, but faster</td><td>RedBirdly</td></tr>
@ -412,7 +430,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>
@ -420,6 +438,7 @@
<tr><td>paint_event.js</td><td>Random event that randomly paints a circle</td><td>Alice</td></tr>
<tr><td>rainbow_tests.js</td><td>Variants of the rainbow element with different maths</td><td>Alice</td></tr>
<tr><td>real_light.js</td><td>Everything is dark unless hit with a photon (Light) pixel, hot, or glowing</td><td>Nekonico</td></tr>
<tr><td>rich_grain.js</td><td>Changes pixel grain to create richer colors</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>shader_by_jayd.js</td><td>Glow around light elements</td><td>Jayd</td></tr>
<tr><td>Shroomboxels.js</td><td>Variant of acid_and_shapes.js that uses a different trigonometric function</td><td>Alice</td></tr>
<tr><td>singleColor.js</td><td>Elements pick one color each time they're drawn</td><td>stefanblox</td></tr>
@ -440,7 +459,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>
@ -455,7 +474,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>
@ -464,8 +485,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>
@ -498,7 +519,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>

View File

@ -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 🏈🏈 IM 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);

180
mods/PRNGworldgenlib.js Normal file
View File

@ -0,0 +1,180 @@
/*Version 1.1.0 Pseudorandom world generator*/
function pseudorandom(key, num, max = 1){
return (Math.log(key)*(num*Math.log(1625.4986772154357))) % max;
};
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+2; x++){
//console.log(x);
let heightIncrease = (fraction < 0.5) ? -3*pseudorandom(((1-fraction)*(x+1))*(100*pseudorandom(x, 1241, 500)), 1) : 3*pseudorandom(((fraction)*(x+1))*(100*pseudorandom(x, 1241, 500)), 1);
let h = level + heightIncrease;
for(let y = 0; y <= h; y++){
//console.log(x,y);
let elementsArr = this.layers[this.yLevels.indexOf(level)];
let elem = elementsArr[Math.floor(elementsArr.length*pseudorandom((1-fraction)*pseudorandom((x+15)*(y+5), 65343, 500), 2) % elementsArr.length)] || elementsArr[0];
//if(x == 0 || x == 1){console.log(elem);};
let placed = tryCreate(elem, x-2, 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)*pseudorandom(x*y, 657345, 600), 3);
if(c <= 0.3){
let c2 = pseudorandom((seed/2**32)*pseudorandom(x*y, 98755, 750), 4);
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)*pseudorandom(x2,y2, 350), x2*y2) < (0.35*multi))){
hasStone = true;
tryCreate(ore, x2, y2, true);
}
if(pseudorandom((seed/2**32)*x2*y2, 6) < 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], {vMulti: 1.2}),
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"], vMulti: 1.5}),
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, vMulti: 2}),
}
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)*pseudorandom(i, 6544, 500), 7) < 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 = [];
let txt = shiftDown;
Object.keys(biomes).forEach(function(b){arr.push(b);});
txt = (arr.length >= 7) ? true : txt;
promptInput("Leave blank to generate new seed. Your current seed is: " + seed, function(i){
seed = (i != null && i.toLowerCase() == "c") ? seed : parseFloat(i) || Math.random()*(2**32);
seed = seed % (2**32);
if(!txt){
promptChoose("", arr, (choice)=>{
biomes[choice].generate(seed);
promptText("World generation complete.");
selectElement('dirt');
}, "Select a biome to generate: ");
} else {
let str = "";
for(let key in biomes){
str += `${key},`;
}
str = str.replace(/^,|,$/g, '');
promptInput("Enter the name of a biome (caps-insensetive) \nBiomes Available: " + str, function(inp){
if(!arr.includes(inp.toLowerCase())){
promptText("Invalid selection.");
}else {
biomes[inp.toLowerCase()].generate(seed);
promptText("World generation complete.");
selectElement('dirt');
}
}, "Enter Biome")
}
}, "Enter seed:");
}
}
elements.view_seed = {
category: "tools",
onSelect: function(){
alert(seed);
selectElement("dirt");
}
}

View File

@ -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)

View File

@ -146,10 +146,54 @@ elements.NaK = {
category: "liquids",
state: "liquid",
density: 866,
tempLow: -12.6,
stateHigh: "frozen_NaK",
tempHigh: 785,
stateHigh: "NaK_gas",
reactions: {
"water": {elem1:["caustic_potash","hydrogen"],elem2:"fire"}
"water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"dirty_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"seltzer": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"sugar_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"salt_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"pool_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]}
}
};
elements.frozen_NaK = {
color: "#777070",
behavior: behaviors.WALL,
category: "states",
state: "solid",
density: 8600,
tempHigh: -12.6,
stateHigh: "NaK",
reactions: {
"water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"dirty_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"seltzer": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"sugar_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"salt_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"pool_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]}
}
};
elements.NaK_gas = {
color: "#372030",
behavior: behaviors.GAS,
category: "states",
state: "gas",
density: 3.104,
tempLow: -785,
stateLow: "NaK",
reactions: {
"water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"dirty_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"seltzer": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"sugar_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"salt_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]},
"pool_water": {elem1:["caustic_potash","lye"],elem2:["fire","hydrogen"]}
}
};
elements.obsidian = {
color: ["#020202","#3d2856","#281f3f","#110d1d","#06030c"],
behavior: behaviors.WALL,
@ -204,10 +248,20 @@ elements.pink_polonium_solution={
behavior: [
"CH:light%1|CH:light%2|CH:light%1",
"XX|CH:yellow_polonium_solution%3.5|XX",
"XX|XX|XX",
"M2|M1|M2",
],
glow: false
};
elements.stable_pink_polonium_solution={
color: "#f49ce3",
category:"liquids",
customColor: false,
hidden:false,
state: "liquid",
canPlace: true,
behavior:behaviors.LIQUID,
glow: false
}
elements.yellow_polonium_solution={
color: "#f2f538",
category:"liquids",
@ -215,8 +269,75 @@ elements.yellow_polonium_solution={
hidden:false,
state: "liquid",
canPlace: true,
glow: false
glow: false,
behavior:behaviors.LIQUID
}
elements.those_little_heart_particles_you_get_from_feeding_animals_in_minecraft_you_know_dont_you={
color:"#e61017",
category:"special",
behavior:behaviors.DGAS
}
elements.higgs_field_collapse={
behavior: [
"DL%38 AND CH:"void"%30|DL%38 AND CL%30|DL%38 AND CL%30",
"DL%38 AND CL%30|DL%60|DL%30 AND CL%30",
"DL%38 AND CL%30|DL%38 AND CL%30|DL%38 AND CL%30",
],
color:"#edf0f5",
category:"weapons",
maxSize:1,
hidden:true,
nocheer:true
}
elements.ferz={
alias:"fers",
color:"#6e6b6a",
category:"special",
behavior: [
"M1%8|XX|M1%8",
"XX|XX|XX",
"M1%8|XX|M1%8",
],
hidden:false
//slower than wazir because it looks too fast
}
elements.wazir={
alias:"vasir",
color:"#ada7a6",
category:"special",
behavior: [
"XX|M1%10|XX",
"M1%10|XX|M1%10",
"XX|M1%10|XX",
],
hidden:false
}
elements.stable_sodium={
color: ["#484849","#5d5e5f","#6b6968","#747775"],
reactions: {
"chlorine": { elem1:"salt", elem2:"pop" },
"vinegar": { elem1:"sodium_acetate", elem2:[null,null,null,"hydrogen"], attr1:{"foam":15} },
"water": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"salt_water": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"sugar_water": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"dirty_water": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"seltzer": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"pool_water": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"primordial_soup": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"nut_milk": { elem1:["pop","pop","pop","hydrogen"], chance:0.01, temp2:250 },
"acid": { elem1:"explosion" }
},
tempHigh: 97.794,
category: "powders",
state: "solid",
density: 968,
conduct: 0.85,
hardness: 0.05
},
elements.acid.ignore.push("yellow_polonium_solution")
elements.acid.ignore.push("pink_polonium_solution")
elements.water.reactions.pickle = {elem1:"pickle_juice", elem2:"pickle"}
elements.salt_water.reactions.pickle = {elem1:"pickle_juice", elem2:"pickle"}
elements.sodium.reactions.potassium = {elem1:"NaK",elem2:null}
//gallium is overrated

View File

@ -0,0 +1,40 @@
function setCanvasBG(url) {
delete settings.bg;
let canvas = document.getElementById("game");
canvas.style.backgroundColor = "";
canvas.style.backgroundImage = `url(${url})`;
canvas.style.backgroundRepeat = "no-repeat";
canvas.style.backgroundSize = "cover";
canvas.style.backgroundPosition = "bottom";
settings.bgimg = url;
saveSettings()
}
keybinds.KeyB = () => {
promptInput("Enter an image URL. Leave blank to clear background.", (url) => {
if (!url) {
delete settings.bgimg;
let canvas = document.getElementById("game");
canvas.style.backgroundImage = "";
canvas.style.backgroundRepeat = "";
canvas.style.backgroundSize = "";
canvas.style.backgroundPosition = "";
}
setCanvasBG(url);
}, "Background")
}
document.addEventListener("load", () => {
if (settings.bgimg) {
setCanvasBG(settings.bgimg)
}
})
runAfterReset(() => {
if (settings.bgimg) {
setCanvasBG(settings.bgimg)
}
})

394
mods/bf.js Normal file
View File

@ -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
}
}

File diff suppressed because it is too large Load Diff

43
mods/black_hole.js Normal file
View File

@ -0,0 +1,43 @@
elements.black_hole = {
color: "#000000",
tick: function(pixel) {
// Attract other pixels within a 9-pixel radius
for (let dx = -9; dx <= 9; dx++) {
for (let dy = -9; dy <= 9; dy++) {
let x = pixel.x + dx;
let y = pixel.y + dy;
// Ignore out-of-bounds
if (!isEmpty(x, y, true)) {
let other = pixelMap[x]?.[y];
if (other && other.element !== "black_hole") {
// Attraction: move other pixel towards the black hole
let stepX = Math.sign(pixel.x - other.x);
let stepY = Math.sign(pixel.y - other.y);
tryMove(other, other.x + stepX, other.y + stepY);
}
}
}
}
// Convert touching pixels into black holes
const dirs = [
[1, 0], [-1, 0], [0, 1], [0, -1],
[1, 1], [-1, -1], [1, -1], [-1, 1]
];
for (let d of dirs) {
let nx = pixel.x + d[0];
let ny = pixel.y + d[1];
if (isEmpty(nx, ny, true)) continue;
let touching = pixelMap[nx]?.[ny];
if (touching && touching.element !== "black_hole") {
changePixel(touching, "black_hole");
}
}
},
category: "special",
state: "solid",
density: 99999, // Very dense (optional)
hardness: 1, // Can't be destroyed easily
};

377
mods/bojithekings_mod.js Normal file
View File

@ -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

71
mods/borders.js Normal file
View File

@ -0,0 +1,71 @@
let isMachine = {"machines":true}
elements.static.border = false;
elements.mixer.border = false;
elements.grinder.border = false;
window.addEventListener("load", () => {
let oldPreRenderer = viewInfo[1].pre;
let oldPixelRenderer = viewInfo[1].pixel;
viewInfo[1].pre = function(ctx) {
if (oldPreRenderer) oldPreRenderer(ctx);
currentPixels.forEach(pixel => {
if ((elements[pixel.element].movable !== true && isMachine[elements[pixel.element].category] === undefined) || elements[pixel.element].isGas === true) return;
if (elements[pixel.element].border === false) return;
if (pixel.alpha === 0) return;
let edge = false;
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = pixel.x + coords[0];
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
// if (elements[pixelMap[x][y].element].id !== elements[pixel.element].id || elements[pixelMap[x][y].element].state !== elements[pixel.element].id) continue
edge = true;
break;
}
}
if (edge) drawSquare(ctx,"rgb(0,0,0)",pixel.x-1,pixel.y-1,3);
})
}
viewInfo[1].pixel = function(pixel, ctx) {
if (elements[pixel.element].movable || isMachine[elements[pixel.element].category] === true) return oldPixelRenderer(pixel, ctx);
if (pixel.alpha === 0) return;
let edge = false;
if (elements[pixel.element].border !== false) {
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = pixel.x + coords[0];
var y = pixel.y + coords[1];
if (isEmpty(x,y) || (!outOfBounds(x,y) &&
elements[pixelMap[x][y].element].movable
)) {
// if (elements[pixelMap[x][y].element].id !== elements[pixel.element].id || elements[pixelMap[x][y].element].state !== elements[pixel.element].id) continue
edge = true;
break;
}
}
};
if (edge) drawSquare(ctx,"rgb(0,0,0)",pixel.x,pixel.y);
else oldPixelRenderer(pixel, ctx);
}
// viewInfo[1].post = function(ctx) {
// currentPixels.forEach(pixel => {
// let edge = false;
// for (var i = 0; i < adjacentCoords.length; i++) {
// var coords = adjacentCoords[i];
// var x = pixel.x + coords[0];
// var y = pixel.y + coords[1];
// if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable !== elements[pixel.element].movable) {
// // if (elements[pixelMap[x][y].element].id !== elements[pixel.element].id || elements[pixelMap[x][y].element].state !== elements[pixel.element].id) continue
// edge = true;
// break;
// }
// }
// if (edge) drawSquare(ctx,"rgb(0,0,0)",pixel.x-0.5,pixel.y-0.5,2);
// })
// }
})

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

238
mods/datawire.js Normal file
View File

@ -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);

View File

@ -1,426 +0,0 @@
elements.beautiful_sun = {
color: "#c12600",
tick: function(pixel) {
// minimum 1726
// maximum 7726
if (pixel.eclipse) { pixel.color = pixelColorPick(pixel,"#f68656"); var c=0.01}
else if (pixel.temp < 1500) { pixel.color = pixelColorPick(pixel,"#7a4e43"); }
else if (pixel.temp < 3600) { pixel.color = pixelColorPick(pixel,"#ffbdbd"); var c=0.05 }
else if (pixel.temp < 7000) { pixel.color = pixelColorPick(pixel,"#c12600"); var c=0.1 }
else if (pixel.temp < 11000) { pixel.color = pixelColorPick(pixel,"#ffb09c"); var c=0.25 }
else if (pixel.temp < 28000) { pixel.color = pixelColorPick(pixel,"#f7fff5"); var c=0.5 }
else { pixel.color = pixelColorPick(pixel,"#c3bdff"); var c=0.4 }
if (pixel.temp < 1500) { var c=0 }
for (var i = 0; i < adjacentCoords.length; i++) {
var x = pixel.x+adjacentCoords[i][0];
var y = pixel.y+adjacentCoords[i][1];
if (isEmpty(x,y)) {
if (Math.random() > c) {continue}
createPixel("beautiful_light", x, y);
pixelMap[x][y].color = pixel.color;
}
else if (!outOfBounds(x,y)) {
var newPixel = pixelMap[x][y];
if (elements[newPixel.element].id === elements.beautiful_sun.id) {
if (pixel.eclipse) { newPixel.eclipse = true }
if (pixel.temp!==newPixel.temp) {
var avg = (pixel.temp + newPixel.temp)/2;
pixel.temp = avg;
newPixel.temp = avg;
pixelTempCheck(pixel);
pixelTempCheck(newPixel);
}
}
else if (elements[newPixel.element].id === elements.sun.id) {
changePixel(newPixel, "beautiful_sun");
}
}
}
},
tool: function(pixel) {
if (pixel.element === "light") {
deletePixel(pixel.x,pixel.y);
}
if (pixel.element === "beautiful_light") {
deletePixel(pixel.x,pixel.y);
}
},
canPlace: true,
reactions: {
"hydrogen": { elem2:"helium", temp1:5 },
"helium": { elem2:"carbon_dioxide", temp1:5, tempMax:3600 },
"carbon_dioxide": { elem2:"neon", temp1:5, tempMax:1800 },
"sun": { elem2:"beautiful_sun", },
"light": { elem2:"beautiful_light" },
},
temp: 5504,
tempLow: -100,
stateLow: "supernova",
category: "brokenday",
state: "gas",
//density: 1408,
insulate: true,
noMix: true,
alias: "hateful_star",
movable: false
},
elements.beautiful_light = {
hidden: true,
name: "light",
color: "#c12600",
tick: function(pixel) {
if (Math.random() < 0.01) {
deletePixel(pixel.x,pixel.y);
return;
}
if (pixel.bx===undefined) {
// choose 1, 0, or -1
pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
// if both are 0, make one of them 1 or -1
if (pixel.bx===0 && pixel.by===0) {
if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; }
else { pixel.by = Math.random() < 0.5 ? 1 : -1; }
}
}
// move and invert direction if hit
if (pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) {
var newX = pixel.x + pixel.bx;
if (!isEmpty(newX, pixel.y, true)) {
var newPixel = pixelMap[pixel.x+pixel.bx][pixel.y];
if (!elements[newPixel.element].insulate) {
newPixel.temp += 1;
pixelTempCheck(newPixel);
}
if (!elements.light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
else if (!elements.beautiful_light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
}
pixel.bx = -pixel.bx;
}
if (pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) {
var newY = pixel.y + pixel.by;
if (!isEmpty(pixel.x, newY, true)) {
var newPixel = pixelMap[pixel.x][pixel.y+pixel.by];
if (!elements[newPixel.element].insulate) {
newPixel.temp += 0.05;
pixelTempCheck(newPixel);
}
if (!elements.light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
else if (!elements.beautiful_light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
}
pixel.by = -pixel.by;
}
},
reactions: {
"glass": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"glass_shard": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rad_glass": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"rad_shard": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"steam": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rain_cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"smog": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"ice": { "color1":"#c2fff9" },
"rime": { "color1":"#c2fff9" },
"water": { "color1":"#a1bac9" },
"salt_water": { "color1":"#a1bac9" },
"sugar_water": { "color1":"#a1bac9" },
"dirty_water": { "color1":"#a1c9a8" },
"seltzer": { "color1":"#c2fff9" },
"diamond": { "color1":["#c2c5ff","#c2d9ff"] },
"rainbow": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"static": { "color1":["#ffffff","#bdbdbd","#808080","#424242","#1c1c1c"] },
"sun": { elem2:"beautiful_sun", },
"light": { elem2:"beautiful_light" },
"meat": { elem2:"fused_organism" },
"head": { elem2:"melted_human" },
"body": { elem2:"melted_human" },
"dead_bug": { elem2:"melted_insect" },
"worm": { elem2:"melted_insect" },
"ant": { color2:"#5E0B04", elem2:"melted_insect" },
"bee": { elem2:"melted_insect" },
"fly": { elem2:"melted_insect" },
"firefly": { elem2:"melted_insect" },
"stinkbug": { elem2:"melted_insect" },
"slug": { color2:["#997e12","#997e12","#997e12","#997e12","#997e12","#997e12","#403314","#403314","#403314","#403314","#403314","#403314","#124a44"], elem2:"melted_insect" },
"snail": { color2:"#5c3104", elem2:"melted_insect", chance:0.5 },
"tree_branch": { elem2:"wood" },
"plant": { elem2:"melted_plant" },
"grass": { elem2:"melted_plant" },
"evergreen": { color2:"#006300", elem2:"melted_plant" },
"pistil": { elem2:"melted_plant" },
"petal": { color2:["#ff0000","#ff8800","#ffff00","#88ff00","#00ff00","#00ff88","#00ffff","#0088ff","#0000ff","#8800ff","#ff00ff"], elem2:"melted_plant" },
"bamboo": { elem2:"melted_plant" },
"bamboo_plant": { elem2:"melted_plant" },
"cactus": { elem2:"melted_plant" },
"corn": { color2:["#f8d223","#d6ba2a","#f7f5ba","#dbd281","#cdb12d"], elem2:"melted_plant" },
"wheat": { color2:["#f1b569","#edb864","#de9c45","#c2853d"], elem2:"melted_plant" },
"dead_plant": { elem2:"melted_plant" },
"sapling": { elem2:"melted_plant" },
"pinecone": { color2:["#5c3e33","#472f27","#31211b"], elem2:"melted_plant" },
"bird": { color2:"#997457", elem2:"melted_animal" },
"rat": { color2:["#a698a9","#8c7d82","#ccc3cf"], elem2:"melted_animal" },
"fish": { elem2:"melted_fish", chance:0.2 },
"tadpole": { color2:"#87b574", elem2:"melted_fish", chance:0.2 },
"frog": { color2:"#607300", elem2:"melted_fish", chance:0.2 },
},
temp: 35,
tempLow: -273,
stateLow: ["liquid_light",null],
stateLowColorMultiplier: 0.8,
category: "brokenday",
state: "gas",
density: 0.00001,
ignoreAir: true,
insulate: true
},
elements.melted_human = {
color: ["#f3e7db","#eadaba","#d7bd96","#a07e56"],
behavior: behaviors.LIQUID,
viscosity: 7500,
reactions: {
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
"meat": { elem2:null, chance:0.1 },
"cooked_meat": { elem2:null, chance:0.1 },
"sun": { elem2:"beautiful_sun", elem1:"cooked_meat" },
"light": { elem2:"beautiful_light" },
"dead_bug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
"ant": { color2:"#D2B6AB", elem2:"fused_organism", chance:0.2 },
"bee": { color2:"#E9DBAA", elem2:"fused_organism", chance:0.2 },
"fly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"firefly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"stinkbug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"slug": { color2:["#DFD0AE","#E5D6C7"], elem2:"fused_organism", chance:0.2 },
"snail": { color2:"#E5D6C7", elem2:"fused_organism", chance:0.15 },
"head": { elem2:"melted_human", chance:0.1 },
"body": { elem2:"melted_human", chance:0.1 },
"bird": { color2:"#DAC8B7", elem2:"fused_organism", chance:0.1 },
"rat": { color2:["#E2D5D0","#EADFD8"], elem2:"fused_organism", chance:0.1 },
"fish": { color2:"#E3D1BC", elem2:"fused_organism", chance:0.2 },
"tadpole": { color2:"#DBDCC4", elem2:"fused_organism", chance:0.2 },
"frog": { color2:"#D2CDAA", elem2:"fused_organism", chance:0.2 },
"melted_fish": { color2:"#E3D1BC",elem2:"fused_organism", chance:0.1 },
"melted_animal": { color2:["#E2D5D0","#EADFD8","#DAC8B7"], elem2:"fused_organism", chance:0.1 },
"melted_insect": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
},
tempHigh: 300,
stateHigh: "cooked_meat",
tempLow: -20,
stateLow: "frozen_meat",
burn: 10,
burnTime: 300,
burnInto: "cooked_meat",
state: "liquid",
density: 1900,
category: "brokenday",
},
elements.melted_animal = {
color: ["#997457","#a698a9"],
behavior: behaviors.LIQUID,
viscosity: 7500,
reactions: {
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
"meat": { elem2:"fused_organism", chance:0.1 },
"sun": { elem2:"beautiful_sun", elem1:"cooked_meat" },
"light": { elem2:"beautiful_light" },
"dead_bug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
"ant": { color2:"#D2B6AB", elem2:"fused_organism", chance:0.2 },
"bee": { color2:"#E9DBAA", elem2:"fused_organism", chance:0.2 },
"fly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"firefly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"stinkbug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"slug": { color2:["#DFD0AE","#E5D6C7"], elem2:"fused_organism", chance:0.2 },
"snail": { color2:"#E5D6C7", elem2:"fused_organism", chance:0.15 },
"head": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"body": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"bird": { color2:"#997457", elem2:"melted_animal", chance:0.2 },
"rat": { color2:["#a698a9","#8c7d82","#ccc3cf"], elem2:"melted_animal", chance:0.2 },
"fish": { color2:"#E3D1BC", elem2:"fused_organism", chance:0.2 },
"tadpole": { color2:"#DBDCC4", elem2:"fused_organism", chance:0.2 },
"frog": { color2:"#D2CDAA", elem2:"fused_organism", chance:0.2 },
"melted_fish": { color2:"#E3D1BC",elem2:"fused_organism", chance:0.1 },
"melted_human": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"melted_insect": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
},
tempHigh: 275,
stateHigh: "cooked_meat",
tempLow: -20,
stateLow: "frozen_meat",
burn: 10,
burnTime: 300,
burnInto: "cooked_meat",
state: "liquid",
density: 900,
category: "brokenday",
},
elements.melted_fish = {
color: "#ac8650",
behavior: [
"XX|XX|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5",
"M2%0.5|FX%0.5|M2%0.5 AND BO",
"M2%10|M1|M2%10 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14",
],
reactions: {
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
"sun": { elem2:"beautiful_sun", elem1:"cooked_meat" },
"light": { elem2:"beautiful_light" },
"dead_bug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
"ant": { color2:"#D2B6AB", elem2:"fused_organism", chance:0.2 },
"bee": { color2:"#E9DBAA", elem2:"fused_organism", chance:0.2 },
"fly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"firefly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"stinkbug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"head": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"body": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"bird": { color2:"#DAC8B7", elem2:"fused_organism", chance:0.2 },
"rat": { color2:["#E2D5D0","#EADFD8"], elem2:"fused_organism", chance:0.2 },
"slug": { color2:["#DFD0AE","#E5D6C7"], elem2:"fused_organism", chance:0.2 },
"snail": { color2:"#E5D6C7", elem2:"fused_organism", chance:0.15 },
"fish": { elem2:"melted_fish", chance:0.2 },
"tadpole": { color2:"#87b574", elem2:"melted_fish", chance:0.2 },
"frog": { color2:"#607300", elem2:"melted_fish", chance:0.2 },
"melted_animal": { color2:["#E2D5D0","#EADFD8","#DAC8B7"], elem2:"fused_organism", chance:0.1 },
"melted_human": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"melted_insect": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
},
tempHigh: 275,
stateHigh: "cooked_meat",
tempLow: -20,
stateLow: "frozen_meat",
burn: 10,
burnTime: 300,
burnInto: "cooked_meat",
state: "liquid",
density: 800,
category: "brokenday",
},
elements.melted_insect = {
color: ["#4c4e42","#5e0b04","#4c4e42","#5e0b04","#56482d","#52472c","#635443"],
behavior: behaviors.LIQUID,
viscosity: 4500,
reactions: {
"meat": { elem2:"fused_organism", chance:0.1 },
"cooked_meat": { elem2:"fused_organism", chance:0.1 },
"sun": { elem2:"beautiful_sun", elem1:"cooked_meat" },
"light": { elem2:"beautiful_light" },
"dead_bug": { elem2:"melted_insect", chance:0.1 },
"ant": { color2:"#5E0B04", elem2:"melted_insect", chance:0.2 },
"bee": { color2:"#c4b100", elem2:"melted_insect", chance:0.2 },
"fly": { elem2:"melted_insect", chance:0.2 },
"firefly": { elem2:"melted_insect", chance:0.2 },
"stinkbug": { elem2:"melted_insect", chance:0.2 },
"slug": { color2:["#997e12","#997e12","#997e12","#997e12","#997e12","#997e12","#403314","#403314","#403314","#403314","#403314","#403314","#124a44"], elem2:"melted_insect", chance:0.2 },
"snail": { color2:"#5c3104", elem2:"melted_insect", chance:0.15 },
"fish": { color2:"#E3D1BC", elem2:"fused_organism", chance:0.2 },
"tadpole": { color2:"#DBDCC4", elem2:"fused_organism", chance:0.2 },
"frog": { color2:"#D2CDAA", elem2:"fused_organism", chance:0.2 },
"head": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"body": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"melted_human": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"bird": { color2:"#DAC8B7", elem2:"fused_organism", chance:0.1 },
"rat": { color2:["#E2D5D0","#EADFD8"], elem2:"fused_organism", chance:0.1 },
"melted_animal": { color2:["#E2D5D0","#EADFD8","#DAC8B7"], elem2:"fused_organism", chance:0.1 },
"melted_fish": { color2:"#E3D1BC",elem2:"fused_organism", chance:0.1 },
},
tempHigh: 100,
stateHigh: "dead_bug",
tempLow: -20,
stateLow: "dead_bug",
burn: 10,
burnTime: 150,
burnInto: "ash",
state: "liquid",
density: 500,
category: "brokenday",
},
elements.melted_plant = {
color: ["#00bf00","#439809","#258b08","#118511","#127b12","#136d14"],
behavior: behaviors.LIQUID,
viscosity: 50000,
reactions: {
"sun": { elem2:"beautiful_sun", elem1:"dead_plant" },
"light": { elem2:"beautiful_light" },
"carbon_dioxide": { elem2:"oxygen" },
"tree_branch": { elem2:"wood" },
"plant": { elem2:"melted_plant", chance:0.2 },
"grass": { elem2:"melted_plant", chance:0.2 },
"evergreen": { color2:"#006300", elem2:"melted_plant", chance:0.2 },
"pistil": { elem2:"melted_plant", chance:0.2 },
"petal": { color2:["#CC9978","#CD8C6F","#BE785E","#CC9978","#CD8C6F","#BE785E","#A9D475","#5AF353","#8E5FA5"], elem2:"melted_plant", chance:0.1 },
"bamboo": { elem2:"melted_plant", chance:0.1 },
"bamboo_plant": { elem2:"melted_plant", chance:0.1 },
"cactus": { elem2:"melted_plant", chance:0.1 },
"corn": { color2:["#f8d223","#d6ba2a","#f7f5ba","#dbd281","#cdb12d"], elem2:"melted_plant", chance:0.1 },
"wheat": { color2:["#f1b569","#edb864","#de9c45","#c2853d"], elem2:"melted_plant", chance:0.1 },
"dead_plant": { elem2:"melted_plant", chance:0.1 },
"sapling": { elem2:"melted_plant", chance:0.05 },
"pinecone": { color2:["#5c3e33","#472f27","#31211b"], elem2:"melted_plant", chance:0.05 },
},
tempHigh: 250,
stateHigh: "dead_plant",
tempLow: -20,
stateLow: "frozen_plant",
burn: 10,
burnTime: 200,
burnInto: ["dead_plant","fire","fire","fire","ash"],
state: "liquid",
density: 1200,
category: "brokenday",
};
elements.fused_organism = {
color: ["#E5D6C7","#f7ead0"],
behavior: behaviors.LIQUID,
viscosity: 6000,
reactions: {
"meat": { elem2:"fused_organism", chance:0.1 },
"cooked_meat": { elem2:"fused_organism", chance:0.1 },
"sun": { elem2:"beautiful_sun", elem1:"cooked_meat" },
"light": { elem2:"beautiful_light" },
"dead_bug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
"ant": { color2:"#D2B6AB", elem2:"fused_organism", chance:0.2 },
"bee": { color2:"#E9DBAA", elem2:"fused_organism", chance:0.2 },
"fly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"firefly": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"stinkbug": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.2 },
"slug": { color2:["#DFD0AE","#E5D6C7"], elem2:"fused_organism", chance:0.2 },
"snail": { color2:"#E5D6C7", elem2:"fused_organism", chance:0.15 },
"head": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"body": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"melted_human": { color2:["#F1E4D4","#EDDECC"], elem2:"fused_organism", chance:0.1 },
"melted_insect": { color2:"#CEC5B9", elem2:"fused_organism", chance:0.1 },
"bird": { color2:"#DAC8B7", elem2:"fused_organism", chance:0.1 },
"rat": { color2:["#E2D5D0","#EADFD8"], elem2:"fused_organism", chance:0.1 },
"fish": { color2:"#E3D1BC", elem2:"fused_organism", chance:0.2 },
"tadpole": { color2:"#DBDCC4", elem2:"fused_organism", chance:0.2 },
"frog": { color2:"#D2CDAA", elem2:"fused_organism", chance:0.2 },
"melted_animal": { color2:["#E2D5D0","#EADFD8","#DAC8B7"], elem2:"fused_organism", chance:0.1 },
"melted_fish": { color2:"#E3D1BC", elem2:"fused_organism", chance:0.1 },
},
tempHigh: 300,
stateHigh: "cooked_meat",
tempLow: -20,
stateLow: "frozen_meat",
burn: 10,
burnTime: 400,
burnInto: "cooked_meat",
state: "liquid",
density: 2000,
category: "brokenday",
};
HighNumber = "36 41 20 36 46 20 36 41 20 36 46 20 32 30 20 33 44 20 32 30 20 36 37 20 36 31 20 37 39"

View File

@ -73,4 +73,88 @@ 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,
}
if (!elements.mayo.reactions) elements.mayo.reactions = {};
elements.mayo.reactions.ketchup = { elem1:"mayochup", elem2:"mayochup" }
elements.mayochup = {
color: "#FDCC94",
behavior: behaviors.LIQUID,
reactions: {
"rust": { elem2:"iron", chance:0.005 },
"oxidized_copper": { elem2:"copper", chance:0.005 },
"baking_soda": { "elem1":"carbon_dioxide", elem2:"foam", chance:0.005, attr2:{"foam":3} },
"glue": { elem2:null, chance:0.005 },
"oil": { elem2:null, chance:0.005 },
"sap": { elem2:null, chance:0.005 }
},
viscosity: 26745.5,
tempHigh: 180.3,
stateHigh: ["carbon_dioxide","methane","steam","salt","sugar","steam","carbon_dioxide","methane"],
category:"liquids",
state: "liquid",
density: 1072.5,
isFood: true,
hidden: true
};

View File

@ -1,4 +1,4 @@
if (enabledMods.includes("mods/betterMenuScreens.js")) {
dependOn("betterMenuScreens.js", () => {
const properties = {
meta: [
{name: "name", type: "string", viewOnly: true, required: true},
@ -1209,8 +1209,4 @@ if (enabledMods.includes("mods/betterMenuScreens.js")) {
}
runAfterLoadList.push(cssInject, loadChanges);
} else {
enabledMods.unshift("mods/betterMenuScreens.js");
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
window.location.reload();
}
}, true);

218
mods/light.js Normal file
View File

@ -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 };

View File

@ -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
}
}
}

View File

@ -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},
}
}

21
mods/mobile_keybinds.js Normal file
View File

@ -0,0 +1,21 @@
(() => {
function runKeybind() {
promptInput("Input the keybind you want to run. (e.g. KeyA, Digit1, Backspace)", (keybind) => {
if (keybinds[keybind]) {
keybinds[keybind]();
}
})
}
if (isMobile) {
const keybindButton = document.createElement("button")
keybindButton.id = "keybindButton"
keybindButton.title = "Change static mode"
keybindButton.classList.add("controlButton")
keybindButton.onclick = () => {
runKeybind()
}
keybindButton.textContent = "Keybind"
document.getElementById("pauseButton").before(keybindButton)
}
})()

1143
mods/morebombs.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1384
mods/nature_Mod.js Normal file

File diff suppressed because it is too large Load Diff

23
mods/no_blood.js Normal file
View File

@ -0,0 +1,23 @@
elements.blood.hidden = true;
elements.blood.tick = function (pixel) {
tryDelete(pixel.x, pixel.y);
}
elements.blood.onPlace = function (pixel) {
tryDelete(pixel.x, pixel.y);
}
elements.infection.hidden = true;
elements.infection.tick = function (pixel) {
tryDelete(pixel.x, pixel.y);
}
elements.infection.onPlace = function (pixel) {
tryDelete(pixel.x, pixel.y);
}
elements.antibody.hidden = true;
elements.antibody.tick = function (pixel) {
tryDelete(pixel.x, pixel.y);
}
elements.antibody.onPlace = function (pixel) {
tryDelete(pixel.x, pixel.y);
}

View File

@ -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
}
}
}

70
mods/orchidslibrary.js Normal file
View File

@ -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})`;
}

915
mods/organism.js Normal file
View File

@ -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 }

File diff suppressed because it is too large Load Diff

54
mods/rich_grain.js Normal file
View File

@ -0,0 +1,54 @@
pixelColorPick = function(pixel,customColor=null) {
let element = pixel.element;
let elementInfo = elements[element];
//if (elementInfo.behavior instanceof Array) {
if (pixel.charge && elementInfo.colorOn) {
customColor = elementInfo.colorOn;
}
let rgb;
if (customColor !== null) {
if (Array.isArray(customColor)) {
customColor = customColor[Math.floor(Math.random() * customColor.length)];
}
if (customColor.startsWith("#")) {
customColor = hexToRGB(customColor);
}
rgb = customColor;
}
else {
rgb = elements[element].colorObject; // {r, g, b}
// If rgb is an array, choose a random item
if (Array.isArray(rgb)) {
rgb = rgb[Math.floor(Math.random() * rgb.length)];
}
}
// Randomly darken or lighten the RGB color
let grain = 15;
if (elementInfo.grain !== undefined) { grain = grain * elementInfo.grain }
let coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * grain);
let r = rgb.r + coloroffset;
let g = rgb.g + coloroffset;
let b = rgb.b + coloroffset;
// better_grain.js changes begin
let hsl = RGBToHSL([r,g,b]);
hsl[0] += coloroffset/1.5/255;
// console.log(hsl)
let rgb2 = HSLtoRGB(hsl);
r = Math.round(rgb2[0]); g = Math.round(rgb2[1]); b = Math.round(rgb2[2]);
// better_grain.js changes end
// Make sure the color is within the RGB range
r = Math.max(0, Math.min(255, r));
g = Math.max(0, Math.min(255, g));
b = Math.max(0, Math.min(255, b));
let color = "rgb("+r+","+g+","+b+")";
/*}
else {
var color = elementInfo.color;
if (Array.isArray(color)) {
color = color[Math.floor(Math.random() * color.length)];
}
}*/
return color;
}

File diff suppressed because it is too large Load Diff

20
mods/sensitive.js Normal file
View File

@ -0,0 +1,20 @@
// Makes all elements EXTREAMLY sensitive to air or anything else.
runAfterLoad(function() {
for (const elem in elements) {
if (["fire", "explosion", "smoke"].includes(elem)) continue;
if (!elements[elem].onPlace) {
elements[elem].onPlace = function(pixel) {
changePixel(pixel, "explosion");
};
} else {
const oldOnPlace = elements[elem].onPlace;
elements[elem].onPlace = function(pixel) {
oldOnPlace(pixel);
changePixel(pixel, "explosion");
};
}
}
});

287
mods/solubility.js Normal file
View File

@ -0,0 +1,287 @@
/*
* Version 1.1.0
*/
dependOn("orchidslibrary.js", ()=>{
elements.water.reactions.salt = undefined;
elements.water.reactions.sugar = undefined;
elements.water.properties = {capacity: 100, elemsDissolved: {}};
elements.salt.solubility = {water: 0.36, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.sugar.solubility = {water: 2, visc: 850, color: ["#9bb0de", "#a8bbe3", "#a2b8e8", "#a7b7d9"]};
elements.lye.solubility = {water: 1.09, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.caustic_potash.solubility = {water: 1.1, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.potassium_salt.solubility = {water: 0.3397, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.borax.solubility = {water: 0.041, color: ["#658ce0", "#7299ed", "#7597e0", "#78a1fa"]};
elements.epsom_salt.solubility = {water: 0.351, color: ["#658ce0", "#7299ed", "#7597e0", "#78a1fa"]};
elements.sodium_acetate.solubility = {water: 1.233, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.baking_soda.solubility = {water: 0.097, color: ["#7ca3f7", "#7798e0", "#89abf5", "#96b8ff"]};
elements.copper_sulfate.solubility = {water: 0.32, color: ["#4a68f0", "#3358ff", "#2948d6", "#2146ed"]};
elements.lye.reactions.water = undefined;
elements.soap.reactions.water = undefined;
elements.ash.solubility = {water: 1.1, func: function(p1, p2){
if(p1.elemsDissolved.caustic_potash != undefined){
p1.elemsDissolved.caustic_potash += p1.elemsDissolved.ash;
p1.elemsDissolved.ash = 0;
} else {
p1.elemsDissolved.caustic_potash = p1.elemsDissolved.ash;
p1.elemsDissolved.ash = 0;
}
if(p2.dissolved >= 100){
changePixel(p2, getItem(["limestone", "quicklime", "charcoal", "dust", "dust"]));
p2.dissolved = undefined;
}
}};
elements.water.reactions.ash = undefined;
function getItem(obj){
let res;
if(Array.isArray(obj)){
res = obj[Math.round(Math.random()*obj.length)];
while(res == null){
res = obj[Math.round(Math.random()*obj.length)];
}
} else {
res = obj;
}
return res;
}
function aqueousReaction(p1, p2){
for(let elem in p1.elemsDissolved){
if(elements[elem].reactions != null && p2.element != "water" && (elements[elem].reactions[p2.element] != undefined || (elements[p2.element].reactions != null && elements[p2.element].reactions[elem] != undefined))){
let r = elements[elem].reactions[p2.element] || elements[p2.element].reactions[elem];
if(r.tempMin && !((p1.temp >= r.tempMin) && (p2.temp >= r.tempMin))){
return false;
}
if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){
return false;
}
if(r.charged && !(p1.charge || p2.charge)){
return false;
}
let c = (r.chance != undefined) ? r.chance : 1;
c = c*((p1.elemsDissolved[elem]/100)/elements[elem].solubility.water);
if(Math.random() > c){
return false;
}
if(r.aqFunc){
r.aqFunc(p1, p2);
}
if(r.elem1 != undefined){
let e = getItem(r.elem1);
if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
p1.elemsDissolved[e] = p1.elemsDissolved[elem];
p1.elemsDissolved[elem] = undefined;
} else {
if(e === null){
deletePixel(p1.x, p1.y);
} else {
changePixel(p1, e);
}
}
}
if(r.elem2 != undefined){
changePixel(p2, getItem(r.elem2));
}
if(r.charge1){
p1.charge = r.charge1;
}
if(r.charge2){
p2.charge = r.charge2;
}
if(r.stain1){
stainPixel(p1,r.stain1,0.05);
}
if(r.stain2){
stainPixel(p2,r.stain2,0.05);
}
} else if (p2.element == "water"){
for(let e2 in p2.elemsDissolved){
if(elements[elem].reactions != undefined && elements[elem].reactions[e2] != undefined){
let r = elements[elem].reactions[e2];
if(r.tempMin && !((p1.temp >= r.tempMin) && (p2.temp >= r.tempMin))){
return false;
}
if(r.tempMax && !((p1.temp <= r.tempMax) && (p2.temp <= r.tempMax))){
return false;
}
if(r.charged && !(p1.charge || p2.charge)){
return false;
}
let c = (r.chance != undefined) ? r.chance : 1;
c = c*((p1.elemsDissolved[elem]/100)/elements[elem].solubility.water);
if(Math.random() > c){
return false;
}
if(r.aqFunc){
r.aqFunc(p1, p2);
}
if(r.elem1 != undefined){
let e = getItem(r.elem1);
if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
p1.elemsDissolved[e] = p1.elemsDissolved[elem];
p1.elemsDissolved[elem] = undefined;
} else {
if(e === null){
deletePixel(p1.x, p1.y);
} else {
changePixel(p1, e);
}
}
}
if(r.elem2 != undefined){
let e = getItem(r.elem2);
if(elements[e].solubility != undefined && elements[e].solubility.water != undefined){
p2.elemsDissolved[e] = p1.elemsDissolved[elem];
p2.elemsDissolved[elem] = undefined;
} else {
if(e === null){
deletePixel(p2.x, p2.y);
} else {
changePixel(p2, e);
}
}
}
if(r.charge1){
p1.charge = r.charge1;
}
if(r.charge2){
p2.charge = r.charge2;
}
if(r.stain1){
stainPixel(p1,r.stain1,0.05);
}
if(r.stain2){
stainPixel(p2,r.stain2,0.05);
}
}
}
}
}
}
function updateColor(pixel){
let c = pixel.oColor;
for(let element in pixel.elemsDissolved){
//if(elements[element].solubility.color != undefined){
let color = (elements[element].solubility.color != undefined) ? getItem(elements[element].solubility.color) : getItem(elements[element].color);
/*if(Array.isArray(elements[element].solubility.color)){
color = elements[element].solubility.color[Math.round(Math.random()*elements[element].solubility.color.length)];
while(color == undefined){
color = elements[element].solubility.color[Math.round(Math.random()*elements[element].solubility.color.length)];
}
} else {
color = elements[element].solubility.color;
}*/
if(color.startsWith("#")){
color = hexToRGB(color);
} else if(color.startsWith("rgb(")){
color = getRGB(color);
}
c = interpolateRgb(getRGB(c), color, ((pixel.elemsDissolved[element]/100)/elements[element].solubility.water) || 0.01);
//console.log(rgb, color, getRGB(pixel.oColor), ((pixel.elemsDissolved[elem]/100)/elements[elem].solubility.water));
}
pixel.color = c;
//}
}
function solventTick(pixel) {
if(pixel.start = pixelTicks+5){
pixel.oColor = pixel.color;
}
pixel.capacity = (1+((pixel.temp-20)/80))*100;
for(let coords of adjacentCoords){
let x = pixel.x+coords[0], y = pixel.y+coords[1];
let p2 = getPixel(x,y);
let total = 0;
for(let elem in pixel.elemsDissolved){
total += pixel.capacity*((pixel.elemsDissolved[elem]/100)/elements[elem].solubility.water);
}
if(p2 != null){
aqueousReaction(pixel, p2);
}
if(p2 != null && total < pixel.capacity){
if(elements[p2.element].solubility != null && elements[p2.element].solubility[pixel.element] != null){
let solubilityObj = elements[p2.element].solubility;
p2.dissolved = (p2.dissolved == undefined) ? elements[p2.element].solubility[pixel.element] : p2.dissolved+elements[p2.element].solubility[pixel.element];
if(pixel.elemsDissolved[p2.element] == undefined){
pixel.elemsDissolved[p2.element] = elements[p2.element].solubility[pixel.element];
} else {
pixel.elemsDissolved[p2.element] += elements[p2.element].solubility[pixel.element];
}
updateColor(pixel, p2.element);
if(solubilityObj.func != undefined){
solubilityObj.func(pixel, p2);
}
if(p2.dissolved >= 100){
deletePixel(p2.x, p2.y);
}
}
} else if(total > (pixel.capacity+20) && p2 == null) {
let solArr = [], elemArr = [];
for(let elem in pixel.elemsDissolved){
elemArr.push(elem);
solArr.push(elements[elem].solubility[pixel.element]);
}
let index = solArr.indexOf(Math.min(...solArr));
if(isEmpty(x,y) && !outOfBounds(x,y)){
createPixel(elemArr[index], x, y);
let max = (pixel.elemsDissolved[elemArr[index]] > (total-pixel.capacity)) ? total-pixel.capacity : pixel.elemsDissolved[elemArr[index]];
pixelMap[x][y].dissolved = 100-max;
updateColor(pixel);
pixel.elemsDissolved[elemArr[index]] -= max;
}
}
else if (p2 != null && p2.element == "water"){
for(let elem in pixel.elemsDissolved){
if(p2.elemsDissolved[elem] == undefined) {p2.elemsDissolved[elem] = 0;};
if(p2.elemsDissolved[elem] > pixel.elemsDissolved[elem] && pixel.elemsDissolved[elem]/100 < elements[elem].solubility[pixel.element]){
p2.elemsDissolved[elem]--;
pixel.elemsDissolved[elem]++;
updateColor(pixel);
updateColor(p2);
} else if (p2.elemsDissolved[elem] < pixel.elemsDissolved[elem] && p2.elemsDissolved[elem]/100 < elements[elem].solubility[pixel.element]) {
p2.elemsDissolved[elem]++;
pixel.elemsDissolved[elem]--;
updateColor(pixel);
updateColor(p2);
}
}
}
}
if(pixel.temp >= elements[pixel.element].solventTempHigh){
let elem = null;
let num = Math.random();
if(elem === null){
for(let e in pixel.elemsDissolved){
if(num <= ((pixel.elemsDissolved[e]/100)/elements[e].solubility.water)/4){
elem = e;
}
}
}
elem = (elem == null) ? "steam" : elem;
changePixel(pixel, elem, 110);
pixel.dissolvedElems = {};
}
}
behaviors.SOLVENT = function(pixel){
let visc = 0;
for(let elem in pixel.elemsDissolved){
if(elements[elem].solubility.visc != undefined){
visc += ((pixel.elemsDissolved[elem]/100)/elements[elem].solubility[pixel.element])*elements[elem].solubility.visc;
}
}
if(elements[pixel.element].viscosity != undefined){
visc = visc*(elements[pixel.element].viscosity/1000);
}
let chance = 1-(visc/1000);
let dir = (Math.random()<chance) ? (Math.random() < 0.5) ? 1 : -1 : 0;
if(!tryMove(pixel, pixel.x+dir, pixel.y+1) && !tryMove(pixel, pixel.x, pixel.y+1)){
tryMove(pixel, pixel.x+dir, pixel.y);
}
}
elements.water.tick = solventTick;
elements.water.behavior = behaviors.SOLVENT;
elements.water.tempHigh = undefined;
elements.water.solventTempHigh = 101;
elements.steam.tempLow = 99
}, true);

182
mods/static.js Normal file
View File

@ -0,0 +1,182 @@
// IIFE to prevent this mod from breaking
(() => {
let staticMode = 0
function randomGrayscale() {
const value = Math.floor(Math.random() * 256);
return `rgb(${value}, ${value}, ${value})`;
}
function randomColor() {
return '#' + Math.floor(Math.random() * 0xFFFFFF).toString(16).padStart(6, '0');
}
function loopScreen(callback) {
for (let x = 0; x <= width; x++) {
for (let y = 0; y <= height; y++) {
callback(x, y)
}
}
}
/**
* Converts RGB to RGBA
* @param {string|object} rgb - Either "rgb(r, g, b)" string or {r, g, b} object
* @param {number} alpha - Alpha value between 0 and 1
* @returns {string} RGBA string
*/
function rgbToRgba(rgb, alpha = 1) {
let r, g, b;
if (typeof rgb === 'string') {
const match = rgb.match(/\d+/g);
if (!match || match.length < 3) throw new Error('Invalid RGB string');
[r, g, b] = match.map(Number);
} else if (typeof rgb === 'object') {
({ r, g, b } = rgb);
} else {
throw new Error('Invalid input: must be RGB string or object');
}
alpha = Math.min(Math.max(alpha, 0), 1);
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
/**
* Updates the alpha value of an rgba string
* @param {string} rgbaString - Example: "rgba(255, 0, 0, 0.5)"
* @param {number} newAlpha - New alpha value (0 to 1)
* @returns {string} - Updated rgba string
*/
function setAlpha(rgbaString, newAlpha) {
// Use a regex to capture the r, g, b values
const match = rgbaString.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\s*\)/);
if (!match) {
throw new Error("Invalid rgba string: " + rgbaString);
}
const [_, r, g, b] = match;
return `rgba(${r}, ${g}, ${b}, ${newAlpha})`;
}
function drawCircle(ctx, x, y, radius, options = {}) {
const { fill = 'blue', stroke = null, lineWidth = 1 } = options;
// Only compute offset if needed
const offset = lineWidth % 2 === 0 ? 0 : 0.5;
const cx = x + offset;
const cy = y + offset;
ctx.beginPath();
ctx.arc(cx, cy, radius, 0, Math.PI * 2);
// Set styles only if needed
if (fill) {
if (ctx.fillStyle !== fill) ctx.fillStyle = fill;
ctx.fill();
}
if (stroke) {
if (ctx.strokeStyle !== stroke) ctx.strokeStyle = stroke;
if (ctx.lineWidth !== lineWidth) ctx.lineWidth = lineWidth;
ctx.stroke();
}
}
function toggleStaticMode() {
staticMode = (staticMode + 1) % 5
}
if (isMobile) {
const staticButton = document.createElement("button")
staticButton.id = "staticButton"
staticButton.title = "Change static mode"
staticButton.classList.add("controlButton")
staticButton.onclick = () => {
toggleStaticMode()
}
staticButton.textContent = "Static"
document.getElementById("pauseButton").before(staticButton)
}
keybinds["KeyS"] = () => {
toggleStaticMode()
}
keybinds["KeyK"] = () => {
toggleStaticMode()
}
// Static rendering loop
let cachedColorMap = []
renderPostPixel(function (ctx) {
if (!staticMode) return
if (!paused) {
cachedColorMap = []
} else {
cachedColorMap.forEach(renderObj => {
let x = renderObj.x
let y = renderObj.y
let color = renderObj.color
if (color.match(/^#[0-9A-Fa-f]{6}$/)) {
color = rgbToRgba(hexToRGB(color), 1)
}
let colorFullAlpha = setAlpha(color, 1)
let isCircle = renderObj.circle
if (isCircle) {
drawCircle(ctx, canvasCoord(x) + 2.1, canvasCoord(y) + 2.1, 3, { fill: color })
} else {
drawSquare(ctx, colorFullAlpha, x, y, 1, 0.2)
}
})
return
}
loopScreen((x, y) => {
if (staticMode === 1) {
let color = randomGrayscale()
drawSquare(ctx, color, x, y, 1, 0.2)
cachedColorMap.push({ x, y, color })
}
if (staticMode === 2) {
let color = randomColor()
drawSquare(ctx, color, x, y, 1, 0.2)
cachedColorMap.push({ x, y, color })
}
if (staticMode === 3) {
let color = rgbToRgba(randomGrayscale(), 0.2)
drawCircle(ctx, canvasCoord(x) + 2.1, canvasCoord(y) + 2.1, 3, { fill: color })
cachedColorMap.push({ x, y, color, circle: true })
}
if (staticMode === 4) {
let color = rgbToRgba(hexToRGB(randomColor()), 0.2)
drawCircle(ctx, canvasCoord(x) + 2.1, canvasCoord(y) + 2.1, 3, { fill: color })
cachedColorMap.push({ x, y, color, circle: true })
}
// Currently broken with pausing
/*
if (staticMode === 5) {
let color = rgbToRgba(randomGrayscale(), 0.2)
const random = Math.random()
if (random <= 0.5) {
drawSquare(ctx, color, x, y)
cachedColorMap.push({ x, y, color })
} else {
drawCircle(ctx, canvasCoord(x) + 2.1, canvasCoord(y) + 2.1, 3, { fill: color })
cachedColorMap.push({ x, y, color, circle: true })
}
}
if (staticMode === 6) {
let color = rgbToRgba(hexToRGB(randomColor()), 0.2)
const random = Math.random()
if (random <= 0.5) {
drawSquare(ctx, color, x, y)
cachedColorMap.push({ x, y, color })
} else {
drawCircle(ctx, canvasCoord(x) + 2.1, canvasCoord(y) + 2.1, 3, { fill: color })
cachedColorMap.push({ x, y, color, circle: true })
}
}
*/
})
})
})()

51
mods/war.js Normal file
View File

@ -0,0 +1,51 @@
elements.land = {
color: "#096600",
category: "war",
behavior: behaviors.WALL,
};
elements.red = {
name: "redville",
color: "#880000",
category: "war",
behavior: [
"XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5|XX",
"CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5|XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5",
"XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5|XX",
],
};
elements.blu = {
name: "blue city",
color: "#000088",
category: "war",
behavior: [
"XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5|XX",
"CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5|XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5",
"XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5|XX",
],
};
elements.kerdly = {
name: "water",
category: "war",
color: "#5599ff",
behavior: behaviors.WALL,
};
elements.suselle = {
name: "redville water",
category: "war",
color: "#7777dd",
behavior: [
"XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5 AND CH:kralsei>suselle%1|XX",
"CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5 AND CH:kralsei>suselle%1|XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5 AND CH:kralsei>suselle%1",
"XX|CH:land>red%50 AND CH:blu>land%25 AND CH:kerdly>suselle%5 AND CH:kralsei>suselle%1|XX",
],
};
elements.kralsei = {
name: "blue city water",
category: "war",
color: "#3377ff",
behavior: [
"XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5 AND CH:suselle>kralsei%1|XX",
"CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5 AND CH:suselle>kralsei%1|XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5 AND CH:suselle>kralsei%1",
"XX|CH:land>blu%50 AND CH:red>land%25 AND CH:kerdly>kralsei%5 AND CH:suselle>kralsei%1|XX",
],
};

View File

@ -297,4 +297,4 @@ runAfterReset(() => {
runAfterLoad(() => {
patch_keybinds()
patch_ui()
})
})

View File

@ -98,10 +98,10 @@
<p><dfn>Sandboxels</dfn> is a falling-sand simulator playable in any web browser.</p>
<p>It brings nostalgia to players of old falling-sand games. This modern take on the genre has a strong focus on chemistry, life, and even food.</p>
<p>Players are allowed to freely experiment with over 500 different materials — liquids, powders, metals, plants, bugs, gases, and more — and see how they interact with each other in real time.</p>
<p>Sandboxels is releasing on Steam <strong><time>May 16th, 2025</time></strong> for Windows and macOS. Sandboxels is and always will be available to play in the browser as well.</p>
<p>Sandboxels released on Steam <strong><time>May 16th, 2025</time></strong> for Windows and macOS. Sandboxels is and always will be available to play in the browser as well.</p>
<h2>The Dev</h2>
<p>R74n was founded in 2017 as a web collective. We published Sandboxels in late 2021, and have been marketing it on <a href="https://www.youtube.com/@R74n/shorts" target="_blank">YouTube</a> and <a href="https://tiktok.com/@r74n.com" target="_blank">TikTok</a>, where it has amassed millions of views.</p>
<p>R74n was founded in 2017 as a web collective. We published Sandboxels in late 2021, and have been marketing it on <a href="https://www.youtube.com/@R74n/shorts" target="_blank">YouTube</a> and <a href="https://tiktok.com/@r74n.com" target="_blank">TikTok</a>, where it has amassed millions of views. Later on, we also began developing <a href="https://R74n.com/cook/" target="_blank">Infinite Chef</a> and <a href="https://R74n.com/gentown/" target="_blank">GenTown</a>.</p>
<h2>Official Trailer</h2>
<p style="text-align: center;">Watch the official trailer we posted for the Steam release!</p>