Merge branch 'R74nCom:main' into main

This commit is contained in:
sq 2025-02-27 18:27:19 +08:00 committed by GitHub
commit 39bcfa26bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 7340 additions and 6518 deletions

114
adtest.html Normal file
View File

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test - Sandboxels</title>
<meta name="description" content="Test">
<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="noindex">
<!--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}
</style>
<!-- <script src="https://hb.vntsm.com/v4/live/vms/sites/sandboxels.r74n.com/index.js"></script> -->
</head>
<body>
<h1><a href="https://sandboxels.R74n.com" class="backbutton">&lt;</a> Test</h1>
</ul>
<div id="content">
This is a test page.
<div id="slot-1"></div>
<div id="slot-2"></div>
<div id="slot-5"></div>
<div id="slot-10"></div>
</div>
<script>
standalone = false;
window.addEventListener('load', function() {
if (standalone) return;
var adscript = document.createElement('script');
adscript.src = "https://hb.vntsm.com/v4/live/vms/sites/sandboxels.r74n.com/index.js";
adscript.setAttribute("data-disable-placements","vertical-sticky, video_slider");
adscript.addEventListener('load', function() {
self.__VM = self.__VM || [];
self.__VM.push(function (admanager, scope) {
scope.Config.get('billboard').display('slot-1');
scope.Config.get('leaderboard').display('slot-2');
// scope.Config.get('double_mpu').display('slot-3');
// scope.Config.get('mpu').display('slot-4');
scope.Config.get('mobile_banner').display('slot-5');
// scope.Config.get('mobile_mpu').display('slot-6');
// scope.Config.get('skyscraper').display('slot-7');
// scope.Config.get('video').display('slot-8');
// scope.Config.get('desktop_takeover').display('slot-9');
scope.Config.get('mobile_takeover').display('slot-10');
// Based on your layout, here are the responsive tags. The placement will change based on screen width.
// With the mobile breakpoint set by default at max-width:1024px
});
});
document.head.appendChild(adscript);
})
</script>
<!-- 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>

View File

@ -104,11 +104,154 @@
<div id="intro">
<p>Below are all of the updates to Sandboxels.</p>
<p>Suggest new additions on our <strong><a href="https://sandboxels.r74n.com/feedback" target="_blank">Feedback Form</a></strong>.</p>
<p>Join our <strong><a href="https://link.r74n.com/discord" target="_blank">Discord</a></strong> or our free <a href="https://news.r74n.com/subscribe">Newsletter</a> to be notified when new updates drop.</p>
<p>The original <a href="https://sandboxels.r74n.com/changelog.txt">plain text version</a> of this is still maintained.</p>
<p>Suggest new additions on our <strong><a href="https://sandboxels.R74n.com/feedback" target="_blank">Feedback Form</a></strong>.</p>
<p>Join our <strong><a href="https://discord.gg/ejUc6YPQuS" target="_blank">Discord</a></strong> or our free <a href="https://news.R74n.com/subscribe">Newsletter</a> to be notified when new updates drop.</p>
<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.11">[Version 1.11 - February 21, 2025 - Everyone's Update]</h2>
<ul>
<li>+ Portals!</li>
<li> + Portal In and Portal Out elements</li>
<li> + Portals teleport pixels and electricity</li>
<li>+ Coral</li>
<li> + Grows in Water</li>
<li> + Bleaches in high temperatures</li>
<li>+ Adobe, made from Mud and Straw</li>
<li>+ Element translations for Turkish and Hungarian</li>
<li>[Electricity Rework]</li>
<li>~ Electricity is now more consistent in highly conductive material</li>
<li>~ Sensors give out a single charge instead of 4</li>
<li>~ Pixels now store when they were charged</li>
<li>~ Note: Effects on existing builds should be limited but please report any issues</li>
<li>[Changes]</li>
<li>+ Liquid pixels of the same element move around</li>
<li>+ Tiny canvas size</li>
<li>+ Molten elements oscillate color (Experimental)</li>
<li>~ Pixels can now exist along the border of the canvas</li>
<li>~ Disabling Staining will clear all existing pixel stains</li>
<li>+ Dye, Paint, etc. retain their selected color independently</li>
<li>+ Radioactive Tornado variant</li>
<li>+ Humans panic when shocked</li>
<li>~ Humans are less heat-resistant</li>
<li>~ Pipes are no longer unbreakable</li>
<li>+ Smoke rises in normal air density</li>
<li>~ Tweaked Fire and Cold Fire behavior</li>
<li>+ Sabatier process for producing Methane</li>
<li>+ Bergius process for producing Oil</li>
<li>+ Acid reacts with Potassium</li>
<li>~ Increased Methane autoignition point</li>
<li>+ Uranium radiates Glass on contact</li>
<li>+ Burning Lamp Oil explodes in Water</li>
<li>+ Liquid Ozone explodes when broken or shocked</li>
<li>+ Molten Gallium can react with Gold Coins</li>
<li>+ Slaked Lime reacts with Carbon Dioxide</li>
<li>+ Molten Plastic evaporates</li>
<li>+ Glue turns Color Sand into Stained Glass</li>
<li>+ Butter and Caustic Potash make Soap</li>
<li>+ Neutrons radiate Glass, Clouds, and Water</li>
<li>~ Light absorbed by LEDs is deleted</li>
<li>~ Foam made from Oxygen + Water releases the Oxygen</li>
<li>~ Tweaked Bleach and Acid reaction</li>
<li>~ Increased Molten Sulfur freezing point</li>
<li>~ Tweaked Smash tool</li>
<li>+ Cyanide dirties Water variants</li>
<li>+ Infection dirties Water</li>
<li>+ Tea and Coffee bubble when hot</li>
<li>+ CO2 carbonates Salt Water instead of dirtying</li>
<li>+ Soda and Seltzer release Foam when mixed</li>
<li>+ Pilk creates Foam</li>
<li>+ Cells can ferment Milk variants</li>
<li>~ Cells ferment Milk slower</li>
<li>~ Cheese keeps color when breaking into powder (Pilk Powder?)</li>
<li>~ Caramel is more heat-resistant</li>
<li>~ Acid turns Humans into Bone</li>
<li>~ Birds are less flammable</li>
<li>+ Fish turn to white meat when cooked</li>
<li>+ Worms can compost Petal, Pistil, and Vine</li>
<li>+ Rats can eat Hard Yolk</li>
<li>+ Alcohol calms Humans</li>
<li>+ Humans panic from bad smells</li>
<li>+ Smog breaks into Dirty Water</li>
<li>~ Fireworks create less Carbon Dioxide</li>
<li>+ Bless can fix Brick Rubble</li>
<li>+ Midas Touch converts some metals to Gold variants</li>
<li>+ Malware can affect Snake</li>
<li>~ Pointer retains same speed at any TPS</li>
<li>~ Optimized Cell and Cancer</li>
<li>~ Recolored Pipe Wall</li>
<li>~ Improved Slug, Brick, and Ruins buttons</li>
<li>~ Hid Liquid Oxygen</li>
<li>~ Unhid Liquid Hydrogen</li>
<li>~ Moved Liquid Hydrogen to Liquids</li>
<li>~ Moved Poison Gas to Gases</li>
<li>+ Liquid Nitrogen alias 'LN2'</li>
<li>+ Electric alias 'Electron'</li>
<li>+ Light alias 'Photon'</li>
<li>+ Nut Oil alias 'Cooking Oil'</li>
<li>+ Epsom Salt alias 'Magnesium Sulfate'</li>
<li>+ Pyrite alias 'Iron Sulfide'</li>
<li>+ Limestone alias 'Calcium Carbonate'</li>
<li>+ Quicklime alias 'Calcium Oxide'</li>
<li>+ Slaked Lime alias 'Calcium Hydroxide'</li>
<li>~ Petal displays with dark text</li>
<li>~ Slightly moved Porcelain</li>
<li>+ Built-in dialog boxes</li>
<li>~ Canvas touches the top of the page</li>
<li>~ Wide canvas size takes up more screen space</li>
<li>~ White border no longer shown on wide canvas size</li>
<li>~ Buttons, menus, and the canvas have thicker borders</li>
<li>~ "Elem" in stats bar is no longer uppercase</li>
<li>~ Unknown has no grain</li>
<li>- Loading a save no longer changes your selected element</li>
<li>+ Ctrl+S to bring up save prompt</li>
<li>+ Ctrl+Shift+S to instantly save canvas</li>
<li>+ Retroactive changelogs for versions v0.1-v0.4</li>
<li>+ Bluesky social link</li>
<li>+ Partial translations for Ukrainian, Toki Pona, and Halacae</li>
<li>+ Finished translations for Spanish and Russian</li>
<li>[Bug Fixes]</li>
<li>~ Fixed: Oxygen from hydrolysis immediately turns to Foam</li>
<li>~ Fixed: Menu heights vary dramatically with long categories</li>
<li>~ Fixed: Mod Manager and Info Screen text boxes don't stick to bottom</li>
<li>~ Fixed: Lattice Wars appear without borders</li>
<li>~ Fixed: Smash tool breaks harder elements faster</li>
<li>~ Fixed: Error in console on page load</li>
<li>~ Fixed: Artifacts above stats bar text on Chrome</li>
<li>~ Fixed: Console logging when Hail breaks a pixel</li>
<li>~ Fixed: Milk variants still heat into Yogurt</li>
<li>~ Fixed: Controls still show Smooth View keybind</li>
<li>~ Fixed: "Save to File" button cut off on some small screens</li>
<li>~ Fixed: Many aliases can't be used in Element Select</li>
<li>~ Fixed: Prop tool doesn't change pixel state when changing temperature</li>
<li>~ Fixed: Grenades stop moving while charged</li>
<li>~ Fixed: Lightning doesn't reach bottom on large canvases</li>
<li>~ Fixed: Ghost pixels when placing Foam with low air temperature set</li>
<li>~ Fixed: 'CR' behavior cell errors with low air temperature set</li>
<li>[Technical]</li>
<li>+ Portal 'channel' property can be set with the Prop tool (Integer)</li>
<li>+ runAfterReset function</li>
<li>+ isBreakable function</li>
<li>+ 'breakIntoColorMultiplier' element property</li>
<li>+ 'onMoveInto' element property, called when another pixel moves into it (function(pixel1,pixel2))</li>
<li>+ 'chargeStart' pixel property</li>
<li>~ 'breakIntoColor' element property can be used without 'breakInto'</li>
<li>+ 'sense' sensor property to detect a certain element</li>
<li>~ Optimized electricity</li>
<li>~ Fire is affected by air density</li>
<li>+ View setting dropdown includes views added by mods</li>
<li>~ currentSaveData is now always defined, and holds metadata about the current canvas, even non-saves</li>
<li>+ currentSaveData always contains a UUID for seeded randomness</li>
<li>~ Default max pixel count slightly increased</li>
<li>~ Save version is now sb3</li>
<li> ~ Canvas border width is now stored (Default 1 for old saves)</li>
<li> ~ Pixel properties with value "undefined" are skipped</li>
<li>+ Error message in console for broken translation files</li>
<li>+ GUI translation support</li>
<li>+ More GUI elements have IDs</li>
<li>+ Future standalone mode</li>
</ul>
<h2 id="1.10.2">[Version 1.10.2 - December 15, 2024 - Birthday III]</h2>
<ul>
<li>+ Cheese Powder, from breaking Cheese</li>
@ -2558,7 +2701,163 @@
<li>~ Gravel can now melt</li>
</ul>
<h2>[Public Release - Dec. 15, 2021]</h2>
<p><em>[Note: Changelogs for version v0.1-v0.4 were added retroactively in 2025]</em></p>
<h2 id="0.4">[Version 0.4 - Dec. 20, 2021]</h2>
<ul>
<li>+ Grass</li>
<li>+ Algae</li>
<li>+ Heater</li>
<li>+ Cooler</li>
<li>+ Superheater</li>
<li>+ Freezer</li>
<li>+ Charcoal</li>
<li>+ Carbon Dioxide</li>
<li>+ Dry Ice</li>
<li>+ Oil</li>
<li>+ Propane</li>
<li>+ Methane</li>
<li>+ Oxygen</li>
<li>+ Liquid Oxygen</li>
<li>+ Tinder</li>
<li>+ Static</li>
<li>+ Borax</li>
<li>+ Bamboo</li>
<li>+ Bamboo Plant</li>
<li>+ Clay</li>
<li>+ Baked Clay</li>
<li>+ Brick</li>
<li>+ Sapling</li>
<li>+ Grass Seed</li>
<li>+ Flower Seed</li>
<li>+ Pistil</li>
<li>+ Petal</li>
<li>+ Tree Branch</li>
<li>+ Vine</li>
<li>+ Burner</li>
<li>+ Foam</li>
<li>+ Bubble</li>
<li>+ Rainbow</li>
<li>+ Copper</li>
<li>+ Molten Copper</li>
<li>+ Oxidized Copper</li>
<li>+ Acid</li>
<li>+ Dust</li>
<li>+ Glue</li>
<li>+ Anti Fluid</li>
<li>+ Lamp Oil</li>
<li>+ Wheat Seed</li>
<li>+ Wheat</li>
<li>+ Straw</li>
<li>+ Gray Goo</li>
<li>+ Virus</li>
<li>+ Worm</li>
<li>+ Termite</li>
<li>+ Pixel burning</li>
<li>~ Renamed Laser Pointer to Pointer</li>
<li>+ Element and hidden element count</li>
<li>[Technical]</li>
<li>+ Behavior presets FOAM, BUBBLE, STICKY, AGLIQUID</li>
<li>+ Behavior rules L1, L2, HT, CO, CC, ST</li>
</ul>
<h2 id="0.3">[Version 0.3 - Dec. 17, 2021]</h2>
<ul>
<li>+ Ant</li>
<li>+ Frog</li>
<li>+ Fish</li>
<li>+ Rocket</li>
<li>+ Ash</li>
<li>+ Meat</li>
<li>+ Cooked Meat</li>
<li>+ Light</li>
<li>+ Laser Pointer</li>
<li>+ Element categories (Tools, Land, Liquids, Solids, Gases, Energy, Structure, Special, Life, Weapons)</li>
<li>+ Hide button</li>
<li>[Technical]</li>
<li>+ Behavior presets STURDYPOWDER, SELFDELETE</li>
<li>+ SW behavior rule</li>
</ul>
<h2 id="0.2">[Version 0.2 - Dec. 16, 2021]</h2>
<ul>
<li>+ Heat tool</li>
<li>+ Cool tool</li>
<li>+ Steam</li>
<li>+ Ice</li>
<li>+ Snow</li>
<li>+ Packed Snow</li>
<li>+ Wood</li>
<li>+ Fire</li>
<li>+ Smoke</li>
<li>+ Rock</li>
<li>+ Magma</li>
<li>+ Concrete</li>
<li>+ Plasma</li>
<li>+ Iron</li>
<li>+ Glass</li>
<li>+ Blood</li>
<li>+ Honey</li>
<li>+ Ketchup</li>
<li>+ Molasses</li>
<li>+ Filler</li>
<li>+ Dirt</li>
<li>+ Gravel</li>
<li>+ Slime</li>
<li>+ Ruins</li>
<li>+ Void</li>
<li>+ Flea</li>
<li>+ Fly</li>
<li>+ Smoke Grenade</li>
<li>+ Torch</li>
<li>+ Water Spout</li>
<li>+ Bone Marrow</li>
<li>+ Bone</li>
<li>+ Anti Powder</li>
<li>+ Vertical</li>
<li>+ Horizontal</li>
<li>+ Rain Cloud</li>
<li>+ Snow Cloud</li>
<li>+ Plant</li>
<li>+ Seed</li>
<li>+ Molten Glass</li>
<li>+ Molten Iron</li>
<li>+ Pixel temperature and state changes</li>
<li>+ Pause button</li>
<li>+ Step button</li>
<li>+ Adjustable cursor size and buttons</li>
<li>+ Replace mode and button</li>
<li>+ Element select "E" button</li>
<li>+ Adjustable TPS and button</li>
<li>+ Keybinds for pausing, changing cursor size</li>
<li>+ Shift key handling</li>
<li>+ Stats bar, shows pixel information on hover</li>
<li>+ Randomized pixel color, pixel grain, and gradient element buttons</li>
<li>~ Renamed "Clear" button to "Reset"</li>
<li>[Technical]</li>
<li>+ Behavior grid system</li>
<li>+ Behavior presets POWDER, AGPOWDER, LIQUID, WALL, UL_UR, GAS, DGAS, SUPPORT, SUPPORTPOWDER, DELETE, FILL</li>
<li>+ Autogenerated molten elements</li>
<li>- Removed hard-coded behaviors</li>
</ul>
<h2 id="0.1.1">[Version 0.1.1 - Dec. 15, 2021]</h2>
<ul>
<li>+ Clear button</li>
<li>+ Pixels can be deleted by right-clicking</li>
<li>+ Touchscreen support</li>
<li>+ Element buttons</li>
</ul>
<h2 id="0.1">[Version 0.1 - Dec. 15, 2021 - Public Release]</h2>
<ul>
<li>+ Sand</li>
<li>+ Water</li>
<li>+ Wall</li>
<li>+ Elements must be selected with the S, W, and X keys</li>
<li>[Technical]</li>
<li>+ Hard-coded behaviors DL_DR (Sand), L_R (Water), WALL (Wall)</li>
</ul>
</div>

View File

