Merge branch 'main' of https://github.com/GGodPL/sandboxels
This commit is contained in:
commit
ef61abd3e8
126
changelog.html
126
changelog.html
|
|
@ -109,7 +109,133 @@
|
|||
<p>The original <a href="https://sandboxels.r74n.com/changelog.txt">plain text version</a> of this is still maintained.</p>
|
||||
</div>
|
||||
|
||||
<h2 id="1.9.4">[Version 1.9.4 - March 17, 2024 - Natural Disasters]</h2>
|
||||
<ul>
|
||||
<li>+ Tornado</li>
|
||||
<li>+ Earthquake</li>
|
||||
<li>+ Tsunami</li>
|
||||
<li>+ Blaster</li>
|
||||
<li>+ Sandstorm (Hidden)</li>
|
||||
<li>[Changes]</li>
|
||||
<li>+ Scrolling resizes in correct direction on Windows</li>
|
||||
<li>+ Invert Scroll setting</li>
|
||||
<li>~ Humans no longer trample Grass</li>
|
||||
<li>~ Milk no longer turns to Yogurt when heated</li>
|
||||
<li>+ Milk turns to Yogurt in Primordial Soup</li>
|
||||
<li>+ Cells can ferment Milk into Yogurt</li>
|
||||
<li>+ Cells boil and freeze into some Sugar</li>
|
||||
<li>+ Cheese can be made from Nut Milk</li>
|
||||
<li>+ Hives show Bee count when hovered</li>
|
||||
<li>+ Flies, Fireflies, and Rats get trapped in Glue</li>
|
||||
<li>+ Worms can compost Charcoal and Straw</li>
|
||||
<li>+ Snails eat Pickles and Grapes</li>
|
||||
<li>+ Slugs eat Grapes</li>
|
||||
<li>+ Evergreen trees drop Pinecones when burned</li>
|
||||
<li>~ Pinecones can withstand high temperatures</li>
|
||||
<li>+ Wheat dries and freezes into Straw</li>
|
||||
<li>+ Straw breaks into Flour</li>
|
||||
<li>+ Potato can be deep-fried</li>
|
||||
<li>+ Water can explode in hot Nut Oil</li>
|
||||
<li>+ Soda can disolve Eggs</li>
|
||||
<li>+ Yeast ferments Mashed Potato</li>
|
||||
<li>+ Potatoes can charge Zinc or Copper</li>
|
||||
<li>+ Batteries explode when melted</li>
|
||||
<li>+ Ammonia can spawn Algae in Water</li>
|
||||
<li>+ Broth can extinguish small fires</li>
|
||||
<li>+ Salt slowly dissolves in Caramel</li>
|
||||
<li>+ Ketchup and Baking Soda reaction</li>
|
||||
<li>+ Acid kills Plant and Tree Branch before dissolving it</li>
|
||||
<li>+ Copper Sulfate kills Termites, Plant, Grass, Algae, and Mushrooms</li>
|
||||
<li>+ Caustic Potash and Acid reaction</li>
|
||||
<li>+ Nickel can resist Acid</li>
|
||||
<li>+ Aluminum breaks into Metal Scrap</li>
|
||||
<li>+ Thermite can be made from Metal Scrap</li>
|
||||
<li>+ Gallium stains solids</li>
|
||||
<li>+ Gold can alloy with AlGa</li>
|
||||
<li>+ Electrum breaks into Gold Coins</li>
|
||||
<li>+ Electrolysis on Salt Water produces Chlorine</li>
|
||||
<li>+ Alcohol can purify Infection</li>
|
||||
<li>+ Vaccine and Antibody can cure Rotten Meat and Cheese</li>
|
||||
<li>+ Soap releases Fragrance when burned</li>
|
||||
<li>+ Soap can be made from Milk</li>
|
||||
<li>+ Paper is yellowed by Light and Oxygen</li>
|
||||
<li>+ Plant is yellowed by Chlorine</li>
|
||||
<li>+ Skin is darkened and reddened by Light</li>
|
||||
<li>+ Skin will rash when exposed to irritants</li>
|
||||
<li>+ Neutrons can react with Plant, Gunpowder, Yeast, and Firework</li>
|
||||
<li>+ Positrons react violently with Electric</li>
|
||||
<li>+ Light can kill Plague and Virus</li>
|
||||
<li>~ Virus no longer eats Light or Loopy</li>
|
||||
<li>~ Loopy ignores Cloners</li>
|
||||
<li>~ Cancer is killed by Radiation faster</li>
|
||||
<li>+ Cancer can be killed by Laser</li>
|
||||
<li>~ Diamond is no longer indestructible, but still very strong</li>
|
||||
<li>~ Diamonds will no longer form if Charcoal is too hot</li>
|
||||
<li>~ Moved Bubble to Gases</li>
|
||||
<li>+ Bubbles pop when cooled or heated</li>
|
||||
<li>~ Tweaked Bleach and Vinegar reaction</li>
|
||||
<li>~ Randomized Egg hatching rate</li>
|
||||
<li>~ Cacti no longer grow arms at their base</li>
|
||||
<li>+ Bamboo burns into Embers</li>
|
||||
<li>+ Malware can hijack Loopy</li>
|
||||
<li>+ Malware can misalign Lattice</li>
|
||||
<li>+ Malware can break down Border</li>
|
||||
<li>+ Rainbow breaks into Static</li>
|
||||
<li>+ Bless revives Tree Branches from Saplings</li>
|
||||
<li>+ Bless purifies Pilk</li>
|
||||
<li>+ Bless removes Color Smoke and Spray Paint</li>
|
||||
<li>+ Packed Snow breaks into Snow</li>
|
||||
<li>+ Water can put out Antifire</li>
|
||||
<li>~ Antifire ignores air density</li>
|
||||
<li>~ Holding Shift can force mix dense ingredients into Batter</li>
|
||||
<li>~ Gave unique colors to Supernova, NExplosion, and Pop</li>
|
||||
<li>~ Recolored Molten Potassium and Molten Magnesium</li>
|
||||
<li>~ Tweaked charged Hydrogen and Helium colors</li>
|
||||
<li>~ Moved Ball to Special (For real this time)</li>
|
||||
<li>~ Moved Perfume to Liquids</li>
|
||||
<li>~ Moved Amber to Solids</li>
|
||||
<li>~ Save names are truncated in save menu</li>
|
||||
<li>+ Humans always save skin and shirt color in saves</li>
|
||||
<li>+ Shift can be held when pressing -/+ buttons</li>
|
||||
<li>+ Unpaint tool downgrades colorful element variants</li>
|
||||
<li>+ Earthquakes and Tornadoes in random events</li>
|
||||
<li>+ Magma alias 'Lava'</li>
|
||||
<li>- Removed Smooth View (Try moreViews.js!)</li>
|
||||
<li>[Bug Fixes]</li>
|
||||
<li>~ Fixed: Evergreen and Lattice can be dragged</li>
|
||||
<li>~ Fixed: Cellulose isn't considered a liquid</li>
|
||||
<li>~ Fixed: Cellulose density too low</li>
|
||||
<li>~ Fixed: Ketchup could result from recipes with Butter</li>
|
||||
<li>~ Fixed: Accented element names capitalize incorrectly</li>
|
||||
<li>~ Fixed: Virus can destroy invincible pixels</li>
|
||||
<li>~ Fixed: E-cloner doesn't copy temperature</li>
|
||||
<li>~ Fixed: Middle click begins scrolling on Windows</li>
|
||||
<li>~ Fixed: Swapping to secondary element doesn't focus category</li>
|
||||
<li>~ Fixed: Alcohol Gas has 110% flammability</li>
|
||||
<li>~ Fixed: Acid Gas can destroy some Acid-resistant elements</li>
|
||||
<li>~ Fixed: Certain Cactus pixel grows instantly</li>
|
||||
<li>~ Fixed: Typo in Hydrogen and Sulfur reaction</li>
|
||||
<li>~ Fixed: Antigas places at room temperature</li>
|
||||
<li>~ Fixed: Hot Antifire burns indefinitely</li>
|
||||
<li>~ Fixed: Melted Wax viscosity defined twice</li>
|
||||
<li>~ Fixed: Flash lower state defined twice</li>
|
||||
<li>~ Fixed: Ketchup boils into Vinegar, which immediately boils</li>
|
||||
<li>~ Fixed: F11 doesn't toggle fullscreen (May need Shift)</li>
|
||||
<li>~ Fixed: Water causes Ember to stop burning, etc.</li>
|
||||
<li>~ Fixed: Bless can create everlasting Fire</li>
|
||||
<li>~ Fixed: Spawning Liquid Propane causes pulse effect</li>
|
||||
<li>~ Fixed: Stained Glass and Color Sand can't be painted</li>
|
||||
<li>[Technical]</li>
|
||||
<li>+ Prop tool accepts lowercase "-infinity"</li>
|
||||
<li>~ Prop tool deselects on invalid input</li>
|
||||
<li>+ onMouseDown() element property</li>
|
||||
<li>+ hoverStat(pixel) element property for hover info, return string</li>
|
||||
<li>+ stain1 and stain2 reaction property, accepts hex color code</li>
|
||||
<li>+ Shift + W?</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="1.9.3">[Version 1.9.3 - February 2, 2024 - Mix & Munch]</h2>
|
||||
<p><a href="https://news.r74n.com/p/sandboxels-v193-mix-and-munch-out">Read More on the Newsletter!</a></p>
|
||||
<ul>
|
||||
<li>+ Potassium</li>
|
||||
<li>+ Magnesium</li>
|
||||
|
|
|
|||
123
changelog.txt
123
changelog.txt
|
|
@ -7,6 +7,129 @@ See sneak peaks for upcoming updates on the Discord: https://discord.gg/ejUc6YPQ
|
|||
|
||||
A fancier version of this changelog can be found here: https://sandboxels.R74n.com/changelog
|
||||
|
||||
[Version 1.9.4 - March 17, 2024 - Natural Disasters]
|
||||
+ Tornado
|
||||
+ Earthquake
|
||||
+ Tsunami
|
||||
+ Blaster
|
||||
+ Sandstorm (Hidden)
|
||||
[Changes]
|
||||
+ Scrolling resizes in correct direction on Windows
|
||||
+ Invert Scroll setting
|
||||
~ Humans no longer trample Grass
|
||||
~ Milk no longer turns to Yogurt when heated
|
||||
+ Milk turns to Yogurt in Primordial Soup
|
||||
+ Cells can ferment Milk into Yogurt
|
||||
+ Cells boil and freeze into some Sugar
|
||||
+ Cheese can be made from Nut Milk
|
||||
+ Hives show Bee count when hovered
|
||||
+ Flies, Fireflies, and Rats get trapped in Glue
|
||||
+ Worms can compost Charcoal and Straw
|
||||
+ Snails eat Pickles and Grapes
|
||||
+ Slugs eat Grapes
|
||||
+ Evergreen trees drop Pinecones when burned
|
||||
~ Pinecones can withstand high temperatures
|
||||
+ Wheat dries and freezes into Straw
|
||||
+ Straw breaks into Flour
|
||||
+ Potato can be deep-fried
|
||||
+ Water can explode in hot Nut Oil
|
||||
+ Soda can disolve Eggs
|
||||
+ Yeast ferments Mashed Potato
|
||||
+ Potatoes can charge Zinc or Copper
|
||||
+ Batteries explode when melted
|
||||
+ Ammonia can spawn Algae in Water
|
||||
+ Broth can extinguish small fires
|
||||
+ Salt slowly dissolves in Caramel
|
||||
+ Ketchup and Baking Soda reaction
|
||||
+ Acid kills Plant and Tree Branch before dissolving it
|
||||
+ Copper Sulfate kills Termites, Plant, Grass, Algae, and Mushrooms
|
||||
+ Caustic Potash and Acid reaction
|
||||
+ Nickel can resist Acid
|
||||
+ Aluminum breaks into Metal Scrap
|
||||
+ Thermite can be made from Metal Scrap
|
||||
+ Gallium stains solids
|
||||
+ Gold can alloy with AlGa
|
||||
+ Electrum breaks into Gold Coins
|
||||
+ Electrolysis on Salt Water produces Chlorine
|
||||
+ Alcohol can purify Infection
|
||||
+ Vaccine and Antibody can cure Rotten Meat and Cheese
|
||||
+ Soap releases Fragrance when burned
|
||||
+ Soap can be made from Milk
|
||||
+ Paper is yellowed by Light and Oxygen
|
||||
+ Plant is yellowed by Chlorine
|
||||
+ Skin is darkened and reddened by Light
|
||||
+ Skin will rash when exposed to irritants
|
||||
+ Neutrons can react with Plant, Gunpowder, Yeast, and Firework
|
||||
+ Positrons react violently with Electric
|
||||
+ Light can kill Plague and Virus
|
||||
~ Virus no longer eats Light or Loopy
|
||||
~ Loopy ignores Cloners
|
||||
~ Cancer is killed by Radiation faster
|
||||
+ Cancer can be killed by Laser
|
||||
~ Diamond is no longer indestructible, but still very strong
|
||||
~ Diamonds will no longer form if Charcoal is too hot
|
||||
~ Moved Bubble to Gases
|
||||
+ Bubbles pop when cooled or heated
|
||||
~ Tweaked Bleach and Vinegar reaction
|
||||
~ Randomized Egg hatching rate
|
||||
~ Cacti no longer grow arms at their base
|
||||
+ Bamboo burns into Embers
|
||||
+ Malware can hijack Loopy
|
||||
+ Malware can misalign Lattice
|
||||
+ Malware can break down Border
|
||||
+ Rainbow breaks into Static
|
||||
+ Bless revives Tree Branches from Saplings
|
||||
+ Bless purifies Pilk
|
||||
+ Bless removes Color Smoke and Spray Paint
|
||||
+ Packed Snow breaks into Snow
|
||||
+ Water can put out Antifire
|
||||
~ Antifire ignores air density
|
||||
~ Holding Shift can force mix dense ingredients into Batter
|
||||
~ Gave unique colors to Supernova, NExplosion, and Pop
|
||||
~ Recolored Molten Potassium and Molten Magnesium
|
||||
~ Tweaked charged Hydrogen and Helium colors
|
||||
~ Moved Ball to Special (For real this time)
|
||||
~ Moved Perfume to Liquids
|
||||
~ Moved Amber to Solids
|
||||
~ Save names are truncated in save menu
|
||||
+ Humans always save skin and shirt color in saves
|
||||
+ Shift can be held when pressing -/+ buttons
|
||||
+ Unpaint tool downgrades colorful element variants
|
||||
+ Earthquakes and Tornadoes in random events
|
||||
+ Magma alias 'Lava'
|
||||
- Removed Smooth View (Try moreViews.js!)
|
||||
[Bug Fixes]
|
||||
~ Fixed: Evergreen and Lattice can be dragged
|
||||
~ Fixed: Cellulose isn't considered a liquid
|
||||
~ Fixed: Cellulose density too low
|
||||
~ Fixed: Ketchup could result from recipes with Butter
|
||||
~ Fixed: Accented element names capitalize incorrectly
|
||||
~ Fixed: Virus can destroy invincible pixels
|
||||
~ Fixed: E-cloner doesn't copy temperature
|
||||
~ Fixed: Middle click begins scrolling on Windows
|
||||
~ Fixed: Swapping to secondary element doesn't focus category
|
||||
~ Fixed: Alcohol Gas has 110% flammability
|
||||
~ Fixed: Acid Gas can destroy some Acid-resistant elements
|
||||
~ Fixed: Certain Cactus pixel grows instantly
|
||||
~ Fixed: Typo in Hydrogen and Sulfur reaction
|
||||
~ Fixed: Antigas places at room temperature
|
||||
~ Fixed: Hot Antifire burns indefinitely
|
||||
~ Fixed: Melted Wax viscosity defined twice
|
||||
~ Fixed: Flash lower state defined twice
|
||||
~ Fixed: Ketchup boils into Vinegar, which immediately boils
|
||||
~ Fixed: F11 doesn't toggle fullscreen (May need Shift)
|
||||
~ Fixed: Water causes Ember to stop burning, etc.
|
||||
~ Fixed: Bless can create everlasting Fire
|
||||
~ Fixed: Spawning Liquid Propane causes pulse effect
|
||||
~ Fixed: Stained Glass and Color Sand can't be painted
|
||||
[Technical]
|
||||
+ Prop tool accepts lowercase "-infinity"
|
||||
~ Prop tool deselects on invalid input
|
||||
+ onMouseDown() element property
|
||||
+ hoverStat(pixel) element property for hover info, return string
|
||||
+ stain1 and stain2 reaction property, accepts hex color code
|
||||
+ Shift + W?
|
||||
|
||||
[Version 1.9.3 - February 2, 2024 - Mix & Munch]
|
||||
+ Potassium
|
||||
+ Magnesium
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@
|
|||
<tr><td>Normal view</td> <td><kbd>1</kbd></td></tr>
|
||||
<tr><td>Thermal view</td> <td><kbd>2</kbd></td></tr>
|
||||
<tr><td>Basic view (No effects)</td> <td><kbd>3</kbd></td></tr>
|
||||
<tr><td>Smooth view (Low performance)</td> <td><kbd>4</kbd></td></tr>
|
||||
<tr><td>Hide canvas</td> <td><kbd>H</kbd></td></tr>
|
||||
<tr><td>Toggle GUI</td> <td><kbd>F1</kbd></td></tr>
|
||||
<tr><td>Capture screenshot</td> <td><kbd>C</kbd> or <kbd>F2</kbd></td></tr>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ F or F11 = Toggle Fullscreen
|
|||
1 or 0 = Normal View
|
||||
2 = Thermal View
|
||||
3 = Basic View (No Effects)
|
||||
4 = Smooth View
|
||||
H = Hide Canvas
|
||||
F1 = Toggle GUI / HUD
|
||||
F2 or C = Capture Screenshot
|
||||
|
|
|
|||
777
index.html
777
index.html
File diff suppressed because it is too large
Load Diff
|
|
@ -13,5 +13,6 @@
|
|||
"molten_sulfur": "molten_sulphur",
|
||||
"sulfur_gas": "sulphur_gas",
|
||||
"color_sand": "colour_sand",
|
||||
"yogurt": "yoghurt"
|
||||
"yogurt": "yoghurt",
|
||||
"frozen_yogurt": "frozen_yoghurt"
|
||||
}
|
||||
28
lang/fr.json
28
lang/fr.json
|
|
@ -10,10 +10,10 @@
|
|||
"weapons":"Armes",
|
||||
"gases":"Des gaz",
|
||||
"food":"Nourriture",
|
||||
"machines":"Usiner",
|
||||
"machines":"Machines",
|
||||
"special":"Spécial",
|
||||
"other":"Autre",
|
||||
"heat":"Chaleur",
|
||||
"heat":"Réchauffer",
|
||||
"cool":"Refroidir",
|
||||
"erase":"Effacer",
|
||||
"drag":"Traîner",
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
"mix":"Mélanger",
|
||||
"lookup":"Chercher",
|
||||
"shock":"Choc",
|
||||
"paint":"Peinture",
|
||||
"paint":"Peindre",
|
||||
"sand":"Sable",
|
||||
"water":"Eau",
|
||||
"salt_water":"Eau salée",
|
||||
|
|
@ -32,14 +32,14 @@
|
|||
"dirt":"Saleté",
|
||||
"mud":"Boue",
|
||||
"wet_sand":"Sable mouillé",
|
||||
"rock":"Rocher",
|
||||
"rock":"Roche",
|
||||
"rock_wall":"Mur en pierre",
|
||||
"mudstone":"Argile",
|
||||
"packed_sand":"Sable compacté",
|
||||
"plant":"Usine",
|
||||
"plant":"Plante",
|
||||
"dead_plant":"Plante morte",
|
||||
"frozen_plant":"Plante gelée",
|
||||
"grass":"Gazon",
|
||||
"grass":"Herbe",
|
||||
"algae":"Algues",
|
||||
"concrete":"Béton",
|
||||
"wall":"Mur",
|
||||
|
|
@ -68,13 +68,13 @@
|
|||
"molten_salt":"Sel dissous",
|
||||
"sugar":"Sucre",
|
||||
"flour":"Farine",
|
||||
"wire":"Fil",
|
||||
"wire":"Cable",
|
||||
"battery":"Batterie",
|
||||
"cloner":"Cloneur",
|
||||
"sensor":"Capteur",
|
||||
"heater":"Chauffage",
|
||||
"cooler":"glacière",
|
||||
"random":"aléatoire",
|
||||
"cooler":"Glacière",
|
||||
"random":"Aléatoire",
|
||||
"image":"Image",
|
||||
"unpaint":"Dépeindre",
|
||||
"uncharge":"Décharger",
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
"filler":"Remplisseur",
|
||||
"lattice":"Treillis",
|
||||
"gravel":"Gravier",
|
||||
"slime":"Vase",
|
||||
"slime":"Slime",
|
||||
"cement":"Ciment",
|
||||
"dust":"Poussière",
|
||||
"void":"Vide",
|
||||
|
|
@ -102,12 +102,12 @@
|
|||
"hive":"Ruche",
|
||||
"bee":"Abeille",
|
||||
"stink_bug":"Punaise",
|
||||
"dead_bug":"Bug mort",
|
||||
"dead_bug":"Insecte mort",
|
||||
"human":"Humain",
|
||||
"body":"Corps",
|
||||
"head":"Tête",
|
||||
"bird":"Oiseau",
|
||||
"rat":"Manger",
|
||||
"rat":"Rat",
|
||||
"frog":"Grenouille",
|
||||
"frozen_frog":"Grenouille congelée",
|
||||
"tadpole":"Têtard",
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
"superheater":"Surchauffeur",
|
||||
"freezer":"Congélateur",
|
||||
"pipe":"Tuyau",
|
||||
"pipe_wall":"Mur_tuyau",
|
||||
"pipe_wall":"Mur tuyau",
|
||||
"ewall":"Mur électronique",
|
||||
"torch":"Torche",
|
||||
"spout":"Pec",
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
"balloon":"Ballon",
|
||||
"antipowder":"Antipoudre",
|
||||
"antimolten":"Antifondu",
|
||||
"antifire":"Anti-incendie",
|
||||
"antifire":"Anti-feu",
|
||||
"antifluid":"Antifluide",
|
||||
"antigas":"Antigaz",
|
||||
"vertical":"Verticale",
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@
|
|||
<tr><td>all_around_fillers.js</td><td>Adds directional Filler variants</td><td>idk73248</td></tr>
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Adora</td></tr>
|
||||
<tr><td>amogus.js</td><td>Adds a small amogus structure</td><td>Alice</td></tr>
|
||||
<tr><td>citybuilding.js</td><td>Adds seeds that create miniature buildings and other city-related items</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>collab_mod.js</td><td>Created by multiple people, adds random things</td><td>mrapple, ilikepizza, stefanblox</td></tr>
|
||||
<tr><td>elem3.js</td><td>Adds all elements and combinations from Elemental 3 [Very Large]</td><td>Sophie</td></tr>
|
||||
<tr><td>funny elements 2022-11-15.js</td><td>Adds a few curated randomly-generated elements</td><td>Alice</td></tr>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -14,6 +14,13 @@ try {
|
|||
|
||||
//ESSENTIAL COMMON FUNCTIONS (CODE LIBRARY) ##
|
||||
|
||||
//DEBUGGING
|
||||
|
||||
function logAndReturn(thing) {
|
||||
console.log(thing);
|
||||
return thing
|
||||
};
|
||||
|
||||
//URL
|
||||
|
||||
urlParams = new URLSearchParams(window.location.search);
|
||||
|
|
@ -493,7 +500,7 @@ try {
|
|||
if(!color.startsWith("hsl(") || !color.endsWith(")")) {
|
||||
throw new Error(`The color ${color} is not a valid hsl() color`)
|
||||
};
|
||||
var colorTempArray = color.split(",")
|
||||
var colorTempArray = color.split(",").map(x => x.trim())
|
||||
if(colorTempArray.length !== 3) {
|
||||
throw new Error(`The color ${color} is not a valid hsl() color`)
|
||||
};
|
||||
|
|
@ -2101,6 +2108,8 @@ try {
|
|||
if(pixelIndex !== -1) {
|
||||
currentPixels.splice(pixelIndex,1)
|
||||
if (pixelMap[x][y]) { delete pixelMap[x][y] };
|
||||
} else {
|
||||
return false
|
||||
};
|
||||
//if (pixelMap[x][y]) {pixelMap[x][y].del = true}
|
||||
//if (pixelMap[x][y]) { delete pixelMap[x][y] };
|
||||
|
|
@ -21260,10 +21269,13 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
|
|||
tempLow: Math.min(rockInfo.tempHigh - 100,800),
|
||||
stateLow: rockName,
|
||||
density: rockInfo.density * 0.9,
|
||||
hardness: rockInfo.density * 0.85,
|
||||
//breakInto: newName + "_gravel",
|
||||
_data: [rockData[0], rockData[1], hotData2Switch(rockData[2])],
|
||||
};
|
||||
|
||||
if(rockInfo.hardness) {
|
||||
elements[newName].hardness = rockInfo.hardness * 0.85
|
||||
};
|
||||
|
||||
//console.log([elements[rockName].tempHigh,elements[rockName].stateHigh]);
|
||||
//console.log([elements[newName].tempLow,elements[newName].stateLow])
|
||||
|
|
@ -45937,14 +45949,15 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
|
|||
//SPECIFY CURRENT ELEMENT ON LOAD ##
|
||||
|
||||
window.addEventListener("load",function() {
|
||||
//console.log(currentElement);
|
||||
currentElement = urlParams.get("currentElement") ?? "sand";
|
||||
//console.log(currentElement);
|
||||
if(!elementExists(currentElement)) {
|
||||
//console.log(false);
|
||||
currentElement = "sand"
|
||||
}// else { console.log(true) };
|
||||
//console.log(currentElement);
|
||||
}
|
||||
var size = urlParams.get("mouseSize") ?? 5;
|
||||
if(isNaN(size)) {
|
||||
size = 5;
|
||||
};
|
||||
mouseSize = size
|
||||
});
|
||||
|
||||
//MISCELLANEOUS CHANGES ##
|
||||
|
|
|
|||
|
|
@ -0,0 +1,216 @@
|
|||
function building_1_segment() {
|
||||
if (pixel.foundation = true && pixel.height < pixel.limit) {
|
||||
if (isEmpty(pixel.x+1,pixel.y-pixel.height) &&
|
||||
isEmpty(pixel.x-1,pixel.y-pixel.height) &&
|
||||
isEmpty(pixel.x+2,pixel.y-pixel.height) &&
|
||||
isEmpty(pixel.x-2,pixel.y-pixel.height) &&
|
||||
isEmpty(pixel.x+2,pixel.y-1-pixel.height) &&
|
||||
isEmpty(pixel.x-2,pixel.y-1-pixel.height) &&
|
||||
isEmpty(pixel.x+1,pixel.y-1-pixel.height) &&
|
||||
isEmpty(pixel.x-1,pixel.y-1-pixel.height) &&
|
||||
isEmpty(pixel.x,pixel.y-1-pixel.height) &&
|
||||
isEmpty(pixel.x,pixel.y-pixel.height)) {
|
||||
createPixel("glass",pixel.x+1,pixel.y-pixel.height);
|
||||
createPixel("glass",pixel.x-1,pixel.y-pixel.height);
|
||||
createPixel("concrete",pixel.x+2,pixel.y-pixel.height);
|
||||
createPixel("concrete",pixel.x-2,pixel.y-pixel.height);
|
||||
createPixel("concrete",pixel.x+1,pixel.y-1-pixel.height);
|
||||
createPixel("concrete",pixel.x-1,pixel.y-1-pixel.height);
|
||||
createPixel("concrete",pixel.x+2,pixel.y-1-pixel.height);
|
||||
createPixel("concrete",pixel.x-2,pixel.y-1-pixel.height);
|
||||
createPixel("concrete",pixel.x,pixel.y-1-pixel.height);
|
||||
createPixel("concrete",pixel.x,pixel.y-pixel.height);
|
||||
pixel.height = pixel.height+2
|
||||
}
|
||||
}
|
||||
}
|
||||
function filldirt2x5() {
|
||||
var dirtPixelElem = pixelMap[pixel.x][pixel.y+1];
|
||||
if (!isEmpty(pixel.x,pixel.y+1) && !outOfBounds(pixel.x,pixel.y+1)) {
|
||||
dirtPixelElem = pixelMap[pixel.x][pixel.y+1].element
|
||||
}
|
||||
if (isEmpty(pixel.x+1,pixel.y+1)) {
|
||||
createPixel(dirtPixelElem,pixel.x+1,pixel.y+1);
|
||||
}
|
||||
if (isEmpty(pixel.x-1,pixel.y+1)) {
|
||||
createPixel(dirtPixelElem,pixel.x-1,pixel.y+1);
|
||||
}
|
||||
if (isEmpty(pixel.x+2,pixel.y+1)) {
|
||||
createPixel(dirtPixelElem,pixel.x+2,pixel.y+1);
|
||||
}
|
||||
if (isEmpty(pixel.x-2,pixel.y+1)) {
|
||||
createPixel(dirtPixelElem,pixel.x-2,pixel.y+1);
|
||||
}
|
||||
if (isEmpty(pixel.x+2,pixel.y+2)) {
|
||||
createPixel(dirtPixelElem,pixel.x+2,pixel.y+2);
|
||||
}
|
||||
if (isEmpty(pixel.x-2,pixel.y+2)) {
|
||||
createPixel(dirtPixelElem,pixel.x-2,pixel.y+2);
|
||||
}
|
||||
}
|
||||
elements.building_1 = {
|
||||
color: "#a78d38",
|
||||
tick: function(pixel) {
|
||||
if (!isEmpty(pixel.x,pixel.y+1)) {
|
||||
if (isEmpty(pixel.x+1,pixel.y) &&
|
||||
isEmpty(pixel.x-1,pixel.y) &&
|
||||
isEmpty(pixel.x+2,pixel.y) &&
|
||||
isEmpty(pixel.x-2,pixel.y) &&
|
||||
isEmpty(pixel.x+2,pixel.y-1) &&
|
||||
isEmpty(pixel.x-2,pixel.y-1) &&
|
||||
isEmpty(pixel.x+1,pixel.y-1) &&
|
||||
isEmpty(pixel.x-1,pixel.y-1) &&
|
||||
isEmpty(pixel.x,pixel.y-1) &&
|
||||
isEmpty(pixel.x+2,pixel.y-2) &&
|
||||
isEmpty(pixel.x-2,pixel.y-2) &&
|
||||
isEmpty(pixel.x+1,pixel.y-2) &&
|
||||
isEmpty(pixel.x-1,pixel.y-2) &&
|
||||
isEmpty(pixel.x,pixel.y-2)) {
|
||||
filldirt2x5();
|
||||
movePixel(pixel,pixel.x,pixel.y-1);
|
||||
createPixel("concrete",pixel.x+1,pixel.y+1);
|
||||
createPixel("concrete",pixel.x-1,pixel.y+1);
|
||||
createPixel("concrete",pixel.x+2,pixel.y+1);
|
||||
createPixel("concrete",pixel.x-2,pixel.y+1);
|
||||
createPixel("wood",pixel.x,pixel.y+1);
|
||||
pixel.limit = 10 + Math.floor(Math.random() * 5)*2;
|
||||
createPixel("concrete",pixel.x+1,pixel.y);
|
||||
createPixel("concrete",pixel.x-1,pixel.y);
|
||||
createPixel("concrete",pixel.x+2,pixel.y);
|
||||
createPixel("concrete",pixel.x-2,pixel.y);
|
||||
createPixel("concrete",pixel.x+1,pixel.y-1);
|
||||
createPixel("concrete",pixel.x-1,pixel.y-1);
|
||||
createPixel("concrete",pixel.x+2,pixel.y-1);
|
||||
createPixel("concrete",pixel.x-2,pixel.y-1);
|
||||
createPixel("concrete",pixel.x,pixel.y-1);
|
||||
pixel.foundation = true;
|
||||
pixel.height = pixel.height+2
|
||||
}
|
||||
}
|
||||
if (pixel.foundation == true && pixel.height < pixel.limit) {
|
||||
building_1_segment();
|
||||
}
|
||||
else if (pixel.foundation == true && pixel.height >= pixel.limit) {
|
||||
pixel.built = true;
|
||||
}
|
||||
if (pixel.built == true) {
|
||||
changePixel(pixel,"wood");
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
properties: {
|
||||
height:0,
|
||||
limit:0,
|
||||
foundation:false,
|
||||
built:false
|
||||
},
|
||||
category: "citybuilding",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
cooldown: defaultCooldown,
|
||||
seed: true,
|
||||
maxSize: 1,
|
||||
excludeRandom: true,
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
};
|
||||
elements.building_1_tall = {
|
||||
color: "#d9c243",
|
||||
tick: function(pixel) {
|
||||
if (!isEmpty(pixel.x,pixel.y+1)) {
|
||||
if (isEmpty(pixel.x+1,pixel.y) &&
|
||||
isEmpty(pixel.x-1,pixel.y) &&
|
||||
isEmpty(pixel.x+2,pixel.y) &&
|
||||
isEmpty(pixel.x-2,pixel.y) &&
|
||||
isEmpty(pixel.x+2,pixel.y-1) &&
|
||||
isEmpty(pixel.x-2,pixel.y-1) &&
|
||||
isEmpty(pixel.x+1,pixel.y-1) &&
|
||||
isEmpty(pixel.x-1,pixel.y-1) &&
|
||||
isEmpty(pixel.x,pixel.y-1) &&
|
||||
isEmpty(pixel.x+2,pixel.y-2) &&
|
||||
isEmpty(pixel.x-2,pixel.y-2) &&
|
||||
isEmpty(pixel.x+1,pixel.y-2) &&
|
||||
isEmpty(pixel.x-1,pixel.y-2) &&
|
||||
isEmpty(pixel.x,pixel.y-2)) {
|
||||
filldirt2x5();
|
||||
movePixel(pixel,pixel.x,pixel.y-1);
|
||||
createPixel("concrete",pixel.x+1,pixel.y+1);
|
||||
createPixel("concrete",pixel.x-1,pixel.y+1);
|
||||
createPixel("concrete",pixel.x+2,pixel.y+1);
|
||||
createPixel("concrete",pixel.x-2,pixel.y+1);
|
||||
createPixel("wood",pixel.x,pixel.y+1);
|
||||
pixel.limit = 15 + Math.floor(Math.random() * 10)*2;
|
||||
createPixel("concrete",pixel.x+1,pixel.y);
|
||||
createPixel("concrete",pixel.x-1,pixel.y);
|
||||
createPixel("concrete",pixel.x+2,pixel.y);
|
||||
createPixel("concrete",pixel.x-2,pixel.y);
|
||||
createPixel("concrete",pixel.x+1,pixel.y-1);
|
||||
createPixel("concrete",pixel.x-1,pixel.y-1);
|
||||
createPixel("concrete",pixel.x+2,pixel.y-1);
|
||||
createPixel("concrete",pixel.x-2,pixel.y-1);
|
||||
createPixel("concrete",pixel.x,pixel.y-1);
|
||||
pixel.foundation = true;
|
||||
pixel.height = pixel.height+2
|
||||
}
|
||||
}
|
||||
if (pixel.foundation == true && pixel.height < pixel.limit) {
|
||||
building_1_segment();
|
||||
}
|
||||
else if (pixel.foundation == true && pixel.height >= pixel.limit) {
|
||||
pixel.built = true;
|
||||
}
|
||||
if (pixel.built == true) {
|
||||
changePixel(pixel,"wood");
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
properties: {
|
||||
height:0,
|
||||
limit:0,
|
||||
foundation:false,
|
||||
built:false
|
||||
},
|
||||
category: "citybuilding",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
cooldown: defaultCooldown,
|
||||
seed: true,
|
||||
maxSize: 1,
|
||||
excludeRandom: true,
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
};
|
||||
elements.small_tree_1 = {
|
||||
color: "#4bd943",
|
||||
tick: function(pixel) {
|
||||
if (!isEmpty(pixel.x,pixel.y+1)) {
|
||||
if (isEmpty(pixel.x+1,pixel.y-1) &&
|
||||
isEmpty(pixel.x-1,pixel.y-1) &&
|
||||
isEmpty(pixel.x,pixel.y-1) &&
|
||||
isEmpty(pixel.x+1,pixel.y-2) &&
|
||||
isEmpty(pixel.x-1,pixel.y-2) &&
|
||||
isEmpty(pixel.x,pixel.y-2) &&
|
||||
isEmpty(pixel.x+1,pixel.y-3) &&
|
||||
isEmpty(pixel.x-1,pixel.y-3) &&
|
||||
isEmpty(pixel.x,pixel.y-3)) {
|
||||
createPixel("wood",pixel.x,pixel.y-1);
|
||||
createPixel("wood",pixel.x,pixel.y-2);
|
||||
createPixel("plant",pixel.x,pixel.y-3);
|
||||
createPixel("plant",pixel.x-1,pixel.y-1);
|
||||
createPixel("plant",pixel.x-1,pixel.y-2);
|
||||
createPixel("plant",pixel.x-1,pixel.y-3);
|
||||
createPixel("plant",pixel.x+1,pixel.y-1);
|
||||
createPixel("plant",pixel.x+1,pixel.y-2);
|
||||
createPixel("plant",pixel.x+1,pixel.y-3);
|
||||
changePixel(pixel,"wood");
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
category: "citybuilding",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
cooldown: defaultCooldown,
|
||||
seed: true,
|
||||
maxSize: 1,
|
||||
excludeRandom: true,
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
};
|
||||
|
|
@ -147,4 +147,9 @@ if (elements.gold_coin) {elements.gold_coin.color = ["#fff0b5","#986a1a","#f0bb6
|
|||
if (elements.rocket) {elements.rocket.color = "#ff0000";}
|
||||
if (elements.rose_gold) {elements.rose_gold.color = ["#b76e79","#a1334d","#f06283"];}
|
||||
if (elements.calcium) {elements.calcium.color = ["#515053","#7a787d","#748193","#fef9ff","#748193","#7a787d","#515053"];}
|
||||
if (elements.electrum) {elements.electrum.color = ["#ffdd63","#ad9532","#bda853","#bdb38e","#fff5d1"];}
|
||||
if (elements.electrum) {elements.electrum.color = ["#ffdd63","#ad9532","#bda853","#bdb38e","#fff5d1"];}
|
||||
if (elements.molten_potassium) {delete elements.molten_potassium.color;}
|
||||
if (elements.molten_magnesium) {delete elements.molten_magnesium.color;}
|
||||
if (elements.n_explosion) {elements.n_explosion.color = ["#ffb48f","#ffd991","#ffad91"];}
|
||||
if (elements.supernova) {elements.supernova.color = ["#ffb48f","#ffd991","#ffad91"];}
|
||||
if (elements.pop) {elements.pop.color = ["#ffb48f","#ffd991","#ffad91"];}
|
||||
|
|
@ -1,57 +1,3 @@
|
|||
elements.earthquake = {
|
||||
color: ["#bda791","#997756","#613d19"],
|
||||
tick: function(pixel) {
|
||||
if (pixel.stage) {
|
||||
var coords = circleCoords(pixel.x,pixel.y,pixel.stage);
|
||||
if (pixel.stage >= pixel.mag) {
|
||||
deletePixel(pixel.x,pixel.y);
|
||||
return;
|
||||
}
|
||||
coords.forEach(function(coord){
|
||||
var x = coord.x;
|
||||
var y = coord.y;
|
||||
if (!isEmpty(x,y,true)) {
|
||||
var p = pixelMap[x][y];
|
||||
if (p.element === "earthquake") { return }
|
||||
if (elements[p.element].breakInto) {
|
||||
// times 0.25 if not shiftDown else 1
|
||||
if (Math.random() < (elements[p.element].hardness || 1) * (shiftDown ? 1 : 0.25)) {
|
||||
var breakInto = elements[p.element].breakInto;
|
||||
// if breakInto is an array, pick one
|
||||
if (Array.isArray(breakInto)) {
|
||||
breakInto = breakInto[Math.floor(Math.random() * breakInto.length)];
|
||||
}
|
||||
if (breakInto === null) {
|
||||
deletePixel(p.x,p.y);
|
||||
return;
|
||||
}
|
||||
var oldelement = p.element;
|
||||
changePixel(p,breakInto);
|
||||
if (elements[oldelement].breakIntoColor) {
|
||||
p.color = pixelColorPick(p, elements[oldelement].breakIntoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!elements[p.element].movable) { return }
|
||||
tryMove(p,p.x,p.y-1);
|
||||
}
|
||||
})
|
||||
pixel.stage++;
|
||||
}
|
||||
else if (!tryMove(pixel,pixel.x,pixel.y+1)) {
|
||||
// random 10 to 20
|
||||
pixel.mag = Math.floor(Math.random() * 10) + 20;
|
||||
pixel.stage = 1;
|
||||
}
|
||||
},
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
density: 100000000,
|
||||
maxSize: 1,
|
||||
cooldown: defaultCooldown,
|
||||
excludeRandom: true,
|
||||
}
|
||||
|
||||
elements.rad_fluid = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,37 @@
|
|||
// 1.0 update
|
||||
// adds dragon breath
|
||||
// adds frostbite
|
||||
// adds pulsium
|
||||
// adds pulsium bar
|
||||
// adds goblins delight
|
||||
// adds pheonix
|
||||
// adds pheonix ash
|
||||
// adds baby pheonix
|
||||
// adds ice pheonix
|
||||
|
||||
// 1.1 update
|
||||
// adds dragon scale
|
||||
// adds mystic runes
|
||||
// adds enchanted wood
|
||||
// adds quartzium
|
||||
// adds quartz
|
||||
// adds moonite
|
||||
|
||||
// 1.2 update
|
||||
// fixed visibility bug and some errors
|
||||
// adds faustium
|
||||
// adds nebulaflare
|
||||
// adds flaro
|
||||
// adds aurorium
|
||||
// adds glimmerium
|
||||
// adds ozmoz
|
||||
// adds goblin
|
||||
// adds fenzium
|
||||
// adds sceptrium
|
||||
// adds sceptrium dust
|
||||
|
||||
// 1.3.2 fantasy_elements.js mod
|
||||
// added changelog
|
||||
// adds plode a bomb
|
||||
|
||||
// 1.4 the golem mod
|
||||
|
|
@ -12,6 +45,11 @@
|
|||
// iced pheonix at 700 degrees becomes pheonix
|
||||
// added blood golem
|
||||
|
||||
// 1.5 update
|
||||
// corrected the 'phoenix' wrong spelling mistake to pheonix
|
||||
// added grethe
|
||||
// added grothea
|
||||
|
||||
elements.dragon_breath = {
|
||||
color: "#f94e4e",
|
||||
behavior: behaviors.GAS,
|
||||
|
|
@ -110,7 +148,7 @@ elements.pheonix = {
|
|||
baby: "baby_pheonix",
|
||||
};
|
||||
|
||||
elements.phoenix_ash = {
|
||||
elements.pheonix_ash = {
|
||||
color: "#a8a8a5",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "fantasy",
|
||||
|
|
@ -134,7 +172,7 @@ elements.baby_pheonix = {
|
|||
burnTime:19,
|
||||
state: "solid",
|
||||
stateLow: "iced_pheonix",
|
||||
breakInto: "phoenix_ash",
|
||||
breakInto: "pheonix_ash",
|
||||
density: 850,
|
||||
conduct: 1,
|
||||
};
|
||||
|
|
@ -738,3 +776,25 @@ elements.blood_golem= {
|
|||
"category":"fantasy",
|
||||
"temp": 10,
|
||||
};
|
||||
|
||||
elements.grethe = {
|
||||
color: "#51f542",
|
||||
"behavior": [
|
||||
"XX|XX|DL",
|
||||
"SA|XX|M2",
|
||||
"XX|M1|XX",
|
||||
],
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
};
|
||||
|
||||
elements.grothea = {
|
||||
color: ["#d742f5","#c246db","#772987"],
|
||||
"behavior": [
|
||||
"M2|XX|XX",
|
||||
"SA|M1|XX",
|
||||
"XX|XX|DL",
|
||||
],
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
function weightedAverage(num1, num2, weight){
|
||||
return ((weight * num1)+((1-weight)*num2))
|
||||
}
|
||||
const heatfunc = function(pixel){
|
||||
if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null || !(pixel.element == pixel.ogElement)){
|
||||
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||
|
|
@ -5,23 +8,24 @@ const heatfunc = function(pixel){
|
|||
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||
pixel.ogElement = pixel.element
|
||||
}else{
|
||||
pixel.gethigh = (elements[pixel.element].tempHigh)
|
||||
pixel.halftemp = ((20+pixel.gethigh)/2)
|
||||
if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
||||
pixel.ctemp = 0;
|
||||
} else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
||||
pixel.ctemp = ((1/pixel.halftemp)*pixel.temp)-(((pixel.gethigh)-pixel.halftemp)/pixel.halftemp)
|
||||
var gethigh = (elements[pixel.element].tempHigh)
|
||||
var halftemp = ((20+gethigh)/2)
|
||||
if (pixel.temp <= (gethigh) - halftemp){
|
||||
var ctemp = 0;
|
||||
} else if (pixel.temp > (gethigh)-halftemp && pixel.temp <= gethigh){
|
||||
var ctemp = ((1/halftemp)*pixel.temp)-(((gethigh)-halftemp)/halftemp)
|
||||
}
|
||||
if (pixel.ctemp <= 0.5){
|
||||
pixel.newR = (((510-(2*pixel.ogR))*pixel.ctemp)+pixel.ogR);
|
||||
pixel.newG = ((0-((2*pixel.ogG)*pixel.ctemp))+pixel.ogG);
|
||||
pixel.newB = ((0-((2*pixel.ogB)*pixel.ctemp))+pixel.ogB);
|
||||
}else if (pixel.ctemp > 0.5){
|
||||
pixel.newR = 255;
|
||||
pixel.newG = ((510*pixel.ctemp)-255);
|
||||
pixel.newB= ((280*pixel.ctemp)-140);
|
||||
if (ctemp <= 0.5){
|
||||
var newR = (((510-(2*pixel.ogR))*ctemp)+pixel.ogR);
|
||||
var newG = ((0-((2*pixel.ogG)*ctemp))+pixel.ogG);
|
||||
var newB = ((0-((2*pixel.ogB)*ctemp))+pixel.ogB);
|
||||
}else if (ctemp > 0.5){
|
||||
var newR = 255;
|
||||
var newG = ((510*ctemp)-255);
|
||||
var newB= ((280*ctemp)-140);
|
||||
}
|
||||
pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
||||
let weight = (1-(ctemp/1.3))
|
||||
pixel.color = "rgb(" + weightedAverage(pixel.ogR, newR, weight) + "," + weightedAverage(pixel.ogG, newG, weight) + "," + weightedAverage(pixel.ogB, newB, weight) + ")";
|
||||
}
|
||||
};
|
||||
if (!eLists.metals) { eLists.metals = [] }
|
||||
|
|
@ -53,9 +57,6 @@ elements.color_baker = {
|
|||
desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.",
|
||||
}
|
||||
/*
|
||||
function weightedAverage(num1, num2, weight){
|
||||
return ((weight * num1)+((1-weight)*num2))
|
||||
}
|
||||
const plantfunc = function(pixel){
|
||||
if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){
|
||||
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
//jaydsfunctions
|
||||
erase1Var = 0;
|
||||
elements.selective_eraser = {
|
||||
color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === erase1Var) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
erase1Var = answer1;
|
||||
}
|
||||
},
|
||||
explode1Var = 0;
|
||||
elements.selective_exploder = {
|
||||
color: ["#ff0000","#ff0000","#ff0000","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === explode1Var) {
|
||||
changePixel(pixel, "explosion")
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer2 = prompt("Please input what element to explode.",(explode1Var||undefined));
|
||||
if (!answer2) { return }
|
||||
explode1Var = answer2;
|
||||
}
|
||||
},
|
||||
convert11Var = 0;
|
||||
convert22Var = 0;
|
||||
elements.converter_tool = {
|
||||
color: ["#ffffff","#ffffff","#ffffff","#555555","#555555","#555555"],
|
||||
darkText: true,
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === convert11Var) {
|
||||
changePixel(pixel, convert22Var)
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer3 = prompt("Please input what should element be converted.",(convert11Var||undefined));
|
||||
if (!answer3) { return }
|
||||
convert11Var = answer3;
|
||||
var answer4 = prompt("Please input what element to convert into.",(convert22Var||undefined));
|
||||
if (!answer4) { return }
|
||||
convert22Var = answer4;
|
||||
}
|
||||
},
|
||||
elements.fast_bomb = {
|
||||
color: "#524c41",
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>explosion|M2",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
for (var i=0; i<3; i++) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
|
||||
if (!isEmpty(pixel.x, pixel.y+1,true)) {
|
||||
var newPixel = pixelMap[pixel.x][pixel.y+1];
|
||||
if (newPixel.element === "fast_bomb") { break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
exclude1Var = 0;
|
||||
elements.exclusive_eraser = {
|
||||
color: ["#ff5a00","#ff5a00","#ff5a00","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element !== exclude1Var) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer5 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
||||
if (!answer5) { return }
|
||||
exclude1Var = answer5;
|
||||
}
|
||||
},
|
||||
elements.tenth_heater = {
|
||||
category: "special",
|
||||
color: "#ff0000",
|
||||
behavior: [
|
||||
"XX|HT:0.1|XX",
|
||||
"HT:0.1|XX|HT:0.1",
|
||||
"XX|HT:0.1|XX",
|
||||
],
|
||||
ignore: "tenth_heater"
|
||||
},
|
||||
elements.e_tenth_heater = {
|
||||
category: "special",
|
||||
color: "#ff0000",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|HT:0.1|XX",
|
||||
"HT:0.1|XX|HT:0.1",
|
||||
"XX|HT:0.1|XX",
|
||||
],
|
||||
ignore: "tenth_heater",
|
||||
conduct: 1
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
// helper objects for pixel
|
||||
const cat = {
|
||||
TOOLS: "tools",
|
||||
LAND: "land",
|
||||
LIQUIDS: "liquids",
|
||||
LIFE: "life",
|
||||
POWDERS: "powders",
|
||||
SOLIDS: "solids",
|
||||
ENERGY: "energy",
|
||||
WEAPONS: "weapons",
|
||||
GASES: "gases",
|
||||
FOOD: "food",
|
||||
MACHINES: "machines",
|
||||
SPECIAL: "special",
|
||||
STATES: "states",
|
||||
}
|
||||
const state = {
|
||||
SOLID: "solid",
|
||||
LIQUID: "liquid",
|
||||
GAS: "gas",
|
||||
}
|
||||
const bb = {
|
||||
POWDER_OLD: behaviors.POWDER_OLD,
|
||||
POWDER: behaviors.POWDER,
|
||||
AGPOWDER: behaviors.AGPOWDER,
|
||||
LIQUID_OLD: behaviors.LIQUID_OLD,
|
||||
LIQUID: behaviors.LIQUID,
|
||||
SUPERFLUID_OLD: behaviors.SUPERFLUID_OLD,
|
||||
SUPERFLUID: behaviors.SUPERFLUID,
|
||||
LIGHTWEIGHT: behaviors.LIGHTWEIGHT,
|
||||
SLIDE: behaviors.SLIDE,
|
||||
AGLIQUID: behaviors.AGLIQUID,
|
||||
WALL: behaviors.WALL,
|
||||
UL_UR: behaviors.UL_UR,
|
||||
UL_UR_OPTIMIZED: behaviors.UL_UR_OPTIMIZED,
|
||||
GAS_OLD: behaviors.GAS_OLD,
|
||||
GAS: behaviors.GAS,
|
||||
DGAS: behaviors.DGAS,
|
||||
SUPPORT: behaviors.SUPPORT,
|
||||
SUPPORTPOWDER: behaviors.SUPPORTPOWDER,
|
||||
DELETE: behaviors.DELETE,
|
||||
FILL: behaviors.FILL,
|
||||
CLONER: behaviors.CLONER,
|
||||
STURDYPOWDER: behaviors.STURDYPOWDER,
|
||||
SELFDELETE: behaviors.SELFDELETE,
|
||||
FOAM: behaviors.FOAM,
|
||||
BUBBLE: behaviors.BUBBLE,
|
||||
STICKY: behaviors.STICKY,
|
||||
MOLTEN: behaviors.MOLTEN,
|
||||
RADPOWDER: behaviors.RADPOWDER,
|
||||
RADMOLTEN: behaviors.RADMOLTEN,
|
||||
RADLIQUID: behaviors.RADLIQUID,
|
||||
BOUNCY: behaviors.BOUNCY,
|
||||
FEEDPIXEL: behaviors.FEEDPIXEL,
|
||||
KILLPIXEL1: behaviors.KILLPIXEL1,
|
||||
KILLPIXEL2: behaviors.KILLPIXEL2,
|
||||
FLY: behaviors.FLY,
|
||||
CRAWLER: behaviors.CRAWLER,
|
||||
}
|
||||
|
||||
class Type {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
this.color = "#ffffff";
|
||||
this.behavior = behaviors.WALL;
|
||||
this.category = "land";
|
||||
this.state = "solid";
|
||||
this.hidden = false;
|
||||
this.density = undefined;
|
||||
this.tempHigh = undefined;
|
||||
this.stateHigh = undefined;
|
||||
this.tempLow = undefined;
|
||||
this.stateLow = undefined;
|
||||
this.temp = undefined;
|
||||
this.reactions = undefined;
|
||||
this.viscosity = undefined;
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
if (typeof color == "string" && !color.startsWith("#")) color = "#" + color;
|
||||
this.color = color;
|
||||
this.colorObject = hexToRGB(color);
|
||||
}
|
||||
Add() {
|
||||
const {...elem} = this;
|
||||
elements[this.name] = elem;
|
||||
}
|
||||
}
|
||||
|
||||
function createPowders() {
|
||||
const Ni = new Type("nirme");
|
||||
Ni.setColor("22b14c");
|
||||
Ni.behavior = bb.POWDER;
|
||||
Ni.category = cat.POWDERS;
|
||||
Ni.state = state.SOLID;
|
||||
Ni.density = 1752;
|
||||
Ni.reactions = {
|
||||
"water": { elem1: "dull_nirme", elem2: null },
|
||||
"salt_water": { elem1: "dull_nirme", elem2: null },
|
||||
}
|
||||
Ni.Add();
|
||||
|
||||
const DNi = new Type("dull_nirme");
|
||||
DNi.setColor("5c916c");
|
||||
DNi.behavior = bb.STURDYPOWDER;
|
||||
DNi.category = cat.STATES;
|
||||
DNi.state = state.SOLID;
|
||||
DNi.density = 1752;
|
||||
DNi.hidden = true;
|
||||
DNi.Add();
|
||||
|
||||
const Em = new Type("emerald");
|
||||
Em.setColor(["#00f49f", "#2fe094", "#b3ffd6", "#5fd9c5"]);
|
||||
Em.behavior = bb.POWDER;
|
||||
Em.category = cat.POWDERS;
|
||||
Em.state = state.SOLID;
|
||||
Em.density = 2750;
|
||||
Em.Add();
|
||||
}
|
||||
|
||||
function createMetals() {
|
||||
const Tg = new Type("thingite");
|
||||
Tg.setColor("4f5263");
|
||||
Tg.behavior = bb.WALL;
|
||||
Tg.category = cat.SOLIDS;
|
||||
Tg.state = state.SOLID;
|
||||
Tg.density = 9408;
|
||||
Tg.tempHigh = 700;
|
||||
Tg.stateHigh = "molten_thingite";
|
||||
Tg.Add();
|
||||
|
||||
const MTg = new Type("molten_thingite");
|
||||
MTg.setColor("5f9cba");
|
||||
MTg.behavior = bb.MOLTEN;
|
||||
MTg.category = cat.STATES;
|
||||
MTg.state = state.LIQUID;
|
||||
MTg.density = 9408;
|
||||
MTg.temp = 700;
|
||||
MTg.tempLow = 600;
|
||||
MTg.stateLow = "thingite";
|
||||
MTg.hidden = true;
|
||||
MTg.Add();
|
||||
|
||||
const Or = new Type("orangium");
|
||||
Or.setColor("b89256");
|
||||
Or.behavior = bb.WALL;
|
||||
Or.category = cat.SOLIDS;
|
||||
Or.state = state.SOLID;
|
||||
Or.density = 12403;
|
||||
Or.tempHigh = 1600;
|
||||
Or.stateHigh = "molten_orangium";
|
||||
Or.Add();
|
||||
|
||||
const MOr = new Type("molten_orangium");
|
||||
MOr.setColor("cca833");
|
||||
MOr.behavior = bb.MOLTEN;
|
||||
MOr.category = cat.STATES;
|
||||
MOr.state = state.LIQUID;
|
||||
MOr.density = 12403;
|
||||
MOr.temp = 1600;
|
||||
MOr.tempLow = 1500;
|
||||
MOr.stateLow = "orangium";
|
||||
MOr.hidden = true;
|
||||
MOr.Add();
|
||||
}
|
||||
|
||||
createPowders();
|
||||
createMetals();
|
||||
|
|
@ -2288,7 +2288,6 @@ elements.selective_void = {
|
|||
selvoid = mostSimilarElement(selvoidans);
|
||||
},
|
||||
tick: function(pixel){
|
||||
var neighbors = 0;
|
||||
if(!pixel.changeElem){
|
||||
pixel.changeElem = selvoid;
|
||||
}
|
||||
|
|
@ -2303,4 +2302,44 @@ elements.selective_void = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let radiusVar = 0
|
||||
let circleElem = 0
|
||||
let circleRep = false
|
||||
elements.scuffed_circle_brush = {
|
||||
category: "special",
|
||||
color: elements.drag.color,
|
||||
excludeRandom: true,
|
||||
state: "solid",
|
||||
movable: "false",
|
||||
onSelect: function(){
|
||||
var answerR = prompt("Radius of the brush.",(radiusVar||undefined));
|
||||
if (!answerR) { return }
|
||||
radiusVar = answerR;
|
||||
var answerE = prompt("Element of the brush.",(circleElem||undefined));
|
||||
if (!answerE) { return }
|
||||
circleElem = answerE;
|
||||
var answerH = prompt("Replace? y or n. May be laggy.",(circleRep||undefined));
|
||||
if (!answerH) { return }
|
||||
circleRep = answerH;
|
||||
},
|
||||
tick: function(pixel){
|
||||
var circlec = circleCoords(pixel.x, pixel.y, radiusVar)
|
||||
for (var i = 0; i < circlec.length; i++){
|
||||
var coord = circlec[i]
|
||||
var x = coord.x
|
||||
var y = coord.y
|
||||
if (isEmpty(x, y)){
|
||||
createPixel(circleElem, x, y)
|
||||
}
|
||||
else if (!isEmpty(x, y, true) && !(circleRep == "n")){
|
||||
deletePixel(x, y)
|
||||
createPixel(circleElem, x, y)
|
||||
}
|
||||
}
|
||||
var thisx = pixel.x
|
||||
var thisy = pixel.y
|
||||
deletePixel(thisx, thisy)
|
||||
createPixel(circleElem, thisx, thisy)
|
||||
}
|
||||
}
|
||||
499
mods/plants.js
499
mods/plants.js
|
|
@ -1,9 +1,10 @@
|
|||
//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok.
|
||||
let fruits = ["plum", "peach", "pear", "orange", "apple", "cherry", "mango"];
|
||||
//This mod was made by Adora the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. Current version: plans.js v1.1.0
|
||||
let fruits = ["plum", "peach", "pear", "orange", "apple", "cherry", "mango", "pineapple", "sugarcane"];
|
||||
let vineExclude = ["tomato", "grape", "fruit_vine", "kiwi"];
|
||||
let vines = ['tomato', 'grape', 'kiwi'];
|
||||
let vines = ['tomato', 'grape', 'kiwi', 'watermelon', 'strawberry', 'cucumber'];
|
||||
let bushes = ["blackberry", "blueberry", "raspberry"];
|
||||
let allFruits = fruits.concat(vines, bushes)
|
||||
let rosaceae = ["plum", "peach", "pear", "apple", "cherry", "blackberry", "raspberry", "strawberry"]
|
||||
function interpolateRgb(rgb1, rgb2, ratio) {
|
||||
const interpolatedRgb = {
|
||||
r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio),
|
||||
|
|
@ -89,7 +90,7 @@ elements.fruit_leaves = {
|
|||
let y = pixel.y+adjacentCoords[i][1];
|
||||
if(isEmpty(x, y) || outOfBounds(x, y)) { continue; }
|
||||
let pixel2 = pixelMap[x][y];
|
||||
if(pixel2.element == "fruit_branch" || pixel2.element == "fruit_leaves" || pixel2.element == "wood" || (elements[pixel2.element].properties && elements[pixel2.element].properties.type == "fruit")){
|
||||
if(pixel2.element == "fruit_branch" || pixel2.element == "fruit_leaves" || pixel2.element == "wood" || (elements[pixel2.element].properties && elements[pixel2.element].properties.type == "fruit") && pixel2.fruit != "pineapple"){
|
||||
if(pixel.fruit && !pixel2.fruit){
|
||||
pixel2.fruit = pixel.fruit;
|
||||
} else if (!pixel.fruit && pixel2.fruit){
|
||||
|
|
@ -110,6 +111,24 @@ elements.fruit_leaves = {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(pixel.fruit == "pineapple" && isEmpty(pixel.x, pixel.y-1) && !outOfBounds(pixel.x, pixel.y-1) && pixel.age < 300){
|
||||
pixel.blooming = false;
|
||||
pixel.color = elements.plant.color;
|
||||
createPixel("unripe_fruit", pixel.x, pixel.y-1);
|
||||
if(isEmpty(pixel.x, pixel.y-2)){
|
||||
createPixel("unripe_fruit", pixel.x, pixel.y-2);
|
||||
}
|
||||
if(isEmpty(pixel.x, pixel.y-3)){
|
||||
createPixel("fruit_leaves", pixel.x, pixel.y-3);
|
||||
}
|
||||
if(isEmpty(pixel.x-1, pixel.y-4)){
|
||||
createPixel("fruit_leaves", pixel.x-1, pixel.y-4);
|
||||
}
|
||||
if(isEmpty(pixel.x+1, pixel.y-4)){
|
||||
createPixel("fruit_leaves", pixel.x+1, pixel.y-4);
|
||||
}
|
||||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1066,6 +1085,8 @@ elements.mango_seed = {
|
|||
elements.seed_maker = {
|
||||
category: "machines",
|
||||
behavior: behaviors.WALL,
|
||||
noMix: true,
|
||||
movable: false,
|
||||
tick: function(pixel){
|
||||
for(var i = 0; i < adjacentCoords.length; i++){
|
||||
let x = pixel.x + adjacentCoords[i][0];
|
||||
|
|
@ -1074,8 +1095,478 @@ elements.seed_maker = {
|
|||
let pixel2 = pixelMap[x][y];
|
||||
if(allFruits.includes(pixel2.element)){
|
||||
changePixel(pixel2, `${pixel2.element}_seed`)
|
||||
} else if (pixel2.element == "cocoa_pod"){
|
||||
changePixel(pixel2, "cocoa_bean");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function xyInRange(x, y, range){
|
||||
let i = 0;
|
||||
while (i < range.length) {
|
||||
if (x === range[i][0] && y === range[i][1]) {
|
||||
i++;
|
||||
return true;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
elements.watermelon = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "#007706",
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
breakIntoColor: "#C1674C",
|
||||
isFood: true,
|
||||
properties: {
|
||||
type: "fruit",
|
||||
age: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.grow && pixel.age > 400){
|
||||
pixel.grow = false;
|
||||
}
|
||||
if(pixel.grow && pixel.range){
|
||||
for(var i = 0; i < adjacentCoords.length; i++){
|
||||
let x = pixel.x + adjacentCoords[i][0];
|
||||
let y = pixel.y + adjacentCoords[i][1];
|
||||
if(isEmpty(x,y) && xyInRange(x,y,pixel.range) && !outOfBounds(x,y)){
|
||||
if(Math.floor(Math.random() * 300) == 1){
|
||||
createPixel("watermelon", x, y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
for(var i = 0; i < adjacentCoords.length; i++){
|
||||
let x = pixel.x + adjacentCoords[i][0];
|
||||
let y = pixel.y + adjacentCoords[i][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y)){
|
||||
let pixel2 = pixelMap[x][y];
|
||||
if(["wood","low_fruit_vine","watermelon"].includes(pixel.element)){
|
||||
if(!pixel2.range || !pixel2.grow){
|
||||
if(pixel.range && !pixel2.range){
|
||||
pixel2.range = pixel.range;
|
||||
}
|
||||
if(pixel.grow && !pixel2.grow){
|
||||
pixel2.grow = pixel.grow;
|
||||
}
|
||||
}
|
||||
if(pixel2.range || pixel2.grow){
|
||||
if(!pixel.range && pixel2.range){
|
||||
pixel.range = pixel2.range;
|
||||
}
|
||||
if(!pixel.grow && pixel2.grow){
|
||||
pixel.grow = pixel2.grow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pixel.age++;
|
||||
}
|
||||
}
|
||||
let sizes = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 9]
|
||||
elements.low_fruit_vine = {
|
||||
color: elements.fruit_vine.color,
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
if(pixel.fruiting && pixel.fruit == "watermelon"){
|
||||
pixel.fruiting = false;
|
||||
let size = pixel.size;
|
||||
let range = mouseRange(pixel.x, pixel.y + Math.floor(size / 2 + 1), size)
|
||||
if(isEmpty(pixel.x, pixel.y + 1) && !outOfBounds(pixel.x, pixel.y + 1)){
|
||||
createPixel("watermelon", pixel.x, pixel.y + 1);
|
||||
let pixel2 = pixelMap[pixel.x][pixel.y + 1];
|
||||
pixel2.range = range;
|
||||
pixel2.grow = true;
|
||||
}
|
||||
} else {
|
||||
if(isEmpty(pixel.x, pixel.y - 1) && !outOfBounds(pixel.x, pixel.y - 1) && Math.floor(Math.random() * 300) == 1 && pixel.fruit && ![undefined, "watermelon"].includes(pixel.fruit)){
|
||||
createPixel(pixel.fruit, pixel.x, pixel.y - 1);
|
||||
}
|
||||
}
|
||||
if(Math.floor(Math.random() * 100) == 1 && !["watermelon", undefined].includes(pixel.fruit)){
|
||||
eval((Math.floor(Math.random() * 2) == 1) ? `
|
||||
if(isEmpty(pixel.x + 1, pixel.y)){
|
||||
createPixel("low_fruit_vine", pixel.x + 1, pixel.y);
|
||||
pixelMap[pixel.x + 1][pixel.y].fruit = pixel.fruit;
|
||||
}`
|
||||
: `
|
||||
if(isEmpty(pixel.x - 1, pixel.y)){
|
||||
createPixel("low_fruit_vine", pixel.x - 1, pixel.y);
|
||||
pixelMap[pixel.x - 1][pixel.y].fruit = pixel.fruit;
|
||||
}`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
let sizeObj = {
|
||||
size3: [
|
||||
[0,1],
|
||||
[0,2],
|
||||
[1,3],
|
||||
[2,3]
|
||||
],
|
||||
size5:[
|
||||
[0,1],
|
||||
[0,2],
|
||||
[0,3],
|
||||
[0,4],
|
||||
[1,5],
|
||||
[2,5],
|
||||
[3,5],
|
||||
],
|
||||
size7: [
|
||||
[0,1],
|
||||
[0,2],
|
||||
[0,3],
|
||||
[0,4],
|
||||
[0,5],
|
||||
[0,6],
|
||||
[1,7],
|
||||
[2,7],
|
||||
[3,7],
|
||||
[4,7],
|
||||
],
|
||||
size9: [
|
||||
[0,1],
|
||||
[0,2],
|
||||
[0,3],
|
||||
[0,4],
|
||||
[0,5],
|
||||
[0,6],
|
||||
[0,7],
|
||||
[0,8],
|
||||
[1,9],
|
||||
[2,9],
|
||||
[3,9],
|
||||
[4,9],
|
||||
[5,9],
|
||||
]
|
||||
}
|
||||
elements.watermelon_seed = {
|
||||
color: "#231A00",
|
||||
category: "life",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tick: function(pixel){
|
||||
if(pixel.start == pixelTicks - 10){
|
||||
pixel.size = sizes[Math.floor(Math.random() * sizes.length)];
|
||||
pixel.direction = Math.floor(Math.random() * 2)
|
||||
pixel.grow = true;
|
||||
}
|
||||
if(pixel.grow && !isEmpty(pixel.x,pixel.y+1) && !outOfBounds(pixel.x,pixel.y+1) && pixelMap[pixel.x][pixel.y + 1].element == "dirt" && pixel.age > 100){
|
||||
pixel.fruit = "watermelon";
|
||||
let sizeList = sizeObj[`size${pixel.size}`];
|
||||
for(var i = 0; i < sizeList.length; i++){
|
||||
let x = (pixel.direction == 1) ? pixel.x - sizeList[i][0] : pixel.x + sizeList[i][0];
|
||||
let y = pixel.y - sizeList[i][1];
|
||||
if(isEmpty(x, y) && !outOfBounds(x, y)){
|
||||
createPixel("low_fruit_vine", x, y);
|
||||
if(i == sizeList.length - 1){
|
||||
pixelMap[x][y].fruiting = true;
|
||||
pixelMap[x][y].size = pixel.size;
|
||||
pixelMap[x][y].fruit = "watermelon";
|
||||
changePixel(pixel,"low_fruit_vine");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pixel.age++;
|
||||
},
|
||||
properties: {
|
||||
age: 0,
|
||||
},
|
||||
}
|
||||
elements.strawberry = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "#e5080a",
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
breakIntoColor: "#f9c0af",
|
||||
isFood: true,
|
||||
properties: {
|
||||
type: "fruit",
|
||||
age: 0,
|
||||
},
|
||||
}
|
||||
elements.strawberry_seed = {
|
||||
color: "#ffa371",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "life",
|
||||
properties: {
|
||||
age: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.age > 40){
|
||||
changePixel(pixel, "low_fruit_vine");
|
||||
pixel.fruit = "strawberry";
|
||||
}
|
||||
pixel.age += 1;
|
||||
}
|
||||
}
|
||||
elements.cucumber = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "#285a1b",
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
breakIntoColor: "#80b450",
|
||||
isFood: true,
|
||||
properties: {
|
||||
type: "fruit",
|
||||
age: 0,
|
||||
},
|
||||
}
|
||||
let ages = {
|
||||
pineapple: 140,
|
||||
}
|
||||
elements.cucumber_seed = {
|
||||
color: "#e9f5b5",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "life",
|
||||
properties: {
|
||||
age: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.age > 40){
|
||||
changePixel(pixel, "low_fruit_vine");
|
||||
pixel.fruit = "cucumber";
|
||||
}
|
||||
pixel.age += 1;
|
||||
}
|
||||
}
|
||||
elements.unripe_fruit = {
|
||||
color: "#9eba32",
|
||||
behavior: behaviors.WALL,
|
||||
category: "life",
|
||||
properties: {
|
||||
age: 0,
|
||||
fruit: "pineapple",
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.age >= ages[pixel.fruit] && Math.floor(Math.random() * 100) == 1){
|
||||
changePixel(pixel, pixel.fruit);
|
||||
}
|
||||
pixel.age++;
|
||||
},
|
||||
breakInto: ["poison", "juice", "cyanide"],
|
||||
breakIntoColor: "#9eba32",
|
||||
}
|
||||
elements.pineapple = {
|
||||
behavior: [["XX", "ST:fruit_leaves", "XX"],["ST:fruit_leaves", "XX", "ST:fruit_leaves"],["M2", "ST:fruit_leaves AND M1", "M2"]],
|
||||
color: ["#ffcc56", "#e69f05", "#ffc061", "#fad32b"],
|
||||
category: "food",
|
||||
breakInto: "juice",
|
||||
breakIntoColor: "#ffd905",
|
||||
isFood: true,
|
||||
properties: {
|
||||
type: "fruit",
|
||||
age: 0,
|
||||
},
|
||||
}
|
||||
elements.pineapple_seed = {
|
||||
color: "#7b2700",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "life",
|
||||
properties: {
|
||||
age: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.age > 40){
|
||||
changePixel(pixel, "fruit_leaves");
|
||||
pixel.fruit = "pineapple";
|
||||
}
|
||||
pixel.age += 1;
|
||||
}
|
||||
}
|
||||
elements.cocoa_pod = {
|
||||
behavior: [["XX", "ST:fruit_leaves AND ST:fruit_branch", "XX"],["ST:fruit_leaves AND ST:fruit_branch", "XX", "ST:fruit_leaves AND ST:fruit_branch"],["M2", "ST:fruit_leaves AND ST:fruit_branch AND M1", "M2"]],
|
||||
color: "#9e5648",
|
||||
category: "food",
|
||||
breakInto: ["cocoa_butter", "cocoa_bean"],
|
||||
isFood: true,
|
||||
properties: {
|
||||
fruit: "cocoa_pod",
|
||||
type: "fruit",
|
||||
}
|
||||
}
|
||||
elements.cocoa_bean = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "#ebaf7b",
|
||||
category: "food",
|
||||
isFood: true,
|
||||
properties: {
|
||||
fruit: "cocoa_pod",
|
||||
type: "fruit",
|
||||
age: 0,
|
||||
},
|
||||
tempHigh: 122,
|
||||
stateHigh: "roasted_cocoa_bean",
|
||||
tick: function(pixel) {
|
||||
if (isEmpty(pixel.x,pixel.y+1)) {
|
||||
movePixel(pixel,pixel.x,pixel.y+1);
|
||||
}
|
||||
else {
|
||||
if (Math.random() < 0.02 && pixel.age > 650 && pixel.temp < 120) {
|
||||
if (!outOfBounds(pixel.x,pixel.y+1)) {
|
||||
var dirtPixel = pixelMap[pixel.x][pixel.y+1];
|
||||
if (dirtPixel.element === "dirt" || dirtPixel.element === "mud" || dirtPixel.element === "sand" || dirtPixel.element === "wet_sand" || dirtPixel.element === "clay_soil" || dirtPixel.element === "mycelium") {
|
||||
changePixel(dirtPixel,"root");
|
||||
}
|
||||
}
|
||||
if (isEmpty(pixel.x,pixel.y-1)) {
|
||||
movePixel(pixel,pixel.x,pixel.y-1);
|
||||
createPixel(Math.random() > 0.5 ? "wood" : "fruit_branch",pixel.x,pixel.y+1);
|
||||
if (pixelMap[pixel.x][pixel.y+1].element == "fruit_branch" || pixelMap[pixel.x][pixel.y+1].element == "fruit_leaves"){
|
||||
pixelMap[pixel.x][pixel.y+1].fruit = "cocoa_pod";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pixel.age > 1650) {
|
||||
changePixel(pixel,"wood");
|
||||
}
|
||||
pixel.age++;
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
}
|
||||
|
||||
elements.cocoa_butter = {
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
color: "#ddc996",
|
||||
category: "food",
|
||||
isFood: true,
|
||||
tempHigh: 30,
|
||||
stateHigh: "melted_cocoa_butter",
|
||||
}
|
||||
elements.melted_cocoa_butter = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color: "#c78b06",
|
||||
category: "states",
|
||||
isFood: true,
|
||||
viscosity: 2000,
|
||||
tempLow: 30,
|
||||
stateLow: "cocoa_butter",
|
||||
temp: 30,
|
||||
reactions: {
|
||||
sugar: { elem1: "melted_white_chocolate", elem2: "melted_white_chocolate" }
|
||||
}
|
||||
}
|
||||
elements.roasted_cocoa_bean = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "#6b3b24",
|
||||
category: "food",
|
||||
isFood: true,
|
||||
breakInto: "cocoa_powder",
|
||||
}
|
||||
elements.cocoa_powder = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "#451f16",
|
||||
category: "food",
|
||||
isFood: true,
|
||||
reactions: {
|
||||
melted_cocoa_butter: { elem1: "chocolate", elem2: "chocolate" }
|
||||
}
|
||||
}
|
||||
elements.extractor = {
|
||||
category: "machines",
|
||||
noMix: true,
|
||||
movable: false,
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
for(var i = 0; i < adjacentCoords.length; i++){
|
||||
let x = pixel.x + adjacentCoords[i][0];
|
||||
let y = pixel.y + adjacentCoords[i][1]
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y)){
|
||||
let pixel2 = pixelMap[x][y];
|
||||
if (pixel2.element == "cocoa_pod"){
|
||||
changePixel(pixel2, "cocoa_butter");
|
||||
} else if (pixel2.element == "sugarcane"){
|
||||
changePixel(pixel2, "sugar");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.white_chocolate = {
|
||||
"color": "#f4e6cb",
|
||||
"behavior": [
|
||||
[
|
||||
"XX",
|
||||
"XX",
|
||||
"XX"
|
||||
],
|
||||
[
|
||||
"XX",
|
||||
"XX",
|
||||
"XX"
|
||||
],
|
||||
[
|
||||
"XX",
|
||||
"M1",
|
||||
"XX"
|
||||
]
|
||||
],
|
||||
"tempHigh": 31,
|
||||
"stateHigh": "melted_white_chocolate",
|
||||
"category": "food",
|
||||
"state": "solid",
|
||||
"density": 1325,
|
||||
"isFood": true,
|
||||
"movable": true
|
||||
}
|
||||
elements.melted_white_chocolate = {
|
||||
behavior: behaviors.LIQUID,
|
||||
"color": "#f2d184",
|
||||
"tempLow": 0,
|
||||
"stateLow": "white_chocolate",
|
||||
"tempHigh": 99,
|
||||
"stateHigh": [
|
||||
"steam",
|
||||
"sugar"
|
||||
],
|
||||
"category": "states",
|
||||
"viscosity": 40,
|
||||
"state": "liquid",
|
||||
"density": 1325,
|
||||
"hidden": true,
|
||||
"stain": 0.05,
|
||||
"isFood": true,
|
||||
"movable": true
|
||||
}
|
||||
elements.sugarcane_seed = {
|
||||
color: "#c4ae7d",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "life",
|
||||
properties: {
|
||||
age: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(isEmpty(pixel.x, pixel.y-1) && !outOfBounds(pixel.x, pixel.y-1) && Math.floor(Math.random() * 100) == 1 && pixel.age > 40){
|
||||
movePixel(pixel,pixel.x,pixel.y-1);
|
||||
createPixel("sugarcane",pixel.x,pixel.y+1);
|
||||
} else if (!isEmpty(pixel.x, pixel.y-1) && !outOfBounds(pixel.x, pixel.y-1) && pixelMap[pixel.x][pixel.y-1].element == "sugarcane_seed"){
|
||||
deletePixel(pixel.x, pixel.y-1);
|
||||
}
|
||||
if(!pixel.age){
|
||||
pixel.age = 1;
|
||||
} else {
|
||||
pixel.age++;
|
||||
}
|
||||
if(pixel.age == 550){
|
||||
changePixel(pixel, "sugarcane")
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.sugarcane = {
|
||||
color: "#76881c",
|
||||
breakInto: ["sugar_water", "dead_plant", "dead_plant", "dead_plant"],
|
||||
isFood: true,
|
||||
behavior: behaviors.WALL,
|
||||
category: "food",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -509,4 +509,87 @@ tick: function(pixel) {
|
|||
}}},
|
||||
category: "aircrafts",
|
||||
breakInto: "metal_scrap"
|
||||
}
|
||||
},
|
||||
elements.machine_for_throwing_bombs_at_you_left = {
|
||||
color: "#524c41",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|XX|XX",
|
||||
"CR:bombs_for_throwing_at_you_left|XX|XX",
|
||||
"XXXX|XX",
|
||||
],
|
||||
category: "weapons",
|
||||
conduct: 1
|
||||
},
|
||||
elements.bombs_for_throwing_at_you_left = {
|
||||
color: "#524c41",
|
||||
category: "ammunition",
|
||||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"M1|M1%10 AND EX:10>bomb|XX",
|
||||
],
|
||||
}
|
||||
elements.machine_for_throwing_bombs_at_right = {
|
||||
color: "#524c41",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|CR:bombs_for_throwing_at_you_right",
|
||||
"XXXX|XX",
|
||||
],
|
||||
category: "weapons",
|
||||
conduct: 1
|
||||
},
|
||||
elements.bombs_for_throwing_at_you_right = {
|
||||
color: "#524c41",
|
||||
category: "ammunition",
|
||||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|M1%10 AND EX:10>bomb|M1",
|
||||
],
|
||||
},
|
||||
elements.energized_orb_left = {
|
||||
color: ["#e0e000","#f3f300"],
|
||||
category: "energy",
|
||||
behavior: [
|
||||
"XX|EX:50>electric|XX",
|
||||
"M1 AND EX:50>electric|XX|EX:50>electric",
|
||||
"XX|EX:50>electric|XX"
|
||||
],
|
||||
state: "gas",
|
||||
},
|
||||
elements.energized_orb_right = {
|
||||
color: ["#e0e000","#f3f300"],
|
||||
category: "energy",
|
||||
behavior: [
|
||||
"XX|EX:50>electric|XX",
|
||||
"EX:50>electric|XX|M1 AND EX:50>electric",
|
||||
"XX|EX:50>electric|XX"
|
||||
],
|
||||
state: "gas",
|
||||
},
|
||||
elements.fast_bomb = {
|
||||
color: "#524c41",
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>explosion|M2",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
for (var i=0; i<3; i++) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
|
||||
if (!isEmpty(pixel.x, pixel.y+1,true)) {
|
||||
var newPixel = pixelMap[pixel.x][pixel.y+1];
|
||||
if (newPixel.element === "fast_bomb") { break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
}
|
||||
Loading…
Reference in New Issue