Merge branch 'main' of https://github.com/GGodPL/sandboxels
This commit is contained in:
commit
012477256f
30
CITATION.cff
30
CITATION.cff
|
|
@ -8,11 +8,35 @@ message: >-
|
|||
metadata from this file.
|
||||
type: software
|
||||
authors:
|
||||
- given-names: R74n
|
||||
email: contact@r74n.com
|
||||
affiliation: R74n
|
||||
- name: R74n
|
||||
email: contact@R74n.com
|
||||
date-start: '2017-05-02'
|
||||
website: 'https://r74n.com/'
|
||||
identifiers:
|
||||
- type: doi
|
||||
value: 10.17605/OSF.IO/H7TDY
|
||||
- type: swh
|
||||
value: 'swh:1:rev:5a5813a8f4f418540f1bdb765d293735541bf7fd'
|
||||
- type: url
|
||||
value: 'https://sandboxels.r74n.com/'
|
||||
- type: doi
|
||||
value: 10.5281/zenodo.10044909
|
||||
- type: other
|
||||
value: /g/11spmybz10
|
||||
description: KGMID
|
||||
- type: url
|
||||
value: 'https://purl.org/r74n/sandboxels'
|
||||
description: PURL
|
||||
- type: url
|
||||
value: 'https://w3id.org/r74n/sandboxels'
|
||||
description: W3ID
|
||||
repository-code: 'https://github.com/R74nCom/sandboxels'
|
||||
url: 'https://sandboxels.r74n.com'
|
||||
abstract: >-
|
||||
Sandboxels is a free falling-sand simulator that can be
|
||||
played in your browser. It features heat simulation,
|
||||
electricity, density, chemical reactions, cooking, and
|
||||
fire spread.
|
||||
keywords:
|
||||
- R74n
|
||||
- Sandboxels
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
113
changelog.html
113
changelog.html
|
|
@ -109,6 +109,117 @@
|
|||
<p>The original <a href="https://sandboxels.r74n.com/changelog.txt">plain text version</a> of this is still maintained.</p>
|
||||
</div>
|
||||
|
||||
<h2 id="1.9.1">[Version 1.9.1 - December 1, 2023 - Cozy Solstice]</h2>
|
||||
<ul>
|
||||
<li>+ Pipe</li>
|
||||
<li> 1. Draw a line with Pipe, maybe while paused</li>
|
||||
<li> 2. Wait for walls to form around it</li>
|
||||
<li> 3. Erase an exit point and allow Pipe to generate</li>
|
||||
<li>+ Mayo</li>
|
||||
<li>+ Mulch</li>
|
||||
<li>+ Porcelain Shard (Hidden)</li>
|
||||
<li>+ Jelly (Hidden)</li>
|
||||
<li>[Coffee]</li>
|
||||
<li>+ Coffee Bean</li>
|
||||
<li>+ Coffee Ground (Hidden)</li>
|
||||
<li>+ Coffee (Hidden)</li>
|
||||
<li>[Nuts]</li>
|
||||
<li>+ Nuts</li>
|
||||
<li>+ Nut Meat (Hidden, from crushing)</li>
|
||||
<li>+ Nut Butter (Hidden, from cooking)</li>
|
||||
<li>+ Nut Milk (Hidden, from soaking)</li>
|
||||
<li>[Festivities]</li>
|
||||
<li>+ Candy is candy cane-colored</li>
|
||||
<li>+ Mashed Potato (Hidden)</li>
|
||||
<li>+ Skin will warm itself up when cold</li>
|
||||
<li>[Other Changes]</li>
|
||||
<li>+ Roots grow through Grass</li>
|
||||
<li>~ Saplings no longer turn to wood all at once</li>
|
||||
<li>~ Tree Branches no longer grow when burning</li>
|
||||
<li>~ Tree Branches, Plant, and Grass are less flammable</li>
|
||||
<li>+ Soda deoxidizes Rust and Copper</li>
|
||||
<li>+ Balloons pop near absolute zero</li>
|
||||
<li>+ Balloons pop when touching Clouds</li>
|
||||
<li>+ Humans can consume Tomatoes, Pumpkin Seeds, and Cream</li>
|
||||
<li>+ Humans get gas when eating Beans</li>
|
||||
<li>+ Humans can take Gold Coins</li>
|
||||
<li>+ Skin spawns at average body temperature</li>
|
||||
<li>~ Skin no longer heals wounds</li>
|
||||
<li>+ Snails can eat Lettuce</li>
|
||||
<li>+ Tadpoles and Evergreen can be smashed</li>
|
||||
<li>~ Rats no longer eat Rotten Meat</li>
|
||||
<li>+ Rats can drink Milk</li>
|
||||
<li>+ Lichen convert Gravel and Rock Wall to Dirt</li>
|
||||
<li>+ Yeast ferments Sugar Water and Soda</li>
|
||||
<li>+ Caramel freezes into Candy much colder</li>
|
||||
<li>+ Baked Batter breaks into Crumbs</li>
|
||||
<li>+ Rotten Meat or Cheese and Flies remove Fragrance</li>
|
||||
<li>+ Primordial Soup spawns at a warmer temperature</li>
|
||||
<li>+ Ammonia affects Pumpkin Seeds, Herbs, and Tomatoes</li>
|
||||
<li>+ Glue can fix shards</li>
|
||||
<li>+ Salt makes Water colder</li>
|
||||
<li>+ Water breaks down Confetti into Cellulose</li>
|
||||
<li>+ Hydrogen burns into some Steam</li>
|
||||
<li>+ Hydrogen fusion releases Neutrons</li>
|
||||
<li>+ Anesthesia breaks down to Oxygen at high temperatures</li>
|
||||
<li>+ Castner–Kellner process</li>
|
||||
<li>+ Sodium and Mercury reaction shocks and releases heat</li>
|
||||
<li>+ Sulfur burns into Stench</li>
|
||||
<li>+ Sugar dissolves in Milk</li>
|
||||
<li>+ Salt dissolves in Sauce and Melted Cheese</li>
|
||||
<li>+ Juice can be radiated</li>
|
||||
<li>+ Carbonating Juice makes Soda</li>
|
||||
<li>+ Seltzer can dissolve Limestone over time</li>
|
||||
<li>+ Water can weather Limestone into Sand</li>
|
||||
<li>+ Vinegar slowly dissolves the shell of Eggs</li>
|
||||
<li>+ Baking Soda releases CO₂ when heated</li>
|
||||
<li>+ Tuff melts into Magma</li>
|
||||
<li>+ E-cloner ignores Wire, Sensor, and Battery</li>
|
||||
<li>+ Cloners ignore Wall</li>
|
||||
<li>+ Incense recipe</li>
|
||||
<li>~ Fragrance now dissipates over time</li>
|
||||
<li>~ Oxygen spreads Fragrance and Stench slower</li>
|
||||
<li>~ Molten Solder no longer makes Fire</li>
|
||||
<li>~ Recolored Molten Solder</li>
|
||||
<li>~ Recolored Gold Coin</li>
|
||||
<li>+ Insulation won't mix unless Shift is held</li>
|
||||
<li>+ LEDs can break into Glass Shards</li>
|
||||
<li>+ Cloners display element on hover</li>
|
||||
<li>+ Author name appears if present in loaded save</li>
|
||||
<li>+ Pressing ; toggles Replace mode</li>
|
||||
<li>+ Methane Ice</li>
|
||||
<li>- Removed Molten Baking Soda</li>
|
||||
<li>[Bug Fixes]</li>
|
||||
<li>~ Fixed: Flicker when stepping frame</li>
|
||||
<li>~ Fixed: Lamp Oil burns forever</li>
|
||||
<li>~ Fixed: Mushroom Gills don't conduct heat</li>
|
||||
<li>~ Fixed: Pumpkin, Stained Glass, Skin, Sponge, E-cloner can be dragged</li>
|
||||
<li>~ Fixed: God Raying Gray Goo makes Rainbow</li>
|
||||
<li>~ Fixed: Soda deletes Salt Water quickly</li>
|
||||
<li>~ Fixed: Juice Ice darkens when melting</li>
|
||||
<li>~ Fixed: Sand from Water weathering Tuff uses wrong color</li>
|
||||
<li>~ Fixed: Hail doesn't apply color variants when breaking</li>
|
||||
<li>~ Fixed: Confirmation appears when dropping save onto empty canvas</li>
|
||||
<li>~ Fixed: Sauce density too high</li>
|
||||
<li>~ Fixed: Hail is way too cold</li>
|
||||
<li>~ Fixed: Humans continue panicking after extinguished</li>
|
||||
<li>~ Fixed: Cloned pixels don't change state based on Cloner temperature</li>
|
||||
<li>~ Fixed: Antifire doesn't react with Antifluid right</li>
|
||||
<li>~ Fixed: Porcelain reforms immediately after breaking when hot</li>
|
||||
<li>~ Fixed: Hot Bomb often melts itself</li>
|
||||
<li>~ Fixed: Hard Yolk can't be mixed into Batter/Dough</li>
|
||||
<li>[Technical]</li>
|
||||
<li>+ Prop tool</li>
|
||||
<li>+ Option for uncompressed raw save data</li>
|
||||
<li>~ Save version is now sb2</li>
|
||||
<li> ~ New saves may not work in older versions</li>
|
||||
<li> ~ Old saves will work fine</li>
|
||||
<li> + Version handling system, warnings</li>
|
||||
<li>+ Random will work when placed by cheating</li>
|
||||
<li>~ FW_Ember no longer has a long name</li>
|
||||
<li>+ runAfterAutogen function</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="1.9">[Version 1.9 - October 13, 2023 - Local Saves]</h2>
|
||||
<ul>
|
||||
<li>+ Local Saves</li>
|
||||
|
|
@ -126,7 +237,7 @@
|
|||
<li>~ Thermal View now uses a more useful logarithmic scale</li>
|
||||
<li>[Changes]</li>
|
||||
<li>+ Resetting now adjusts canvas size if needed</li>
|
||||
<li>+ Dot appears in center of cursor</li>
|
||||
<li>+ Setting for dot in center of cursor</li>
|
||||
<li>+ E-cloner can select an element while unpowered</li>
|
||||
<li>+ E-cloner ignores Wires and E-walls</li>
|
||||
<li>+ Grass can spread on Sand, Clay, and Mycelium</li>
|
||||
|
|
|
|||
111
changelog.txt
111
changelog.txt
|
|
@ -7,6 +7,115 @@ See sneak peaks for upcoming updates on the Discord: https://discord.gg/ejUc6YPQ
|
|||
|
||||
A fancier version of this changelog can be found here: https://sandboxels.R74n.com/changelog
|
||||
|
||||
[Version 1.9.1 - December 1, 2023 - Cozy Solstice]
|
||||
+ Pipe
|
||||
1. Draw a line with Pipe, maybe while paused
|
||||
2. Wait for walls to form around it
|
||||
3. Erase an exit point and allow Pipe to generate
|
||||
+ Mayo
|
||||
+ Mulch
|
||||
+ Porcelain Shard (Hidden)
|
||||
+ Jelly (Hidden)
|
||||
[Coffee]
|
||||
+ Coffee Bean
|
||||
+ Coffee Ground (Hidden)
|
||||
+ Coffee (Hidden)
|
||||
[Nuts]
|
||||
+ Nuts
|
||||
+ Nut Meat (Hidden, from crushing)
|
||||
+ Nut Butter (Hidden, from cooking)
|
||||
+ Nut Milk (Hidden, from soaking)
|
||||
[Festivities]
|
||||
+ Candy is candy cane-colored
|
||||
+ Mashed Potato (Hidden)
|
||||
+ Skin will warm itself up when cold
|
||||
[Other Changes]
|
||||
+ Roots grow through Grass
|
||||
~ Saplings no longer turn to wood all at once
|
||||
~ Tree Branches no longer grow when burning
|
||||
~ Tree Branches, Plant, and Grass are less flammable
|
||||
+ Soda deoxidizes Rust and Copper
|
||||
+ Balloons pop near absolute zero
|
||||
+ Balloons pop when touching Clouds
|
||||
+ Humans can consume Tomatoes, Pumpkin Seeds, and Cream
|
||||
+ Humans get gas when eating Beans
|
||||
+ Humans can take Gold Coins
|
||||
+ Skin spawns at average body temperature
|
||||
~ Skin no longer heals wounds
|
||||
+ Snails can eat Lettuce
|
||||
+ Tadpoles and Evergreen can be smashed
|
||||
~ Rats no longer eat Rotten Meat
|
||||
+ Rats can drink Milk
|
||||
+ Lichen convert Gravel and Rock Wall to Dirt
|
||||
+ Yeast ferments Sugar Water and Soda
|
||||
+ Caramel freezes into Candy much colder
|
||||
+ Baked Batter breaks into Crumbs
|
||||
+ Rotten Meat or Cheese and Flies remove Fragrance
|
||||
+ Primordial Soup spawns at a warmer temperature
|
||||
+ Ammonia affects Pumpkin Seeds, Herbs, and Tomatoes
|
||||
+ Glue can fix shards
|
||||
+ Salt makes Water colder
|
||||
+ Water breaks down Confetti into Cellulose
|
||||
+ Hydrogen burns into some Steam
|
||||
+ Hydrogen fusion releases Neutrons
|
||||
+ Anesthesia breaks down to Oxygen at high temperatures
|
||||
+ Castner–Kellner process
|
||||
+ Sodium and Mercury reaction shocks and releases heat
|
||||
+ Sulfur burns into Stench
|
||||
+ Sugar dissolves in Milk
|
||||
+ Salt dissolves in Sauce and Melted Cheese
|
||||
+ Juice can be radiated
|
||||
+ Carbonating Juice makes Soda
|
||||
+ Seltzer can dissolve Limestone over time
|
||||
+ Water can weather Limestone into Sand
|
||||
+ Vinegar slowly dissolves the shell of Eggs
|
||||
+ Baking Soda releases CO₂ when heated
|
||||
+ Tuff melts into Magma
|
||||
+ E-cloner ignores Wire, Sensor, and Battery
|
||||
+ Cloners ignore Wall
|
||||
+ Incense recipe
|
||||
~ Fragrance now dissipates over time
|
||||
~ Oxygen spreads Fragrance and Stench slower
|
||||
~ Molten Solder no longer makes Fire
|
||||
~ Recolored Molten Solder
|
||||
~ Recolored Gold Coin
|
||||
+ Insulation won't mix unless Shift is held
|
||||
+ LEDs can break into Glass Shards
|
||||
+ Cloners display element on hover
|
||||
+ Author name appears if present in loaded save
|
||||
+ Pressing ; toggles Replace mode
|
||||
+ Methane Ice
|
||||
- Removed Molten Baking Soda
|
||||
[Bug Fixes]
|
||||
~ Fixed: Flicker when stepping frame
|
||||
~ Fixed: Lamp Oil burns forever
|
||||
~ Fixed: Mushroom Gills don't conduct heat
|
||||
~ Fixed: Pumpkin, Stained Glass, Skin, Sponge, E-cloner can be dragged
|
||||
~ Fixed: God Raying Gray Goo makes Rainbow
|
||||
~ Fixed: Soda deletes Salt Water quickly
|
||||
~ Fixed: Juice Ice darkens when melting
|
||||
~ Fixed: Sand from Water weathering Tuff uses wrong color
|
||||
~ Fixed: Hail doesn't apply color variants when breaking
|
||||
~ Fixed: Confirmation appears when dropping save onto empty canvas
|
||||
~ Fixed: Sauce density too high
|
||||
~ Fixed: Hail is way too cold
|
||||
~ Fixed: Humans continue panicking after extinguished
|
||||
~ Fixed: Cloned pixels don't change state based on Cloner temperature
|
||||
~ Fixed: Antifire doesn't react with Antifluid right
|
||||
~ Fixed: Porcelain reforms immediately after breaking when hot
|
||||
~ Fixed: Hot Bomb often melts itself
|
||||
~ Fixed: Hard Yolk can't be mixed into Batter/Dough
|
||||
[Technical]
|
||||
+ Prop tool
|
||||
+ Option for uncompressed raw save data
|
||||
~ Save version is now sb2
|
||||
~ New saves may not work in older versions
|
||||
~ Old saves will work fine
|
||||
+ Version handling system, warnings
|
||||
+ Random will work when placed by cheating
|
||||
~ FW_Ember no longer has a long name
|
||||
+ runAfterAutogen function
|
||||
|
||||
[Version 1.9 - October 13, 2023 - Local Saves]
|
||||
+ Local Saves
|
||||
+ SAVES button
|
||||
|
|
@ -23,7 +132,7 @@ A fancier version of this changelog can be found here: https://sandboxels.R74n.c
|
|||
~ Thermal View now uses a more useful logarithmic scale
|
||||
[Changes]
|
||||
+ Resetting now adjusts canvas size if needed
|
||||
+ Dot appears in center of cursor
|
||||
+ Setting for dot in center of cursor
|
||||
+ E-cloner can select an element while unpowered
|
||||
+ E-cloner ignores Wires and E-walls
|
||||
+ Grass can spread on Sand, Clay, and Mycelium
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
<tr><td>Erase pixels</td> <td><kbd>Right Click</kbd></td></tr>
|
||||
<tr><td>Pick element</td> <td><kbd>Middle Click</kbd></td></tr>
|
||||
<tr><td>Pause simulation</td> <td><kbd>Space</kbd> or <kbd>P</kbd></td></tr>
|
||||
<tr><td>Intensify effect</td> <td><kbd>Shift</kbd> + <kbd style="background-color:red;">Heat</kbd>/<kbd style="background-color:blue;">Cool</kbd>/<kbd style="background-color:white;color:black">Drag</kbd>/<kbd style="background-color:#fff4b5;color:black">Mix</kbd>/<kbd style="background-color:yellow;color:black">Shock</kbd>/<kbd style="background-color:888888;color:white">Smash</kbd></td></tr>
|
||||
<tr><td>Intensify effect</td> <td><kbd>Shift</kbd> + <kbd style="background-color:red;">Heat</kbd>/<kbd style="background-color:blue;">Cool</kbd>/<kbd style="background-color:#c1cfb6;color:black">Drag</kbd>/<kbd style="background-color:#fff4b5;color:black">Mix</kbd>/<kbd style="background-color:yellow;color:black">Shock</kbd>/<kbd style="background-color:888888;color:white">Smash</kbd></td></tr>
|
||||
<tr><td>Draw line</td> <td><kbd>Shift</kbd> + <kbd>Click</kbd></td></tr>
|
||||
<tr><td>Change cursor size</td> <td><kbd>Scroll</kbd> or <kbd>+</kbd><kbd>-</kbd> or <kbd>[</kbd><kbd>]</kbd></td></tr>
|
||||
<tr><td>Cursor size 1</td> <td><kbd>Shift</kbd> + <kbd>-</kbd></td></tr>
|
||||
|
|
@ -103,6 +103,8 @@
|
|||
<tr><td>Toggle GUI</td> <td><kbd>F1</kbd></td></tr>
|
||||
<tr><td>Capture screenshot</td> <td><kbd>C</kbd> or <kbd>F2</kbd></td></tr>
|
||||
<tr><td>Paste Image or Load Save File</td> <td><kbd>Ctrl</kbd> + <kbd>V</kbd> or <kbd>Drag & Drop</kbd></td></tr>
|
||||
<tr><td>Close menu or clear logs</td> <td><kbd>Esc</kbd></td></tr>
|
||||
<tr><td>Toggle Replace mode</td> <td><kbd>;</kbd></td></tr>
|
||||
</table>
|
||||
|
||||
<h2>Button Info</h2>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ Middle Click = Pick Element
|
|||
Space or P = Pause Simulation
|
||||
Shift + Heat = Intense Heating
|
||||
Shift + Cool = Intense Cooling
|
||||
Shift + Mix = Include Fire & Smoke in Mixing
|
||||
Shift + Mix = Include Fire, Smoke, and more in Mixing
|
||||
Shift + Shock = Intense Shock
|
||||
Shift + Smash = Intense Smash
|
||||
Shift + Mouse = Draw Line
|
||||
Scroll = Change Cursor Size
|
||||
- or [ = Decrease Cursor Size
|
||||
|
|
@ -32,6 +33,8 @@ F1 = Toggle GUI / HUD
|
|||
F2 or C = Capture Screenshot
|
||||
Drag & Drop = Insert an image or load save file
|
||||
Paste = Insert an image or load save file
|
||||
Escape = Close Menu / Clear Logs
|
||||
; = Replace Mode
|
||||
|
||||
(Alt/Option can be used in place of Shift)
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@
|
|||
<p>This is usually because of a mod, so follow the steps above.</p>
|
||||
<p>If you've done those steps, it may be that you are using an unsupported or outdated browser. Try a different one, like Google Chrome or Microsoft Edge.</p>
|
||||
|
||||
<h2>Game runs slowly, low frame rate</h2>
|
||||
<p>Make sure you do not have Low Power Mode enabled on your device.</p>
|
||||
<p>This can limit JavaScript speeds, especially on mobile devices.</p>
|
||||
|
||||
<h2>Screen flickers or stays black unless paused</h2>
|
||||
<p>The canvas may flicker or disappear if an error occurs when trying to simulate certain pixels.</p>
|
||||
<p>Pausing should fix this temporarily, during which you can delete the offending pixels, or follow the steps above to uninstall any mods.</p>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
|
|
@ -134,6 +134,8 @@
|
|||
<img src="../icons/wordmark-white.png"> Icon + Wordmark (White, Black Border)<br>
|
||||
<img src="../icons/wordmark-black.png"> Icon + Wordmark (Black)<br>
|
||||
<img src="../icons/tall.webp"> Icon + Wordmark (Horizontal)<br>
|
||||
<img src="../icons/88x31.png" style="height:unset"> 88x31 Button<br>
|
||||
<img src="../icons/80x15.png" style="height:unset"> 80x15 Mini<br>
|
||||
<img src="../icons/cover.png"> Cover Image<br>
|
||||
|
||||
<h2>Sizes</h2>
|
||||
|
|
|
|||
1070
index.html
1070
index.html
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,46 @@
|
|||
# R74n Content License
|
||||
|
||||
> Version 1.0, December 2023
|
||||
> Original: https://R74n.com/license.txt
|
||||
|
||||
> Copyright (C) 2024 R74n
|
||||
> All Rights Reserved
|
||||
> Original content hosted at: https://sandboxels.R74n.com/
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified copies of this license document.
|
||||
|
||||
"Content" in this license refers to, but is not limited to, the following:
|
||||
- Software
|
||||
- Text (Documentation, code, etc.)
|
||||
- Media (Images, videos, audio, etc.)
|
||||
- Other files
|
||||
|
||||
"Our", "we", and "us" in this license refers to the licensor. "You" and "your" in this license refers to the agent (individual, organization, or otherwise) to which this license applies, being the one who distributes or modifies the content, or one that otherwise uses our content.
|
||||
|
||||
> R74n Content License
|
||||
> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION, AND MODIFICATION
|
||||
|
||||
1. We reserve the right to request that you remove our content from your project at any time, for any reason.
|
||||
|
||||
1a. If you do not comply with our request, we reserve the right to take legal action against you. We also reserve the right to take legal action without requesting that you remove our content directly.
|
||||
|
||||
1b. You are typically free to create and distribute scripts that modify our content, such as mods or plugins, with segments of our content (i.e. code) included, as long as you comply with the rest of this license. In the unlikely event that we request that you remove your script, you must comply with our request.
|
||||
|
||||
1c. We may submit our content to third-party services. This is explicitly allowed by this license, only if we ourselves have published it there, and us alone.
|
||||
|
||||
2. You may not use our content for any commercial purposes without our explicit permission, unless otherwise stated, including but not limited to:
|
||||
|
||||
- Advertising
|
||||
- Selling
|
||||
- Any other means of generating income
|
||||
|
||||
3. Any content you use must be clearly credited to us, unless otherwise stated.
|
||||
|
||||
3a. Any credit included in the original content, including, but not limited to, links, warnings, and popup messages, must not be removed or modified.
|
||||
|
||||
4. We are free to use any content you create using our content for any commercial or other purpose. Content you create includes, but is not limited to:
|
||||
|
||||
- User-generated content
|
||||
- Derivative works
|
||||
|
||||
5. Content (i.e. code) is provided with no warranty. We are not required to provide support for any of our content.
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://R74n.com/load.js"></script>
|
||||
<meta http-equiv='content-language' content='en-us'>
|
||||
|
||||
<style>
|
||||
html,
|
||||
|
|
@ -1557,7 +1558,6 @@
|
|||
<a href="https://sandboxels.R74n.com" class="backbutton"><</a>
|
||||
Sandboxels Lite (by <a href="http://markverb1.xyz">markverb1</a>)</h1><br>
|
||||
<div id="gameDiv">
|
||||
<h1>
|
||||
<canvas id="game" width="800" height="600" oncontextmenu="return false;">
|
||||
Your browser does not support the HTML5 canvas tag.
|
||||
</canvas>
|
||||
|
|
@ -1578,7 +1578,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
|
||||
<!-- i like having this but ublock blocks these things anyway -->
|
||||
|
|
|
|||
|
|
@ -89,6 +89,19 @@
|
|||
<tr><th>Mod Name</th><th>Description</th><th>Creator</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Top-rated Mods</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>chem.js</td><td>Adds several chemistry and physics-related elements</td><td>lllllllllwith10ls</td></tr>
|
||||
<tr><td>delete_all_of_element.js</td><td>Adds a tool that deletes every pixel of the element(s) the user clicks on</td><td>Alice</td></tr>
|
||||
<tr><td>edible_everything.js</td><td>Allows every element to be mixed into Batter and Dough</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>
|
||||
<tr><td>devtests.js</td><td>Experimental features from the Sandboxels developer; Currently there is Earthquake in Weapons</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
<tr><td>elementsManager.js</td><td>Create and edit custom elements</td><td>ggod</td></tr>
|
||||
<tr><td>the_ground_og.js</td><td>Adds several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
<tr><td>fey_and_more.js</td><td>Adds fairies, magic, and a lot of other things</td><td>Melecie</td></tr>
|
||||
<tr><td>velocity.js</td><td>Beta for explosion velocity, and later wind, which may come to the base game in the future</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
|
||||
<!----><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>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>
|
||||
|
|
@ -100,11 +113,9 @@
|
|||
<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>velocity.js</td><td>Beta for explosion velocity, and later wind, which may come to the base game in the future</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Tools & Settings</td></tr><!---->
|
||||
<tr><td>adjustablepixelsize.js</td><td>Allows you to set the pixelSize with a URL parameter</td><td>Alice</td></tr>
|
||||
<tr><td>betaworldgen.js</td><td>adds a more advanced world generation to the game</td><td>Alex</td></tr>
|
||||
<tr><td>betterModManager.js</td><td>Improvements to the Mod Manager</td><td>ggod</td></tr>
|
||||
<tr><td>betterSettings.js</td><td>Adds additional settings and functionality</td><td>ggod</td></tr>
|
||||
<tr><td>betterStats.js</td><td>Separate “real” and “set” TPS, meaning you can see what the TPS actually is, instead of only seeing what it’s set to</td><td>mollthecoder</td></tr>
|
||||
|
|
@ -112,6 +123,7 @@
|
|||
<tr><td>color_tools.js</td><td>Adds tools that manipulate colors</td><td>Alice</td></tr>
|
||||
<tr><td>controllable_pixel_test.js</td><td>Adds a pixel that can be controlled with the keyboard keys. <a href="https://github.com/R74nCom/sandboxels/commit/58dfa9477f2ed7ec9c44b00a35162e7c63bc129c">Read the commit description for more info.</a> [PC ONLY]</td><td>Alice</td></tr>
|
||||
<tr><td>cpt_alt.js</td><td>Adds a more destructive variant of the controllable pixel</td><td>Alice</td></tr>
|
||||
<tr><td>debugRework.js</td><td>Revamps the Debug tool</td><td>Fioushemastor</td></tr>
|
||||
<tr><td>delete_all_of_element.js</td><td>Adds a tool that deletes every pixel of the element(s) the user clicks on</td><td>Alice</td></tr>
|
||||
<tr><td>descriptions.js</td><td>Adds descriptions to the info page and tooltips of elements</td><td>mollthecoder</td></tr>
|
||||
<tr><td>editTools.js</td><td>Selections, Copying, Pasting, Cutting, Shapes, and more!</td><td>ggod</td></tr>
|
||||
|
|
@ -124,13 +136,14 @@
|
|||
<tr><td>move_tools.js</td><td>Adds tools that move pixels</td><td>Alice</td></tr>
|
||||
<tr><td>noconfirm.js</td><td>Removes all confirmation pop ups</td><td>mollthecoder</td></tr>
|
||||
<tr><td>page_color.js</td><td>Allows changing the background color outside of the canvas with the “pageColor” query parameter</td><td>Alice</td></tr>
|
||||
<tr><td>pixelResizeTool.js</td><td>Adds a button to change pixel scale</td><td>feeshmaster</td></tr>
|
||||
<tr><td>prompt.js</td><td>Adds a primitive command console</td><td>Alice</td></tr>
|
||||
<tr><td>prop.js</td><td>Adds tool to edit the attributes of pixels</td><td>Alice</td></tr>
|
||||
<tr><td>replace_all.js</td><td>Adds a way to replace every pixel of an element with another element<br><a href="https://github.com/R74nCom/sandboxels/commit/0066cea82345a5bc3a990df858239104e8ca9d44">Read the commit description for usage</a></td><td>Alice</td></tr>
|
||||
<tr><td>replace.js</td><td>Adds a tool that replaces every pixel of a specified element with another specified element. (The prompt to specify these is toggled by pressing " or by the button in the element description)</td><td>Alice</td></tr>
|
||||
<tr><td>save_loading.js</td><td>Adds the ability to save and load scenes from files (See the info page of the element)</td><td>Alice</td></tr>
|
||||
<tr><td>stripe_paint.js</td><td>Adds a tool to paint with stripes</td><td>Alice</td></tr>
|
||||
<tr><td>the_ground.js</td><td>A mod that adds several rock types, worldgen settings, and gemstones (broadly construed as ground-related).<br>Very incomplete</td><td>Alice</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Adds several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Science & Chemistry</td></tr><!---->
|
||||
<tr><td>alcohol.js</td><td>Adds methanol, (iso-)propanol, and butanol</td><td>Alice</td></tr>
|
||||
|
|
@ -151,6 +164,8 @@
|
|||
<tr><td>laetium.js</td><td>Adds several fictional elements</td><td>Alice</td></tr>
|
||||
<tr><td>liquid_energy.js</td><td>Adds liquid versions of the elements in the Energy category</td><td>Alice</td></tr>
|
||||
<tr><td>metals.js</td><td>Adds several metals</td><td>Alice</td></tr>
|
||||
<tr><td>mixture.js</td><td>Allows many chemicals to be mixed</td><td>lllllllllwith10ls</td></tr>
|
||||
<tr><td>morechemistry.js</td><td>Adds many new chemicals and compounds as well as some new machines</td><td>Alex</td></tr>
|
||||
<tr><td>moreliquids.js</td><td>Adds various liquids</td><td>te-agma-at</td></tr>
|
||||
<tr><td>nellfire.js</td><td>Adds a weird transforming flame and several rock types</td><td>Alice</td></tr>
|
||||
<tr><td>Neutronium Mod.js</td><td>Variety of scientific elements<br>Explosions</td><td>StellarX20</td></tr>
|
||||
|
|
@ -158,12 +173,15 @@
|
|||
<tr><td>random_rocks.js</td><td>Randomly generates rocks on game load</td><td>Alice</td></tr>
|
||||
<tr><td>roseyiede.js</td><td>Adds several variants of a substance called roseyiede</td><td>Alice</td></tr>
|
||||
<tr><td>some_tf_liquids.js</td><td>Adds various liquids from the Thermal Foundation Minecraft mod</td><td>Alice</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Adds several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Machines & Technology</td></tr><!---->
|
||||
<tr><td>clone_liquid.js</td><td>Adds a liquid form of cloner</td><td>Alice</td></tr>
|
||||
<tr><td>conveyance.js</td><td>Conveyors, operated with and without electricity</td><td>Melecie</td></tr>
|
||||
<tr><td>flipflop.js</td><td>Toggleable switches; <a href="https://github.com/R74nCom/sandboxels/pull/134">Explanation</a></td><td>Flix</td></tr>
|
||||
<tr><td>gameOfLife.js</td><td>Conway's Game of Life on a screen</td><td>ggod</td></tr>
|
||||
<tr><td>note_block.js</td><td>Adds musical Note Blocks</td><td>Alice</td></tr>
|
||||
<tr><td>nousersthings.js</td><td>Destroyable machines, pipe variants, filters, and more</td><td>nousernamefound</td></tr>
|
||||
<tr><td>portal.js</td><td>Adds portals that can teleport pixels</td><td>Alice</td></tr>
|
||||
<tr><td>pushers.js</td><td>Adds pixels that push elements away from them</td><td>Alice</td></tr>
|
||||
<tr><td>spouts.js</td><td>Adds spouts for all liquids</td><td>Alice</td></tr>
|
||||
|
|
@ -200,13 +218,15 @@
|
|||
<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>primordial_birthpool.js</td><td>A cross between Primordial Soup and Birthpool. Requires F&M</td><td>Alice</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.js</td><td>Adds several rock types, worldgen settings, and gemstones</td><td>Alice</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>toothpaste.js</td><td>Teeth and paste</td><td>Alice</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Alex</td></tr>
|
||||
<tr><td>amogus.js</td><td>Adds a small amogus structure</td><td>Alice</td></tr>
|
||||
<tr><td>elem3.js</td><td>Adds all elements and combinations from Elemental 3 [Very Large]</td><td>Sophie</td></tr>
|
||||
<tr><td>funny elements 2022-11-15.js</td><td>Adds a few curated randomly-generated elements</td><td>Alice</td></tr>
|
||||
<tr><td>funny_liquid.js</td><td>Adds NSFW elements relating to bodily fluids</td><td>Alice</td></tr>
|
||||
<tr><td>funny_liquid_2.js</td><td>Adds urine</td><td>Alice</td></tr>
|
||||
<tr><td>funny_liquid_3.js</td><td>Adds vomit</td><td>Alice</td></tr>
|
||||
<tr><td>funny_solid.js</td><td>Adds feces</td><td>Alice</td></tr>
|
||||
|
|
@ -223,9 +243,11 @@
|
|||
<tr><td>sus.js</td><td>Adds an Among Us crewmate</td><td>Nv7</td></tr>
|
||||
<tr><td>triggerable_random_powders.js</td><td>Adds powders with different abilities, such as heating and cooling</td><td>Alice</td></tr>
|
||||
<tr><td>troll.js</td><td>Adds various dumb elements that iterate randomly on the entire screen</td><td>Alice</td></tr>
|
||||
<tr><td>star_wars.js</td><td>Adds various items from Star Wars by Disney</td><td>SeaPickle754</td>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Visual Effects</td></tr><!---->
|
||||
<tr><td>acid_and_shapes.js</td><td>Weird visual effects. Enable in Settings</td><td>Alice</td></tr>
|
||||
<tr><td>heatglow.js</td><td>Red glowing effect for hot metals</td><td>nousernamefound</td></tr>
|
||||
<tr><td>invisible_dye.js</td><td>Adds elements like Dye and Spray Paint that take the color of the background</td><td>Alice</td></tr>
|
||||
<tr><td>invisible_wall.js</td><td>Adds an element like Wall that takes the color of the background</td><td>Alice</td></tr>
|
||||
<tr><td>paint_event.js</td><td>Adds a random event that randomly paints a circle</td><td>Alice</td></tr>
|
||||
|
|
@ -239,6 +261,7 @@
|
|||
<tr><td>changeTempReactionParameter.js</td><td>Adds the changeTemp property to modded reactions</td><td>Alice</td></tr>
|
||||
<tr><td>code_library.js</td><td>Adds functions and variables common to some other mods</td><td>Alice</td></tr>
|
||||
<tr><td>CrashTestDummy.js</td><td>Originally a test to see if certain code broke the game, but now just adds a tool that turns things into sand</td><td>StellarX20</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>date_test.js</td><td>K-pop idol birthday testing stuff</td><td>Alice</td></tr>
|
||||
<tr><td>drawPixels_change_test.js</td><td>A 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>An example mod for new modders</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
let liquid = [["XX", "XX", "XX"], ["M1", "XX", "M1"], ["M1", "M2", "M1"]]
|
||||
for (var element in elements){
|
||||
|
||||
let a = elements[element].behavior;
|
||||
console.log(a, elements[element], liquid)
|
||||
if(a != undefined && typeof a != 'function'){
|
||||
let i = 0;
|
||||
while (i < a.length){
|
||||
if(typeof a[i] == "string"){
|
||||
a[i] = a[i].split("|");
|
||||
i += 1;
|
||||
} else {
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
elements[element].behavior = [[a[0][0], a[0][1], a[0][2]], [`${a[1][0]} AND M1`, a[1][1], `${a[1][2]} AND M1`], [`${a[2][0]} AND M1`, `${a[2][1]} AND M2`, `${a[2][2]} AND M1`]];
|
||||
} else {
|
||||
elements[element].behavior = liquid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
|
||||
function randomAlter(num, list){
|
||||
let r = Math.floor(Math.random() * list.length);
|
||||
return (num + list[r]);
|
||||
}
|
||||
let avgheight = 0;
|
||||
let seed = "";
|
||||
function getSeed(type = "plains", thickness = 15){
|
||||
seed = "";
|
||||
console.log(thickness)
|
||||
if(thickness == 15){
|
||||
avgheight = Math.floor(Math.random() * (18 - 12 + 1)) + 12;
|
||||
} else{
|
||||
avgheight = thickness;
|
||||
}
|
||||
console.log(avgheight)
|
||||
|
||||
if(type == "plains"){
|
||||
let location = Math.floor(Math.random(0, pixelMap.length) * 100);
|
||||
let i = 0;
|
||||
while (i < pixelMap.length){
|
||||
if (i !== location){
|
||||
seed += `${randomAlter(avgheight, [0, 1, 1, 2, 0, 0])}|`;
|
||||
i += 1;
|
||||
} else if (i == location){
|
||||
let height = `${Math.floor(Math.random(40, pixelMap[i].length) * 10)}`;
|
||||
let prevH = randomAlter(avgheight, [1, 1, 1, 2, 0, 0]);
|
||||
while (height > prevH){
|
||||
prevH = randomAlter(prevH, [0, 1, 1, 2, 0, 0, 0, 1]);
|
||||
seed += `${prevH}|`;
|
||||
}
|
||||
|
||||
i += 1;
|
||||
|
||||
}
|
||||
}
|
||||
return seed;
|
||||
}
|
||||
if(type == "desert"){
|
||||
let i = 0;
|
||||
while (i < pixelMap.length){
|
||||
seed += `${randomAlter(avgheight, [0, 1, 1, 2, 0, 0])}|`;
|
||||
i += 1;
|
||||
|
||||
}
|
||||
}
|
||||
return seed;
|
||||
}
|
||||
function spawnElements(seed, list, height2 = 1, condition = [1, 1, 0]){
|
||||
console.log(list);
|
||||
let width = pixelMap.length - 1;
|
||||
let element;
|
||||
let height = pixelMap[1].length - 1;
|
||||
console.log(seed);
|
||||
let seedArray = seed.split("|");
|
||||
console.log(seedArray);
|
||||
seedArray.splice(seedArray.indexOf(""), 1);
|
||||
seedArray.splice(pixelMap.length);
|
||||
console.log(seedArray);
|
||||
let i = 0;
|
||||
while (i < seedArray.length - 1){
|
||||
|
||||
let ii = 0;
|
||||
while (ii < seedArray[i]){
|
||||
if((Math.floor(Math.random() * (condition[0] - condition[1] + 1))) == condition[2]){
|
||||
if (height2 != 1){
|
||||
element = list[Math.floor(Math.random() * list.length)];
|
||||
createPixel(element, (width - 1) - i, (height - (height2 + 1)) - ii);
|
||||
} else{
|
||||
element = list[Math.floor(Math.random() * list.length)];
|
||||
createPixel(element, (width - 1) - i, (height - 1) - ii);
|
||||
}
|
||||
}
|
||||
ii += 1;
|
||||
}
|
||||
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
function flat(){
|
||||
let iii = 0;
|
||||
let flat = "";
|
||||
while (iii < pixelMap.length){
|
||||
flat += "1|";
|
||||
iii += 1;
|
||||
}
|
||||
return flat;
|
||||
}
|
||||
function processSeed(seed, type = "plains"){
|
||||
|
||||
console.log(flat());
|
||||
let seedsArray = seed.split(":");
|
||||
console.log(seedsArray);
|
||||
if(type == "plains"){
|
||||
spawnElements(seedsArray[0],["rock","rock","rock","rock","rock","rock","metal_scrap","metal_scrap","metal_scrap","gold_coin","uranium","uranium","diamond","rock","iron","iron","iron","aluminum","aluminum","aluminum","aluminum","copper","copper","copper","zinc","zinc","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock"].sort(() => Math.random() - 0.5));
|
||||
setTimeout(function(){ spawnElements(seedsArray[1], ["dirt"], 24); }, 200);
|
||||
setTimeout(function(){ spawnElements(flat(),["grass","grass","grass","sapling","flower_seed","grass","grass","pinecone","grass","grass","grass","grass","grass","grass","grass","grass","grass","grass"], 40); }, 300);
|
||||
} else if(type == "desert"){
|
||||
spawnElements(seed, ["sand"]);
|
||||
setTimeout(function(){ spawnElements(flat(), ["cactus"], 40, [6, 0, 3]); }, 100);
|
||||
}
|
||||
}
|
||||
elements.worldGen = {
|
||||
color: "#FFFFFF",
|
||||
behavior: elements.erase.behavior,
|
||||
temp: 2,
|
||||
category: "tools",
|
||||
insulate:true,
|
||||
canPlace: false,
|
||||
desc: "Generate worlds with random seeds or your own seeds.",
|
||||
onSelect: function() {
|
||||
let Seed = prompt("Enter desert or plains random generation! automatically set to plains.");
|
||||
let regex = /[a-z]/;
|
||||
if (regex.test(Seed)){
|
||||
if(Seed.toLowerCase() == "desert"){
|
||||
processSeed(getSeed("desert", 30), "desert");
|
||||
}
|
||||
} else {
|
||||
if (Seed == ""){
|
||||
seed = `${getSeed("plains", 20)}:${getSeed("plains", 8)}`
|
||||
processSeed(seed);
|
||||
} else{
|
||||
processSeed(Seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
26
mods/chem.js
26
mods/chem.js
|
|
@ -16,10 +16,6 @@ function whenAvailable(names, callback) {
|
|||
}
|
||||
}, interval);
|
||||
}
|
||||
var runAfterAutogenMod = "mods/runAfterAutogen2.js";
|
||||
if(enabledMods.includes(runAfterAutogenMod)){
|
||||
whenAvailable(["runAfterAutogen"], function() {
|
||||
|
||||
|
||||
elements.fluorine = {
|
||||
color: "#FFFFBF",
|
||||
|
|
@ -420,7 +416,7 @@ trueAcidGases = ["acid_gas", "hydrofluoric_acid_gas"];
|
|||
|
||||
|
||||
if (enabledMods.includes("mods/generative_mods.js")) {
|
||||
whenAvailable(["generateCloud"], function() {
|
||||
runAfterLoad(function() {
|
||||
generateCloud("hydrofluoric_acid");
|
||||
elements["hydrofluoric_acid_gas"].reactions["hydrofluoric_acid_gas"]= { "elem1": null, "elem2": "hydrofluoric_acid_cloud", "chance":0.3, "y":[0,12], "setting":"clouds" };
|
||||
elements["hydrofluoric_acid_gas"].reactions["rain_cloud"]= { "elem1": null, "elem2": "hydrofluoric_acid_cloud", "chance":0.4, "y":[0,12], "setting":"clouds" };
|
||||
|
|
@ -480,7 +476,7 @@ function createAcid(name,reactions, gasReactions, color, category, categoryGas,
|
|||
elements.bless.reactions[name] = { elem2: "hydrogen" };
|
||||
elements.bless.reactions[name+"_gas"] = { elem2: "hydrogen" };
|
||||
if (enabledMods.includes("mods/generative_mods.js")) {
|
||||
whenAvailable(["generateCloud"], function() {
|
||||
runAfterLoad(function() {
|
||||
generateCloud(name);
|
||||
elements[name+"_gas"].reactions[name+"_gas"]= { "elem1": null, "elem2": name + "_cloud", "chance":0.3, "y":[0,12], "setting":"clouds" };
|
||||
elements[name+"_gas"].reactions["rain_cloud"]= { "elem1": null, "elem2": name + "_cloud", "chance":0.4, "y":[0,12], "setting":"clouds" };
|
||||
|
|
@ -1854,8 +1850,9 @@ elements.molten_potassium = {
|
|||
elements.potassium_gas = {
|
||||
color: "#5e6fdb"
|
||||
};
|
||||
elements.molten_salt = {};
|
||||
elements.molten_potassium_salt = {};
|
||||
|
||||
runAfterAutogen(function() {
|
||||
elements.molten_salt.reactions = {};
|
||||
elements.molten_salt.reactions.aluminum = { elem1:["sodium","chlorine"], charged:true, chance:0.0025 };
|
||||
elements.molten_salt.reactions.zinc = { elem1:["sodium","chlorine"], charged:true, chance:0.015 };
|
||||
|
|
@ -1883,13 +1880,14 @@ runAfterAutogen(function() {
|
|||
elements.molten_potassium_salt.reactions.silver = { elem1:["potassium","chlorine"], charged:true, chance:0.0075 };
|
||||
elements.molten_potassium_salt.reactions.gold = { elem1:["potassium","chlorine"], charged:true, chance:0.0075 };
|
||||
elements.molten_potassium_salt.conduct = 0.7;
|
||||
delete elements.molten_potassium_salt.burn;
|
||||
delete elements.molten_potassium.burn;
|
||||
elements.molten_potassium_salt.burn = 0;
|
||||
elements.molten_potassium.burn = 0;
|
||||
|
||||
//Hall–Heroult process
|
||||
elements.molten_cryolite_solution = {};
|
||||
elements.molten_cryolite_solution.reactions = {};
|
||||
elements.molten_cryolite_solution.reactions.charcoal = { elem1:"molten_aluminum", elem2:"carbon_dioxide" };
|
||||
});
|
||||
|
||||
|
||||
elements.niter = {
|
||||
color: "#f0efcc",
|
||||
|
|
@ -2654,10 +2652,4 @@ elements.bless.reactions["liquid_sulfur_dioxide"] = {elem2: "oxygen"};
|
|||
elements.bless.reactions["sulfur_dioxide_ice"] = {elem2: "oxygen"};
|
||||
elements.bless.reactions["hydrogen_sulfide"] = {elem2: "hydrogen"};
|
||||
elements.bless.reactions["liquid_hydrogen_sulfide"] = {elem2: "hydrogen"};
|
||||
elements.bless.reactions["rocket_fuel"] = {elem2: null};
|
||||
});
|
||||
} else {
|
||||
if(!enabledMods.includes(runAfterAutogenMod)) { enabledMods.unshift(runAfterAutogenMod) };
|
||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||
alert(`The "${runAfterAutogenMod}" is required and have been automatically inserted (reload for this to take effect).`);
|
||||
};
|
||||
elements.bless.reactions["rocket_fuel"] = {elem2: null};
|
||||
|
|
@ -139,5 +139,8 @@ if (elements.lead) {elements.lead.color = "#6c6c6a";}
|
|||
if (elements.drag) {elements.drag.color = "#ffffff";}
|
||||
if (elements.tuff) {elements.tuff.color = ["#A16A49","#C98256","#C7834F","#BF7640","#DB8641","#D1732C","#AF5D30","#A55E35","#8B5B4C"];}
|
||||
if (elements.blood) {elements.blood.color = "#ff0000";}
|
||||
if (elements.water && elements.tuff) {elements.water.reactions.tuff = { elem2: "wet_sand", color2:"#7a6b5c", chance: 0.00035 };}
|
||||
if (elements.antibody) {elements.antibody.color = "#ff4040";}
|
||||
if (elements.infection) {elements.infection.color = "#cf005d";}
|
||||
if (elements.infection) {elements.infection.color = "#cf005d";}
|
||||
if (elements.molten_solder) {delete elements.molten_solder.color;}
|
||||
if (elements.gold_coin) {elements.gold_coin.color = ["#fff0b5","#986a1a","#f0bb62"];}
|
||||
|
|
@ -1,7 +1,15 @@
|
|||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//URL
|
||||
|
||||
urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Objects
|
||||
|
||||
//getKeyByValue code by SO UncleLaz: https://stackoverflow.com/questions/9907419/how-to-get-a-key-in-a-javascript-object-by-its-value
|
||||
|
|
@ -10,6 +18,10 @@
|
|||
return Object.keys(object).find(key => object[key] === value);
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//RNG
|
||||
|
||||
//Random integer from 0 to n
|
||||
|
|
@ -77,6 +89,10 @@
|
|||
return Math.floor(randomFunction() * (max - min + 1)) + min
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Arrays
|
||||
|
||||
//Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204
|
||||
|
|
@ -158,6 +174,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Checks
|
||||
|
||||
//Element exists in the elements object
|
||||
|
|
@ -260,6 +280,10 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Math(s)
|
||||
|
||||
//Base n logarithm from https://stackoverflow.com/a/3019290
|
||||
|
|
@ -305,6 +329,10 @@
|
|||
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
||||
}
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Color
|
||||
|
||||
function rgbStringToUnvalidatedObject(string) { //turns rgb() to {r,g,b} with no bounds checking
|
||||
|
|
@ -1182,7 +1210,11 @@
|
|||
//console.log(`Hexed to #${f(0)}${f(8)}${f(4)}`)
|
||||
return `#${f(0)}${f(8)}${f(4)}`;
|
||||
};
|
||||
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Pixels
|
||||
|
||||
function exposedToAir(pixel) {
|
||||
|
|
@ -1540,6 +1572,10 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//World
|
||||
|
||||
function breakCircle(x,y,radius,respectHardness=false,changeTemp=false,defaultBreakIntoDust=false) {
|
||||
|
|
@ -1639,6 +1675,10 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Logic
|
||||
|
||||
function xor(c1,c2) {
|
||||
|
|
@ -1651,6 +1691,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//currentPixels operations
|
||||
|
||||
function findInCurrentPixels(x,y) {
|
||||
|
|
@ -1710,6 +1754,10 @@
|
|||
};
|
||||
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Sugar functions
|
||||
|
||||
function newElement(name="element_name",color="#FF00FF",otherProps={}) {
|
||||
|
|
@ -1722,6 +1770,10 @@
|
|||
return elements[name];
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
//Fixes
|
||||
|
||||
//fix -1-caused ghost pixels
|
||||
|
|
@ -1747,4 +1799,16 @@
|
|||
}
|
||||
}
|
||||
}*/
|
||||
};
|
||||
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true;
|
||||
|
||||
runAfterLoad(function() {
|
||||
if(!libraryLoaded) {
|
||||
libraryLoaded = true;
|
||||
this.libraryLoaded = true;
|
||||
window.libraryLoaded = true
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,228 @@
|
|||
// Coffee Mod - Since coffee has been confirmed for a future update, I wanted to see what it might be like :)
|
||||
// Created by Cerulean - special thanks to ggod :D
|
||||
// If you have any suggestions for the mod, please leave a dm at @playblooket on discord (me)
|
||||
// I'm not a pro modder, don't expect much lololol
|
||||
// Version 1.0 // Last update - Nov 22
|
||||
|
||||
elements.coffee = {
|
||||
color: "#22120d",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 75,
|
||||
category: "food",
|
||||
viscosity: 27,
|
||||
tempHigh: 200,
|
||||
stateHigh: ["steam", "fragrance"],
|
||||
tempLow: 4,
|
||||
stateLow: "iced_coffee",
|
||||
state: "liquid",
|
||||
density: 308
|
||||
};
|
||||
|
||||
elements.iced_coffee = {
|
||||
color: "#271f1c",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: -5,
|
||||
category: "food",
|
||||
viscosity: 35,
|
||||
state: "liquid",
|
||||
tempHigh: 10,
|
||||
stateHigh: "coffee",
|
||||
tempLow: -20,
|
||||
stateLow: ["ice", "ground_coffee_bean"],
|
||||
density: 308
|
||||
};
|
||||
|
||||
elements.latte = {
|
||||
color: "#92817b",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 75,
|
||||
category: "food",
|
||||
viscosity: 20,
|
||||
tempHigh: 200,
|
||||
stateHigh: ["steam", "fragrance"],
|
||||
tempLow: 4,
|
||||
stateLow: "iced_latte",
|
||||
state: "liquid",
|
||||
density: 822
|
||||
};
|
||||
|
||||
elements.iced_latte = {
|
||||
color: "#271f1c",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: -5,
|
||||
category: "food",
|
||||
viscosity: 35,
|
||||
state: "liquid",
|
||||
tempHigh: 10,
|
||||
stateHigh: "latte",
|
||||
tempLow: -20,
|
||||
stateLow: ["ice", "ground_coffee_bean", "creamer"],
|
||||
density: 822
|
||||
};
|
||||
|
||||
elements.creamer = {
|
||||
color: "#efe8e4",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
viscosity: 5,
|
||||
state: "liquid",
|
||||
tempLow: -25,
|
||||
stateLow: "ice_cream",
|
||||
tempHigh: 150,
|
||||
stateHigh: ["steam", "oil", "sugar"],
|
||||
density: 500
|
||||
};
|
||||
|
||||
elements.coffee_bean = {
|
||||
color: "#552717",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempLow: -20,
|
||||
stateLow: "frozen_coffee_bean",
|
||||
tempHigh: 200,
|
||||
stateHigh: "roasted_coffee_bean",
|
||||
breakInto: ["coffee_grounds", "ground_coffee_bean"],
|
||||
density: 500
|
||||
};
|
||||
|
||||
elements.coffee_grounds = {
|
||||
color: "#34160b",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempHigh: 1200,
|
||||
stateHigh: "molten_dirt",
|
||||
tempLow: -50,
|
||||
stateLow: "permafrost",
|
||||
density: 550
|
||||
};
|
||||
|
||||
elements.ground_coffee_bean = {
|
||||
color: "#552717",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempHigh: 200,
|
||||
stateHigh: "roasted_ground_coffee_bean",
|
||||
tempLow: -20,
|
||||
stateLow: "frozen_coffee_bean",
|
||||
density: 450
|
||||
};
|
||||
|
||||
elements.frozen_coffee_bean = {
|
||||
color: "#5d4037",
|
||||
behavior: behaviors.POWDER,
|
||||
temp: -25
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempHigh: -10,
|
||||
stateHigh: "coffee_bean",
|
||||
density: 550
|
||||
};
|
||||
|
||||
elements.frozen_ground_coffee_bean = {
|
||||
color: "#533328",
|
||||
behavior: behaviors.POWDER,
|
||||
temp: -25
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempLow: -10,
|
||||
stateLow: "ground_coffee_bean",
|
||||
density: 600
|
||||
};
|
||||
|
||||
elements.roasted_ground_coffee_bean = {
|
||||
color: "#803e29",
|
||||
behavior: behaviors.POWDER,
|
||||
temp: 150
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempHigh: 350,
|
||||
stateHigh: "ash",
|
||||
tempLow: -20,
|
||||
stateLow: "frozen_ground_coffee_bean",
|
||||
density: 350
|
||||
};
|
||||
|
||||
elements.roasted_coffee_bean = {
|
||||
color: "#9e5842",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempLow: -20,
|
||||
stateLow: "frozen_coffee_bean",
|
||||
tempHigh: 300,
|
||||
stateHigh: "ash",
|
||||
breakInto: ["coffee_grounds", "roasted_ground_coffee_bean"]
|
||||
density: 400
|
||||
};
|
||||
|
||||
elements.toffee = {
|
||||
color: "#bf8d5f",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
viscosity: 1,
|
||||
state: "solid",
|
||||
tempHigh: 186,
|
||||
stateHigh: "sugar",
|
||||
breakInto: ["sugar", "h_bomb"]
|
||||
density: 1000
|
||||
};
|
||||
|
||||
elements.espresso = {
|
||||
color: "#170701",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 75,
|
||||
category: "food",
|
||||
viscosity: 27,
|
||||
tempHigh: 200,
|
||||
stateHigh: ["steam", "fragrance"],
|
||||
tempLow: 4,
|
||||
stateLow: "iced_espresso",
|
||||
state: "liquid",
|
||||
density: 700
|
||||
};
|
||||
|
||||
elements.iced_espresso = {
|
||||
color: "#2a1a12",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: -5,
|
||||
category: "food",
|
||||
viscosity: 35,
|
||||
state: "liquid",
|
||||
tempHigh: 10,
|
||||
stateHigh: "espresso",
|
||||
tempLow: -20,
|
||||
stateLow: ["ice", "roasted_ground_coffee_bean"],
|
||||
density: 700
|
||||
};
|
||||
|
||||
elements.cacaoffee = {
|
||||
color: "#33180b",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 75,
|
||||
category: "food",
|
||||
viscosity: 27,
|
||||
tempHigh: 200,
|
||||
stateHigh: ["steam", "melted_chocolate"],
|
||||
tempLow: 4,
|
||||
stateLow: ["chocolate", "iced_coffee"],
|
||||
state: "liquid",
|
||||
density: 308
|
||||
};
|
||||
|
||||
elements.milk.reactions.coffee = { "elem1":"latte"};
|
||||
elements.creamer.reactions.coffee = { "elem1":"latte"};
|
||||
elements.milk.reactions.ground_coffee_bean = { "elem1":"latte"};
|
||||
elements.creamer.reactions.roasted_ground_coffee_bean = { "elem1":"espresso"};
|
||||
elements.water.reactions.ground_coffee_bean = { "elem1":"coffee"};
|
||||
elements.water.reactions.coffee_grounds = { "elem1":"mud"};
|
||||
elements.chocolate.reactions.coffee = { "elem1":"latte"};
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
|
||||
//how to use:
|
||||
//the "customExplosion" function is to be used in reactions, like so:
|
||||
//"water": {
|
||||
//func: function (pixel1, pixel2) {customExplosion(pixel1, pixel2, 5, ["fire", "fire", "pop", "hydrogen", "sodiumhydroxide", "potassiumhydroxide","sodiumhydroxide", "potassiumhydroxide","sodiumhydroxide", "potassiumhydroxide"])}
|
||||
//}
|
||||
//and the element you just have to select and enter "EX:(radius)>(elem1),(elem2),(elem3)" and so on. do not include spaces.
|
||||
function customExplosion(pixel1, pixel2, radius, list) {
|
||||
let x = pixel1.x;
|
||||
let y = pixel1.y;
|
||||
deletePixel(x, y);
|
||||
deletePixel(pixel2.x, pixel2.y);
|
||||
explodeAt(x, y, radius, list);
|
||||
};
|
||||
elements.customExplosion = {
|
||||
items: "",
|
||||
rItems: "",
|
||||
behavior: behaviors.SOLID,
|
||||
state: "solid",
|
||||
onSelect: function(){
|
||||
items = prompt("What should this explosion include?");
|
||||
this.items = items;
|
||||
console.log(items);
|
||||
elements.customExplosion.behavior = [["XX", "XX", "XX"], ["XX", `EX:4>${items}`, "XX"], ["XX", "XX", "XX"]]
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
let cssForDebug = `
|
||||
#debugParent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#debugXButton {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
font-size: 2em;
|
||||
background-color: rgb(100, 33, 33);
|
||||
padding:5px;
|
||||
text-align:center;
|
||||
border: 1px solid #ffffff;
|
||||
z-index: 12;
|
||||
}
|
||||
#debugXButton:hover {
|
||||
background-color: rgb(200, 33, 33);
|
||||
}
|
||||
|
||||
#debugMenuTitle {
|
||||
position: absolute;
|
||||
left: 175px;
|
||||
font-size: 1.5em;
|
||||
text-decoration: underline;
|
||||
color: white;
|
||||
}
|
||||
#debugStats {
|
||||
margin-top: 5px;
|
||||
line-height: 1.5em;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#debugLiveButton {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
font-size: 2em;
|
||||
background-color: rgb(100, 33, 33);
|
||||
padding:5px;
|
||||
text-align:center;
|
||||
border: 1px solid #ffffff;
|
||||
z-index: 12;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#debugLiveButton.live {
|
||||
background-color: #24fc03;
|
||||
}
|
||||
|
||||
#debugLiveButton.live:hover {
|
||||
background-color: #50ff36;
|
||||
}
|
||||
|
||||
#debugStatList {
|
||||
position: absolute;
|
||||
border: 1px solid #ffffff;
|
||||
left: 50%;
|
||||
top: 5%;
|
||||
transform: translate(-50%, 0%);
|
||||
width: 95%;
|
||||
height: 50%;
|
||||
max-width: 700px;
|
||||
padding: 10px;
|
||||
background-color: rgb(31, 31, 31);
|
||||
overflow-x: hidden;
|
||||
z-index: 10;
|
||||
}
|
||||
`,
|
||||
head = document.head || document.getElementsByTagName('head')[0],
|
||||
style = document.createElement('style');
|
||||
|
||||
head.appendChild(style);
|
||||
|
||||
style.type = 'text/css';
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = cssForDebug;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(cssForDebug));
|
||||
};
|
||||
let debugMenu = document.createElement("div");
|
||||
debugMenu.innerHTML = `
|
||||
<div id="debugParent" style="display: none;">
|
||||
<div id="debugStatList">
|
||||
<button id="debugXButton" onclick="closeDebugUi()">X</button>
|
||||
<button id="debugLiveButton" onclick="startDebugLive()">Live</button>
|
||||
<span id="debugMenuTitle">
|
||||
Debug Stats
|
||||
</span>
|
||||
<br><br>
|
||||
<div id="debugStats">
|
||||
No stats currently
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
document.getElementById("gameDiv").appendChild(debugMenu);
|
||||
var statChangeInterval;
|
||||
let live = false;
|
||||
let openedByClick = true;
|
||||
let debugToggle = false;
|
||||
var output;
|
||||
var targetedPixel;
|
||||
elements.debug = {
|
||||
color: ["#b150d4", "#d1b74f"],
|
||||
tool: function(pixel) {
|
||||
startDebugUi(pixel);
|
||||
},
|
||||
maxSize: 1,
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
function startDebugUi(pixel) {
|
||||
if (debugToggle) return;
|
||||
targetedPixel = pixel;
|
||||
mouseIsDown = false;
|
||||
shiftDown = false;
|
||||
output = targetedPixel.element.toUpperCase() + " at x" + targetedPixel.x + ", y" + targetedPixel.y + ", tick: " + pixelTicks + `<br>`;
|
||||
for (let i in targetedPixel) {
|
||||
if (i !== "x" && i !== "y" && i !== "element") {
|
||||
output += " " + i + ": " + targetedPixel[i] + `<br>`;
|
||||
}
|
||||
}
|
||||
statChangeInterval = setInterval(statChange, 1000/tps);
|
||||
document.getElementById("debugParent").style.display = "block";
|
||||
document.getElementById("debugStats").innerHTML = output;
|
||||
debugToggle = true;
|
||||
|
||||
setTimeout(() => {
|
||||
openedByClick = false;
|
||||
document.addEventListener('click', clickHandler);
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
function closeDebugUi() {
|
||||
if (!debugToggle) return;
|
||||
openedByClick = true;
|
||||
document.getElementById("debugParent").style.display = "none";
|
||||
debugToggle = false;
|
||||
document.removeEventListener('click', clickHandler);
|
||||
clearInterval(statChangeInterval);
|
||||
}
|
||||
|
||||
function clickHandler(event) {
|
||||
const modParent = document.getElementById("debugParent");
|
||||
|
||||
if (event.target !== modParent && !modParent.contains(event.target)) {
|
||||
closeDebugUi();
|
||||
}
|
||||
}
|
||||
|
||||
function startDebugLive() {
|
||||
live = !live;
|
||||
|
||||
document.getElementById("debugLiveButton").classList.toggle("live");
|
||||
|
||||
}
|
||||
function statChange() {
|
||||
if (live == true) {
|
||||
output = targetedPixel.element.toUpperCase() + " at x" + targetedPixel.x + ", y" + targetedPixel.y + ", tick: " + pixelTicks + `<br>`;
|
||||
for (let i in targetedPixel) {
|
||||
if (i !== "x" && i !== "y" && i !== "element") {
|
||||
output += " " + i + ": " + targetedPixel[i] + `<br>`;
|
||||
}
|
||||
}
|
||||
document.getElementById("debugStats").innerHTML = output;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,4 +59,101 @@ elements.rad_fluid = {
|
|||
state: "liquid",
|
||||
}
|
||||
elements.rad_fluid.color = elements.radiation.color;
|
||||
elements.rad_fluid.reactions = elements.radiation.reactions;
|
||||
elements.rad_fluid.reactions = elements.radiation.reactions;
|
||||
|
||||
elements.time_reverse = {
|
||||
color: "#ffffff",
|
||||
perTick: function() {
|
||||
pixelTicks -= 2;
|
||||
},
|
||||
rotatable: true,
|
||||
category: "special",
|
||||
canPlace: false,
|
||||
}
|
||||
|
||||
elements.steam_train = {
|
||||
color: "#DFDFDF",
|
||||
behavior: [
|
||||
"XX|CR:smoke|XX",
|
||||
"BO AND M1|XX|CR:smoke",
|
||||
"XX|CR:smoke|XX",
|
||||
],
|
||||
category: "gases",
|
||||
density: 99999,
|
||||
state: "gas",
|
||||
}
|
||||
|
||||
elements.polish = {
|
||||
color: "#aba593",
|
||||
tool: function(pixel) {
|
||||
if (elements.polish.reactions[pixel.element] && Math.random()<0.25) {
|
||||
var r = elements.polish.reactions[pixel.element];
|
||||
var color2 = r.color2;
|
||||
if (color2 !== undefined) {
|
||||
if (Array.isArray(color2)) { color2 = color2[Math.floor(Math.random()*color2.length)]; }
|
||||
var rgb = hexToRGB(color2);
|
||||
pixel.color = "rgb("+rgb.r+","+rgb.g+","+rgb.b+")";
|
||||
}
|
||||
}
|
||||
},
|
||||
behavior: [
|
||||
"M2|M1|M2",
|
||||
"M1|DL%10|M1",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
reactions: {
|
||||
"wood": { color2:"#872b00" },
|
||||
"glass": { color2:"#526158" },
|
||||
},
|
||||
burn: 100,
|
||||
burnTime: 2,
|
||||
state: "gas",
|
||||
canPlace: true,
|
||||
category: "gases",
|
||||
stain: -0.5
|
||||
}
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
eLists.FOOD = [];
|
||||
for (var element in elements) {
|
||||
if (elements[element].isFood) {
|
||||
eLists.FOOD.push(element);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
elements.food = {
|
||||
color: ["#359100","#74b332","#b9d461","#dede7a"],
|
||||
tick: function(pixel) {
|
||||
// Choose randomly from eLists.SEEDS
|
||||
changePixel(pixel,eLists.FOOD[Math.floor(Math.random()*eLists.FOOD.length)]);
|
||||
},
|
||||
category: "food"
|
||||
}
|
||||
|
||||
elements.liquid = {
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M2|XX|M2",
|
||||
"M1|M1|M1",
|
||||
],
|
||||
category: "special"
|
||||
}
|
||||
elements.gas = {
|
||||
behavior: [
|
||||
"M1|M1|M1",
|
||||
"M1|XX|M1",
|
||||
"M1|M1|M1",
|
||||
],
|
||||
state: "gas",
|
||||
category: "special"
|
||||
}
|
||||
elements.liquid_gas = {
|
||||
behavior: [
|
||||
"M1%25|M1%25|M1%25",
|
||||
"M2|XX|M2",
|
||||
"M1|M1|M1",
|
||||
],
|
||||
state: "gas",
|
||||
category: "special"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
window.addEventListener('load', function() {
|
||||
for (element in elements) {
|
||||
for (var element in elements) {
|
||||
elements[element].isFood = true;
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
const heatfunc = function(pixel){
|
||||
if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null || !(pixel.element == pixel.ogElement)){
|
||||
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||
pixel.ogElement = pixel.element
|
||||
}else{
|
||||
pixel.gethigh = (elements[pixel.element].tempHigh)
|
||||
pixel.halftemp = ((20+pixel.gethigh)/2)
|
||||
if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
||||
pixel.ctemp = 0;
|
||||
} else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
||||
pixel.ctemp = ((1/pixel.halftemp)*pixel.temp)-(((pixel.gethigh)-pixel.halftemp)/pixel.halftemp)
|
||||
}
|
||||
if (pixel.ctemp <= 0.5){
|
||||
pixel.newR = (((510-(2*pixel.ogR))*pixel.ctemp)+pixel.ogR);
|
||||
pixel.newG = ((0-((2*pixel.ogG)*pixel.ctemp))+pixel.ogG);
|
||||
pixel.newB = ((0-((2*pixel.ogB)*pixel.ctemp))+pixel.ogB);
|
||||
}else if (pixel.ctemp > 0.5){
|
||||
pixel.newR = 255;
|
||||
pixel.newG = ((510*pixel.ctemp)-255);
|
||||
pixel.newB= ((280*pixel.ctemp)-140);
|
||||
}
|
||||
pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
||||
}
|
||||
};
|
||||
if (!eLists.metals) { eLists.metals = [] }
|
||||
eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead", "rose_gold"])
|
||||
eLists.metals.forEach(metal => {
|
||||
const prefunc = elements[metal].tick;
|
||||
if (!prefunc){
|
||||
elements[metal].tick = heatfunc;
|
||||
}else{
|
||||
const modfunc = function(pixel){
|
||||
prefunc(pixel);
|
||||
heatfunc(pixel);
|
||||
};
|
||||
elements[metal].tick = modfunc;
|
||||
}
|
||||
if (elements[metal].behavior == behaviors.WALL){
|
||||
elements[metal].movable = false;
|
||||
}
|
||||
});
|
||||
elements.color_baker = {
|
||||
color: "#F61212",
|
||||
tool: function(pixel) {
|
||||
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||
},
|
||||
category: "tools",
|
||||
excludeRandom: true,
|
||||
desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.",
|
||||
}
|
||||
//const plantfunc = function(pixel){
|
||||
// if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){
|
||||
// pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||
// pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||
// pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||
// pixel.deadR = 130;
|
||||
// pixel.deadG = 103;
|
||||
// pixel.deadB = 40;
|
||||
// pixel.burnR = 30;
|
||||
// pixel.burnG = 30;
|
||||
// pixel.burnB = 30;
|
||||
// }else{
|
||||
// pixel.gethigh = (elements[pixel.element].tempHigh)
|
||||
// pixel.halftemp = ((20+pixel.gethigh)/2)
|
||||
// if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
||||
// pixel.ctemp = 0;
|
||||
// pixel.twoctemp = 0,
|
||||
// pixel.littlectemp = 1;
|
||||
// } else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
||||
// pixel.ctemp = ((1/pixel.halftemp)*pixel.temp)-(((pixel.gethigh)-pixel.halftemp)/pixel.halftemp);
|
||||
// pixel.twoctemp = pixel.ctemp*2;
|
||||
// pixel.littlectemp = 2*(1-(pixel.ctemp));
|
||||
// }
|
||||
// if (pixel.ctemp <= 0.5){
|
||||
// pixel.newR = ((pixel.twoctemp*pixel.deadR)+(pixel.littlectemp*pixel.ogR)/(pixel.twoctemp+pixel.littlectemp));
|
||||
// pixel.newG = ((pixel.twoctemp*pixel.deadG)+(pixel.littlectemp*pixel.ogG)/(pixel.twoctemp+pixel.littlectemp));
|
||||
// pixel.newB = ((pixel.twoctemp*pixel.deadB)+(pixel.littlectemp*pixel.ogB)/(pixel.twoctemp+pixel.littlectemp));
|
||||
// }else if (pixel.ctemp > 0.5){
|
||||
// pixel.newR = (((pixel.twoctemp*pixel.deadR)+(pixel.littlectemp*pixel.burnR))/(pixel.twoctemp*pixel.littlectemp));
|
||||
// pixel.newG = (((pixel.twoctemp*pixel.deadG)+(pixel.littlectemp*pixel.burnG))/(pixel.twoctemp*pixel.littlectemp));
|
||||
// pixel.newB= (((pixel.twoctemp*pixel.deadB)+(pixel.littlectemp*pixel.burnB))/(pixel.twoctemp*pixel.littlectemp));
|
||||
// }
|
||||
// pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
||||
// }
|
||||
// };
|
||||
// if (!eLists.burnplants) { eLists.burnplants = [] }
|
||||
// eLists.burnplants = eLists.burnplants.concat(["plant","dead_plant","grass","algae","sapling","evergreen","cactus","seeds","grass_seed","wheat_seed","flower_seed","pistil","petal","tree_branch","bamboo_plant","mushroom_spore","mushroom_stalk","mushroom_gill","mushroom_cap","hyphae","pumpkin_seed","pumpkin","corn","corn_seed","potato","potato_seed","root"])
|
||||
//eLists.burnplants.forEach(plant => {
|
||||
// const prefunc = elements[plant].tick;
|
||||
// if (!prefunc){
|
||||
// elements[plant].tick = plantfunc;
|
||||
// }else{
|
||||
// const modfunc = function(pixel){
|
||||
// prefunc(pixel);
|
||||
// plantfunc(pixel);
|
||||
// };
|
||||
// elements[plant].tick = modfunc;
|
||||
// }
|
||||
//});
|
||||
|
||||
|
|
@ -0,0 +1,716 @@
|
|||
/* WARNING: not finished */
|
||||
|
||||
|
||||
|
||||
function whenAvailable(names, callback) {
|
||||
var interval = 10; // ms
|
||||
window.setTimeout(function() {
|
||||
let bool = true;
|
||||
for(let i = 0; i < names.length; i++)
|
||||
{
|
||||
if(!window[names[i]])
|
||||
{
|
||||
bool = false;
|
||||
}
|
||||
}
|
||||
if (bool) {
|
||||
callback();
|
||||
} else {
|
||||
whenAvailable(names, callback);
|
||||
}
|
||||
}, interval);
|
||||
}
|
||||
var runAfterAutogenMod = "mods/runAfterAutogen2.js";
|
||||
|
||||
function getName(elementList)
|
||||
{
|
||||
let name = elementList.join();
|
||||
if(nameList[name])
|
||||
{
|
||||
name = nameList[name];
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList = elementList.filter(function(item, pos, self) {
|
||||
return self.indexOf(item) == pos;
|
||||
});
|
||||
|
||||
let name = elementList.join();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
function makeColors(elementList)
|
||||
{
|
||||
let colors = [];
|
||||
for(let i = 0; i < predefinedColors.length; i++)
|
||||
{
|
||||
if(predefinedColors[i][1].every(val => elementList.includes(val)
|
||||
&& predefinedColors[i][1].filter(el => el === val).length
|
||||
<=
|
||||
elementList.filter(el => el === val).length
|
||||
))
|
||||
{
|
||||
color = predefinedColors[i][0];
|
||||
if(color instanceof Array)
|
||||
{
|
||||
color = color.map((c) => "rgb("+hexToRGB(c).r+","+hexToRGB(c).g+","+hexToRGB(c).b+")");
|
||||
colors.push(color);
|
||||
}
|
||||
else
|
||||
{
|
||||
colors.push(["rgb("+hexToRGB(color).r+","+hexToRGB(color).g+","+hexToRGB(color).b+")"]);
|
||||
}
|
||||
for(let j = 0; j < predefinedColors[i][1].length; j++)
|
||||
{
|
||||
let index = elementList.indexOf(predefinedColors[i][1][j]);
|
||||
if (index > -1) { // only splice array when item is found
|
||||
elementList.splice(index, 1); // 2nd parameter means remove one item only
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
colors = colors.concat(elementList.map((c) => elements[c].color instanceof Array ? elements[c].color : [elements[c].color]));
|
||||
return colors;
|
||||
}
|
||||
|
||||
function mixture(elementList)
|
||||
{
|
||||
elementList.sort();
|
||||
|
||||
let name = getName(elementList);
|
||||
|
||||
|
||||
if(!elements[name])
|
||||
{
|
||||
elements[name] = true;
|
||||
let minTempHigh = Infinity;
|
||||
let stateHigh = null;
|
||||
let indexStateHigh = -1;
|
||||
|
||||
let maxTempLow = -Infinity;
|
||||
let stateLow = null;
|
||||
let indexStateLow = -1;
|
||||
|
||||
|
||||
for(let i = 0; i < elementList.length; i++)
|
||||
{
|
||||
if(elements[elementList[i]])
|
||||
{
|
||||
if(typeof elements[elementList[i]].tempHigh === "number" && elements[elementList[i]].stateHigh)
|
||||
{
|
||||
if(elements[elementList[i]].tempHigh < minTempHigh)
|
||||
{
|
||||
minTempHigh = elements[elementList[i]].tempHigh;
|
||||
indexStateHigh = i;
|
||||
stateHigh = elements[elementList[i]].stateHigh;
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof elements[elementList[i]].tempLow === "number" && elements[elementList[i]].stateLow)
|
||||
{
|
||||
if(elements[elementList[i]].tempLow > maxTempLow)
|
||||
{
|
||||
maxTempLow = elements[elementList[i]].tempLow;
|
||||
indexStateLow = i;
|
||||
stateLow = elements[elementList[i]].stateLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let elementList2 = elementList.slice();
|
||||
let elementHigh = null;
|
||||
let gasesOk = gasOk(elementList);
|
||||
if(indexStateHigh >= 0 && gasesOk)
|
||||
{
|
||||
if(stateHigh instanceof Array)
|
||||
{
|
||||
elementHigh = [];
|
||||
for(let i = 0; i < stateHigh.length; i++)
|
||||
{
|
||||
elementList2[indexStateHigh] = stateHigh[i];
|
||||
if(isValidMixture(elementList2))
|
||||
{
|
||||
elementHigh.push(mixture(elementList2));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList2[indexStateHigh] = stateHigh;
|
||||
if(isValidMixture(elementList2))
|
||||
{
|
||||
elementHigh = mixture(elementList2);
|
||||
}
|
||||
else
|
||||
{
|
||||
minTempHigh = Infinity;
|
||||
elementHigh = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let elementList3 = elementList.slice();
|
||||
let elementLow = null;
|
||||
if(indexStateLow >= 0 && gasesOk)
|
||||
{
|
||||
if(stateLow instanceof Array)
|
||||
{
|
||||
elementLow = [];
|
||||
for(let i = 0; i < stateLow.length; i++)
|
||||
{
|
||||
elementList3[indexStateLow] = stateLow[i];
|
||||
if(isValidMixture(elementList3))
|
||||
{
|
||||
elementLow.push(mixture(elementList3));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList3[indexStateLow] = stateLow;
|
||||
if(isValidMixture(elementList3))
|
||||
{
|
||||
elementLow = mixture(elementList3);
|
||||
}
|
||||
else
|
||||
{
|
||||
maxTempLow = -Infinity;
|
||||
elementLow = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(elementHigh instanceof Array && elementHigh.length === 0)
|
||||
{
|
||||
minTempHigh = Infinity;
|
||||
elementHigh = null;
|
||||
}
|
||||
if(elementLow instanceof Array && elementLow.length === 0)
|
||||
{
|
||||
maxTempLow = -Infinity;
|
||||
elementLow = null;
|
||||
}
|
||||
|
||||
let colors = makeColors(elementList.slice());
|
||||
let colors2 = [];
|
||||
let maxLength = Math.max(...(colors.map((c) => c.length)));
|
||||
|
||||
for(let i = 0; i < maxLength; i++)
|
||||
{
|
||||
let colors3 = [];
|
||||
for(let j = 0; j < colors.length; j++)
|
||||
{
|
||||
colors3.push(toObject(colors[j][i%colors[j].length]));
|
||||
}
|
||||
colors2.push(averageRGB(colors3));
|
||||
}
|
||||
let temp = airTemp;
|
||||
if(maxTempLow < airTemp && minTempHigh > airTemp)
|
||||
{
|
||||
|
||||
}
|
||||
else if(maxTempLow > -Infinity && minTempHigh < Infinity)
|
||||
{
|
||||
temp = (maxTempLow + minTempHigh)/2;
|
||||
}
|
||||
else if(maxTempLow > -Infinity)
|
||||
{
|
||||
temp = maxTempLow+20;
|
||||
}
|
||||
else if(minTempHigh < Infinity)
|
||||
{
|
||||
temp = Math.max(minTempHigh-20,absoluteZero);
|
||||
}
|
||||
|
||||
let movable = !elementList.some((c) => !elements[c].movable);
|
||||
|
||||
let density = elementList.map((c) => elements[c].density ? elements[c].density : 0).reduce((a,b)=>a+b)/elementList.length;
|
||||
let stain = elementList.map((c) => elements[c].stain ? elements[c].stain : 0).reduce((a,b)=>a+b)/elementList.length;
|
||||
|
||||
if(elementList.some((c) => c.includes("molten")) || elementList.some((c) => c.includes("magma")))
|
||||
{
|
||||
movable = true;
|
||||
}
|
||||
|
||||
let states = elementList.map((c) => elements[c].state);
|
||||
if(!gasesOk)
|
||||
{
|
||||
state = "gas";
|
||||
density = 0;
|
||||
}
|
||||
else if(!movable)
|
||||
{
|
||||
state = "solid";
|
||||
}
|
||||
else if(states.includes("liquid"))
|
||||
{
|
||||
state = "liquid";
|
||||
}
|
||||
else
|
||||
{
|
||||
state = "solid";
|
||||
}
|
||||
|
||||
elements[name] = {
|
||||
color: colors2.length == 1 ? colors2[0] : colors2,
|
||||
colorObject: colors2.length == 1 ? toObject(colors2[0]) :colors2.map((c) => toObject(c)),
|
||||
tick: function(pixel) {
|
||||
checkReactions(pixel, elements[pixel.element].mixture);
|
||||
mixtureBehavior(pixel, elements[pixel.element].mixture);
|
||||
doDefaults(pixel);
|
||||
},
|
||||
tempHigh: minTempHigh,
|
||||
stateHigh: elementHigh,
|
||||
tempLow: maxTempLow,
|
||||
stateLow: elementLow,
|
||||
temp: temp,
|
||||
category: "mixture",
|
||||
mixture: elementList,
|
||||
movable: movable,
|
||||
density: density,
|
||||
state: state,
|
||||
stain: stain,
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
elementCount++;
|
||||
elements[name].hidden = true;
|
||||
hiddenCount++;
|
||||
elements[name].id = nextid++;
|
||||
document.getElementById("extraInfo").innerHTML = "<small><p>There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.</p><p>©2021-" + new Date().getFullYear() + ". All Rights Reserved. <a href='https://r74n.com'>R74n</a></p></small>"; //update extra info counts (and the copyright year, due to the method used)
|
||||
}
|
||||
else if(!elements[name].mixture)
|
||||
{
|
||||
elements[name].mixture = elementList;
|
||||
let tick = elements[name].tick;
|
||||
if(!elements[name].reactions)
|
||||
{
|
||||
elements[name].reactions = {};
|
||||
}
|
||||
elements[name].tick = function(pixel) {
|
||||
checkReactions(pixel, elements[pixel.element].mixture);
|
||||
if(typeof tick === "function")
|
||||
{
|
||||
tick(pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
function checkReactions(pixel, elementList)
|
||||
{
|
||||
for (let i = -1; i <= 1; i++)
|
||||
{
|
||||
for (let j = -1; j <= 1; j++)
|
||||
{
|
||||
if (!(i === 0 && j === 0) && !isEmpty(pixel.x+i,pixel.y+j,true)
|
||||
&& !elements[pixel.element].reactions[pixelMap[pixel.x+i][pixel.y+j].element])
|
||||
{
|
||||
let otherElement = pixelMap[pixel.x+i][pixel.y+j].element;
|
||||
let otherList = [otherElement];
|
||||
if(elements[otherElement].mixture)
|
||||
{
|
||||
otherList = elements[otherElement].mixture;
|
||||
}
|
||||
let list = elements[pixel.element];
|
||||
if(compatableMix(elements[pixel.element].mixture,otherList))
|
||||
{
|
||||
elements[pixel.element].reactions[otherElement] = {elem1: mixture(elements[pixel.element].mixture.concat(otherList)),elem2:null};;
|
||||
}
|
||||
else
|
||||
{
|
||||
elements[pixel.element].reactions[otherElement] = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mixtureBehavior(pixel, elementList)
|
||||
{
|
||||
let gasesOk = gasOk(elementList);
|
||||
let gases = elementList.filter((c) => elements[c].state === "gas");
|
||||
if(!gasesOk)
|
||||
{
|
||||
let neighbors = [ [-1,0], [1,0], [0,-1], [0,1] ]
|
||||
let randomNeighbor = neighbors[Math.floor(Math.random() * neighbors.length)]
|
||||
let randomGas = gases[Math.floor(Math.random() * gases.length)]
|
||||
let rnx = randomNeighbor[0];
|
||||
let rny = randomNeighbor[1];
|
||||
if(isEmpty(pixel.x+rnx, pixel.y+rny, false)) {
|
||||
let index = elementList.indexOf(randomGas);
|
||||
if (index > -1) {
|
||||
createPixel(randomGas, pixel.x+rnx, pixel.y+rny);
|
||||
currentPixels[currentPixels.length-1].temp = pixel.temp;
|
||||
changePixel(pixel, mixture(elementList.slice(0, index).concat(elementList.slice(index+1))));
|
||||
return;
|
||||
}
|
||||
}
|
||||
behaviors.GAS(pixel);
|
||||
return;
|
||||
}
|
||||
let states = elementList.map((c) => elements[c].state);
|
||||
if(elementList.some((c) => c.includes("molten")) || elementList.some((c) => c.includes("magma")))
|
||||
{
|
||||
pixelTick(pixel,behaviors.MOLTEN);
|
||||
}
|
||||
else if(!elements[pixel.element].movable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if(states.includes("liquid"))
|
||||
{
|
||||
if(elementList.includes("carbon_dioxide"))
|
||||
{
|
||||
pixelTick(pixel,elements.soda.behavior);
|
||||
}
|
||||
else
|
||||
{
|
||||
behaviors.LIQUID(pixel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
behaviors.POWDER(pixel);
|
||||
}
|
||||
}
|
||||
|
||||
function toObject(color)
|
||||
{
|
||||
color = color.match(/\d+/g);
|
||||
return {
|
||||
r: parseInt(color[0]),
|
||||
g: parseInt(color[1]),
|
||||
b: parseInt(color[2])
|
||||
};
|
||||
}
|
||||
|
||||
function averageRGB2(colors)
|
||||
{
|
||||
return toObject(averageRGB(colors.map((d) => (toObject(d)))));
|
||||
}
|
||||
|
||||
function averageRGB(rgblist) {
|
||||
var r = 0;
|
||||
var g = 0;
|
||||
var b = 0;
|
||||
for (var i = 0; i < rgblist.length; i++) {
|
||||
var rgb = rgblist[i];
|
||||
r += parseInt(rgb.r);
|
||||
g += parseInt(rgb.g);
|
||||
b += parseInt(rgb.b);
|
||||
}
|
||||
r = Math.floor(r/rgblist.length);
|
||||
g = Math.floor(g/rgblist.length);
|
||||
b = Math.floor(b/rgblist.length);
|
||||
return "rgb("+r+","+g+","+b+")";
|
||||
}
|
||||
|
||||
|
||||
function blendColors(colorA, colorB, amount = 0.5) {
|
||||
const [rA, gA, bA] = colorA.match(/\w\w/g).map((c) => parseInt(c, 16));
|
||||
const [rB, gB, bB] = colorB.match(/\w\w/g).map((c) => parseInt(c, 16));
|
||||
const r = Math.round(rA + (rB - rA) * amount).toString(16).padStart(2, '0');
|
||||
const g = Math.round(gA + (gB - gA) * amount).toString(16).padStart(2, '0');
|
||||
const b = Math.round(bA + (bB - bA) * amount).toString(16).padStart(2, '0');
|
||||
return '#' + r + g + b;
|
||||
}
|
||||
|
||||
let mixtureGroups = [];
|
||||
|
||||
function compatableMix(list1,list2)
|
||||
{
|
||||
if(!gasOk(list1.concat(list2)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for(let i = 0; i < mixtureGroups.length; i++)
|
||||
{
|
||||
if(list1.concat(list2).every(val => mixtureGroups[i].includes(val)
|
||||
&& list1.concat(list2).filter(el => el === val).length
|
||||
<=
|
||||
mixtureGroups[i].filter(el => el === val).length
|
||||
))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function mixture2(elementList)
|
||||
{
|
||||
mixtureGroups.push(elementList);
|
||||
for(let i = 0; i < elementList.length; i++)
|
||||
{
|
||||
for(let j = i+1; j < elementList.length; j++)
|
||||
{
|
||||
if(compatableMix([elementList[i]],[elementList[j]]))
|
||||
{
|
||||
if(!elements[elementList[i]].reactions)
|
||||
{
|
||||
elements[elementList[i]].reactions = {};
|
||||
}
|
||||
elements[elementList[i]].reactions[elementList[j]] = {elem1: mixture([elementList[i],elementList[j]]),elem2:null};
|
||||
}
|
||||
}
|
||||
}
|
||||
mixture3(elementList,[],0);
|
||||
}
|
||||
|
||||
function mixture3(elementList, list, n)
|
||||
{
|
||||
if(list.length > 0)
|
||||
{
|
||||
mixture(list);
|
||||
}
|
||||
if(n < elementList.length)
|
||||
{
|
||||
mixture3(elementList,list,n+1);
|
||||
if(compatableMix(list,[elementList[n]]))
|
||||
{
|
||||
mixture3(elementList,list.concat([elementList[n]]),n+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//exceptions to releasing gas
|
||||
function gasOk(elementList)
|
||||
{
|
||||
let gases = elementList.filter((c) => elements[c].state === "gas");
|
||||
if(elementList.includes("water") || elementList.includes("ice"))
|
||||
{
|
||||
gases = gases.filter((c) => c !== "carbon_dioxide");
|
||||
}
|
||||
return gases.length <= 0;
|
||||
}
|
||||
|
||||
//exceptions to mixtures
|
||||
function isValidMixture(elementList)
|
||||
{
|
||||
if(elementList.includes("dry_ice"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if(enabledMods.includes(runAfterAutogenMod)){
|
||||
whenAvailable(["runAfterAutogen"], function() {
|
||||
runAfterAutogen(function() {
|
||||
mixture2(["water","blood"]);
|
||||
mixture2(["water","cough_drugs","cellulose_gum","carbon_dioxide","sugar","milk"]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
predefinedColors = [
|
||||
["#8f19c2",["sugar","carbon_dioxide","cough_drugs","water","cellulose_gum"]],
|
||||
["#ab1efc",["sugar","carbon_dioxide","cough_drugs","ice","cellulose_gum"]],
|
||||
["#a527db",["sugar","carbon_dioxide","cough_drugs","water"]],
|
||||
["#c62eff",["sugar","carbon_dioxide","cough_drugs","ice"]],
|
||||
["#422016",["sugar","carbon_dioxide","water"]],
|
||||
["#4f261c",["sugar","carbon_dioxide","ice"]],
|
||||
["#e9cba3",["sugar","carbon_dioxide","water","milk"]],
|
||||
["#fff3d3",["sugar","carbon_dioxide","ice","milk"]],
|
||||
]
|
||||
|
||||
/*
|
||||
var c = elements.lean.colorObject;
|
||||
for (var j = 0; j < autoElements.frozen.rgb.length; j++) {
|
||||
var newc = autoElements.frozen.rgb[j];
|
||||
r = Math.floor(c.r * newc[0]);
|
||||
g = Math.floor(c.g * newc[1]);
|
||||
b = Math.floor(c.b * newc[2]);
|
||||
if (r > 255) {r = 255;} if (g > 255) {g = 255;} if (b > 255) {b = 255;}
|
||||
alert(RGBToHex({r:r,g:g,b:b}));
|
||||
}*/
|
||||
|
||||
nameList = {};
|
||||
|
||||
nameList[["blood","water"].sort().join()] = "bloody_water";
|
||||
nameList[["blood","ice"].sort().join()] = "bloody_slush";
|
||||
nameList[["blood_ice","water"].sort().join()] = "slushy_blood";
|
||||
nameList[["blood_ice","ice"].sort().join()] = "bloody_ice";
|
||||
|
||||
nameList[["cough_drugs","water"].sort().join()] = "cough_water";
|
||||
nameList[["cough_drugs","ice"].sort().join()] = "cough_ice";
|
||||
nameList[["cellulose_gum","water"].sort().join()] = "thick_water";
|
||||
nameList[["cellulose_gum","ice"].sort().join()] = "thick_ice";
|
||||
nameList[["cough_drugs","cellulose_gum"].sort().join()] = "dried_unsweetened_cough_syrup";
|
||||
nameList[["molten_cough_drugs","cellulose_gum"].sort().join()] = "molten_dried_unsweetened_cough_syrup";
|
||||
nameList[["cough_drugs","cellulose_gum","water"].sort().join()] = "unsweetened_cough_syrup";
|
||||
nameList[["cough_drugs","cellulose_gum","ice"].sort().join()] = "unsweetened_cough_syrup_ice";
|
||||
|
||||
nameList[["carbon_dioxide","water"].sort().join()] = "seltzer";
|
||||
nameList[["carbon_dioxide","ice"].sort().join()] = "seltzer_ice";
|
||||
|
||||
nameList[["carbon_dioxide","cough_drugs","water"].sort().join()] = "cough_seltzer";
|
||||
nameList[["carbon_dioxide","cough_drugs","ice"].sort().join()] = "cough_seltzer_ice";
|
||||
nameList[["carbon_dioxide","cellulose_gum","water"].sort().join()] = "thick_seltzer";
|
||||
nameList[["carbon_dioxide","cellulose_gum","ice"].sort().join()] = "thick_seltzer_ice";
|
||||
nameList[["carbon_dioxide","cough_drugs","cellulose_gum","water"].sort().join()] = "thick_cough_seltzer";
|
||||
nameList[["carbon_dioxide","cough_drugs","cellulose_gum","ice"].sort().join()] = "thick_cough_seltzer_ice";
|
||||
|
||||
|
||||
|
||||
nameList[["sugar","water"].sort().join()] = "sugar_water";
|
||||
nameList[["sugar","ice"].sort().join()] = "sugar_ice";
|
||||
|
||||
nameList[["sugar","cough_drugs","water"].sort().join()] = "sweetened_cough_water";
|
||||
nameList[["sugar","cough_drugs","ice"].sort().join()] = "sweetened_cough_ice";
|
||||
nameList[["sugar","cellulose_gum","water"].sort().join()] = "thick_sugar_water";
|
||||
nameList[["sugar","cellulose_gum","ice"].sort().join()] = "thick_sugar_ice";
|
||||
nameList[["sugar","cough_drugs","cellulose_gum"].sort().join()] = "dried_cough_syrup";
|
||||
nameList[["sugar","molten_cough_drugs","cellulose_gum"].sort().join()] = "molten_dried_cough_syrup";
|
||||
nameList[["sugar","cough_drugs","cellulose_gum","water"].sort().join()] = "cough_syrup";
|
||||
nameList[["sugar","cough_drugs","cellulose_gum","ice"].sort().join()] = "cough_syrup_ice";
|
||||
|
||||
nameList[["sugar","carbon_dioxide","water"].sort().join()] = "soda";
|
||||
nameList[["sugar","carbon_dioxide","ice"].sort().join()] = "soda_ice";
|
||||
|
||||
nameList[["sugar","carbon_dioxide","cough_drugs","water"].sort().join()] = "runny_lean";
|
||||
nameList[["sugar","carbon_dioxide","cough_drugs","ice"].sort().join()] = "runny_lean_ice";
|
||||
nameList[["sugar","carbon_dioxide","cellulose_gum","water"].sort().join()] = "thick_soda";
|
||||
nameList[["sugar","carbon_dioxide","cellulose_gum","ice"].sort().join()] = "thick_soda_ice";
|
||||
nameList[["sugar","carbon_dioxide","cough_drugs","cellulose_gum","water"].sort().join()] = "lean";
|
||||
nameList[["sugar","carbon_dioxide","cough_drugs","cellulose_gum","ice"].sort().join()] = "lean_ice";
|
||||
|
||||
nameList[["sugar","cough_drugs"].sort().join()] = "cough_sugar";
|
||||
nameList[["sugar","molten_cough_drugs"].sort().join()] = "molten_cough_sugar";
|
||||
nameList[["caramel","molten_cough_drugs"].sort().join()] = "molten_cough_caramel";
|
||||
nameList[["caramel","cough_drugs"].sort().join()] = "cough_caramel";
|
||||
nameList[["candy","cough_drugs"].sort().join()] = "cough_candy";
|
||||
nameList[["candy","molten_cough_drugs"].sort().join()] = "molten_cough_candy";
|
||||
|
||||
nameList[["sugar","cellulose_gum"].sort().join()] = "sweet_cellulose_gum";
|
||||
nameList[["caramel","cellulose_gum"].sort().join()] = "caramel_cellulose_gum";
|
||||
nameList[["candy","cellulose_gum"].sort().join()] = "cellulose_gum_candy";
|
||||
|
||||
|
||||
nameList[["cellulose_gum","caramel","molten_cough_drugs"].sort().join()] = "molten_caramelized_cough_syrup";
|
||||
nameList[["cellulose_gum","caramel","cough_drugs"].sort().join()] = "caramelized_cough_syrup";
|
||||
nameList[["cellulose_gum","candy","cough_drugs"].sort().join()] = "cough_drop";
|
||||
nameList[["cellulose_gum","candy","molten_cough_drugs"].sort().join()] = "molten_cough_drop";
|
||||
|
||||
function milkNames(elements,name)
|
||||
{
|
||||
nameList[elements.concat("milk").sort().join()] = name + "_milk";
|
||||
nameList[elements.concat("yogurt").sort().join()] = name + "_yogurt";
|
||||
nameList[elements.concat("frozen_yogurt").sort().join()] = name + "_frozen_yogurt";
|
||||
nameList[elements.concat("cream").sort().join()] = name + "_cream";
|
||||
nameList[elements.concat("ice_cream").sort().join()] = name + "_ice_cream";
|
||||
}
|
||||
|
||||
nameList[["calcium","cough_drugs"].sort().join()] = "calcified_cough_syrup";
|
||||
nameList[["calcium","molten_cough_drugs"].sort().join()] = "calcified_molten_cough_syrup";
|
||||
nameList[["molten_calcium","molten_cough_drugs"].sort().join()] = "molten_calcified_cough_syrup";
|
||||
|
||||
|
||||
milkNames2([
|
||||
["water","ice","cellulose_gum","sugar","carbon_dioxide","caramel","candy","cough_drugs","molten_cough_drugs"],
|
||||
["watery","icy","thick","sweetened","carbonated","caramelized","candied","cough","cough"]],[[],""],0);
|
||||
|
||||
function milkNames2(elementList, list, n)
|
||||
{
|
||||
if(list[0].length > 0)
|
||||
{
|
||||
if(list[0].includes("molten_cough_drugs"))
|
||||
{
|
||||
milkNames(list[0], "molten" + list[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
milkNames(list[0], list[1].substring(1));
|
||||
}
|
||||
}
|
||||
if(n < elementList[0].length && n < elementList[1].length)
|
||||
{
|
||||
milkNames2(elementList,list,n+1);
|
||||
list2 = [list[0].concat([elementList[0][n]]),list[1] + "_" + elementList[1][n]];
|
||||
if(list2[0])
|
||||
{
|
||||
milkNames2(elementList,list2,n+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(let i in nameList)
|
||||
{
|
||||
if(nameList[i].includes("sweetened_carbonated_"))
|
||||
{
|
||||
nameList[i] = nameList[i].replace("sweetened_carbonated_","");
|
||||
nameList[i] += "_soda";
|
||||
}
|
||||
}
|
||||
|
||||
nameList[["sugar","carbon_dioxide","water","milk"].sort().join()] = "pilk";
|
||||
nameList[["sugar","carbon_dioxide","ice","milk"].sort().join()] = "icy_pilk";
|
||||
nameList[["sugar","carbon_dioxide","water","yogurt"].sort().join()] = "pogurt";
|
||||
nameList[["sugar","carbon_dioxide","ice","yogurt"].sort().join()] = "icy_pogurt";
|
||||
nameList[["sugar","carbon_dioxide","water","frozen_yogurt"].sort().join()] = "frozen_pogurt";
|
||||
nameList[["sugar","carbon_dioxide","ice","frozen_yogurt"].sort().join()] = "icy_frozen_pogurt";
|
||||
nameList[["sugar","carbon_dioxide","water","cream"].sort().join()] = "pilk_cream";
|
||||
nameList[["sugar","carbon_dioxide","ice","cream"].sort().join()] = "icy_pilk_cream";
|
||||
nameList[["sugar","carbon_dioxide","water","ice_cream"].sort().join()] = "pice_cream";
|
||||
nameList[["sugar","carbon_dioxide","ice","ice_cream"].sort().join()] = "icy_pice_cream";
|
||||
|
||||
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","water","milk"].sort().join()] = "thick_pilk";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","ice","milk"].sort().join()] = "icy_thick_pilk";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","water","yogurt"].sort().join()] = "thick_pogurt";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","ice","yogurt"].sort().join()] = "icy_thick_pogurt";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","water","frozen_yogurt"].sort().join()] = "frozen_thick_pogurt";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","ice","frozen_yogurt"].sort().join()] = "icy_frozen_thick_pogurt";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","water","cream"].sort().join()] = "thick_pilk_cream";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","ice","cream"].sort().join()] = "icy_thick_pilk_cream";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","water","ice_cream"].sort().join()] = "thick_pice_cream";
|
||||
nameList[["cellulose_gum","sugar","carbon_dioxide","ice","ice_cream"].sort().join()] = "icy_thick_pice_cream";
|
||||
|
||||
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","water","milk"].sort().join()] = "lilk";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","ice","milk"].sort().join()] = "icy_lilk";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","water","yogurt"].sort().join()] = "logurt";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","ice","yogurt"].sort().join()] = "icy_logurt";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","water","frozen_yogurt"].sort().join()] = "frozen_logurt";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","ice","frozen_yogurt"].sort().join()] = "icy_frozen_logurt";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","water","cream"].sort().join()] = "lilk_cream";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","ice","cream"].sort().join()] = "icy_lilk_cream";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","water","ice_cream"].sort().join()] = "leanice_cream";
|
||||
nameList[["cough_drugs","cellulose_gum","sugar","carbon_dioxide","ice","ice_cream"].sort().join()] = "icy_leanice_cream";
|
||||
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","water","milk"].sort().join()] = "runny_lilk";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","ice","milk"].sort().join()] = "icy_runny_lilk";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","water","yogurt"].sort().join()] = "runny_logurt";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","ice","yogurt"].sort().join()] = "icy_runny_logurt";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","water","frozen_yogurt"].sort().join()] = "frozen_runny_logurt";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","ice","frozen_yogurt"].sort().join()] = "icy_frozen_runny_logurt";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","water","cream"].sort().join()] = "runny_lilk_cream";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","ice","cream"].sort().join()] = "icy_runny_lilk_cream";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","water","ice_cream"].sort().join()] = "runny_leanice_cream";
|
||||
nameList[["cough_drugs","sugar","carbon_dioxide","ice","ice_cream"].sort().join()] = "icy_runny_leanice_cream";
|
||||
|
||||
elements.cough_drugs = {
|
||||
density: 1230, //using the 6.25/10 ratio from a CP/PH cough syrup from Morton Grove Pharmaceuticals, Inc. because it was in hot on r/lean (of course there’s a subreddit for that) | this is 6.25 mg pr.hy. and 10 mg co.ph. per 5mL dose, but ratios and reactions aren’t possible and implementing them to this accuracy would also require an accurate cough syrup density
|
||||
tempHigh: 157.5,
|
||||
color: "#e0e4e0",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid"
|
||||
}
|
||||
|
||||
|
||||
elements.cellulose_gum = {
|
||||
density: 1600,
|
||||
tempHigh: 270,
|
||||
stateHigh: "fire",
|
||||
color: "#f7e7b7",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -3,8 +3,10 @@ pixelResizeButton.onclick = function(pixel) {
|
|||
let canvas_width = document.getElementById("game").width;
|
||||
let canvas_height = document.getElementById("game").height;
|
||||
let pixelSizeNeeded = prompt("How big should pixels be?");
|
||||
if (!pixelSizeNeeded) { return }
|
||||
if (!pixelSizeNeeded || isNaN(pixelSizeNeeded)) { alert('number is invalid!'); return; }
|
||||
resizeCanvas(canvas_height,canvas_width, parseFloat(pixelSizeNeeded), true);
|
||||
};
|
||||
pixelResizeButton.textContent = "Resize";
|
||||
document.getElementById("toolControls").appendChild(pixelResizeButton);
|
||||
window.addEventListener("load",function(){
|
||||
document.getElementById("toolControls").appendChild(pixelResizeButton);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
let precisionDrawing = false
|
||||
//mod made by feeshmaster
|
||||
|
||||
//try out debugRework.js or any other mods made by me!
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.key == "w" && precisionDrawing) {
|
||||
mousePos.y -= 1
|
||||
} else if (e.key == "a" && precisionDrawing) {
|
||||
mousePos.x -= 1
|
||||
} else if (e.key == "s" && precisionDrawing) {
|
||||
mousePos.y += 1
|
||||
} else if (e.key == "d" && precisionDrawing) {
|
||||
mousePos.x += 1
|
||||
} else if (event.key === 'X' && event.shiftKey) {
|
||||
console.log("precisionMode deactivated!")
|
||||
precisionDrawing = !precisionDrawing
|
||||
if (!precisionDrawing) {
|
||||
mousePos = {x: "not", y: "updated"}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(setUpOnStart, 1000)
|
||||
function setUpOnStart() {
|
||||
|
||||
getMousePos = (canvas, evt) => {
|
||||
if (precisionDrawing) {
|
||||
return mousePos;
|
||||
}
|
||||
// If evt.touches is defined, use the first touch
|
||||
if (evt.touches) {
|
||||
evt.preventDefault();
|
||||
evt = evt.touches[0];
|
||||
isMobile = true;
|
||||
}
|
||||
var rect = canvas.getBoundingClientRect();
|
||||
return {
|
||||
// Round to nearest pixel
|
||||
x: Math.round((evt.clientX - rect.left)/pixelSize-0.5),
|
||||
y: Math.round((evt.clientY - rect.top)/pixelSize-0.5)
|
||||
};
|
||||
}
|
||||
|
||||
let controlsTable = document.getElementById("controlsTable");
|
||||
let row1 = document.createElement("tr");
|
||||
row1.innerHTML = `<td colspan="2" style="text-align:center"><strong>Mod controls</strong></td>`;
|
||||
let row2 = document.createElement("tr");
|
||||
row2.innerHTML = `<td>start precision</td><td><kbd>Shift + X</kbd> or <kbd>toggle button(not released)</kbd></td>`;
|
||||
let row3 = document.createElement("tr");
|
||||
row3.innerHTML = `<td>move in precision</td><td><kbd>W, A, S, D/arrows</kbd> or <kbd>buttons(not released)</kbd></td>`;
|
||||
|
||||
// Append the rows
|
||||
controlsTable.appendChild(row1);
|
||||
controlsTable.appendChild(row2);
|
||||
controlsTable.appendChild(row3);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,13 +3,15 @@ elements.legendary_energy = {
|
|||
color: "#13d649",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:90>plasma,plasma,plasma,plasma,radon,radon,radon,radon,radon,radon,molten_iron,molten_uranium,molten_lead AND CH:light|XX",
|
||||
"XX|EX:90>plasma,plasma,plasma,plasma,radon,radon,radon,radon,radon,radon,molten_iron,molten_uranium,legendary_energy AND CH:light|XX",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
temp: 99999999700,
|
||||
temp: 9869,
|
||||
tempLow: 6382,
|
||||
stateLow: "liquid_legend",
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 1000,
|
||||
density: 3000,
|
||||
hardness: 1,
|
||||
excludeRandom: true,
|
||||
noMix: true,
|
||||
|
|
@ -17,40 +19,51 @@ elements.legendary_energy = {
|
|||
"magma": { "elem1": "armageddon", "elem2": null },
|
||||
"void": { "elem1": "light", "elm2": null },
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
runAfterLoad(function() {
|
||||
if(enabledMods.includes("liquid_energy.js") && enabledMods.includes("bananas.js")) {
|
||||
elements.liquid_legend = {
|
||||
elements.liquid_legend = {
|
||||
name: "liquid legend",
|
||||
color: "#13d644",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M2|EX:15>radon,radon,radon,liquid_legend%0.4 AND DL%0.2|M2",
|
||||
"M2|EX:15>radon,radon,legendary_energy,liquid_legend%0.4 AND DL%0.2|M2",
|
||||
"M1|M1|M1",
|
||||
],
|
||||
temp: 300,
|
||||
category: "energy liquids",
|
||||
temp: 6382,
|
||||
tempHigh: 9869,
|
||||
stateHigh: "legendary_energy",
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2000,
|
||||
excludeRandom: true,
|
||||
reactions: {
|
||||
"magma": { "elem1": "armageddon", "elem2": null },
|
||||
"void": { "elem1": "light", "elm2": null },
|
||||
},
|
||||
},
|
||||
elements.banana_juice = {
|
||||
},
|
||||
},
|
||||
|
||||
elements.wine = {
|
||||
name: "wine",
|
||||
color: "#f02263",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 30,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 20,
|
||||
excludeRandom: true,
|
||||
},
|
||||
|
||||
if (enabledMods.includes("bananas.js")) {
|
||||
runAfterLoad(function() {
|
||||
elements.banana_juice = {
|
||||
name: "banana juice",
|
||||
color: "#e0f542",
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 800,
|
||||
category: "food",
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 200,
|
||||
density: 20,
|
||||
excludeRandom: true,
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
)};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ var runAfterAutogenMod = "mods/runAfterAutogen2.js";
|
|||
var libraryMod = "mods/code_library.js";
|
||||
|
||||
if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) {
|
||||
whenAvailable(["runAfterAutogen","libraryLoaded"], function() {
|
||||
whenAvailable(["raaLoaded","libraryLoaded"], function() {
|
||||
runAfterAutogen(function() {
|
||||
snowAndIceCache = Object.keys(elements).filter(function(name) {
|
||||
return name.endsWith("snow") || name.endsWith("ice") || name == "rime"
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ function runAfterAutogen(callback) {
|
|||
}, interval);
|
||||
}
|
||||
function createButtonsAndCountElements() {
|
||||
document.getElementById("categoryControls").innerHTML = "";
|
||||
window.setTimeout(function() {
|
||||
document.getElementById("categoryControls").innerHTML = "";
|
||||
document.getElementById("elementControls").innerHTML = "";
|
||||
document.getElementById("category-tools").innerHTML = "";
|
||||
document.getElementById("extraInfo").innerHTML = "";
|
||||
elementCount = 0;
|
||||
hiddenCount = 0;
|
||||
|
|
@ -46,7 +48,9 @@ function createButtonsAndCountElements() {
|
|||
document.getElementById("categoryControls").children[0].click()
|
||||
document.getElementById("extraInfo").insertAdjacentHTML("beforeend", "<small><p>v" + currentversion + " • " + elementCount + " elements, including " + hiddenCount + " hidden ones.</p><p>©2021-" + new Date().getFullYear() + ". All Rights Reserved. <a style='color:#00ffff' href='https://r74n.com'>R74n</a></p></small>");
|
||||
selectElement(currentElement);
|
||||
|
||||
}, 10);
|
||||
};
|
||||
|
||||
runAfterAutogen(createButtonsAndCountElements);
|
||||
runAfterAutogen(createButtonsAndCountElements);
|
||||
|
||||
raaLoaded = true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
elements.carbonite = {
|
||||
color: "#343634",
|
||||
behavior: behaviors.WALL,
|
||||
category: "star wars",
|
||||
state: "solid",
|
||||
density: 1000,
|
||||
tempHigh: 1000,
|
||||
stateHigh: "carbondioxide",
|
||||
reactions:{
|
||||
"acid": {elem1: null, elem2: "slag"},
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
elements.light_saber = {
|
||||
color: "#06d106",
|
||||
behavior: behaviors.WALL,
|
||||
category: "star wars",
|
||||
state: "solid"
|
||||
}
|
||||
|
||||
// look it up:
|
||||
// https://starwars.fandom.com/wiki/Plastoid
|
||||
// stormtrooper armor
|
||||
elements.plastoid = {
|
||||
color: "#FFAAAA",
|
||||
behavior: behaviors.WALL,
|
||||
category: "star wars",
|
||||
state: "solid",
|
||||
density: 400,
|
||||
tempHigh: 300,
|
||||
stateHigh: "molten_plastic",
|
||||
hardness: 1,
|
||||
burn: 0
|
||||
};
|
||||
|
||||
elements.green_milk ={
|
||||
color: "#95f595",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "star wars",
|
||||
state: "liquid",
|
||||
viscosity: 100,
|
||||
density: 720,
|
||||
};
|
||||
|
||||
elements.laser_blast = {
|
||||
color: "#ff0000",
|
||||
behavior: behaviors.BOUNCY,
|
||||
category: "star wars",
|
||||
};
|
||||
elements.tibanna_gas ={
|
||||
color: "#d99a9a",
|
||||
behavior: behaviors.GAS,
|
||||
category: "star wars",
|
||||
burn: 100,
|
||||
burnTime: 1,
|
||||
|
||||
}
|
||||
elements.milk_water = {
|
||||
color: "#e4fade",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "star wars",
|
||||
hidden: true,
|
||||
viscosity: 90,
|
||||
state: "liquid",
|
||||
density: 1,
|
||||
};
|
||||
|
||||
elements.water.reactions.green_milk = {elem1: null, elem2: "milk_water"}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -62,7 +62,6 @@ drawPixels = function(forceTick=false) {
|
|||
//if (pixelMap[pixel.x][pixel.y] == undefined || currentPixels.indexOf(pixel) == -1) {continue}
|
||||
if (pixel.del) {continue}
|
||||
if (!paused || forceTick) {
|
||||
// VELOCITY
|
||||
doVelocity(pixel);
|
||||
if (elements[pixel.element].tick) { // Run tick function if it exists
|
||||
elements[pixel.element].tick(pixel);
|
||||
|
|
@ -72,6 +71,7 @@ drawPixels = function(forceTick=false) {
|
|||
pixelTick(pixel);
|
||||
}
|
||||
};
|
||||
if (pixel.con) { pixel = pixel.con }
|
||||
if (elements[pixel.element].isGas || elements[pixel.element].glow) {
|
||||
pixelsLast.push(pixel);
|
||||
}
|
||||
|
|
@ -81,12 +81,18 @@ drawPixels = function(forceTick=false) {
|
|||
}
|
||||
// Draw the current pixels
|
||||
var canvas = document.getElementById("game");
|
||||
if (canvas === null) {return}
|
||||
var ctx = canvas.getContext("2d");
|
||||
// Clear the canvas
|
||||
if (!settings["bg"]) {ctx.clearRect(0, 0, canvas.width, canvas.height)}
|
||||
else {
|
||||
ctx.fillStyle = settings["bg"];
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
var pixelDrawList = pixelsFirst.concat(pixelsLast);
|
||||
for (var i = 0; i < pixelDrawList.length; i++) {
|
||||
pixel = pixelDrawList[i];
|
||||
if (pixelMap[pixel.x][pixel.y] == undefined) {continue}
|
||||
if (pixel.con) { pixel = pixel.con }
|
||||
if (view===null || view===3) {
|
||||
ctx.fillStyle = pixel.color;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,15 @@
|
|||
#content { font-family: Arial, Helvetica, sans-serif; font-size:1.5em; }
|
||||
h2 { text-align: center; margin-bottom:0; margin-top:45px}
|
||||
</style>
|
||||
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
|
||||
<script>
|
||||
window.googletag = window.googletag || {cmd: []};
|
||||
googletag.cmd.push(function() {
|
||||
googletag.defineSlot('/23030676605/optima_slot300x250', [300, 250], 'div-gpt-ad-1701632379761-0').addService(googletag.pubads());
|
||||
googletag.pubads().enableSingleRequest();
|
||||
googletag.enableServices();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<html>
|
||||
<style>
|
||||
body, html {width: 300px; height: 250px; overflow: hidden; padding:0!important; margin: 0!important;text-align: center}
|
||||
/* body, html {overflow: hidden; padding:0!important; margin: 0!important;} */
|
||||
img {width: 300px; height: 250px;}
|
||||
p {font-family: Arial, Helvetica, sans-serif; color:white;}
|
||||
p a {color:rgb(255, 0, 255)}
|
||||
</style>
|
||||
</html>
|
||||
<body>
|
||||
<img src="https://R74n.com/icons/thumbnail.png">
|
||||
<!-- <p style="font-size:1.2em"><strong>Christmas <span style="color:red">GIFT</span> <span style="color:lime">IDEA</span></strong>: <a href="https://amzn.to/3R6Pruz" target="_blank">Chemistry Molecule Set Toy</a></p> -->
|
||||
</body>
|
||||
|
|
@ -8,4 +8,5 @@ https://sandboxels.r74n.com/help
|
|||
https://sandboxels.r74n.com/mobile-use
|
||||
https://sandboxels.r74n.com/mod-list
|
||||
https://sandboxels.r74n.com/offline-use
|
||||
https://sandboxels.r74n.com/feedback
|
||||
https://sandboxels.r74n.com/feedback
|
||||
https://sandboxels.r74n.com/tips
|
||||
|
|
@ -86,7 +86,9 @@ kbd {
|
|||
border: 1px solid #000;
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 2px rgba(0, 0, 0, 0.05);
|
||||
font-family: 'Arial';
|
||||
cursor: pointer;
|
||||
}
|
||||
kbd:active {filter: brightness(70%);}
|
||||
#infoParent, #modParent, #settingsParent, .menuParent {
|
||||
display: none;
|
||||
}
|
||||
|
|
@ -549,4 +551,5 @@ select, .toggleInput, #settingsMenu input[type="number"], #settingsMenu input[ty
|
|||
pointer-events: none;
|
||||
padding: 5px;
|
||||
white-space: pre-wrap;
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>50 Things to Do in Sandboxels</title>
|
||||
<meta name="description" content="List of 50+ activities to have fun in the free sandbox chemistry and science simulator, Sandboxels.">
|
||||
<meta name="keywords" content="falling sand, elements, pixel art, simulator, powder">
|
||||
<meta name="author" content="R74n">
|
||||
<meta name="copyright" content="R74n">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="all">
|
||||
|
||||
<!--Favicons-->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-touch-icon.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png?v=2">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="mask-icon" href="icons/safari-pinned-tab.svg?v=2" color="#2167ff">
|
||||
<link rel="shortcut icon" href="icons/favicon.ico?v=2">
|
||||
<meta name="msapplication-TileColor" content="#e6d577">
|
||||
<meta name="theme-color" content="#000000">
|
||||
|
||||
<!--OpenGraph-->
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="Sandboxels">
|
||||
<meta property="og:image" content="https://sandboxels.r74n.com/icons/wallpaper.png">
|
||||
<meta property="og:image:width" content="1980">
|
||||
<meta property="og:image:height" content="971">
|
||||
<meta property="og:image:type" content="image/png">
|
||||
<meta property="og:image:alt" content="A rainforest made in Sandboxels">
|
||||
|
||||
<!--Twitter-->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site:id" content="1436857621827530753">
|
||||
<meta name="twitter:image" content="https://sandboxels.r74n.com/icons/card.png">
|
||||
<meta name="twitter:image:alt" content="A rainforest made in Sandboxels">
|
||||
<meta name="twitter:creator:id" content="1436857621827530753">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style.css?nocache=3">
|
||||
<style>
|
||||
/* on mobile, make h1 fit on one line */
|
||||
@media only screen and (max-width: 800px) {
|
||||
h1 { font-size: 1em; }
|
||||
}
|
||||
#content { font-family: Arial, Helvetica, sans-serif; font-size:1.5em; }
|
||||
h2 { text-align: center; margin-bottom:0; margin-top:45px}
|
||||
ol li::marker { color:lime }
|
||||
ol li {
|
||||
margin-bottom: 10px;
|
||||
margin-left: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1><a href="https://sandboxels.R74n.com" class="backbutton"><</a> 50 Things to Do in Sandboxels</h1>
|
||||
|
||||
</ul>
|
||||
<div id="content">
|
||||
|
||||
<p>Sandboxels is the <strong>ultimate sandbox simulator</strong>, allowing you to experiment with chemistry, ecosystems, food, and much more, with 500+ elements, like sand, water, fire, and plants! Get started on any device with a web browser, even your phone, by visiting the <a href="https://sandboxels.R74n.com/">WEBSITE</a> for free!</p>
|
||||
|
||||
<p>Below is just a portion of the things you can do to relax or research. The real options are unlimited, use your creativity!</p>
|
||||
|
||||
<ol>
|
||||
<li>Follow a food recipe from Google</li>
|
||||
<li>Create a lovely scene then blow it up</li>
|
||||
<li>Build a thriving ecosystem with diverse plants, animals, and a food chain</li>
|
||||
<li>Put Steam into the air and watch Clouds form and rain</li>
|
||||
<li>Add different liquids to a glass to compare their densities</li>
|
||||
<li>Bombard Uranium with Neutrons until it explodes</li>
|
||||
<li>Have a battle between Spout and Torch in Special</li>
|
||||
<li>Have a battle between Gray Goo and Malware in Special</li>
|
||||
<li>Research and construct a working nuclear reactor</li>
|
||||
<li>Create tutorials on the <a href="https://sandboxels.wiki.gg/wiki/Category:Tutorials" target="_blank">Sandboxels Wiki</a></li>
|
||||
<li>Create an infinitely looping Pipe</li>
|
||||
<li>Lay down soil, add Primordial Soup, and watch it evolve</li>
|
||||
<li>Find chemical reactions on Google and try to replicate them</li>
|
||||
<li>Install and try out a mod from the <a href="https://sandboxels.r74n.com/mod-list">Mod List</a></li>
|
||||
<li>Dip Humans in Acid</li>
|
||||
<li>Melt metals together to discover different alloys</li>
|
||||
<li>Discover the different flame colors of burning substances</li>
|
||||
<li>Research a Sandboxels element in real life on Google</li>
|
||||
<li>Create pixel art with the Art element in Special</li>
|
||||
<li>Mix random liquids and powders together</li>
|
||||
<li>Try heating and cooling different things to see their states</li>
|
||||
<li>Check out <a href="https://sandboxels.r74n.com/controls">all the controls</a></li>
|
||||
<li>Make a factory to produce an element</li>
|
||||
<li>Take your anger out on pixels with Lightning</li>
|
||||
<li>Create Glass by melting Sand</li>
|
||||
<li>See the <a href="https://sandboxels.r74n.com/changelog">latest updates</a> to Sandboxels</li>
|
||||
<li>Learn the effects of Radiation on different lifeforms</li>
|
||||
<li>Try feeding different foods to different animals and see what they like</li>
|
||||
<li>Melt Gallium with just the body heat from Humans</li>
|
||||
<li>Mix ingredients into Batter and bake a cake</li>
|
||||
<li>Follow a tutorial from our <a href="https://tiktok.com/@r74n.com">TikTok</a> or <a href="https://www.youtube.com/channel/UCzS6ufDfiDxbHVL001GwFeA/shorts">YouTube</a></li>
|
||||
<li>Mix random food ingredients together and create a new recipe</li>
|
||||
<li>Host a Firework show</li>
|
||||
<li>Create a gift for a friend or loved one and save it as a file</li>
|
||||
<li>Brew your own herbal or floral Tea</li>
|
||||
<li>See what chemicals react to Fire and how</li>
|
||||
<li>Test the strengths of different materials with explosions</li>
|
||||
<li>Make a campfire from Wood and light it</li>
|
||||
<li>Research and create the elusive Homunculus</li>
|
||||
<li>Test the boiling and melting points of different materials</li>
|
||||
<li>Use the Incinerate tool to melt or burn almost anything</li>
|
||||
<li>Add Oxygen to Iron or Copper to create their oxides</li>
|
||||
<li>Ferment different things, like Grapes, with Yeast</li>
|
||||
<li>Import an image using the Image tool in Special</li>
|
||||
<li>Grow a Flower garden</li>
|
||||
<li>Build a terrarium for bugs and feed them</li>
|
||||
<li>Watch Humans steal all of your Gold Coins</li>
|
||||
<li>Melt everything with Plasma</li>
|
||||
<li>Discover every element (Info > Undiscovered)</li>
|
||||
<li>Compost your Dead Plants and Ash with Worms</li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-93720349-9"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-93720349-9');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>Verification: fc020778bf434546</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue