Merge remote-tracking branch 'upstream/main' into load_order_fix

This commit is contained in:
lllllllllwith10ls 2023-09-30 19:33:55 -05:00
commit 2d728658c8
5 changed files with 57 additions and 10 deletions

View File

@ -13951,6 +13951,7 @@ Cancer, Landmine, Grenade, Smoke Grenade">?</span> <input type="button" value="O
<div id="bottomInfoBox">
<div id="bottomTopBox">
<p>Support development by subscribing on <a href="https://www.patreon.com/R74n" target="_blank">our Patreon</a>! Many benefits!!</p>
<p>Want your ad here? Email us at <a href="mailto:contact@r74n.com">contact@R74n.com</a>!</p>
</div>
@ -13961,11 +13962,11 @@ Cancer, Landmine, Grenade, Smoke Grenade">?</span> <input type="button" value="O
<p>Falling-sand games are a genre of sandbox games characterized by falling particles of various types.</p>
<p>Simply click or use your touchscreen to select a category, like <strong>Liquids</strong>, then pick an element, like <strong>Water</strong>. Drag on the canvas above to place your pixels, and watch them interact with others!</p>
<img src="icons/wallpaper.webp" style="width:100%" alt="Rainforest landscape made in Sandboxels" title="Rainforest landscape made in Sandboxels">
<p>Sandboxels has many applications in <a href="education-use">education</a>. With a hands-on experience, it can give students an understanding of emerging phenomena in many fields, such as biology, chemistry, ecology, geology, cooking, and even virology. There are countless aspects to discover.</p>
<p>Sandboxels has many applications in <a href="https://sandboxels.R74n.com/education-use">education</a>. With a hands-on experience, it can give students an understanding of emerging phenomena in many fields, such as biology, chemistry, ecology, geology, cooking, and even virology. There are countless aspects to discover.</p>
<p>We have a thriving community on <a href="https://discord.gg/ejUc6YPQuS" target="_blank">Discord</a>! There you can post feedback or share your creations.</p>
<!-- <p>If you'd like to support us, consider donating on <a href="https://www.paypal.com/donate/?hosted_button_id=GCX4VHQ7SZWTN" target="_blank">PayPal</a> or <a href="https://cash.app/$emojiartist" target="_blank" title="$emojiartist">CashApp</a>, or subscribing on Discord.</p> -->
<p>Business inquiries? Education stories? <a href="help">Help needed?</a> Email us at <a href="mailto:contact@r74n.com">contact@R74n.com</a>!</p>
<p>Thanks to: Serioustar, ggod, Trent, u2ce</p>
<p>Business inquiries? Education stories? <a href="https://sandboxels.R74n.com/help">Help needed?</a> Email us at <a href="mailto:contact@r74n.com">contact@R74n.com</a>!</p>
<p>Thanks to: Serioustar, WeiChei, ggod, Trent, u2ce</p>
<p>Sandboxels is developed by R74n. Check out <a href="https://R74n.com" target="_blank">our other projects</a>! <a href="https://R74n.com/privacy">Privacy Policy</a></p>
<script>
// add the above elements programmatically when the page loads

View File

@ -92,10 +92,12 @@
<!----><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>
<tr><td>color_everything.js</td><td>Allows every element to have a custom color</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>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>fools.js</td><td>Adds back FOOLS Mode</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>smooth_water.js</td><td>Changes water mechanics so that it flows in one direction until it bounces off of something</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>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>
@ -103,6 +105,7 @@
<!----><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>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 its set to</td><td>mollthecoder</td></tr>
<tr><td>change.js</td><td>Adds a tool that only replaces existing pixels</td><td>Alice</td></tr>
@ -159,6 +162,7 @@
<!----><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>note_block.js</td><td>Adds musical Note Blocks</td><td>Alice</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>
@ -173,6 +177,7 @@
<tr><td>life_eater.js</td><td>Adds Warhammer 40,000s Life-Eater Virus and Virus Bombs</td><td>Alice</td></tr>
<tr><td>liquid_void.js</td><td>Adds a liquid variant of Void</td><td>Alice</td></tr>
<tr><td>more_breaking.js</td><td>Allows for breaking more elements in explosions</td><td>Alice</td></tr>
<tr><td>rays.js</td><td>Adds more Ray types</td><td>Alice</td></tr>
<!----><tr><td class="modCat" colspan="3">Food & Cooking</td></tr><!---->
<tr><td>bananas.js</td><td>Adds bananas and banana plants</td><td>Alice</td></tr>
@ -194,6 +199,7 @@
<tr><td>nocancer.js</td><td>Removes cancer from the game one tick after it is created</td><td>mollthecoder</td></tr>
<tr><td>nocancer2.js</td><td>Removes cancer from the game altogether. May be incompatible with other mods that spawn cancer</td><td>mollthecoder</td></tr>
<tr><td>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>toothpaste.js</td><td>Teeth and paste</td><td>Alice</td></tr>
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
@ -228,6 +234,7 @@
<!----><tr><td class="modCat" colspan="3">Technical Libraries & Tests</td></tr><!---->
<tr><td>a_bundle_of_tests.js</td><td>Several test functions</td><td>Alice</td></tr>
<tr><td>betterMenuScreens.js</td><td>Library for mods to create their own menus</td><td>ggod</td></tr>
<tr><td>changePixelDebug.js</td><td>Makes the changePixel() function abort and log to console when it tries to change to a non-existent element</td><td>Alice</td></tr>
<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>
@ -235,6 +242,7 @@
<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>
<tr><td>explodeAtPlus.js</td><td>Extension of the explodeAt function with more options</td><td>Alice</td></tr>
<tr><td>fill_script.js</td><td>Script that fills an area</td><td>TealEgg#7646</td></tr>
<tr><td>generative_mods.js</td><td>Modpack with optional mass element generation</td><td>Alice</td></tr>
<tr><td>generator_prompt.js</td><td>Adds a prompt to use generative_mods.jss element generators after the game finishes loading</td><td>Alice</td></tr>

View File

@ -2,7 +2,7 @@
// Create a new Javascript file like this one.
// Add the file to the mods folder on GitHub, or host it somewhere else.
// https://github.com/slweeb/sandboxels/tree/main/mods
// https://github.com/R74nCom/sandboxels/tree/main/mods
// To add it in the Mod Loader:
// If it is in the mods folder, you can just use the name of the file.

36
mods/flipflop.js Normal file
View File

@ -0,0 +1,36 @@
elements.flipflop = {
properties: {
powerstate: "false",
cooldown: 0,
},
name: "Flip Flop",
color: "#CF300D",
state: "solid",
category: "machines",
tick: function(pixel) {
doHeat(pixel)
doBurning(pixel)
doElectricity(pixel)
let Output = pixelMap[pixel.x+1][pixel.y]
let Input = pixelMap[pixel.x-1][pixel.y]
if (typeof Output !== "undefined" && typeof Input !== "undefined") {
if (Input.charge == undefined && pixel.cooldown == 1) {
pixel.cooldown = 0
}
if (Input.charge > 0 && pixel.cooldown == 0) {
pixel.cooldown = 1
if (pixel.powerstate == "true") {
pixel.powerstate = "false"
pixel.color = "#CF300D"
} else if (pixel.powerstate == "false") {
pixel.powerstate = "true"
pixel.color = "#94CF0D"
Output.charge = 1
}
} else if (pixel.cooldown == 0) {
Output.charge = undefined
}
}
}
};

View File

@ -4,13 +4,13 @@
runAfterLoad(function() {
if (enabledMods.includes("mods/the_ground.js")) {
let regexRocks = /(granite)|(rhyolite)|(pumice)|(obsidian)|(dacite)|(dacidian)|(andesite)|(diorite)|(scoria)|(andesidian)|(gabbro)|(basalt)|(basalidian)|(peridotite)|(komatiite)|(komatidian)/
let regexType = /(_gravel)|(_sand)|(_dust)|(_shard)|(hot_)/
let regexType = /(_gravel)|(_sand)|(_sandstone)|(_dust)|(_shard)|(hot_)/
let toHide = ["dry_permafrost", "hot_sand", "hot_dirt", "hot_rock", "hot_rock_wall", "hot_gravel", "hot_limestone", "hot_calcium_carbonate_dust", "sandy_water", "clay_water", "dry_clay_loam"]
// hides all elements part of both rocks and type
// false positives *can* be hit because this doesn't check if it comes from The Ground (it can't), but ideally none given how specific it is
for (elem in elements) {
if (regexRocks.test(elem)) {
for (let elem in elements) {
if (typeof(elements[elem]) == "object" && regexRocks.test(elem)) {
// move wall to solids to not make land too big
if (/_wall/.test(elem)) {
elements[elem].category = "solids"
@ -23,12 +23,14 @@ runAfterLoad(function() {
}
// manual hiding
for (elem in toHide) {
elements[toHide[elem]].hidden = true;
for (let elem of toHide) {
if (typeof(elements[elem]) == "object") {
elements[elem].hidden = true;
}
}
// while i'm here, might as well fix Sandstone's color
elements.sandstone.color = "#dbbe80";
//elements.sandstone.color = "#dbbe80";
}
else {