diff --git a/backgrounds/License.txt b/backgrounds/License.txt
new file mode 100644
index 00000000..673e1aa6
--- /dev/null
+++ b/backgrounds/License.txt
@@ -0,0 +1 @@
+https://craftpix.net/file-licenses/
\ No newline at end of file
diff --git a/backgrounds/sky.png b/backgrounds/sky.png
new file mode 100644
index 00000000..94f4a033
Binary files /dev/null and b/backgrounds/sky.png differ
diff --git a/backgrounds/sky_dark.png b/backgrounds/sky_dark.png
new file mode 100644
index 00000000..2f3cf4bc
Binary files /dev/null and b/backgrounds/sky_dark.png differ
diff --git a/backgrounds/sky_grass.png b/backgrounds/sky_grass.png
new file mode 100644
index 00000000..1b522a83
Binary files /dev/null and b/backgrounds/sky_grass.png differ
diff --git a/backgrounds/sky_pink.png b/backgrounds/sky_pink.png
new file mode 100644
index 00000000..847c9c32
Binary files /dev/null and b/backgrounds/sky_pink.png differ
diff --git a/backgrounds/sky_purple.png b/backgrounds/sky_purple.png
new file mode 100644
index 00000000..d7b84274
Binary files /dev/null and b/backgrounds/sky_purple.png differ
diff --git a/backgrounds/sky_warm.png b/backgrounds/sky_warm.png
new file mode 100644
index 00000000..9d9f1841
Binary files /dev/null and b/backgrounds/sky_warm.png differ
diff --git a/changelog.html b/changelog.html
index 28feec7e..e5d1d6d6 100644
--- a/changelog.html
+++ b/changelog.html
@@ -113,6 +113,137 @@
The original plain text version of this is still maintained.
+[Version 1.13.1 - December 18, 2025 - G&G Hotfix]
+
+~ This is a quick group of bug fixes and improvements following yesterday's update.
++ More Shift-Select functionality:
+ + Fuse can turn into an element after charged
+ + Filler can turn into an element after cloning itself
+ + Heat and Cool tools can specify limits
+ + Paint tool can specify a specific element to paint
+ + Udder can dispense a specific element
+ ~ Distinct border for Shift-Selected element buttons
+~ Chlorine Ice kills Virus like gaseous and liquid forms
+~ When window is shortened vertically, canvas will shrink to fit screen
+[Bug Fixes]
+~ Fixed: 2- and 4-wide brushes aren't possible with scroll wheel
+~ Fixed: Tea doesn't stain Paper very well
+~ Fixed: Fireflies change the color of any pixel they touch
+~ Fixed: Slow Cloner can't clone more than one element with Shift-Select
+~ Fixed: Slow Cloner doesn't immediately grab element
+~ Fixed: E-cloners can clone Walls
+~ Fixed: Outline View uses white outline with custom URL backgrounds
+~ Fixed: Heaters, Coolers, and Cloners can be mixed without holding Shift
+~ Fixed: Language isn't autoselected for Brazilian Portuguese or Chinese
+[Technical]
++ chargePixel(pixel, amount?) helper function to easily shock a pixel
++ burnPixel(pixel) helper function to easily ignite a pixel
+
+
+[Version 1.13 - December 17, 2025 - Gizmos & Gadgets]
+
++ Filter
+ + Only allows the first element it touches to pass
++ Gate
+ + Only allows pixels to pass if electrified
+ + Only conducts electricity into itself and Wire
++ Canvas background images
+ + Some presets and custom image URLs
++ Outline View (Press 5)
++ 2-wide and 4-wide brushes
++ Ruler tool in Special to measure lengths and angles
++ Manual element control
+ + Shift-clicking certain element buttons prompt the user for more information
+ + Erase tool allows only deleting certain elements
+ + Cloners allow multiple comma-separated elements
+ + Filters allow states (solid, liquid, or gas) or multiple elements
+ + Sensors allow sensing specific elements
+ + Portals allow the setting of channels
+ + Void allows only deleting certain elements
+ + Random tool allows pre-selected element choices
+ + Explosion allows custom radius
+ + Antibombs allow pre-selected explosion elements
+~ Replaced LED Red, Green, and Blue with a single customizable LED
+ ~ LEDs in old saves are automatically converted to the new element
+- Merged Superheaters and Freezers with Heaters and Coolers
+ + Heaters can be heated to heat the same as a Superheater
+ + Coolers can be cooled to cool the same as a Freezer
+- Removed Tesla Coil and Shocker
+ ~ These elements in old saves are automatically converted to E-cloners
+~ Drag tool is faster and smoother
+~ Pixelated and colorful button borders
++ Translations for Swedish
++ Partial translations for Japanese, Thai, Arabic, Hebrew, and Viossa
+[Changes]
++ Pipes can transport pixels directly with Filter and Gate
+~ Pipes no longer conduct heat
+~ Brightened blue stage in Pipes
+~ Incomplete pipes darken after being initialized
++ Oxygen can be used to dispose Molten Lead in reactors
++ Electrolysis of raw Salt
++ Smashing hot Cooked Meat releases Grease
++ Worms can compost Lettuce, Tomato, Corn, Pickle, and Bread
++ Rats can eat Spiders
++ Caramel and Herb make peppermint-colored sugar
++ Baking Soda can be made with Lye and Carbon Dioxide
++ Melting Ash with Dirt creates Tuff
+~ Poison Gas no longer makes Slag from molten elements
+~ Perfume can exist at room temperature
+~ Acid doesn't dissolve Mercury or Diamond
+~ Sulfur ignites when hot
+~ All Cloud types can be smashed like Rain Cloud
+~ Thermite burns into less Iron
+~ Rock Wall deletes Light when placed over it for better eclipses
+- Removed Gallium-Sodium reaction
+~ Copper Sulfate reacts with more carbs
+~ Rainbow recipe uses Pointer instead of Flash
+~ Bless deletes Strange Matter instead of turning it into Neutron
++ Static recipe
++ Malware can mix with some metals to create machine parts
++ Tea stains Paper
++ Unique fire color for Tin
+~ Element buttons are consistently spaced on all sides
+~ Recolored Pyrite
+~ Acid has a smoother texture
+~ Purple Gold is slightly more purple
+~ Hyphae and Lichen are grainier
+~ Recolored Random button
+~ Recolored Balloon button
+~ Recolored Confetti button
+~ Recolored Hair button
+~ Recolored Pistil button
+~ Reordered colors in many buttons for consistent "lighting" look
+~ Rice, Candy, Nut Oil, Dye, Rainbow, and Spray Paint buttons display with dark text
++ Firefly alias 'Lightning Bug'
+~ Shortened hiding setting labels
+~ Language should automatically be set from browser preferences (Untested)
+~ Re-saving after saving automatically fills in name, author, and description
+~ Save browser thumbnails are crisper
+~ Steam Deck compliance
+[Technical]
++ 'onShiftSelect' element property, called when selecting element while holding Shift
++ 'onlyConduct' element property, list of the only elements to conduct electricity into
++ 'renderTool' element property, renderer function called once per frame while selected
++ 'updateOrder' element property, prioritizes (positive) or deprioritizes (negative) tick order (integer; default 0)
++ autoResizeRatio(height,width) function (e.g. (16,9))
+~ 'shiftDown' variable is set even when in a menu
+[Bug Fixes]
+~ Fixed: Placing Humans with Replace Mode causes a gory mess
+~ Fixed: Using Human on Cloners cause a gory mess
+~ Fixed: Bottom pixels can be cut off on certain window sizes
+~ Fixed: Line-drawing preview is opaque when using a theme
+~ Fixed: Text in Debug popup can't be selected
+~ Fixed: onClicked passes "unknown" when no element is selected, now passes null
+~ Fixed: onMouseDown doesn't get called on mobile
+~ Fixed: onMouseDown is called when clicking out of a menu
+~ Fixed: Using Heat Ray on Stained Glass can make Rainbows
+~ Fixed: Saves with pipes containing invalid elements fail to load
+~ Fixed: Some Fireflies stay illuminated after hitting another
+~ Fixed: Liquid/gaseous pixels with 'skip' property can be displaced by denser pixels
+~ Fixed: Salt isn't considered a food and can't be eaten by Humans
+~ Fixed: Corn can't be dragged or put into Pipes
+
+
[Version 1.12 - July 17, 2025 - Saves For All]
+ Featured Saves tab
diff --git a/changelog.txt b/changelog.txt
index 080661e4..0c5ebcb5 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -4,6 +4,133 @@ See sneak peaks for upcoming updates on the Discord: https://discord.gg/ejUc6YPQ
A fancier version of this changelog can be found here: https://sandboxels.R74n.com/changelog
+[Version 1.13.1 - December 18, 2025 - G&G Hotfix]
+ ~ This is a quick group of bug fixes and improvements following yesterday's update.
+ + More Shift-Select functionality:
+ + Fuse can turn into an element after charged
+ + Filler can turn into an element after cloning itself
+ + Heat and Cool tools can specify limits
+ + Paint tool can specify a specific element to paint
+ + Udder can dispense a specific element
+ ~ Distinct border for Shift-Selected element buttons
+ ~ Chlorine Ice kills Virus like gaseous and liquid forms
+ ~ When window is shortened vertically, canvas will shrink to fit screen
+ [Bug Fixes]
+ ~ Fixed: 2- and 4-wide brushes aren't possible with scroll wheel
+ ~ Fixed: Tea doesn't stain Paper very well
+ ~ Fixed: Fireflies change the color of any pixel they touch
+ ~ Fixed: Slow Cloner can't clone more than one element with Shift-Select
+ ~ Fixed: Slow Cloner doesn't immediately grab element
+ ~ Fixed: E-cloners can clone Walls
+ ~ Fixed: Outline View uses white outline with custom URL backgrounds
+ ~ Fixed: Heaters, Coolers, and Cloners can be mixed without holding Shift
+ ~ Fixed: Language isn't autoselected for Brazilian Portuguese or Chinese
+ [Technical]
+ + chargePixel(pixel, amount?) helper function to easily shock a pixel
+ + burnPixel(pixel) helper function to easily ignite a pixel
+
+[Version 1.13 - December 17, 2025 - Gizmos & Gadgets]
+ + Filter
+ + Only allows the first element it touches to pass
+ + Gate
+ + Only allows pixels to pass if electrified
+ + Only conducts electricity into itself and Wire
+ + Canvas background images
+ + Some presets and custom image URLs
+ + Outline View (Press 5)
+ + 2-wide and 4-wide brushes
+ + Ruler tool in Special to measure lengths and angles
+ + Manual element control
+ + Shift-clicking certain element buttons prompt the user for more information
+ + Erase tool allows only deleting certain elements
+ + Cloners allow multiple comma-separated elements
+ + Filters allow states (solid, liquid, or gas) or multiple elements
+ + Sensors allow sensing specific elements
+ + Portals allow the setting of channels
+ + Void allows only deleting certain elements
+ + Random tool allows pre-selected element choices
+ + Explosion allows custom radius
+ + Antibombs allow pre-selected explosion elements
+ ~ Replaced LED Red, Green, and Blue with a single customizable LED
+ ~ LEDs in old saves are automatically converted to the new element
+ - Merged Superheaters and Freezers with Heaters and Coolers
+ + Heaters can be heated to heat the same as a Superheater
+ + Coolers can be cooled to cool the same as a Freezer
+ - Removed Tesla Coil and Shocker
+ ~ These elements in old saves are automatically converted to E-cloners
+ ~ Drag tool is faster and smoother
+ ~ Pixelated and colorful button borders
+ + Translations for Swedish
+ + Partial translations for Japanese, Thai, Arabic, Hebrew, and Viossa
+ [Changes]
+ + Pipes can transport pixels directly with Filter and Gate
+ ~ Pipes no longer conduct heat
+ ~ Brightened blue stage in Pipes
+ ~ Incomplete pipes darken after being initialized
+ + Oxygen can be used to dispose Molten Lead in reactors
+ + Electrolysis of raw Salt
+ + Smashing hot Cooked Meat releases Grease
+ + Worms can compost Lettuce, Tomato, Corn, Pickle, and Bread
+ + Rats can eat Spiders
+ + Caramel and Herb make peppermint-colored sugar
+ + Baking Soda can be made with Lye and Carbon Dioxide
+ + Melting Ash with Dirt creates Tuff
+ ~ Poison Gas no longer makes Slag from molten elements
+ ~ Perfume can exist at room temperature
+ ~ Acid doesn't dissolve Mercury or Diamond
+ ~ Sulfur ignites when hot
+ ~ All Cloud types can be smashed like Rain Cloud
+ ~ Thermite burns into less Iron
+ ~ Rock Wall deletes Light when placed over it for better eclipses
+ - Removed Gallium-Sodium reaction
+ ~ Copper Sulfate reacts with more carbs
+ ~ Rainbow recipe uses Pointer instead of Flash
+ ~ Bless deletes Strange Matter instead of turning it into Neutron
+ + Static recipe
+ + Malware can mix with some metals to create machine parts
+ + Tea stains Paper
+ + Unique fire color for Tin
+ ~ Element buttons are consistently spaced on all sides
+ ~ Recolored Pyrite
+ ~ Acid has a smoother texture
+ ~ Purple Gold is slightly more purple
+ ~ Hyphae and Lichen are grainier
+ ~ Recolored Random button
+ ~ Recolored Balloon button
+ ~ Recolored Confetti button
+ ~ Recolored Hair button
+ ~ Recolored Pistil button
+ ~ Reordered colors in many buttons for consistent "lighting" look
+ ~ Rice, Candy, Nut Oil, Dye, Rainbow, and Spray Paint buttons display with dark text
+ + Firefly alias 'Lightning Bug'
+ ~ Shortened hiding setting labels
+ ~ Language should automatically be set from browser preferences (Untested)
+ ~ Re-saving after saving automatically fills in name, author, and description
+ ~ Save browser thumbnails are crisper
+ ~ Steam Deck compliance
+ [Technical]
+ + 'onShiftSelect' element property, called when selecting element while holding Shift
+ + 'onlyConduct' element property, list of the only elements to conduct electricity into
+ + 'renderTool' element property, renderer function called once per frame while selected
+ + 'updateOrder' element property, prioritizes (positive) or deprioritizes (negative) tick order (integer; default 0)
+ + autoResizeRatio(height,width) function (e.g. (16,9))
+ ~ 'shiftDown' variable is set even when in a menu
+ [Bug Fixes]
+ ~ Fixed: Placing Humans with Replace Mode causes a gory mess
+ ~ Fixed: Using Human on Cloners cause a gory mess
+ ~ Fixed: Bottom pixels can be cut off on certain window sizes
+ ~ Fixed: Line-drawing preview is opaque when using a theme
+ ~ Fixed: Text in Debug popup can't be selected
+ ~ Fixed: onClicked passes "unknown" when no element is selected, now passes null
+ ~ Fixed: onMouseDown doesn't get called on mobile
+ ~ Fixed: onMouseDown is called when clicking out of a menu
+ ~ Fixed: Using Heat Ray on Stained Glass can make Rainbows
+ ~ Fixed: Saves with pipes containing invalid elements fail to load
+ ~ Fixed: Some Fireflies stay illuminated after hitting another
+ ~ Fixed: Liquid/gaseous pixels with 'skip' property can be displaced by denser pixels
+ ~ Fixed: Salt isn't considered a food and can't be eaten by Humans
+ ~ Fixed: Corn can't be dragged or put into Pipes
+
[Version 1.12 - July 17, 2025 - Saves For All]
+ Featured Saves tab
+ Discord Saves tab
diff --git a/controls.html b/controls.html
index 8742cb6c..7b47c61b 100644
--- a/controls.html
+++ b/controls.html
@@ -106,6 +106,7 @@
Thermal view 2
Basic view (No effects) 3
Streak view 4
+ Outline view 5
Hide canvas H
Toggle GUI F1
Capture screenshot C or F2
@@ -113,6 +114,7 @@
Close menu or Clear logs Esc
Toggle Replace mode ;
Pick element (Copy properties) Shift + Middle Click
+ Extra manual element controls Shift + Element Button
Select secondary element Z
Select previous element Backspace
diff --git a/controls.txt b/controls.txt
index 65bd0b80..6b41b068 100644
--- a/controls.txt
+++ b/controls.txt
@@ -29,6 +29,7 @@ F or F11 = Toggle Fullscreen
2 = Thermal View
3 = Basic View (No Effects)
4 = Streak View
+5 = Outline View
H = Hide Canvas
F1 = Toggle GUI / HUD
F2 or C = Capture Screenshot
@@ -41,6 +42,7 @@ Ctrl + Shift + O = Reload last save
Escape = Close Menu / Clear Logs
; = Replace Mode
Shift + Mid Click = Pick Element (Copy Properties)
+Shift + Button = Extra manual element controls
Z = Select Secondary Element
Baskspace = Select Previous Element
diff --git a/index.html b/index.html
index 1a10eee9..8d058f87 100644
--- a/index.html
+++ b/index.html
@@ -49,8 +49,8 @@
@@ -78,7 +78,7 @@
"availability":"https://schema.org/InStock"
},
"genre": "Falling-sand game",
- "softwareVersion":"1.11.2",
+ "softwareVersion":"1.13",
"datePublished":"2021-12-15",
"dateCreated":"2021-12-15",
"gameTip":"https://sandboxels.r74n.com/controls",
@@ -167,7 +167,7 @@
POWDER_OLD: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
POWDER: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -189,12 +189,12 @@ POWDER: function(pixel) {
AGPOWDER: [
"M2|M1|M2",
"XX|XX|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
LIQUID_OLD: [
"XX|XX|XX",
"M2|XX|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
LIQUID: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -241,7 +241,7 @@ LIQUID: function(pixel) {
SUPERFLUID_OLD: [
"XX|XX|XX",
"XX|XX|M2 AND BO",
- "XX|M1|M2",
+ "XX|M1|M2"
],
SUPERFLUID: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -269,27 +269,27 @@ SUPERFLUID: function(pixel) {
LIGHTWEIGHT: [
"XX|XX|XX",
"XX|FX%0.25|XX",
- "M2%10|M1%10|M1%10",
+ "M2%10|M1%10|M1%10"
],
SLIDE: [
"XX|XX|XX",
"XX|XX|M2 AND BO",
- "XX|M1|M1",
+ "XX|M1|M1"
],
AGLIQUID: [
"M1|M1|M1",
"M2|XX|M2",
- "XX|XX|XX",
+ "XX|XX|XX"
],
WALL: [
"XX|XX|XX",
"XX|XX|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
UL_UR: [
"M1|M1|M1",
"M2|XX|M2",
- "XX|M2|XX",
+ "XX|M2|XX"
],
UL_UR_OPTIMIZED: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -323,7 +323,7 @@ UL_UR_OPTIMIZED: function(pixel) {
GAS_OLD: [
"M2|M1|M2",
"M1|XX|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
GAS: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -353,7 +353,7 @@ GAS: function(pixel) {
DGAS_OLD: [
"M2|M1|M2",
"M1|DL%5|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
DGAS: function(pixel) {
if (Math.random() < 0.05) {
@@ -365,28 +365,62 @@ DGAS: function(pixel) {
SUPPORT: [
"XX|XX|XX",
"SP|XX|SP",
- "XX|M1|XX",
+ "XX|M1|XX"
],
SUPPORTPOWDER: [
"XX|XX|XX",
"SP|XX|SP",
- "M2|M1|M2",
+ "M2|M1|M2"
],
DELETE: [
"XX|DL|XX",
"DL|XX|DL",
- "XX|DL|XX",
+ "XX|DL|XX"
],
FILL: [
"XX|CL|XX",
"CL|XX|CL",
- "XX|CL|XX",
+ "XX|CL|XX"
],
-CLONER: [
+CLONER_OLD: [
"XX|CF|XX",
"CF|XX|CF",
- "XX|CF|XX",
+ "XX|CF|XX"
],
+CLONER: function(pixel, chance) {
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (!pixel.clone) {
+ if (!isEmpty(x,y,true)) {
+ let newPixel = pixelMap[x][y];
+ if (newPixel.clone) {
+ pixel.clone = newPixel.clone;
+ pixel.temp = newPixel.temp;
+ pixelTempCheck(pixel);
+ }
+ if (elements[pixel.element].ignore && elements[pixel.element].ignore.indexOf(newPixel.element) !== -1) {
+ continue;
+ }
+ if (elements[pixel.element].id === elements[newPixel.element].id) {
+ continue;
+ }
+ pixel.clone = elements[newPixel.element].pickElement || newPixel.element;
+ pixel.temp = newPixel.temp;
+ pixelTempCheck(pixel);
+ }
+ }
+ else if (isEmpty(x,y)) {
+ if (chance && Math.random() > chance) continue;
+ createPixel(pixel.clone.match(/,/) ? choose(pixel.clone.split(",")) : pixel.clone, x, y);
+ if (pixelMap[x][y]) {
+ pixelMap[x][y].temp = pixel.temp;
+ pixelTempCheck(pixelMap[x][y]);
+ }
+ }
+ }
+},
CLONE_ON_CLICK: function(pixel,element) {
if (pixel.clone) return;
if (elements[pixel.element].ignore.indexOf(element) !== -1) return;
@@ -395,6 +429,14 @@ CLONE_ON_CLICK: function(pixel,element) {
pixel.clone = element;
if (elements[element].temp !== undefined) pixel.temp = elements[element].temp;
},
+CLONER_SHIFT_SELECT: function(element) {
+ promptInput("Enter an element to clone. Enter multiple separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { clone:r }
+ if (elements[r] && elements[r].temp !== undefined) currentElementProp.temp = elements[r].temp;
+ }, elemTitleCase(elements[element].name || element));
+},
STAIN_ON_MIX: function(pixel1,pixel2) {
if (elements[pixel1.element].id === elements[pixel2.element].id) return;
if (elements[pixel2.element].isGas) return;
@@ -406,7 +448,7 @@ STAIN_ON_MIX: function(pixel1,pixel2) {
STURDYPOWDER_OLD: [
"XX|XX|XX",
"XX|XX|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
STURDYPOWDER: function(pixel) {
if (pixel.start === pixelTicks) {return}
@@ -420,22 +462,22 @@ STURDYPOWDER: function(pixel) {
SELFDELETE: [
"XX|XX|XX",
"XX|DL|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
FOAM: [
"XX|XX|XX",
"XX|DL%5|XX",
- "M2%25|M1%25|M2%25",
+ "M2%25|M1%25|M2%25"
],
BUBBLE: [
"XX|XX|XX",
"XX|DL%0.25 AND FX%1|M1%5",
- "XX|M1%1|M1%2",
+ "XX|M1%1|M1%2"
],
STICKY: [
"XX|ST|XX",
"ST|XX|ST",
- "XX|ST AND M1|XX",
+ "XX|ST AND M1|XX"
],
MOLTEN: function(pixel) {
if (Math.random() < 0.025 && isEmpty(pixel.x,pixel.y-1)) {
@@ -450,22 +492,22 @@ MOLTEN: function(pixel) {
MOLTEN_OLD: [
"XX|CR:fire%2.5|XX",
"M2|XX|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
RADPOWDER: [
"XX|XX|XX",
"XX|RL:radiation%1|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
RADMOLTEN: [
"XX|CR:fire,fire,fire,radiation%4.5|XX",
"M2 AND CR:radiation%1|XX|M2 AND CR:radiation%1",
- "M1|M1|M1",
+ "M1|M1|M1"
],
RADLIQUID: [
"XX|XX|XX",
"M2|RL:radiation%2|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
BOUNCY: function(pixel) {
if (pixel.bx===undefined) {
@@ -833,12 +875,23 @@ SEEDRISE: function(pixel) {
behavior: [
"HT:2|HT:2|HT:2",
"HT:2|HT:2|HT:2",
- "HT:2|HT:2|HT:2",
+ "HT:2|HT:2|HT:2"
],
+ onShiftSelect: function(element) {
+ promptInput("Enter a maximum temperature (Celsius).", function(r) {
+ r = parseFloat(r);
+ if (isNaN(r)) return;
+ currentElementProp = { max:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tool: function(pixel) {
+ if (currentElementProp && pixel.temp >= currentElementProp.max) return;
+
if (shiftDown) {pixel.temp += elements.heat.temp+(Math.random()*elements.heat.temp*1.5)*20;}
else {pixel.temp += elements.heat.temp+(Math.random()*elements.heat.temp*1.5);}
pixelTempCheck(pixel);
+
+ if (currentElementProp && pixel.temp > currentElementProp.max) pixel.temp = currentElementProp.max
},
temp: 2,
category: "tools",
@@ -851,12 +904,23 @@ SEEDRISE: function(pixel) {
behavior: [
"CO:2|CO:2|CO:2",
"CO:2|CO:2|CO:2",
- "CO:2|CO:2|CO:2",
+ "CO:2|CO:2|CO:2"
],
+ onShiftSelect: function(element) {
+ promptInput("Enter a minimum temperature (Celsius).", function(r) {
+ r = parseFloat(r);
+ if (isNaN(r)) return;
+ currentElementProp = { min:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tool: function(pixel) {
+ if (currentElementProp && pixel.temp <= currentElementProp.min) return;
+
if (shiftDown) {pixel.temp += elements.cool.temp+(Math.random()*elements.cool.temp*1.5)*20;}
else {pixel.temp += elements.cool.temp+(Math.random()*elements.cool.temp*1.5);}
pixelTempCheck(pixel);
+
+ if (currentElementProp && pixel.temp < currentElementProp.min) pixel.temp = currentElementProp.min;
},
temp: -2,
category: "tools",
@@ -866,12 +930,23 @@ SEEDRISE: function(pixel) {
},
"erase": {
color: "#fdb5ff",
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to delete. Enter multiple separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { filter:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
behavior: [
"DL|DL|DL",
"DL|DL|DL",
- "DL|DL|DL",
+ "DL|DL|DL"
],
tool: function(pixel) {
+ if (currentElementProp && currentElementProp.filter &&
+ currentElementProp.filter !== pixel.element &&
+ !currentElementProp.filter.split(",").includes(pixel.element)
+ ) return;
deletePixel(pixel.x,pixel.y);
},
category: "tools",
@@ -883,7 +958,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|SW",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tool: function(pixel) {
if (dragStart === null) {
@@ -908,27 +983,34 @@ SEEDRISE: function(pixel) {
},
perTick: function() {
if (!draggingPixels) { return; }
+ shuffleArray(draggingPixels);
+ draggingPixels.sort((pixel1, pixel2) => {
+ return pixelDistance(pixel1.x, pixel1.y, mousePos.x, mousePos.y) - pixelDistance(pixel2.x, pixel2.y, mousePos.x, mousePos.y);
+ })
for (var j = 0; j < (shiftDown ? 3 : 1); j++) {
for (var i = 0; i < draggingPixels.length; i++) {
var pixel = draggingPixels[i];
- if (pixel.del) { continue }
- const x = pixel.x;
- const y = pixel.y;
- const [mX, mY] = [mousePos.x, mousePos.y];
- const empty = checkForEmptyPixels(x, y);
- let bestVal = Math.sqrt(Math.pow(mX - x, 2) + Math.pow(mY - y, 2));
- let best = null;
- for (const pixelPair of empty) {
- const x_ = x + pixelPair[0];
- const y_ = y + pixelPair[1];
- const c = Math.sqrt(Math.pow(mX - x_, 2) + Math.pow(mY - y_, 2));
- if (c < bestVal) {
- bestVal = c;
- best = pixelPair;
+ let moves = Math.max(1, Math.round(pixelDistance(pixel.x, pixel.y, mousePos.x, mousePos.y) / 10));
+ for (let m = 0; m < moves; m++) {
+ if (pixel.del) { break }
+ const x = pixel.x;
+ const y = pixel.y;
+ const [mX, mY] = [mousePos.x, mousePos.y];
+ const empty = checkForEmptyPixels(x, y);
+ let bestVal = Math.sqrt(Math.pow(mX - x, 2) + Math.pow(mY - y, 2));
+ let best = null;
+ for (const pixelPair of empty) {
+ const x_ = x + pixelPair[0];
+ const y_ = y + pixelPair[1];
+ const c = Math.sqrt(Math.pow(mX - x_, 2) + Math.pow(mY - y_, 2));
+ if (c < bestVal) {
+ bestVal = c;
+ best = pixelPair;
+ }
+ }
+ if (best) {
+ tryMove(pixel, x + best[0], y + best[1], undefined, true);
}
- }
- if (best) {
- tryMove(pixel, x + best[0], y + best[1], undefined, true);
}
}
}
@@ -959,10 +1041,10 @@ SEEDRISE: function(pixel) {
behavior: [
"CF|CF|CF",
"CF|DL%5|CF",
- "CF|CF|CF",
+ "CF|CF|CF"
],
category: "tools",
- maxSize: 0,
+ maxSize: 1,
darkText: true,
canPlace: false,
desc: "Use on a pixel to select its element."
@@ -972,7 +1054,7 @@ SEEDRISE: function(pixel) {
behavior: [
"SW|SW|SW",
"SW|DL%5|SW",
- "SW|SW|SW",
+ "SW|SW|SW"
],
tool: function(pixel){},
category: "tools",
@@ -1006,7 +1088,7 @@ SEEDRISE: function(pixel) {
behavior: [
"SH|SH|SH",
"SH|DL%5|SH",
- "SH|SH|SH",
+ "SH|SH|SH"
],
tool: function(pixel) {
// One loop that repeats 5 times if shiftDown else 1 time
@@ -1018,11 +1100,7 @@ SEEDRISE: function(pixel) {
for (var j = 0; j < (shiftDown ? 5 : 1); j++) {
if (Math.random() < con) { // If random number is less than conductivity
if (!pixel.charge && !pixel.chargeCD) {
- pixel.charge = 1;
- pixel.chargeStart = pixelTicks;
- if (elements[pixel.element].colorOn) {
- pixel.color = pixelColorPick(pixel);
- }
+ chargePixel(pixel);
}
}
else if (elements[pixel.element].insulate !== true) { // Otherwise heat the pixel (Resistance simulation)
@@ -1038,7 +1116,17 @@ SEEDRISE: function(pixel) {
},
"paint": {
color: ["#c27070","#c29c70","#c2c270","#70c270","#70c2c2","#7070c2","#c270c2"],
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to only paint. Enter multiple elements separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { filter:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tool: function(pixel) {
+ if (currentElementProp && currentElementProp.filter && !currentElementProp.filter.split(",").includes(pixel.element)) {
+ return;
+ }
if (!shiftDown) {
pixel.color = pixelColorPick(pixel,currentColorMap.paint)
}
@@ -1274,7 +1362,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:foam%3|XX",
"M2|XX|M2",
- "M2|M1|M2",
+ "M2|M1|M2"
],
onMix: function(pixel) {
releaseElement(pixel, "foam", shiftDown)
@@ -1531,6 +1619,9 @@ SEEDRISE: function(pixel) {
pixel.color = pixelColorPick(pixel,"#301B16")
}
}
+ else if (pixel.element === "light") {
+ deletePixel(pixel.x, pixel.y);
+ }
},
canPlace: true,
tempHigh: 950,
@@ -1595,7 +1686,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
category:"life",
tempHigh: 300,
@@ -1673,7 +1764,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"SW:water,salt_water,dirty_water,sugar_water%1|XX|SW:water,salt_water,dirty_water,sugar_water%1",
- "M2%10|M1|M2%10",
+ "M2%10|M1|M2%10"
],
tick: function(pixel) {
if (Math.random() < 0.01 && !isEmpty(pixel.x+1,pixel.y+1,true) && isEmpty(pixel.x+1,pixel.y)) {
@@ -1810,7 +1901,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:10|XX",
"XX|XX|XX",
- "M2|M1 AND EX:10|M2",
+ "M2|M1 AND EX:10|M2"
],
category: "weapons",
state: "solid",
@@ -1877,7 +1968,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|CH:rain_cloud|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
temp: -5,
tempHigh: 20,
@@ -2005,7 +2096,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"M2|M1|M2",
"CL%5 AND M1|XX|CL%5 AND M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
tool: function(pixel) {
if (pixel.temp >= elements.plasma.temp || elements[pixel.element].insulate) {return;}
@@ -2110,7 +2201,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:radiation%0.075|XX",
"CR:radiation%0.075|XX|CR:radiation%0.075",
- "XX|CR:radiation%0.075|XX",
+ "XX|CR:radiation%0.075|XX"
],
tempHigh: 1500,
category: "solids",
@@ -2126,7 +2217,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"SP|XX|SP",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"dirty_water": { elem1:"rotten_meat", chance:0.1 },
@@ -2180,7 +2271,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:plague,stench,stench,stench,fly%0.25 AND CH:meat>rotten_meat%1|XX",
"SP%99 AND CH:meat>rotten_meat%1|XX|SP%99 AND CH:meat>rotten_meat%1",
- "XX|M1 AND CH:meat>rotten_meat%1|XX",
+ "XX|M1 AND CH:meat>rotten_meat%1|XX"
],
reactions: {
"water": { elem2:"broth", tempMin:70, color2:"#d7db69" },
@@ -2206,7 +2297,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"SP|XX|SP",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"water": { elem2:"broth", tempMin:70 },
@@ -2234,6 +2325,11 @@ SEEDRISE: function(pixel) {
changePixel(pixel,"grease")
}
},
+ onBreak: function(pixel) {
+ if (Math.random() <= (shiftDown ? 0.33 : 0.1) && pixel.temp > 125) {
+ releaseElement(pixel, "grease")
+ }
+ },
reactions: {
"water": { elem2:"broth", tempMin:70 },
"salt_water": { elem2:"broth", tempMin:70 },
@@ -2272,14 +2368,26 @@ SEEDRISE: function(pixel) {
"rime": { elem1:null, elem2:"salt_water", chance:0.075 },
"snow": { elem1:null, elem2:"salt_water", chance:0.25 },
"packed_snow": { elem1:null, elem2:"salt_water", chance:0.05 },
- "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 }
+ "packed_ice": { elem1:null, elem2:"salt_water", chance:0.01 },
+ // electrolysis:
+ "aluminum": { elem1:["sodium","chlorine"], charged:true, chance:0.0025 },
+ "zinc": { elem1:["sodium","chlorine"], charged:true, chance:0.015 },
+ "steel": { elem1:["sodium","chlorine"], charged:true, chance:0.0125 },
+ "iron": { elem1:["sodium","chlorine"], charged:true, chance:0.0125 },
+ "tin": { elem1:["sodium","chlorine"], charged:true, chance:0.01 },
+ "brass": { elem1:["sodium","chlorine"], charged:true, chance:0.001 },
+ "bronze": { elem1:["sodium","chlorine"], charged:true, chance:0.001 },
+ "copper": { elem1:["sodium","chlorine"], charged:true, chance:0.0075 },
+ "silver": { elem1:["sodium","chlorine"], charged:true, chance:0.0075 },
+ "gold": { elem1:["sodium","chlorine"], charged:true, chance:0.0075 }
},
category: "food",
tempHigh: 801,
state: "solid",
density: 2160,
fireColor: "#F1E906",
- alias: "sodium chloride"
+ alias: "sodium chloride",
+ isFood: true
},
"molten_salt": {
conduct: 0.1,
@@ -2343,33 +2451,55 @@ SEEDRISE: function(pixel) {
insulate: true,
conduct: 1,
noMix: true,
- // ignoreConduct:["ecloner"],
+ // ignoreConduct:["ecloner"]
},
"battery": {
color: "#9c6c25",
behavior: [
"XX|SH|XX", // shocks (adds charge)
"SH|XX|SH",
- "XX|SH|XX",
+ "XX|SH|XX"
],
+ // tick: function(pixel) {
+ // doDefaults(pixel);
+ // for (var i = 0; i < adjacentCoords.length; i++) {
+ // var coords = adjacentCoords[i];
+ // var x = pixel.x + coords[0];
+ // var y = pixel.y + coords[1];
+ // if (!isEmpty(x,y,true)) {
+ // var newPixel = pixelMap[x][y];
+
+ // }
+ // }
+ // },
category: "machines",
tempHigh: 1455.5,
stateHigh: ["molten_steel","explosion","acid_gas"],
hardness: 0.8,
- breakInto: ["metal_scrap","acid"]
+ breakInto: ["metal_scrap","acid"],
+ movable: false
},
"cloner": {
color: "#dddd00",
behavior: behaviors.CLONER,
onClicked: behaviors.CLONE_ON_CLICK,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
ignore: ["ecloner","slow_cloner","clone_powder","floating_cloner","wall","ewall"],
category:"machines",
insulate:true,
hardness: 1,
darkText: true,
+ movable: false
},
"sensor": {
color: "#bebfa3",
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to detect. Enter multiple separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { sense:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel) {
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
@@ -2391,36 +2521,69 @@ SEEDRISE: function(pixel) {
conduct: 1,
movable: false,
category:"machines",
- darkText: true,
+ darkText: true
},
"heater": {
color: "#881111",
- behavior: [
- "XX|HT:2|XX",
- "HT:2|XX|HT:2",
- "XX|HT:2|XX",
- ],
+ tick: function(pixel) {
+ let temp = pixel.temp - airTemp;
+ temp = Math.max(temp, 2);
+ temp = Math.min(temp, 10);
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (isEmpty(x,y,true)) continue;
+
+ if (elements[pixelMap[x][y].element].insulate) continue;
+ pixelMap[x][y].temp += temp;
+ pixelTempCheck(pixelMap[x][y]);
+ }
+ },
+ temp: 22,
category:"machines",
- insulate:true
+ insulate:true,
+ movable: false
},
"cooler": {
color: "#111188",
- behavior: [
- "XX|CO:2|XX",
- "CO:2|XX|CO:2",
- "XX|CO:2|XX",
- ],
+ tick: function(pixel) {
+ let temp = pixel.temp - airTemp;
+ temp = Math.min(temp, -2);
+ temp = Math.max(temp, -10);
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (isEmpty(x,y,true)) continue;
+
+ if (elements[pixelMap[x][y].element].insulate) continue;
+ pixelMap[x][y].temp += temp;
+ pixelTempCheck(pixelMap[x][y]);
+ }
+ },
+ temp: 18,
category:"machines",
- insulate:true
+ insulate:true,
+ movable: false
},
"random": {
- color: ["#3e5f8a","#a334ec","#ea96f9","#a6ecf6","#70ebc8","#d9286b","#7eed91","#a18b30"],
+ color: ["#28BCD1","#9335E6","#E13294"],
behavior: behaviors.WALL,
+ onShiftSelect: function(element) {
+ promptInput("Enter multiple elements separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { randomChoices:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel) {
- changePixel(pixel,randomChoices[Math.floor(Math.random() * randomChoices.length)]);
+ let choice = choose( (currentElementProp && currentElementProp.randomChoices) ? currentElementProp.randomChoices.split(",") : randomChoices );
+ if (choice === "unknown") deletePixel(pixel.x, pixel.y);
+ else if (choice) changePixel(pixel,choice);
},
onPlace: function(pixel) {
- changePixel(pixel,randomChoices[Math.floor(Math.random() * randomChoices.length)]);
+ elements.random.tick(pixel);
},
category: "special",
excludeRandom: true
@@ -2455,7 +2618,110 @@ SEEDRISE: function(pixel) {
placingImage = null;
},
tool: function() {},
+ category: "special"
+},
+"ruler": {
+ color: ["#C99255","#B6894C"],
+ onSelect: function() {
+ currentElementProp = {};
+ // console.log(currentElementProp);
+ },
+ onMouseDown: function() {
+ currentElementProp.startX = mousePos.x;
+ currentElementProp.startY = mousePos.y;
+ // console.log(currentElementProp);
+ },
+ onMouseUp: function() {
+ currentElementProp = {};
+ // console.log(currentElementProp);
+ },
+ renderTool: function(ctx) {
+ if (currentElementProp.startX === undefined) return;
+
+ let startX = currentElementProp.startX;
+ let startY = currentElementProp.startY;
+ let newX = mousePos.x;
+ let newY = mousePos.y;
+ let diffY = Math.abs(startY - newY) + 1;
+ let diffX = Math.abs(startX - newX) + 1;
+ if (shiftDown) {
+ if (diffX > diffY) newY = startY;
+ else newX = startX;
+ }
+ let triWidth = Math.abs(newX - startX) + 1;
+ let triHeight = Math.abs(newY - startY) + 1;
+ let hypot = Math.hypot(triWidth, triHeight);
+ let dirX = Math.sign(newX - startX || -1) * 3;
+ let dirY = Math.sign(newY - startY || 1) * 3;
+ let done = {};
+ let coords = [];
+
+ coords = coords.concat(
+ lineCoords(startX, startY, newX, startY, 1)
+ );
+ coords = coords.concat(
+ lineCoords(startX, startY, newX, newY, 1)
+ );
+ coords = coords.concat(
+ lineCoords(newX, startY, newX, newY, 1)
+ );
+
+ let nums = [ /* [value, x position, y position] */ ]
+
+ if (triWidth >= 3 || triWidth >= triHeight) { /* midWidth */
+ nums.push( [Math.abs(newX - startX) + 1, (newX + startX) / 2, startY - dirY] );
+ }
+ if (triHeight >= 3 || triHeight > triWidth) { /* midHeight */
+ nums.push( [Math.abs(newY - startY) + 1, newX + dirX, (newY + startY) / 2] );
+ }
+ if (triWidth > 5 && triHeight >= 5) { /* hypot */
+ nums.push( [hypot, (newX + startX) / 2 - dirX, (newY + startY) / 2 + dirY] );
+ }
+ if (triWidth > 10 && triHeight >= 10) {
+ let area = (triWidth * triHeight) / 2;
+ let angle = Math.asin((2 * area) / (hypot * triWidth));
+ angle = Math.round(angle * 180/Math.PI);
+ nums.push( [angle+"°", startX + (triWidth * Math.sign(dirX) * 0.25), startY + (triHeight * Math.sign(dirY) * 0.1)] );
+ }
+
+ for (let i = 0; i < coords.length; i++) {
+ const coord = coords[i];
+ if (done[coord[0] + "," + coord[1]]) continue;
+ done[coord[0] + "," + coord[1]] = true;
+
+ let color = i % 2 ? "#808080" : "#ffff00";
+ drawSquare(ctx, color, coord[0], coord[1], undefined, 0.75);
+ }
+ ctx.font = (pixelSize*4)+"px 'VT323'";
+ ctx.fillStyle = "#ffff00";
+ ctx.strokeStyle = "#000000";
+ ctx.lineWidth = pixelSize;
+ for (let i = 0; i < nums.length; i++) {
+ const num = nums[i];
+ let value = typeof num[0] === "number" ? Math.round(num[0]) : num[0];
+ let x = num[1];
+ let y = num[2];
+
+ x -= value.toString().length / 2;
+ y += 1.5;
+
+ x = Math.max(x, 5);
+ x = Math.min(x, width-5);
+ y = Math.max(y, 5);
+ y = Math.min(y, height-5);
+
+ x = Math.round(x);
+ y = Math.round(y);
+
+ ctx.strokeText(value, x * pixelSize, y * pixelSize);
+ ctx.fillText(value, x * pixelSize, y * pixelSize);
+ }
+ },
+ tool: function() {},
category: "special",
+ maxSize: 1,
+ desc: "Use to measure lengths and angles on the canvas.",
+ excludeRandom: true
},
"unpaint": {
color: ["#ffffff","#000000"],
@@ -2562,7 +2828,23 @@ SEEDRISE: function(pixel) {
},
"filler": {
color: "#ae4cd9",
- behavior: behaviors.FILL,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
+ tick: function(pixel) {
+ doDefaults(pixel);
+
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (isEmpty(x,y)) {
+ createPixel(pixel.element, x, y);
+ if (pixel.clone) pixelMap[x][y].clone = pixel.clone;
+ }
+ }
+ if (pixel.clone !== undefined && pixelTicks - pixel.start >= 2) {
+ changePixel(pixel, choose(pixel.clone.split(",")));
+ }
+ },
category:"special",
excludeRandom: true,
reactions: {
@@ -2572,14 +2854,15 @@ SEEDRISE: function(pixel) {
"positron": { elem1:"vertical" },
"plasma": { elem1:"armageddon", tempMin:500, charged:true }
},
- density: 1834
+ density: 1834,
+ movable: false
},
"lattice": {
color: "#cb4cd9",
behavior: [
"CL|XX|CL",
"XX|XX|XX",
- "CL|XX|CL",
+ "CL|XX|CL"
],
tick: function(pixel) {
for (var i = 0; i < adjacentCoords.length; i++) {
@@ -2675,18 +2958,27 @@ SEEDRISE: function(pixel) {
},
"void": {
color: "#262626",
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to allow. Enter multiple separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { filter:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel) {
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 (pixel.filter && !(pixel.filter === newPixel.element || pixel.filter.split(",").includes(newPixel.element))) continue;
if (elements[newPixel.element].hardness === 1) { continue; }
deletePixel(x,y);
}
}
doDefaults(pixel);
},
+ hoverStat: function(pixel) { return pixel.filter || "" },
category:"special",
hardness: 1,
excludeRandom: true,
@@ -2753,7 +3045,7 @@ SEEDRISE: function(pixel) {
movable: false
},
"cell": {
- color: ["#00ee00","#83ee00","#d6ee00"],
+ color: ["#d6ee00","#83ee00","#00ee00"],
tick: function(pixel){
if (Math.random() < 0.005 && isEmpty(pixel.x,pixel.y-1)) clonePixel(pixel,pixel.x,pixel.y-1);
if (Math.random() < 0.005 && isEmpty(pixel.x-1,pixel.y)) clonePixel(pixel,pixel.x-1,pixel.y);
@@ -2796,7 +3088,7 @@ SEEDRISE: function(pixel) {
breakInto: ["water","dna","dna","dna"]
},
"cancer": {
- color: ["#300b29","#5c114e","#870c71"],
+ color: ["#870c71","#5c114e","#300b29"],
tick: function(pixel){
if (Math.random() < 0.01 && isEmpty(pixel.x,pixel.y-1)) clonePixel(pixel,pixel.x,pixel.y-1);
if (Math.random() < 0.01 && isEmpty(pixel.x-1,pixel.y)) clonePixel(pixel,pixel.x-1,pixel.y);
@@ -2838,28 +3130,12 @@ SEEDRISE: function(pixel) {
nocheer: true,
hidden: true
},
-"dna": {
- color: ["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"],
- behavior: behaviors.POWDER,
- reactions: {
- "fire": { elem2:null },
- "radiation": { "color1":["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"] },
- "neutron": { "color1":["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"] }
- },
- tempHigh: 190,
- stateHigh: "smoke",
- state: "solid",
- density: 1700,
- category: "life",
- hidden: true,
- alias: "deoxyribonucleic acid"
-},
"plague": {
color: "#36005c",
behavior: [
"M2|M1|M2",
"M1|DL%1|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"frog": { elem2:"plague", chance:0.05 },
@@ -2878,12 +3154,28 @@ SEEDRISE: function(pixel) {
state: "gas",
density: 600
},
+"dna": {
+ color: ["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"],
+ behavior: behaviors.POWDER,
+ reactions: {
+ "fire": { elem2:null },
+ "radiation": { "color1":["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"] },
+ "neutron": { "color1":["#ffe3e3","#e3e3ff","#ffffe3","#e3ffe3"] }
+ },
+ tempHigh: 190,
+ stateHigh: "smoke",
+ state: "solid",
+ density: 1700,
+ category: "life",
+ hidden: true,
+ alias: "deoxyribonucleic acid"
+},
"worm": {
color: "#d34c37",
behavior: [
"SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3|XX|SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3",
"M2%10|XX|M2%10",
- "SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3|M1|SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3",
+ "SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3|M1|SW:dirt,sand,gravel,ash,mycelium,mud,wet_sand,clay_soil,water,salt_water,dirty_water,primordial_soup,blood,infection,color_sand%3"
],
reactions: {
"ash": { elem2:[null,null,null,null,null,null,null,null,null,null,"dirt"], chance:0.1, func:behaviors.FEEDPIXEL },
@@ -2910,6 +3202,12 @@ SEEDRISE: function(pixel) {
"yolk": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL },
"charcoal": { elem2:"dirt", chance:0.05, func:behaviors.FEEDPIXEL },
"straw": { elem2:"dirt", chance:0.05, func:behaviors.FEEDPIXEL },
+ "lettuce": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
+ "tomato": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
+ "corn": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
+ "pickle": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
+ "bread": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
+ "toast": { elem2:"dirt", chance:0.01, func:behaviors.FEEDPIXEL },
"mudstone": { elem2:"dirt", chance:0.1 },
"permafrost": { elem2:"dirt", chance:0.1 },
"packed_sand": { elem2:"sand", chance:0.1 },
@@ -2949,7 +3247,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M2|XX|M2",
"XX|XX|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"blood": { elem2:null, chance:0.1875, func:behaviors.FEEDPIXEL },
@@ -2982,7 +3280,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|SW:wood,tree_branch,dirt,sand,gravel,clay_soil%5",
"XX|FX%3|M2%15 AND BO",
- "XX|M1|SW:wood,tree_branch,dirt,sand,gravel,clay_soil%5",
+ "XX|M1|SW:wood,tree_branch,dirt,sand,gravel,clay_soil%5"
],
reactions: {
"wood": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL },
@@ -3185,7 +3483,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|CR:flash|XX",
"CR:flash|CH:ash|CR:flash",
- "XX|CR:flash|XX",
+ "XX|CR:flash|XX"
],
reactions: {
"dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
@@ -3243,8 +3541,11 @@ SEEDRISE: function(pixel) {
pixel.emit = false;
}
behaviors.FLY(pixel,function(firefly,newfly){
- if (newfly) {
+ if (newfly && newfly.element === "firefly") {
newfly.fff = firefly.fff;
+ newfly.color = newfly.ffc||pixelColorPick(newfly,"#684841");
+ newfly.glow = false;
+ newfly.emit = false;
}
})
},
@@ -3266,7 +3567,8 @@ SEEDRISE: function(pixel) {
burnTime:25,
state: "solid",
density: 600,
- conduct: 0.15
+ conduct: 0.15,
+ alias: "lightning bug"
},
"bee": {
color: "#c4b100",
@@ -3516,6 +3818,13 @@ SEEDRISE: function(pixel) {
panic: 0
},
onPlace: function(pixel) {
+ if (!isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element === "head") {
+ deletePixel(pixel.x, pixel.y-1);
+ }
+ else if (!isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element === "body") {
+ deletePixel(pixel.x, pixel.y+1);
+ }
+
if (isEmpty(pixel.x, pixel.y+1)) {
createPixel("body", pixel.x, pixel.y+1);
var color = pixel.color;
@@ -3552,7 +3861,7 @@ SEEDRISE: function(pixel) {
},
related: ["body","head"],
cooldown: defaultCooldown,
- forceSaveColor: true,
+ forceSaveColor: true
},
"body": {
color: ["#069469","#047e99","#7f5fb0"],
@@ -3944,7 +4253,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%1.5|M2%5",
"XX|FX%2 AND RL:plague%0.05|M2 AND BO",
- "XX|M1|M2",
+ "XX|M1|M2"
],
reactions: {
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
@@ -4013,6 +4322,7 @@ SEEDRISE: function(pixel) {
"jelly": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"worm": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"ant": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
+ "spider": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
"frog": { elem2:null, chance:0.005, func:behaviors.FEEDPIXEL },
"snail": { elem2:"limestone", chance:0.1, func:behaviors.FEEDPIXEL },
"slug": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }
@@ -4036,7 +4346,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|M2%3 AND SW:water,salt_water,sugar_water,dirty_water,seltzer%7",
"XX|FX%0.5|CR:slime%0.01 AND BO",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"fly": { elem2:null, chance:0.5, func:behaviors.FEEDPIXEL },
@@ -4098,7 +4408,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|M2%25 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14",
"XX|FX%0.5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14",
- "XX|M1|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14",
+ "XX|M1|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14"
],
tick: function(pixel) {
if (pixelTicks-pixel.start > 500) {
@@ -4125,7 +4435,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%14",
"XX|FX%0.5|BO",
- "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5",
+ "M2|M1|M2 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water,primordial_soup%5"
],
reactions: {
"algae": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL },
@@ -4192,7 +4502,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|FX%0.25|M2%0.5 AND BO",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"salt": { elem1: "slime", elem2: null },
@@ -4239,7 +4549,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|FX%0.25|M2%0.5 AND BO",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"salt": { elem1: "limestone", elem2: null },
@@ -4295,31 +4605,11 @@ SEEDRISE: function(pixel) {
behavior: [
"CR:propane|CR:propane|CR:propane",
"XX|XX|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
category: "machines",
conduct: 0.73
},
-"superheater": {
- color: "#dd1111",
- behavior: [
- "XX|HT:10|XX",
- "HT:10|XX|HT:10",
- "XX|HT:10|XX",
- ],
- category:"machines",
- insulate:true
-},
-"freezer": {
- color: "#1111dd",
- behavior: [
- "XX|CO:10|XX",
- "CO:10|XX|CO:10",
- "XX|CO:10|XX",
- ],
- category:"machines",
- insulate:true
-},
"pipe": {
color: "#414c4f",
onSelect: function() {
@@ -4338,6 +4628,7 @@ SEEDRISE: function(pixel) {
createPixel("pipe_wall",x,y);
}
}
+ pixel.color = pixelColorPick(pixel,"#293132");
pixel.stage = 1;
}
else if (pixel.stage === 1 && pixelTicks-pixel.start > 70) { //uninitialized
@@ -4347,7 +4638,7 @@ SEEDRISE: function(pixel) {
var y = pixel.y+coord[1];
if (isEmpty(x,y)) {
pixel.stage = 2; //blue
- pixel.color = pixelColorPick(pixel,"#000036");
+ pixel.color = pixelColorPick(pixel,"#000056");
break;
}
}
@@ -4364,7 +4655,7 @@ SEEDRISE: function(pixel) {
switch (pixel.stage) {
case 2: newPixel.stage = 3; newColor = "#003600"; break; //green
case 3: newPixel.stage = 4; newColor = "#360000"; break; //red
- case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue
+ case 4: newPixel.stage = 2; newColor = "#000056"; break; //blue
}
newPixel.color = pixelColorPick(newPixel,newColor);
}
@@ -4419,9 +4710,12 @@ SEEDRISE: function(pixel) {
pixel.con = null;
break;
}
- if (!isEmpty(x,y,true) && pixelMap[x][y].element === "pipe") {
+ if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].canContain) {
var newPixel = pixelMap[x][y];
- if (pixel.con && !newPixel.con && newPixel.stage === pixel.stage) {
+ if (newPixel.filter) {
+ if (newPixel.filter !== pixel.con.element && !newPixel.filter.split(",").includes(pixel.con.element)) continue
+ }
+ if (pixel.con && !newPixel.con && (pixelMap[x][y].element !== "pipe" || newPixel.stage === pixel.stage)) {
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -4438,43 +4732,255 @@ SEEDRISE: function(pixel) {
movable: false,
canContain: true,
forceSaveColor: true,
- hardness: 0.75
+ hardness: 0.75,
+ insulate: true
},
"pipe_wall": {
color: "#586879",
behavior: behaviors.WALL,
category: "machines",
noMix: true,
- hidden: true
+ hidden: true,
+ insulate: true
+},
+"filter": {
+ color: ["#885a3a","#64432b"],
+ colorKey: {
+ "L":"#885a3a",
+ "D":"#64432b"
+ },
+ colorPattern: [
+ "DL",
+ "LD"
+ ],
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to allow. Enter multiple separated by commas.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { filter:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
+ onClicked: function(pixel,element) {
+ if (pixel.filter) return;
+ if (elements[element].tool && elements[element].canPlace !== true) return;
+ if (elements[element].canPlace === false) return;
+ if (elements[element].movable) pixel.filter = element;
+ },
+ tick: function(pixel) {
+ doDefaults(pixel);
+ if (!pixel.con) { //collect pixel
+ if (Math.random() > 0.2) return;
+ for (var i = 0; i < squareCoords.length; i++) {
+ var coord = squareCoords[i];
+ var x = pixel.x+coord[0];
+ var y = pixel.y+coord[1];
+ let newPixel = getPixel(x, y);
+ if (!newPixel) continue;
+ if (newPixel.element === "filter") {
+ if (!newPixel.filter && pixel.filter) newPixel.filter = pixel.filter;
+ if (!pixel.filter && newPixel.filter) pixel.filter = newPixel.filter;
+ }
+ if (!elements[newPixel.element].movable) continue;
+ if (!pixel.filter) {
+ pixel.filter = newPixel.element;
+ }
+ if (elements[newPixel.element].movable && (
+ pixel.filter === newPixel.element ||
+ pixel.filter === elements[newPixel.element].state ||
+ (pixel.filter.match(/,/) && pixel.filter.split(",").includes(newPixel.element))
+ )) {
+ if (!elements[newPixel.element].isGas && coord[1] > 0) continue;
+ pixel.con = newPixel;
+ deletePixel(newPixel.x,newPixel.y);
+ pixel.con.x = pixel.x;
+ pixel.con.y = pixel.y;
+ pixel.con.del;
+ pixel.filterTick = pixelTicks;
+ break;
+ }
+ }
+ return;
+ }
+
+ //move pixel
+ let targets;
+ let element = pixel.con.element;
+ if (elements[element].isGas) { //random direction
+ shuffleArray(squareCoordsShuffle);
+ targets = squareCoordsShuffle;
+ }
+ else { //downward, and then randomly diagonally
+ if (Math.random() < 0.5) return;
+ targets = [[0,1], ...(Math.random() < 0.5 ? [[1,1],[-1,1]] : [[-1,1],[1,1]])];
+ }
+
+ for (var i = 0; i < targets.length; i++) {
+ var coord = targets[i];
+ var x = pixel.x+coord[0];
+ var y = pixel.y+coord[1];
+ if (isEmpty(x,y)) { //release pixel
+ delete pixel.con.del;
+ pixel.con.x = x;
+ pixel.con.y = y;
+ pixelMap[x][y] = pixel.con;
+ currentPixels.push(pixel.con);
+ pixel.con = null;
+ break;
+ }
+ let newPixel = getPixel(x, y);
+ if (!newPixel) continue;
+ if (elements[newPixel.element].canContain && !newPixel.con && newPixel.filterTick !== pixelTicks) {
+ if (newPixel.filter !== pixel.filter) {
+ if (newPixel.filter !== pixel.con.element && !newPixel.filter.split(",").includes(pixel.con.element)) continue
+ }
+ newPixel.con = pixel.con;
+ newPixel.con.x = newPixel.x;
+ newPixel.con.y = newPixel.y;
+ newPixel.con.del; //???
+ newPixel.filterTick = pixelTicks;
+ delete newPixel.con.del;
+ pixel.con = null;
+ break;
+ }
+ }
+
+ },
+ hoverStat: function(pixel) { return pixel.filter ? pixel.filter.toUpperCase() : "NONE" },
+ category: "machines",
+ movable: false,
+ canContain: true,
+ forceSaveColor: true,
+ hardness: 0.75
+},
+"gate": {
+ color: ["#883a88","#642b64"],
+ colorKey: {
+ "L":"#883a88",
+ "D":"#642b64"
+ },
+ colorPattern: [
+ "DD",
+ "LL"
+ ],
+ tick: function(pixel) {
+ doDefaults(pixel);
+ if (!pixel.charge) {
+ if (pixel.alpha < 1) pixel.alpha = 1;
+ return;
+ }
+ else {
+ if (pixel.alpha !== 0.25) pixel.alpha = 0.25;
+ }
+ if (!pixel.con) { //collect pixel
+ for (var i = 0; i < squareCoords.length; i++) {
+ var coord = squareCoords[i];
+ var x = pixel.x+coord[0];
+ var y = pixel.y+coord[1];
+ let newPixel = getPixel(x, y);
+ if (!newPixel) continue;
+ if (!elements[newPixel.element].movable) continue;
+ if (elements[newPixel.element].movable) {
+ if (!elements[newPixel.element].isGas && coord[1] > 0) continue;
+ pixel.con = newPixel;
+ deletePixel(newPixel.x,newPixel.y);
+ pixel.con.x = pixel.x;
+ pixel.con.y = pixel.y;
+ pixel.con.del;
+ pixel.filterTick = pixelTicks;
+ break;
+ }
+ }
+ return;
+ }
+
+ //move pixel
+ let targets;
+ let element = pixel.con.element;
+ if (elements[element].isGas) { //random direction
+ shuffleArray(squareCoordsShuffle);
+ targets = squareCoordsShuffle;
+ }
+ else { //downward, and then randomly diagonally
+ targets = [[0,1], ...(Math.random() < 0.5 ? [[1,1],[-1,1]] : [[-1,1],[1,1]])];
+ }
+
+ for (var i = 0; i < targets.length; i++) {
+ var coord = targets[i];
+ var x = pixel.x+coord[0];
+ var y = pixel.y+coord[1];
+ if (isEmpty(x,y)) { //release pixel
+ delete pixel.con.del;
+ pixel.con.x = x;
+ pixel.con.y = y;
+ pixelMap[x][y] = pixel.con;
+ currentPixels.push(pixel.con);
+ pixel.con = null;
+ break;
+ }
+ let newPixel = getPixel(x, y);
+ if (!newPixel) continue;
+ if (elements[newPixel.element].canContain && !newPixel.con && newPixel.filterTick !== pixelTicks) {
+ if (newPixel.filter) {
+ if (newPixel.filter !== pixel.con.element && !newPixel.filter.split(",").includes(pixel.con.element)) continue
+ }
+ newPixel.con = pixel.con;
+ newPixel.con.x = newPixel.x;
+ newPixel.con.y = newPixel.y;
+ newPixel.con.del; //???
+ newPixel.filterTick = pixelTicks;
+ delete newPixel.con.del;
+ pixel.con = null;
+ break;
+ }
+ }
+
+ },
+ category: "machines",
+ movable: false,
+ canContain: true,
+ forceSaveColor: true,
+ conduct: 1,
+ onlyConduct: ["gate","wire"],
+ hardness: 0.75,
+ insulate: true
},
"mixer": {
color: ["#9f936f","#b4a98e","#c8beac"],
behavior: [
"MX|MX|MX",
"MX|CC:#9f936f,#b4a98e,#c8beac|MX",
- "MX|MX|MX",
+ "MX|MX|MX"
],
category: "machines",
noMix: true,
- darkText: true
+ darkText: true,
+ outline: false
},
"grinder": {
color: ["#8a8986","#a3a29f","#bcbbb9"],
behavior: [
"MX|SM%8 AND MX|MX",
"SM%8 AND MX|CC:#8a8986,#a3a29f,#bcbbb9|SM%8 AND MX",
- "MX|SM%8 AND MX|MX",
+ "MX|SM%8 AND MX|MX"
],
category: "machines",
noMix: true,
- darkText: true
+ darkText: true,
+ outline: false
},
"fuse": {
color: "#825d38",
+ onShiftSelect: function(element) {
+ promptInput("Enter an element to turn into once charged.", function(r) {
+ r = validateElementList(r);
+ if (!r) return;
+ currentElementProp = { clone:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel) {
doDefaults(pixel);
if (pixel.charge < 1) {
- changePixel(pixel,"flash");
+ changePixel(pixel,pixel.clone ? choose(pixel.clone.split(",")) : "flash");
pixel.charge = 0;
}
},
@@ -4505,7 +5011,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:fire|XX",
"XX|XX|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"water": { elem1:"wood" },
@@ -4534,7 +5040,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:water|XX",
"CR:water|XX|CR:water",
- "XX|CR:water|XX",
+ "XX|CR:water|XX"
],
category:"special",
tempHigh: 1455.5,
@@ -4543,6 +5049,7 @@ SEEDRISE: function(pixel) {
},
"udder": {
color: "#ecb3f5",
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
tick: function(pixel) {
if (!isEmpty(pixel.x+1,pixel.y,true)) {
let pixel2 = pixelMap[pixel.x+1][pixel.y];
@@ -4585,14 +5092,14 @@ SEEDRISE: function(pixel) {
burnTime:200,
burnInto:"cooked_meat",
category:"special",
- movable: false,
+ movable: false
},
"bone_marrow": {
color: "#c97265",
behavior: [
"XX|CR:blood,bone,bone%1|XX",
"CR:blood,bone,bone%1|XX|CR:blood,bone,bone%1",
- "XX|CR:blood,bone,bone%1|XX",
+ "XX|CR:blood,bone,bone%1|XX"
],
category:"life",
tempHigh: 750,
@@ -4626,7 +5133,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|FY:0%5|XX",
- "XX|M1 AND BO|XX",
+ "XX|M1 AND BO|XX"
],
tempHigh: 250,
stateHigh: "molten_plastic",
@@ -4639,10 +5146,11 @@ SEEDRISE: function(pixel) {
},
"balloon": {
color: ["#fe4a75","#267cb0","#1a743c","#ff6ffa","#eaede5","#1dc9f3","#ff0101","#f4cd32","#bee347","#fab937","#91c7cc"],
+ buttonColor: ["#ff8080","#ff2626"],
behavior: [
"M1%50|M1%50|M1%50",
"M2%5|XX|M2%5",
- "M2%5|M2%5|M2%5",
+ "M2%5|M2%5|M2%5"
],
reactions: {
"cloud": {elem1:"pop"},
@@ -4679,7 +5187,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M1|M1|M1",
"M2|XX|M2",
- "XX|CR:antifire%2.5|XX",
+ "XX|CR:antifire%2.5|XX"
],
temp: 1850,
tempLow: 1750,
@@ -4695,7 +5203,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2|XX",
"M2|XX|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
reactions: {
"antifluid": { elem1: "antigas" },
@@ -4715,7 +5223,7 @@ SEEDRISE: function(pixel) {
hidden: true,
state: "gas",
density: 0.2,
- ignoreAir: true,
+ ignoreAir: true
},
"antifluid": {
color: "#d1dbeb",
@@ -4750,7 +5258,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M1 AND BO|XX",
"CR:wall|XX|CR:wall",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"electric": { elem1:"horizontal" }
@@ -4764,7 +5272,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:wall|XX",
"XX|XX|M1 AND BO",
- "XX|CR:wall|XX",
+ "XX|CR:wall|XX"
],
reactions: {
"proton": { elem1:"vertical" },
@@ -4787,7 +5295,8 @@ SEEDRISE: function(pixel) {
"acid_cloud": { elem1: "pyrocumulus", chance:0.05, "y":[0,12], "setting":"clouds" },
"pyrocumulus": { elem1: "pyrocumulus", chance:0.08, "y":[0,12], "setting":"clouds" },
"tornado":{elem1:"pyrocumulus", oneway:true},
- "stench": { elem2:null, chance:0.1 }
+ "stench": { elem2:null, chance:0.1 },
+ "molten_dirt": { elem1:null, elem2:"molten_tuff" }
},
category:"powders",
state: "solid",
@@ -4868,7 +5377,7 @@ SEEDRISE: function(pixel) {
"static": { "color1":["#ffffff","#bdbdbd","#808080","#424242","#1c1c1c"] },
"pipe": { },
"pipe_wall": { },
- "wall": { },
+ "wall": { }
},
temp: 35,
tempLow: -273,
@@ -4950,7 +5459,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|DL%0.25|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tick: behaviors.BOUNCY,
temp: 35,
@@ -4976,6 +5485,10 @@ SEEDRISE: function(pixel) {
pixel.start = pixelTicks;
}
},
+ reactions: {
+ "molten_stained_glass": { elem1:"rainbow" },
+ "metal_scrap": { charged:true, elem1:"static" },
+ },
canPlace: true,
category:"special",
customColor: true,
@@ -4983,7 +5496,7 @@ SEEDRISE: function(pixel) {
movable: false,
state: "gas",
glow: false,
- density: 1,
+ density: 1
},
"charcoal": {
color: "#2b2b2b",
@@ -5113,7 +5626,8 @@ SEEDRISE: function(pixel) {
"ozone": { elem1: "ozone", chance:0.01, "y":[0,12], "setting":"clouds" },
"light": { elem1: "ozone", elem2: null, chance:0.3, "y":[0,12], "setting":"clouds" },
"proton": { elem1:"flash", color1:"#e36d88", attr1:{delay:500}, elem2:"flash", color2:"#e36d88", attr2:{delay:500}, chance:0.25, "y":[0,10] },
- "paper": { elem1:"fragrance", chance:0.005 }
+ "paper": { elem1:"fragrance", chance:0.005 },
+ "molten_lead": { elem2:"poison_gas" }
},
category: "gases",
// burn: 100,
@@ -5190,7 +5704,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|FX%1|M1%5",
- "XX|M1%1|M1%2",
+ "XX|M1%1|M1%2"
],
tick: function(pixel) {
if (Math.random() < 0.0025 || (pixel.clone && isEmpty(pixel.x,pixel.y-1))) {
@@ -5259,7 +5773,7 @@ SEEDRISE: function(pixel) {
},
"liquid_ammonia": {
tempLow: -77.78,
- density: 681.9,
+ density: 681.9
},
"oil": {
color: "#470e00",
@@ -5283,7 +5797,7 @@ SEEDRISE: function(pixel) {
"pool_water": { burning1:true, elem2:"explosion" },
"seltzer": { burning1:true, elem2:"explosion" },
"coral": { elem2:null, chance:0.01 },
- "hydrogen": { elem1:"sulfur", elem2:"steam", burning1:false, burning2:false, tempMin:90, chance:0.1 },
+ "hydrogen": { elem1:"sulfur", elem2:"steam", burning1:false, burning2:false, tempMin:90, chance:0.1 }
},
category: "liquids",
tempHigh: 500,
@@ -5302,8 +5816,7 @@ SEEDRISE: function(pixel) {
behavior: behaviors.LIQUID,
tick: function(pixel) {
if (pixel.temp > 500 && !pixel.burning) {
- pixel.burning = true;
- pixel.burnStart = pixelTicks;
+ burnPixel(pixel);
}
},
reactions: {
@@ -5332,7 +5845,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|CH:fire|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
conduct: 0.01,
category: "gases",
@@ -5357,7 +5870,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|CH:fire|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
conduct: 0.01,
category: "gases",
@@ -5440,7 +5953,8 @@ SEEDRISE: function(pixel) {
category: "special",
movable: false,
breakInto: "static",
- fireColor: ["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"]
+ fireColor: ["#ff0000","#ff8800","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"],
+ darkText: true
},
"static": {
color: ["#ffffff","#888888","#000000"],
@@ -5471,7 +5985,8 @@ SEEDRISE: function(pixel) {
conduct: 1,
movable: false,
breakInto: "malware",
- fireColor: ["#ffffff","#bfbfbf","#888888","#404040","#000000"]
+ fireColor: ["#ffffff","#bfbfbf","#888888","#404040","#000000"],
+ outline: false
},
"border": {
color: ["#00ffff","#000000","#00ffff","#000000","#00ffff"],
@@ -5488,6 +6003,7 @@ SEEDRISE: function(pixel) {
hardness: 1,
insulate: true,
movable: false,
+ outline: false
},
"clay": {
color: "#d4c59c",
@@ -5511,7 +6027,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2%25|M1|M2%25",
+ "M2%25|M1|M2%25"
],
reactions: {
"water":{elem1:"clay",elem2:null},
@@ -5969,7 +6485,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%0.05|XX",
"XX|L2:grass|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
tempHigh: 100,
@@ -5991,7 +6507,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%0.25|XX",
"XX|L2:wheat AND C2:wheat%30|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
tempHigh: 400,
@@ -6029,7 +6545,7 @@ SEEDRISE: function(pixel) {
density: 2403,
hardness: 0.4,
breakInto: "porcelain_shard",
- noMix: true,
+ noMix: true
},
"paper": {
color: "#f0f0f0",
@@ -6097,7 +6613,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%1.5|XX",
"XX|L2:plant AND C2:pistil%30|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
tempHigh: 100,
@@ -6114,7 +6630,8 @@ SEEDRISE: function(pixel) {
seed: true
},
"pistil": {
- color: ["#734e39","#2f0603","#d2ac3a","#8a978f","#593117"],
+ color: ["#8a978f","#d2ac3a","#734e39","#593117","#2f0603"],
+ buttonColor: ["#d2ac3a","#2f0603"],
tick: function(pixel) {
if (!pixel.fColor) {
// make it a hsl random hue, 100% saturation, 50% lightness
@@ -6159,7 +6676,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|ST:pistil|XX",
"ST:pistil|FX%0.25|ST:pistil",
- "M2%10|ST:pistil AND M1%10|M1%10",
+ "M2%10|ST:pistil AND M1%10|M1%10"
],
reactions: {
"water": { elem2:"tea", tempMin:80, color2:"#9e4c00" },
@@ -6325,7 +6842,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%2|XX",
"XX|L2:bamboo AND C2:bamboo%10|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
tempHigh: 100,
@@ -6346,7 +6863,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2%25|M1%25|M2%25",
+ "M2%25|M1%25|M2%25"
],
tick: function(pixel) {
if (pixel.foam && isEmpty(pixel.x,pixel.y-1)) {
@@ -6372,13 +6889,13 @@ SEEDRISE: function(pixel) {
extinguish: true
},
"acid": {
- color: ["#b5cf91","#a1ff5e","#288f2a"],
+ color: ["#AEDF80","#A8EF6F","#a1ff5e","#79DA4D","#50B43B","#288f2a"],
behavior: [
"XX|DB%5|XX",
"DB%5 AND M2|XX|DB%5 AND M2",
- "DB%5 AND M2|DB%10 AND M1|DB%5 AND M2",
+ "DB%5 AND M2|DB%10 AND M1|DB%5 AND M2"
],
- ignore: ["fire","smoke","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor","clay","pipe","pipe_wall","lye","rose_gold","purple_gold","blue_gold","electrum"],
+ ignore: ["fire","smoke","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor","clay","pipe","pipe_wall","lye","rose_gold","purple_gold","blue_gold","electrum","mercury","bubble","diamond"],
reactions: {
"ash": { elem1:"neutral_acid", elem2:null },
"limestone": { elem1:"neutral_acid", elem2:["calcium","carbon_dioxide"] },
@@ -6408,7 +6925,8 @@ SEEDRISE: function(pixel) {
"gravel": { elem1:null, elem2:"sand", chance:0.1 },
"wet_sand": { elem1:"neutral_acid", elem2:"clay" },
"snail": { elem1:"neutral_acid", elem2:"slug" },
- "silver": { stain2:"#2a2e2a" }
+ "silver": { stain2:"#2a2e2a" },
+ "acid": { elem2:"bubble", color2:"#bfcfa9", attr2:{"clone":"acid"}, chance:0.001, tempMin:80 }
},
category: "liquids",
tempHigh: 110,
@@ -6439,14 +6957,14 @@ SEEDRISE: function(pixel) {
behavior: [
"M1|DB%5 AND M1|M1",
"DB%5 AND M1|XX|DB%5 AND M1",
- "DB%5 AND M1|DB%10 AND M1|DB%5 AND M1",
+ "DB%5 AND M1|DB%10 AND M1|DB%5 AND M1"
],
tick: function(pixel) {
if (pixel.temp > 1000 && Math.random() < 0.01) {
changePixel(pixel,Math.random() < 0.66 ? "hydrogen" : "chlorine");
}
},
- ignore: ["fire","smoke","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor","pipe","pipe_wall","lye"],
+ ignore: ["fire","smoke","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor","pipe","pipe_wall","lye","mercury","bubble","diamond"],
reactions: {
"acid_gas": { elem1: null, elem2: "acid_cloud", chance:0.3, "y":[0,12], "setting":"clouds" },
"rain_cloud": { elem1: null, elem2: "acid_cloud", chance:0.4, "y":[0,12], "setting":"clouds" },
@@ -6511,7 +7029,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"M2|XX|M2",
- "M2|M1|M2",
+ "M2|M1|M2"
],
tick: function(pixel) {
if (Math.random() < 0.02 && isEmpty(pixel.x,pixel.y-1)) {
@@ -6549,12 +7067,12 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CH:gray_goo%25|XX",
"M2%5 AND CH:gray_goo%25|DL%5|M2%5 AND CH:gray_goo%25",
- "XX|CH:gray_goo%25 AND M1|XX",
+ "XX|CH:gray_goo%25 AND M1|XX"
],
behaviorOn: [
"XX|XX|XX",
"XX|DL%10|XX",
- "M1|M2|M1",
+ "M1|M2|M1"
],
reactions: {
"antibody": { elem1:"malware", elem2:null }
@@ -6574,7 +7092,7 @@ SEEDRISE: function(pixel) {
behavior: [
"CL%1|CL%1 AND SH|CL%1",
"CL%1 AND SH|SH%5 AND DL%10|CL%1 AND SH",
- "M1%15 AND CL%1|M1%50 AND CL%2 AND SH|M1%15 AND CL%1",
+ "M1%15 AND CL%1|M1%50 AND CL%2 AND SH|M1%15 AND CL%1"
],
reactions: {
"gray_goo": { elem2:"malware" },
@@ -6595,16 +7113,16 @@ SEEDRISE: function(pixel) {
"lattice": { elem1:"lattice", elem2:null },
"light_bulb": { elem2:"explosion", chance:0.01 },
"battery": { elem2:"explosion", chance:0.01 },
- "heater": { elem2:["cooler","superheater"], chance:0.01 },
- "cooler": { elem2:["heater","freezer"], chance:0.01 },
- "superheater": { elem2:["heater","freezer"], chance:0.01 },
- "freezer": { elem2:["cooler","superheater"], chance:0.01 },
- "led_r": { elem2:["led_g","led_b"], chance:0.01 },
- "led_g": { elem2:["led_r","led_b"], chance:0.01 },
- "led_b": { elem2:["led_r","led_g"], chance:0.01 },
+ "heater": { elem2:"cooler", chance:0.01 },
+ "cooler": { elem2:"heater", chance:0.01 },
+ "led": { elem2:"explosion", chance:0.01 },
"ewall": { elem2:"wall", chance:0.01 },
"border": { elem2:null, chance:0.01 },
- "virus": { func: function(pixel1,pixel2){pixel2.heal=false;pixel2.origElem="malware"} }
+ "virus": { func: function(pixel1,pixel2){pixel2.heal=false;pixel2.origElem="malware"} },
+ "lead": { elem2:"pipe", chance:0.05 },
+ "tungsten": { elem2:"light_bulb", chance:0.05 },
+ "zinc": { elem2:"battery", chance:0.05 },
+ "copper": { elem2:"wire", chance:0.05 },
},
category: "special",
state: "solid",
@@ -6613,9 +7131,10 @@ SEEDRISE: function(pixel) {
"ecloner": {
name: "e-cloner",
color: "#dddd00",
- behavior: behaviors.WALL,
- behaviorOn: behaviors.CLONER,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
tick: function(pixel) {
+ doDefaults(pixel);
+ if (pixel.charge) behaviors.CLONER(pixel);
if (pixel.clone) { return }
for (var i = 0; i < adjacentCoords.length; i++) {
var coords = adjacentCoords[i];
@@ -6626,13 +7145,13 @@ SEEDRISE: function(pixel) {
if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break }
var element = pixelMap[x][y].element;
if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1 && element !== "fuse") { continue }
- pixel.clone = element;
+ pixel.clone = elements[element].pickElement || element;
break;
}
}
},
onClicked: behaviors.CLONE_ON_CLICK,
- ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","wire","ewall","sensor","battery","fuse"],
+ ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","wire","wall","ewall","sensor","battery","fuse"],
ignoreConduct:["fuse"],
category:"machines",
insulate:true,
@@ -6643,25 +7162,24 @@ SEEDRISE: function(pixel) {
},
"slow_cloner": {
color: "#888800",
- behavior: [
- "XX|CF%10|XX",
- "CF%10|XX|CF%10",
- "XX|CF%10|XX",
- ],
+ tick: function(pixel) {
+ doDefaults(pixel);
+ behaviors.CLONER(pixel, 0.1);
+ },
onClicked: behaviors.CLONE_ON_CLICK,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
ignore: ["cloner","ecloner","clone_powder","floating_cloner","wall","ewall"],
category:"machines",
insulate:true,
- hardness: 1
+ hardness: 1,
+ movable: false
},
"clone_powder": {
color: "#f0f000",
- behavior: [
- "XX|CF|XX",
- "CF|XX|CF",
- "M2|CF AND M1|M2",
- ],
+ behavior: behaviors.POWDER,
+ tick: behaviors.CLONER,
onClicked: behaviors.CLONE_ON_CLICK,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
reactions: {
"malware": { elem1:"floating_cloner" }
},
@@ -6677,11 +7195,15 @@ SEEDRISE: function(pixel) {
"floating_cloner": {
color: "#c7c787",
behavior: [
- "XX|CF%3 AND M1%10|XX",
- "CF%3 AND M1%10|XX|CF%3 AND M1%10",
- "XX|CF%3 AND M1%10|XX",
+ "XX|M1%10|XX",
+ "M1%10|XX|M1%10",
+ "XX|M1%10|XX"
],
+ tick: function(pixel) {
+ behaviors.CLONER(pixel, 0.03);
+ },
onClicked: behaviors.CLONE_ON_CLICK,
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
reactions: {
"malware": { elem1:"clone_powder" }
},
@@ -6718,6 +7240,7 @@ SEEDRISE: function(pixel) {
reactions: {
"chlorine": { elem1:null },
"liquid_chlorine": { elem1:null },
+ "chlorine_ice": { elem1:null },
"light": { elem1:null, chance:0.1 },
"liquid_light": { elem1:null, chance:0.1 },
"electric": { elem2:"malware" }
@@ -6733,7 +7256,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:ice%0.5|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"water": { elem2: "ice_nine" },
@@ -6802,7 +7325,7 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 2000,
excludeRandom: true,
- ignore: ["fire","smoke","antimatter","strange_matter","wall","ewall","plasma","void","border","pointer"],
+ ignore: ["fire","smoke","antimatter","strange_matter","wall","ewall","plasma","void","border","pointer"]
},
"permafrost": {
color: ["#54443a","#4f4235","#453c30","#524639"],
@@ -6837,7 +7360,7 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 911,
isFood: true,
- stain: 0.05,
+ stain: 0.05
},
"melted_cheese": {
color: "#fcdb53",
@@ -6862,7 +7385,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%1.5|XX",
"XX|L2:mushroom_stalk AND C2:mushroom_gill%20|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
reactions: {
@@ -6891,7 +7414,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "XX|CH:dirt>hyphae%1 AND M1|XX",
+ "XX|CH:dirt>hyphae%1 AND M1|XX"
],
reactions: {
"wood": { elem2:"dirt", chance:0.04 },
@@ -6992,11 +7515,12 @@ SEEDRISE: function(pixel) {
breakInto: [null,null,"mycelium"]
},
"hyphae": {
- color: "#c79789",
+ color: ["#c79789","#bd937b"],
+ grain: 2,
behavior: [
"CH:dirt>hyphae,hyphae,mycelium%0.5|CR:mushroom_spore%0.5|CH:dirt>hyphae,hyphae,mycelium%0.5",
"CH:dirt>mycelium%0.5|XX|CH:dirt>mycelium%0.5",
- "CH:dirt>hyphae,hyphae,mycelium%0.5|XX|CH:dirt>hyphae,hyphae,mycelium%0.5",
+ "CH:dirt>hyphae,hyphae,mycelium%0.5|XX|CH:dirt>hyphae,hyphae,mycelium%0.5"
],
reactions: {
"wood": { elem2:"dirt", chance:0.04 },
@@ -7026,6 +7550,7 @@ SEEDRISE: function(pixel) {
},
"mycelium": {
color: ["#734d5e","#734d5e","#734d5e","#61404f","#6b4b5a","#755061","#866372","#987886","#ab8e9a","#bea4ad","#d0b9c1","#e3cfd5"],
+ buttonColor: ["#e3cfd5","#734d5e"],
behavior: behaviors.POWDER,
reactions: {
"dead_plant": { elem2:[null,null,null,"mycelium","hyphae"], chance:0.0025 },
@@ -7081,6 +7606,7 @@ SEEDRISE: function(pixel) {
},
"lichen": {
color: ["#b6d6c3","#769482"],
+ grain: 2,
tick: function(pixel) {
if (!tryMove(pixel,pixel.x,pixel.y+1)) {
var coords = [
@@ -7123,7 +7649,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M2|DB%50 AND M2|M2",
"M1|XX|M1",
- "M1|DB%50 AND M1|M1",
+ "M1|DB%50 AND M1|M1"
],
onCollide: function(pixel1,pixel2) {
if (elements.antimatter.ignore.indexOf(pixel2.element) !== -1 || elements[pixel2.element].isGas) return;
@@ -7158,7 +7684,7 @@ SEEDRISE: function(pixel) {
behavior: behaviors.LIQUID,
viscosity: 20,
tempHigh: 600,
- stateHigh: ["dioxin","smoke","dioxin","smoke","stench"],
+ stateHigh: ["dioxin","smoke","dioxin","smoke","stench"]
},
"cloth": {
color: ["#F7F7F7","#F1F1F1","#E8E8E8","#CDCDCD"],
@@ -7335,7 +7861,7 @@ SEEDRISE: function(pixel) {
stateHigh: "fire",
state: "solid",
density: 65,
- movable: false,
+ movable: false
},
"bamboo": {
color: ["#7cc00c","#77a012"],
@@ -7495,6 +8021,7 @@ SEEDRISE: function(pixel) {
density: 7260,
conduct: 0.45,
hardness: 0.15,
+ fireColor: ["#DBD1E9","#D7E9F2","#9AB0D1"],
movable: false,
superconductAt: -269.45
},
@@ -7625,12 +8152,11 @@ SEEDRISE: function(pixel) {
reactions: {
"aluminum": { elem1:["molten_gallium","molten_gallium","alga"], elem2:null, chance:0.01 },
"molten_aluminum": { elem1:"alga", elem2:"molten_alga", chance:0.05 },
- "sodium": { elem1:"hydrogen", elem2:"salt", chance:0.005 },
"steel": { elem2:"iron", chance:0.005 },
"gold": { elem1:null, elem2:"blue_gold", chance:0.01 },
"gold_coin": { elem1:null, elem2:"blue_gold", chance:0.01 }
},
- stain: 0.05,
+ stain: 0.05
},
"gallium_gas": {
density: 6.31
@@ -7648,7 +8174,7 @@ SEEDRISE: function(pixel) {
hidden: true
},
"purple_gold": {
- color: ["#f58fda","#d06cb5","#f58fda"],
+ color: ["#ee8ef5","#c96cd0","#ee8ef5"],
behavior: behaviors.WALL,
tempHigh: 1060,
category: "solids",
@@ -7685,7 +8211,7 @@ SEEDRISE: function(pixel) {
alias: "green gold"
},
"pyrite": {
- color: ["#e8e0cb","#cdcaaf","#726a53","#8f835e","#bfb9a0",],
+ color: ["#f7f6e8","#d6d285","#d1bf75","#b3974d","#a48546"],
behavior: behaviors.WALL,
tempHigh: 1182.5,
category: "solids",
@@ -7900,7 +8426,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:foam%1|XX",
"M2|XX|M2",
- "M2|M1|M2",
+ "M2|M1|M2"
],
onMix: function(milk1,milk2) {
if (Math.random() < 0.5) releaseElement(milk1, "foam");
@@ -8041,7 +8567,7 @@ SEEDRISE: function(pixel) {
hidden: true,
isFood: true,
state: "liquid",
- density: 959.97,
+ density: 959.97
},
"nut_milk": {
color: "#D7D1C3",
@@ -8146,7 +8672,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"M2%0.5|XX|M2%0.5",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"milk": { elem2:null, chance:0.025 },
@@ -8222,7 +8748,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:plague,stench,stench,stench,fly%0.25 AND CH:cheese,cheese_powder>rotten_cheese%1|XX",
"CH:cheese,cheese_powder>rotten_cheese%1|XX|CH:cheese,cheese_powder>rotten_cheese%1",
- "XX|M1 AND CH:cheese,cheese_powder>rotten_cheese%1|XX",
+ "XX|M1 AND CH:cheese,cheese_powder>rotten_cheese%1|XX"
],
tempHigh: 54,
stateHigh: ["melted_cheese","melted_cheese","melted_cheese","melted_cheese","melted_cheese","melted_cheese","melted_cheese","melted_cheese","melted_cheese","stench"],
@@ -8270,7 +8796,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|ST:vine|XX",
"ST:vine|XX|ST:vine",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"radiation": { elem1:"explosion", chance:0.1, color1:"#291824" },
@@ -8362,7 +8888,7 @@ SEEDRISE: function(pixel) {
category:"food",
state: "solid",
density: 1400,
- isFood: true,
+ isFood: true
},
"lettuce": {
color: ["#a2c96b","#81C520","#639917"],
@@ -8397,7 +8923,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|ST:vine|XX",
"ST:vine|XX|ST:vine",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"rock": { elem1:"sauce", chance:0.1 },
@@ -8527,8 +9053,7 @@ SEEDRISE: function(pixel) {
state: "solid",
density: 721,
seed: "corn_seed",
- isFood: true,
- movable: false,
+ isFood: true
},
"popcorn": {
color: ["#a6a076","#ebe4ab","#ebe4ab","#ebe4ab","#ebe4ab","#ebe4ab","#ebe4ab","#c99947"],
@@ -8545,11 +9070,11 @@ SEEDRISE: function(pixel) {
isFood: true
},
"corn_seed": {
- color: ["#f2b813","#f9e3ba"],
+ color: ["#f9e3ba","#f2b813"],
behavior: [
"XX|M2%0.25|XX",
"XX|L2:plant,corn AND C2:corn%30|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
tick: behaviors.SEEDRISE,
tempHigh: 400,
@@ -8571,7 +9096,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|SH:wire%1|XX",
"SH:wire%1|XX|SH:wire%1",
- "M2|M1 AND SH:wire%1|M2",
+ "M2|M1 AND SH:wire%1|M2"
],
reactions: {
"zinc": { charge2:1, chance:0.01 },
@@ -8621,11 +9146,11 @@ SEEDRISE: function(pixel) {
hidden: true
},
"potato_seed": {
- color: ["#cda57f","#aa7437","#bc9563"],
+ color: ["#cda57f","#bc9563","#aa7437"],
behavior: [
"XX|CH:dirt>fiber|XX",
"CH:dirt>potato%5|CH:potato%1|CH:dirt>potato%5",
- "XX|SW:dirt%3 AND M1|XX",
+ "XX|SW:dirt%3 AND M1|XX"
],
tempHigh: 400,
stateHigh: "fire",
@@ -8646,7 +9171,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber,fiber%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber%0.5",
+ "CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber,fiber%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand>root,fiber%0.5"
],
reactions: {
"rock": { elem2:"sand", chance:0.0004 },
@@ -8690,7 +9215,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CL:70%10|XX",
"CL:70%10 AND SW:bread%30|XX|CL:70%10 AND SW:bread%30",
- "XX|M1|XX",
+ "XX|M1|XX"
],
reactions: {
"bread": { elem1:"bread" },
@@ -8844,7 +9369,8 @@ SEEDRISE: function(pixel) {
breakInto: "flour",
state: "solid",
density: 1182,
- isFood: true
+ isFood: true,
+ darkText: true
},
"candy": {
color: "#e6cab1",
@@ -8856,7 +9382,8 @@ SEEDRISE: function(pixel) {
category: "food",
state: "solid",
density: 900,
- isFood: true
+ isFood: true,
+ darkText: true
},
"coffee_bean": {
color: ["#994528","#772C12","#5c2513","#4a2416"],
@@ -8925,7 +9452,7 @@ SEEDRISE: function(pixel) {
category: "food",
state: "solid",
density: 325,
- isFood: true,
+ isFood: true
},
"nut_oil": {
color: "#E7D784",
@@ -8945,7 +9472,8 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 910,
isFood: true,
- alias: "cooking oil"
+ alias: "cooking oil",
+ darkText: true
},
"nut_meat": {
color: ["#deba8e","#d1a56f","#ba8b50"],
@@ -8974,7 +9502,7 @@ SEEDRISE: function(pixel) {
state: "solid",
density: 905,
isFood: true,
- hidden: true,
+ hidden: true
},
"nut_butter": {
color: "#cd9141",
@@ -8993,7 +9521,7 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 1090.5,
isFood: true,
- hidden: true,
+ hidden: true
},
"jelly": {
color: "#A35298",
@@ -9036,7 +9564,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2%5|M1|M2%5",
+ "M2%5|M1|M2%5"
],
tempHigh: 1000,
stateHigh: ["smoke","smoke","smoke","calcium"],
@@ -9053,7 +9581,7 @@ SEEDRISE: function(pixel) {
behavior: behaviors.STURDYPOWDER,
category: "food",
isFood: true,
- stateHighColorMultiplier: 0.955,
+ stateHighColorMultiplier: 0.955
},
"ice_cream": {
color: ["#f7f7f7","#ededed","#dedede"],
@@ -9180,10 +9708,11 @@ SEEDRISE: function(pixel) {
state: "solid",
density: 1019.5,
conduct: 0.05,
- movable: false,
+ movable: false
},
"hair": {
color: ["#C6C3BF","#EEDFC0","#DAB575","#BF9F6C","#C67945","#9B6E47","#967454","#945F36","#4C3D2E","#5A3E2D","#1c1c1c","#4A2227","#6D342B","#9D4C3B","#C25E3B"],
+ buttonColor: ["#C67945","#1c1c1c"],
singleColor: true,
behavior: behaviors.WALL,
tick: function(pixel) {
@@ -9297,7 +9826,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:bubble%0.25|XX",
"M2|XX|M2",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"rust": { elem2: "iron", chance:0.01 },
@@ -9461,7 +9990,8 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 998,
stainSelf: true,
- isFood: true
+ isFood: true,
+ darkText: true
},
"ink": {
color: "#171717",
@@ -9561,7 +10091,7 @@ SEEDRISE: function(pixel) {
"oxygen": { elem2:null, chance:0.05 },
"carbon_dioxide": { elem2:null, chance:0.05 },
"alcohol": { elem1:[null,"dna"], chance:0.02 },
- "blood": { elem2:"bubble", color2:"#f07878", attr2:{"clone":"blood"}, chance:0.001, tempMin:85 },
+ "blood": { elem2:"bubble", color2:"#f07878", attr2:{"clone":"blood"}, chance:0.001, tempMin:85 }
},
viscosity: 10,
tempHigh: 124.55,
@@ -9777,7 +10307,8 @@ SEEDRISE: function(pixel) {
"pilk": { elem2:"foam", color1:"#9c7954", chance:0.005},
"cream": { elem2:null, color1:"#9c6c38", chance:0.005},
"ice_cream": { elem2:null, color1:"#9c6c38", chance:0.005},
- "tea": { elem2:"bubble", color2:"#87633d", attr2:{"clone":"tea"}, chance:0.001, tempMin:80 }
+ "tea": { elem2:"bubble", color2:"#87633d", attr2:{"clone":"tea"}, chance:0.001, tempMin:80 },
+ "paper": { stain2:"#6c4317", chance:0.1 }
},
tempHigh: 125,
stateHigh: ["steam","fragrance",null],
@@ -9787,6 +10318,7 @@ SEEDRISE: function(pixel) {
state: "liquid",
density: 1001,
stain: -0.1,
+ ignore: ["paper"],
hidden: true,
isFood: true
},
@@ -9846,7 +10378,7 @@ SEEDRISE: function(pixel) {
isFood: true
},
"sap": {
- color: ["#b67f18","#c86305","#cf7a19","#e4ae3a"],
+ color: ["#e4ae3a","#cf7a19","#c86305","#b67f18"],
behavior: behaviors.LIQUID,
reactions: {
"dead_bug": { elem1:"amber", elem2:null, chance:0.1 },
@@ -9879,7 +10411,8 @@ SEEDRISE: function(pixel) {
behavior: behaviors.LIQUID,
reactions: {
"grape": { elem1:null, elem2:"jelly", chance:0.005, tempMin:100 },
- "salt": { elem2:null, color1:"#ffbd80", chance:0.005}
+ "salt": { elem2:null, color1:"#ffbd80", chance:0.005},
+ "herb": { tempMax:180, elem1:"sugar", color1:["#c92626","#e3e3e3","#c92626","#e3e3e3","#c92626"], elem2:null, chance:0.1 }
},
viscosity: 500,
tempLow: -20,
@@ -9971,7 +10504,7 @@ SEEDRISE: function(pixel) {
stateHigh: "grease",
reactions: {
"caustic_potash": { elem1:"soap", elem2:null }
- },
+ }
},
"melted_chocolate": {
color: "#3b160b",
@@ -10141,7 +10674,7 @@ SEEDRISE: function(pixel) {
fireElement: null
},
"limestone": {
- color: ["#c5b79c","#d9ccb2","#f8f1db","#fcfaeb"],
+ color: ["#fcfaeb","#f8f1db","#d9ccb2","#c5b79c"],
behavior: behaviors.STURDYPOWDER,
tempHigh: 825,
stateHigh: ["quicklime","quicklime","quicklime","quicklime","quicklime","quicklime","carbon_dioxide"],
@@ -10326,6 +10859,7 @@ SEEDRISE: function(pixel) {
"pool_water": { elem1:"bubble", chance:0.01, temp2:250 },
"primordial_soup": { elem1:"bubble", chance:0.01, temp2:250 },
"nut_milk": { elem1:"bubble", chance:0.01, temp2:250 },
+ "carbon_dioxide": { elem1:"baking_soda", elem2:null, chance:0.02 }
},
category: "powders",
tempHigh: 323,
@@ -10343,7 +10877,7 @@ SEEDRISE: function(pixel) {
"molten_lead": { elem1:"hydrogen", elem2:null, chance:0.005 },
"molten_tin": { elem1:"hydrogen", elem2:null, chance:0.005 },
"molten_zinc": { elem1:"hydrogen", elem2:null, chance:0.005 },
- "molten_galvanized_steel": { elem1:"hydrogen", elem2:"molten_steel", chance:0.01 },
+ "molten_galvanized_steel": { elem1:"hydrogen", elem2:"molten_steel", chance:0.01 }
},
tempHigh: 1388,
stateHigh: "smoke"
@@ -10372,7 +10906,7 @@ SEEDRISE: function(pixel) {
reactions: {
"ice": { "elem1":"explosion" }
},
- burnInto: [null,null,"molten_iron"]
+ burnInto: [null,null,null,null,"molten_iron"]
},
"slag": {
color: ["#4b3a2d","#6a5447","#6b5b53","#675851","#78756e"],
@@ -10397,7 +10931,7 @@ SEEDRISE: function(pixel) {
density: 13920,
hardness: 0.1,
hidden: true,
- conduct: 0.37,
+ conduct: 0.37
},
"molten_aluminum": {
color: ["#e6e0db","#d0d7cb","#d3d2d5"],
@@ -10446,7 +10980,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2%5|XX",
"M1%8|XX|M1%8",
- "XX|M2%5|XX",
+ "XX|M2%5|XX"
],
reactions: {
"plant": { elem1:"cloud" },
@@ -10470,7 +11004,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M2|M1|M2",
"M1|DL%0.5|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"oxygen": { elem2:"stench", chance:0.01 },
@@ -10497,7 +11031,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M2|M1|M2",
"M1|DL%0.5|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"stench": { elem2:null },
@@ -10520,7 +11054,9 @@ SEEDRISE: function(pixel) {
reactions: {
"liquid_stench": { elem2:null }
},
- category: "liquids"
+ category: "liquids",
+ tempHigh: 40,
+ stateHigh: "fragrance"
},
"cyanide": {
color: "#b6ccb6",
@@ -10549,7 +11085,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"M1%7|XX|M1%7",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"carbon_dioxide": { elem1:null, elem2:null, chance:0.05 },
@@ -10613,7 +11149,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CO:1%5|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"rain_cloud": { elem1:"rain_cloud", temp1:-20 },
@@ -10637,7 +11173,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:water%0.05|M1%2.5 AND BO",
- "CR:electric%0.05|CR:electric%0.05|CR:electric%0.05",
+ "CR:electric%0.05|CR:electric%0.05|CR:electric%0.05"
],
reactions: {
"anesthesia": { elem1:"acid_cloud", elem2:null, chance:0.05 },
@@ -10661,7 +11197,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:snow%0.05|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
category:"gases",
temp: -10,
@@ -10670,6 +11206,7 @@ SEEDRISE: function(pixel) {
tempLow: -200,
stateLow: "hail_cloud",
state: "gas",
+ breakInto: "snow",
density: 0.55,
ignoreAir: true,
conduct: 0.01
@@ -10679,13 +11216,14 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:hail%0.05|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
category:"gases",
temp: -200,
tempHigh: -160,
stateHigh: "snow_cloud",
state: "gas",
+ breakInto: "hail",
density: 0.6,
ignoreAir: true,
conduct: 0.01
@@ -10695,7 +11233,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:lightning%0.001 AND CH:water%0.05|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tick: function(pixel) {
pixel.temp = 70;
@@ -10705,6 +11243,7 @@ SEEDRISE: function(pixel) {
tempLow: 0,
stateLow: "snow_cloud",
state: "gas",
+ breakInto: "rain_cloud",
density: 0.55,
ignoreAir: true,
conduct: 0.03
@@ -10714,7 +11253,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tick: function(pixel) {
if (pixel.temp > elements.acid.tempLow && pixel.temp < elements.acid.tempHigh && Math.random() <= 0.0005) {
@@ -10733,6 +11272,7 @@ SEEDRISE: function(pixel) {
category:"gases",
burn: 15,
burnTime: 5,
+ breakInto: "acid",
state: "gas",
density: 0.7,
ignoreAir: true
@@ -10742,13 +11282,14 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:sand%0.075|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"sand": { elem2: "sandstorm", chance:0.2, "y":[0,12], "setting":"clouds" }
},
category:"gases",
hidden: true,
+ breakInto: "sand",
state: "gas",
density: 0.8,
ignoreAir: true
@@ -10758,13 +11299,14 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:ash%0.075|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"fireball": { elem1:null, elem2:"fire_cloud", chance:0.25 }
},
category:"gases",
hidden: true,
+ breakInto: "ash",
state: "gas",
density: 0.7,
ignoreAir: true
@@ -10774,7 +11316,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:fireball%0.02|M1%2.5 AND BO",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"rain_cloud": { elem1: "pyrocumulus", elem2: "pyrocumulus" },
@@ -10788,6 +11330,7 @@ SEEDRISE: function(pixel) {
stateLow: "pyrocumulus",
category:"gases",
state: "gas",
+ breakInto: ["ash","ash","fireball"],
density: 0.8,
ignoreAir: true,
excludeRandom: true
@@ -10797,7 +11340,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:fallout,radiation%0.025|M1%2.5 AND BO",
- "CR:radiation%0.05|CR:radiation%0.05|CR:radiation%0.05",
+ "CR:radiation%0.05|CR:radiation%0.05|CR:radiation%0.05"
],
category:"gases",
hidden: true,
@@ -10810,7 +11353,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"M2%10|XX|M2%10",
- "XX|M2%10|XX",
+ "XX|M2%10|XX"
],
reactions: {
"rad_steam": { elem1: null, elem2: "rad_cloud", chance:0.3, "y":[0,15], "setting":"clouds" },
@@ -10827,6 +11370,7 @@ SEEDRISE: function(pixel) {
stateLow: "fallout",
category: "gases",
hidden: true,
+ breakInto: ["fallout","radiation","radiation"],
state: "gas",
density: 0.7
},
@@ -10847,10 +11391,22 @@ SEEDRISE: function(pixel) {
burnTime: 1,
density: 1.977,
customColor: true,
- stain: 0.25
+ stain: 0.25,
+ darkText: true
},
"portal_in": {
color: "#ff9a00",
+ onShiftSelect: function(element) {
+ promptInput("Enter a number to use as the portal channel. (Default 0)", function(r) {
+ if (r === "") return;
+ r = parseInt(r);
+ if (isNaN(r)) {
+ logMessage("Invalid integer - portal channel not set.")
+ return;
+ };
+ currentElementProp = { channel:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel) {
// if (Math.random() > 0.1) return;
if (!ticktemp.portal_out) ticktemp.portal_out = {};
@@ -10916,6 +11472,17 @@ SEEDRISE: function(pixel) {
},
"portal_out": {
color: "#00a2ff",
+ onShiftSelect: function(element) {
+ promptInput("Enter a number to use as the portal channel. (Default 0)", function(r) {
+ if (r === "") return;
+ r = parseInt(r);
+ if (isNaN(r)) {
+ logMessage("Invalid integer - portal channel not set.")
+ return;
+ };
+ currentElementProp = { channel:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
tick: function(pixel){
doElectricity(pixel);
},
@@ -10930,41 +11497,10 @@ SEEDRISE: function(pixel) {
conduct:1,
emit:true
},
-"led_r": {
+"led": {
color: "#ff0000",
- buttonColor: "#660000",
- behavior: behaviors.WALL,
- renderer: renderPresets.LED,
- reactions: {
- "light": {charge1:1,elem2:null},
- "liquid_light": {charge1:1,elem2:null}
- },
- category: "machines",
- tempHigh: 1500,
- stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"],
- conduct: 1,
- breakInto: "glass_shard",
- forceSaveColor: true
-},
-"led_g": {
- color: "#00ff00",
- buttonColor: "#006600",
- behavior: behaviors.WALL,
- renderer: renderPresets.LED,
- reactions: {
- "light": {charge1:1,elem2:null},
- "liquid_light": {charge1:1,elem2:null}
- },
- category: "machines",
- tempHigh: 1500,
- stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"],
- conduct: 1,
- breakInto: "glass_shard",
- forceSaveColor: true
-},
-"led_b": {
- color: "#0000ff",
- buttonColor: "#000066",
+ buttonColor: ["#660000","#660000","#006600","#006600","#000066","#000066"],
+ customColor: true,
behavior: behaviors.WALL,
renderer: renderPresets.LED,
reactions: {
@@ -10986,7 +11522,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|CR:light|XX",
"CR:light|XX|CR:light",
- "XX|CR:light|XX",
+ "XX|CR:light|XX"
],
category: "machines",
tempHigh: 1500,
@@ -11015,6 +11551,11 @@ SEEDRISE: function(pixel) {
"molten_sulfur": {
color: "#831502",
behavior: behaviors.LIQUID,
+ tick: function(pixel) {
+ if (!pixel.burning && pixel.temp >= 232) {
+ burnPixel(pixel);
+ }
+ },
reactions: {
"iron": { elem1: null, elem2: "pyrite" },
"magnesium": { elem1:null, elem2:"epsom_salt", chance:0.01 },
@@ -11040,7 +11581,7 @@ SEEDRISE: function(pixel) {
color: "#b0a65d",
burnTime: 10,
density: 2.16,
- burnInto: ["smoke","smoke","smoke","smoke","stench"],
+ burnInto: ["smoke","smoke","smoke","smoke","stench"]
},
"copper_sulfate": {
color: ["#4391fd","#004cfe"],
@@ -11070,6 +11611,12 @@ SEEDRISE: function(pixel) {
"candy": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
"flour": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
"chocolate": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "soda": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "chocolate_powder": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "chocolate_milk": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "juice": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "fruit_milk": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
+ "ice_cream": {elem1:"oxidized_copper", elem2:null, color1:["#CB3D3D","#A6292B","#6E1B1B"]},
},
tempHigh: 110,
fireColor: ["#91d106","#feff97","#248e01"],
@@ -11083,7 +11630,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|LB:plant AND RT%5|M1 AND BO:1,2,3",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"rat": {elem2:null},
@@ -11099,7 +11646,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M2|M1",
"XX|RT%20|M2",
- "CF|XX|XX",
+ "CF|XX|XX"
],
onClicked: behaviors.CLONE_ON_CLICK,
ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","ecloner"],
@@ -11113,7 +11660,7 @@ SEEDRISE: function(pixel) {
"M1 AND SW%33|XX|M1 AND SW%33",
"XX|M1 AND SW%33|XX"
],
- category:"special",
+ category:"special"
},
"midas_touch": {
color: ["#ffdf5e","#ffe682"],
@@ -11161,14 +11708,14 @@ SEEDRISE: function(pixel) {
},
density: 193,
state: "liquid",
- category:"special",
+ category:"special"
},
"radiation": {
color: ["#00ff00","#6fff00"],
behavior: [
"XX|M1%0.5 AND HT|XX",
"M1%7 AND HT|DL%3|M1%7 AND HT",
- "XX|M1%1 AND HT|XX",
+ "XX|M1%1 AND HT|XX"
],
reactions: {
"water": { elem2:"rad_steam", chance:0.4 },
@@ -11281,7 +11828,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:radiation%2|XX",
"CR:radiation%2|CH:radiation%0.5|CR:radiation%2",
- "M2|M1 AND CR:radiation%2|M2",
+ "M2|M1 AND CR:radiation%2|M2"
],
category:"energy",
hidden: true,
@@ -11293,7 +11840,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|CH:proton%0.25 AND DL%0.25|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tick: behaviors.BOUNCY,
reactions: {
@@ -11319,12 +11866,12 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|DL%0.5|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
behaviorOn: [
"XX|XX|XX",
"XX|CH:hydrogen|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
tick: behaviors.BOUNCY,
reactions: {
@@ -11345,7 +11892,7 @@ SEEDRISE: function(pixel) {
behavior: [
"CL%5|CL%5 AND SH|CL%5",
"CL%5 AND SH|SH%5 AND DL%50|CL%5 AND SH",
- "M1%15 AND CL%6|M1%50 AND CL%13 AND SH|M1%15 AND CL%6",
+ "M1%15 AND CL%6|M1%50 AND CL%13 AND SH|M1%15 AND CL%6"
],
charge: 3,
category: "energy",
@@ -11353,8 +11900,6 @@ SEEDRISE: function(pixel) {
density: 2.1,
insulate: true,
ignoreAir: true,
- ignore: ["shocker"],
- ignoreConduct: ["shocker"],
alias: "electron"
},
"uranium": {
@@ -11362,7 +11907,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|RL:radiation%1 AND CH:lead%0.001|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"neutron": { elem1:"n_explosion", tempMin:500, chance:0.1 }
@@ -11452,7 +11997,6 @@ SEEDRISE: function(pixel) {
density: 3905,
conduct: 0.39,
hardness: 0.1,
- alias: "gallanylidynealumane",
hidden: true
},
"metal_scrap": {
@@ -11532,7 +12076,8 @@ SEEDRISE: function(pixel) {
state: "solid",
density: 2000,
hardness: 0.325,
- hidden: true
+ hidden: true,
+ darkText: true
},
"feather": {
color: ["#ffffff","#e3e3e3","#d1d1d1"],
@@ -11548,10 +12093,11 @@ SEEDRISE: function(pixel) {
},
"confetti": {
color: ["#dc2c37","#edce66","#0dbf62","#0679ea","#7144b2","#d92097"],
+ buttonColor: ["#ffe629","#ff29c2"],
behavior: [
"XX|XX|XX",
"XX|FX%0.25|XX",
- "M2%25|M1%25|M1%25",
+ "M2%25|M1%25|M1%25"
],
reactions: {
"water": { elem1:[null,"cellulose"], chance:0.001 },
@@ -11571,7 +12117,7 @@ SEEDRISE: function(pixel) {
density: 1201
},
"glitter": {
- color: ["#dbbfe3", "#cc95db","#c477d9","#b85cd1", "#8d5cd1","#9e77d9","#cc95db", "#95a4db","#7789d9","#5c68d1", "#c1bfe3"],
+ color: ["#c1bfe3", "#dbbfe3", "#cc95db","#c477d9","#b85cd1", "#8d5cd1","#9e77d9","#cc95db", "#95a4db","#7789d9","#5c68d1"],
behavior: behaviors.POWDER,
category: "powders",
tempHigh: 100,
@@ -11646,7 +12192,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
tick: function(pixel) {
if ((pixel.foam || Math.random() < 0.25) && isEmpty(pixel.x,pixel.y-1)) {
@@ -11826,7 +12372,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M2|M1|M2",
"M1|DL%25|M1",
- "M2|M1|M2",
+ "M2|M1|M2"
],
reactions: {
"cancer": { elem2:null },
@@ -11907,7 +12453,7 @@ SEEDRISE: function(pixel) {
"mercury_gas": { elem2: null },
"solid_mercury": { elem2: null },
"ice_nine": { elem2: "ice" },
- "strange_matter": { elem2: "neutron" },
+ "strange_matter": { elem2: null },
"frozen_frog": { elem2: "frog" },
"frozen_worm": { elem2: "worm" },
"molten_thermite": { elem2: "rock" },
@@ -12082,7 +12628,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|EX:3|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
category: "energy",
state: "gas",
@@ -12093,11 +12639,20 @@ SEEDRISE: function(pixel) {
},
"explosion": {
color: ["#ffb48f","#ffd991","#ffad91"],
- behavior: [
- "XX|XX|XX",
- "XX|EX:10|XX",
- "XX|XX|XX",
- ],
+ behavior: behaviors.WALL,
+ onShiftSelect: function(element) {
+ promptInput("Enter a radius from 1 to 100. (Default 10)", function(r) {
+ if (!r) return;
+ r = parseInt(r);
+ if (isNaN(r)) return;
+ r = Math.min(100, r);
+ r = Math.max(1, r);
+ currentElementProp = { radius:r }
+ }, elemTitleCase(elements[element].name || element));
+ },
+ tick: function(pixel) {
+ explodeAt(pixel.x, pixel.y, pixel.radius || 10, "fire")
+ },
temp: 300,
category: "energy",
state: "gas",
@@ -12110,7 +12665,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|EX:40>plasma,plasma,plasma,plasma,radiation,rad_steam|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
temp: 100000000,
category: "energy",
@@ -12126,7 +12681,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|EX:80>plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,plasma,molten_iron,molten_uranium,molten_lead,oxygen,molten_sodium,sulfur_gas,neon,chlorine,molten_calcium,molten_nickel,molten_copper,molten_zinc,gallium_gas,molten_potassium,mercury,molten_aluminum AND CH:void|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
temp: 99999999700,
category: "energy",
@@ -12159,8 +12714,7 @@ SEEDRISE: function(pixel) {
tool: function(pixel) {
pixel.temp += 10000;
if (!pixel.burning && elements[pixel.element].burn) {
- pixel.burning = true;
- pixel.burnStart = pixelTicks;
+ burnPixel(pixel)
}
pixelTempCheck(pixel);
},
@@ -12181,7 +12735,7 @@ SEEDRISE: function(pixel) {
behavior: [
"M1%15 AND CL%6|M1%50 AND CL%13|M1%15 AND CL%6",
"CL%5|DL%50|CL%5",
- "CL%5|CL%5|CL%5",
+ "CL%5|CL%5|CL%5"
],
reactions: {
"electric": { elem1:"light", elem2:"explosion" },
@@ -12200,7 +12754,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|EX:10|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
conduct: 1,
category: "weapons",
@@ -12221,7 +12775,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|EX:10|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
conduct: 1,
category: "weapons",
@@ -12238,12 +12792,12 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:6>metal_scrap,fire,fire,fire%1|XX",
"XX|XX|XX",
- "M2|M1 AND EX:6>metal_scrap,fire,fire,fire%1|M2",
+ "M2|M1 AND EX:6>metal_scrap,fire,fire,fire%1|M2"
],
behaviorOn: [
"XX|XX|XX",
"XX|EX:6>metal_scrap,fire,fire,fire%1|XX",
- "M2|M1 AND EX:6>metal_scrap,fire,fire,fire%1|M2",
+ "M2|M1 AND EX:6>metal_scrap,fire,fire,fire%1|M2"
],
category: "weapons",
state: "solid",
@@ -12261,7 +12815,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|EX:15|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
conduct: 1,
category: "weapons",
@@ -12278,7 +12832,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|EX:10|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
conduct: 1,
category: "weapons",
@@ -12297,7 +12851,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|M1|M1",
"XX|XX|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
onCollide: function(pixel1,pixel2) {
if (elements[pixel2.element].fireColor) {
@@ -12335,8 +12889,7 @@ SEEDRISE: function(pixel) {
color: "#c44f45",
tick: function(pixel) {
if ((pixel.temp > 1000 || pixel.charge) && !pixel.burning) {
- pixel.burning = true;
- pixel.burnStart = pixelTicks;
+ burnPixel(pixel);
}
if (pixel.burning) {
if (!tryMove(pixel, pixel.x, pixel.y-1)) {
@@ -12369,7 +12922,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|DL%25|M2",
- "XX|M2|M1",
+ "XX|M2|M1"
],
burning: true,
burnInto: "ash",
@@ -12382,14 +12935,15 @@ SEEDRISE: function(pixel) {
hidden: true,
state: "gas",
density: 700,
- alias: "firework ember"
+ alias: "firework ember",
+ darkText: true
},
"nuke": {
color: "#534636",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1 AND EX:60>plasma,plasma,plasma,plasma,radiation,rad_steam|M2",
+ "M2|M1 AND EX:60>plasma,plasma,plasma,plasma,radiation,rad_steam|M2"
],
category: "weapons",
state: "solid",
@@ -12402,7 +12956,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1 AND EX:90>plasma,plasma,plasma,plasma,fire|M2",
+ "M2|M1 AND EX:90>plasma,plasma,plasma,plasma,fire|M2"
],
category: "weapons",
state: "solid",
@@ -12416,7 +12970,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|XX|XX",
- "M2|M1 AND EX:40>radiation,radiation,radiation,rad_steam|M2",
+ "M2|M1 AND EX:40>radiation,radiation,radiation,rad_steam|M2"
],
category: "weapons",
state: "solid",
@@ -12458,7 +13012,7 @@ SEEDRISE: function(pixel) {
behaviorOn: [
"XX|XX|XX",
"XX|EX:10|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
reactions: {
"clay": { elem1:"dynamite", elem2:"dynamite" },
@@ -12517,7 +13071,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:fire%25|XX",
"XX|CC:782828,783b28,784b28%25|XX",
- "M2|M1 AND EX:8|M2",
+ "M2|M1 AND EX:8|M2"
],
reactions: {
"water": { elem1:"rock", elem2:"steam" }
@@ -12573,6 +13127,7 @@ SEEDRISE: function(pixel) {
},
"antibomb": {
color: "#adb3be",
+ onShiftSelect: behaviors.CLONER_SHIFT_SELECT,
tick: function(pixel) {
doDefaults(pixel)
if (!tryMove(pixel,pixel.x,pixel.y+1)) {
@@ -12584,7 +13139,7 @@ SEEDRISE: function(pixel) {
var elem = "smoke";
}
if (elem !== "antibomb") {
- explodeAt(pixel.x,pixel.y,8,elem)
+ explodeAt(pixel.x,pixel.y,8,pixel.clone || elem);
}
}
},
@@ -12599,7 +13154,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:10>cold_fire|XX",
"XX|XX|XX",
- "M2|M1 AND EX:10>cold_fire|M2",
+ "M2|M1 AND EX:10>cold_fire|M2"
],
category: "weapons",
state: "solid",
@@ -12614,7 +13169,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|HT:20000 AND EX:15>plasma|XX",
"XX|XX|XX",
- "M2|M1 AND HT:20000 AND EX:15>plasma|M2",
+ "M2|M1 AND HT:20000 AND EX:15>plasma|M2"
],
category: "weapons",
state: "solid",
@@ -12627,7 +13182,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:20>antimatter|XX",
"XX|XX|XX",
- "M2|M1 AND EX:20>antimatter|M2",
+ "M2|M1 AND EX:20>antimatter|M2"
],
category: "weapons",
state: "solid",
@@ -12643,7 +13198,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:15>confetti,flash,flash,smoke|XX",
"XX|XX|XX",
- "M2|M1 AND EX:15>confetti,flash,flash,smoke|M2",
+ "M2|M1 AND EX:15>confetti,flash,flash,smoke|M2"
],
category: "weapons",
state: "solid",
@@ -12656,7 +13211,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:20>flash%1|XX",
"XX|XX|XX",
- "M2|M1 AND EX:20>flash%1|M2",
+ "M2|M1 AND EX:20>flash%1|M2"
],
category: "weapons",
state: "solid",
@@ -12687,7 +13242,6 @@ SEEDRISE: function(pixel) {
},
reactions: {
"blood": { elem1:"pointer" },
- "molten_stained_glass": { elem1:"rainbow" },
"electric": { elem1:"pointer" }
},
category: "energy",
@@ -12704,7 +13258,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:smoke|XX",
"XX|EX:4>smoke%1|XX",
- "M2|M1|M2",
+ "M2|M1|M2"
],
category: "weapons",
state: "solid",
@@ -12721,7 +13275,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|EX:20|XX",
"XX|XX|XX",
- "XX|M1|XX",
+ "XX|M1|XX"
],
category: "weapons",
state: "solid",
@@ -12907,7 +13461,7 @@ SEEDRISE: function(pixel) {
density: 100000000,
maxSize: 1,
cooldown: defaultCooldown,
- excludeRandom: true,
+ excludeRandom: true
},
"tsunami": {
color: ["#91b9bd","#566f99","#192f61"],
@@ -12965,7 +13519,7 @@ SEEDRISE: function(pixel) {
maxSize: 1,
density: 997,
cooldown: defaultCooldown,
- excludeRandom: true,
+ excludeRandom: true
},
"blaster": {
color: ["#ff0000","#ff4d00","#ff7700"],
@@ -13010,7 +13564,7 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|XX|XX",
"XX|EX:10>armageddon,fire,fire,fire,fire,fire,fire,fire,fire,fire,fire,fire,fire%25 AND DL%10|XX",
- "XX|XX|XX",
+ "XX|XX|XX"
],
category: "weapons",
state: "solid",
@@ -13020,34 +13574,6 @@ SEEDRISE: function(pixel) {
maxSize: 1,
cooldown: defaultCooldown
},
-"tesla_coil": {
- color: "#725c38",
- behavior: behaviors.WALL,
- behaviorOn: [
- "XX|CR:plasma|XX",
- "CR:plasma|XX|CR:plasma",
- "XX|CR:plasma|XX",
- ],
- category: "machines",
- conduct: 1,
- insulate: true,
- ignoreConduct: ["plasma"],
- temp: 7065
-},
-"shocker": {
- color: "#78784c",
- behavior: behaviors.WALL,
- behaviorOn: [
- "XX|CR:electric AND SH|XX",
- "CR:electric AND SH|XX|CR:electric AND SH",
- "XX|CR:electric AND SH|XX",
- ],
- colorOn: "#ffff59",
- category: "machines",
- conduct: 1,
- ignore: ["shocker"],
- ignoreConduct: ["electric"]
-},
"pressure_plate": {
color: "#8a8a84",
tick: function(pixel) {
@@ -13064,10 +13590,7 @@ SEEDRISE: function(pixel) {
var x = coordsToShock[i][0];
var y = coordsToShock[i][1];
if (!isEmpty(x,y,true)) {
- var newpixel = pixelMap[x][y];
- if (elements[newpixel.element].conduct) {
- newpixel.charge = 1;
- }
+ chargePixel(pixelMap[x][y]);
}
}
}
@@ -13087,12 +13610,12 @@ SEEDRISE: function(pixel) {
behavior: [
"XX|CR:foam%2|XX",
"M2|CH:algae,cell,mushroom_spore,lichen,yeast,antibody,cellulose,seltzer,oxygen%0.005|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
behaviorOn: [
"XX|CR:foam%25|XX",
"M2|CH:algae,cell,mushroom_spore,lichen,yeast,antibody,cellulose,seltzer,oxygen%5|M2",
- "M1|M1|M1",
+ "M1|M1|M1"
],
reactions: {
"cancer": { elem1:"dirty_water" },
@@ -13233,7 +13756,7 @@ SEEDRISE: function(pixel) {
pixel[currentProp] = currentPropValue;
if (currentProp === "temp") pixelTempCheck(pixel);
},
- category: "special",
+ category: "special"
},
//ice color: "#c5e9f0"
"salt_ice": { color: "#b6ced4" },
@@ -13297,7 +13820,7 @@ else if (currentMonth == 9) { // October
elements.candy.colorPattern = [
"W","W","W","W","W",
"O","O","O","O","O",
- "Y","Y","Y","Y","Y",
+ "Y","Y","Y","Y","Y"
]
elements.candy.colorKey = {"W":"#ffffff", "Y":"#ffcd55", "O":"#ff9933"}
elements.candy.color = ["#ffffff","#ffffff","#ff9933","#ff9933","#ffcd55","#ffcd55"]
@@ -13314,7 +13837,7 @@ else if (currentMonth == 11) { // December
"RRWWRRRWWR",
"RWWWRRWWWR",
"RWWRRRWWRR",
- "WWWRRWWWRR",
+ "WWWRRWWWRR"
]
elements.candy.colorKey = {"R":"#c92626", "W":"#e3e3e3"}
elements.candy.color = ["#c92626","#e3e3e3","#c92626","#e3e3e3","#c92626"]
@@ -13382,16 +13905,16 @@ keybinds = {};
keybinds["Minus"] = ()=>{ // Decrease the mouse size by 2
if (shiftDown) {mouseSize = 1}
else {
- mouseSize -= 2;
+ mouseSize -= 1;
if (mouseSize < 1) { mouseSize = 1; }
}
- checkMouseSize(true);
+ checkMouseSize(-1);
}
keybinds["BracketLeft"] = keybinds["Minus"];
keybinds["Equal"] = ()=>{ // Increase the mouse size by 2
if (shiftDown) {mouseSize = (mouseSize+15)-((mouseSize+15) % 15)}
- else {mouseSize += 2;}
- checkMouseSize(true);
+ else {mouseSize += 1;}
+ checkMouseSize(1);
}
keybinds["BracketRight"] = keybinds["Equal"];
keybinds["Space"] = ()=>{ // Pause
@@ -13614,6 +14137,20 @@ else if (settings.lang && settings.lang !== "en") {
else if (window.initialData && window.initialData.langCode && window.initialData.langCode !== "en") {
langCode = window.initialData.langCode;
}
+else if (!standalone && settings.lang !== null) {
+ try {
+ // try auto-setting language
+ let code = navigator.languages ? navigator.languages[0] : navigator.language;
+ if (code.match(/^en-?/)) { /*do nothing*/ }
+ else if (code === "pt-BR") langCode = "pt_br";
+ else if (code === "zh-CN") langCode = "zh_cn";
+ else if (code === "zh-HK" || code === "zh-TW") langCode = "zh_hant";
+ else if (code) {
+ langCode = code.toLowerCase().split("-")[0];
+ }
+ }
+ catch (e) {}
+}
// langCode = "test";
if (langCode) {
try {
@@ -14095,6 +14632,32 @@ function langKey(key,fallback,template) {
}
return null;
}
+ function chargePixel(pixel,amount=1) {
+ var con = elements[pixel.element].conduct;
+ if (con !== undefined) {
+ if (Math.random() < con) { // If random number is less than conductivity
+ if (elements[pixel.element].ignore && elements[pixel.element].ignore.indexOf(pixel.element) !== -1) {
+ return;
+ }
+ if (!pixel.charge && !pixel.chargeCD) {
+ pixel.charge = amount;
+ if (elements[pixel.element].colorOn) {
+ pixel.color = pixelColorPick(pixel);
+ }
+ }
+ }
+ }
+ }
+ function burnPixel(pixel) {
+ if (!elements[pixel.element].burn || pixel.burning) return;
+ pixel.burning = true;
+ pixel.burnStart = pixelTicks;
+ }
+ function pixelDistance(x1, y1, x2, y2) {
+ let a = x1 - x2;
+ let b = y1 - y2;
+ return Math.sqrt( a*a + b*b );
+ }
validDensitySwaps = {
"solid": {
@@ -14148,7 +14711,7 @@ function langKey(key,fallback,template) {
// Density
if (info.density !== undefined && elements[newPixel.element].density !== undefined) {
// if the pixel's state + ">" + newPixel's state is in validDensitySwaps, and the pixel's density is larger than the newPixel's density, swap the pixels
- if (validDensitySwaps[info.state][elements[newPixel.element].state] !== undefined && info.density >= elements[newPixel.element].density) {
+ if (validDensitySwaps[info.state][elements[newPixel.element].state] !== undefined && info.density >= elements[newPixel.element].density && newPixel.skip !== true) {
// chance depending on the difference in density
if (Math.random() < (info.density - elements[newPixel.element].density)/(info.density + elements[newPixel.element].density)) {
swapPixels(pixel,newPixel);
@@ -14288,230 +14851,82 @@ function choose(array) {
return array[Math.floor(Math.random()*array.length)];
}
behaviorRules = {
- "M1": function() {
- if (btemp.info.viscosity !== undefined) {
- if (!((Math.random()*100) < 100 / Math.pow(btemp.info.viscosity, 0.25))) {
- btemp.newCoords.x = btemp.pixel.x;
- }
+"M1": function() {
+ if (btemp.info.viscosity !== undefined) {
+ if (!((Math.random()*100) < 100 / Math.pow(btemp.info.viscosity, 0.25))) {
+ btemp.newCoords.x = btemp.pixel.x;
}
- btemp.move1Spots.push(btemp.newCoords);
- },
- "M2": function() {
- if (btemp.info.viscosity !== undefined) {
- if (!((Math.random()*100) < 100 / Math.pow(btemp.info.viscosity, 0.25))) {
- btemp.newCoords.x = btemp.pixel.x;
- }
+ }
+ btemp.move1Spots.push(btemp.newCoords);
+},
+"M2": function() {
+ if (btemp.info.viscosity !== undefined) {
+ if (!((Math.random()*100) < 100 / Math.pow(btemp.info.viscosity, 0.25))) {
+ btemp.newCoords.x = btemp.pixel.x;
}
- btemp.move2Spots.push(btemp.newCoords);
- },
- "SP": function() {
- btemp.supportSpots.push({x:btemp.newCoords.x,y:btemp.newCoords.y,arg:btemp.arg});
- },
- "SA": function() {
- if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
- btemp.move = false;
+ }
+ btemp.move2Spots.push(btemp.newCoords);
+},
+"SP": function() {
+ btemp.supportSpots.push({x:btemp.newCoords.x,y:btemp.newCoords.y,arg:btemp.arg});
+},
+"SA": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
+ btemp.move = false;
+ }
+},
+"DL": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
+ // if the pixel at newCoords is the same element as the pixel, ignore
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ // if info.ignore exists and newPixel.element is in it
+ if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
}
- },
- "DL": function() {
- if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
- // if the pixel at newCoords is the same element as the pixel, ignore
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- // if info.ignore exists and newPixel.element is in it
- if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if ((!(newPixel.element == btemp.pixel.element)) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
- if (btemp.arg !== null) { var args = btemp.arg.split(","); }
- if (btemp.arg === null || args.indexOf(newPixel.element) !== -1) {
- if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness) {
- deletePixel(btemp.newCoords.x,btemp.newCoords.y);
- if (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y) {
- btemp.deleted = true;
- }
- btemp.swapSpots.length = 0;
- }
- }
- }
- }
- },
- "DB": function() {
- if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
- // if the pixel at newCoords is the same element as the pixel, ignore
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- // if info.ignore exists and newPixel.element is in it
- if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if (!(newPixel.element == btemp.pixel.element)) {
- if (btemp.arg !== null) { var args = btemp.arg.split(","); }
- if (btemp.arg === null || args.indexOf(newPixel.element) !== -1) {
- if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness) {
- deletePixel(btemp.newCoords.x,btemp.newCoords.y);
- if (pixelMap[btemp.pixel.x][btemp.pixel.y] !== undefined) {
- deletePixel(btemp.pixel.x,btemp.pixel.y);
- }
- btemp.deleted = true;
- btemp.swapSpots = [];
- }
- }
- }
- }
- },
- "CH": function() {
- if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
- if (btemp.arg.indexOf(">") !== -1) {
- var argfrom = btemp.arg.split(">")[0];
- if (argfrom.indexOf(",") !== -1) {
- if (argfrom.split(",").indexOf(newPixel.element) === -1) {
- return;
- }
- }
- else if (argfrom !== newPixel.element) {
- return;
- }
- var argto = btemp.arg.split(">")[1];
- }
- else {
- var argfrom = null;
- var argto = btemp.arg;
- }
- if (argto.indexOf(",") !== -1) {
- var argto = choose(argto.split(","));
- }
- if (elements[argto]) {
- if (elements[newPixel.element].id !== elements[argto].id) {
- changePixel(newPixel,argto);
- }
- }
- }
- }
- },
- "SW": function() {
- 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) { var args = btemp.arg.split(","); }
if (btemp.arg === null || args.indexOf(newPixel.element) !== -1) {
if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness) {
- btemp.swapSpots.push({x:btemp.newCoords.x,y:btemp.newCoords.y});
- }
- }
- }
- },
- "CR": function() {
- if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
- if (btemp.arg === null) {
- btemp.arg = btemp.pixel.element;
- }
- else if (btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","));
- }
- if (elements[btemp.arg]) {
- createPixel(btemp.arg,btemp.newCoords.x,btemp.newCoords.y);
- if (!pixelMap[btemp.newCoords.x][btemp.newCoords.y]) return;
- if (btemp.info.fireColor && btemp.arg==="fire") {
- pixelMap[btemp.newCoords.x][btemp.newCoords.y].color = pixelColorPick(pixelMap[btemp.newCoords.x][btemp.newCoords.y],btemp.info.fireColor);
- }
- pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp
- pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
- }
- }
- },
- "CL": function() {
- if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
- if (btemp.arg === null || btemp.pixel.temp >= parseFloat(btemp.arg)) {
- clonePixel(btemp.pixel,btemp.newCoords.x,btemp.newCoords.y);
- }
- }
- },
- "CF": function() {
- if (btemp.pixel.clone) {
- if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) {
- createPixel(btemp.pixel.clone, btemp.newCoords.x, btemp.newCoords.y);
- if (pixelMap[btemp.newCoords.x][btemp.newCoords.y]) {
- pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp;
- pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
- }
- }
- }
- else {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y,true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (!btemp.pixel.clone && btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if (newPixel.element !== btemp.pixel.element) {
- btemp.pixel.clone = newPixel.element;
- btemp.pixel.temp = newPixel.temp;
- }
- else if (newPixel.clone) {
- btemp.pixel.clone = newPixel.clone;
- btemp.pixel.temp = newPixel.temp;
- }
- }
- }
- },
- "SH": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- var con = elements[newPixel.element].conduct;
- if (con !== undefined) {
- if (Math.random() < con) { // If random number is less than conductivity
- if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if (!newPixel.charge && !newPixel.chargeCD && (btemp.arg === null || newPixel.element == btemp.arg)) {
- newPixel.charge = (parseFloat(btemp.arg) || 1);
- if (elements[newPixel.element].colorOn) {
- newPixel.color = pixelColorPick(newPixel);
- }
+ deletePixel(btemp.newCoords.x,btemp.newCoords.y);
+ if (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y) {
+ btemp.deleted = true;
}
+ btemp.swapSpots.length = 0;
}
}
}
- },
- "ST": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
- return;
- }
- if (newPixel.element !== btemp.pixel.element && (btemp.arg === null || newPixel.element == btemp.arg)) {
- btemp.sticking = true
+ }
+},
+"DB": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
+ // if the pixel at newCoords is the same element as the pixel, ignore
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ // if info.ignore exists and newPixel.element is in it
+ if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
+ }
+ if (!(newPixel.element == btemp.pixel.element)) {
+ if (btemp.arg !== null) { var args = btemp.arg.split(","); }
+ if (btemp.arg === null || args.indexOf(newPixel.element) !== -1) {
+ if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness) {
+ deletePixel(btemp.newCoords.x,btemp.newCoords.y);
+ if (pixelMap[btemp.pixel.x][btemp.pixel.y] !== undefined) {
+ deletePixel(btemp.pixel.x,btemp.pixel.y);
+ }
+ btemp.deleted = true;
+ btemp.swapSpots = [];
+ }
}
}
- },
- "LB": function() {
- if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","));
+ }
+},
+"CH": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
}
- if (elements[btemp.arg]) {
- btemp.leaveBehind = btemp.arg;
- }
- },
- "L1": function() {
- if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","));
- }
- if (elements[btemp.arg]) {
- btemp.leaveBehind1 = btemp.arg;
- }
- },
- "L2": function() {
- if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","));
- }
- if (elements[btemp.arg]) {
- btemp.leaveBehind2 = btemp.arg;
- }
- },
- "CC": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
if (btemp.arg.indexOf(">") !== -1) {
var argfrom = btemp.arg.split(">")[0];
if (argfrom.indexOf(",") !== -1) {
@@ -14522,159 +14937,297 @@ behaviorRules = {
else if (argfrom !== newPixel.element) {
return;
}
- btemp.arg = btemp.arg.split(">")[1];
+ var argto = btemp.arg.split(">")[1];
}
- if (btemp.arg === null) {btemp.arg = newPixel.colorObject}
else {
- if (btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","))
- }
- if (!btemp.arg.startsWith("#")) {
- btemp.arg = "#" + btemp.arg;
+ var argfrom = null;
+ var argto = btemp.arg;
+ }
+ if (argto.indexOf(",") !== -1) {
+ var argto = choose(argto.split(","));
+ }
+ if (elements[argto]) {
+ if (elements[newPixel.element].id !== elements[argto].id) {
+ changePixel(newPixel,argto);
}
}
- newPixel.color = btemp.arg;
}
- },
- "HT": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ }
+},
+"SW": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y,true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (btemp.arg !== null) { var args = btemp.arg.split(","); }
+ if (btemp.arg === null || args.indexOf(newPixel.element) !== -1) {
+ if (!elements[newPixel.element].hardness || Math.random() > elements[newPixel.element].hardness) {
+ btemp.swapSpots.push({x:btemp.newCoords.x,y:btemp.newCoords.y});
+ }
+ }
+ }
+},
+"CR": function() {
+ if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
+ if (btemp.arg === null) {
+ btemp.arg = btemp.pixel.element;
+ }
+ else if (btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[btemp.arg]) {
+ createPixel(btemp.arg,btemp.newCoords.x,btemp.newCoords.y);
+ if (!pixelMap[btemp.newCoords.x][btemp.newCoords.y]) return;
+ if (btemp.info.fireColor && btemp.arg==="fire") {
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].color = pixelColorPick(pixelMap[btemp.newCoords.x][btemp.newCoords.y],btemp.info.fireColor);
+ }
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp
+ pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
+ }
+ }
+},
+"CL": function() {
+ if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
+ if (btemp.arg === null || btemp.pixel.temp >= parseFloat(btemp.arg)) {
+ clonePixel(btemp.pixel,btemp.newCoords.x,btemp.newCoords.y);
+ }
+ }
+},
+"CF": function() {
+ if (btemp.pixel.clone) {
+ if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) {
+ createPixel(btemp.pixel.clone, btemp.newCoords.x, btemp.newCoords.y);
+ if (pixelMap[btemp.newCoords.x][btemp.newCoords.y]) {
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp;
+ pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
+ }
+ }
+ }
+ else {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y,true)) {
var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (elements[newPixel.element].insulate) { return }
- if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
- if (btemp.arg !== null) {btemp.arg = parseFloat(btemp.arg)}
- else {btemp.arg = 1}
- if (isNaN(btemp.arg)) {btemp.arg = 1}
- newPixel.temp += btemp.arg;
- pixelTempCheck(newPixel);
+ if (!btemp.pixel.clone && btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
+ }
+ if (newPixel.element !== btemp.pixel.element) {
+ btemp.pixel.clone = elements[newPixel.element].pickElement || newPixel.element;
+ btemp.pixel.temp = newPixel.temp;
+ }
+ else if (newPixel.clone) {
+ btemp.pixel.clone = newPixel.clone;
+ btemp.pixel.temp = newPixel.temp;
}
}
- },
- "CO": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (elements[newPixel.element].insulate) { return }
- if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
- if (btemp.arg !== null) {btemp.arg = parseFloat(btemp.arg)}
- else {btemp.arg = 1}
- if (isNaN(btemp.arg)) {btemp.arg = 1}
- newPixel.temp -= btemp.arg;
- pixelTempCheck(newPixel);
- }
+ }
+},
+"SH": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ chargePixel(newPixel, parseFloat(btemp.arg) || 1);
+ if (btemp.arg !== null && newPixel.element !== btemp.arg) {
+ return;
}
- },
- "FX": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (elements[newPixel.element].flippableX) {
- if (btemp.arg === "0") { newPixel.flipX = false; }
- else if (btemp.arg === "1") { newPixel.flipX = true; }
- newPixel.flipX = !newPixel.flipX;
- }
+ }
+},
+"ST": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
}
- },
- "FY": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (elements[newPixel.element].flippableY) {
- if (btemp.arg === "0") { newPixel.flipY = false; }
- else if (btemp.arg === "1") { newPixel.flipY = true; }
- else { newPixel.flipY = !newPixel.flipY; }
- }
+ if (newPixel.element !== btemp.pixel.element && (btemp.arg === null || newPixel.element == btemp.arg)) {
+ btemp.sticking = true
}
- },
- "RT": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(btemp.arg.split(","));
- }
- if (elements[newPixel.element].rotatable) {
- newPixel.r = ((newPixel.r||0) + (parseInt(btemp.arg)||1)) % 4;
- }
- }
- },
- "BO": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y) && (outOfBounds(btemp.newCoords.x, btemp.newCoords.y) || elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].id === elements[btemp.pixel.element].id || elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].state === "solid")) {
- if (btemp.info.flippableX) {
- btemp.pixel.flipX = !btemp.pixel.flipX;
- }
- if (btemp.info.flippableY) {
- btemp.pixel.flipY = !btemp.pixel.flipY;
- }
- if (btemp.info.rotatable) {
- // If arg isn't null, set arg to a random choice from arg.split(",")
- if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
- btemp.arg = btemp.arg.split(",")[Math.floor(Math.random()*btemp.arg.split(",").length)];
- }
- if (btemp.pixel.r !== undefined) {
- btemp.pixel.r = (btemp.pixel.r + (parseInt(btemp.arg)||2)) % 4;
- }
- else { btemp.pixel.r = (parseInt(btemp.arg)||2); }
- }
- }
- },
- "C2": function() {
- if (btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(arg.split(","));
- }
- btemp.C2 = btemp.arg;
- },
- "EX": function() {
- if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
- if (btemp.info.ignore && !outOfBounds(btemp.newCoords.x,btemp.newCoords.y)) {
- if (btemp.info.ignore.indexOf(pixelMap[btemp.newCoords.x][btemp.newCoords.y].element) !== -1) {
+ }
+},
+"LB": function() {
+ if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[btemp.arg]) {
+ btemp.leaveBehind = btemp.arg;
+ }
+},
+"L1": function() {
+ if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[btemp.arg]) {
+ btemp.leaveBehind1 = btemp.arg;
+ }
+},
+"L2": function() {
+ if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[btemp.arg]) {
+ btemp.leaveBehind2 = btemp.arg;
+ }
+},
+"CC": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (btemp.arg.indexOf(">") !== -1) {
+ var argfrom = btemp.arg.split(">")[0];
+ if (argfrom.indexOf(",") !== -1) {
+ if (argfrom.split(",").indexOf(newPixel.element) === -1) {
return;
}
}
- if (outOfBounds(btemp.newCoords.x,btemp.newCoords.y) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y) || (btemp.pixel.element !== pixelMap[btemp.newCoords.x][btemp.newCoords.y].element && elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].state !== "gas")) {
- // if arg contains ">", var fire = everything after it, arg = everything before it
- if (btemp.arg.indexOf(">") !== -1) {
- var fire = btemp.arg.split(">")[1];
- btemp.arg = btemp.arg.split(">")[0];
- }
- else { var fire = "fire" }
- // arg = a number
- if (btemp.arg !== null) {
- btemp.arg = parseInt(btemp.arg);
- if (isNaN(btemp.arg)) {btemp.arg = 3}
- }
- else {btemp.arg = 3}
- explodeAt(btemp.pixel.x,btemp.pixel.y,btemp.arg,fire);
- if (!btemp.pixel.del && btemp.info.hardness !== 1) {
- deletePixel(btemp.pixel.x,btemp.pixel.y);
- btemp.deleted = true;
- }
- btemp.swapSpots = [];
+ else if (argfrom !== newPixel.element) {
+ return;
+ }
+ btemp.arg = btemp.arg.split(">")[1];
+ }
+ if (btemp.arg === null) {btemp.arg = newPixel.colorObject}
+ else {
+ if (btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","))
+ }
+ if (!btemp.arg.startsWith("#")) {
+ btemp.arg = "#" + btemp.arg;
}
}
- },
- "SM": function() {
- if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (isBreakable(newPixel) && Math.random() > (elements[newPixel.element].hardness || 0)) {
- breakPixel(newPixel);
+ newPixel.color = btemp.arg;
+ }
+},
+"HT": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (elements[newPixel.element].insulate) { return }
+ if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
+ if (btemp.arg !== null) {btemp.arg = parseFloat(btemp.arg)}
+ else {btemp.arg = 1}
+ if (isNaN(btemp.arg)) {btemp.arg = 1}
+ newPixel.temp += btemp.arg;
+ pixelTempCheck(newPixel);
+ }
+ }
+},
+"CO": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (elements[newPixel.element].insulate) { return }
+ if (!(newPixel.element === btemp.pixel.element) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y)) {
+ if (btemp.arg !== null) {btemp.arg = parseFloat(btemp.arg)}
+ else {btemp.arg = 1}
+ if (isNaN(btemp.arg)) {btemp.arg = 1}
+ newPixel.temp -= btemp.arg;
+ pixelTempCheck(newPixel);
+ }
+ }
+},
+"FX": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (elements[newPixel.element].flippableX) {
+ if (btemp.arg === "0") { newPixel.flipX = false; }
+ else if (btemp.arg === "1") { newPixel.flipX = true; }
+ newPixel.flipX = !newPixel.flipX;
+ }
+ }
+},
+"FY": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (elements[newPixel.element].flippableY) {
+ if (btemp.arg === "0") { newPixel.flipY = false; }
+ else if (btemp.arg === "1") { newPixel.flipY = true; }
+ else { newPixel.flipY = !newPixel.flipY; }
+ }
+ }
+},
+"RT": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[newPixel.element].rotatable) {
+ newPixel.r = ((newPixel.r||0) + (parseInt(btemp.arg)||1)) % 4;
+ }
+ }
+},
+"BO": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y) && (outOfBounds(btemp.newCoords.x, btemp.newCoords.y) || elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].id === elements[btemp.pixel.element].id || elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].state === "solid")) {
+ if (btemp.info.flippableX) {
+ btemp.pixel.flipX = !btemp.pixel.flipX;
+ }
+ if (btemp.info.flippableY) {
+ btemp.pixel.flipY = !btemp.pixel.flipY;
+ }
+ if (btemp.info.rotatable) {
+ // If arg isn't null, set arg to a random choice from arg.split(",")
+ if (btemp.arg !== null && btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = btemp.arg.split(",")[Math.floor(Math.random()*btemp.arg.split(",").length)];
+ }
+ if (btemp.pixel.r !== undefined) {
+ btemp.pixel.r = (btemp.pixel.r + (parseInt(btemp.arg)||2)) % 4;
+ }
+ else { btemp.pixel.r = (parseInt(btemp.arg)||2); }
+ }
+ }
+},
+"C2": function() {
+ if (btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(arg.split(","));
+ }
+ btemp.C2 = btemp.arg;
+},
+"EX": function() {
+ if (!isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
+ if (btemp.info.ignore && !outOfBounds(btemp.newCoords.x,btemp.newCoords.y)) {
+ if (btemp.info.ignore.indexOf(pixelMap[btemp.newCoords.x][btemp.newCoords.y].element) !== -1) {
+ return;
}
}
- },
- "MX": function() {
- if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) {
- btemp.mixSpots.push({x:btemp.newCoords.x, y:btemp.newCoords.y});
- }
- else if (!outOfBounds(btemp.newCoords.x, btemp.newCoords.y)) {
- var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
- if (newPixel.element === btemp.pixel.element) { return }
- if (btemp.arg || !(elements[newPixel.element].movable !== true || elements[newPixel.element].noMix === true)) {
- btemp.mixSpots.push({x:newPixel.x, y:newPixel.y});
+ if (outOfBounds(btemp.newCoords.x,btemp.newCoords.y) || (btemp.newCoords.x == btemp.pixel.x && btemp.newCoords.y == btemp.pixel.y) || (btemp.pixel.element !== pixelMap[btemp.newCoords.x][btemp.newCoords.y].element && elements[pixelMap[btemp.newCoords.x][btemp.newCoords.y].element].state !== "gas")) {
+ // if arg contains ">", var fire = everything after it, arg = everything before it
+ if (btemp.arg.indexOf(">") !== -1) {
+ var fire = btemp.arg.split(">")[1];
+ btemp.arg = btemp.arg.split(">")[0];
}
+ else { var fire = "fire" }
+ // arg = a number
+ if (btemp.arg !== null) {
+ btemp.arg = parseInt(btemp.arg);
+ if (isNaN(btemp.arg)) {btemp.arg = 3}
+ }
+ else {btemp.arg = 3}
+ explodeAt(btemp.pixel.x,btemp.pixel.y,btemp.arg,fire);
+ if (!btemp.pixel.del && btemp.info.hardness !== 1) {
+ deletePixel(btemp.pixel.x,btemp.pixel.y);
+ btemp.deleted = true;
+ }
+ btemp.swapSpots = [];
}
- },
- "RL": function() {
- if (btemp.arg.indexOf(",") !== -1) {
- btemp.arg = choose(arg.split(","));
+ }
+},
+"SM": function() {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y, true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (isBreakable(newPixel) && Math.random() > (elements[newPixel.element].hardness || 0)) {
+ breakPixel(newPixel);
}
- releaseElement(btemp.pixel, btemp.arg);
- },
- "XX": function() {},
+ }
+},
+"MX": function() {
+ if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) {
+ btemp.mixSpots.push({x:btemp.newCoords.x, y:btemp.newCoords.y});
+ }
+ else if (!outOfBounds(btemp.newCoords.x, btemp.newCoords.y)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (newPixel.element === btemp.pixel.element) { return }
+ if (btemp.arg || !(elements[newPixel.element].movable !== true || elements[newPixel.element].noMix === true)) {
+ btemp.mixSpots.push({x:newPixel.x, y:newPixel.y});
+ }
+ }
+},
+"RL": function() {
+ if (btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(arg.split(","));
+ }
+ releaseElement(btemp.pixel, btemp.arg);
+},
+"XX": function() {}
}
function pixelTick(pixel,custom=null) {
if (pixel.start === pixelTicks) {return}
@@ -14918,8 +15471,7 @@ behaviorRules = {
var newPixel = pixelMap[x][y];
if (elements[newPixel.element].burn && !newPixel.burning) {
if (Math.floor(Math.random()*100) < elements[newPixel.element].burn) {
- newPixel.burning = true;
- newPixel.burnStart = pixelTicks;
+ burnPixel(newPixel);
}
}
if (elements[newPixel.element].extinguish && elements[pixel.element].burning !== true) {
@@ -15007,7 +15559,10 @@ behaviorRules = {
var con = elements[newPixel.element].conduct;
if (con === undefined) {continue}
if (elements[newPixel.element].ignoreConduct !== undefined && elements[newPixel.element].ignoreConduct.indexOf(pixel.element) !== -1) {
- continue
+ continue;
+ }
+ if (elements[pixel.element].onlyConduct !== undefined && elements[pixel.element].onlyConduct.indexOf(newPixel.element) === -1) {
+ continue;
}
if (newPixel.temp <= elements[newPixel.element].superconductAt) {
con = 1;
@@ -15545,6 +16100,48 @@ behaviorRules = {
"pixelMap":compressedMap
}
}
+ saveElementMigrations = {
+ "sticky_bomb": function(pixel) {
+ pixel.element = "bomb";
+ },
+ "cluster_bomb": function(pixel) {
+ pixel.element = "antibomb";
+ pixel.clone = "grenade";
+ },
+ "electro_bomb": function(pixel) {
+ pixel.element = "antibomb";
+ pixel.clone = "electric";
+ },
+ "water_bomb": function(pixel) {
+ pixel.element = "antibomb";
+ pixel.clone = "water";
+ },
+ "tesla_coil": function(pixel) {
+ pixel.element = "ecloner";
+ pixel.clone = "plasma";
+ },
+ "shocker": function(pixel) {
+ pixel.element = "ecloner";
+ pixel.clone = "electric";
+ },
+ "led_r": function(pixel) {
+ pixel.element = "led";
+ },
+ "led_g": function(pixel) {
+ pixel.element = "led";
+ },
+ "led_b": function(pixel) {
+ pixel.element = "led";
+ },
+ "superheater": function(pixel) {
+ pixel.element = "heater";
+ pixel.temp = 30;
+ },
+ "freezer": function(pixel) {
+ pixel.element = "cooler";
+ pixel.temp = 10;
+ },
+ }
function loadSave(saveJSON, confirmed=0, skip=0) {
if (!saveJSON.pixelMap) { return }
var compressedMap = saveJSON.pixelMap;
@@ -15624,16 +16221,18 @@ behaviorRules = {
for (var y = 0; y < pixelarray[x].length; y++) {
var pixel = pixelarray[x][y];
if (pixel) {
+ let element;
for (var prop in pixel) {
if (saveJSON.codes[prop]) {
pixel[saveJSON.codes[prop]] = pixel[prop];
delete pixel[prop];
}
- if (pixel.element) {
- pixel.element = saveJSON.codes[pixel.element]||pixel.element;
- if (!elements[pixel.element]) {
- pixel.element = "unknown";
- }
+ }
+ if (pixel.element) {
+ pixel.element = saveJSON.codes[pixel.element]||pixel.element;
+ if (element === undefined) element = pixel.element;
+ if (!elements[pixel.element]) {
+ pixel.element = "unknown";
}
}
createPixel(pixel.element,x,y);
@@ -15642,6 +16241,12 @@ behaviorRules = {
// if (!pixelMap[x][y]) continue;
pixelMap[x][y][prop] = pixel[prop];
}
+ if (saveElementMigrations[element]) {
+ saveElementMigrations[element](pixelMap[x][y], version);
+ if (pixel.color === undefined && pixel.element === "unknown") {
+ pixelMap[x][y].color = pixelColorPick(pixelMap[x][y]);
+ }
+ }
}
else {
pixelarray[x][y] = undefined;
@@ -15748,8 +16353,7 @@ behaviorRules = {
}
}
if (damage > 0.75 && info.burn) {
- pixel.burning = true;
- pixel.burnStart = pixelTicks;
+ burnPixel(pixel);
}
pixel.temp += damage*radius*power;
pixelTempCheck(pixel);
@@ -15880,7 +16484,7 @@ behaviorRules = {
if (ctx === null) return
clearLayers();
ctx.clearRect(0, 0, canvas.width, canvas.height);
- if (settings.bg) { // Set background color
+ if (settings.bg && !settings.bgimg) { // Set background color
if (canvas.style.backgroundColor !== settings.bg) {
canvas.style.backgroundColor = settings.bg;
// document.getElementById("stats").style.backgroundColor = settings.bg;
@@ -15909,13 +16513,18 @@ behaviorRules = {
}
function drawCursor() {
var layerCtx = canvasLayers.gui.getContext('2d');
- var mouseOffset = Math.trunc(mouseSize/2);
- var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset];
- var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset];
+ let mouseOffset = mouseSize/2;
+ let mouseMin = Math.trunc(mouseOffset);
+ let mouseMax = mouseMin;
+ if (mouseOffset % 1 === 0) {
+ mouseMax --;
+ }
+ var topLeft = [mousePos.x-mouseMin,mousePos.y-mouseMin];
+ var bottomRight = [mousePos.x+mouseMax,mousePos.y+mouseMax];
// Draw a square around the mouse
layerCtx.globalAlpha = mouseAlpha;
layerCtx.lineWidth = 2;
- layerCtx.strokeStyle = settings.mouseColor||mouseColor||"white";
+ layerCtx.strokeStyle = mouseColor||settings.mouseColor||"white";
layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize);
// draw one transparent pixel in the center
if (settings.precision) {
@@ -15927,7 +16536,7 @@ behaviorRules = {
let coords = lineCoords(shapeStart.x,shapeStart.y,mousePos.x,mousePos.y);
coords.forEach((coord) => {
if (outOfBounds(coord[0],coord[1])) return;
- drawSquare(layerCtx,mouseColor,coord[0],coord[1],undefined,mouseAlpha)
+ drawSquare(layerCtx,mouseColor,coord[0],coord[1],undefined,0.5)
})
}
}
@@ -15937,6 +16546,11 @@ behaviorRules = {
var newCurrentPixels = currentPixels.slice();
shuffleArray(newCurrentPixels);
+ if (hasUpdateOrder) {
+ newCurrentPixels.sort((a, b) => {
+ return (elements[a.element].updateOrder || 0) - (elements[b.element].updateOrder || 0)
+ })
+ }
for (var i = 0; i < newCurrentPixels.length; i++) {
var pixel = newCurrentPixels[i];
@@ -15979,6 +16593,7 @@ behaviorRules = {
viewKey = {/*DEPRECATED*/}
thermalMax = 100;
thermalMin = 0;
+ isMachine = {"machines":true}
viewInfo = {
1: { // Normal View (Default)
name: "",
@@ -16047,6 +16662,63 @@ behaviorRules = {
pixel: function(pixel,ctx) {
viewInfo[1].pixel(pixel,ctx);
}
+ },
+ 5: { // Outline View
+ name: "Outline",
+ effects: true,
+ colorEffects: true,
+ alias: 1,
+ onUnselect: function(ctx) {
+ if (viewInfo[1].onUnselect) viewInfo[1].onUnselect(ctx);
+ },
+ pre: function(ctx) {
+ if (!settings.bg || settings.bg === '#000000') {
+ ticktemp.outline = '#ffffff';
+ }
+ else ticktemp.outline = '#000000';
+ if (viewInfo[1].pre) viewInfo[1].pre(ctx);
+ currentPixels.forEach(pixel => {
+ if ((elements[pixel.element].movable !== true && isMachine[elements[pixel.element].category] === undefined) || elements[pixel.element].isGas === true) return;
+ if (elements[pixel.element].outline === false) return;
+ if (pixel.alpha === 0) return;
+ let edge = false;
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (isEmpty(x,y, true)) {
+ // if (elements[pixelMap[x][y].element].id !== elements[pixel.element].id || elements[pixelMap[x][y].element].state !== elements[pixel.element].id) continue
+ edge = true;
+ break;
+ }
+ }
+ if (edge) drawSquare(ctx,ticktemp.outline,pixel.x-1,pixel.y-1,3);
+ })
+ },
+ pixel: function(pixel, ctx) {
+ if (elements[pixel.element].movable || isMachine[elements[pixel.element].category] === true) return viewInfo[1].pixel(pixel, ctx);
+ if (pixel.alpha === 0) return;
+ let edge = false;
+ if (elements[pixel.element].outline !== false) {
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (isEmpty(x,y) || (!outOfBounds(x,y) &&
+ elements[pixelMap[x][y].element].movable
+ )) {
+ // if (elements[pixelMap[x][y].element].id !== elements[pixel.element].id || elements[pixelMap[x][y].element].state !== elements[pixel.element].id) continue
+ edge = true;
+ break;
+ }
+ }
+ };
+ if (edge) drawSquare(ctx,ticktemp.outline,pixel.x,pixel.y);
+ else viewInfo[1].pixel(pixel, ctx);
+ },
+ post: function(ctx) {
+ if (viewInfo[1].post) viewInfo[1].post(ctx);
+ }
}
}
function canvasCoord(n) {
@@ -16085,7 +16757,10 @@ behaviorRules = {
i--;
continue;
}
- if (pixel.con) { pixel = pixel.con }
+ if (pixel.con) {
+ if (!elements[pixel.con.element]) delete pixel.con;
+ else pixel = pixel.con;
+ }
if (elements[pixel.element].isGas || elements[pixel.element].glow) {
pixelsLast.push(pixel);
}
@@ -16130,6 +16805,9 @@ behaviorRules = {
renderPostPixelList[i](ctx);
}
}
+ if (elements[currentElement].renderTool !== undefined) {
+ elements[currentElement].renderTool(ctx);
+ }
if (viewInfo[view].post) {
viewInfo[view].post(ctx);
}
@@ -16194,6 +16872,7 @@ behaviorRules = {
promptState = null;
mouseIsDown = false;
isMobile = false;
+ hasUpdateOrder = false;
genericMenuHandler = null;
changedMods = false;
forceReload = false;
@@ -16365,14 +17044,16 @@ behaviorRules = {
lastPos = mousePos;
lastPlace = -100;
if (typeof settings.mouseColor !== "string") { delete settings.mouseColor }
- mouseColor = settings.mouseColor||"rgba(255,255,255)";
+ mouseColor = settings.mouseColor||"rgb(255,255,255)";
mouseAlpha = 0.5;
function mouseRange(mouseX,mouseY,size) {
var coords = [];
size = size || mouseSize;
- var mouseOffset = Math.trunc(size/2);
- var topLeft = [mouseX-mouseOffset,mouseY-mouseOffset];
- var bottomRight = [mouseX+mouseOffset,mouseY+mouseOffset];
+ let mouseOffset = size/2;
+ let mouseMin = Math.trunc(mouseOffset);
+ let mouseMax = mouseMin - (mouseOffset % 1 ? 0 : 1);
+ var topLeft = [mouseX-mouseMin,mouseY-mouseMin];
+ var bottomRight = [mouseX+mouseMax,mouseY+mouseMax];
// Starting at the top left, go through each pixel
for (var x = topLeft[0]; x <= bottomRight[0]; x++) {
for (var y = topLeft[1]; y <= bottomRight[1]; y++) {
@@ -16441,7 +17122,7 @@ behaviorRules = {
}
}
else if (existingPixel !== null && elements[existingPixel.element].onClicked && currentElement !== existingPixel.element) {
- elements[existingPixel.element].onClicked(existingPixel,currentElement);
+ elements[existingPixel.element].onClicked(existingPixel,currentElement === "unknown" ? null : currentElement);
}
if (currentElement === "mix") {
@@ -16469,12 +17150,14 @@ behaviorRules = {
if (isEmpty(x, y)) {
if (currentPixels.length < maxPixelCount) {
createPixel(currentElement,x,y);
- 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 (currentElementProp) {
- for (var key in currentElementProp) {
- pixelMap[x][y][key] = currentElementProp[key]
+ if (pixelMap[x][y]) {
+ if (currentElement === pixelMap[x][y].element && (elements[currentElement].customColor || elements[currentElement].singleColor)) {
+ pixelMap[x][y].color = pixelColorPick(pixelMap[x][y],currentColorMap[currentElement]);
+ }
+ if (currentElementProp) {
+ for (var key in currentElementProp) {
+ pixelMap[x][y][key] = currentElementProp[key]
+ }
}
}
}
@@ -16572,14 +17255,14 @@ behaviorRules = {
var deltaY = e.deltaY;
if (settings.invertscroll) {
if (deltaY > 0) { deltaY = 1; }
- else { deltaY = -1.5; }
+ else { deltaY = -1; }
}
else {
if (deltaY < 0) { deltaY = 1; }
- else { deltaY = -1.5; }
+ else { deltaY = -1; }
}
- mouseSize += Math.round(deltaY*1.5);
- checkMouseSize(true);
+ mouseSize += Math.round(deltaY);
+ checkMouseSize(Math.sign(deltaY));
}
function chooseElementPrompt() {
promptInput("Enter the element's ID.",
@@ -16591,6 +17274,15 @@ behaviorRules = {
if (es !== null) {
selectElement(es);
selectCategory(elements[es].category);
+ if (shiftDown && elements[currentElement].onShiftSelect) {
+ elements[currentElement].onShiftSelect(currentElement);
+ if (promptState) promptState.after = function() {
+ if (currentElementProp) {
+ let btn = document.getElementById("elementButton-"+currentElement);
+ if (btn) btn.setAttribute("modified", "true");
+ }
+ }
+ }
}
else {
logMessage("Element \"" + e + "\" not found");
@@ -16703,7 +17395,10 @@ behaviorRules = {
elements[currentElement].onUnselect();
}
var e1 = document.getElementById("elementButton-"+currentElement);
- if (e1 !== null) { e1.setAttribute("current","false"); }
+ if (e1 !== null) {
+ e1.setAttribute("current","false");
+ e1.setAttribute("modified","false");
+ }
prevElement = currentElement;
currentElement = element;
currentElementProp = null;
@@ -16734,6 +17429,7 @@ behaviorRules = {
function editDistance(s1, s2) {s1 = s1.toLowerCase();s2 = s2.toLowerCase();var costs = new Array();for (var i = 0; i <= s1.length; i++) {var lastValue = i;for (var j = 0; j <= s2.length; j++) {if (i == 0)costs[j] = j;else {if (j > 0) {var newValue = costs[j - 1];if (s1.charAt(i - 1) !== s2.charAt(j - 1))newValue = Math.min(Math.min(newValue, lastValue),costs[j]) + 1;costs[j - 1] = lastValue;lastValue = newValue;}}}if (i > 0)costs[s2.length] = lastValue;}return costs[s2.length];}
function similarity(s1, s2) {var longer = s1;var shorter = s2;if (s1.length < s2.length) {longer = s2;shorter = s1;}var longerLength = longer.length;if (longerLength == 0) {return 1.0;}return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);}
function mostSimilarElement(s) {
+ if (elements[s]) return s;
var max = 0;
var maxElement = "";
for (var e in elements) {
@@ -16808,12 +17504,48 @@ behaviorRules = {
}
else {
selectElement(this.getAttribute("element"));
+ if (shiftDown && elements[currentElement].onShiftSelect) {
+ elements[currentElement].onShiftSelect(currentElement);
+ if (promptState) promptState.after = function() {
+ if (currentElementProp) {
+ let btn = document.getElementById("elementButton-"+currentElement);
+ if (btn) btn.setAttribute("modified", "true");
+ }
+ }
+ }
}
}
function elemTitleCase(string) {
string = string.replace(/_./g, function (match) {return match.toUpperCase();}).replace(/_/g, '');
return string.charAt(0).toUpperCase() + string.slice(1);
}
+ function validateElementList(string) {
+ if (!string) return "";
+ if (string.toString) string = string.toString();
+ if (string.match(/,/)) {
+ let newList = [];
+ let list = string.split(",");
+ list.forEach(element => {
+ element = element.trim().replace(/ /g, "_");
+ if (validDensitySwaps[element]) {
+ newList.push(element);
+ return;
+ }
+ if (element === "null" || element === "air") {
+ newList.push("unknown");
+ return;
+ }
+ element = mostSimilarElement(element);
+ newList.push(elements[element] ? element : "unknown");
+ })
+ return newList.join(",");
+ }
+ string = string.trim().replace(/ /g, "_");
+ if (validDensitySwaps[string]) return string;
+ string = mostSimilarElement(string);
+ if (string === "null" || string === "air") return "unknown";
+ return elements[string] ? string : "unknown";
+ }
function createElementButton(element) {
var button = document.createElement("button");
// if the element has the attribute "name", use that as the button's text, otherwise use the element with underscores replaced by spaces
@@ -16843,19 +17575,26 @@ behaviorRules = {
else colorObjects = [hexToRGB(buttonColor)];
}
+ let average = averageRGB(colorObjects).match(/\d+/g);
+ let hsl = RGBToHSL(average);
+ let bright = hsl[2] > 0.7;
+ if (elements[element].darkText || (bright && elements[element].darkText !== false)) {
+ button.classList.add("bright");
+ hsl[1] = Math.min(hsl[1], 0.3)
+ }
+ else {
+ hsl[1] = Math.min(hsl[1], 0.5)
+ }
+ hsl[2] = 0.35;
+ button.setAttribute("style", "--button-border:hsl("+Math.round(hsl[0]*360)+"deg "+Math.round(hsl[1]*100)+"% "+Math.round(hsl[2]*100)+"%)")
+
if (colorObjects.length === 1) {
button.style.background = buttonColor;
var colorObject = elements[element].colorObject;
- if (elements[element].darkText !== false && (elements[element].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) {
- button.className += " bright"
- }
}
else {
button.style.backgroundImage = "linear-gradient(to bottom right, "+buttonColor.join(", ")+")";
var colorObject = colorObjects[Math.floor(colorObjects.length/2)];
- if (elements[element].darkText !== false && (elements[element].darkText || (colorObject.r+colorObject.g+colorObject.b)/3 > 200)) {
- button.className += " bright"
- }
}
if (elements[element].buttonGlow) {
@@ -16901,7 +17640,7 @@ behaviorRules = {
if (elements[element] && elements[element].hidden && !settings.unlocked[element]) {
settings.unlocked[element] = true;
if (settings.unhide === 2) {
- createElementButton(element)
+ createElementButton(element);
var categoryButton = document.querySelector(".categoryButton[current='true']");
var currentCategory = categoryButton.getAttribute("category");
if (currentCategory !== elements[element].category) {
@@ -16930,6 +17669,7 @@ behaviorRules = {
if (styleTag) styleTag.remove();
mouseColor = settings.mouseColor||"rgba(255,255,255)";
mouseAlpha = 0.5;
+ if (settings.bgimg) setCanvasBackground(settings.bgimg);
return;
}
let rgb;
@@ -18291,7 +19031,6 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
}
function confirmSave(confirmed=0) {
if (!savingState) { return }
- console.log(confirmed);
if (confirmed < 1 && savingState.slot && settings.resetwarning!==0 && localStorage["SandboxelsSaves/"+savingState.slot]) {
let tempState = savingState;
promptConfirm("Are you sure you want to overwrite the current save in slot "+savingState.slot+"? This cannot be undone.",
@@ -18353,6 +19092,13 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
}, 0);
closeMenu();
}
+
+ if (currentSaveData) {
+ if (savingState && !isNaN(savingState.slot)) currentSaveData.slot = savingState.slot;
+ currentSaveData.name = saveName;
+ currentSaveData.author = saveAuthor;
+ currentSaveData.desc = saveDesc;
+ }
}
function saveToFile() {
savingState = {slot:null};
@@ -18364,7 +19110,7 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
function loadFromFile() {
var input = document.createElement("input");
input.type = "file";
- // input.accept = ".sbxls,.json,.txt,text/*,application/json";
+ if (!isMobile) input.accept = ".sbxls,.json,.txt,text/*,application/json,application/vnd.R74n.sandboxels+json";
input.addEventListener("change", function(e) {
var file = e.target.files[0];
var reader = new FileReader();
@@ -18515,10 +19261,83 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
if (setting) { setSetting(setting,0); }
}
}
+ canvasBackgrounds = {
+ "day": ["backgrounds/sky.png", "#9EC2F6", true],
+ "grass": ["backgrounds/sky_grass.png", "#4FA760", true],
+ "dawn": ["backgrounds/sky_pink.png", "#DB79B2", false],
+ "sunset": ["backgrounds/sky_warm.png", "#EC8575", true],
+ "dusk": ["backgrounds/sky_purple.png", "#763CB5", true],
+ "night": ["backgrounds/sky_dark.png", "#181628", false],
+ };
+ function setCanvasBackground(key) {
+ if (key === "color") {
+ if (settings.bgimg) clearCanvasBackground();
+ return;
+ };
+ if (key === "custom") return;
+ let url;
+ let color;
+ let mousecolor;
+ if (key === "url") {
+ promptInput("Enter a URL for a background image.", (url) => {
+ if (!url) return;
+ if (!url.startsWith("http")) url = "https://"+url;
+ setCanvasBackground(url);
+ settings.bg = "#616161";
+ });
+ return;
+ };
+ if (key.startsWith("http")) url = key;
+ else if (canvasBackgrounds[key]) {
+ url = canvasBackgrounds[key][0];
+ color = canvasBackgrounds[key][1];
+ mousecolor = canvasBackgrounds[key][2] ? "rgb(0,0,0)" : "rgb(255,255,255)";
+ }
+
+ if (settings.bgimg !== key) {
+ if (color) {
+ settings.bg = color;
+ document.querySelector('.multisetting[setting="bg"] input').value = color;
+ }
+ settings.bgimg = key;
+ saveSettings();
+ }
+ if (color && !settings.theme) setTheme(color);
+ if (mousecolor) {
+ mouseColor = mousecolor;
+ mouseAlpha = 0.5;
+ }
+
+ gameCanvas.style.backgroundColor = "";
+ setTimeout(function() {
+ gameCanvas.style.backgroundImage = `url(${url})`;
+ gameCanvas.style.backgroundRepeat = "no-repeat";
+ gameCanvas.style.backgroundSize = "cover";
+ gameCanvas.style.backgroundPosition = "bottom";
+ },100);
+ }
+ function clearCanvasBackground() {
+ if (!settings.bgimg) return;
+ delete settings.bgimg;
+ gameCanvas.style.backgroundImage = "";
+ gameCanvas.style.backgroundRepeat = "";
+ gameCanvas.style.backgroundSize = "";
+ gameCanvas.style.backgroundPosition = "";
+ if (settings.theme) setThemeElement(settings.theme);
+ else setTheme();
+ saveSettings();
+ }
function checkMouseSize(changed) {
+ // console.log(changed,lastMouseSize);
+ let diff = Math.sign(mouseSize - lastMouseSize);
if (changed) { lastMouseSize = mouseSize }
else if (lastMouseSize) { mouseSize = lastMouseSize }
if (mouseSize < 1) { mouseSize = 1; }
+ if (mouseSize % 2 === 0 && mouseSize !== 2 && mouseSize !== 4) {
+ if (changed === 1) mouseSize++;
+ else if (changed === -1) mouseSize--;
+ else mouseSize += diff || -1;
+ }
if (settings.limitless && !elements[currentElement].tool) { return }
if (mouseSize > elements[currentElement].maxSize) { mouseSize = elements[currentElement].maxSize; }
if (mouseSize > (height > width ? (height + height % 2) : (width + width % 2))) { mouseSize = (height > width ? (height + height % 2) : (width + width % 2)); }
@@ -18636,9 +19455,13 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
if (!promptState) return;
if (!promptState.wasPaused && paused) togglePause();
let handler = promptState.handler;
+ let after = promptState.after;
closeMenu();
promptState = null;
if (handler) handler(result);
+ if (after) {
+ after();
+ }
if (promptState && showingMenu !== "prompt") {
showPromptScreen();
}
@@ -18789,7 +19612,6 @@ function autoGen(newname,element,autoType) {
elements[newname].reactions.smog = { elem1:null, elem2:"molten_slag" }
elements[newname].reactions.pyrocumulus = { elem1:null, elem2:"molten_slag" }
elements[newname].reactions.dioxin = { elem1:null, elem2:"molten_slag" }
- elements[newname].reactions.poison_gas = { elem1:null, elem2:"molten_slag" }
elements[newname].reactions.dirt = { elem1:null, elem2:"molten_slag" }
elements[newname].reactions.molten_dirt = { elem1:null, elem2:"molten_slag" }
};
@@ -19101,6 +19923,10 @@ window.onload = function() {
finalizeColor(elements[key])
checkAutoGen(key,elements[key])
+
+ if (elements[key].updateOrder !== undefined) {
+ hasUpdateOrder = true;
+ }
}
// Loop through each element. If it has a tempHigh, but not a stateHigh, create a new molten element
@@ -19172,9 +19998,9 @@ window.onload = function() {
}
}
else {
- var settingElements = settingSpans[i].getElementsByTagName("select")
+ var settingElements = settingSpans[i].getElementsByTagName("input")
if (settingElements.length === 0) {
- settingElements = settingSpans[i].getElementsByTagName("input");
+ settingElements = settingSpans[i].getElementsByTagName("select");
}
if (settingElements.length > 0) {
settingElements[0].value = settingValue;
@@ -19201,9 +20027,9 @@ window.onload = function() {
if (newWidth > 1000) { newWidth = 1000; }
// If we are on a desktop and the new height is greater than 500, set it to 500
if (window.innerWidth > 1000 && newHeight > 500) { newHeight = 500; }
- canvas.style.backgroundColor = settings.bg||"#000000";
+ if (!settings.bgimg) canvas.style.backgroundColor = settings.bg||"#000000";
- autoResizeCanvas = function(clear) {
+ autoResizeCanvas = function(clear, ratio) {
pixelSize = parseInt(settings.pixelsize) || 6;
if (window.innerWidth < 700) {
pixelSize--;
@@ -19221,8 +20047,8 @@ window.onload = function() {
// If we are on a desktop and the new height is greater than 500, set it to 500
if (window.innerWidth > 1000 && newHeight > 500) { newHeight = 500; }
- newHeight -= newHeight % pixelSize;
- newWidth -= newWidth % pixelSize;
+ // newHeight -= newHeight % pixelSize;
+ // newWidth -= newWidth % pixelSize;
document.getElementById("gameDiv").classList.remove("gameDiv-wide");
if (settings.pixelsize && settings.pixelsize.toString().slice(-1) === "w") {
@@ -19231,11 +20057,26 @@ window.onload = function() {
newWidth = window.innerWidth-10;
document.getElementById("gameDiv").classList.add("gameDiv-wide");
}
+
+ if (ratio) {
+ if (newHeight < newWidth) {
+ newWidth = ratio * newHeight;
+ }
+ else {
+ newHeight = ratio * newWidth;
+ }
+ }
+
resizeCanvas(newHeight,newWidth,pixelSize,clear);
}
+ autoResizeRatio = function(height, width) {
+ autoResizeCanvas(undefined, width/height)
+ }
resizeCanvas = function(newHeight,newWidth,newPixelSize,clear) {
var gameCanvas = document.getElementById("game");
var ctx = gameCanvas.getContext("2d");
+ newHeight -= newHeight % pixelSize;
+ newWidth -= newWidth % pixelSize;
ctx.canvas.width = newWidth;
ctx.canvas.height = newHeight;
document.getElementById("gameDiv").style.width = newWidth + "px";
@@ -19262,6 +20103,25 @@ window.onload = function() {
}
autoResizeCanvas(false);
+ let bgSelect = document.querySelector('.multisetting[setting="bg"] select');
+ for (let key in canvasBackgrounds) {
+ let option = document.createElement("option");
+ option.value = key;
+ option.id = "setting-bg-"+key;
+ option.innerText = elemTitleCase(key);
+ bgSelect.appendChild(option);
+ }
+ if (settings.bgimg) {
+ if (bgSelect.querySelector(`option[value="${settings.bgimg}"]`)) {
+ bgSelect.value = settings.bgimg;
+ }
+ else {
+ bgSelect.value = "custom";
+ }
+ setCanvasBackground(settings.bgimg);
+ }
+ bgSelect.appendChild(document.getElementById("setting-bg-url"));
+
document.getElementById("loadingP").style.display = "none";
document.getElementById("canvasDiv").style.display = "block";
@@ -19270,20 +20130,31 @@ window.onload = function() {
randomChoices = Object.keys(elements).filter(function(e) {
return elements[e].excludeRandom != true && elements[e].category !== "tools" && !elements[e].tool;
});
- gameCanvas.addEventListener("mousedown", mouseClick);
gameCanvas.addEventListener("mousedown", function(e){
- if (elements[currentElement] && elements[currentElement].onMouseDown) {
+ if (!showingMenu && elements[currentElement] && elements[currentElement].onMouseDown) {
elements[currentElement].onMouseDown(e);
}
});
+ gameCanvas.addEventListener("mousedown", mouseClick);
gameCanvas.addEventListener("touchstart", function(e) {
- if (e.touches) e = e.touches[0];
mousePos = getMousePos(canvas, e);
+ if (e.touches) e = e.touches[0];
+ if (!showingMenu && elements[currentElement] && elements[currentElement].onMouseDown) {
+ elements[currentElement].onMouseDown(e);
+ }
return false;
});
gameCanvas.addEventListener("touchstart", mouseClick, { passive: false });
window.addEventListener("mouseup", mouseUp);
window.addEventListener("touchend", mouseUp, { passive: false });
+ gameCanvas.addEventListener("touchend", function(e) {
+ // mousePos = getMousePos(canvas, e);
+ if (e.touches) e = e.touches[0];
+ if (!showingMenu && elements[currentElement] && elements[currentElement].onMouseUp) {
+ elements[currentElement].onMouseUp(e);
+ }
+ return false;
+ });
window.addEventListener("mousemove", mouseMove);
gameCanvas.addEventListener("touchmove", mouseMove, { passive: false });
gameCanvas.addEventListener("wheel", wheelHandle);
@@ -19379,6 +20250,20 @@ window.onload = function() {
document.getElementById("game").oncontextmenu = function(e) { e.preventDefault(); return false; }
document.addEventListener("keydown", function(e) {
var keyName = e.code;
+ if (e.keyCode == 16) { // shift
+ if (event.location === KeyboardEvent.DOM_KEY_LOCATION_LEFT) {
+ shiftDown = 1;
+ } else if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT) {
+ shiftDown = 3;
+ }
+ }
+ else if (e.keyCode == 18) { // alt
+ if (event.location === KeyboardEvent.DOM_KEY_LOCATION_LEFT) {
+ shiftDown = 2;
+ } else if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT) {
+ shiftDown = 4;
+ }
+ }
if (e.ctrlKey || e.metaKey) {
if (e.keyCode == 83) { // Ctrl+S = Save
e.preventDefault();
@@ -19450,26 +20335,12 @@ window.onload = function() {
}
}
}
+
// if the user is in an input, return
if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") {
return;
}
- if (e.keyCode == 16) { // shift
- if (event.location === KeyboardEvent.DOM_KEY_LOCATION_LEFT) {
- shiftDown = 1;
- } else if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT) {
- shiftDown = 3;
- }
- }
- else if (e.keyCode == 18) { // alt
- if (event.location === KeyboardEvent.DOM_KEY_LOCATION_LEFT) {
- shiftDown = 2;
- } else if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT) {
- shiftDown = 4;
- }
- }
-
if (keybinds[e.key]) {
e.preventDefault();
keybinds[e.key](e);
@@ -19588,10 +20459,10 @@ window.onload = function() {
//post-load
let tempSave = localStorage.getItem("SandboxelsTempSave");
if (tempSave) {
+ localStorage.removeItem("SandboxelsTempSave");
let json = JSON.parse(tempSave);
lastSaveJSON = json;
loadSave(json,3,3)
- localStorage.removeItem("SandboxelsTempSave")
}
else if (urlParams.has("discord")) {
let saveID = parseInt(urlParams.get("discord"));
@@ -19645,7 +20516,7 @@ window.onload = function() {
- ↑ Pause > - + Reset Replace E Tps Info Saves Mods Settings
+ ↑ Pause > - + Reset Replace E Tps Info Saves Mods Settings
+ crossorigin="anonymous">