@ -1,9 +1,150 @@
Suggest new additions at https://link.R74n.com/sandboxels-feedback
Suggest new additions at https://sandboxels.R74n.com/feedback
See sneak peaks for upcoming updates on the Discord: https://discord.gg/ejUc6YPQuS
A fancier version of this changelog can be found here: https://sandboxels.R74n.com/changelog
[Version 1.11 - February 21, 2025 - Everyone's Update]
+ Portals!
+ Portal In and Portal Out elements
+ Portals teleport pixels and electricity
+ Coral
+ Grows in Water
+ Bleaches in high temperatures
+ Adobe, made from Mud and Straw
+ Element translations for Turkish and Hungarian
[Electricity Rework]
~ Electricity is now more consistent in highly conductive material
~ Sensors give out a single charge instead of 4
~ Pixels now store when they were charged
~ Note: Effects on existing builds should be limited but please report any issues
[Changes]
+ Liquid pixels of the same element move around
+ Tiny canvas size
+ Molten elements oscillate color (Experimental)
~ Pixels can now exist along the border of the canvas
~ Disabling Staining will clear all existing pixel stains
+ Dye, Paint, etc. retain their selected color independently
+ Radioactive Tornado variant
+ Humans panic when shocked
~ Humans are less heat-resistant
~ Pipes are no longer unbreakable
+ Smoke rises in normal air density
~ Tweaked Fire and Cold Fire behavior
+ Sabatier process for producing Methane
+ Bergius process for producing Oil
+ Acid reacts with Potassium
~ Increased Methane autoignition point
+ Uranium radiates Glass on contact
+ Burning Lamp Oil explodes in Water
+ Liquid Ozone explodes when broken or shocked
+ Molten Gallium can react with Gold Coins
+ Slaked Lime reacts with Carbon Dioxide
+ Molten Plastic evaporates
+ Glue turns Color Sand into Stained Glass
+ Butter and Caustic Potash make Soap
+ Neutrons radiate Glass, Clouds, and Water
~ Light absorbed by LEDs is deleted
~ Foam made from Oxygen + Water releases the Oxygen
~ Tweaked Bleach and Acid reaction
~ Increased Molten Sulfur freezing point
~ Tweaked Smash tool
+ Cyanide dirties Water variants
+ Infection dirties Water
+ Tea and Coffee bubble when hot
+ CO2 carbonates Salt Water instead of dirtying
+ Soda and Seltzer release Foam when mixed
+ Pilk creates Foam
+ Cells can ferment Milk variants
~ Cells ferment Milk slower
~ Cheese keeps color when breaking into powder (Pilk Powder?)
~ Caramel is more heat-resistant
~ Acid turns Humans into Bone
~ Birds are less flammable
+ Fish turn to white meat when cooked
+ Worms can compost Petal, Pistil, and Vine
+ Rats can eat Hard Yolk
+ Alcohol calms Humans
+ Humans panic from bad smells
+ Smog breaks into Dirty Water
~ Fireworks create less Carbon Dioxide
+ Bless can fix Brick Rubble
+ Midas Touch converts some metals to Gold variants
+ Malware can affect Snake
~ Pointer retains same speed at any TPS
~ Optimized Cell and Cancer
~ Recolored Pipe Wall
~ Improved Slug, Brick, and Ruins buttons
~ Hid Liquid Oxygen
~ Unhid Liquid Hydrogen
~ Moved Liquid Hydrogen to Liquids
~ Moved Poison Gas to Gases
+ Liquid Nitrogen alias 'LN2'
+ Electric alias 'Electron'
+ Light alias 'Photon'
+ Nut Oil alias 'Cooking Oil'
+ Epsom Salt alias 'Magnesium Sulfate'
+ Pyrite alias 'Iron Sulfide'
+ Limestone alias 'Calcium Carbonate'
+ Quicklime alias 'Calcium Oxide'
+ Slaked Lime alias 'Calcium Hydroxide'
~ Petal displays with dark text
~ Slightly moved Porcelain
+ Built-in dialog boxes
~ Canvas touches the top of the page
~ Wide canvas size takes up more screen space
~ White border no longer shown on wide canvas size
~ Buttons, menus, and the canvas have thicker borders
~ "Elem" in stats bar is no longer uppercase
~ Unknown has no grain
- Loading a save no longer changes your selected element
+ Ctrl+S to bring up save prompt
+ Ctrl+Shift+S to instantly save canvas
+ Retroactive changelogs for versions v0.1-v0.4
+ Bluesky social link
+ Partial translations for Ukrainian, Toki Pona, and Halacae
+ Finished translations for Spanish and Russian
[Bug Fixes]
~ Fixed: Oxygen from hydrolysis immediately turns to Foam
~ Fixed: Menu heights vary dramatically with long categories
~ Fixed: Mod Manager and Info Screen text boxes don't stick to bottom
~ Fixed: Lattice Wars appear without borders
~ Fixed: Smash tool breaks harder elements faster
~ Fixed: Error in console on page load
~ Fixed: Artifacts above stats bar text on Chrome
~ Fixed: Console logging when Hail breaks a pixel
~ Fixed: Milk variants still heat into Yogurt
~ Fixed: Controls still show Smooth View keybind
~ Fixed: "Save to File" button cut off on some small screens
~ Fixed: Many aliases can't be used in Element Select
~ Fixed: Prop tool doesn't change pixel state when changing temperature
~ Fixed: Grenades stop moving while charged
~ Fixed: Lightning doesn't reach bottom on large canvases
~ Fixed: Ghost pixels when placing Foam with low air temperature set
~ Fixed: 'CR' behavior cell errors with low air temperature set
[Technical]
+ Portal 'channel' property can be set with the Prop tool (Integer)
+ runAfterReset function
+ isBreakable function
+ 'breakIntoColorMultiplier' element property
+ 'onMoveInto' element property, called when another pixel moves into it (function(pixel1,pixel2))
+ 'chargeStart' pixel property
~ 'breakIntoColor' element property can be used without 'breakInto'
+ 'sense' sensor property to detect a certain element
~ Optimized electricity
~ Fire is affected by air density
+ View setting dropdown includes views added by mods
~ currentSaveData is now always defined, and holds metadata about the current canvas, even non-saves
+ currentSaveData always contains a UUID for seeded randomness
~ Default max pixel count slightly increased
~ Save version is now sb3
~ Canvas border width is now stored (Default 1 for old saves)
~ Pixel properties with value "undefined" are skipped
+ Error message in console for broken translation files
+ GUI translation support
+ More GUI elements have IDs
+ Future standalone mode
[Version 1.10.2 - December 15, 2024 - Birthday III]
+ Cheese Powder, from breaking Cheese
+ Chocolate Powder, from breaking Chocolate
@ -2353,4 +2494,152 @@ A fancier version of this changelog can be found here: https://sandboxels.R74n.c
~ Heat & Cool tools look more natural
~ Gravel can now melt
[Note: Changelogs for version v0.1-v0.4 were added retroactively in 2025]
[Version 0.4 - Dec. 20, 2021]
+ Grass
+ Algae
+ Heater
+ Cooler
+ Superheater
+ Freezer
+ Charcoal
+ Carbon Dioxide
+ Dry Ice
+ Oil
+ Propane
+ Methane
+ Oxygen
+ Liquid Oxygen
+ Tinder
+ Static
+ Borax
+ Bamboo
+ Bamboo Plant
+ Clay
+ Baked Clay
+ Brick
+ Sapling
+ Grass Seed
+ Flower Seed
+ Pistil
+ Petal
+ Tree Branch
+ Vine
+ Burner
+ Foam
+ Bubble
+ Rainbow
+ Copper
+ Molten Copper
+ Oxidized Copper
+ Acid
+ Dust
+ Glue
+ Anti Fluid
+ Lamp Oil
+ Wheat Seed
+ Wheat
+ Straw
+ Gray Goo
+ Virus
+ Worm
+ Termite
+ Pixel burning
~ Renamed Laser Pointer to Pointer
+ Element and hidden element count
[Technical]
+ Behavior presets FOAM, BUBBLE, STICKY, AGLIQUID
+ Behavior rules L1, L2, HT, CO, CC, ST
[Version 0.3 - Dec. 17, 2021]
+ Ant
+ Frog
+ Fish
+ Rocket
+ Ash
+ Meat
+ Cooked Meat
+ Light
+ Laser Pointer
+ Element categories (Tools, Land, Liquids, Solids, Gases, Energy, Structure, Special, Life, Weapons)
+ Hide button
[Technical]
+ Behavior presets STURDYPOWDER, SELFDELETE
+ SW behavior rule
[Version 0.2 - Dec. 16, 2021]
+ Heat tool
+ Cool tool
+ Steam
+ Ice
+ Snow
+ Packed Snow
+ Wood
+ Fire
+ Smoke
+ Rock
+ Magma
+ Concrete
+ Plasma
+ Iron
+ Glass
+ Blood
+ Honey
+ Ketchup
+ Molasses
+ Filler
+ Dirt
+ Gravel
+ Slime
+ Ruins
+ Void
+ Flea
+ Fly
+ Smoke Grenade
+ Torch
+ Water Spout
+ Bone Marrow
+ Bone
+ Anti Powder
+ Vertical
+ Horizontal
+ Rain Cloud
+ Snow Cloud
+ Plant
+ Seed
+ Molten Glass
+ Molten Iron
+ Pixel temperature and state changes
+ Pause button
+ Step button
+ Adjustable cursor size and buttons
+ Replace mode and button
+ Element select "E" button
+ Adjustable TPS and button
+ Keybinds for pausing, changing cursor size
+ Shift key handling
+ Stats bar, shows pixel information on hover
+ Randomized pixel color, pixel grain, and gradient element buttons
~ Renamed "Clear" button to "Reset"
[Technical]
+ Behavior grid system
+ Behavior presets POWDER, AGPOWDER, LIQUID, WALL, UL_UR, GAS, DGAS, SUPPORT, SUPPORTPOWDER, DELETE, FILL
+ Autogenerated molten elements
- Removed hard-coded behaviors
[Version 0.1.1 - Dec. 15, 2021]
+ Clear button
+ Pixels can be deleted by right-clicking
+ Touchscreen support
+ Element buttons
[Version 0.1 - Dec. 15, 2021]
+ Sand
+ Water
+ Wall
+ Elements must be selected with the S, W, and X keys
[Technical]
+ Hard-coded behaviors DL_DR (Sand), L_R (Water), WALL (Wall)
[Public Release - Dec. 15, 2021]

View File

@ -93,11 +93,13 @@
<tr><td>Element info</td> <td><kbd>I</kbd> or <kbd>/</kbd></td></tr>
<tr><td>Open settings</td> <td><kbd>\</kbd></td></tr>
<tr><td>Open saves</td> <td><kbd>L</kbd></td></tr>
<tr><td>Open save prompt</td> <td><kbd>Ctrl</kbd> + <kbd>S</kbd></td></tr>
<tr><td>Instant save</td> <td><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd></td></tr>
<tr><td>Open Mod Manager</td> <td><kbd>M</kbd></td></tr>
<tr><td>Reset canvas</td> <td><kbd>R</kbd></td></tr>
<tr><td>Single step</td> <td><kbd>&gt;</kbd></td></tr>
<tr><td>Fullscreen</td> <td><kbd>F</kbd> or <kbd>F11</kbd></td></tr>
<tr><td>Normal view</td> <td><kbd>1</kbd> or <kbd>1</kbd></td></tr>
<tr><td>Normal view</td> <td><kbd>1</kbd> or <kbd>0</kbd></td></tr>
<tr><td>Thermal view</td> <td><kbd>2</kbd></td></tr>
<tr><td>Basic view (No effects)</td> <td><kbd>3</kbd></td></tr>
<tr><td>Hide canvas</td> <td><kbd>H</kbd></td></tr>
@ -144,6 +146,19 @@
<p>The original <a href="https://sandboxels.r74n.com/controls.txt">plain text version</a> may not be maintained.</p>
<script>
let isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
if (isMacLike) {
let kbds = document.getElementsByTagName("kbd");
for (let i = 0; i < kbds.length; i++) {
const kbd = kbds[i];
if (kbd.innerHTML === "Ctrl") {
kbd.innerHTML = "Cmd"
}
}
}
</script>
</div>

1705
index.html

File diff suppressed because it is too large Load Diff

5
lang/README.txt Normal file
View File

@ -0,0 +1,5 @@
Translation updates to this GitHub repo are no longer accepted!
If you'd like to contribute translations, you must use the new Crowdin system here: https://crowdin.com/editor/sandboxels
For more information, see the Translation Page: https://sandboxels.r74n.com/translate

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,124 @@
{
"#lang.name": "LANGUAGE NAME",
"#lang.credit": "NAME, NAME, NAME",
"gui.langSelectLabel": "Language",
"gui.titleTag": "Sandboxels - Experiment with Pixels",
"gui.pageDesc": "Relax or experiment with over 500 materials in this falling sand simulator, featuring heat, chemical reactions, density, burning, explosions.",
"gui.shiftButton": "↑",
"gui.shiftButton.title": "Toggle Shift key",
"gui.pauseButton": "Pause",
"gui.pauseButton.title": "Pause/play the simulation",
"gui.frameButton": ">",
"gui.frameButton.title": "Pause and play one frame",
"gui.sizeDownButton": "-",
"gui.sizeDownButton.title": "Decrease the brush size",
"gui.sizeUpButton": "-",
"gui.sizeUpButton.title": "Increase the brush size",
"gui.resetButton": "Reset",
"gui.resetButton.title": "Clear the entire scene",
"gui.replaceButton": "Replace",
"gui.replaceButton.title": "Override existing pixels when placing",
"gui.elemSelectButton": "E",
"gui.elemSelectButton.title": "Select an element by name",
"gui.tpsButton": "Tps",
"gui.tpsButton.title": "Change the simulation Ticks Per Second (TPS)",
"gui.infoButton": "Info",
"gui.infoButton.title": "Brings up the element info screen",
"gui.savesButton": "Saves",
"gui.savesButton.title": "Brings up the Save & Load menu",
"gui.modsButton": "Mods",
"gui.modsButton.title": "Brings up the Mod Manager",
"gui.settingsButton": "Settings",
"gui.settingsButton.title": "Brings up the settings screen",
"gui.changelogButton": "Changelog",
"gui.feedbackButton": "Feedback",
"gui.wikiButton": "Wiki",
"gui.install-button": "Install Offline",
"gui.copyrightLabel": "All Rights Reserved",
"gui.stats.temp": "Temp",
"gui.stats.elem": "Elem",
"gui.stats.burning": "Burning",
"gui.savesMenuTitle": "Save & Load",
"gui.saves.title": "Save & Load",
"gui.saves.unnamed": "Unnamed",
"gui.saves.save": "Save",
"gui.saves.load": "Load",
"gui.saves.clear": "Clear",
"gui.saveFile": "Save to File",
"gui.loadFile": "Load File",
"guitemplate.saves.slot": "Slot $1",
"gui.savePromptTitle.slot": "Save to Slot",
"gui.savePromptTitle.file": "Save to File",
"gui.saveNameLabel": "Name",
"gui.saveName": "Save Name...",
"gui.saveInclude": "Include",
"gui.saveTemp": "Temperature",
"gui.saveColors": "Colors",
"gui.saveSettings": "Settings",
"gui.saveMods": "Mods",
"gui.saveRaw": "Raw Data",
"gui.saveAuthorLabel": "By",
"gui.saveAuthor": "Your Name...",
"gui.saveDescLabel": "About",
"gui.saveDesc": "Short Description...",
"gui.saveConfirm": "Save",
"gui.modWarning": "Mods might not be necessary to include, and may annoy the user!",
"guitemplate.saves.overwrite": "This will overwrite the save in slot $1!",
"gui.settingsMenuTitle": "Settings",
"gui.settingLabel-units": "Units",
"gui.setting-units-m": "Metric",
"gui.setting-units-i": "Imperial",
"gui.setting-units-s": "SI",
"gui.settingLabel-bg": "Background",
"gui.settingLabel-unhide": "Hiding",
"gui.setting-unhide-0": "Hide Some Elements",
"gui.setting-unhide-1": "Unhide All Elements",
"gui.setting-unhide-2": "Unlock as Discovered",
"gui.settingLabel-view": "Default View",
"gui.setting-view-0": "Unset",
"gui.settingLabel-pixelsize": "Canvas Size",
"gui.setting-pixelsize-12": "Tiny",
"gui.setting-pixelsize-8": "Small",
"gui.setting-pixelsize-6": "Medium",
"gui.setting-pixelsize-6w": "Wide",
"gui.setting-pixelsize-4": "Large",
"gui.settingLabel-stain": "Staining",
"gui.settingLabel-burn": "Burning",
"gui.settingLabel-clouds": "Clouds",
"gui.settingLabel-resetwarning": "Reset Warning",
"gui.settingLabel-textures": "Fancy Pixels",
"gui.settingLabel-precision": "Precision Dot",
"gui.settingLabel-invertscroll": "Invert Scroll",
"gui.settingLabel-limitless": "Limitless",
"gui.settingLabel-cheerful": "Cheerful Mode",
"gui.settingLabel-language": "Language",
"gui.settingLabel-events": "Random Events",
"gui.setting-events-0": "Disabled",
"gui.setting-events-0.005": "Rare (For casual play)",
"gui.setting-events-0.025": "Common",
"gui.setting-events-0.05": "Annoying",
"gui.setting-events-0.25": "Overdrive (DANGEROUS)",
"gui.settingLabel-airtemp": "Air Temp",
"gui.settingLabel-airdensity": "Air Density",
"gui.settingLabel-abszero": "Abs Zero",
"gui.resetDiscovered": "Reset Discovered",
"gui.resetAll": "Reset All",
"gui.clearMods": "Clear Mods",
"gui.clearSaves": "Clear Saves",
"gui.settingLabel-worldgen": "World Gen",
"gui.setting-worldgen-off": "Disabled",
"gui.settingLabel-imageelem": "Image Elem",
"gui.settingLabel-imagesmooth": "Smoothing",
"guitemplate.elementCount": "$1 elements, with $2 hidden",
"land": "",
"liquids": "",
"life": "",

View File

@ -1,5 +1,5 @@
{
"#lang.name": "Turkish",
"#lang.name": "Türkçe",
"#lang.credit": "Ömer, Kağan, Sağdıç",
"land": "Karasal",
"liquids": "Sıvılar",

View File

@ -188,6 +188,7 @@
<tr><td>boiling_things.js</td><td>Allows for various elements to be vaporized</td><td>Alice</td></tr>
<tr><td>bouncing_balls.js</td><td>Adds new types of balls that bounce accurately and roll.</td><td>Nekonico</td></tr>
<tr><td>chalcopyrite.js</td><td>Adds the chalcopyrite ore</td><td>Sophie</td></tr>
<tr><td>charsonsmoduno.js</td><td>Adds Arsenic, Beryllium, Silicon, compounds, and some non-realistic stuff, such as Aresium and Nahnium</td><td>CharsonBurensen</td></tr>
<tr><td>chem.js</td><td>Adds several chemistry and physics-related elements</td><td>lllllllllwith10ls</td></tr>
<tr><td>clf3.js</td><td>Adds Chlorine Trifluoride</td><td>Alice</td></tr>
<tr><td>debrisable.js</td><td>Expands the number of breakable elements, changes erosion, and adds way to craft certain elements from breaking other elements. </td><td>Nekonico</td></tr>
@ -203,6 +204,7 @@
<tr><td>jaydstuff.js</td><td>Adds various chemicals and compounds</td><td>Jayd</td></tr>
<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>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
<tr><td>lye.js</td><td>Adds lye</td><td>BatteRaquette58</td></tr>
<tr><td>mars.js</td><td>Adds some things from Mars with 2 minerals to smelt.</td><td>charcoal_afterlife</td></tr>
<tr><td>metals.js</td><td>Adds several metals</td><td>Alice</td></tr>
@ -219,7 +221,7 @@
<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>stickyslime.js</td><td>Allows slime to stick to other elements</td><td>Suss</td></tr>
<tr><td>stickystuff.js</td><td>Allows slime, honey and all things normally sticky to stick to other elements</td><td>Suss</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><!---->
@ -341,15 +343,16 @@
<tr><td>funnynames.js</td><td>Adds various ways to mess with the names of elements</td><td>nousernamefound</td></tr>
<tr><td>haseulite.js</td><td>Adds Loona-related materials with various properties</td><td>Alice</td></tr>
<tr><td>lactose_intolerance_and_celiac.js</td><td>Makes humans explode on contact with milk, wheat, bread, or toast</td><td>Nubo318</td></tr>
<tr><td>lattice_filler.js</td><td>Adds a combination of lattice and filler and adds a destructive variant</td><td>Suss</td></tr>
<tr><td>lattice_filler.js</td><td>Adds a combination of lattice and filler and a destructive variant</td><td>Suss</td></tr>
<tr><td>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
<tr><td>lone_urea.js</td><td>Adds urea without the rest of the piss mod</td><td>Alice</td></tr>
<tr><td>maze.js</td><td>Adds a solvable maze generator</td><td>ggod</td></tr>
<tr><td>memelists.js</td><td>Makes it so you must select elements through a list at the bottom of the page.<br>We like lists</td><td>mollthecoder</td></tr>
<tr><td>minecraft.js</td><td>Adds several things from Minecraft</td><td>StellarX20, nousernamefound</td></tr>
<tr><td>minesweeper.js</td><td>A subpar implementation of Minesweeper</td><td>Alice</td></tr>
<tr><td>musicalfruit.js</td><td>Humans get gas from eating Beans</td><td>mollthecoder</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite and oobleck.</td><td>Nekonico</td></tr>
<tr><td>prideflags.js</td><td>Adds some pride flags to the game.</td><td>Adora</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite, oobleck, and red ice</td><td>Nekonico</td></tr>
<tr><td>prideflags.js</td><td>Adds some pride flags to the game</td><td>Adora</td></tr>
<tr><td>random_elems.js</td><td>Curated randomly generated elements</td><td>Alice</td></tr>
<tr><td>random_liquids.js</td><td>Randomly generates liquids on game load</td><td>Alice</td></tr>
<tr><td>sbmixup.js</td><td>Adds silly elements from a <a href="https://R74n.com/mix/" target="_blank">Mix-Up!</a> game</td><td>stefanblox</td>
@ -361,6 +364,7 @@
<!----><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>clouds.js</td><td>Adds moving clouds, recommended to include sky.js too</td><td>RedBirdly</td></tr>
<tr><td>customBackground.js</td><td>Set your background to an image link</td><td>Jayd</td></tr>
<tr><td>fast_lightmap.js</td><td>Makes light sources glow, but the fast version</td><td>RedBirdly</td></tr>
<tr><td>fractals.js</td><td>Adds an element and tools to render fractals in game</td><td>nousernamefound</td></tr>
@ -369,12 +373,14 @@
<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>lightmap.js</td><td>Makes light sources glow</td><td>RedBirdly</td></tr>
<tr><td>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
<tr><td>moreViews.js</td><td>Many new rendering modes</td><td>ggod</td></tr>
<tr><td>nicer_flame.js</td><td>Makes fire visually pleasing</td><td>RedBirdly</td></tr>
<tr><td>occlusion.js</td><td>Adds realistic shadows (similar to Terraria's lighting)</td><td>RedBirdly</td></tr>
<tr><td>onecolor.js</td><td>Makes all placed pixels single-colored</td><td>nousernamefound</td></tr>
<tr><td>paint_event.js</td><td>Adds a random event that randomly paints a circle</td><td>Alice</td></tr>
<tr><td>rainbow_tests.js</td><td>Adds variants of the rainbow element with different maths</td><td>Alice</td></tr>
<tr><td>real_light.js</td><td>Changes view code to make everything dark if not hit with a photon or light element, as well as making hot things and glowing things still be visible.</td><td>Nekonico</td></tr>
<tr><td>shader_by_jayd.js</td><td>Adds a glow around light elements</td><td>Jayd</td></tr>
<tr><td>Shroomboxels.js</td><td>A variant of acid_and_shapes.js that uses a different trigonometric function</td><td>Alice</td></tr>
<tr><td>singleColor.js</td><td>Makes all elements pick one color each time they're drawn</td><td>stefanblox</td></tr>

View File

@ -43,7 +43,7 @@ elements.rf_transmitter = {
// RF Receiver Element
elements.rf_receiver = {
color: "#142c47",
category: "Machines",
category: "machines",
behaviors: behaviors.WALL,
tempHigh: 250,
stateHigh: "dirt",

View File

@ -1,19 +1,6 @@
if(typeof(urlParams) === "undefined") {
urlParams = new URLSearchParams(window.location.search);
};
if(urlParams.get('loadTheModList') !== null || urlParams.get('ltml') !== null) { //if the variable exists at all
loadTheModList = true
} else { //if it doesn't (and it returns null)
loadTheModList = false
}
if(loadTheModList) {
enabledMods = ["mods/code_library.js","mods/adjustablepixelsize.js","mods/boiling_rock.js","mods/chalcopyrite.js","mods/clone_liquid.js","mods/conveyance.js","mods/CrashTestDummy.js","mods/delete_all_of_element.js","mods/evenmoretemptools.js","mods/extra_element_info.js","mods/fantastic_creatures.js","mods/fey_and_more.js","mods/glenn_gases.js","mods/iocalfaeus_clones.js","mods/grav_mudstones.js","mods/icb.js","mods/iean.js","mods/ketchup_mod.js","mods/laetium.js","mods/liquid_energy.js","mods/minecraft.js","mods/minesweeper.js","mods/more_breaking.js","mods/moreliquids.js","mods/moretools.js","mods/move_tools.js","mods/nested_for_reaction_example.js","mods/Neutronium Mod.js","mods/portal.js","mods/pushers.js","mods/rainbow_tests.js","mods/random_elems.js","mods/random_liquids.js","mods/random_rocks.js","mods/randomness.js","mods/randomness_but_tick.js","mods/randomness_but_tool.js","mods/slag_fix.js","mods/some_tf_liquids.js","mods/structure_test.js","mods/test.js","mods/ticking_temp_stuff.js","mods/time.js","mods/toothpaste.js","mods/troll.js","mods/unhide.js","mods/worldgen_test.js","mods/page_color.js","mods/color_tools.js","mods/invisible_wall.js","mods/replace_all.js","mods/bacteria_mod.js","mods/controllable_pixel_test.js","mods/fire_slime.js","mods/bioooze.js","mods/color_tools.js","mods/cells.js","mods/triggerable_random_powders.js","mods/replace.js","mods/change.js","mods/prompt.js","mods/miscible_psoup_and_birthpool.js","mods/primordial_birthpool.js","mods/liquid_void.js","mods/solid_rock.js","mods/invisible_dye.js","mods/alcohol.js","mods/a_bundle_of_tests.js","mods/paint_event.js","mods/amogus.js","mods/chem.js","mods/clf3.js","mods/roseyiede.js","mods/state_voids.js","mods/the_ground.js","mods/lone_urea.js","mods/fwibblen.js","mods/prop and prompt variables.js","mods/prop.js","mods/x_dependent_change_test.js","mods/alkahest.js","mods/tool_pixel_behavior.js","mods/onTryMoveInto.js","mods/human_edit.js","mods/runAfterAutogen and onload restructure.js","mods/changeTempReactionParameter.js","mods/metals.js","mods/explodeAtPlus.js","mods/note_block.js","mods/wirelike_test.js","mods/no_random_grbs.js","mods/bananas.js","mods/cpt_alt.js","mods/fire_mod.js","mods/test_4.js","mods/save_loading.js","mods/apioforms_pre.js","mods/fill_script.js","mods/funny elements 2022-11-15.js","mods/haseulite.js","mods/neutronium_compressor.js","mods/mobs.js","mods/stripe_paint.js","mods/velvet.txt","mods/switches.js","mods/noConduct.js","mods/changePixelDebug.js","mods/no_gas_sticking.js","mods/conduit.js","mods/ray_cloner.js","mods/date_test.js","mods/velocity.js","mods/maxColorOffset.js","mods/gradient_background_support.js","mods/life_eater.js","mods/planet_cracker.js","mods/generative_mods.js","mods/generator_prompt.js","mods/place_all_elements.js"];
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert("Mod list loaded. Refresh the page without the loadTheModList query parameter.");
console.log("Mod list loaded. Refresh the page without the loadTheModList query parameter.");
};
if(typeof(pyth) === "undefined") { //has to be in here due to the role in loading the mod list
function pyth(xA,yA,xB,yB) {
var a = Math.abs(xB - xA);

View File

@ -1,5 +1,5 @@
var modName = "mods/../a_mod_by_alice.js" //can't do "alice's mod" because the apostrophe will fuck up code, be too confusing, or both
//Version ω0.2 [???]
//Version ω0.3 [Corium update]
var dependencies = ["mods/libhooktick.js", "mods/chem.js", "mods/minecraft.js", "mods/Neutronium Mod.js", "mods/fey_and_more.js", "mods/velocity.js", "mods/ketchup_mod.js", "mods/moretools.js", "mods/aChefsDream.js", "mods/nousersthings.js"]; //thanks to mollthecoder, PlanetN9ne, StellarX20 (3), MelecieDiancie, R74n, Nubo318, Sightnado, SquareScreamYT, and NoUsernameFound
var dependencyExistence = dependencies.map(x => enabledMods.includes(x));
var allDependenciesExist = dependencyExistence.reduce(function(a,b) { return a && b });
@ -2695,11 +2695,12 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
booleanSynonyms = [ "boolean", "bool", "boole", "boo", "bo", "bl", "b" ];
arraySynonyms = [ "arr", "a", "ar", "list" ];
defaultStringTypeValues = ["element","color","clone","changeTo","void","type","spawn"];
defaultNumberTypeValues = ["x","y","charge","temp","start","vx","vy","chargeCD","start","burnStart","dir","panic","r","frequency","length","delay","volume","debounce","debounceLength","speed","fall","penetrateCounter","chargeCounter","spawnCounter","spawnTime","squadiusX","squadiusY","spawnTries","counter","attachDirection","value","range","xSpacing","ySpacing","maxPixels","explosionRadius","circleRadius","breakAroundRadius"];
defaultNumberTypeValues = ["x","y","charge","temp","start","vx","vy","chargeCD","start","burnStart","dir","panic","r","frequency","length","delay","volume","debounce","debounceLength","speed","fall","penetrateCounter","chargeCounter","spawnCounter","spawnTime","squadiusX","squadiusY","spawnTries","counter","attachDirection","value","range","xSpacing","ySpacing","maxPixels","explosionRadius","circleRadius","breakAroundRadius","radiation"];
defaultBooleanTypeValues = ["burning","dead","hissing","following","dirLocked","del","didChargeBlueTinted","shooting","del","spawnAtPixelTemp","overwrite"];
defaultArrayTypeValues = ["attachOffsets"];
synonymsOfTrue = ["true", "t", "1", "yes"];
synonymsOfFalse = ["false", "f", "0", "no"];
//FORCE DATA FOOTER TO 2 LINES SO IT NEVER HIDES INFO
//ENABLE RUNNING CODE AFTER STATE ELEMENT AUTOGENERATION (runAfterAutogen) ##
resizeCanvas = function(newHeight,newWidth,newPixelSize,clear) {
var gameCanvas = document.getElementById("game");
@ -4405,6 +4406,12 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
pixel1[key] = r.attr1[key];
}
}
if (r.propAdds1) { // add value to each attribute to pixel1
for (var key in r.propAdds1) {
pixel1[key] ??= 0;
pixel1[key] += r.propAdds1[key]
}
}
if (r.stain1) { stainPixel(pixel1,r.stain1,0.05); }
if (r.elem2 !== undefined) {
// if r.elem2 is an array, set elem2 to a random element from the array, otherwise set it to r.elem2
@ -4429,6 +4436,12 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
pixel2[key] = r.attr2[key];
}
}
if (r.propAdds2) { // add value to each attribute to pixel2
for (var key in r.propAdds2) {
pixel2[key] ??= 0;
pixel2[key] += r.propAdds2[key]
}
}
if (r.stain2) { stainPixel(pixel2,r.stain2,0.05); }
if(r.func && pixel1 && pixel2) {
r.func(pixel1,pixel2);
@ -4653,7 +4666,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
color: ["#daff21","#a6ff00","#ffff00"],
behavior: [
"XX|CR:radiation%0.1|XX",
"CR:radiation%0.1|XX|CR:radiation%0.1",
"CR:radiation%0.1|DEL%0.02 AND CH:rad_smoke%0.2|CR:radiation%0.1",
"XX|CR:radiation%0.1|XX",
],
tick: function(pixel) {
@ -5759,6 +5772,38 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
}
clearInterval(renderInterval);
renderInterval = window.setInterval(drawLayers, 1000/60);
viewInfo[4] = {
name: 'element',
pixel: function(pixel,ctx) {
var data = elements[pixel.element];
var _color = data.color;
if(Array.isArray(_color)) {
_color = _color[Math.floor(pixelTicks / 10) % _color.length]
};
drawSquare(ctx,_color,pixel.x,pixel.y,undefined,1 - (data.alpha ?? 0))
}
};
viewInfo[5] = {
name: 'velocity',
pixel: function(pixel,ctx) {
var data = elements[pixel.element];
var vx = pixel.vx ?? 0;
var vy = pixel.vy ?? 0;
var _color = null;
if(vx === 0 && vy === 0) {
_color = "rgb(15,15,15)"
} else {
var magnitude = Math.sqrt ((vx ** 2) + (vy ** 2));
var direction = Math.atan2(pixel.vy ?? 0,pixel.vx ?? 0)*180/Math.PI;
if(direction < 0) { direction = scale(direction,-180,0,360,180) };
hue = direction;
sat = 100;
lig = bound(scale(magnitude,0,100,10,100),0,100);
_color = "hsl("+hue+","+sat+"%,"+lig+"%)";
};
drawSquare(ctx,_color,pixel.x,pixel.y,undefined,1 - (data.alpha ?? 0))
}
};
canvasLayers.pressure = document.createElement("canvas");
canvasLayersPre.push(canvasLayers.pressure);
function drawPressure() {
@ -6970,15 +7015,17 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
color: "#72dfed",
behavior: [
"XX|XX|XX",
"M2|EX:15>frostwind,frostwind,frostwind,liquid_frostbomb%0.4 AND DL%0.2|M2",
"M2|EX:15>frostwind,frostwind,frostwind,liquid_frostbomb%0.4 AND DL%0.2 AND CO:1%10|M2",
"M1|M1|M1",
],
temp: 300,
temp: -200,
category: "energy liquids",
state: "liquid",
density: 2000,
excludeRandom: true,
}
elements.frostwind.tempHigh = 0;
elements.frostwind.stateHigh = null;
//LIQUID VOID ##
elements.liquid_void = {
color: "#262626",
@ -11735,6 +11782,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
};
elements.planet_cracker = {
color: "#ffc8ba",
excludeRandom: true,
behavior: behaviors.WALL,
properties: {
active: true,
@ -11780,8 +11828,14 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
var y = yRisingFromBottomToHalfway;
if(isEmpty(x,y,true)) { continue };
var newPixel = pixelMap[x][y];
var newData = elements[newPixel.element]
if(Math.random() < closenessToBottom) { tryBreak(newPixel) }
newPixel.temp += 400 + ((1 - closenessToBottom) * 100);
pixelTempCheck(newPixel)
if(!newData.excludeVelocity) {
newPixel.vy ??= 0;
newPixel.vy -= Math.round((2 + (closenessToBottom * 2)) ** 2)
}
};
explodeAtPlus(pixel.x,pixel.y+pixel.counter,finalRadius,"plasma","fire",null,planetCrackerHeat);
@ -13377,7 +13431,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
throw new Error("Could not save quicksave in localStorage");
};
};
function quickload(pause=true,doSuccessAlert=true,doFailAlert=true) {
function quickload(pause=true,doSuccessAlert=true,doFailAlert=true,suppressModdedSaveLoadWarning=false) {
var save = localStorage.getItem("quicksave");
if(!save) {
if(doFailAlert) { alert("No save exists") };
@ -13385,7 +13439,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
} else {
clearAll();
rebuildCurrentPixels();
importJsonState(JSON.parse(save));
importJsonState(JSON.parse(save),suppressModdedSaveLoadWarning);
if(doSuccessAlert) { alert("Quicksave loaded") };
if(pause) {
paused = true;
@ -13466,7 +13520,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
//return json;
return importJsonState(json);
};
function importJsonState(json) {
function importJsonState(json,suppressModdedSaveLoadWarning=false) {
//check keys
var jsonKeys = Object.keys(json);
var requiredKeys = [/*"currentPixels", */"pixelMap", "width", "height", "pixelSize"];
@ -13520,7 +13574,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
};
localStorage.setItem("enabledMods",JSON.stringify(currentEnmods));
if((enMods.length > 0 && enMods[0] !== modName) || enMods.length > 1) {
if(!(settings.suppressModdedSaveLoadWarning)) {
if(!(suppressModdedSaveLoadWarning || settings.suppressModdedSaveLoadWarning)) {
alert("Saves with other mods might require a reload (and then importing the save file again).\nIf you see a blank screen, try refreshing and loading the file again before you panic.")
}
};
@ -13614,7 +13668,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
};
var displayTemp = Math.round(_temp);
if(displayTemp > 999999999) {
var shrinkage = (10 ** (Math.floor(Math.log10(_temp)) - 4));
var shrinkage = (10 ** (Math.floor(Math.log10(_temp)) - 2));
displayTemp = [Math.floor(_temp/shrinkage),"e",Math.log10(shrinkage),suffix].join("");
} else {
displayTemp = Math.round(_temp).toString() + suffix;
@ -13684,6 +13738,9 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
statsDiv.style["font-size"] = "75%"
}
}
//Force stats bar to be 2 lines tall so it never hides info
var statsBar = document.getElementById("stats");
statsBar.style.height = "3em";
}
//Moved to window.onload where gameDiv should be guaranteed to exist
} catch (error) {
@ -15189,6 +15246,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
elements.steam.reactions ??= {};
elements.steam.reactions.charcoal = { tempMin: 680, elem1: "hydrogen", elem2: "carbon_monoxide" };
elements.steam.reactions.diamond = { tempMin: 680, elem1: "hydrogen", elem2: "carbon_monoxide" };
elements.diamond.tempHigh = 10000; elements.diamond.stateHigh = "carbon_dioxide" //not really that high
//Oil refining
delete elements.oil.tempHigh;
function liquidMoveCustomViscosity(pixel,viscosity) {
@ -15232,6 +15290,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
};
elements.light_petroleum_fuel_gas = { //it's not liquified, and sandboxels doesn't even have a pressure system, and there is no generic name for uncompressed, gaseous "L"PG, so we need a different name
burn: 100,
burnTime: 10,
color: "#b5b5b3",
density: 3.5,
tempLow: -44,
@ -15241,10 +15300,17 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
pixel.burnStart = pixelTicks;
}
},
burnInto: "explosion,explosion,fire,fire,fire,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","),
burnInto: "explosion,explosion,ignited_gas,fire,fire,fire,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","),
state: "gas",
behavior: behaviors.GAS,
};
elements.liquid_light_petroleum_fuel = {
burn: 50,
burnTime: 165,
fireElement: ["light_petroleum_fuel_gas","fire","fire"],
burnInto: "ignited_gas,fire,fire,smoke,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","),
tempLow: -180 //based off of ethane
}
elements.lamp_oil.tempHigh = 170;
elements.lamp_oil.stateHigh = "lamp_oil_gas";
elements.lamp_oil.density = 810;
@ -16518,8 +16584,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
heatCapacity: 3.52, //unimplemented feature
name: "bio-ooze",
reactions: {
"water": { "elem1":"slime", "elem2":"slime" }, //balance
"poison": { "elem1":"slime", "elem2":"slime" }, //balance
"water": { "elem1":"slime", "elem2":"poison" }, //balance
//"acid": { "elem1":"wastestone" }, //acid should be sulfuric acid and product should be wastestone
//"elder_fluid": { "elem1":"corrupt_slime" }, //acid should be sulfuric acid and product should be wastestone
//"mercury": { "elem1":"liquid_protocite" }, //acid should be sulfuric acid and product should be wastestone
@ -17044,10 +17109,6 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
state: "gas"
},
//}
// charcoal {
elements.charcoal.tempHigh = 800
elements.charcoal.stateHigh = "carbon_dioxide"
//}
//carbon dioxide {
/*fuck this, i can't work out the offset-infested math
function carbonDioxideDecompRatio(temp) {
@ -18482,7 +18543,27 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
density: 6520,
conduct: 0.19,
hardness: 0.5,
forceAutoGen: true
},
eLists.NUCLEARFUEL = ['uranium', 'molten_uranium', 'enriched_uranium', 'molten_enriched_uranium', 'uranium_dioxide', 'enriched_uranium_dioxide', 'molten_uranium_dioxide', 'molten_enriched_uranium_dioxide', 'uranium233', 'uranium235', 'uranium_gas', 'plutonium', 'molten_plutonium', 'enriched_plutonium', 'molten_enriched_plutonium', 'plutonium_dioxide', 'molten_plutonium_dioxide', 'enriched_plutonium_dioxide', 'molten_enriched_plutonium_dioxide', 'uranium_gas', 'plutonium_gas'];
elements.molten_zirconium = {
tick: function(pixel) {
var neighbors = getVonNeumannNeighbors(pixel);
var lavaNeighbors = neighbors.filter(p => (eLists.MAGMA.includes(p.element)) || p.element.includes("molten_dirt"));
var fuelNeighbors = neighbors.filter(p => (eLists.NUCLEARFUEL.includes(p.element)));
if((lavaNeighbors.length > 0) && (fuelNeighbors.length > 0)) {
var aLavaNeighbor = randomChoice(lavaNeighbors);
var aFuelNeighbor = randomChoice(fuelNeighbors);
var coria = [pixel,aLavaNeighbor,aFuelNeighbor];
for(var i = 0; i < coria.length; i++) {
var newPixel = coria[i];
if(!newPixel) { continue };
changePixel(newPixel,"corium",false);
if(newPixel.temp < elements.corium.temp) { newPixel.temp = elements.corium.temp }; //changeTemp upwards only
}
}
}
}
newPowder("zirconia",["#F0ECDB","#FBF8EC"],5680,2715)
elements.solid_zirconia = newPowder("zirconia",["#F0ECDB","#FBF8EC"],5680,2715,null,"zirconia",0.85,true);
elements.molten_magnesium ??= {}; elements.molten_magnesium.tempHigh = 1090;
@ -18539,7 +18620,226 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
};
elements.neutron.state = "gas";
elements.neutron.ignoreAir = "true";
neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
neighbors = [[-1,0],[0,-1],[1,0],[0,1]];
function coriumSteamExpHeat(pixel,x,y,radius,fire,smoke,power,damage) {
var distance = pyth(x,y,pixel.x,pixel.y);
var closeness = Math.abs(radius - distance);
var closenessProportion = closeness / radius;
pixel.temp += 25;
if(Math.random() < Math.sqrt(closenessProportion)) {
if(pixel.element.endsWith("water")) {
pixel.temp += 325;
pixelTempCheck(pixel)
}
};
//double velocity
if (!elements[pixel.element].excludeRandom && !elements[pixel.element].excludeVelocity) {
var angle = Math.atan2(pixel.y-y,pixel.x-x);
pixel.vx = Math.round((pixel.vx|0) + Math.cos(angle) * (radius * power/10));
pixel.vy = Math.round((pixel.vy|0) + Math.sin(angle) * (radius * power/10));
}
}
//and the reason I added zirconium in the first place
elements.corium = {
color: ["#F4D851","#A9B335","#E1710F"],
behavior: behaviors.MOLTEN,
tick: function(pixel) {
pixel.radiation ??= 150;
var range = Math.ceil(Math.log(((pixel.radiation ?? 50) ** (0.583)) + 1))
if(isNaN(pixel.radiation)) { pixel.temp += 10; pixel.radiation = 150 };
if(isNaN(pixel.temp)) { pixel.temp = 2400 };
pixel.temp += (pixel.radiation / 75);
if(pixel.radiation > 0) {
for(var dx = -range; dx <= range; dx++) {
for(var dy = -range; dy <= range; dy++) {
if(Math.random() < (pixel.radiation * 0.003)) {
var distance = Math.sqrt((Math.abs(dx)**2) + (Math.abs(dy)**2));
if(distance > range) { continue };
var x = pixel.x + dx;
var y = pixel.y + dy;
if(isEmpty(x,y,false)) {
createPixelReturn("radiation",x,y).temp = pixel.temp;
}
}
}
}
};
pixel.radiation *= 0.99975;
},
reactions: {
"magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"felsic_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"intermediate_felsic_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"intermediate_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"ultramafic_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"crimson_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"blackpinkinitic_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"rainbow_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"nellish_magma": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_slag": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_steel": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_zirconium": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_zirconia": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_carbon": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_dirt": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_tuff": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_glass": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"molten_silica": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"fallout": { func(pixel1,pixel2) {
changePixel(pixel2,"corium",false); pixel2.radiation = pixel1.radiation / 2; pixel1.radiation = pixel1.radiation / 2 }, chance: 0.02
},
"iodine": { elem2: null },
"caesium": { elem2: null },
"barium": { elem2: null },
"ash": { elem2: null },
"liquid_irradium": { elem2: ["liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium",null], temp1: 1.5, propAdds1: { radiation: 10 } },
"pure_water": { elem1: "intermediate_magma", elem2: "pure_water", changeTemp: true },
"chilly_water": { elem1: "intermediate_magma", elem2: "pure_water", temp1: -500, temp2: -100 }
},
hoverStat: function(pixel) { return "rad.lvl. " + (pixel.radiation ?? 150).toLocaleString(undefined,{maximumFractionDigits: 1}) },
temp: 2400,
tempLow: 1400, //made up
stateLow: "solidified_corium",
tempHigh: 4400, //made up
viscosity: 8, //bad guesstrapolation from https://www.kns.org/files/pre_paper/36/16A-362%EA%B9%80%EC%9B%85%EA%B8%B0.pdf
category: "liquids",
state: "liquid",
density: 7058 //assuming a 0.456 U-Zr ratio, and with uranium dioxide's density of 10970 subject to Sandboxels's standard molten density approximation of -10% because no data is available, and 4700 for liquid ZrO2, but this doesn't account for the variety of other s*** that gets in corium
};
/*for(var key in elements.corium.reactions) {
var r = elements.corium.reactions[key]
if(r.elem1 !== "corium") { continue };
elements[key] ??= {};
elements[key].reactions ??= {};
elements[key].reactions.corium ;
}*/
elements.solidified_corium = {
color: ["#5D4D36","#535F30","#414137"],
behavior: behaviors.POWDER,
tick: function(pixel) {
pixel.radiation ??= 10;
var range = Math.ceil(Math.log(((pixel.radiation ?? 10) ** (0.583)) + 1))
pixel.temp += 2;
if(isNaN(pixel.radiation)) { pixel.temp += 3; pixel.radiation = 150 };
for(var dx = -range; dx <= range; dx++) {
for(var dy = -range; dy <= range; dy++) {
if(Math.random() < 0.03 + (pixel.radiation * 0.0025)) {
var distance = Math.sqrt((Math.abs(dx)**2) + (Math.abs(dy)**2));
if(distance > range) { continue };
var x = pixel.x + dx;
var y = pixel.y + dy;
if(isEmpty(x,y,false)) {
createPixelReturn("radiation",x,y).temp = pixel.temp;
}
}
}
};
pixel.radiation *= 0.9998;
},
hoverStat: elements.corium.hoverStat,
reactions: {
"pure_water": { elem1: "andesite", elem2: "pure_water", changeTemp: true },
"chilly_water": { elem1: "solidified_corium", elem2: ["chilly_water","steam"], temp1: -500, temp2: -100 },
"liquid_irradium": { elem2: ["liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium",null], temp1: 1.5, propAdds1: { radiation: 10 } }
},
temp: 50,
tempHigh: 1400, //made up
stateHigh: "corium",
category: "solids",
state: "solid",
density: 11800 //assuming a 0.456 U-Zr ratio, and with uranium dioxide's density of 10970 subject to Sandboxels's standard molten density approximation of -10% because no data is available, and 4700 for liquid ZrO2, but this doesn't account for the variety of other s*** that gets in corium
};
if(eLists.WATER) {
for(var i = 0; i < eLists.WATER.length; i++) {
var water = eLists.WATER[i];
if(water == "chilly_water" || water == "pure_water") { continue };
elements.corium.reactions[water] = { func(pixel1,pixel2) {
explodeAt(pixel1.x,pixel1.y,5,"fire,rad_steam,rad_steam,rad_steam,steam,steam,radiation","steam,radiation",null,coriumSteamExpHeat)
}, temp1: 50, chance: 0.01 }
}
};
elements.corium_gas = {
tick: elements.corium.tick,
hoverStat: elements.corium.hoverStat,
reactions: {
"liquid_irradium": { elem2: ["liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium","liquid_irradium",null], temp1: 1.5, propAdds1: { radiation: 10 } },
"pure_water": { elem1: "intermediate_magma", elem2: "pure_water", changeTemp: true },
"chilly_water": { elem1: "solidified_corium", elem2: "steam", temp1: -500, temp2: -100 }
},
density: 20
};
elements.pure_water.reactions.dirty_water = elements.pure_water.reactions.water
radiationIncreaseOverrides = {
molten_uranium238: 1,
molten_actinium: 5,
molten_protactinium: 3,
molten_americium: 3,
molten_berkelium: 3,
molten_californium: 3,
molten_einsteinium: 5,
molten_fermium: 5,
molten_nihonium: 5,
molten_moscovium: 10,
molten_livermorium: 10,
molten_tennessine: 10,
molten_oganesson: 10,
molten_nihonium_oxide: 10,
molten_flerovium_oxide: 10,
molten_livermorium_oxide: 10,
"molten_p9-leeseocid": 10,
}
var radioactives = eLists.NUCLEARFUEL; radioactives.push("molten_uranium","molten_uranium238","molten_neptunium","molten_uranium238","molten_actinium","molten_protactinium","molten_americium","molten_berkelium","molten_californium","molten_einsteinium","molten_fermium","molten_nihonium","molten_moscovium","molten_livermorium","molten_tennessine","molten_oganesson","molten_nihonium_oxide","molten_flerovium_oxide","molten_livermorium_oxide","molten_p9-leeseocid")
for(var i = 0; i < radioactives.length; i++) {
var radioactive = radioactives[i];
elements.corium.reactions[radioactive] ??= { elem2: null, temp1: 1, chance: 0.1, propAdds1: { radiation: radiationIncreaseOverrides[radioactive] ?? 2 } }
}
//Non-element: Liquid ammonia
elements.liquid_ammonia = {
color: "#bab6a9",
@ -21561,7 +21861,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
elements[name] = {
behavior: itsActuallySolidNotPowderLol ? behaviors.WALL : behaviors.POWDER,
color: color,
category: "solids",
category: itsActuallySolidNotPowderLol ? "solids" : "powders",
state: "solid",
density: density ?? 1000,
};
@ -23164,6 +23464,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
stain: 0.01,
_data: [particulateInfo._data[0], particulateInfo._data[1], "suspension"],
}
if(eLists.WATER) { eLists.WATER.push(suspensionName) };
elements[suspensionName].reactions[suspensionName] = { "elem1":"water", "elem2":sedimentName, "chance": 0.001 },
elements[suspensionName].reactions[particulateName] = { "elem1": "water", "elem2":sedimentName, "chance": 0.0005 },
//Sediment element where lithification code resides
@ -23241,6 +23542,8 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
};
};
};
if(!eLists.WATER) { console.error(38309309) };
if(eLists.WATER) { eLists.WATER.push("swamp_water","heavy_water","radioactive_water","milk") };
newPowder("calcite","#f5ecd0",2711,825,["carbon_dioxide","quicklime"],"calcium_carbonate_dust");
newPowder("aragonite","#e3c58d",2830,825,["carbon_dioxide","quicklime"],"calcium_carbonate_dust");
newPowder("vaterite","#e8ebd8",2540,825,["carbon_dioxide","quicklime"],"calcium_carbonate_dust");
@ -23277,6 +23580,8 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
};
};
runAfterLoad(function() {
eLists.MAGMA = Object.keys(elements).filter(x => x.includes("magma") && !(x.includes("vaporized")) && !(x.includes("cloud")))
for(i = 0; i < sands.length; i++) {
switch(sands[i]) {
case "dirt":
@ -25880,6 +26185,9 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
density: 3600,
hardness: 0.85,
}
elements.molten_spinel = {
tempHigh: 2977, //The real boiling point is not known, so using corundum
}
//Topaz
elements.topaz = {
color: ["#f7f431", "#ffff5c", "#f7e048", "#fae43e", "#fff86e", "#ede321"],
@ -25916,7 +26224,6 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
goldenZirconColors = ["#e99209","#fcb111","#d88208","#b97605"];
//heatTreated 0 = untreated, 1 = inertly (blue), 2 = with oxygen (golden)
elements.zircon = {
//Corundum with different impurities, so I can copy/paste everything but the color
color: ["#37130b","#a9301a","#3c1810"],
properties: {
heatTreated: 0
@ -26622,15 +26929,22 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
//Money world
worldgentypes.money = {
layers: [
[0.9, "jadeite",1/2],
[0.9, "emerald"],
[0.6, "diamond"],
[0.3, "osmium_scrap",1/5],
[0.3, "rhenium_scrap",1/5],
[0.3, "rhodium_scrap",1/5],
[0.3, "iridium_scrap",1/5],
[0.3, "gold_coin"],
[0.1, "ruby", 1/3],
[0.1, "amethyst", 1/2],
[0.1, "garnet", 1/5],
[0.1, "spinel", 1/5],
[0.1, "ruby", 1/5],
[0.1, "amethyst", 1/5],
[0.1, "sapphire"],
[-0.1, "pearl", 0.4],
[-0.1, "onyx"]
]
],
};
//Concrete
worldgentypes.concrete = {
@ -27959,9 +28273,16 @@ ${eightSpaces}Example full decor definition: bird:0.04:10:#FF0000,#FFFF00,#00FF0
console.error("pixelsize: supplied pixel size was zero or negative");
return false;
} else {
document.querySelector('span[setting="pixelsize"]').querySelector("select").selectedIndex = pixelSizeSettingDropdownOtherOptionIndex;
settings.pixelsize = argPixelSize;
resizeCanvas(ctx.canvas.height,ctx.canvas.width,settings.pixelsize,false)
var confirmation = confirm("Due to changes in the game, this command must reset the canvas. Proceed?")
if(confirmation) {
document.querySelector('span[setting="pixelsize"]').querySelector("select").selectedIndex = pixelSizeSettingDropdownOtherOptionIndex;
settings.pixelsize = argPixelSize;
resizeCanvas(ctx.canvas.height,ctx.canvas.width,settings.pixelsize,false);
clearAll();
return argPixelSize
} else {
return false
}
};
} else {
alert(pixelSize);
@ -28733,7 +29054,8 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.smash_ray = {
color: ["#ff9999", "#8c8279"],
tick: function(pixel) {
if(pixel.done) { deletePixel(pixel); return };
if(!pixel) { return };
if(pixel?.done) { deletePixel(pixel.x,pixel.y); return };
var x = pixel.x;
for (var y = pixel.y; y < height; y++) {
if (outOfBounds(x, y)) {
@ -29697,114 +30019,7 @@ Make sure to save your command in a file if you want to add this preset again.`
state: "solid",
movable: false
}
//PORTALS ##
//heehee haha melanie martinez
//https://stackoverflow.com/a/60922255
headBodyObject = {
"head": "body",
};
elements.portal_in = {
color: "#ee7f00",
properties: {
_channel: 0,
_correspondingPortals: null
},
insulate: true,
onTryMoveInto: function(pixel,otherPixel) {
try {
if(pixel._correspondingPortals == null) {
return;
};
if(pixel._correspondingPortals.length <= 0) {
return;
};
var portal = randomChoice(pixel._correspondingPortals);
var offset = {x: pixel.x - otherPixel.x, y: pixel.y - otherPixel.y}; //teleport destination's offset, inverted by subtraction
var destination = {x: portal.x + offset.x, y: portal.y + offset.y};
var otherElement = otherPixel.element;
var isHead = (typeof(headBodyObject[otherElement]) !== "undefined");
var isBody = (typeof(getKeyByValue(headBodyObject,otherElement)) !== "undefined");
var isBipartite = xor(isHead,isBody); //a head being its own body will break the code
if(isBipartite) {
if(isHead) {
var dead = otherPixel.dead;
var body = pixelMap[otherPixel.x][otherPixel.y+1];
if(body == undefined) { body = null };
if(!dead && (body !== null)) {
if(offset.y == -1) {
offset.y--;
destination.y--;
};
var headSpotIsEmpty = isEmpty(destination.x,destination.y,false);
var bodySpotIsEmpty = isEmpty(destination.x,destination.y+1,false);
if(headSpotIsEmpty && bodySpotIsEmpty) {
tryMove(otherPixel,destination.x,destination.y);
tryMove(body,destination.x,destination.y+1);
};
} else {
tryMove(otherPixel,destination.x,destination.y);
};
} else if(isBody) {
var dead = otherPixel.dead;
var head = pixelMap[otherPixel.x][otherPixel.y-1];
if(head == undefined) { head = null };
if(!dead && (head !== null)) {
if(offset.y == 1) {
offset.y++;
destination.y++;
};
var headSpotIsEmpty = isEmpty(destination.x,destination.y-1,false);
var bodySpotIsEmpty = isEmpty(destination.x,destination.y,false);
if(headSpotIsEmpty && bodySpotIsEmpty) {
tryMove(head,destination.x,destination.y-1);
tryMove(otherPixel,destination.x,destination.y);
};
} else {
tryMove(otherPixel,destination.x,destination.y);
};
};
} else {
tryMove(otherPixel,destination.x,destination.y);
};
} catch(error) {
//ignore stack overflows
if(error.toString().includes("call stack")) {
} else {
throw new Error("error")
}
}
},
tick: function(pixel) {
pixel._channel = Math.floor(pixel.temp / 100);
pixel._correspondingPortals = currentPixels.filter(function(pixelToCheck) {
return (
pixelToCheck.element == "portal_out" &&
pixelToCheck._channel == pixelChannel
);
},pixelChannel=pixel._channel);
for(i = 0; i < pixel._correspondingPortals.length; i++) {
pixel._correspondingPortals[i] = {x: pixel._correspondingPortals[i].x, y: pixel._correspondingPortals[i].y};
};
//pixel.tempdebug = JSON.stringify(pixel._correspondingPortals);
},
category: "machines",
state: "solid",
breakInto: ["radiation","laser","iridium","essence","ionized_deuterium","electron","magic","steel","pop","unstable_mistake","explosion","magic","steel","proton","electron","radiation","laser","iridium"],
hardness: 0.999
},
elements.portal_out = {
color: "#2222ee",
insulate: true,
tick: function(pixel) {
pixel._channel = Math.floor(pixel.temp / 100);
},
behavior: behaviors.WALL,
category: "machines",
state: "solid",
insulate: true,
breakInto: ["radiation","laser","iridium","essence","ionized_deuterium","electron","magic","steel","pop","unstable_mistake","explosion","magic","steel","proton","electron","radiation","laser","iridium"],
hardness: 0.999
}
//PORTALS have been added to vanilla Sandboxels. Congratulations to our graduate. ##
//MOBS ##
//Prerequisite Functions and Variables
minimumCreeperTries = 3;
@ -35621,7 +35836,7 @@ Make sure to save your command in a file if you want to add this preset again.`
}
//Requisite variables
//Bombs
amalgamatedBombFire = "plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,acid,acid,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,flash,flash,flash,flash,flash,acid_gas,acid_gas,acid_gas,acid,oil,oil,oil,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,acid,acid,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,electric_cluster_bomb,electric_cluster_bomb,flash,flash,flash,flash,flash,acid_gas,acid_gas,acid_gas,acid,oil,oil,oil,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plague,plague,plague,plague,plague,plague,radiation,radiation,radiation,radiation,radiation,radiation,radiation,radiation,uranium,uranium,uranium,uranium,uranium,uranium,greek_fire,greek_fire,greek_fire,greek_fire,greek_fire,antimatter,antimatter,antimatter,antimatter,antimatter,smoke_grenade,antimatter,smoke_grenade,fireball,flash,acid_gas,acid_gas,acid_gas,plague,plague,plague,plague,plague,plague,radiation,radiation,radiation,radiation,radiation,radiation,radiation,radiation,uranium,uranium,uranium,uranium,uranium,uranium,greek_fire,greek_fire,greek_fire,greek_fire,greek_fire,antimatter,antimatter,antimatter,antimatter,antimatter,smoke_grenade,antimatter,flash,acid_gas,acid_gas,acid_gas,radiation,radiation,radiation,radiation,plague,acid_gas,acid_gas,acid_gas,chlorine,chlorine,chlorine"
amalgamatedBombFire = "plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,acid,acid,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,flash,flash,flash,flash,flash,acid_gas,acid_gas,acid_gas,acid,oil,oil,oil,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,acid,acid,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plasma,smoke,plasma,plasma,fire,smoke,plasma,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,metal_scrap,electric_cluster_bomb,electric_cluster_bomb,flash,flash,flash,flash,flash,acid_gas,acid_gas,acid_gas,acid,oil,oil,oil,oil,oil,oil,oil,oil,oil,oil,plasma,plasma,plasma,plasma,plague,plague,plague,plague,plague,plague,radiation,radiation,radiation,radiation,radiation,radiation,radiation,radiation,uranium,uranium,uranium,uranium,uranium,uranium,greek_fire,greek_fire,greek_fire,greek_fire,greek_fire,antimatter,antimatter,antimatter,antimatter,antimatter,smoke_grenade,antimatter,smoke_grenade,fireball,flash,acid_gas,acid_gas,acid_gas,plague,plague,plague,plague,plague,plague,radiation,radiation,radiation,radiation,radiation,radiation,radiation,radiation,uranium,uranium,uranium,uranium,uranium,uranium,greek_fire,greek_fire,greek_fire,greek_fire,greek_fire,antimatter,antimatter,antimatter,antimatter,antimatter,smoke_grenade,antimatter,flash,acid_gas,acid_gas,acid_gas,radiation,radiation,radiation,radiation,plague,acid_gas,acid_gas,acid_gas,chlorine,chlorine,chlorine,god_slayer_bomb,god_slayer_bomb,god_slayer_fire,god_slayer_fire,holy_bomb,holy_bomb,holy_fire,holy_fire,warp_bomb,warp_bomb,op_electromagneticester_emp,op_electromagneticester_emp,op_hottester_bomb,op_hottester_bomb,force_bomb,force_bomb,wall_bomb,wall_bomb,hypernapalm,hypernapalm,liquid_god_slayer_fire,earthquake,tornado,tsunami,firebomb,firebomb"
eLists.BOMB = ["bomb", "tnt", "c4", "grenade", "dynamite", "gunpowder", "firework", "nuke", "h_bomb", "dirty_bomb", "emp_bomb", "sticky_bomb", "cold_bomb", "hot_bomb", "electro_bomb", "water_bomb", "antimatter_bomb", "flashbang", "smoke_grenade", "fireball", "landmine", "cluster_bomb", "cluster_nuke", "op_hottester_bomb", "anti-bomb", "electric_bomblet", "electric_cluster_bomb", "radioactive_popper", "acid_bomb", "amalgamated_bomb"]; bombChoices = eLists.BOMB;
var excludedBombElements = ["water", "antimatter", "acid"];
//Clouds
@ -35763,6 +35978,7 @@ Make sure to save your command in a file if you want to add this preset again.`
};
elements.amba_tsunami = {
color: ["#2449d1","#4b6adb","#8093d9"],
excludeRandom: true,
behavior: behaviors.WALL,
properties: {
active: true,
@ -35842,6 +36058,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.megatsunami = {
color: ["#1f2aa3","#2641c9","#3a57c9"],
behavior: behaviors.WALL,
excludeRandom: true,
properties: {
active: true,
},
@ -35922,6 +36139,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.lava_tsunami = {
color: ["#ff370a","#e84a23","#e67740"],
behavior: behaviors.WALL,
excludeRandom: true,
properties: {
active: true,
},
@ -36012,6 +36230,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.lava_megatsunami = {
color: ["#b32b10","#c24d1f","#d66924"],
behavior: behaviors.WALL,
excludeRandom: true,
properties: {
active: true,
},
@ -39830,6 +40049,7 @@ Make sure to save your command in a file if you want to add this preset again.`
state: "solid",
density: 3980,
hardness: 0.9,
hidden: true
};
standaloneBrokenFormMaker("ruphire","shard",true,"powders","auto","auto","molten_ruphire",["alumina","alumina","alumina","alumina","alumina","alumina","alumina","alumina","alumina","iron_scrap","titanium_scrap","chromium_scrap","chromium_scrap"]).hidden = true;
elements.molten_ruby ??= {};
@ -39929,7 +40149,7 @@ Make sure to save your command in a file if you want to add this preset again.`
};
});
function propPrompt() {
propProperty = prompt("Enter the property you want to set");
propProperty = prompt("(Prop) Enter the property you want to set");
propValue = prompt("Enter the value you want to set to");
//special check: element
if(propProperty === "element") {
@ -40108,7 +40328,7 @@ Make sure to save your command in a file if you want to add this preset again.`
if(oldProperty === null) {
oldProperty = "temp";
};
numberAdjusterProperty = prompt("Enter the property you want to change");
numberAdjusterProperty = prompt("(Number adjuster) Enter the value you want to change");
if(numberAdjusterProperty === null) {
numberAdjusterProperty = oldProperty;
return false;
@ -44780,35 +45000,43 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
};*/
window.addEventListener("load",function() {
currentElement = urlParams.get("currentElement") ?? "sand";
if(!elementExists(currentElement)) {
currentElement = "sand"
};
selectElement(currentElement);
currentElement = urlParams.get("currentElement") ?? "sand";
if(!elementExists(currentElement)) {
currentElement = "sand"
};
selectElement(currentElement);
var size = urlParams.get("mouseSize") ?? 5;
if(isNaN(size)) {
size = 5;
};
mouseSize = size
var size = urlParams.get("mouseSize") ?? 5;
if(isNaN(size)) {
size = 5;
};
mouseSize = size
var _tps = urlParams.get("tps") ?? 30;
if(isNaN(_tps)) {
_tps = 30;
};
tps = _tps;
resetInterval(tps);
var _tps = urlParams.get("tps") ?? 30;
if(isNaN(_tps)) {
_tps = 30;
};
tps = _tps;
resetInterval(tps);
var shape = urlParams.get("currentShape") ?? "square";
if(shapeOrder.indexOf(shape) == -1) {
shape = "square"
};
currentShape = shape;
var shape = urlParams.get("currentShape") ?? "square";
if(shapeOrder.indexOf(shape) == -1) {
shape = "square"
};
currentShape = shape;
var doPause = urlParams.get("paused");
if(doPause !== null) {
paused = true;
document.getElementById("pauseButton").setAttribute("on","true")
};
var autoQuickload = urlParams.get("quickload");
if(autoQuickload !== null) {
quickload(doPause !== null,false,true);
autoResizeCanvas(false)
};
/*if(urlParams.get("pause") !== null) {
paused = true;
document.getElementById("pauseButton").setAttribute("on","true")
};*/
});
//PRESSURE SYSTEM ##
if(settings.dopressure == undefined || settings.drawpressure == undefined) {
@ -45530,6 +45758,101 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
behavior: behaviors.WALL,
grain: 0
};
behaviorRules.LC = function() { //limited cool
if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
//if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
if (btemp.arg != null) {btemp.arg = btemp.arg.split(",").map(parseFloat)}
else {btemp.arg = [0,1]}
if (isNaN(btemp.arg[0])) {btemp.arg[0] = 0}
if (isNaN(btemp.arg[1])) {btemp.arg[1] = 1}
if(newPixel.temp > btemp.arg[0]) {
if(newPixel.temp - btemp.arg[0] < btemp.arg[1]) {
newPixel.temp = btemp.arg[0]
} else {
newPixel.temp -= btemp.arg[1]
}
}
pixelTempCheck(newPixel);
//}
}
}
behaviorRules.LH = function() { //limited heat
if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
//if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
if (btemp.arg != null) {btemp.arg = btemp.arg.split(",").map(parseFloat)}
else {btemp.arg = [0,1]}
if (isNaN(btemp.arg[0])) {btemp.arg[0] = 0}
if (isNaN(btemp.arg[1])) {btemp.arg[1] = 1}
if(newPixel.temp < btemp.arg[0]) {
if(newPixel.temp + btemp.arg[0] > btemp.arg[1]) {
newPixel.temp = btemp.arg[0]
} else {
newPixel.temp += btemp.arg[1]
}
}
pixelTempCheck(newPixel);
//}
}
}
behaviorRules.TS = function() { //thermostat
if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
//if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
if (btemp.arg != null) {btemp.arg = btemp.arg.split(",").map(parseFloat)}
else {btemp.arg = [0,1]}
if (isNaN(btemp.arg[0])) {btemp.arg[0] = 0}
if (isNaN(btemp.arg[1])) {btemp.arg[1] = 1}
if(newPixel.temp > btemp.arg[0]) {
if(newPixel.temp - btemp.arg[0] < btemp.arg[1]) {
newPixel.temp = btemp.arg[0]
} else {
newPixel.temp -= btemp.arg[1]
}
} else if(newPixel.temp < btemp.arg[0]) {
if(newPixel.temp + btemp.arg[0] > btemp.arg[1]) {
newPixel.temp = btemp.arg[0]
} else {
newPixel.temp += btemp.arg[1]
}
}
pixelTempCheck(newPixel);
//}
}
}
behaviorRules.BN = function() { //burn
if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
var burn = elements[newPixel.element].burn;
if (burn !== undefined) {
if (Math.random() < (burn / 100)) { // If random number is less than flammability
if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
return;
}
if (!(newPixel.burning || (newPixel.burnStart !== undefined))) {
newPixel.burning = true;
newPixel.burnStart = pixelTicks;
}
}
}
}
}
behaviorRules.ET = function() { //extinguish
if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
if (newPixel.burning || newPixel.burnStart) {
delete newPixel.burning;
delete newPixel.burnStart;
}
}
}
runAfterLoad(function() {
//Emergency bug fix
elemfillerVar = null;
@ -45678,7 +46001,10 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
//END ##
console.log("Mod loaded");
window.addEventListener("load",function() {logMessage("a_mod_by_alice.js requires many other mods. Many of the elements and features added with it installed are actually added by the other mods it depends on.")})
window.addEventListener("load",function() {
logMessage("a_mod_by_alice.js requires many other mods. Many of the elements and features added with it installed are actually added by the other mods it depends on.")
logMessage('These mods are libhooktick.js, chem.js, minecraft.js, Neutronium Mod.js, fey_and_more.js, velocity.js, ketchup_mod.js, moretools.js, aChefsDream.js, nousersthings.js. They were enabled automatically')
})
} catch (error) {
alert(`Load failed (try reloading).\nThis is likely a sporadic failure caused by inconsistencies in how mods are loaded, and will likely fix itself in a refresh or two. If it persists, then it's an issue.\nError: ${error.stack}`);
console.error(error)

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
elements.mud_brick = {
color: "#8a6249",
colorPattern: textures.BRICK,
colorKey: {
"l": "#986c51",
"r": "#8a6249",
"d": "#7f5943",
"w": "#634933"},
behavior: behaviors.WALL,
category: "solids",
state: "solid",
tempHigh: 1200,
stateHigh: "molten_dirt",
hardness: 0.33,
breakInto: "dirt"
}
// elements.mud_brick = {
// color: "#8a6249",
// colorPattern: textures.BRICK,
// colorKey: {
// "l": "#986c51",
// "r": "#8a6249",
// "d": "#7f5943",
// "w": "#634933"},
// behavior: behaviors.WALL,
// category: "solids",
// state: "solid",
// tempHigh: 1200,
// stateHigh: "molten_dirt",
// hardness: 0.33,
// breakInto: "dirt"
// }
var materials = ["brick","concrete","wood","glass","steel"];

2116
mods/charsonsmoduno.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,35 +12,35 @@ cc_settingsTab.registerSettings("OverHeating", cc_setting1);
settingsManager.registerTab(cc_settingsTab);
var colorPalette_4bit = [
"#101820", "#37175F", "#5F1717", "#6F175F",
"#005F00", "#1563BF", "#7F401A", "#525252",
"#8F8F8F", "#EE8822", "#FF3027", "#FF47FF",
"#58E618", "#27FFDF", "#FFFF27", "#FFFFFF"
"#101820", "#37175F", "#5F1717", "#6F175F",
"#005F00", "#1563BF", "#7F401A", "#525252",
"#8F8F8F", "#EE8822", "#FF3027", "#FF47FF",
"#58E618", "#27FFDF", "#FFFF27", "#FFFFFF"
];
function hueLerp(value) {
// Clamp the value between -50 and 400
if (value < -50) value = -50;
if (value > 400) value = 400;
// Clamp the value between -50 and 400
if (value < -50) value = -50;
if (value > 400) value = 400;
let r, g, b;
let r, g, b;
if (value <= 300) {
// Interpolate between blue and red
let t = (value + 50) / 350; // Normalize value from -50 to 300 to a 0-1 range
r = Math.round(255 * t);
g = 0;
b = Math.round(255 * (1 - t));
} else {
// Interpolate between red and white
let t = (value - 300) / 100; // Normalize value from 300 to 400 to a 0-1 range
r = 255;
g = Math.round(255 * t);
b = Math.round(255 * t);
}
if (value <= 300) {
// Interpolate between blue and red
let t = (value + 50) / 350; // Normalize value from -50 to 300 to a 0-1 range
r = Math.round(255 * t);
g = 0;
b = Math.round(255 * (1 - t));
} else {
// Interpolate between red and white
let t = (value - 300) / 100; // Normalize value from 300 to 400 to a 0-1 range
r = 255;
g = Math.round(255 * t);
b = Math.round(255 * t);
}
// Convert RGB values to a hex string
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();
// Convert RGB values to a hex string
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();
}
function cc_rgbToArray(colorString) {
@ -76,7 +76,7 @@ function cc_rgbToArray(colorString) {
}
function cc_arrayToRgbString(rgbArray) {
return `rgb(${rgbArray.join(', ')})`;
return `rgb(${rgbArray.join(', ')})`;
}
function cc_scaleList(numbers, scale) {
@ -220,58 +220,58 @@ function setPin(pixel, pins, index, value, rotation=pixel.circuitRotation) {
// Circuits
elements.four_bit_selector_circuit = {
cc_stableTick: function(pixel) {
var pins = [
// First 4-bit input (A)
[-1, -2, true], // A0
[-3, -2, true], // A1
[-5, -2, true], // A2
[-7, -2, true], // A3
cc_stableTick: function(pixel) {
var pins = [
// First 4-bit input (A)
[-7, -2, true], // A0
[-5, -2, true], // A1
[-3, -2, true], // A2
[-1, -2, true], // A3
// Second 4-bit input (B)
[7, -2, true], // B0
[5, -2, true], // B1
[3, -2, true], // B2
[1, -2, true], // B3
// Second 4-bit input (B)
[1, -2, true], // B0
[3, -2, true], // B1
[5, -2, true], // B2
[7, -2, true], // B3
// Selection pin (Sel)
[9, 0, true], // Selection (Sel)
// Selection pin (Sel)
[9, 0, true], // Selection (Sel)
// Output (O)
[-3, 2, false], // O0 (centered)
[-1, 2, false], // O1 (centered)
[1, 2, false], // O2 (centered)
[3, 2, false], // O3 (centered)
];
// Output (O)
[-3, 2, false], // O0 (centered)
[-1, 2, false], // O1 (centered)
[1, 2, false], // O2 (centered)
[3, 2, false], // O3 (centered)
];
initializeCircuit(pixel, pins, 17, 3);
initializeCircuit(pixel, pins, 17, 3);
// Read inputs
var A = [
checkPin(pixel, pins, 0),
checkPin(pixel, pins, 1),
checkPin(pixel, pins, 2),
checkPin(pixel, pins, 3)
];
// Read inputs
var A = [
checkPin(pixel, pins, 0),
checkPin(pixel, pins, 1),
checkPin(pixel, pins, 2),
checkPin(pixel, pins, 3)
];
var B = [
checkPin(pixel, pins, 4),
checkPin(pixel, pins, 5),
checkPin(pixel, pins, 6),
checkPin(pixel, pins, 7)
];
var B = [
checkPin(pixel, pins, 4),
checkPin(pixel, pins, 5),
checkPin(pixel, pins, 6),
checkPin(pixel, pins, 7)
];
var Sel = checkPin(pixel, pins, 8); // Selection pin
var Sel = checkPin(pixel, pins, 8); // Selection pin
// Select between A and B based on Sel
var output = Sel ? B : A;
// Select between A and B based on Sel
var output = Sel ? B : A;
// Output the selected 4-bit value
setPin(pixel, pins, 9, output[0]); // O0
setPin(pixel, pins, 10, output[1]); // O1
setPin(pixel, pins, 11, output[2]); // O2
setPin(pixel, pins, 12, output[3]); // O3
}
// Output the selected 4-bit value
setPin(pixel, pins, 9, output[0]); // O0
setPin(pixel, pins, 10, output[1]); // O1
setPin(pixel, pins, 11, output[2]); // O2
setPin(pixel, pins, 12, output[3]); // O3
}
};
elements.four_bit_enabler_circuit = {
@ -404,13 +404,13 @@ elements.four_bit_randomizer_circuit = {
var tempVar = 0;
elements.temperature_sensor = {
behavior: behaviors.WALL,
behavior: behaviors.WALL,
onSelect: function() {
var answertemp = Number(prompt("Set your target temperature:",(tempVar||undefined)));
if (!answertemp) { return }
var answertemp = Number(prompt("Set your target temperature:",(tempVar||undefined)));
if (!answertemp) { return }
tempVar = answertemp;
},
hoverStat: function(pixel) {
},
hoverStat: function(pixel) {
return `TargetTmp: {pixel.targetTemp}`;
},
cc_stableTick: function(pixel) {
@ -1335,67 +1335,67 @@ elements.four_bit_adder_circuit = {
};
elements.four_bit_subtractor_circuit = {
cc_stableTick: function(pixel) {
var pins = [
// First 4-bit number (A)
[-1, -2, true], // A3
[-3, -2, true], // A2
[-5, -2, true], // A1
[-7, -2, true], // A0
cc_stableTick: function(pixel) {
var pins = [
// First 4-bit number (A)
[-1, -2, true], // A3
[-3, -2, true], // A2
[-5, -2, true], // A1
[-7, -2, true], // A0
// Second 4-bit number (B)
[7, -2, true], // B3
[5, -2, true], // B2
[3, -2, true], // B1
[1, -2, true], // B0
// Second 4-bit number (B)
[7, -2, true], // B3
[5, -2, true], // B2
[3, -2, true], // B1
[1, -2, true], // B0
// Borrow-in (B_in)
[9, 0, true], // Borrow-in (B_in)
// Borrow-in (B_in)
[9, 0, true], // Borrow-in (B_in)
// Output difference (D)
[-1, 2, false], // D3
[-3, 2, false], // D2
[-5, 2, false], // D1
[-7, 2, false], // D0
[1, 2, false], // Borrow Out (B4)
];
// Output difference (D)
[-1, 2, false], // D3
[-3, 2, false], // D2
[-5, 2, false], // D1
[-7, 2, false], // D0
[1, 2, false], // Borrow Out (B4)
];
initializeCircuit(pixel, pins, 17, 3);
initializeCircuit(pixel, pins, 17, 3);
// Read inputs
var A = [
checkPin(pixel, pins, 0),
checkPin(pixel, pins, 1),
checkPin(pixel, pins, 2),
checkPin(pixel, pins, 3)
];
// Read inputs
var A = [
checkPin(pixel, pins, 0),
checkPin(pixel, pins, 1),
checkPin(pixel, pins, 2),
checkPin(pixel, pins, 3)
];
var B = [
checkPin(pixel, pins, 4),
checkPin(pixel, pins, 5),
checkPin(pixel, pins, 6),
checkPin(pixel, pins, 7)
];
var B = [
checkPin(pixel, pins, 4),
checkPin(pixel, pins, 5),
checkPin(pixel, pins, 6),
checkPin(pixel, pins, 7)
];
var B_in = checkPin(pixel, pins, 8); // Borrow-in
var B_in = checkPin(pixel, pins, 8); // Borrow-in
// Calculate the difference and borrow
var difference = [];
var borrow = B_in;
// Calculate the difference and borrow
var difference = [];
var borrow = B_in;
for (var i = 0; i < 4; i++) {
var bitDifference = A[i] - B[i] - borrow;
difference[i] = (bitDifference + 2) % 2; // Current bit difference
borrow = bitDifference < 0 ? 1 : 0; // Borrow for next bit
}
for (var i = 0; i < 4; i++) {
var bitDifference = A[i] - B[i] - borrow;
difference[i] = (bitDifference + 2) % 2; // Current bit difference
borrow = bitDifference < 0 ? 1 : 0; // Borrow for next bit
}
// Output the difference
setPin(pixel, pins, 9, difference[0]); // D0
setPin(pixel, pins, 10, difference[1]); // D1
setPin(pixel, pins, 11, difference[2]); // D2
setPin(pixel, pins, 12, difference[3]); // D3
setPin(pixel, pins, 13, borrow); // Borrow Out (B4)
}
// Output the difference
setPin(pixel, pins, 9, difference[0]); // D0
setPin(pixel, pins, 10, difference[1]); // D1
setPin(pixel, pins, 11, difference[2]); // D2
setPin(pixel, pins, 12, difference[3]); // D3
setPin(pixel, pins, 13, borrow); // Borrow Out (B4)
}
};
function general_clock(speed, s2) {
@ -1930,7 +1930,7 @@ document.addEventListener('keydown', function(event) {
}
});
function drawCircuitExtras() {
function drawCircuitExtras(ctx) {
if (elements[currentElement].isCircuitCore && elements[currentElement].previewSize) {
var circuitWidth = elements[currentElement].previewSize[0];
var circuitHeight = elements[currentElement].previewSize[1];
@ -1983,7 +1983,7 @@ function runLogicTick() {
}
function stabilizeLogicGates() {
var logicgatesElements = ["output","logic_wire","not_gate","and_gate","xor_gate","or_gate","nand_gate","nor_gate","nxor_gate","E2L_lever","E2L_button","L2E_constant","logic_transmitter","logic_receiver","logic_shock","logic_unshock"]
var logicgatesElements = ["output","logic_wire","not_gate","and_gate","xor_gate","or_gate","nand_gate","nor_gate","nxor_gate","E2L_lever","E2L_button","L2E_constant","logic_shock","logic_unshock"]
for (var i = 0;i < logicgatesElements.length;i++) {
elements[logicgatesElements[i]].cc_stableTick = elements[logicgatesElements[i]].tick;

View File

@ -172,4 +172,5 @@ if (elements.border) {elements.border.tick = function(pixel){
var t = pixelTicks/2+pixel.x+pixel.y;
var r = Math.floor(127*Math.sin(t/1.5));
pixel.color = "rgba("+r+","+r*2+","+r*2+","+r/127+")";
};}
};}
if (elements.pipe_wall) {elements.pipe_wall.color = "#808080";}

106
mods/clouds.js Normal file
View File

@ -0,0 +1,106 @@
// Clouds.js
if (!enabledMods.includes("mods/betterSettings.js")) { enabledMods.unshift("mods/betterSettings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); window.location.reload() };
var clouds_settingsTab = new SettingsTab("Clouds");
var cloud_count_setting = new Setting("Cloud count", "cloud_count", settingType.NUMBER, false, defaultValue=40);
clouds_settingsTab.registerSettings("Real time", cloud_count_setting);
settingsManager.registerTab(clouds_settingsTab);
// Biased random
function randomGaussian(A, B, biasFactor=2) {
let u = Math.random();
let v = Math.random();
let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
let mean = (A + B) / 2;
let stdDev = (B - A) / biasFactor;
let result = mean + num * stdDev;
return Math.min(Math.max(result, A), B);
}
function randomBetween(A, B) {
return Math.random() * (B - A) + A;
}
function initClouds(amount) {
for (let i = 0; i < amount; i++) {
var w = randomBetween(6, 17);
var h = randomBetween(4, 10);
var x = randomBetween(0, width - w);
var y = randomGaussian(0, height * 0.75, 4);
// Higher clouds move faster
var speedBoost = 1 - (y / (height * 0.75));
var speed = ((Math.random() - 0.5) * 0.05) * (0.5 + speedBoost * 2);
var color = Math.random() > 0.5 ? "255,255,255" : "210,210,190";
var blur = Math.max(Math.min(1 / (Math.abs(speed) * 48), 4), 0); // For parallax
// Pre-render the cloud
var offCanvas = document.createElement("canvas");
var margin = blur;
offCanvas.width = w * pixelSize + 2 * margin;
offCanvas.height = h * pixelSize + 2 * margin;
var offCtx = offCanvas.getContext("2d");
var gradient = offCtx.createLinearGradient(0, margin, 0, h * pixelSize + margin);
gradient.addColorStop(0, `RGBA(${color},0.12)`);
gradient.addColorStop(1, `RGBA(${color},0.24)`);
offCtx.filter = `blur(${blur}px)`;
offCtx.fillStyle = gradient;
offCtx.fillRect(margin, margin, w * pixelSize, h * pixelSize);
clouds.push({ x, y, w, h, speed, color, blur, image: offCanvas, margin });
}
}
function renderClouds(ctx) {
// Fade in
ctx.globalAlpha = Math.min(pixelTicks * 0.02, 1);
for (var i = 0; i < clouds.length; i++) {
var cloud = clouds[i];
ctx.drawImage(
cloud.image,
cloud.x * pixelSize - cloud.margin,
cloud.y * pixelSize - cloud.margin
);
}
}
function updateClouds() {
if (paused) { return; }
if (cloud_count_setting.value != clouds.length) {
clouds = [];
initClouds(cloud_count_setting.value);
return;
}
for (var i = 0; i < clouds.length; i++) {
var cloud = clouds[i];
cloud.x += cloud.speed;
// Wrap around
if (cloud.x > width) {
cloud.x = -cloud.w;
} else if (cloud.x + cloud.w < 0) {
cloud.x = width;
}
}
}
// Hooks
renderPrePixel(renderClouds);
runEveryTick(updateClouds);
var clouds = [];
runAfterReset(() => {
initClouds(cloud_count_setting.value);
});

View File

@ -2,9 +2,9 @@ elements.delete_all_of_element = {
name: "delete all of element",
color: ["#a7a7a7", "#a7a7a7", "#a7a7a7", "#a7a7a7", "#000000", "#000000", "#000000", "#000000"],
tool: function(pixel) {
for (var i = 1; i < width; i++) {
for (var j = 1; j < height; j++) {
if (!isEmpty(i,j)) {
for (var i = 0; i <= width; i++) {
for (var j = 0; j <= height; j++) {
if (!isEmpty(i,j,true)) {
if(pixelMap[i][j].element == pixel.element) {
deletePixel(i,j)
}

View File

@ -327,4 +327,4 @@ renderEachPixel(function(pixel,ctx) {
// if (devtestsCtx2.globalAlpha !== a) { devtestsCtx2.globalAlpha = a; }
// devtestsCtx2.fillRect(pixel.x-r, pixel.y-r, d, d);
// }
})
})

View File

@ -927,9 +927,6 @@ whenAvailable(["eLists","explodeAtPlus","urlParams","runAfterAutogen","mobsLoade
if(enabledMods.includes("mods/chem.js")) {
amalgamatedBombFire += ",FOOF".repeat(8);
};
if(enabledMods.includes("mods/the_ground.js")) {
amalgamatedBombFire += ",liquid_irradium".repeat(7);
};
if(enabledMods.includes("mods/bioooze.js")) {
amalgamatedBombFire += ",bioooze".repeat(8);
};
@ -1187,49 +1184,6 @@ whenAvailable(["eLists","explodeAtPlus","urlParams","runAfterAutogen","mobsLoade
cooldown: defaultCooldown
};
if(enabledMods.includes("mods/the_ground.js")) { //uses things from that but not worth requiring for the whole mod
elements.star_bomb = {
color: "#fffbb5",
properties: {
radius: 50, //just so people can edit it per pixel to be stupidly high
},
tick: function(pixel) {
var starFire = "stellar_plasma,stellar_plasma,stellar_plasma,liquid_stellar_plasma,liquid_stellar_plasma,plasma,plasma";
var starSmoke = "light,light,radiation";
doDefaults(pixel);
if(!isEmpty(pixel.x,pixel.y-1,true)) { //[0][1] EX (ignore bounds)
var newPixel = pixelMap[pixel.x][pixel.y-1];
newPixel.temp += 10000000; //[0][1] HT:10000000
var newElement = newPixel.element;
var newInfo = elements[newElement];
if(newInfo.state !== "gas" && newElement !== pixel.element) {
explodeAtPlus(pixel.x,pixel.y,pixel.radius,starFire,starSmoke,starbombHeat,starbombHeat,false);
};
};
if(!isEmpty(pixel.x,pixel.y+1,true)) { //[2][1] EX (don't ignore bounds, non-bound case)
var newPixel = pixelMap[pixel.x][pixel.y+1];
newPixel.temp += 10000000;
var newElement = newPixel.element;
var newInfo = elements[newElement];
if(newInfo.state !== "gas" && newElement !== pixel.element) {
explodeAtPlus(pixel.x,pixel.y,pixel.radius,starFire,starSmoke,starbombHeat,starbombHeat,false);
};
};
if(outOfBounds(pixel.x,pixel.y+1)) { //[2][1] EX (don't ignore bounds, bound case)
explodeAtPlus(pixel.x,pixel.y,pixel.radius,starFire,starSmoke,starbombHeat,starbombHeat,false);
};
if(!tryMove(pixel,pixel.x,pixel.y+1)) { //behaviors.POWDER
Math.random() < 0.5 ? tryMove(pixel,pixel.x-1,pixel.y+1) : tryMove(pixel,pixel.x+1,pixel.y+1);
};
},
category: "weapons",
state: "solid",
density: 3.663e33,
excludeRandom: true,
cooldown: defaultCooldown
};
};
//Fairies
elements.acid_fairy = {

View File

@ -62,6 +62,7 @@ elements.rad_shard.emit = 2;
elements.rad_shard.emitColor = "#009800";
elements.malware.emit = 2;
elements.border.emit = 2;
elements.void.emit = 10;
viewInfo[1] = { // Blur Glow (Emissive pixels only)
name: "",

View File

@ -1,5 +1,4 @@
// Redbirdly's Mod that adds a better light system
// if the mod is too laggy, use fast_lightmap.js
if (!enabledMods.includes("mods/betterSettings.js")) { enabledMods.unshift("mods/betterSettings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); window.location.reload() };
var lightmap = [];
var nextLightmap = [];
@ -9,12 +8,15 @@ var lightSourceBoost = 2;
var pixelSizeQuarter = pixelSizeHalf / 2;
var falloff = 0.8;
// Define RGB colors
var coldFireColor = [0, 191, 255];
var fireflyColor = [240, 255, 70];
var radColor = [75, 100, 30];
var strangeMatterColor = [220 * 0.3, 255 * 0.3, 210 * 0.3];
var sparkColors = [[255, 210, 120], [255, 140, 10]];
// BetterSettings.js integration
var lightmap_settingsTab = new SettingsTab("Lightmap");
var resolution_setting = new Setting("Resolution (higher number = lower quality)", "resolution", settingType.NUMBER, false, defaultValue=2);
lightmap_settingsTab.registerSettings("Resolution", resolution_setting);
settingsManager.registerTab(lightmap_settingsTab);
function getRandomElement(arr) {
return arr[Math.floor(Math.random() * arr.length)];
@ -22,35 +24,34 @@ function getRandomElement(arr) {
if (!rgbToArray) {
function rgbToArray(colorString) {
if (typeof colorString !== 'string') {
console.error('Invalid colorString:', colorString);
if (typeof colorString !== "string") {
console.error("Invalid colorString:", colorString);
return null;
}
if (colorString.startsWith('rgb')) {
return colorString.slice(4, -1).split(',').map(val => parseInt(val.trim()));
} else if (colorString.startsWith('#')) {
if (colorString.startsWith("rgb")) {
return colorString
.slice(4, -1)
.split(",")
.map(val => parseInt(val.trim()));
} else if (colorString.startsWith("#")) {
let hex = colorString.slice(1);
// Handle shorthand hex (e.g., #03F)
if (hex.length === 3) {
hex = hex.split('').map(char => char + char).join('');
hex = hex
.split("")
.map(char => char + char)
.join("");
}
if (hex.length !== 6) {
console.error('Invalid hex color:', colorString);
console.error("Invalid hex color:", colorString);
return null;
}
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
var r = parseInt(hex.slice(0, 2), 16);
var g = parseInt(hex.slice(2, 4), 16);
var b = parseInt(hex.slice(4, 6), 16);
return [r, g, b];
} else {
console.error('Invalid color format:', colorString);
return null;
}
console.error("Invalid color format:", colorString);
return null;
}
}
@ -59,19 +60,20 @@ function scaleList(numbers, scale) {
}
function initializeLightmap(_width, _height) {
const lightmapWidth = Math.ceil(_width / lightmapScale);
const lightmapHeight = Math.ceil(_height / lightmapScale);
lightmapWidth = Math.ceil(_width / lightmapScale) + 1;
lightmapHeight = Math.ceil(_height / lightmapScale) + 1;
const createLightmapArray = (width, height) =>
Array.from({ length: height }, () =>
Array.from({ length: width }, () => ({ color: [0, 0, 0] }))
);
function createLightmapArray(width_, height_) {
return Array.from({ length: height_ }, () =>
Array.from({ length: width_ }, () => ({ color: [0, 0, 0] }))
);
}
const newLightmap = createLightmapArray(lightmapWidth, lightmapHeight);
const newNextLightmap = createLightmapArray(lightmapWidth, lightmapHeight);
var newLightmap = createLightmapArray(lightmapWidth, lightmapHeight);
var newNextLightmap = createLightmapArray(lightmapWidth, lightmapHeight);
lightmap = newLightmap;
nextLightmap = newNextLightmap;
lightmap = newLightmap;
nextLightmap = newNextLightmap;
}
function deepCopy(source, target) {
@ -88,12 +90,11 @@ function propagateLightmap() {
var width = lightmap[0].length;
var height = lightmap.length;
var neighbors = [
{ dx: 1, dy: 0 },
{ dx: -1, dy: 0 },
{ dx: 0, dy: 1 },
{ dx: 0, dy: -1 },
{ dx: 0, dy: -1 }
];
for (var y = 0; y < height; y++) {
@ -114,9 +115,9 @@ function propagateLightmap() {
nextLightmap[y][x] = {
color: [
Math.min(Math.max(0, totalColor[0] / neighborCount * falloff), 255 * 8),
Math.min(Math.max(0, totalColor[1] / neighborCount * falloff), 255 * 8),
Math.min(Math.max(0, totalColor[2] / neighborCount * falloff), 255 * 8)
Math.min(Math.max(0, (totalColor[0] / neighborCount) * falloff), 255 * 8),
Math.min(Math.max(0, (totalColor[1] / neighborCount) * falloff), 255 * 8),
Math.min(Math.max(0, (totalColor[2] / neighborCount) * falloff), 255 * 8)
]
};
}
@ -126,67 +127,96 @@ function propagateLightmap() {
}
function rgbToHsv(r, g, b) {
r /= 255; g /= 255; b /= 255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, v = max;
r /= 255;
g /= 255;
b /= 255;
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var h, s;
var v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if (max === min) {
h = 0;
} else {
switch (max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return [h, s, v];
}
function hsvToRgb(h, s, v) {
var r, g, b;
var i = Math.floor(h * 6);
var f = h * 6 - i;
var p = v * (1 - s);
var q = v * (1 - f * s);
var t = v * (1 - (1 - f) * s);
var r, g, b;
switch (i % 6) {
case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break;
case 2: r = p; g = v; b = t; break;
case 3: r = p; g = q; b = v; break;
case 4: r = t; g = p; b = v; break;
case 5: r = v; g = p; b = q; break;
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
}
return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
}
function renderLightmapPrePixel(ctx) {
if (!lightmap || !lightmap[0]) return;
if (!lightmap || !lightmap[0]) return;
var _width = lightmap[0].length;
var _height = lightmap.length;
var _width = lightmap[0].length;
var _height = lightmap.length;
for (var y = 0; y < _height; y++) {
for (var x = 0; x < _width; x++) {
var color = lightmap[y][x].color;
var r = color[0];
var g = color[1];
var b = color[2];
for (var y = 0; y < _height; y++) {
for (var x = 0; x < _width; x++) {
var { color } = lightmap[y][x];
var [r, g, b] = color;
if (r > 16 || g > 16 || b > 16) {
var hsv = rgbToHsv(r, g, b);
var newColor = hsvToRgb(hsv[0], hsv[1], 1);
var alpha = hsv[2];
if (r > 16 || g > 16 || b > 16) {
var [h, s, v] = rgbToHsv(r, g, b);
var newColor = hsvToRgb(h, s, 1);
var alpha = v;
ctx.globalAlpha = 1.0;
ctx.fillStyle = `rgba(${newColor[0]}, ${newColor[1]}, ${newColor[2]}, ${alpha * 0.4})`;
ctx.globalAlpha = 1.0;
ctx.fillStyle = `rgba(${newColor[0]}, ${newColor[1]}, ${newColor[2]}, ${alpha * 0.4})`;
ctx.fillRect(
x * pixelSize * lightmapScale,
y * pixelSize * lightmapScale,
@ -201,27 +231,39 @@ function renderLightmapPrePixel(ctx) {
pixelSize * lightmapScale * 2,
pixelSize * lightmapScale * 2
);
}
}
}
}
}
}
}
// Register the function to run before each pixel is rendered
// Main loop
renderPrePixel(function(ctx) {
if (!paused) {propagateLightmap();}
renderLightmapPrePixel(ctx);
// Reset lightmap if resolution changed
if (resolution_setting.value != lightmapScale) {
lightmapScale = resolution_setting.value;
initializeLightmap(width, height);
return;
}
if (!paused) {
propagateLightmap();
}
renderLightmapPrePixel(ctx);
});
function glowItsOwnColor(pixel) {
if (!pixel.color) {return;}
if (!pixel.color) return;
var x = Math.floor(pixel.x / lightmapScale);
var y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: scaleList(rgbToArray(pixel.color), lightSourceBoost) };
try {
lightmap[y][x] = { color: scaleList(rgbToArray(pixel.color), lightSourceBoost) };
} catch (e) {
console.log(e, pixel, pixel.color, rgbToArray(pixel.color), x, y)
}
}
function glowItsOwnColorIfPowered(pixel) {
if (!pixel.charge || pixel.charge <= 0) {return;}
if (!pixel.charge || pixel.charge <= 0) return;
if (!pixel.color) return;
var x = Math.floor(pixel.x / lightmapScale);
var y = Math.floor(pixel.y / lightmapScale);
@ -229,7 +271,7 @@ function glowItsOwnColorIfPowered(pixel) {
}
function glowColor(pixel, color) {
if (!color) {return;}
if (!color) return;
var x = Math.floor(pixel.x / lightmapScale);
var y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: scaleList(color, lightSourceBoost) };
@ -241,7 +283,6 @@ function glowRadiationColor(pixel) {
lightmap[y][x] = { color: scaleList(radColor, lightSourceBoost) };
}
// Define element tick functions
var originalStrangeMatterTick = elements.strange_matter.tick;
elements.strange_matter.tick = function(pixel) {
originalStrangeMatterTick(pixel);
@ -266,9 +307,9 @@ elements.laser.tick = function(pixel) {
glowColor(pixel, scaleList(rgbToArray(pixel.color), 0.5));
};
var originalFireTick2 = elements.fire.tick;
var originalFireTick3 = elements.fire.tick;
elements.fire.tick = function(pixel) {
originalFireTick2(pixel);
originalFireTick3(pixel);
glowItsOwnColor(pixel);
};
@ -287,10 +328,8 @@ elements.rainbow.tick = function(pixel) {
var originalFireflyTick = elements.firefly.tick;
elements.firefly.tick = function(pixel) {
originalFireflyTick(pixel);
var x = Math.floor(pixel.x / lightmapScale);
var y = Math.floor(pixel.y / lightmapScale);
var tickMod = pixelTicks % pixel.fff;
var num;
@ -315,10 +354,8 @@ elements.sun.tick = glowItsOwnColor;
elements.magma.tick = glowItsOwnColor;
elements.plasma.tick = glowItsOwnColor;
elements.fw_ember.tick = glowItsOwnColor;
elements.cold_fire.tick = glowItsOwnColor;
// Radioactive elements
var radioactiveElements = [
"uranium", "radiation", "rad_glass", "fallout",
"molten_uranium", "rad_shard", "rad_cloud", "rad_steam"
@ -327,12 +364,11 @@ radioactiveElements.forEach(element => {
elements[element].tick = glowRadiationColor;
});
window.addEventListener('load', () => {
initializeLightmap(width, height);
var fireflyColor = [240, 255, 70];
var radColor = [75, 100, 30];
var strangeMatterColor = [220 * 0.3, 255 * 0.3, 210 * 0.3];
var sparkColors = [[255, 210, 120], [255, 140, 10]];
var originalResizeCanvas = resizeCanvas;
resizeCanvas = function(newHeight, newWidth, newPixelSize, clear) {
originalResizeCanvas(newHeight, newWidth, newPixelSize, clear);
initializeLightmap(width, height);
};
runAfterReset(() => {
initializeLightmap(width, height);
});

184
mods/liquid_mixing.js Normal file
View File

@ -0,0 +1,184 @@
window.addEventListener('load', function() {
for (var element in elements) {
if (elements[element].state === "liquid" && elements[element].behavior != behaviors.MOLTEN) {
elements[element].renderer = function(pixel, ctx) { // this part used nouseramefounds code, props to him!
drawDefault(ctx,pixel);
if (!viewInfo[view].colorEffects) { return }
if (!pixel.rSeed){pixel.rSeed = [Math.random(), Math.random(), Math.random(), Math.random()]}
if (typeof pixel.color == "object"){
let selectedColor = pixel.color[Math.floor(pixel.rSeed[1]*elements[pixel.element].color.length)]
let rgb = {
r: parseInt(selectedColor.match(/\d+/g)[0]),
g: parseInt(selectedColor.match(/\d+/g)[1]),
b: parseInt(selectedColor.match(/\d+/g)[2])
}
for (let c in rgb){
rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15);
rgb[c] = Math.max(0, Math.min(255, rgb[c]));
}
if (elements[pixel.element].glow || elements[pixel.element].isGas){
drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1);
} else {
drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y);
}
} else {
let rgb = {
r: parseInt(pixel.color.match(/\d+/g)[0]),
g: parseInt(pixel.color.match(/\d+/g)[1]),
b: parseInt(pixel.color.match(/\d+/g)[2])
}
for (let c in rgb){
rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15);
rgb[c] = Math.max(0, Math.min(255, rgb[c]));
}
if (elements[pixel.element].glow || elements[pixel.element].isGas){
drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1);
} else {
drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y);
}
}
}
if (element === "cement" || element === "beans" || element === "algae" || element === "cellulose") {
elements[element].miscible = false
}
if (element === "midas_touch" || element === "cement" || element === "beans" || element === "algae" || element === "cellulose" || element === "primordial_soup" || element === "cyanide" || element === "poison" || element === "antidote" || element === "mercury" || element === "liquid_oxygen" || element === "liquid_nitrogen") {
elements[element].soluble = false
}
if (element === "midas_touch" || element === "molasses" || element === "grease" || element === "oil" || element === "lamp_oil" || element === "nut_oil" || element === "honey" || element === "sap" || element === "caramel") {
elements[element].polar = 2
}
else if (element === "soap" || element === "dye") {
elements[element].polar = 3
}
else {
elements[element].polar = 1
}
if (elements[element].stain === undefined || !elements[element].stain) {
elements[element].stain = 0.000000001
elements[element].mixstain = 0.3
}
else if (elements[element].stain < 0.66 && elements[element].stain > -0.249 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
elements[element].mixstain = (elements[element].stain + 0.25)
}
else if (elements[element].stain < 0.66 && elements[element].stain > -0.35 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
elements[element].mixstain = (Math.abs(elements[element].stain) - 0.1)
}
else if (elements[element].stain < 0.66 && elements[element].stain < -0.35 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
elements[element].mixstain = 0.1
}
else if (elements[element].stain < 0.66 && elements[element].stain < -0.249 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
elements[element].mixstain = 0.125
}
else {
elements[element].mixstain = (0.66)
}
}
}
});
doStaining = function(pixel) {
if (settings.stain===0) { return }
var stain = elements[pixel.element].stain;
var mixstain = elements[pixel.element].mixstain;
if (stain > 0) {
var newColor = pixel.color.match(/\d+/g);
}
else {
var newColor = null;
}
if (mixstain > 0) {
var mixnewColor = pixel.color.match(/\d+/g);
}
else {
var mixnewColor = null;
}
for (var i = 0; i < adjacentCoords.length; i++) {
var x = pixel.x+adjacentCoords[i][0];
var y = pixel.y+adjacentCoords[i][1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
if (elements[pixel.element].ignore && elements[pixel.element].ignore.indexOf(newPixel.element) !== -1) {
continue;
}
if ((elements[newPixel.element].id !== elements[pixel.element].id || elements[newPixel.element].stainSelf) && (solidStates[elements[newPixel.element].state] || elements[newPixel.element].id === elements[pixel.element].id)) {
if (Math.random() < Math.abs(stain)) {
if (stain < 0) {
if (newPixel.origColor) {
newColor = newPixel.origColor;
}
else { continue; }
}
else if (!newPixel.origColor) {
newPixel.origColor = newPixel.color.match(/\d+/g);
}
// if newPixel.color doesn't start with rgb, continue
if (!newPixel.color.match(/^rgb/)) { continue; }
// parse rgb color string of newPixel rgb(r,g,b)
var rgb = newPixel.color.match(/\d+/g);
if (elements[pixel.element].stainSelf && elements[newPixel.element].id === elements[pixel.element].id) {
// if rgb and newColor are the same, continue
if (rgb[0] === newColor[0] && rgb[1] === newColor[1] && rgb[2] === newColor[2]) { continue; }
var avg = [];
for (var j = 0; j < rgb.length; j++) {
avg[j] = Math.round((rgb[j]*(1-Math.abs(stain))) + (newColor[j]*Math.abs(stain)));
}
}
else {
// get the average of rgb and newColor, more intense as stain reaches 1
var avg = [];
for (var j = 0; j < rgb.length; j++) {
avg[j] = Math.floor((rgb[j]*(1-Math.abs(stain))) + (newColor[j]*Math.abs(stain)));
}
}
// set newPixel color to avg
newPixel.color = "rgb("+avg.join(",")+")";
}
}
if ((elements[newPixel.element].id === elements[pixel.element].id || elements[newPixel.element].state === "liquid") && elements[pixel.element].state === "liquid" && elements[pixel.element].miscible !== false && elements[newPixel.element].miscible !== false) {
if (mixstain === undefined || !mixstain) {
var mixstain = 0.5
}
if (Math.random() < mixstain) {
if (elements[newPixel.element].polar === elements[pixel.element].polar || elements[newPixel.element].polar === 3) {
if (!newPixel.origColor) {
newPixel.origColor = newPixel.color.match(/\d+/g);
}
// if newPixel.color doesn't start with rgb, continue
if (!newPixel.color.match(/^rgb/)) { continue; }
// parse rgb color string of newPixel rgb(r,g,b)
var rgb = newPixel.color.match(/\d+/g);
if (elements[newPixel.element].id === elements[pixel.element].id) {
// if rgb and newColor are the same, continue
if (rgb[0] === mixnewColor[0] && rgb[1] === mixnewColor[1] && rgb[2] === mixnewColor[2]) { continue; }
var avg = [];
for (var j = 0; j < rgb.length; j++) {
avg[j] = Math.round((rgb[j]*(1- mixstain)) + (mixnewColor[j] * mixstain));
}
}
else {
// get the average of rgb and newColor, more intense as stain reaches 1
var avg = [];
for (var j = 0; j < rgb.length; j++) {
avg[j] = Math.floor((rgb[j]*(1- mixstain)) + (mixnewColor[j] * mixstain));
}
}
if (Math.random() > 0.9 && elements[newPixel.element].soluble === true && elements[pixel.element].soluble === true && newPixel.color === pixel.color && elements[newPixel.element].density > (elements[pixel.element].density - 20) && elements[newPixel.element].density < (elements[pixel.element].density + 40) && elements[pixel.element].density > (elements[newPixel.element].density - 20) && elements[pixel.element].density < (elements[newPixel.element].density + 40) ) {
if (elements[newPixel.element].density < elements[pixel.element].density) {
newPixel.element = pixel.element
}
else if (elements[newPixel.element].density > elements[pixel.element].density) {
pixel.element = newPixel.element
}
else if (elements[newPixel.element].density == elements[pixel.element].density) {
newPixel.element = pixel.element
}
}
// set newPixel color to avg
newPixel.color = "rgb("+avg.join(",")+")";
}
}
}
}
}
}

View File

@ -1,3 +1,4 @@
elements.mars_gunk = {
color: "#121212",
behavior: behaviors.DGAS,
@ -28,7 +29,8 @@ elements.molten_mars = {
state: "liquid",
hidden: "true",
extraInfo: "The Result of Burnt-up mars stuff. Some turn into this faster more than others.",
temp: 2500
temp: 2500,
density: 1150
}
elements.mars_rock = {
color: ["#a51002","#bd1102"],
@ -49,7 +51,10 @@ elements.mars_debris = {
behavior: behaviors.STURDYPOWDER,
category: "mars",
state: "solid",
density: 1605
density: 1605,
burn: 94,
burnTime: 45,
burnInto: "ash"
}
elements.support_mars_rock = {
color: ["#a51002","#bd1102"],
@ -97,12 +102,14 @@ elements.mars_ironheart = {
density: 1500,
tempHigh: 2500,
hardness: 1,
stateHigh: "molten_mars",
stateHigh: "ironheart",
extraInfo: "Mars Stuff.",
hidden: "true",
reactions: {
"mars_furnace": { elem1: "ironheart", elem2: "ironheart" },
"nosmoker": { elem1: "ironheart", elem2: "ironheart" }, },
"nosmoker": { elem1: "ironheart", elem2: "ironheart" },
"ironheart": { elem1: "ironheart", elem2: "ironheart" , chance:0.1 }
},
}
elements.mars_furnace = {
color: ["#870002","#870507"],
@ -180,14 +187,15 @@ elements.liquid_red_gold = {
state: "liquid",
density: 8,
extraInfo: "Red Gold but a fludid.",
temp: 5500
temp: 5500,
density: 3500
}
elements.liquid_mars_dust = {
color: "#DB3629",
elements.mars_water = {
color: "#F94849",
behavior: behaviors.LIQUID,
category: "archived",
category: "mars",
state: "liquid",
extraInfo: "Mars Dust Fluid. Removed 04/02/25."
density: 997
}
elements.testy = {
color: "#FFFFFF",
@ -196,13 +204,6 @@ elements.testy = {
state: "solid",
extraInfo: "Don't mind me, just a test. Removed 06/02/25?"
}
elements.legacy_liquid_mars_dust = {
color: "#DB3629",
behavior: behaviors.SUPERFLUID,
category: "archived",
state: "liquid",
extraInfo: "Mars Dust Superfluid. Changed at the start."
}
elements.o2_tank = {
color: "#98F5F9",
behavior: [
@ -217,7 +218,7 @@ elements.o2_tank = {
breakInto: ["copper", "oxygen"]
}
// 1.6.9
// 1.7.12
// most elements done :D
// iron heart ore
// iron heart
@ -236,4 +237,5 @@ elements.o2_tank = {
// machines are smashable. please smash them.
// also heatable
// O2 BE YOU
// rover
// mars water
// removed legacy liquid mars dust

View File

@ -124,6 +124,79 @@ elements.corn_starch = {
isFood: true
}
elements.desand = {
color: "#192a88",
tool: function (pixel) {
if (pixel.element === "sand") {
deletePixel(pixel.x,pixel.y)
}
else if (pixel.element === "packed_sand") {
changePixel(pixel,"foam")
}
else if (pixel.element === "color_sand") {
pixel.element = "smoke";
}
else if (pixel.element === "glass") {
deletePixel(pixel.x,pixel.y)
}
else if (pixel.element === "rad_glass") {
changePixel(pixel,"radiation")
}
else if (pixel.element === "glass_shard") {
deletePixel(pixel.x,pixel.y)
}
else if (pixel.element === "rad_shard") {
changePixel(pixel,"radiation")
}
else if (pixel.element === "molten_glass") {
changePixel(pixel,"fire")
}
else if (pixel.element === "molten_rad_glass") {
changePixel(pixel,"fire")
}
else if (pixel.element === 'stained_glass') {
pixel.element = "smoke";
}
else if (pixel.element === "wet_sand") {
changePixel(pixel,"water")
}
else if (pixel.element === "sandstorm") {
if (Math.random() < 0.95) {
pixel.element = "foam";
}
else {
changePixel(pixel,"cloud")
}
}
else if (pixel.element === "tornado") {
if (pixel.fired === "sand") {
pixel.fired = null
pixel.color = pixelColorPick(pixel,elements.tornado.color)
}
}
else if (pixel.element === "concrete") {
if (Math.random() < 0.95) {
pixel.element = "gravel";
}
else {
changePixel(pixel,"oxygen")
}
}
else if (pixel.element === "cement") {
if (Math.random() < 0.80) {
pixel.element = "gravel";
}
else {
changePixel(pixel,"water")
}
}
else if ([pixel.element].startsWith("sand_")) {
deletePixel(pixel.x,pixel.y)
}
},
category: "tools",
}
elements.oobleck = {
color: "#8ef1b8",
tick: function(pixel){
@ -396,7 +469,281 @@ elements.graphite = {
density: 2260,
hardness: 0.99,
breakInto: "graphite_dust",
stain: 0.5
stain: 0.4
}
elements.white_pawn = {
color: "#F2F2CC",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"DL:black_pawn,black_rook,black_bishop,black_knight%0.5|M1%0.5|DL:black_pawn,black_rook,black_bishop,black_knight%0.5",
],
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_pawn = {
color: "#2F2F33",
behavior: [
"DL:white_pawn,white_rook,white_bishop,white_knight%0.5|M1%0.5|DL:white_pawn,white_rook,white_bishop,white_knight%0.5",
"XX|XX|XX",
"XX|XX|XX",
],
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.white_rook = {
color: "#F2F2CC",
behavior: [
"XX|M1%0.5|XX",
"M1%0.5|XX|M1%0.5",
"XX|M1%0.5|XX",
],
reactions: {
"black_pawn": { elem2: null },
"black_rook": { elem2: null },
"black_bishop": { elem2: null },
"black_knight": { elem2: null },
"black_queen": { elem2: null },
"black_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_rook = {
color: "#2F2F33",
behavior: [
"XX|M1%0.5|XX",
"M1%0.5|XX|M1%0.5",
"XX|M1%0.5|XX",
],
reactions: {
"white_pawn": { elem2: null },
"white_rook": { elem2: null },
"white_bishop": { elem2: null },
"white_knight": { elem2: null },
"white_queen": { elem2: null },
"white_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.white_bishop = {
color: "#F2F2CC",
behavior: [
"M1%0.5|XX|M1%0.5",
"XX|XX|XX",
"M1%0.5|XX|M1%0.5",
],
reactions: {
"black_pawn": { elem2: null },
"black_rook": { elem2: null },
"black_bishop": { elem2: null },
"black_knight": { elem2: null },
"black_queen": { elem2: null },
"black_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_bishop = {
color: "#2F2F33",
behavior: [
"M1%0.5|XX|M1%0.5",
"XX|XX|XX",
"M1%0.5|XX|M1%0.5",
],
reactions: {
"white_pawn": { elem2: null },
"white_rook": { elem2: null },
"white_bishop": { elem2: null },
"white_knight": { elem2: null },
"white_queen": { elem2: null },
"white_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.white_knight = {
color: "#F2F2CC",
behavior: [
"XX|M1%0.5|XX|M1%0.5|XX",
"M1%0.5|XX|XX|XX|M1%0.5",
"XX|XX|XX|XX|XX",
"M1%0.5|XX|XX|XX|M1%0.5",
"XX|M1%0.5|XX|M1%0.5|XX",
],
reactions: {
"black_pawn": { elem2: null },
"black_rook": { elem2: null },
"black_bishop": { elem2: null },
"black_knight": { elem2: null },
"black_queen": { elem2: null },
"black_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_knight = {
color: "#2F2F33",
behavior: [
"XX|M1%0.5|XX|M1%0.5|XX",
"M1%0.5|XX|XX|XX|M1%0.5",
"XX|XX|XX|XX|XX",
"M1%0.5|XX|XX|XX|M1%0.5",
"XX|M1%0.5|XX|M1%0.5|XX",
],
reactions: {
"white_pawn": { elem2: null },
"white_rook": { elem2: null },
"white_bishop": { elem2: null },
"white_knight": { elem2: null },
"white_queen": { elem2: null },
"white_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.white_queen = {
color: "#F2F2CC",
behavior: [
"M1%0.5|M1%0.5|M1%0.5",
"M1%0.5|XX|M1%0.5",
"M1%0.5|M1%0.5|M1%0.5",
],
reactions: {
"black_pawn": { elem2: null },
"black_rook": { elem2: null },
"black_bishop": { elem2: null },
"black_knight": { elem2: null },
"black_queen": { elem2: null },
"black_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_queen = {
color: "#2F2F33",
behavior: [
"M1%0.5|M1%0.5|M1%0.5",
"M1%0.5|XX|M1%0.5",
"M1%0.5|M1%0.5|M1%0.5",
],
reactions: {
"white_pawn": { elem2: null },
"white_rook": { elem2: null },
"white_bishop": { elem2: null },
"white_knight": { elem2: null },
"white_queen": { elem2: null },
"white_king": { elem2: "supernova" },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.white_king = {
color: "#F2F2CC",
behavior: [
"M1%0.05|M1%0.05|M1%0.05",
"M1%0.05|XX|M1%0.05",
"M1%0.025|M1%0.025|M1%0.025",
],
reactions: {
"black_pawn": { elem2: null },
"black_rook": { elem2: null },
"black_bishop": { elem2: null },
"black_knight": { elem2: null },
"black_queen": { elem2: null },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.black_king = {
color: "#2F2F33",
behavior: [
"M1%0.025|M1%0.025|M1%0.025",
"M1%0.05|XX|M1%0.05",
"M1%0.05|M1%0.05|M1%0.05",
],
reactions: {
"white_pawn": { elem2: null },
"white_rook": { elem2: null },
"white_bishop": { elem2: null },
"white_knight": { elem2: null },
"white_queen": { elem2: null },
},
tempHigh: 400,
stateHigh: "ember",
category: "chess",
state: "solid",
density: 2260,
hardness: 0.5,
breakInto: "sawdust",
}
elements.graphite_dust = {
@ -414,5 +761,5 @@ elements.graphite_dust = {
category: "powders",
state: "solid",
density: 1830,
stain: 0.5
stain: 0.6
}

View File

@ -1,741 +0,0 @@
var modName = "mods/nellfire.js";
var groundMod = "mods/the_ground.js";
var libHookTickMod = "mods/libhooktick.js";
if(enabledMods.includes(groundMod) && enabledMods.includes(libHookTickMod)) {
function nellsunColor(pixel) {
if (pixel.temp < 0) { pixel.color = pixelColorPick(pixel,"#615e5e"); var c=0 }
else if (pixel.temp < 300) { pixel.color = pixelColorPick(pixel,"#664962"); var c=0 }
else if (pixel.temp < 500) { pixel.color = pixelColorPick(pixel,"#714487"); var c=0.00004 }
else if (pixel.temp < 850) { pixel.color = pixelColorPick(pixel,"#6a43bf"); var c=0.00015 }
else if (pixel.temp < 1300) { pixel.color = pixelColorPick(pixel,"#c356db"); var c=0.0005 }
else if (pixel.temp < 1800) { pixel.color = pixelColorPick(pixel,"#f04ac4"); var c=0.0015 }
else if (pixel.temp < 2100) { pixel.color = pixelColorPick(pixel,"#f788c5"); var c=0.004 }
else if (pixel.temp < 2400) { pixel.color = pixelColorPick(pixel,"#f7a3b8"); var c=0.007 }
else if (pixel.temp < 3200) { pixel.color = pixelColorPick(pixel,"#ffd1d9"); var c=0.01 }
else if (pixel.temp < 3900) { pixel.color = pixelColorPick(pixel,"#fce1e1"); var c=0.02 }
else if (pixel.temp < 4600) { pixel.color = pixelColorPick(pixel,"#fff5f5"); var c=0.035 }
else if (pixel.temp < 6100) { pixel.color = pixelColorPick(pixel,"#ffffff"); var c=0.05 }
else if (pixel.temp < 7200) { pixel.color = pixelColorPick(pixel,"#f4fad9"); var c=0.075 } //new in-between state because the transition is too jarring
else if (pixel.temp < 8300) { pixel.color = pixelColorPick(pixel,"#e4f2c2"); var c=0.1 } //most of these are not real because of the kid named Planckian locus, but it makes it more fun
else if (pixel.temp < 10400) { pixel.color = pixelColorPick(pixel,"#c6f2a2"); var c=0.125 }
else if (pixel.temp < 12500) { pixel.color = pixelColorPick(pixel,"#90f277"); var c=0.15 }
else if (pixel.temp < 15600) { pixel.color = pixelColorPick(pixel,"#75f754"); var c=0.175 }
else if (pixel.temp < 18700) { pixel.color = pixelColorPick(pixel,"#5aff30"); var c=0.2 }
else if (pixel.temp < 21800) { pixel.color = pixelColorPick(pixel,"#1df54f"); var c=0.25 }
else if (pixel.temp < 28900) { pixel.color = pixelColorPick(pixel,"#3ce873"); var c=0.3 }
else if (pixel.temp < 36000) { pixel.color = pixelColorPick(pixel,"#4fdb90"); var c=0.35 }
else if (pixel.temp < 45600) { pixel.color = pixelColorPick(pixel,"#5dcfa7"); var c=0.4 }
else if (pixel.temp < 52200) { pixel.color = pixelColorPick(pixel,"#4fe3af"); var c=0.45 }
else if (pixel.temp < 58300) { pixel.color = pixelColorPick(pixel,"#3cfad4"); var c=0.5 }
else if (pixel.temp < 63400) { pixel.color = pixelColorPick(pixel,"#26f8ff"); var c=0.6 }
else if (pixel.temp < 68500) { pixel.color = pixelColorPick(pixel,"#19d9ff"); var c=0.7 }
else if (pixel.temp < 73600) { pixel.color = pixelColorPick(pixel,"#08b1ff"); var c=0.8 }
else { pixel.color = pixelColorPick(pixel,"#0099ff"); var c=0.9 }
return c;
};
function nellSLAC(pixel,c,whitelist=["sun","nellsun"]) {
for (var i = 0; i < adjacentCoords.length; i++) {
var x = pixel.x+adjacentCoords[i][0];
var y = pixel.y+adjacentCoords[i][1];
if (isEmpty(x,y)) {
if (Math.random() <= c) {
createPixel("light", x, y);
pixelMap[x][y].color = pixel.color;
};
} else if (!outOfBounds(x,y)) {
var newPixel = pixelMap[x][y];
//console.log(whitelist,newPixel.element,whitelist.includes(newPixel.element));
if (pixel.temp!==newPixel.temp && whitelist.includes(newPixel.element)) {
var avg = (pixel.temp + newPixel.temp)/2;
pixel.temp = avg;
newPixel.temp = avg;
pixelTempCheck(pixel);
pixelTempCheck(newPixel);
}
}
}
};
elements.nellsun = {
color: ["#ff26ac", "#ffb8e4", "#ffffff", "#b7ffa8", "#2df7b4"],
tick: function(pixel) {
nellSLAC(pixel,nellsunColor(pixel));
},
reactions: {
"hydrogen": { "elem2":"helium", "temp1":5 },
"helium": { "elem2":"carbon_dioxide", "temp1":5, "tempMax":3600 },
"carbon_dioxide": { "elem2":"neon", "temp1":5, "tempMax":1800 },
},
temp: 5504,
tempLow: -100,
stateLow: "supernova",
category: "special",
state: "gas",
//density: 1408,
insulate: true,
nellfireImmune: true,
};
elements.nellfire = {
color: ["#ff8929","#ffb429","#ffde0a"],
behavior: [
"M1|M1|M1",
"M1%10 AND M2|HT%2|M1%10 AND M2",
"XX|M2|XX"
],
reactions: {
"fire": { "elem2": "nellfire" },
/*"water": { "elem1": "smoke" },
"steam": { "elem1": "smoke" },
"carbon_dioxide": { "elem1": "smoke" },
"dirty_water": { "elem1": "smoke" },
"salt_water": { "elem1": "smoke" },
"sugar_water": { "elem1": "smoke" },*/
},
tick: function(pixel) {
if(pixel.burning) {
delete pixel.burning;
delete pixel.burnStart;
pixel.nellburn = true;
pixel.nellburnStart ??= pixelTicks;
};
},
nellBurningWhenConverted: true,
temp:900,
nellFireSpawnChance: 0,
//tempLow:200,
//stateLow: "smoke",
category: "energy",
burning: true,
nellburnTime: 50,
nellburnInto: null,
state: "gas",
density: 0.06,
ignoreAir: true,
noMix: true,
desc: "Researchers first came into this place and thought it was Hell&mdash; it wasn't, so they renamed it Nell (Not Hell). They still named the materials in it hell references, though.",
},
elements.nellglass = {
color: ["#a161b0", "#b06177", "#b59159"],
behavior: behaviors.WALL,
tempHigh: 1765,
category: "solids",
state: "solid",
density: 5012,
breakInto: "nellglass_shard",
noMix: true,
nellfireImmune: true,
};
elements.dantite = {
color: ["#5effba", "#85edd1", "#62d9c7", "#3efa9c", "#21b9db"],
tempHigh: 2000,
behavior: behaviors.POWDER,
category: "powders",
state: "solid",
density: 1442,
hardness: 0.47,
nellfireImmune: "torch",
};
elements.molten_dantite = {
color: ["#5eff6b", "#70faaa", "#31e08b", "#a1f051"],
density: 4012,
hardness: 0.84,
nellfireImmune: "torch",
};
elements.limtupyte = { //λίμνη τοῦ πυρός
color: ["#212121", "#212121", "#40221f", "#611d14"],
behavior: behaviors.WALL,
category: "solids",
state: "solid",
density: 8012,
hardness: 0.87,
nellfireImmune: true,
tempHigh: 9011,
stateHigh: "alpha_limtupyte",
};
elements.alpha_limtupyte = {
name: "α-limtupyte",
color: ["#6e1414", "#8f210b", "#a34910", "#c27115"],
density: 10112,
behavior: behaviors.MOLTEN,
category: "molten",
hidden: true,
state: "liquid",
hardness: 0.91,
nellfireImmune: true,
temp: 9500,
tempHigh: 11022,
stateHigh: "beta_limtupyte",
tempLow: 9011,
stateLow: "limtupyte",
};
elements.beta_limtupyte = {
name: "β-limtupyte",
color: ["#e68917", "#ffbd24", "#ffe940", "#ffff61"],
density: 13178,
behavior: behaviors.MOLTEN,
category: "molten",
hidden: true,
state: "liquid",
hardness: 0.93,
nellfireImmune: true,
temp: 12000,
tempHigh: 14316,
stateHigh: "limtupyte_gas",
tempLow: 11022,
stateLow: "alpha_limtupyte",
};
elements.limtupyte_gas = {
color: ["#ffff80", "#ffe940", "#feffd1", "#ffffff"],
density: 17.12,
behavior: behaviors.GAS,
category: "states",
hidden: true,
state: "gas",
hardness: 1,
nellfireImmune: true,
temp: 15000,
tempLow: 14316,
stateLow: "beta_limtupyte",
};
elements.nellglass_shard = {
color: ["#7d5f8c","#875966","#9e7b47"],
behavior: behaviors.POWDER,
tempHigh: 1765,
stateHigh: "molten_nellglass",
category: "powders",
state: "solid",
density: 4212,
nellfireImmune: true,
};
elements.nellsand = {
color: ["#906fa8", "#80747a", "#b08464"],
behavior: behaviors.POWDER,
tempHigh: 1911,
stateHigh: "molten_nellglass",
category: "land",
state: "solid",
density: 3742,
_data: ["nellsand_material","nellsand_material","particulate"],
nellfireImmune: true,
};
runAfterLoad(function() {
elements.water.reactions.nellsand = { elem1: null, elem2: "wet_nellsand" };
elements.water.reactions.wet_nellsand = { "elem1": "nellsand_water", "elem2": [ "nellsand", "nellsand", "nellsand", "nellsand_water" ], "chance": 0.01 };
});
elements.wet_nellsand = {
color: sandizeToHex("nellsand","w"),
behavior: behaviors.STURDYPOWDER,
category: "land",
reactions: {
"dirt": { "elem1":"sand", "elem2":"mud", "chance":0.0005, "oneway":true },
},
state: "solid",
tempHigh: 100,
stateHigh: "packed_nellsand",
tempLow: -50,
stateLow:"packed_nellsand",
density: 3742 * 0.595 + 150,
_data: ["nellsand_material","nellsand_material","wet_particulate"],
nellfireImmune: true,
};
elements.packed_nellsand = {
color: sandizeToHex("nellsand","p"),
behavior: behaviors.SUPPORT,
category: "land",
state: "solid",
tempHigh: 1911,
stateHigh: "nellglass",
density: 3742 * 0.59,
breakInto: "nellsand",
_data: ["nellsand_material","nellsand_material","packed_particulate"],
nellfireImmune: true,
};
makeNonSandSedimentationElements("nellsand","nellsand_water","nellsandstone");
nellburnObject = {
"dirt": "nellsand",
"dry_dirt": "nellsand",
"mud": "wet_nellsand",
"mudstone": "packed_nellsand",
"brass": ["nell_ash","zinc"],
"thermite": ["nell_ash","zinc"],
"rose_gold": ["nell_ash","gold"],
"electrum": ["nell_ash","gold"],
"molten_brass": ["nell_ash","molten_zinc"],
"molten_thermite": ["nell_ash","molten_zinc"],
"molten_rose_gold": ["nell_ash","molten_gold"],
"molten_electrum": ["nell_ash","molten_gold"],
"sun": "nellsun",
};
var otherImmunes = ["fire","smoke","plasma","cold_fire","radiation","light","proton","neutron","electron","positron","antimatter","cold_smoke","rad_fire","rad_smoke","laser","liquid_fire","liquid_smoke","liquid_plasma","liquid_cold_fire","liquid_cold_smoke","liquid_rad_fire","liquid_rad_fire","liquid_rad_smoke","le_liquid_light","liquid_laser","pure_ice","pure_water","pure_steam","magic","gold","zinc","molten_gold","molten_zinc","pyreite","infernium","molten_pyreite","molten_infernium","infernyrite","molten_infernyrite","infernyreitheum","molten_infernyreitheum","pyrinfernyreitheum","molten_pyrinfernyreitheum","stellar_plasma","liquid_stellar_plasma","hydrogen","liquid_hydrogen","hydrogen_ice","neutronium","molten_neutronium","liquid_neutronium","neutronium_gas","liquid_degenerate_neutronium","gaseous_degenerate_neutronium"].concat(["water","ice","slush","snow","packed_snow","steam", "heavy_steam","heavy_water","heavy_ice","heavy_snow", "hydrogen_ice","liquid_hydrogen","hydrogen","ionized_hydrogen", "liquid_helium","helium","ionized_helium", "tralphium","liquid_tralphium","ionized_tralphium", "carbon","charcoal","diamond","molten_carbon", "carbon_monoxide","liquid_carbon_monoxide","carbon_monoxide_ice", "carbon_dioxide","dry_ice","seltzer","seltzer_ice","foam"]);
for(let i = 0; i < otherImmunes.length; i++) {
var element = otherImmunes[i];
if(elements[element]) { elements[element].nellfireImmune = true };
};
runAfterLoad(function() {
var rockdataElements = Object.keys(elements).filter(function(name) {
return (
elements[name]._data &&
!["blackened_carbonate","nellish","nellsand_material"].includes(elements[name]._data[0])
)
});
for(i = 0; i < rockdataElements.length; i++) {
name = rockdataElements[i];
var info = elements[name];
switch(info._data[1]) {
case "phanerite":
switch(info._data[2]) {
case "igneous_rock":
nellburnObject[name] = "gehennite"
break;
case "solid_igneous_rock":
nellburnObject[name] = "solid_gehennite"
break;
case "igneous_gravel":
nellburnObject[name] = "gehennite_gravel"
break;
case "particulate":
nellburnObject[name] = "gehennite_sand"
break;
case "dust":
nellburnObject[name] = "gehennite_dust"
break;
case "wet_particulate":
nellburnObject[name] = "wet_gehennite_sand"
break;
case "packed_particulate":
nellburnObject[name] = "packed_gehennite_sand"
break;
case "sediment":
nellburnObject[name] = "gehennite_sand_sediment"
break;
case "suspension":
nellburnObject[name] = "gehennite_sandy_water"
break;
};
break;
case "aphanite":
//console.log(info._data[2]);
switch(info._data[2]) {
case "igneous_rock":
nellburnObject[name] = "nellrock"
break;
case "solid_igneous_rock":
nellburnObject[name] = "solid_nellrock"
break;
case "igneous_gravel":
nellburnObject[name] = "nellrock_gravel"
break;
case "particulate":
nellburnObject[name] = "nellrock_sand"
break;
case "dust":
nellburnObject[name] = "nellrock_dust"
break;
case "wet_particulate":
nellburnObject[name] = "wet_nellrock_sand"
break;
case "packed_particulate":
nellburnObject[name] = "packed_nellrock_sand"
break;
case "sediment":
nellburnObject[name] = "nellrock_sand_sediment"
break;
case "suspension":
nellburnObject[name] = "nellrock_sandy_water"
break;
};
break;
case "vesiculite":
//console.log(info._data[2]);
switch(info._data[2]) {
case "igneous_rock":
nellburnObject[name] = "hadean_sponge"
break;
case "solid_igneous_rock":
nellburnObject[name] = "solid_hadean_sponge"
break;
case "igneous_gravel":
nellburnObject[name] = "hadean_sponge_gravel"
break;
case "particulate":
nellburnObject[name] = "hadean_sponge_sand"
break;
case "dust":
nellburnObject[name] = "hadean_sponge_dust"
break;
case "wet_particulate":
nellburnObject[name] = "wet_hadean_sponge_sand"
break;
case "packed_particulate":
nellburnObject[name] = "packed_hadean_sponge_sand"
break;
case "sediment":
nellburnObject[name] = "hadean_sponge_sand_sediment"
break;
case "suspension":
nellburnObject[name] = "hadean_sponge_sandy_water"
break;
};
break;
case "vitrite":
//console.log(info._data[2]);
switch(info._data[2]) {
case "igneous_rock":
nellburnObject[name] = "gehidian"
break;
case "solid_igneous_rock":
nellburnObject[name] = "solid_gehidian"
break;
case "igneous_gravel":
nellburnObject[name] = "gehidian_gravel"
break;
case "particulate":
nellburnObject[name] = "gehidian_sand"
break;
case "dust":
nellburnObject[name] = "gehidian_dust"
break;
case "wet_particulate":
nellburnObject[name] = "wet_gehidian_sand"
break;
case "packed_particulate":
nellburnObject[name] = "packed_gehidian_sand"
break;
case "sediment":
nellburnObject[name] = "gehidian_sand_sediment"
break;
case "suspension":
nellburnObject[name] = "gehidian_sandy_water"
break;
};
break;
case "phanerite_sandstone":
nellburnObject[name] = "gehennite_sandstone"
break;
case "aphanite_sandstone":
nellburnObject[name] = "nellrock_sandstone"
break;
case "vesiculite_sandstone":
nellburnObject[name] = "hadean_sponge_sandstone"
break;
case "vitrite_sandstone":
nellburnObject[name] = "gehidian_sandstone"
break;
case "silica_sandstone":
nellburnObject[name] = "nellsandstone"
break;
case "magma":
switch(info._data[2]) {
case "liquid":
nellburnObject[name] = "nellish_magma"
break;
case "vaporized":
nellburnObject[name] = "vaporized_nellish_magma"
break;
case "cloud":
nellburnObject[name] = "nellish_magma_cloud"
break;
};
break;
case "rock":
switch(name) {
case "shale":
nellburnObject[name] = "nellsandstone"
break;
case "limestone":
nellburnObject[name] = "black_limestone"
break;
};
break;
case "calcium":
switch(info._data[2]) {
case "particulate":
case "mineral":
nellburnObject[name] = bccd
break;
case "sediment":
nellburnObject[name] = "blackened_calcium_carbonate_dust_sediment"
break;
case "suspension":
nellburnObject[name] = bccs
break;
};
break;
case "silica":
switch(info._data[2]) {
case "particulate":
nellburnObject[name] = "nellsand"
break;
case "wet_particulate":
nellburnObject[name] = "wet_nellsand"
break;
case "packed_particulate":
nellburnObject[name] = "packed_nellsand"
break;
case "suspension":
nellburnObject[name] = "nellsand_water"
break;
case "sediment":
nellburnObject[name] = "nellsand_sediment"
break;
};
break;
case "clay":
switch(info._data[2]) {
case "particulate":
nellburnObject[name] = "nellsand"
break;
case "suspension":
nellburnObject[name] = "nellsand_water"
break;
case "sediment":
nellburnObject[name] = "nellsand_sediment"
break;
};
break;
default:
console.log(name,info._data);
};
};
nellfireSpawnBlacklist = ["nellfire"];
});
elements.nell_ash = {
color: ["#ab9393","#947873"],
behavior: behaviors.POWDER,
/*reactions: {
"steam": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"rain_cloud": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"cloud": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"snow_cloud": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"hail_cloud": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"acid_cloud": { "elem1": "pyrocumulus", "chance":0.05, "y":[0,12], "setting":"clouds" },
"pyrocumulus": { "elem1": "pyrocumulus", "chance":0.08, "y":[0,12], "setting":"clouds" },
"stench": { "elem2":null, "chance":0.1 }
},*/
category:"powders",
state: "solid",
nellfireImmune: true,
tick: function(pixel) {
if(Math.random() < 0.01 && pixel.temp < 25) {
pixel.temp++;
};
},
density: 810,
//tempHigh: 2000,
//forceAutoGen: true,
//stateHigh: ["molten_ash","smoke","smoke","smoke"]
};
elements.wall.nellfireImmune = true;
/*
info.nellfireImmune
info.nellburnTempChange
info.nellFireElement
info.nellFireSpawnTemp
info.nellFireSpawnChance
info.nellburn
info.nellburnInto
info.nellFireColor
*/
function doNellfire(pixel) {
var info = elements[pixel.element];
if((info.nellfireImmune && info.nellfireImmune !== "torch") && pixel.nellburn) {
delete pixel.nellburn;
delete pixel.nellburnStart;
return;
};
if (pixel.nellburn) { // Burning
pixel.nellburnStart ??= pixelTicks;
var nellburnTempChange = info.nellburnTempChange ?? 1;
var fire = info.nellFireElement === undefined ? "nellfire" : info.nellFireElement; //allow null but disallow undefined
//console.log(info.nellFireElement,fire);
while(fire instanceof Array) {
fire = fire[Math.floor(Math.random()*fire.length)];
};
var nellFireTemp = info.nellFireSpawnTemp ?? pixel.temp;
var nellFireChance = info.nellFireSpawnChance ?? 20;
pixel.temp += nellburnTempChange ?? 4;
pixelTempCheck(pixel);
for (var i = 0; i < adjacentCoords.length; i++) { // Burn adjacent pixels
var x = pixel.x+adjacentCoords[i][0];
var y = pixel.y+adjacentCoords[i][1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
var newInfo = elements[newPixel.element];
var spreadChance = newInfo.nellburn ?? 15
if (spreadChance && !newPixel.nellburn) {
if (Math.floor(Math.random()*100) < spreadChance) {
newPixel.nellburn = true;
newPixel.nellburnStart = pixelTicks;
}
}
}
}
if (info.nellfireImmune !== "torch" && (pixelTicks - pixel.nellburnStart > (info.nellburnTime || 150)) && Math.floor(Math.random()*100)<(info.nellburn || 25)) {
var burnInto = info.nellburnInto;
//console.log(burnInto);
if(burnInto === undefined) { burnInto = nellburnObject[pixel.element] };
//console.log(burnInto);
if(burnInto === undefined) { burnInto = [null,"nell_ash"] };
//console.log(burnInto);
while(burnInto instanceof Array) {
burnInto = burnInto[Math.floor(Math.random()*burnInto.length)];
};
//console.log(burnInto);
if(burnInto == null) { deletePixel(pixel.x,pixel.y); return } else { changePixel(pixel,burnInto,burnInto !== "smoke") };
if(!elements[burnInto].nellBurningWhenConverted) {
delete pixel.nellburn;
delete pixel.nellburnStart;
};
//console.log("ass");
pixel.temp = nellFireTemp;
if (info.nellFireColor != undefined && burnInto == "nellfire") {
pixel.color = pixelColorPick(pixel,info.nellFireColor);
}
else {
pixel.color = pixelColorPick(pixel)
}
}
else if (Math.floor(Math.random()*100)<nellFireChance && !nellfireSpawnBlacklist.includes(pixel.element)) { // Spawn fire
//console.log(fire);
if (isEmpty(pixel.x,pixel.y-1)) {
if(fire !== null) {
createPixel(fire,pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].temp = nellFireTemp;
if (info.nellFireColor != undefined) {
pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1],info.nellFireColor);
};
};
}
// same for below if top is blocked
else if (isEmpty(pixel.x,pixel.y+1)) {
if(fire !== null) {
createPixel(fire,pixel.x,pixel.y+1);
pixelMap[pixel.x][pixel.y+1].temp = nellFireTemp;
if (info.nellFireColor != undefined) {
pixelMap[pixel.x][pixel.y+1].color = pixelColorPick(pixelMap[pixel.x][pixel.y+1],info.nellFireColor);
};
};
}
}
}
}
newIgneousCompositionFamily(
"nellish",
10,
3012,
-96,
-12,
3812,
"gehennite",
["#857c71", "#b5a98d", "#91847c", "#948b68", "#8a834a", "#adad34"],
2011,
3432,
"nellrock",
["#a15a42","#997849","#946043","#8c533e","#a66658"],
2036,
3371,
"hadean_sponge",
["#e66785", "#b54761", "#cc8156", "#dbc760", "#ab9a44"],
2213,
1012,
"gehidian",
["#754c2f", "#855d3a", "#702a1c", "#691a41"],
2054,
3112,
1,9
);
var bccd = "blackened_calcium_carbonate_dust";
var bccs = "blackened_calcium_carbonate_solution";
elements.calcium_carbonate_dust.reactions ??= {};
elements.calcium_carbonate_dust.reactions.charcoal = {
elem1: bccd, elem2: [bccd, "charcoal", "charcoal"]
};
newPowder(bccd,"#948e87",2771,804,["carbon_dioxide","quicklime","charcoal","ash"]);
elements[bccd]._data = ["blackened_carbonate","blackened_carbonate","particulate"];
elements[bccd].nellfireImmune = true;
makeNonSandSedimentationElements(bccd,bccs,"black_limestone");
elements.blackened_calcium_carbonate_dust_sediment.color = "#756e64";
elements.blackened_calcium_carbonate_dust_sediment.nellfireImmune = true;
elements.black_limestone.color = "#575148";
elements.black_limestone.stateHigh = ["fire","smoke","charcoal","carbon_dioxide","quicklime","quicklime","quicklime","quicklime","quicklime","quicklime","quicklime","quicklime"];
elements[bccs].nellfireImmune = true;
elements.water.reactions[bccd] = {
"elem1":"calcium_carbonate_solution",
"elem2":[bccd,bccd,bccd,bccs],
"chance":0.004
};
elements.seltzer.reactions[bccd] = {
"elem1":bccs,
"elem2":[bccd,bccd,bccd,bccs],
"chance":0.02
};
var resultingAutoElems = [ "gehennite", "solid_gehennite", "gehennite_gravel", "nellrock", "solid_nellrock", "gehennite_sand", "gehennite_dust", "wet_gehennite_sand", "packed_gehennite_sand", "nellrock_gravel", "nellrock_sand", "nellrock_dust", "wet_nellrock_sand", "packed_nellrock_sand", "hadean_sponge", "solid_hadean_sponge", "hadean_sponge_gravel", "hadean_sponge_sand", "hadean_sponge_dust", "wet_hadean_sponge_sand", "packed_hadean_sponge_sand", "gehidian", "solid_gehidian", "gehidian_shard", "gehidian_sand", "gehidian_dust", "wet_gehidian_sand", "packed_gehidian_sand", "nellish_magma", "vaporized_nellish_magma", "nellish_magma_cloud", "gehennite_sandy_water", "gehennite_sand_sediment", "gehennite_sandstone", "nellrock_sandy_water", "nellrock_sand_sediment", "nellrock_sandstone", "hadean_sponge_sandy_water", "hadean_sponge_sand_sediment", "hadean_sponge_sandstone", "gehidian_sandy_water", "gehidian_sand_sediment", "gehidian_sandstone", bccd, bccs, "black_limestone" ] //hard-coded
runAfterLoad(function() {
for(i = 0; i < resultingAutoElems.length; i++) {
if(!elements[resultingAutoElems[i]]) {
console.error(resultingAutoElems[i]);
continue;
}
elements[resultingAutoElems[i]].nellfireImmune = true;
};
});
everyTick(function() {
if(paused) { return };
var nellfirePixels = currentPixels.filter(function(pixel) { return pixel.nellburn });
for(var pixel in nellfirePixels) {
doNellfire(nellfirePixels[pixel]);
};
});
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,groundMod);
enabledMods.splice(enabledMods.indexOf(modName),0,libHookTickMod);
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${groundMod} and ${libHookTickMod} mods are required and have been automatically inserted (reload for this to take effect).`);
};

View File

@ -315,7 +315,7 @@ elements.destroyable_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("brick",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -626,7 +626,7 @@ elements.e_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("pipe_wall",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -744,7 +744,7 @@ elements.destroyable_e_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("brick",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -871,7 +871,7 @@ elements.channel_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("pipe_wall",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -994,7 +994,7 @@ elements.destroyable_channel_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("brick",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -1111,7 +1111,7 @@ elements.bridge_pipe = {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
createPixel("pipe_wall",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
pixelMap[x][y].color = pixelColorPick(pixel,"#586879");
}
}
pixel.stage = 1;
@ -1215,15 +1215,17 @@ elements.bridge_pipe = {
canContain: true,
insulate: true,
},
elements.pipe.tick = function(pixel) {
elements.pipe.tick = function(pixel) {
if (!pixel.stage && pixelTicks-pixel.start > 60) {
for (var i = 0; i < squareCoords.length; i++) {
var coord = squareCoords[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable && newPixel.element != "ray") {
deletePixel(x,y)
}
if (isEmpty(x,y)) {
createPixel("pipe_wall",x,y);
pixelMap[x][y].color = pixelColorPick(pixel,"#808080");
}
}
pixel.stage = 1;
@ -1321,7 +1323,7 @@ elements.pipe.tick = function(pixel) {
}
}
doDefaults(pixel);
},
}
elements.pipe.insulate = true,
filterTypeVar = 0;
elements.filter = {
@ -1575,8 +1577,6 @@ elements.blackhole_storage = {
tick: function(pixel) {
if (!pixel.bhcontents){
pixel.bhcontents = [];
} else {
pixel.decidedcontent = pixel.bhcontents[Math.floor(Math.random()*pixel.bhcontents.length)];
}
for (var i = 0; i < squareCoords.length; i++) {
var coord = squareCoords[i];
@ -1588,15 +1588,15 @@ elements.blackhole_storage = {
pixel.bhcontents.push(otherPixel);
deletePixel(otherPixel.x, otherPixel.y);
}
} else if (pixel.charge && isEmpty(x,y) && pixel.decidedcontent){
var otherPixel = pixelMap[x][y];
pixel.decidedcontent.x = x;
pixel.decidedcontent.y = y;
delete pixel.decidedcontent.del;
otherPixel = pixel.decidedcontent;
currentPixels.push(pixel.decidedcontent);
pixel.bhcontents.splice(pixel.bhcontents.indexOf(pixel.decidedcontent), 1);
pixel.decidedcontent = pixel.bhcontents[Math.floor(Math.random()*pixel.bhcontents.length)];
} else if (pixel.charge && isEmpty(x,y) && pixel.bhcontents.length){
let randomindex = Math.floor(Math.random()*pixel.bhcontents.length);
let releasedPixel = pixel.bhcontents[randomindex]
pixel.bhcontents.splice(randomindex, 1)
delete releasedPixel.del
releasedPixel.x = x
releasedPixel.y = y
pixelMap[x][y] = releasedPixel
currentPixels.push(releasedPixel)
}
}
},
@ -3795,7 +3795,7 @@ elements.hotter_sensor = {
let pipe_transmitter_channelVar = 0;
elements.pipe_transmitter = {
color: "#6e6250",
category: "machines",
category: "deprecated",
movable: false,
canContain: true,
insulate: true,
@ -3826,7 +3826,7 @@ elements.pipe_transmitter = {
let pipe_receiver_channelVar = 0;
elements.pipe_receiver = {
color: "#4d4b63",
category: "machines",
category: "deprecated",
movable: false,
canContain: true,
insulate: true,
@ -3905,4 +3905,73 @@ elements.false_vacuum = {
},
movable: false,
hardness: 1
}
let signInput = "Hello World!";
elements.sign = {
color: "#FFFFFF",
darkText: true,
category: "special",
onSelect: function(){
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
signInput = signi;
},
renderer: function(pixel, ctx){
if (!pixel.sign){pixel.sign = signInput}
},
movable: false
}
elements.e_sign = {
color: "#f3ff88",
darkText: true,
category: "special",
movable: false,
onSelect: () => {
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
signInput = signi;
},
renderer: function(pixel, ctx){
if (!pixel.sign){pixel.sign=signInput}
},
conduct: 1
}
renderPostPixel(function(ctx){
for (pixel of currentPixels){
if ((pixel.element == "sign") && pixel.sign){
ctx.font = `12pt Arial`
ctx.fillStyle = pixel.color;
ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y))
} else if (pixel.element == "e_sign" && pixel.sign){
if (pixel.charge || pixel.chargeCD){
ctx.font = `12pt Arial`
ctx.fillStyle = pixel.color;
ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y))
} else {
drawSquare(ctx, pixel.color, pixel.x, pixel.y)
}
}
}
})
let machinemodName = "nousersthings.js"
elements.mod_dectector = {
color: "#54681d",
behavior: behaviors.WALL,
category: "machines",
movable: false,
excludeRandom: true,
onSelect: () => {
let newMod = prompt("What mod should this machine detect?", "nousersthings.js"||modName)
machinemodName = newMod
},
tick: (pixel) => {
if (!pixel.mod){pixel.mod = machinemodName}
if (enabledMods.includes("mods/" + pixel.mod)){
for (let i = 0; i < adjacentCoords.length; i++){
let x = adjacentCoords[i][0] + pixel.x;
let y = adjacentCoords[i][1] + pixel.y;
if (!isEmpty(x, y, true) && elements[pixelMap[x][y].element].conduct){
pixelMap[x][y].charge = 1
}
}
}
}
}

View File

@ -1,241 +0,0 @@
var modName = "mods/nellfire.js";
var groundMod = "mods/the_ground.js";
if(enabledMods.includes(groundMod)) {
function makeRegularRainbow(steps,s,l,outputFormat="rgb") {
var hslArray = [];
var divisionSize = 360 / steps;
for(i = 0; i < 360; i += divisionSize) {
hslArray.push({h: i, s: s, l: l});
};
return hslArray.map(x => convertHslObjects(x,outputFormat));
};
function rainbowSunColor(pixel) {
var age = pixelTicks - pixel.start;
var ss, ll;
if (pixel.temp < 0) { ss = 20; ll = 10; var c=0 }
else if (pixel.temp < 300) { ss = 20; ll = 15; var c=0 }
else if (pixel.temp < 500) { ss = 30; ll = 20; var c=0.00003 }
else if (pixel.temp < 850) { ss = 30; ll = 25; var c=0.0001 }
else if (pixel.temp < 1300) { ss = 35; ll = 30; var c=0.0004 }
else if (pixel.temp < 1800) { ss = 40; ll = 35; var c=0.001 }
else if (pixel.temp < 2100) { ss = 45; ll = 40; var c=0.0025 }
else if (pixel.temp < 2400) { ss = 50; ll = 45; var c=0.004 }
else if (pixel.temp < 3200) { ss = 55; ll = 50; var c=0.007 }
else if (pixel.temp < 3900) { ss = 65; ll = 55; var c=0.01 }
else if (pixel.temp < 4600) { ss = 70; ll = 60; var c=0.015 }
else if (pixel.temp < 6100) { ss = 75; ll = 65; var c=0.025 }
else if (pixel.temp < 7200) { ss = 85; ll = 65; var c=0.035 }
else if (pixel.temp < 8300) { ss = 95; ll = 70; var c=0.05 }
else if (pixel.temp < 10400) { ss = 100; ll = 72.5; var c=0.07 }
else if (pixel.temp < 12500) { ss = 100; ll = 75; var c=0.1 }
else if (pixel.temp < 15600) { ss = 100; ll = 77.5; var c=0.125 }
else if (pixel.temp < 18700) { ss = 100; ll = 80; var c=0.15 }
else if (pixel.temp < 21800) { ss = 100; ll = 85; var c=0.175 }
else if (pixel.temp < 28900) { ss = 100; ll = 90; var c=0.2 }
else if (pixel.temp < 36000) { ss = 100; ll = 92.5; var c=0.25 }
else if (pixel.temp < 45600) { ss = 100; ll = 94; var c=0.3 }
else if (pixel.temp < 52200) { ss = 100; ll = 96.5; var c=0.4 }
else if (pixel.temp < 58300) { ss = 100; ll = 98; var c=0.5 }
else if (pixel.temp < 63400) { ss = 100; ll = 98.5; var c=0.6 }
else if (pixel.temp < 68500) { ss = 100; ll = 98.5; var c=0.7 }
else if (pixel.temp < 73600) { ss = 100; ll = 98.5; var c=0.8 }
else { ss = 100; ll = 98.5; var c=0.9 }
var hslJson = {h: (age) % 360, s: ss, l: ll};
pixel.color = pixelColorPick(pixel,convertHslObjects(hslJson,"hex"));
return c;
};
elements.rainbow_sun = {
color: ["#ffbdbd", "#f2ffbd", "#bdffd7", "#bdd7ff", "#f2bdff"],
tick: function(pixel) {
starLightAndConduction(pixel,rainbowSunColor(pixel),["sun","nellsun","rainbow_sun"])
},
reactions: {
"hydrogen": { "elem2":"helium", "temp1":5 },
"helium": { "elem2":"carbon_dioxide", "temp1":5, "tempMax":3600 },
"carbon_dioxide": { "elem2":"neon", "temp1":5, "tempMax":1800 },
},
temp: 5700,
tempLow: -100,
stateLow: "supernova",
category: "special",
state: "gas",
//density: 1408,
insulate: true,
nellfireImmune: true,
};
elements.rainbow_fire = {
color: [
{h: 330, s: 100, l: 56},
{h: 0, s: 100, l: 59},
{h: 22, s: 100, l: 58},
{h: 42, s: 100, l: 57},
{h: 60, s: 100, l: 55},
{h: 73, s: 100, l: 49},
{h: 120, s: 100, l: 49.5},
{h: 159, s: 100, l: 52},
{h: 159, s: 100, l: 52},
{h: 180, s: 100, l: 49.5},
{h: 197, s: 100, l: 59},
{h: 240, s: 100, l: 58.5},
{h: 280, s: 94, l: 53},
{h: 307, s: 100, l: 55}
].map(x => convertHslObjects(x,"hex")),
behavior: behaviors.UL_UR,
reactions: {
"fire": { "elem1": "rainbow_fire" },
"water": { "elem1": "color_smoke" },
"steam": { "elem1": "color_smoke" },
"carbon_dioxide": { "elem1": "color_smoke" },
"dirty_water": { "elem1": "color_smoke" },
"salt_water": { "elem1": "color_smoke" },
"sugar_water": { "elem1": "color_smoke" },
},
nellfireImmune: true,
fireSpawnChance: 0,
temp:610,
tempLow:102,
stateLow: "color_smoke",
tempHigh: 7000,
stateHigh: "plasma",
category: "energy",
burning: true,
burnTime: 44,
burnInto: "color_smoke",
state: "gas",
density: 0.21,
ignoreAir: true,
noMix: true,
};
elements.color_smoke.tempHigh = 610;
elements.color_smoke.stateHigh = "rainbow_fire";
elements.rainbow_glass = {
color: makeRegularRainbow(12,100,70,"hex"),
behavior: behaviors.WALL,
tempHigh: 1765,
category: "solids",
state: "solid",
density: 2711,
breakInto: "rainbow_glass_shard",
noMix: true,
nellfireImmune: true,
};
elements.rainbow_glass_shard = {
color: makeRegularRainbow(18,70,65,"hex"),
behavior: behaviors.POWDER,
tempHigh: 1784,
stateHigh: "molten_rainbow_glass",
category: "powders",
state: "solid",
density: 2213,
nellfireImmune: true,
};
elements.rainbow_sand = {
color: makeRegularRainbow(7,100,94,"hex").concat("#fbfbfb"),
behavior: behaviors.POWDER,
tempHigh: 1731,
stateHigh: "molten_rainbow_glass",
category: "land",
state: "solid",
density: 1733,
_data: ["rainbow_sand_material","rainbow_sand_material","particulate"],
nellfireImmune: true,
};
runAfterLoad(function() {
elements.water.reactions.rainbow_sand = { elem1: null, elem2: "wet_rainbow_sand" };
elements.water.reactions.wet_rainbow_sand = { "elem1": "rainbow_sand_water", "elem2": [ "rainbow_sand", "rainbow_sand", "rainbow_sand", "rainbow_sand_water" ], "chance": 0.01 };
});
elements.wet_rainbow_sand = {
color: makeRegularRainbow(7,100,84,"hex").concat("#e0e0e0"),
behavior: behaviors.STURDYPOWDER,
category: "land",
reactions: {
"dirt": { "elem1":"sand", "elem2":"mud", "chance":0.0005, "oneway":true },
},
state: "solid",
tempHigh: 100,
stateHigh: "packed_rainbow_sand",
tempLow: -50,
stateLow:"packed_rainbow_sand",
density: 1733 * 0.595 + 150,
_data: ["rainbow_sand_material","rainbow_sand_material","wet_particulate"],
nellfireImmune: true,
};
elements.packed_rainbow_sand = {
color: makeRegularRainbow(7,70,86,"hex").concat("#dbdbdb"),
behavior: behaviors.SUPPORT,
category: "land",
state: "solid",
tempHigh: 1731,
stateHigh: "rainbow_glass",
density: 1733 * 0.59,
breakInto: "rainbow_sand",
_data: ["rainbow_sand_material","rainbow_sand_material","packed_particulate"],
nellfireImmune: true,
};
makeNonSandSedimentationElements("rainbow_sand","rainbow_sand_water","rainbow_sandstone");
elements.rainbow_sandstone.color = makeRegularRainbow(14,90,71,"hex").concat("#b5b5b5");
var immunes = ["rainbow_sand_water", "rainbow_sand_sediment", "rainbow_sandstone", "phirite", "solid_phirite", "phirite_gravel", "aphirite", "solid_aphirite", "phirite_sand", "wet_phirite_sand", "packed_phirite_sand", "aphirite_gravel", "aphirite_sand", "wet_aphirite_sand", "packed_aphirite_sand", "vesirite", "solid_vesirite", "vesirite_gravel", "vesirite_sand", "wet_vesirite_sand", "packed_vesirite_sand", "vitirite", "solid_vitirite", "vitirite_shard", "vitirite_sand", "wet_vitirite_sand", "packed_vitirite_sand", "rainbow_magma", "vaporized_rainbow_magma", "rainbow_magma_cloud", "phirite_sandy_water", "phirite_sand_sediment", "phirite_sandstone", "aphirite_sandy_water", "aphirite_sand_sediment", "aphirite_sandstone", "vesirite_sandy_water", "vesirite_sand_sediment", "vesirite_sandstone", "vitirite_sandy_water", "vitirite_sand_sediment", "vitirite_sandstone", "phirite_dust", "aphirite_dust", "vesirite_dust", "vitirite_dust" ];
runAfterLoad(function() {
for(i = 0; i < immunes.length; i++) {
if(!elements[immunes[i]]) {
console.error(immunes[i]);
continue;
}
elements[immunes[i]].nellfireImmune = true;
};
});
newIgneousCompositionFamily(
"rainbow",
133487,
5512,
-71,
-17,
4555,
"phirite",
makeRegularRainbow(6,70,45,"hex"),
1671,
4004,
"aphirite",
makeRegularRainbow(24,63,75,"hex").concat("#bfbfbf"),
1685,
3951,
"vesirite",
makeRegularRainbow(13,55,80,"hex").concat(makeRegularRainbow(13,45,50,"hex")),
1712,
2918,
"vitirite",
makeRegularRainbow(30,70,35,"hex").concat("#595959"),
2054,
3741,
3,7
);
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,groundMod);
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${groundMod} mod is required and has been automatically inserted (reload for this to take effect).`);
};

754
mods/real_light.js Normal file
View File

@ -0,0 +1,754 @@
window.addEventListener('load', function() {
for (var element in elements) {
if (!elements[element].onPlace) {elements[element].onPlace = function(pixel) {
pixel.alphaLight = 0.1
}
}
}
});
day = false
bigCircleCoords = [
[0,-1],
[0,1],
[1,0],
[-1,0],
[1,1],
[1,-1],
[-1,1],
[-1,-1],
[0,-2],
[0,2],
[2,0],
[-2,0],
];
bigCircleCoordsShuffle = bigCircleCoords.slice();
elements.light_switch = {
color: "#d2dfd7",
behavior: [
"CR:photon|CR:photon|CR:photon",
"CR:photon|XX|CR:photon",
"CR:photon|CR:photon|CR:photon",
],
tool: function(pixel) {},
onSelect: function() {
if (day != true) {
day = true
}
else if (day != false) {
day = false
}
selectElement(prevElement);
},
category: "tools",
canPlace: false,
darkText: true,
desc: "Use on pixels to move them around."
}
elements.light = {
color: "#fffdcf",
tick: function(pixel) {
if (Math.random() < 0.01) {
deletePixel(pixel.x,pixel.y);
return;
}
if (pixel.visible < 1000) {
pixel.visible = 10000
}
if (pixel.bx===undefined) {
// choose 1, 0, or -1
pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
// if both are 0, make one of them 1 or -1
if (pixel.bx===0 && pixel.by===0) {
if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; }
else { pixel.by = Math.random() < 0.5 ? 1 : -1; }
}
}
// move and invert direction if hit
if (pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) {
var newX = pixel.x + pixel.bx;
if (!isEmpty(newX, pixel.y, true)) {
var newPixel = pixelMap[pixel.x+pixel.bx][pixel.y];
if (!elements[newPixel.element].insulate) {
newPixel.temp += 1;
pixelTempCheck(newPixel);
}
if (!elements.light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
if (!newPixel.visible) { newPixel.visible = 25 }
else { newPixel.visible += 25 }
if (elements[newPixel.element].state == "liquid" && elements[newPixel.element].movable != false) {
swapPixels(pixel,newPixel)
}
else {pixel.bx = -pixel.bx;}
}
else if (outOfBounds(newX, pixel.y)) {
pixel.bx = -pixel.bx;
}
}
if (pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) {
var newY = pixel.y + pixel.by;
if (!isEmpty(pixel.x, newY, true)) {
var newPixel = pixelMap[pixel.x][pixel.y+pixel.by];
if (!elements[newPixel.element].insulate) {
newPixel.temp += 1;
pixelTempCheck(newPixel);
}
if (!elements.light.reactions[newPixel.element]) {
pixel.color = newPixel.color;
}
if (!newPixel.visible) { newPixel.visible = 25 }
else { newPixel.visible += 25 }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = newPixel.x + coords[0];
var y = newPixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var adjacentPixel = pixelMap[x][y];
if (elements[newPixel.element].id === elements.glass.id || elements[newPixel.element].id === elements.rad_glass.id) {
if (!adjacentPixel.visible) { adjacentPixel.visible = 25 }
else { adjacentPixel.visible += 25 }
}
else {
if (!adjacentPixel.visible) { adjacentPixel.visible = 10 }
else { adjacentPixel.visible += 10 }
}
}
}
if (elements[newPixel.element].state == "liquid" && elements[newPixel.element].movable != false) {
swapPixels(pixel,newPixel)
}
else {pixel.by = -pixel.by;}
}
else if (outOfBounds(pixel.x, newY)) {
pixel.by = -pixel.by;
}
}
},
reactions: {
"glass": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"glass_shard": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rad_glass": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"rad_shard": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"steam": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rain_cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"smog": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"ice": { "color1":"#c2fff9" },
"rime": { "color1":"#c2fff9" },
"water": { "color1":"#a1bac9" },
"salt_water": { "color1":"#a1bac9" },
"sugar_water": { "color1":"#a1bac9" },
"dirty_water": { "color1":"#a1c9a8" },
"seltzer": { "color1":"#c2fff9" },
"diamond": { "color1":["#c2c5ff","#c2d9ff"] },
"rainbow": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"static": { "color1":["#ffffff","#bdbdbd","#808080","#424242","#1c1c1c"] }
},
properties: {
visible: 10000,
},
temp: 35,
tempLow: -273,
stateLow: ["liquid_light",null],
stateLowColorMultiplier: 0.8,
category: "energy",
state: "gas",
density: 0.00001,
ignoreAir: true,
insulate: true,
}
elements.photon = {
color: "#ffffff",
grain: 0,
tick: function(pixel) {
if (Math.random() < 0.01) {
deletePixel(pixel.x,pixel.y);
return;
}
if (pixel.visible < 1000) {
pixel.visible = 10000
}
if (pixel.bx===undefined) {
// choose 1, 0, or -1
pixel.bx = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
pixel.by = Math.random() < 0.5 ? 1 : Math.random() < 0.5 ? 0 : -1;
// if both are 0, make one of them 1 or -1
if (pixel.bx===0 && pixel.by===0) {
if (Math.random() < 0.5) { pixel.bx = Math.random() < 0.5 ? 1 : -1; }
else { pixel.by = Math.random() < 0.5 ? 1 : -1; }
}
}
// move and invert direction if hit
if (pixel.bx && !tryMove(pixel, pixel.x+pixel.bx, pixel.y)) {
var newX = pixel.x + pixel.bx;
if (!isEmpty(newX, pixel.y, true)) {
var newPixel = pixelMap[pixel.x+pixel.bx][pixel.y];
if (!newPixel.visible && elements[newPixel.element].id != elements.photon.id) { newPixel.visible = 25 }
else if (elements[newPixel.element].id != elements.photon.id) { newPixel.visible += 25 }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = newPixel.x + coords[0];
var y = newPixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var adjacentPixel = pixelMap[x][y];
if (elements[adjacentPixel.element].id === elements.glass.id || elements[adjacentPixel.element].id === elements.rad_glass.id || elements[newPixel.element].state == "liquid" || elements[newPixel.element].state == "gas") {
if (!adjacentPixel.visible) { adjacentPixel.visible = 25 }
else { adjacentPixel.visible += 25 }
}
else {
if (!adjacentPixel.visible) { adjacentPixel.visible = 10 }
else { adjacentPixel.visible += 10 }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = adjacentPixel.x + coords[0];
var y = adjacentPixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var adjacentPixel2 = pixelMap[x][y];
if (elements[adjacentPixel.element].id === elements.glass.id || elements[adjacentPixel.element].id === elements.rad_glass.id || elements[newPixel.element].state == "liquid" || elements[newPixel.element].state == "gas") {
if (!adjacentPixel2.visible) { adjacentPixel2.visible = 25 }
else { adjacentPixel2.visible += 25 }
}
else {
if (!adjacentPixel2.visible) { adjacentPixel2.visible = 5 }
else { adjacentPixel2.visible += 5 }
}
}
}
}
}
}
if (elements[newPixel.element].state == "liquid" && elements[newPixel.element].movable != false) {
swapPixels(pixel,newPixel)
}
else {pixel.bx = -pixel.bx;}
}
else if (outOfBounds(newX, pixel.y)) {
pixel.bx = -pixel.bx;
}
}
if (pixel.by && !tryMove(pixel, pixel.x, pixel.y+pixel.by)) {
var newY = pixel.y + pixel.by;
if (!isEmpty(pixel.x, newY, true)) {
var newPixel = pixelMap[pixel.x][pixel.y+pixel.by];
if (!newPixel.visible && elements[newPixel.element].id != elements.photon.id) { newPixel.visible = 25 }
else if (elements[newPixel.element].id != elements.photon.id) { newPixel.visible += 25 }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = newPixel.x + coords[0];
var y = newPixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var adjacentPixel = pixelMap[x][y];
if (elements[adjacentPixel.element].id === elements.glass.id || elements[adjacentPixel.element].id === elements.rad_glass.id || elements[newPixel.element].state == "liquid" || elements[newPixel.element].state == "gas") {
if (!adjacentPixel.visible) { adjacentPixel.visible = 25 }
else { adjacentPixel.visible += 25 }
}
else {
if (!adjacentPixel.visible) { adjacentPixel.visible = 10 }
else { adjacentPixel.visible += 10 }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
var x = adjacentPixel.x + coords[0];
var y = adjacentPixel.y + coords[1];
if (!isEmpty(x,y,true)) {
var adjacentPixel2 = pixelMap[x][y];
if (elements[adjacentPixel.element].id === elements.glass.id || elements[adjacentPixel.element].id === elements.rad_glass.id || elements[newPixel.element].state == "liquid" || elements[newPixel.element].state == "gas") {
if (!adjacentPixel2.visible) { adjacentPixel2.visible = 25 }
else { adjacentPixel2.visible += 25 }
}
else {
if (!adjacentPixel2.visible) { adjacentPixel2.visible = 5 }
else { adjacentPixel2.visible += 5 }
}
}
}
}
}
}
if (elements[newPixel.element].state == "liquid" && elements[newPixel.element].movable != false) {
swapPixels(pixel,newPixel)
}
else {pixel.by = -pixel.by;}
}
else if (outOfBounds(pixel.x, newY)) {
pixel.by = -pixel.by;
}
}
},
temp: 20,
stateLowColorMultiplier: 0.8,
category: "energy",
state: "gas",
density: 0,
ignoreAir: true,
insulate: true,
movable: false
}
elements.liquid_light = {
color: "#bdbc9d",
//behavior: behaviors.SUPERFLUID,
tick: function(pixel) {
if (Math.random() < 0.0001) {
deletePixel(pixel.x,pixel.y);
return;
}
if (pixel.charge && elements[pixel.element].behaviorOn) {
pixelTick(pixel)
}
if (Math.random() < 0.33) { tryMove(pixel, pixel.x, pixel.y+1) }
if (!isEmpty(pixel.x, pixel.y+1)) {
// go either left or right depending on pixel.flipX
var newx = pixel.flipX ? pixel.x-1 : pixel.x+1;
if (Math.random() < 0.5) {
if (!tryMove(pixel, newx, pixel.y)) {
if (!outOfBounds(newx, pixel.y) && !elements.liquid_light.reactions[pixelMap[newx][pixel.y].element]) {
pixel.color = pixelMap[newx][pixel.y].color;
if (!pixelMap[newx][pixel.y].visible) { pixelMap[newx][pixel.y].visible = 25 }
else { pixelMap[newx][pixel.y].visible += 25 }
}
pixel.flipX = !pixel.flipX;
if (!tryMove(pixel, newx, pixel.y+1) && !outOfBounds(newx, pixel.y+1) && !elements.liquid_light.reactions[pixelMap[newx][pixel.y+1].element]) {
pixel.color = pixelMap[newx][pixel.y+1].color;
if (!pixelMap[newx][pixel.y+1].visible) { pixelMap[newx][pixel.y+1].visible = 25 }
else { pixelMap[newx][pixel.y+1].visible += 25 }
}
}
}
else {
if (!tryMove(pixel, newx, pixel.y+1)) {
if (!outOfBounds(newx, pixel.y+1) && !elements.liquid_light.reactions[pixelMap[newx][pixel.y+1].element]) {
pixel.color = pixelMap[newx][pixel.y+1].color;
if (!pixelMap[newx][pixel.y+1].visible) { pixelMap[newx][pixel.y+1].visible = 25 }
else { pixelMap[newx][pixel.y+1].visible += 25 }
}
if (!tryMove(pixel, newx, pixel.y)) {
pixel.flipX = !pixel.flipX;
if (!outOfBounds(newx, pixel.y) && !elements.liquid_light.reactions[pixelMap[newx][pixel.y].element]) {
pixel.color = pixelMap[newx][pixel.y].color;
if (!pixelMap[newx][pixel.y].visible) { pixelMap[newx][pixel.y].visible = 25 }
else { pixelMap[newx][pixel.y].visible += 25 }
}
}
}
}
}
doDefaults(pixel);
},
reactions: {
"glass": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"glass_shard": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rad_glass": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"rad_shard": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"steam": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"rain_cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"cloud": { "color1":["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"] },
"smog": { "color1":["#9f6060","#9f8260","#9f9f60","#609f60","#609f9f","#60609f","#9f609f"] },
"laser": { "color1":"#ff0000" },
},
temp: -273,
tempHigh: -272,
stateHigh: "light",
category: "energy",
state: "gas",
density: 0.00002,
ignoreAir: true,
viscosity: 0,
insulate: true,
hidden: true
}
elements.bless = {
color: ["#ffffff","#fffa9c","#00ffff"],
tool: function(pixel) {
if (elements.bless.ignore.indexOf(pixel.element) !== -1) { return; }
if (pixel.burning && !elements[pixel.element].burning) { // stop burning
delete pixel.burning;
delete pixel.burnStart;
}
if (!elements[pixel.element].insulate) {
if (pixel.temp > 100) {
pixel.temp = (pixel.temp+100)/2;
pixelTempCheck(pixel);
if (pixel.del) {return}
}
if (pixel.temp < -200) {
pixel.temp = (pixel.temp-200)/2;
pixelTempCheck(pixel);
if (pixel.del) {return}
}
}
if (pixel.origColor) {
pixel.color = "rgb("+pixel.origColor.join(",")+")";
delete pixel.origColor;
}
if (pixel.charge) {
delete pixel.charge;
pixel.chargeCD = 16;
}
if (!pixel.visible) {
pixel.visible = 10
}
else {
pixel.visible += 10
}
if (elements.bless.reactions[pixel.element] && Math.random()<0.25) {
var r = elements.bless.reactions[pixel.element];
var elem2 = r.elem2;
if (elem2 !== undefined) {
if (Array.isArray(elem2)) { elem2 = elem2[Math.floor(Math.random()*elem2.length)]; }
if (elem2 === null) { deletePixel(pixel.x,pixel.y) }
else { changePixel(pixel, elem2); }
}
if (r.func) { r.func(pixel,pixel) }
if (r.color2) { pixel.color = pixelColorPick(pixel,r.color2) }
}
},
ignore: ["sun"],
behavior: [
"M2|M1|M2",
"M1|DL%25|M1",
"M2|M1|M2",
],
reactions: {
"cancer": { elem2:null },
"rust": { elem2: "iron" },
"oxidized_copper": { elem2: "copper" },
"blood": { elem2:["antibody",null] },
"blood_ice": { elem2:"antibody_ice" },
"dirty_water": { elem2: "water" },
"plague": { elem2: null },
"virus": { func: function(pixel1,pixel2){pixel2.heal=true} },
"filler": { elem2: "wall" },
"armageddon": { elem2: null },
"lattice": { elem2: "wall" },
"vertical": { elem2: "wall" },
"horizontal": { elem2: "wall" },
"gray_goo": { elem2: "malware" },
"infection": { elem2: ["antibody",null] },
"antibody": { elem2: ["antibody",null] },
"infection_ice": { elem2: "antibody_ice" },
"poison": { elem2: "antidote" },
"poison_gas": { elem2: null },
"poison_ice": { elem2: null },
"rotten_meat": { elem2: "meat" },
"rotten_cheese": { elem2: "cheese", color2:["#B8BA9E","#CDCAB2","#C5CEC0","#7B9691","#41564B"] },
"carbon_dioxide": { elem2: "oxygen" },
"pilk": { elem2: "milk" },
"acid": { elem2: "hydrogen" },
"acid_gas": { elem2: "hydrogen" },
"acid_cloud": { elem2: "rain_cloud" },
"fire_cloud": { elem2: "cloud" },
"ash": { elem2: null },
"molten_ash": { elem2: null },
"pyrocumulus": { elem2: null },
"cyanide": { elem2: null },
"cyanide_gas": { elem2: null },
"ammonia": { elem2: null },
"liquid_ammonia": { elem2: null },
"dioxin": { elem2: null },
"stench": { elem2: null },
"liquid_stench": { elem2: null },
"fragrance": { elem2: null },
"chlorine": { elem2: null },
"anesthesia": { elem2: null },
"oil": { elem2: null },
"bleach": { elem2: null },
"soda": { elem2: "seltzer" },
"ink": { elem2: null },
"dye": { elem2: null },
"color_smoke": { elem2: null },
"spray_paint": { elem2: null },
"cancer": { elem2: null },
"rat": { elem2: null },
"flea": { elem2: null },
"termite": { elem2: null },
"smog": { elem2: "cloud" },
"mercury": { elem2: null },
"slime": { elem2: null },
"broth": { elem2: "water" },
"fire": { elem2: "bless" },
"plasma": { elem2: "bless" },
"grenade": { elem2: "metal_scrap" },
"flashbang": { elem2: "metal_scrap" },
"smoke_grenade": { elem2: "metal_scrap" },
"greek_fire": { elem2: "smoke" },
"nitro": { elem2: null },
"smoke": { elem2: null },
"lightning": { elem2: null },
"electric": { elem2: null },
"positron": { elem2: null },
"antimatter": { elem2: null },
"neutron": { elem2: null },
"proton": { elem2: null },
"radiation": { elem2: "flash" },
"uranium": { elem2: "rock" },
"molten_uranium": { elem2: "magma" },
"magma": { elem2: "rock" },
"mercury": { elem2: null },
"mercury_gas": { elem2: null },
"solid_mercury": { elem2: null },
"ice_nine": { elem2: "ice" },
"strange_matter": { elem2: "neutron" },
"frozen_frog": { elem2: "frog" },
"frozen_worm": { elem2: "worm" },
"molten_thermite": { elem2: "rock" },
"rad_glass": { elem2: "glass" },
"rad_shard": { elem2: "glass_shard" },
"rad_steam": { elem2: "steam" },
"fallout": { elem2: null },
"rad_cloud": { elem2: "rain_cloud" },
"fireball": { elem2: "ball" },
"bone_marrow": { elem2: "bone" },
"fly": { elem2: null },
"dead_bug": { elem2: null },
"dead_plant": { elem2: "plant" },
"wood": { func:function(pixel1,pixel2) {if(pixel2.wc){changePixel(pixel2,"tree_branch")}} },
"slag": { elem2: "rock" },
"molten_slag": { elem2: "magma" },
"laser": { elem2: "light" },
"light": { elem2: "flash" },
"torch": { elem2: "wood" },
"explosion": { elem2: null },
"n_explosion": { elem2: null },
"supernova": { elem2: null },
"pop": { elem2: null },
"ember": { elem2: null },
"fw_ember": { elem2: null },
"pollen": { elem2: null },
"lead": { elem2: "gold" },
"molten_lead": { elem2: "molten_gold" },
"dirt": { elem1: "grass", oneway:true },
"static": { elem2: "rainbow" },
"tornado": { elem2: null },
"tsunami": { elem2: null },
"earthquake": { elem2: null },
"blaster": { elem2: null },
"dust": { elem2: null },
"grease": { elem2: null },
"meat": { elem2: "cured_meat" },
"clay_shard": { elem2:"baked_clay" },
"porcelain_shard": { elem2:"porcelain" },
"glass_shard": { elem2:"glass" },
"gunpowder": { elem2:"charcoal" },
"ruins": { elem2:"rock_wall" },
"warp": { elem2:null },
"midas_touch": { elem2:null },
"web": { elem2:null },
"heat_ray": { elem2:null },
},
temp:20,
state: "gas",
density: 0.001,
canPlace: true,
category: "energy",
stain: -0.5
}
viewInfo[1] = { // Real Light View
name: "",
effects: true,
pixel: function(pixel,ctx) {
if (day != true) {
if (pixel.visible && elements[pixel.element].id != elements.photon.id) {
var a = (settings.textures !== 0) ? pixel.alphaLight : undefined;
if (elements[pixel.element].isGas) {
drawPlus(ctx,pixel.color,pixel.x,pixel.y,undefined,a)
if (pixel.visible > 0 && (elements[pixel.element].emit || pixel.emit) || (elements[pixel.element].glow || pixel.glow) || pixel.bright === true || pixel.charge || pixel.burning || pixel.temp > 1025) {
pixel.visible += 1
}
else if (pixel.visible > 1) {
pixel.visible -= 1
}
if (pixel.visible > 250) {
pixel.visible = 250
}
if (pixel.visible > 100 || pixel.bright || (elements[pixel.element].emit || pixel.emit) || (elements[pixel.element].glow || pixel.glow) || pixel.bright === true || pixel.charge || pixel.burning || pixel.temp > 1025) {
pixel.alphaLight = 1
}
else if (pixel.visible <= 100) {
pixel.alphaLight = (pixel.visible / 100)
if (pixel.alphaLight <= 0.05) {
for (var i = 0; i < squareCoordsShuffle.length; i++) {
var x = pixel.x+squareCoordsShuffle[i][0];
var y = pixel.y+squareCoordsShuffle[i][1];
if (isEmpty(x,y)) {
pixel.alphaLight = 0.1
}
else if (pixel.alphaLight <= 0.025 && !isEmpty(x,y, true)) {
for (var i2 = 0; i2 < bigCircleCoordsShuffle.length; i2++) {
var x2 = pixel.x+bigCircleCoordsShuffle[i2][0];
var y2 = pixel.y+bigCircleCoordsShuffle[i2][1];
if (isEmpty(x2,y2)) {
pixel.alphaLight = 0.05
}
else if (pixel.alphaLight <= 0.015) {
pixel.alphaLight = 0.025
}
}
}
}
}
}
// if (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1)) {}
}
else {
drawSquare(ctx,pixel.color,pixel.x,pixel.y,undefined,a)
if (pixel.visible > 0 && (elements[pixel.element].emit || pixel.emit) || (elements[pixel.element].glow || pixel.glow) || pixel.bright === true || pixel.charge || pixel.burning || pixel.temp > 1025) {
pixel.visible += 1
}
else if (pixel.visible > 1) {
pixel.visible -= 1
}
if (pixel.visible > 250) {
pixel.visible = 250
}
if (pixel.visible > 100 || pixel.bright || (elements[pixel.element].emit || pixel.emit) || (elements[pixel.element].glow || pixel.glow) || pixel.bright === true) {
pixel.alphaLight = 1
}
else if (pixel.visible < 0.5 && (pixel.charge || pixel.burning || pixel.temp > 1025)) {
pixel.alphaLight = 0.5
}
else if (pixel.visible <= 100) {
pixel.alphaLight = (pixel.visible / 100)
if (pixel.alphaLight <= 0.05) {
for (var i = 0; i < squareCoordsShuffle.length; i++) {
var x = pixel.x+squareCoordsShuffle[i][0];
var y = pixel.y+squareCoordsShuffle[i][1];
if (isEmpty(x,y)) {
pixel.alphaLight = 0.1
}
else if (pixel.alphaLight <= 0.025 && !isEmpty(x,y, true)) {
for (var i2 = 0; i2 < bigCircleCoordsShuffle.length; i2++) {
var x2 = pixel.x+bigCircleCoordsShuffle[i2][0];
var y2 = pixel.y+bigCircleCoordsShuffle[i2][1];
if (isEmpty(x2,y2)) {
pixel.alphaLight = 0.05
}
else if (pixel.alphaLight <= 0.015) {
pixel.alphaLight = 0.025
}
}
}
}
}
}
}
if (pixel.charge && view !== 2) { // Yellow glow on charge
if (!elements[pixel.element].colorOn) {
drawSquare(ctx,"rgba(255,255,0,0.5)",pixel.x,pixel.y);
}
}
}
else if (!pixel.visible) {
pixel.visible = 1
}
}
else {
var a = (settings.textures !== 0) ? pixel.alpha : undefined;
if (((elements[pixel.element].isGas && elements[pixel.element].glow !== false) || elements[pixel.element].glow || pixel.glow) && pixel.glow !== false) {
drawPlus(ctx,pixel.color,pixel.x,pixel.y,undefined,a)
// if (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1)) {}
}
else {
drawSquare(ctx,pixel.color,pixel.x,pixel.y,undefined,a)
}
if (pixel.charge && view !== 2) { // Yellow glow on charge
if (!elements[pixel.element].colorOn) {
drawSquare(ctx,"rgba(255,255,0,0.5)",pixel.x,pixel.y);
}
}
}
}
}
elements.light_bulb.behaviorOn = [
"XX|CR:light,photon|XX",
"CR:light,photon|XX|CR:light,photon",
"XX|CR:light,photon|XX",
]
elements.sun.tick = function(pixel) {
// minimum 1726
// maximum 7726
if (pixel.eclipse) { pixel.color = pixelColorPick(pixel,"#FD8C03"); var c=0.01}
else if (pixel.temp < 1500) { pixel.color = pixelColorPick(pixel,"#7a4e43"); }
else if (pixel.temp < 3600) { pixel.color = pixelColorPick(pixel,"#ffbdbd"); var c=0.015 }
else if (pixel.temp < 5000) { pixel.color = pixelColorPick(pixel,"#ffd5bd"); var c=0.025 }
else if (pixel.temp < 7000) { pixel.color = pixelColorPick(pixel,"#ffffbd"); var c=0.05 }
else if (pixel.temp < 11000) { pixel.color = pixelColorPick(pixel,"#f7fff5"); var c=0.1 }
else if (pixel.temp < 28000) { pixel.color = pixelColorPick(pixel,"#bde0ff"); var c=0.2 }
else { pixel.color = pixelColorPick(pixel,"#c3bdff"); var c=0.4 }
if (pixel.temp < 1500) { var c=0 }
for (var i = 0; i < adjacentCoords.length; i++) {
var x = pixel.x+adjacentCoords[i][0];
var y = pixel.y+adjacentCoords[i][1];
if (isEmpty(x,y)) {
if (Math.random() > c) {continue}
if (Math.random() > 0.75) {
createPixel("light", x, y);
pixelMap[x][y].color = pixel.color;
}
else {
createPixel("photon", x, y);
}
}
else if (!outOfBounds(x,y)) {
var newPixel = pixelMap[x][y];
if (elements[newPixel.element].id === elements.sun.id) {
if (pixel.eclipse) { newPixel.eclipse = true }
if (pixel.temp!==newPixel.temp) {
var avg = (pixel.temp + newPixel.temp)/2;
pixel.temp = avg;
newPixel.temp = avg;
pixelTempCheck(pixel);
pixelTempCheck(newPixel);
}
}
}
}
}
elements.sun.tool = function(pixel) {
if (pixel.element === "light" || pixel.element === "photon") {
deletePixel(pixel.x,pixel.y);
}
}
elements.fire.properties = { bright: true }
elements.plasma.properties = { bright: true }
elements.sun.properties = { bright: true }
elements.cold_fire.properties = { bright: true }
elements.laser.properties = { bright: true }
elements.pointer.properties = { bright: true }
elements.flash.properties = { bright: true }
elements.bless.properties = { bright: true }
elements.lightning.properties = { bright: true }
elements.neutron.properties = { bright: true }
elements.proton.properties = { bright: true }
elements.electric.properties = { bright: true }
elements.radiation.properties = { bright: true }
elements.god_ray.properties = { bright: true }
elements.heat_ray.properties = { bright: true }
elements.freeze_ray.properties = { bright: true }
elements.pop.properties = { bright: true }
elements.explosion.properties = { bright: true }
elements.n_explosion.properties = { bright: true }
elements.supernova.properties = { bright: true }
elements.positron.properties = { bright: true }
elements.fw_ember.properties = { bright: true }
elements.ember.properties = { bright: true }
elements.firebal.properties = { bright: true }
elements.blaster.properties = { bright: true }
elements.armageddon.properties = { bright: true }
elements.rad_cloud.properties = { bright: true }
elements.rad_steam.properties = { bright: true }
elements.midas_touch.properties = { bright: true }
elements.malware.properties = { bright: true }
elements.strange_matter.properties = { bright: true }

View File

@ -2,7 +2,7 @@ if (!enabledMods.includes("mods/betterSettings.js")) { enabledMods.unshift("mods
var sky_settingsTab = new SettingsTab("Sky");
var realtime_setting = new Setting("Use real life time for sky", "real_time", settingType.BOOLEAN, false, defaultValue=true);
var realtime_setting = new Setting("Use real life time for sky", "real_time", settingType.BOOLEAN, false, defaultValue=false);
var initial_hour_setting = new Setting("Initial hour", "initial_hour", settingType.NUMBER, false, defaultValue=8);
var ticks_per_hour_setting = new Setting("Ticks per hour", "ticks_per_hour", settingType.NUMBER, false, defaultValue=150);
@ -12,78 +12,80 @@ sky_settingsTab.registerSettings("Ticks per hour", ticks_per_hour_setting);
settingsManager.registerTab(sky_settingsTab);
var hour = initial_hour_setting.value;
function lerpColor(start, end, t) {
return start.map((s, i) => Math.round(s + (end[i] - s) * t));
//function lerpColor(start, end, t) {
// return start.map((s, i) => Math.round(s + (end[i] - s) * t));
//}
// Destructuring makes it faster
function lerpColor([r1, g1, b1], [r2, g2, b2], t) {
return [r1 + (r2 - r1) * t, g1 + (g2 - g1) * t, b1 + (b2 - b1) * t].map(Math.round);
}
function getSkyColors(hour) {
const SKY_COLOR_PAIRS = [
[[0, 0, 15], [0, 0, 30]], // midnight
[[10, 10, 40], [20, 20, 60]],
[[255, 100, 50], [255, 150, 100]],
[[135, 206, 235], [180, 230, 255]],
[[135, 206, 250], [135, 206, 255]],
[[135, 206, 250], [120, 190, 240]],
[[255, 150, 100], [120, 70, 70]],
[[30, 15, 60], [20, 10, 40]],
[[0, 0, 15], [0, 0, 30]], // midnight
];
const SKY_COLOR_PAIRS = [
[[0, 0, 15], [0, 0, 30]], // midnight
[[10, 10, 40], [20, 20, 60]],
[[255, 100, 50], [255, 150, 100]],
[[135, 206, 235], [180, 230, 255]],
[[135, 206, 250], [135, 206, 255]],
[[135, 206, 250], [120, 190, 240]],
[[255, 150, 100], [120, 70, 70]],
[[30, 15, 60], [20, 10, 40]],
[[0, 0, 15], [0, 0, 30]], // midnight
];
// Determine the interval (each interval is 3 hours)
const index = Math.floor(hour / 3);
const t = (hour % 3) / 3;
// Determine the interval (each interval is 3 hours)
const index = Math.floor(hour / 3);
const t = (hour % 3) / 3;
const [bottomStart, topStart] = SKY_COLOR_PAIRS[index];
const [bottomEnd, topEnd] = SKY_COLOR_PAIRS[index + 1];
const [bottomStart, topStart] = SKY_COLOR_PAIRS[index];
const [bottomEnd, topEnd] = SKY_COLOR_PAIRS[index + 1];
return {
skyTop: `rgb(${lerpColor(topStart, topEnd, t).join(", ")})`,
skyBottom: `rgb(${lerpColor(bottomStart, bottomEnd, t).join(", ")})`,
};
return {
skyTop: `rgb(${lerpColor(topStart, topEnd, t).join(", ")})`,
skyBottom: `rgb(${lerpColor(bottomStart, bottomEnd, t).join(", ")})`,
};
}
function renderSky(ctx) {
const { skyTop, skyBottom } = getSkyColors(hour);
const gradient = ctx.createLinearGradient(0, 0, 0, height * pixelSize);
// Get sky colors and make gradient
const { skyTop, skyBottom } = getSkyColors(hour);
const gradient = ctx.createLinearGradient(0, 0, 0, height * pixelSize);
gradient.addColorStop(0, skyTop);
gradient.addColorStop(1, skyBottom);
gradient.addColorStop(0, skyTop);
gradient.addColorStop(1, skyBottom);
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, width * pixelSize, height * pixelSize);
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, (width + 1) * pixelSize, (height + 1) * pixelSize);
}
function updateDayTime() {
if (realtime_setting.value) {
const now = new Date();
hour = now.getHours() + now.getMinutes() / 60;
} else {
hour = (hour + (1 / ticks_per_hour_setting.value)) % 24; // Keep within 0-23
}
if (paused) {return;}
if (realtime_setting.value) {
const now = new Date();
hour = now.getHours() + now.getMinutes() / 60;
} else {
hour = (hour + (1 / ticks_per_hour_setting.value)) % 24; // Keep within 0-23
}
}
// Make sure the sky gets VIP treatment in the render list
// Sky should be first layer
function prioritizeRenderSky() {
const idx = renderPrePixelList.indexOf(renderSky);
if (idx !== -1) {
const [skyFn] = renderPrePixelList.splice(idx, 1);
renderPrePixelList.unshift(skyFn);
}
const idx = renderPrePixelList.indexOf(renderSky);
if (idx !== -1) {
const [skyFn] = renderPrePixelList.splice(idx, 1);
renderPrePixelList.unshift(skyFn);
}
}
// Resetting canvas also resets time
function initializeCanvas() {
const resizeCanvas = autoResizeCanvas;
autoResizeCanvas = (clear) => {
resizeCanvas(clear);
hour = initial_hour_setting.value;
};
function initializeSky() {
hour = initial_hour_setting.value;
}
// Hooks
setTimeout(initializeCanvas, 500);
runAfterReset(initializeSky);
runAfterLoad(prioritizeRenderSky);
runEveryTick(updateDayTime);
renderPrePixel(renderSky);
var hour = initial_hour_setting.value;

View File

@ -1,5 +1,3 @@
elements.slime.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
window.addEventListener("load",function() {
logMessage("stickyslime.js has been renamed. plz install stickystuff.js instead, as thats what it was renamed to.")
})

59
mods/stickystuff.js Normal file
View File

@ -0,0 +1,59 @@
elements.slime.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.honey.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.jelly.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.sap.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.caramel.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.melted_chocolate.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.melted_cheese.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.melted_wax.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.batter.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];
elements.nut_butter.behavior = [
"XX|ST|XX",
"ST AND M2|XX|ST AND M2",
"XX|ST AND M1|XX",
];

View File

@ -1,4 +1,4 @@
var modName = "mods/the_ground.js";
var modName = "mods/structure_test.js";
var libraryMod = "mods/code_library.js";
if(!enabledMods.includes(libraryMod)) {

View File

@ -416,8 +416,8 @@ runAfterLoad(function(){
return;
}
createPixel(currentElement,x,y);
if (elements[currentElement].customColor || elements[currentElement].singleColor) {
pixelMap[x][y].color = pixelColorPick(currentElement,currentColor);
if (pixelMap[x][y] && currentElement === pixelMap[x][y].element && (elements[currentElement].customColor || elements[currentElement].singleColor)) {
pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],currentColorMap[currentElement]);
}
if (elements[currentElement].category !== "tools") { survivalRemove(currentElement,1); }
}

View File

@ -1,7 +1,7 @@
if (!settings.survival) {
settings.survival = {
"wall": 999,
"dirt": 999,
"dirt": 9999,
"sapling": 1,
"seeds": 5,
"ice": 25,
@ -154,7 +154,7 @@ elements.smash.tool = function(pixel) {
elementWorth = {
"gold_coin": 1,
"diamond": 10000,
"diamond": 10000000,
"ketchup": 15,
"jelly": 10,
"soda": 10,
@ -183,7 +183,7 @@ elementWorth = {
"vine": 0.1,
"cactus": 0.1,
"cloner": 0,
"wall": 0,
"wall": 100000,
"fire": 0,
"smoke": 0,
"plasma": 0,
@ -194,7 +194,7 @@ elementWorth = {
"radiation": 0,
"petal": -1,
"cell": -1,
"cancer": -1,
"cancer": 1000000000,
"foam": -1,
}
elements.sell = {

File diff suppressed because it is too large Load Diff

View File

@ -7,80 +7,80 @@ let receivers = [];
let transmitters = [];
function updateLogicLists() {
receivers = [];
transmitters = [];
logicReceivers = [];
receivers = [];
transmitters = [];
logicReceivers = [];
logicTransmitters = [];
for (let i = 0; i < currentPixels.length; i++) {
const pixel = currentPixels[i];
if (pixel.element === "logic_receiver") {
logicReceivers.push(pixel);
} else if (pixel.element === "logic_transmitter") {
logicTransmitters.push(pixel);
} else if (pixel.element === "receiver") {
receivers.push(pixel);
} else if (pixel.element === "transmitter") {
transmitters.push(pixel);
}
}
for (let i = 0; i < currentPixels.length; i++) {
const pixel = currentPixels[i];
if (pixel.element === "logic_receiver") {
logicReceivers.push(pixel);
} else if (pixel.element === "logic_transmitter") {
logicTransmitters.push(pixel);
} else if (pixel.element === "receiver") {
receivers.push(pixel);
} else if (pixel.element === "transmitter") {
transmitters.push(pixel);
}
}
}
// Function to draw lines between linked transmitters and receivers
function drawLinks() {
// Iterate through transmitters and receivers to draw lines for linked channels
for (const transmitter of logicTransmitters) {
for (const receiver of logicReceivers) {
if (transmitter.channel === receiver.channel) {
ctx.beginPath();
ctx.moveTo(transmitter.x * pixelSize + pixelSizeHalf, transmitter.y * pixelSize + pixelSizeHalf);
ctx.lineTo(receiver.x * pixelSize + pixelSizeHalf, receiver.y * pixelSize + pixelSizeHalf);
ctx.strokeStyle = "RGBA(255,255,255,0.2)";
function drawLinks(ctx) {
// Iterate through transmitters and receivers to draw lines for linked channels
for (const transmitter of logicTransmitters) {
for (const receiver of logicReceivers) {
if (transmitter.channel === receiver.channel) {
ctx.beginPath();
ctx.moveTo(transmitter.x * pixelSize + pixelSizeHalf, transmitter.y * pixelSize + pixelSizeHalf);
ctx.lineTo(receiver.x * pixelSize + pixelSizeHalf, receiver.y * pixelSize + pixelSizeHalf);
ctx.strokeStyle = "RGBA(255,255,255,0.2)";
const neighbors = [
{ x: transmitter.x, y: transmitter.y - 1 }, // Top
{ x: transmitter.x, y: transmitter.y + 1 }, // Bottom
{ x: transmitter.x - 1, y: transmitter.y }, // Left
{ x: transmitter.x + 1, y: transmitter.y } // Right
];
const neighbors = [
{ x: transmitter.x, y: transmitter.y - 1 }, // Top
{ x: transmitter.x, y: transmitter.y + 1 }, // Bottom
{ x: transmitter.x - 1, y: transmitter.y }, // Left
{ x: transmitter.x + 1, y: transmitter.y } // Right
];
let highlight = false;
for (const neighbor of neighbors) {
if (
neighbor.x >= 0 && neighbor.x < width &&
neighbor.y >= 0 && neighbor.y < height
) {
const neighborPixel = pixelMap[neighbor.x][neighbor.y];
if (neighborPixel && neighborPixel.lstate > 0) {
highlight = true;
break;
}
}
}
let highlight = false;
for (const neighbor of neighbors) {
if (
neighbor.x >= 0 && neighbor.x < width &&
neighbor.y >= 0 && neighbor.y < height
) {
const neighborPixel = pixelMap[neighbor.x][neighbor.y];
if (neighborPixel && neighborPixel.lstate > 0) {
highlight = true;
break;
}
}
}
if (highlight) {
ctx.strokeStyle = "RGBA(255,200,0,0.4)";
}
ctx.lineWidth = 2;
ctx.stroke();
}
}
}
if (highlight) {
ctx.strokeStyle = "RGBA(255,200,0,0.4)";
}
ctx.lineWidth = 2;
ctx.stroke();
}
}
}
// Iterate through transmitters and receivers to draw lines for linked channels
for (const transmitter of transmitters) {
for (const receiver of receivers) {
if (transmitter._channel === receiver._channel) {
ctx.beginPath();
ctx.moveTo(transmitter.x * pixelSize + pixelSizeHalf, transmitter.y * pixelSize + pixelSizeHalf);
ctx.lineTo(receiver.x * pixelSize + pixelSizeHalf, receiver.y * pixelSize + pixelSizeHalf);
ctx.strokeStyle = "RGBA(0,0,255,0.2)";
ctx.lineWidth = 2;
ctx.stroke();
}
}
}
// Iterate through transmitters and receivers to draw lines for linked channels
for (const transmitter of transmitters) {
for (const receiver of receivers) {
if (transmitter._channel === receiver._channel) {
ctx.beginPath();
ctx.moveTo(transmitter.x * pixelSize + pixelSizeHalf, transmitter.y * pixelSize + pixelSizeHalf);
ctx.lineTo(receiver.x * pixelSize + pixelSizeHalf, receiver.y * pixelSize + pixelSizeHalf);
ctx.strokeStyle = "RGBA(0,0,255,0.2)";
ctx.lineWidth = 2;
ctx.stroke();
}
}
}
}
renderPostPixel(updateLogicLists);

124
style.css
View File

@ -16,6 +16,13 @@ body {
font-family: 'Press Start 2P', 'VT323', Arial;
background-color: #000000;
color: #ffffff;
caret-color: #e6d577;
}
::-moz-selection {
background: #948a54;
}
::selection {
background: #948a54;
}
.pagetitle {
padding: 10px;
@ -29,7 +36,7 @@ a, .saveOption {color: rgb(255, 0, 255);text-decoration: none;}
a:hover, .saveOption:hover {filter: brightness(200%);}
a:active, a:hover:active, .saveOption:active, .saveOption:hover:active {filter: brightness(275%);}
#gameDiv { /*game canvas*/
border: 1px solid #ffffff;
border: 3px solid rgba(255, 255, 255, 0.45);
position: relative;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
@ -37,7 +44,11 @@ a:active, a:hover:active, .saveOption:active, .saveOption:hover:active {filter:
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
margin-top: 15px;
/* margin-top: 15px; */
}
.gameDiv-wide {
margin-top: 0!important;
border: none!important;
}
#game {
image-rendering: pixelated;
@ -94,40 +105,51 @@ kbd {
kbd:active {filter: brightness(70%);}
#infoParent, #modParent, #settingsParent, .menuParent {
display: none;
}
#infoScreen, #modManager, #settingsMenu, .menuScreen {
position: absolute;
border: 1px solid #ffffff;
border: 4px solid #9d9d9d;
left: 50%;
top: 5%;
transform: translate(-50%, 0%);
width: 95%;
height: 50%;
height: 60%;
max-width: 700px;
max-height: 450px;
background-color: rgb(31, 31, 31);
z-index:99999
}
#infoScreen, #modManager, #settingsMenu, .menuScreen {
position: absolute;
height:calc(100% - 20px);
width:calc(100% - 20px);
padding: 10px;
background-color: rgb(31, 31, 31);
overflow-x: hidden;
z-index: 10;
}
#settingsMenu {
#settingsParent {
height: 75%;
max-height: 623px;
}
#infoSearch, #modManagerUrl, #saveButtons {
position: absolute;
bottom: 59.4%;
width: 95%;
#promptParent {
height: 50%;
}
#infoSearch, #modManagerUrl, #promptInput {
position: fixed;
bottom: 0px;
left: 0px;
width: calc(100% - 16px);
max-width: 700px;
height: 50px;
left: 50%;
transform: translate(-50%, 198.5%);
background-color: rgb(66, 66, 66);
color: white;
font-size: 1.5em;
padding: 8px;
font-family: 'Press Start 2P';
z-index: 11;
border: none
}
#infoSearch:focus, #modManagerUrl:focus {
#infoSearch:focus, #modManagerUrl:focus, #promptInput:focus {
outline: none;
}
.menuTitle {
@ -149,7 +171,9 @@ kbd:active {filter: brightness(70%);}
background-color: rgb(100, 33, 33);
padding:5px;
text-align:center;
border: 1px solid #ffffff;
border: 4px solid #9d9d9d;
border-top: none;
border-right: none;
z-index: 12;
}
.XButton:hover {
@ -218,7 +242,7 @@ kbd:active {filter: brightness(70%);}
color: gray;
cursor: not-allowed;
}
#saveFile, #loadFile, #saveConfirm {
#saveFile, #loadFile, #saveConfirm, #promptOK, #promptCancel, #promptConfirm {
background-color: black;
text-align: center;
vertical-align: middle;
@ -227,18 +251,22 @@ kbd:active {filter: brightness(70%);}
position:absolute;
bottom: 0;
cursor: pointer;
border-top: solid white;
border-top: 4px solid #9d9d9d;
}
#saveFile {
#saveConfirm, #promptOK {
bottom: 0;
position: fixed;
}
#saveFile, #promptCancel {
left: 0;
width: 50%;
}
#loadFile {
#loadFile, #promptConfirm {
right: 0;
width: 50%;
border-left: solid white;
border-left: 4px solid #9d9d9d;
}
#saveConfirm {
#saveConfirm, #promptOK {
left: 0;
width: 100%;
}
@ -267,8 +295,8 @@ button, input[type="submit"], input[type="reset"] {
font-size: 1em;
text-shadow: 0.5px 1px 4px #000000;
color: rgba(255, 255, 255, 0.85);
border: 1px solid #797979;
margin: 0px 5px 5px 5px;
border: 2px solid #797979;
margin: 0px 4px 4px 4px;
font-variant: small-caps;
}
#controls button.bright {
@ -286,13 +314,13 @@ button, input[type="submit"], input[type="reset"] {
cursor: not-allowed;
}
#controls button[current="true"], #controls button[on="true"] {
border: 1px solid #ffffff;
border: 2px solid #ffffff;
filter: brightness(110%);
/* box-shadow: 0 5px 15px rgba(255, 255, 255, .4); */
color: rgba(255, 255, 255, 1);
}
#controls .elementButton[current="true"] {
border: 1px solid #00ff00;
border: 2px solid #5ee05e;
box-shadow: 0px 1px 15px rgba(0, 255, 0, .75);
}
#controls button.bright[current="true"] {
@ -318,15 +346,24 @@ button, input[type="submit"], input[type="reset"] {
margin: 0px 5px 0px 5px;
font-size: 0.75em;
height: 1.5em;
width:100%;
line-height: 1.5em;
width:calc(100% - 5px);
/* no wrapping */
white-space: nowrap;
overflow-x: hidden;
overflow-y: hidden;
background-color: black;
}
#stat-pos, #stat-pixels, #stat-shift, #stat-tps, #stat-ticks, #stat-view {
float:left;
}
#stat-view, #stat-element {
#stat-element {
margin-right:10px
}
#stats span {
background-color: rgba(0,0,0,0.1);
}
#stat-view, #stat-element span {
text-transform: uppercase;
}
.redText {
@ -341,6 +378,18 @@ button, input[type="submit"], input[type="reset"] {
#extraInfo {
margin:5px
}
#extraInfo small, #extraInfo p {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
margin-right: 1em;
}
#extraInfo small {
margin-bottom: 10px;
}
.gameDiv-wide .extraInfo-right {
float:right
}
#toolControls, #category-tools {
white-space: nowrap;
overflow-x: auto;
@ -422,11 +471,11 @@ button, input[type="submit"], input[type="reset"] {
position: relative;
z-index:0;
flex-grow: 1;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
border-bottom: 2px solid rgba(255, 255, 255, 0.2);
background-color: #202020;
}
#categoryControls button:not(:last-child) {
border-right: 1px solid rgba(255, 255, 255, 0.4);
border-right: 2px solid rgba(255, 255, 255, 0.2);
}
#categoryControls button[current="true"] {
border: none;
@ -481,7 +530,14 @@ button, input[type="submit"], input[type="reset"] {
width: 97%;
margin-left: 5px;
font-size: 0.75em;
height: 2.5em
height: 2.5em;
line-height: 1;
}
#saveFile, #loadFile {
font-size: small
}
.saveSlot {
font-size: small
}
}
@media screen and (max-width: 600px) {
@ -520,10 +576,10 @@ button, input { /*Disable double tap zoom on mobile devices*/
.settingsButton, select, .toggleInput, #settingsMenu input[type="number"], #settingsMenu input[type="text"], #savePromptMenu input, input[type="email"] {
background-color: black;
vertical-align: middle;
margin-left: 5px;
margin-right: 5px;
border: rgb(150, 150, 150) 1px solid;
padding: 0.5em;
margin-left: 4px;
margin-right: 4px;
border: rgb(150, 150, 150) 2px solid;
padding: 0.4em;
color: white;
font-size: 1em;
font-family: Arial, Helvetica, sans-serif;

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Translation - Sandboxels</title>
<title>Help Translate - Sandboxels</title>
<meta name="description" content="Contribute to Sandboxels by translating strings to other languages you know!">
<meta name="keywords" content="falling sand, elements, pixel art, simulator, powder">
<meta name="author" content="R74n">
@ -58,11 +58,24 @@
<h2>What's This?</h2>
<p><dfn>Sandboxels</dfn> is looking to be translated into other languages to support users outside of English-speaking countries.</p>
<p>To select a different language, scroll below the game and find the <strong>🌐 Language</strong> option. Press the dropdown and select your language. This will refresh the page.</p>
<p>Right now, translation is in <em>BETA</em>, and only supports element and category names. It will be expanded in the future.</p>
<p>Right now, translation is in <em>BETA</em>, and doesn't support every aspect of the game.</p>
<h2>Contribute</h2>
<p>If you speak a language besides English and would like to help translate, send us an email at <a href="mailto:contact@R74n.com?subject=Translator%20Application&body=Language%3A%20%3CEnter%20language%20here%3E%0D%0A%0D%0ALiteracy%20Level%3A%20%3CNative%2C%20Fluent%2C%20or%20Learning%3E%0D%0A%0D%0AOther%20Notes%3A">contact@R74n.com</a> with your language(s) and knowledge level. You should also have a great understanding of English.</p>
<p>To report an error, please submit to the <a href="https://docs.google.com/forms/d/e/1FAIpQLSfyNRsMTnEND8WgZ2GdbKr_ZO1vA2T66p31sXXFua-NqTreFQ/viewform?usp=pp_url&entry.1183178100=Bug+report&entry.1334722887=Translation+Error+in+%3CLanguage%3E:+" target="_blank">Feedback Form</a>.</p>
<p>If you speak a language besides English and would like to help translate, you can! You should have a great understanding of English as well as the language you're contributing.</p>
<p>We use Crowdin to manage the translations. Follow the steps below to help out!</p>
<ol>
<li>Visit the <a href="https://crowdin.com/editor/sandboxels" target="_blank">Sandboxels project</a> on Crowdin. Sign up or log in as necessary.</li>
<li>Select the language you want to translate into from the sidebar.</li>
<li>Enter translated strings in the "Translation" column.</li>
<li>(!!!) <strong>Make sure to submit</strong> your translations by pressing the "Unsaved translations" button (Three lines with a pencil icon) and choosing "Save All".</li>
</ol>
<p>To request a new language, send us an email at <a href="mailto:contact@R74n.com?subject=%5BCrowdin%20Language%20Request%20for%20Sandboxels%5D%20LANGUAGE%20NAME&body=Requesting%20the%20addition%20of%20the%20language%3A%20LANGUAGE%20NAME" target="_blank">contact@R74n.com</a>, or contact us in any other way.</p>
<!-- <p>If you speak a language besides English and would like to help translate, send us an email at <a href="mailto:contact@R74n.com?subject=Translator%20Application&body=Language%3A%20%3CEnter%20language%20here%3E%0D%0A%0D%0ALiteracy%20Level%3A%20%3CNative%2C%20Fluent%2C%20or%20Learning%3E%0D%0A%0D%0AOther%20Notes%3A">contact@R74n.com</a> with your language(s) and knowledge level. You should also have a great understanding of English.</p> -->
<p>To report an error, please submit to the <a href="https://docs.google.com/forms/d/e/1FAIpQLSfyNRsMTnEND8WgZ2GdbKr_ZO1vA2T66p31sXXFua-NqTreFQ/viewform?usp=pp_url&entry.1183178100=Bug+report&entry.1334722887=Translation+Error+in+%3CLanguage%3E:+" target="_blank">Feedback Form</a>, or fix it yourself on Crowdin.</p>
</div>