Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
d8be08a220
|
|
@ -1,11 +1,11 @@
|
|||
# Sandboxels
|
||||
A falling sand simulation game.
|
||||
A falling sand simulation game with hundreds of elements, heat simulation, chemical reactions, fire, density, electricity, and more.
|
||||
|
||||
Play at [Sandboxels.R74n.com](https://sandboxels.r74n.com/).
|
||||
Play for free at [Sandboxels.R74n.com](https://sandboxels.r74n.com/).
|
||||
|
||||
Join the [Discord server](https://discord.com/invite/ejUc6YPQuS).
|
||||
|
||||

|
||||

|
||||
|
||||
# Controls
|
||||
* Left Click = Draw pixels
|
||||
|
|
@ -29,7 +29,7 @@ Join the [Discord server](https://discord.com/invite/ejUc6YPQuS).
|
|||
|
||||
# Button Info
|
||||
* Pause = Pause/play the simulation
|
||||
* Step = Run a single frame
|
||||
* Step (>) = Run a single frame
|
||||
* Minus (-) = Decrease the cursor size
|
||||
* Plus (+) = Increase the cursor size
|
||||
* Reset = Clears the entire simulation
|
||||
|
|
@ -37,5 +37,6 @@ Join the [Discord server](https://discord.com/invite/ejUc6YPQuS).
|
|||
* E = Select any element by name
|
||||
* TPS = Change how fast the simulation runs
|
||||
* Info = Open the element info screen
|
||||
* Saves = Open the Save & Load menu
|
||||
* Mods = Open the Mod Manager
|
||||
* Settings = Open the settings menu
|
||||
|
|
|
|||
|
|
@ -109,6 +109,28 @@
|
|||
<p>The original <a href="https://sandboxels.R74n.com/changelog.txt">plain text version</a> of this is still maintained.</p>
|
||||
</div>
|
||||
|
||||
<h2 id="1.11.2">[Version 1.11.2 - May 16, 2025 - Steam Release]</h2>
|
||||
<ul>
|
||||
<li>+ Sandboxels is now on Steam! <a href="https://store.steampowered.com/app/3664820/Sandboxels/" target="_blank">Check it out!</a></li>
|
||||
<li>+ Theme color setting</li>
|
||||
<li>+ Destroyable border mode</li>
|
||||
<li>+ Support for Korean, Italian, Serbian, and Australian English</li>
|
||||
<li>[Changes]</li>
|
||||
<li>~ Backgrounds of menus are blurred</li>
|
||||
<li>~ Solids are no longer affected by Void or Loop borders</li>
|
||||
<li>~ World gen is surrounded by Wall with Void or Loop borders</li>
|
||||
<li>+ Notice when window is resized for the first time</li>
|
||||
<li>~ Saves Menu, Mod Manager, Debug, and Reset settings use native Sandboxels prompts</li>
|
||||
<li>[Bug Fixes]</li>
|
||||
<li>~ Fixed: Category buttons show underscores in names</li>
|
||||
<li>~ Fixed: World gen doesn't fill entire canvas horizontally</li>
|
||||
<li>~ Fixed: Elements dynamically added repeatedly aren't selectable</li>
|
||||
<li>[Technical]</li>
|
||||
<li>+ Multiple mods can be added at once, separated by semicolon (;)</li>
|
||||
<li>+ 'locked' element property, will prevent selection when set to true</li>
|
||||
<li>+ 'fancy' view property, will allow rendering with Fancy Pixels off when set to false</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="1.11.1">[Version 1.11.1 - April 1, 2025 - FOOLS-2-5]</h2>
|
||||
<ul>
|
||||
<li>+ Border setting</li>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,26 @@ 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.11.2 - May 16, 2025 - Steam Release]
|
||||
+ Sandboxels is now on Steam! https://store.steampowered.com/app/3664820/Sandboxels/
|
||||
+ Theme color setting
|
||||
+ Destroyable border mode
|
||||
+ Support for Korean, Italian, Serbian, and Australian English
|
||||
[Changes]
|
||||
~ Backgrounds of menus are blurred
|
||||
~ Solids are no longer affected by Void or Loop borders
|
||||
~ World gen is surrounded by Wall with Void or Loop borders
|
||||
+ Notice when window is resized for the first time
|
||||
~ Saves Menu, Mod Manager, Debug, and Reset settings use native Sandboxels prompts
|
||||
[Bug Fixes]
|
||||
~ Fixed: Category buttons show underscores in names
|
||||
~ Fixed: World gen doesn't fill entire canvas horizontally
|
||||
~ Fixed: Elements dynamically added repeatedly aren't selectable
|
||||
[Technical]
|
||||
+ Multiple mods can be added at once, separated by semicolon (;)
|
||||
+ 'locked' element property, will prevent selection when set to true
|
||||
+ 'fancy' view property, will allow rendering with Fancy Pixels off when set to false
|
||||
|
||||
[Version 1.11.1 - April 1, 2025 - FOOLS-2-5]
|
||||
+ Border setting
|
||||
+ Void deletes pixels that touch the sides
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@
|
|||
<tr><td>E</td> <td>Select any element by name</tr>
|
||||
<tr><td>TPS</td> <td>Change how fast the simulation runs (Default 30tps)</tr>
|
||||
<tr><td>Info</td> <td>Open the element info screen</tr>
|
||||
<tr><td>Saves</td> <td>Open the Save & Load menu</tr>
|
||||
<tr><td>Mods</td> <td>Open the Mod Manager</tr>
|
||||
<tr><td>Settings</td> <td>Open the Settings Menu</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -56,5 +56,6 @@ Replace = Override existing pixels when placing
|
|||
E = Select any element by name
|
||||
TPS = Change how fast the simulation runs
|
||||
Info = Open the element info screen
|
||||
Saves = Open the Save & Load menu
|
||||
Mods = Open the Mod Manager
|
||||
Settings = Open the Settings Menu
|
||||
Settings = Open the Settings Menu
|
||||
|
|
|
|||
561
index.html
561
index.html
File diff suppressed because it is too large
Load Diff
|
|
@ -1 +0,0 @@
|
|||
{}
|
||||
|
|
@ -1 +1 @@
|
|||
{"\"#lang.name\"":"English (Australia)","soda":"soft_drink","gray_goo":"grey_goo","aluminum":"aluminium","candy":"sweets","jelly":"jam","ketchup":"tomato_sauce","molten_aluminum":"molten_aluminium","color_smoke":"colour_smoke","sulfur":"sulphur","molten_sulfur":"molten_sulphur","sulfur_gas":"sulphur_gas","color_sand":"colour_sand","soda_ice":"soft_drink_ice","\"gui.saveColors\"":"Colours"}
|
||||
{"\"#lang.name\"":"English (Australia)","gray_goo":"grey_goo","aluminum":"aluminium","molten_aluminum":"molten_aluminium","color_smoke":"colour_smoke","sulfur":"sulphur","molten_sulfur":"molten_sulphur","sulfur_gas":"sulphur_gas","color_sand":"colour_sand","\"gui.saveColors\"":"Colours"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"\"#lang.name\"":"Nederlands","land":"Land","liquids":"Vloeistoffen","life":"Leven","powders":"Poeder","solids":"Vaste stoffen","energy":"Energie","weapons":"Wapens","gases":"Gassen","food":"Eten","machines":"Machines","special":"Special","other":"Anderen","states":"Staten","heat":"Warmte","cool":"Koud","erase":"Uitgummen","drag":"Mee slepen","pick":"Pakken","mix":"Mix","lookup":"Op Zoeken","shock":"Schok","paint":"Verfen","sand":"Zand","water":"Water","salt_water":"Zout Water","sugar_water":"Suiker Water","seltzer":"seltzer","dirty_water":"Vies water","pool_water":"Zwembad water","dirt":"Aarde","mud":"Modder","wet_sand":"Nat zand","rock":"Steen","rock_wall":"Stenen muur","mudstone":"Moddersteen","packed_sand":"Ingepakt zand","plant":"Plant","dead_plant":"Dode plant","frozen_plant":"Bevroren plant","grass":"Gras","algae":"Algen","concrete":"Beton","wall":"Muur","fire":"Vuur","bomb":"Bom","steam":"Stoom","ice":"ijs","rime":"Rijp","snow":"Sneeuw","slush":"Dik water","packed_snow":"Verpakte sneeuw","wood":"Hout","smoke":"Rook","magma":"Lava","plasma":"Heet Vuur","cold_fire":"Koud Vuur","glass":"Glas","molten_glass":"Gesmolten Glas","molten_rad_glass":"Gesmolten radioactief glas","rad_glass":"Radioactief glas","meat":"Vlees","rotten_meat":"Verrot Vlees","cured_meat":"Gepekeld Vlees","cooked_meat":"Gekookt Vlees","frozen_meat":"Bevroren Vlees","salt":"Zout","molten_salt":"Gesmolten zout","sugar":"Suiker","flour":"Meel","wire":"Stroomdraad","battery":"Batterij","cloner":"Klonen","sensor":"Sensor","heater":"Verwarming","cooler":"Koeler","random":"Willekeurig","image":"Afbeelding","unpaint":"Verf ongedaan maken","uncharge":"Elektriciteit ongedaan maken","unburn":"Brand ongedaan maken","smash":"Breek","filler":"Opvuller","lattice":"Rooster","gravel":"Grind","slime":"Slijm","cement":"Cement","dust":"Stof","void":"Zwart Gat","sun":"Zon","cell":"Cel","cancer":"Kanker","dna":"DNA","plague":"Plaag","worm":"Worm","frozen_worm":"Bevroren Worm","flea":"Vlo","termite":"Termiet","ant":"Mier","spider":"Spin","web":"Spinnenweb","fly":"Vlieg","firefly":"Vuurvlieg","bee":"Bij","hive":"Bijenkorf","stink_bug":"Stink insect","dead_bug":"Dood Insect","human":"Mens","body":"Lichaam","head":"Hoofd","bird":"Vogel","rat":"Rat","frog":"Kikker","frozen_frog":"Bevroren Kikker","tadpole":"Kikkervisje","fish":"Vis","frozen_fish":"Bevroren Vis","slug":"Naaktslak","snail":"Slak","burner":"Brander","superheater":"Super verwarming","freezer":"vriezer","pipe":"Pijp","pipe_wall":"Pijp muur","mixer":"Meng","grinder":"Slijper","fuse":"Lont","ewall":"Elektrische muur","torch":"Fakkel","spout":"Waterspuit","udder":"Uier","bone_marrow":"Beenmerg","bone":"Bot","ball":"Bal","balloon":"Ballon","antipowder":"Anti poeder","antimolten":"Gesmolten anti","antifire":"Anti vuur","antifluid":"Anti vloeistof","antigas":"Anti gas","vertical":"Verticaal","horizontal":"Horizontaal","ash":"As","molten_ash":"Gesmolten as","light":"Licht","liquid_light":"Vloeibaar licht","laser":"Laser","pointer":"Punter","charcoal":"Steenkool\n","tinder":"Tondel","sawdust":"Zaagsel","hail":"Hagel","hydrogen":"Waterstof","oxygen":"Zuurstof","nitrogen":"Stikstof","helium":"Helium","anesthesia":"Anesthesie","carbon_dioxide":"Koolstofdioxide","bubble":"Bubbels","ammonia":"Ammoniak","liquid_ammonia":"Vloeibaar ammoniak","oil":"Olie","lamp_oil":"Kerosine","propane":"Propaan","liquid_propane":"Vloeibaar propaan","methane":"Methaan","liquid_methane":"Vloeibaar methaan","stained_glass":"Gekleurd glas","molten_stained_glass":"Gesmolten gekleurd glas","art":"Kunst","rainbow":"Regenboog","static":"Statisch","border":"Grens","clay":"Klei","clay_soil":"Klei grond","cloth":"Wol","cellulose":"Houtstof","wax":"Wax","melted_wax":"Gesmolten wax","incense":"Wierook","dioxin":"Dioxide","insulation":"Isolatie","sponge":"Spons","bamboo":"Bamboe","iron":"IJzer","copper":"Koper","gold":"Goud","steel":"Staal","galvanized_steel":"Gegalvaniseerd staal","zinc":"Zink","silver":"Zilver","tin":"Tin","lead":"Lood","nickel":"Nikkel","aluminum":"Aluminium","tungsten":"Wolfraam","molten_tungsten":"Gesmolten Wolfraam","brass":"Geelkoper","bronze":"Brons","sterling":"Sterling","gallium":"Gallium","molten_gallium":"Gesmolten Gallium","gallium_gas":"Gallium gas","rose_gold":"Rosé goud","purple_gold":"Paars goud\n","blue_gold":"Blauw Goud","electrum":"Groen Goud","pyrite":"Pyriet","solder":"Soldeersel","amber":"Barnsteen","molten_copper":"Gesmolten koper","molten_copper_sulfate":"Gesmolten koper sulfaat","molten_gold":"Gesmolten goud","molten_silver":"Gesmolten zilver","molten_iron":"Gesmolten IJzer","molten_nickel":"Gesmolten nikkel","molten_tin":"Gesmolten tin","molten_lead":"Gesmolten lood","molten_solder":"Gesmolten soldeersel","juice":"Sap","juice_ice":"Sap ijs","broth":"Bouillon"}
|
||||
{"\"#lang.name\"":"Nederlands","land":"Land","liquids":"Vloeistoffen","life":"Leven","powders":"Poeder","solids":"Vaste stoffen","energy":"Energie","weapons":"Wapens","gases":"Gassen","food":"Eten","machines":"Machines","special":"Special","other":"Anderen","states":"Staten","heat":"Warmte","cool":"Koud","erase":"Uitgummen","drag":"Mee slepen","pick":"Pakken","mix":"Mix","lookup":"Op Zoeken","shock":"Schok","paint":"Verfen","sand":"Zand","water":"Water","salt_water":"Zout Water","sugar_water":"Suiker Water","seltzer":"seltzer","dirty_water":"Vies water","pool_water":"Zwembad water","dirt":"Aarde","mud":"Modder","wet_sand":"Nat zand","rock":"Steen","rock_wall":"Stenen muur","mudstone":"Moddersteen","packed_sand":"Ingepakt zand","plant":"Plant","dead_plant":"Dode plant","frozen_plant":"Bevroren plant","grass":"Gras","algae":"Algen","concrete":"Beton","wall":"Muur","fire":"Vuur","bomb":"Bom","steam":"Stoom","ice":"ijs","rime":"Rijp","snow":"Sneeuw","slush":"Dik water","packed_snow":"Verpakte sneeuw","wood":"Hout","smoke":"Rook","magma":"Lava","plasma":"Heet Vuur","cold_fire":"Koud Vuur","glass":"Glas","molten_glass":"Gesmolten Glas","molten_rad_glass":"Gesmolten radioactief glas","rad_glass":"Radioactief glas","meat":"Vlees","rotten_meat":"Verrot Vlees","cured_meat":"Gepekeld Vlees","cooked_meat":"Gekookt Vlees","frozen_meat":"Bevroren Vlees","salt":"Zout","molten_salt":"Gesmolten zout","sugar":"Suiker","flour":"Meel","wire":"Stroomdraad","battery":"Batterij","cloner":"Klonen","sensor":"Sensor","heater":"Verwarming","cooler":"Koeler","random":"Willekeurig","image":"Afbeelding","unpaint":"Verf ongedaan maken","uncharge":"Elektriciteit ongedaan maken","unburn":"Brand ongedaan maken","smash":"Breek","filler":"Opvuller","lattice":"Rooster","gravel":"Grind","slime":"Slijm","cement":"Cement","dust":"Stof","void":"Zwart Gat","sun":"Zon","cell":"Cel","cancer":"Kanker","dna":"DNA","plague":"Plaag","worm":"Worm","frozen_worm":"Bevroren Worm","flea":"Vlo","termite":"Termiet","ant":"Mier","spider":"Spin","web":"Spinnenweb","fly":"Vlieg","firefly":"Vuurvlieg","bee":"Bij","hive":"Bijenkorf","stink_bug":"Stink insect","dead_bug":"Dood Insect","human":"Mens","body":"Lichaam","head":"Hoofd","bird":"Vogel","rat":"Rat","frog":"Kikker","frozen_frog":"Bevroren Kikker","tadpole":"Kikkervisje","fish":"Vis","frozen_fish":"Bevroren Vis","slug":"Naaktslak","snail":"Slak","burner":"Brander","superheater":"Super verwarming","freezer":"vriezer","pipe":"Pijp","pipe_wall":"Pijp muur","mixer":"Meng","grinder":"Slijper","fuse":"Lont","ewall":"Elektrische muur","torch":"Fakkel","spout":"Waterspuit","udder":"Uier","bone_marrow":"Beenmerg","bone":"Bot","ball":"Bal","balloon":"Ballon","antipowder":"Anti poeder","antimolten":"Gesmolten anti","antifire":"Anti vuur","antifluid":"Anti vloeistof","antigas":"Anti gas","vertical":"Verticaal","horizontal":"Horizontaal","ash":"As","molten_ash":"Gesmolten as","light":"Licht","liquid_light":"Vloeibaar licht","laser":"Laser","pointer":"Punter","charcoal":"Steenkool\n","tinder":"Tondel","sawdust":"Zaagsel","hail":"Hagel","hydrogen":"Waterstof","oxygen":"Zuurstof","nitrogen":"Stikstof","helium":"Helium","anesthesia":"Anesthesie","carbon_dioxide":"Koolstofdioxide","bubble":"Bubbels","ammonia":"Ammoniak","liquid_ammonia":"Vloeibaar ammoniak","oil":"Olie","lamp_oil":"Kerosine","propane":"Propaan","liquid_propane":"Vloeibaar propaan","methane":"Methaan","liquid_methane":"Vloeibaar methaan","stained_glass":"Gekleurd glas","molten_stained_glass":"Gesmolten gekleurd glas","art":"Kunst","rainbow":"Regenboog","static":"Statisch","border":"Grens","clay":"Klei","clay_soil":"Klei grond","brick":"Steen","ruins":"Ruïne","porcelain":"Porselein","sapling":"Jonge boom","cactus":"Cactus","kelp":"Kelp","seeds":"Zaden","wheat_seed":"Tarwe zaad","straw":"Rietje","paper":"Papier","pollen":"Pollen","cloth":"Wol","cellulose":"Houtstof","wax":"Wax","melted_wax":"Gesmolten wax","incense":"Wierook","dioxin":"Dioxide","insulation":"Isolatie","sponge":"Spons","bamboo":"Bamboe","iron":"IJzer","copper":"Koper","gold":"Goud","steel":"Staal","galvanized_steel":"Gegalvaniseerd staal","zinc":"Zink","silver":"Zilver","tin":"Tin","lead":"Lood","nickel":"Nikkel","aluminum":"Aluminium","tungsten":"Wolfraam","molten_tungsten":"Gesmolten Wolfraam","brass":"Geelkoper","bronze":"Brons","sterling":"Sterling","gallium":"Gallium","molten_gallium":"Gesmolten Gallium","gallium_gas":"Gallium gas","rose_gold":"Rosé goud","purple_gold":"Paars goud\n","blue_gold":"Blauw Goud","electrum":"Groen Goud","pyrite":"Pyriet","solder":"Soldeersel","amber":"Barnsteen","molten_copper":"Gesmolten koper","molten_copper_sulfate":"Gesmolten koper sulfaat","molten_gold":"Gesmolten goud","molten_silver":"Gesmolten zilver","molten_iron":"Gesmolten IJzer","molten_nickel":"Gesmolten nikkel","molten_tin":"Gesmolten tin","molten_lead":"Gesmolten lood","molten_solder":"Gesmolten soldeersel","juice":"Sap","juice_ice":"Sap ijs","broth":"Bouillon"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"\"#lang.name\"":"Viossa","land":"lantstof","liquids":"ishkestof","life":"vonastof","powders":"pudrastof","solids":"ishilykstof","energy":"zeusstof","weapons":"krizstof","gases":"luftstof","food":"namting","machines":"ilo","special":"viktistof","other":"anderstof","states":"vapazmatel","heat":"plusvapa","cool":"plussamui","erase":"keshite","drag":"bidra","pick":"kawari","mix":"visk","lookup":"suha","shock":"zeus","paint":"vaha","sand":"san","water":"ishke","salt_water":"shio_ishke","sugar_water":"sokkeri_ishke","seltzer":"bersoda_ishke","dirty_water":"bjurkishke","pool_water":"ojoiplas_ishke"}
|
||||
{"\"#lang.name\"":"Viossa","land":"lantstof","liquids":"ishkestof","life":"vonastof","powders":"pudrastof","solids":"ishilykstof","energy":"zeusstof","weapons":"krizstof","gases":"luftstof","food":"namting","machines":"ilo","special":"viktistof","other":"anderstof","states":"vapazmatel","heat":"plusvapa","cool":"plussamui","erase":"keshite","drag":"bidra","pick":"kawari","mix":"visk","lookup":"suha","shock":"zeus","paint":"vaha","sand":"san","water":"ishke","salt_water":"shio_ishke","sugar_water":"sokkeri_ishke","seltzer":"bersoda_ishke","dirty_water":"bjurkishke","pool_water":"ojoiplas_ishke","dirt":"ter","mud":"pantano","wet_sand":"mokri san","rock":"ishi","rock_wall":"ishitumam","mudstone":"terishi","packed_sand":"gushena san","plant":"ruti","dead_plant":"shinujena ruti","frozen_plant":"cjepingena ruti","grass":"mun","algae":"marerutinen","concrete":"huomidado","wall":"tumam","fire":"hono","bomb":"bamba","steam":"ishkeluft"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -2,18 +2,25 @@ var elementslist = []
|
|||
for (elementi in elements){
|
||||
elementslist.push(elementi)
|
||||
}
|
||||
async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod
|
||||
return new Promise(resolve => {
|
||||
promptInput(message, (result) => {
|
||||
resolve(result);
|
||||
}, title, defaultValue);
|
||||
})
|
||||
}
|
||||
elements.change_count = {
|
||||
color: "#34eb86",
|
||||
canPlace: false,
|
||||
behavior: behaviors.SELFDELETE,
|
||||
onSelect: function() {
|
||||
var cans = prompt("Please input how many elements you would like to be generared each time.", 10000);
|
||||
onSelect: async function() {
|
||||
var cans = await _GNPrompt("Please input how many elements you would like to be generared each time.", "10kelements.js is asking you...", 10000);
|
||||
if (!cans) { return }
|
||||
if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); alert("skin"); return}
|
||||
if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); alert("sand"); return}
|
||||
if (cans > 100000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
|
||||
if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); promptText("skin"); return}
|
||||
if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); promptText("sand"); return}
|
||||
if (cans > 100000){promptText("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
|
||||
if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return}
|
||||
if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
|
||||
if (isNaN(parseInt(cans))){promptText("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
|
||||
settings.randomcount = parseInt(cans)
|
||||
settings.skineasteregg = false;
|
||||
settings.sandeasteregg = false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//Main version
|
||||
//Main version. Still in WIP
|
||||
//reminder for creator: human code is on index.html line 3242.
|
||||
|
||||
//Ini adalah aScientistsWish.js, mod dari Sandboxels yang diciptakan oleh Carbon Monoxide dengan bantuan startup oleh Salmonfishy, bertema sains dan semi fiktif dengan adanya zombie, mod ini masih dalam tahap pengembangan.
|
||||
elements.carbon_monoxide = {
|
||||
color: ["#b5b5b5", "#404040", "#2b2b2b",],
|
||||
behavior: behaviors.GAS,
|
||||
|
|
@ -232,7 +232,7 @@ reactions: {
|
|||
}
|
||||
};
|
||||
|
||||
elements.radiated_metal = {
|
||||
elements.radiated_metal = {
|
||||
behavior: [
|
||||
["XX","CR:radiation%25","XX"],
|
||||
["CR:radiation%25","XX","CR:radiation%25"],
|
||||
|
|
@ -929,6 +929,7 @@ elements.liquid_phosgene = {
|
|||
category: "states",
|
||||
density: 7.50,
|
||||
tempLow: -118,
|
||||
hidden: true,
|
||||
temp: -10,
|
||||
stateLow: "solid_phosgene",
|
||||
tempHigh: 8,
|
||||
|
|
@ -939,6 +940,7 @@ elements.solid_phosgene = {
|
|||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
category: "states",
|
||||
hidden: true,
|
||||
density: 12.45,
|
||||
temp: -150,
|
||||
tempHigh: -117,
|
||||
|
|
@ -962,3 +964,232 @@ elements.chlorophyll = {
|
|||
"acid": { elem1: ["magnesium"], }
|
||||
}
|
||||
}
|
||||
elements.lithium = { //Unsur lithium, buat versi baru, masih WIP.
|
||||
color: ["#928c96", "#9c9c9c",],
|
||||
state: "powder",
|
||||
category: "powders",
|
||||
behavior: behaviors.POWDER,
|
||||
density: 0.5,
|
||||
tempHigh: 180,
|
||||
stateHigh: "molten_lithium",
|
||||
conduct: 0.2,
|
||||
burn: 85,
|
||||
burnTime: 500,
|
||||
reactions: {
|
||||
"water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"salt_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"pool_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"dirty_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"sugar_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"steam": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] },
|
||||
"oxygen": { elem1: "lithium_oxide" },
|
||||
"chlorine": { elem1: "lithium_chloride" },
|
||||
"acid": { elem1: ["lithium_chloride","hydrogen"], chance: 0.2 },
|
||||
"carbon_dioxide": { elem1: "lithium_carbonate" },
|
||||
"carbon_monoxide": { elem1: "lithium_carbonate" },
|
||||
"nitrogen": { elem1: "lithium_nitride", chance: 0.1 }
|
||||
}
|
||||
}
|
||||
elements.molten_lithium = {
|
||||
color: ["#c0c0c0", "#d0d0d0", "#b0b0b0"],
|
||||
behavior: behaviors.LIQUID,
|
||||
temp: 250, // temperatur normal
|
||||
density: 0.5,
|
||||
conduct: 0.5,
|
||||
state: "liquid",
|
||||
category: "states",
|
||||
hidden: true,
|
||||
tempLow: 180,
|
||||
stateLow: "lithium",
|
||||
burn: 50,
|
||||
burnTime: 300,
|
||||
burnInto: "lithium_oxide",
|
||||
}
|
||||
|
||||
elements.lithium_hydroxide = {
|
||||
color: "#c8e4d8",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
tempHigh: 462, // titik leleh LiOH
|
||||
stateHigh: "molten_lithium_hydroxide",
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Molten Lithium Hydroxide
|
||||
elements.molten_lithium_hydroxide = {
|
||||
color: "#dff7f2",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
density: 1400,
|
||||
hidden: true,
|
||||
temp: 463,
|
||||
tempHigh: 924, // perkiraan titik didih
|
||||
stateHigh: "lithium_hydroxide_gas", // opsional
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Lithium Oxide (hasil reaksi lithium dengan oksigen)
|
||||
elements.lithium_oxide = {
|
||||
color: "#d0d0d0",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 2013,
|
||||
tempHigh: 1438,
|
||||
stateHigh: "molten_lithium_oxide",
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Molten Lithium Oxide
|
||||
elements.molten_lithium_oxide = {
|
||||
color: "#e8e8e8",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
density: 1800,
|
||||
hidden: true,
|
||||
temp: 1440,
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Lithium Carbonate (hasil reaksi lithium dengan karbon dioksida)
|
||||
elements.lithium_carbonate = {
|
||||
color: "#f0f0f0",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 2110,
|
||||
tempHigh: 723,
|
||||
stateHigh: "molten_lithium_carbonate",
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Molten Lithium Carbonate
|
||||
elements.molten_lithium_carbonate = {
|
||||
color: "#fafafa",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
density: 1900,
|
||||
hidden: true,
|
||||
temp: 725,
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Lithium Chloride (hasil reaksi lithium dengan klorin atau asam)
|
||||
elements.lithium_chloride = {
|
||||
color: "#e0e0f8",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 2068,
|
||||
tempHigh: 614,
|
||||
stateHigh: "molten_lithium_chloride",
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Molten Lithium Chloride
|
||||
elements.molten_lithium_chloride = {
|
||||
color: "#f0f0ff",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
hidden: true,
|
||||
density: 1900,
|
||||
temp: 615,
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Lithium Nitride (hasil reaksi lithium dengan nitrogen)
|
||||
elements.lithium_nitride = {
|
||||
color: "#b8b8b8",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 1270,
|
||||
tempHigh: 813,
|
||||
stateHigh: "molten_lithium_nitride",
|
||||
reactions: {},
|
||||
};
|
||||
|
||||
// Molten Lithium Nitride
|
||||
elements.molten_lithium_nitride = {
|
||||
color: "#c8c8c8",
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
hidden: true,
|
||||
density: 1100,
|
||||
temp: 815,
|
||||
reactions: {},
|
||||
};
|
||||
elements.phosphorus = {
|
||||
color: ["#ffffcc", "#ffff99", "#ffff66"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 1820,
|
||||
burn: 100,
|
||||
burnTime: 100,
|
||||
burnInto: "fire",
|
||||
reactions: {
|
||||
"oxygen": { elem1: "fire", chance: 0.5 },
|
||||
"water": { elem1: "explosion", },
|
||||
},
|
||||
tempHigh: 44,
|
||||
stateHigh: "molten_phosphorus",
|
||||
hidden: false,
|
||||
};
|
||||
elements.molten_phosphorus = {
|
||||
color: ["#ffcc00", "#ff9900"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
density: 1600,
|
||||
hidden: true,
|
||||
burning: true,
|
||||
burnTime: 2000,
|
||||
burnInto: "fire",
|
||||
reactions: {
|
||||
"oxygen": { elem1: "fire", chance: 1 },
|
||||
},
|
||||
temp: 100,
|
||||
tempLow: 43,
|
||||
stateLow: "phosphorus",
|
||||
viscosity: 20,
|
||||
};
|
||||
elements.phosphorus_bomb = {
|
||||
color: "#ffdd66",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
density: 1200,
|
||||
desc: "Don't let UN see this...",
|
||||
tick: function(pixel) {
|
||||
// Periksa apakah ada elemen lain di sekitarnya
|
||||
for (let dx = -1; dx <= 1; dx++) {
|
||||
for (let dy = -1; dy <= 1; dy++) {
|
||||
if (dx === 0 && dy === 0) continue;
|
||||
let x = pixel.x + dx;
|
||||
let y = pixel.y + dy;
|
||||
if (!isEmpty(x, y)) {
|
||||
// Meledak: ubah area sekitar jadi molten_phosphorus
|
||||
for (let ex = -3; ex <= 3; ex++) {
|
||||
for (let ey = -3; ey <= 3; ey++) {
|
||||
let nx = pixel.x + ex;
|
||||
let ny = pixel.y + ey;
|
||||
if (isEmpty(nx, ny) && Math.random() < 0.6) {
|
||||
createPixel("molten_phosphorus", nx, ny);
|
||||
}
|
||||
}
|
||||
}
|
||||
deletePixel(pixel.x, pixel.y); // Hancurkan bomb setelah meledak
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
Barista Mods by Salmonfishyy (eu)
|
||||
Add many ingredients for drinks
|
||||
|
||||
Changelog - Foundation Level (v0.1)
|
||||
- Matcha Elements
|
||||
Changelog - Foundation Level (v0.2)
|
||||
- Oolong tea
|
||||
- cinnamon tea
|
||||
*/
|
||||
|
||||
elements.tencha = {
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#25360c","#324a0c"],
|
||||
density: 500,
|
||||
breakInto: "matcha_powder",
|
||||
isFood: true,
|
||||
desc: "Tea leaves, can break into matcha, look pretty sussy.",
|
||||
reactions: {
|
||||
"water": { elem2:"tea", tempMin:80 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.matcha_powder = {
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#74A662","#74A12E"],
|
||||
density: 400,
|
||||
tempHigh: 80,
|
||||
stateHigh: "burn_matcha",
|
||||
isFood: true,
|
||||
desc: "Fine green powder from tea leaves. Vibrant color, earthy taste, and packed with antioxidants. Used in drinks, desserts, and rituals. Basically, classy leaf dust. Watch out for heat and oxygen!",
|
||||
reactions: {
|
||||
"oxygen": { elem2: "broke_matcha", chance: 0.5 },
|
||||
"dirty_water": { elem2: "null", chance: 0.5 },
|
||||
"pool_water": { elem2: "null", chance: 0.5 },
|
||||
"water": { elem2: "matcha_tea", chance: 0.5 },
|
||||
"seltzer": { elem2: "matcha_soda", chance: 0.5 },
|
||||
"salt_water": { elem2: "salty_matcha", chance: 0.5 },
|
||||
"sugar_water": { elem2: "sweet_matcha", chance: 0.5 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.broke_matcha = {
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#556B2F","#8B4513"],
|
||||
density: 400,
|
||||
desc: "Broke matcha—once a proud green powder, now a sad, terrible mess. Faded, bitter, and questioning its life choices. Now useless."
|
||||
};
|
||||
|
||||
elements.matcha_tea = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
color: ["#5F8A3D"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "Thick green drink, kinda earthy, kinda bitter. Looks like a magic potion, feels like a forest hug. Smooth, strong, and definitely plotting something...",
|
||||
reactions: {
|
||||
"milk": { elem2: "matcha_latte", chance: 0.5 },
|
||||
"cream": { elem2: "matcha_latte", chance: 0.5 },
|
||||
"salt": { elem2: "salty_matcha", chance: 0.5 },
|
||||
"sugar": { elem2: "sweet_matcha", chance: 0.5 },
|
||||
"carbon_dioxide": { elem2: "matcha_soda", chance: 0.5 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.matcha_latte = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
color: ["#DDEEAF"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "Green tea and milk mixed together. Smooth, slightly sweet, and a bit earthy. Looks fancy, tastes cozy.",
|
||||
reactions: {
|
||||
"milk": { elem2:null, chance: 0.5 },
|
||||
"cream": { elem2:null, chance: 0.5 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.salty_matcha = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
color: ["#A2B57D"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "Green tea but slightly salty. Confusing, kinda wrong, yet somehow still drinkable. Like matcha decided to rebel.",
|
||||
reactions: {
|
||||
"salt": { elem2:null, chance: 0.5 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.matcha_soda = {
|
||||
behavior: behaviors.LIQUID,
|
||||
behavior: [
|
||||
"XX|CR:foam%3|XX",
|
||||
"M2|XX|M2",
|
||||
"M2|M1|M2",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
if (Math.random() < 0.05 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
let foam = releaseElement(pixel, "foam");
|
||||
if (foam) foam.color = pixelColorPick(foam,"#7EBF5C");
|
||||
}
|
||||
},
|
||||
|
||||
onMix: function(pixel) {
|
||||
releaseElement(pixel, "foam", shiftDown)
|
||||
},
|
||||
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
color: ["#7EBF5C"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "Carbonated green tea. Slightly bitter, extra fizzy. Tastes fresh, feels weird...",
|
||||
reactions: {
|
||||
"carbon_dioxide": { elem2:null, chance: 0.5 }
|
||||
}
|
||||
};
|
||||
|
||||
elements.oolong_leaves = {
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#CDB361","#8F6B3A"],
|
||||
density: 200,
|
||||
isFood: true,
|
||||
tempHigh: 120,
|
||||
stateHigh: "roasted_oolong",
|
||||
desc: "Dark, twisty tea leaves that look kinda serious. Smell fancy, taste like tea that went through a phase. Smooth, strong, and slightly dramatic.",
|
||||
reactions: {
|
||||
"water": { elem2:"oolong_tea", tempMin:80 },
|
||||
}
|
||||
};
|
||||
|
||||
elements.roasted_oolong = {
|
||||
behavior: behaviors.POWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#8F6B3A","#654321"],
|
||||
density: 220,
|
||||
isFood: true,
|
||||
desc: "Roasted oolong—deeper flavor, slightly smoky, and probably wiser now.",
|
||||
reactions: {
|
||||
"water": { elem2:"oolong_tea", tempMin:80 },
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.cinnamon = {
|
||||
behavior: behaviors.SUPPORTPOWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#6a462f","#4a3120"],
|
||||
density: 500,
|
||||
breakInto: "cinnamon_powder",
|
||||
isFood: true,
|
||||
desc: "Cinnamon, a thingy things with spicy flavour.",
|
||||
reactions: {
|
||||
"water": { elem2:"cinnamon_tea", tempMin:80, color2:"#6c3213" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.cinnamon_powder = {
|
||||
behavior: behaviors.SUPPORTPOWDER,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#986544"],
|
||||
density: 589,
|
||||
isFood: true,
|
||||
desc: "Cinnamon powder, from cinnamon, a thingy things powder with spicy flavour.",
|
||||
reactions: {
|
||||
"water": { elem2:"cinnamon_tea", chance: 0.5, color2:"#6c3213" },
|
||||
}
|
||||
};
|
||||
|
||||
elements.cinnamon_tea = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#723900"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "Cozy tea with spicy taste.",
|
||||
reactions: {
|
||||
"cinnamon_powder": { elem2:"null", chance: 0.5 },
|
||||
}
|
||||
};
|
||||
|
||||
elements.oolong_tea = {
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "food",
|
||||
state: "solid",
|
||||
color: ["#ADA07B"],
|
||||
density: 1000,
|
||||
isFood: true,
|
||||
desc: "it's just tea, make from oolong.",
|
||||
reactions: {
|
||||
"sugar": { elem2:"null", chance: 0.5 },
|
||||
}
|
||||
};
|
||||
|
|
@ -15,6 +15,7 @@ class Setting {
|
|||
this.defaultValue = defaultValue ?? type[1];
|
||||
this.description = description;
|
||||
this.validate = customValidator;
|
||||
this.listeners = [];
|
||||
}
|
||||
|
||||
set(value) {
|
||||
|
|
@ -23,6 +24,9 @@ class Setting {
|
|||
const settings = JSON.parse(localStorage.getItem(`${this.tabName}/settings`)) ?? {};
|
||||
settings[this.name] = value;
|
||||
localStorage.setItem(`${this.tabName}/settings`, JSON.stringify(settings));
|
||||
for (const listener of this.listeners) {
|
||||
listener(value);
|
||||
}
|
||||
}
|
||||
|
||||
update() {
|
||||
|
|
@ -42,6 +46,10 @@ class Setting {
|
|||
this.disabled = true;
|
||||
}
|
||||
|
||||
onUpdate(callback) {
|
||||
this.listeners.push(callback);
|
||||
}
|
||||
|
||||
#parseColor(colorString) {
|
||||
if (colorString instanceof Array) return parseColor(colorString[0]);
|
||||
if (typeof colorString != "string") return "#ffffff";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
const oldExplode = explodeAt;
|
||||
let explosionCooldown = 0
|
||||
playExplosionSound = function(){
|
||||
var audio = new Audio("https://JustAGenericUsername.github.io/explosion.mp3");
|
||||
audio.play();
|
||||
}
|
||||
explodeAt = function(x,y,radius,fire="fire"){
|
||||
oldExplode(x,y,radius,fire);
|
||||
if(explosionCooldown <= 0){
|
||||
playExplosionSound();
|
||||
explosionCooldown = 7
|
||||
//console.log("success")
|
||||
} //else {
|
||||
//console.log("yeah no")
|
||||
//}
|
||||
}
|
||||
runEveryTick(function(){
|
||||
explosionCooldown -= 1;
|
||||
})
|
||||
|
|
@ -1,4 +1,21 @@
|
|||
//jaydsfunctions
|
||||
async function _jaydfunctionjsprompt(message, defaultValue = "") {
|
||||
|
||||
|
||||
return new Promise(resolve => {
|
||||
|
||||
|
||||
promptInput(message, (result) => {
|
||||
|
||||
|
||||
resolve(result);
|
||||
|
||||
|
||||
}, "jaydfunction.js is asking you...", defaultValue);
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
erase1Var = 0;
|
||||
elements.selective_eraser = {
|
||||
color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"],
|
||||
|
|
@ -8,8 +25,8 @@ elements.selective_eraser = {
|
|||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what element should be erased.",(erase1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
erase1Var = answer1;
|
||||
}
|
||||
|
|
@ -23,8 +40,8 @@ elements.selective_exploder = {
|
|||
changePixel(pixel, "explosion")
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element to explode.",(explode1Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what element to explode.",(explode1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
explode1Var = answer1;
|
||||
}
|
||||
|
|
@ -40,11 +57,11 @@ elements.converter_tool = {
|
|||
changePixel(pixel, convert22Var)
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what should element be converted.",(convert11Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what should element be converted.",(convert11Var||undefined));
|
||||
if (!answer1) { return }
|
||||
convert11Var = answer1;
|
||||
var answer2 = prompt("Please input what element to convert into.",(convert22Var||undefined));
|
||||
var answer2 = await _jaydfunctionjsprompt("Please input what element to convert into.",(convert22Var||undefined));
|
||||
if (!answer2) { return }
|
||||
convert22Var = answer2;
|
||||
}
|
||||
|
|
@ -81,8 +98,8 @@ elements.exclusive_eraser = {
|
|||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
exclude1Var = answer1;
|
||||
}
|
||||
|
|
@ -128,8 +145,8 @@ elements.selective_paint_tool = {
|
|||
delete pixel.origColor;
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element should be painted.",(paint1Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
paint1Var = answer1;
|
||||
},
|
||||
|
|
@ -157,8 +174,8 @@ elements.exclusive_paint_tool = {
|
|||
delete pixel.origColor;
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element should be painted.",(paint2Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint2Var||undefined));
|
||||
if (!answer1) { return }
|
||||
paint2Var = answer1;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,23 @@
|
|||
//jaydstuff
|
||||
//ooooo dependencies
|
||||
if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); alert("'nousersthings.js' is (not) a dependency for 'jaydstuff.js.js' and has been added. Please reload for it to take effect, also im dumb.") }
|
||||
else {
|
||||
if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); window.location.reload(); };
|
||||
async function _jaydstuffjsprompt(message, defaultValue = "") {
|
||||
|
||||
|
||||
return new Promise(resolve => {
|
||||
|
||||
|
||||
promptInput(message, (result) => {
|
||||
|
||||
|
||||
resolve(result);
|
||||
|
||||
|
||||
}, "jaydstuff.js is asking you...", defaultValue);
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
elements.super_raincloud = {
|
||||
color: "#0000ff",
|
||||
behavior: [
|
||||
|
|
@ -132,7 +148,7 @@ elements.heavy_steam = {
|
|||
"iron": { elem1:"oxygen", elem2:"rust", chance:0.005 },
|
||||
"steel": { elem1:"oxygen", elem2:"rust", chance:0.004 },
|
||||
},
|
||||
temp: 150,
|
||||
temp: 150,
|
||||
tempLow: 95,
|
||||
extraTempLow: {
|
||||
0: "heavy_rime"
|
||||
|
|
@ -633,19 +649,124 @@ elements.upquake = {
|
|||
cooldown: defaultCooldown,
|
||||
excludeRandom: true,
|
||||
},
|
||||
elements.legacy_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 === "legacy_earthquake") {
|
||||
if (pixel !== p) {
|
||||
pixel.mag += 3;
|
||||
deletePixel(p.x,p.y);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (elements[p.element].breakInto) {
|
||||
if (Math.random() < (elements[p.element].hardness || 1) * 0.25) {
|
||||
breakPixel(p);
|
||||
}
|
||||
}
|
||||
if (p.del || !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,
|
||||
},
|
||||
// textures.rue = [
|
||||
// [8,8,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
// [8,9,8,0,0,0,0,0,0,0,0,0,14,7,8,7,14,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
// [9,10,9,8,0,9,10,9,9,9,8,14,7,8,9,8,14,14,14,14,14,14,14,0,0,0,0,0,0,0,0,0],
|
||||
// [8,9,10,9,8,10,10,9,9,9,9,7,8,9,8,7,14,14,14,14,14,14,14,14,14,0,0,0,0,0,0,0],
|
||||
// [8,8,9,10,8,9,9,9,9,9,9,7,9,8,7,7,13,13,13,13,13,13,13,14,14,13,0,0,0,0,0,0],
|
||||
// [8,8,9,10,8,8,9,9,9,9,7,7,9,8,7,7,13,13,13,13,13,13,13,13,13,14,13,0,0,0,0,0],
|
||||
// [8,9,10,9,8,8,8,8,8,8,7,7,8,9,8,7,13,13,13,13,13,13,13,13,13,13,14,12,0,0,0,0],
|
||||
// [9,10,9,8,14,8,8,8,8,7,7,13,7,8,9,8,13,13,13,13,13,13,13,13,13,13,13,12,11,0,0,0],
|
||||
// [8,9,8,14,14,14,14,13,13,13,13,13,1,7,8,7,13,13,13,13,13,13,1,1,13,13,13,13,12,17,0,0],
|
||||
// [8,8,14,14,14,14,13,13,13,13,13,1,1,1,7,7,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0,0],
|
||||
// [0,14,14,14,14,13,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0],
|
||||
// [0,14,14,14,14,13,13,13,1,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,1,13,12,17,0],
|
||||
// [0,14,14,14,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,13,12,17,0],
|
||||
// [14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17],
|
||||
// [14,14,14,14,13,13,13,13,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,13,13,13,12,17],
|
||||
// [14,14,14,14,13,13,13,13,1,1,1,1,16,16,2,13,13,13,13,13,13,1,1,1,1,16,16,2,13,13,12,17],
|
||||
// [14,14,14,13,13,13,1,16,14,14,14,1,1,1,16,16,1,13,13,1,16,14,14,14,1,1,1,16,16,1,12,17],
|
||||
// [14,14,14,13,13,13,1,14,14,14,13,1,1,1,16,16,1,13,13,1,14,14,14,13,1,1,1,16,16,1,12,17],
|
||||
// [14,14,14,14,13,13,1,1,14,13,1,1,1,1,16,16,1,13,13,1,1,14,13,1,1,1,1,16,16,1,12,17],
|
||||
// [14,14,14,14,13,13,1,1,1,1,1,16,14,1,16,16,1,13,13,1,1,1,1,1,16,14,1,16,16,1,12,17],
|
||||
// [0,14,14,14,13,13,1,1,1,1,1,14,12,2,16,16,1,13,13,1,1,1,1,1,14,12,2,16,16,1,17,0],
|
||||
// [0,14,14,14,13,13,1,1,1,1,1,1,1,16,16,16,1,13,13,1,1,1,1,1,1,1,16,16,16,1,17,0],
|
||||
// [0,14,14,14,14,13,13,1,1,1,1,2,16,16,16,16,1,13,13,1,1,1,1,1,2,16,16,16,16,1,17,0],
|
||||
// [0,0,14,14,14,14,13,1,16,16,16,16,16,16,16,1,13,13,13,13,1,16,16,16,16,16,16,16,1,17,0,0],
|
||||
// [0,0,14,14,14,14,13,13,1,16,16,16,16,16,1,13,13,13,13,13,13,1,16,16,16,16,16,1,12,17,0,0],
|
||||
// [0,0,0,13,14,14,14,14,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,12,17,0,0,0],
|
||||
// [0,0,0,0,13,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17,0,0,0,0],
|
||||
// [0,0,0,0,0,12,12,13,13,14,14,14,13,13,13,13,13,13,1,13,13,13,13,13,13,12,17,0,0,0,0,0],
|
||||
// [0,0,0,0,0,0,12,12,12,13,13,13,14,14,14,13,13,1,13,1,13,13,13,12,12,17,0,0,0,0,0,0],
|
||||
// [0,0,0,0,0,0,0,11,11,12,12,12,13,13,13,13,13,13,13,13,12,12,12,17,17,0,0,0,0,0,0,0],
|
||||
// [0,0,0,0,0,0,0,0,0,17,17,17,12,12,12,12,12,12,12,12,17,17,17,0,0,0,0,0,0,0,0,0],
|
||||
// [0,0,0,0,0,0,0,0,0,0,0,0,17,17,17,17,17,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
|
||||
// ]
|
||||
// elements.rue = {
|
||||
// color: ["#000000","#111111","#333333","#555555","#777777","#999999","#bbbbbb","#dddddd","#ffffff"],
|
||||
// colorPattern: textures.rue,
|
||||
// colorKey: {
|
||||
// "0": "#000000",
|
||||
// "1": "#000000",
|
||||
// "2": "#111111",
|
||||
// "3": "#333333",
|
||||
// "4": "#444444",
|
||||
// "5": "#555555",
|
||||
// "6": "#666666",
|
||||
// "7": "#19bb20",
|
||||
// "8": "#19bebe",
|
||||
// "9": "#32d458",
|
||||
// "10": "#32d5c6",
|
||||
// "11": "#ddc231",
|
||||
// "12": "#ebcc28",
|
||||
// "13": "#ffe458",
|
||||
// "14": "#ffed91",
|
||||
// "15": "#f0f0f0",
|
||||
// "16": "#ffffff",
|
||||
// "17": "#cdb322",
|
||||
// },
|
||||
// },
|
||||
|
||||
createAtXvar = 0;
|
||||
createAtYvar = 0;
|
||||
create1var = "";
|
||||
elements.element_spawner = {
|
||||
color: "#71797E",
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input the x value.",(createAtXvar||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _jaydstuffjsprompt("Please input the x value.",(createAtXvar||undefined));
|
||||
if (!answer1) {return}
|
||||
createAtXvar = parseInt(answer1);
|
||||
var answer2 = prompt("Please input the y value.",(createAtYvar||undefined));
|
||||
var answer2 = await _jaydstuffjsprompt("Please input the y value.",(createAtYvar||undefined));
|
||||
if (!answer2) {return}
|
||||
createAtYvar = parseInt(answer2);
|
||||
var answer3 = prompt("Please input what element should spawn.",(create1var||undefined));
|
||||
var answer3 = await _jaydstuffjsprompt("Please input what element should spawn.",(create1var||undefined));
|
||||
if (!answer3) {return}
|
||||
create1var = answer3;
|
||||
},
|
||||
|
|
@ -659,7 +780,4 @@ elements.element_spawner = {
|
|||
conduct: 1,
|
||||
state: "solid",
|
||||
category: "machines"
|
||||
//hello nouser if you are reading this:
|
||||
};
|
||||
};
|
||||
//get triggered
|
||||
63
mods/mars.js
63
mods/mars.js
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
elements.mars_gunk = {
|
||||
color: "#121212",
|
||||
behavior: behaviors.DGAS,
|
||||
|
|
@ -29,8 +28,8 @@ elements.mars_basalt = {
|
|||
state: "solid",
|
||||
density: 5000,
|
||||
extraInfo: "Woah",
|
||||
tempHigh: "molten_mars",
|
||||
stateHigh: "600",
|
||||
tempHigh: "700",
|
||||
stateHigh: "molten_mars",
|
||||
hardness: 0.7,
|
||||
breakInto: ["mars_dust", "mars_rock", "mars_rock", "mars_rock", "molten_mars", "mars_debris", "mars_debris", "gunk", "mars_rock_wall"]
|
||||
}
|
||||
|
|
@ -113,7 +112,11 @@ elements.mars_ironheart_ore = {
|
|||
}
|
||||
elements.mars_ironheart = {
|
||||
color: ["#e8e8e8", "#bd1102"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
behavior: [
|
||||
"XX|CR:radiation%3|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
category: "mars",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
|
|
@ -155,10 +158,10 @@ elements.nosmoker = {
|
|||
breakInto: ["ironheart", "mars_ironheart", "ironheart_ore", "antigunk"]
|
||||
}
|
||||
elements.ironheart = {
|
||||
color: "#e9825a",
|
||||
color: "#FF6B5A",
|
||||
behavior: [
|
||||
"XX|XX|XX|",
|
||||
"XX|XX|XX|",
|
||||
"XX|CR:radiation%2|XX|",
|
||||
"XX|CH:feynmanium%0.1|XX|",
|
||||
"M2|M1|M2|",
|
||||
],
|
||||
category: "mars",
|
||||
|
|
@ -166,6 +169,40 @@ elements.ironheart = {
|
|||
state: "solid",
|
||||
stateHigh: "molten_mars",
|
||||
extraInfo: "Very Sturdy.",
|
||||
stateLow: "depleted_ironheart",
|
||||
tempLow: -50,
|
||||
tempHigh: 1500,
|
||||
reactions: {
|
||||
"electric": { elem1: "smint", elem2: "null" },
|
||||
},
|
||||
}
|
||||
elements.depleted_ironheart = {
|
||||
color: "#e9825a",
|
||||
behavior: [
|
||||
"XX|XX|XX|",
|
||||
"XX|XX|XX|",
|
||||
"M2|M1|M2|",
|
||||
],
|
||||
category: "mars",
|
||||
density: 1200,
|
||||
state: "solid",
|
||||
stateHigh: "molten_mars",
|
||||
reactions: {
|
||||
"electric": { elem1: "smint", elem2: "null" },
|
||||
},
|
||||
}
|
||||
elements.feynmanium = {
|
||||
color: "#8C7656",
|
||||
behavior: [
|
||||
"XX|XX|XX|",
|
||||
"XX|XX|XX|",
|
||||
"M2|M1|M2|",
|
||||
],
|
||||
category: "mars",
|
||||
density: 1200,
|
||||
state: "solid",
|
||||
stateHigh: "molten_mars",
|
||||
tempHigh: 6000,
|
||||
reactions: {
|
||||
"electric": { elem1: "smint", elem2: "null" },
|
||||
},
|
||||
|
|
@ -190,7 +227,7 @@ elements.red_gold_powder = {
|
|||
}
|
||||
elements.red_gold = {
|
||||
color: ["#D20103", "#E4080A", "#EFC3CA"],
|
||||
behavior: behaviors.POWDER,
|
||||
behavior: behaviors.WALL,
|
||||
category: "mars",
|
||||
state: "solid",
|
||||
density: 1350,
|
||||
|
|
@ -240,7 +277,7 @@ elements.mars_coal = {
|
|||
stateHigh: "molten_mars",
|
||||
temp: 10,
|
||||
reactions: {
|
||||
"electric": { elem2: "useless", chance: 0.01 },
|
||||
"electric": { elem2: "smint", chance: 0.01 },
|
||||
}
|
||||
}
|
||||
elements.mars_ice = {
|
||||
|
|
@ -354,7 +391,8 @@ elements.ironheart_core = {
|
|||
conduct: 1,
|
||||
extraInfo: "wha"
|
||||
}
|
||||
// 2.9.17.1
|
||||
|
||||
// 2.10.20
|
||||
// most elements done :D
|
||||
// iron heart ore
|
||||
// iron heart
|
||||
|
|
@ -385,7 +423,10 @@ elements.ironheart_core = {
|
|||
// added cores that emit electricity
|
||||
// its like plants
|
||||
// dumbed down ironheart a bit, im thinking about its behaviour
|
||||
|
||||
// Ironheart is Radioactive
|
||||
// Red Gold is Solid
|
||||
// Feynmanium
|
||||
// make things have recaitons
|
||||
|
||||
// Creditssss
|
||||
// Ghanisma - idea for 2.9.16
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ elements.soul_sand = {
|
|||
category: "minecraft",
|
||||
state: "solid",
|
||||
tempHigh: 2575,
|
||||
stateHigh: "soul_glass",
|
||||
stateHigh: "molten_soul_glass",
|
||||
density: 1375,
|
||||
reactions: {
|
||||
"water": { "elem1":"wet_soul_sand", "elem2":null },
|
||||
|
|
@ -114,6 +114,19 @@ elements.wet_soul_sand = {
|
|||
stateHigh: "soul_sand",
|
||||
density: 1660,
|
||||
};
|
||||
elements.molten_soul_glass = {
|
||||
color: ["#36d7ec", "#2fbacd", "#289faf", "#218491", "#1a6a75"],
|
||||
fireColor: "#36d7ec",
|
||||
viscosity: 1000,
|
||||
behavior: behaviors.MOLTEN,
|
||||
category: "minecraft",
|
||||
density: 1625,
|
||||
hidden: true,
|
||||
tempLow: 2540,
|
||||
stateLow: "soul_glass",
|
||||
state: "liquid",
|
||||
temp: 2700,
|
||||
}
|
||||
/* unfinished but near:
|
||||
Soul Adobe,
|
||||
Molten Soul Glass,
|
||||
|
|
@ -135,6 +148,13 @@ function playShriek() {
|
|||
var audio = new Audio("https://JustAGenericUsername.github.io/shriek" + Math.floor((Math.random()*4) +1) + ".ogg");
|
||||
audio.play();
|
||||
}
|
||||
async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod
|
||||
return new Promise(resolve => {
|
||||
promptInput(message, (result) => {
|
||||
resolve(result);
|
||||
}, title, defaultValue);
|
||||
})
|
||||
}
|
||||
function turnIntoSpecific(pixel){
|
||||
newPixel = pixel.storedPixel
|
||||
newPixel.x = pixel.x;
|
||||
|
|
@ -597,8 +617,8 @@ elements.sculk_wifi_transmitter = {
|
|||
hoverStat: function(pixel){
|
||||
return pixel.channel || "unset"
|
||||
},
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0)
|
||||
onSelect: async function(){
|
||||
let ans1 = await _GNPrompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...",channelVar||0)
|
||||
channelVar = ans1
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -636,8 +656,8 @@ elements.sculk_wifi_receiver = {
|
|||
hoverStat: function(pixel){
|
||||
return pixel.channel || "unset"
|
||||
},
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0)
|
||||
onSelect: async function(){
|
||||
let ans1 = await _GNPrompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...", channelVar||0)
|
||||
channelVar = ans1
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -772,26 +792,18 @@ elements.obsidian = { //subject to change
|
|||
density: 2400,
|
||||
renderer: function(pixel, ctx){
|
||||
autoFillColorRectangle(ctx, pixel, "#06030B", 1, 1, 0, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#000001", 0.5, 1/6, 0, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 1/6, 5/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 5/6, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 0, 5/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/5, 1/6, 0.5)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/3, 1/3, 1/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 2/3, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 0.5, 2/3, 0.5)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 2/3, 0.5)
|
||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 0.5, 5/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/6, 1/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0.5, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 5/6, 1/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 5/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 0, 1/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/6, 1/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/3, 1/6, 1/3, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 2/3, 1/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 5/6, 1/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 5/6, 5/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/3, 1/3, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 0, 1/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/3, 1/2, 0)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/2, 1/6, 1/3, 1/6)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/6, 2/3, 2/3)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 1/2)
|
||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/3, 0, 1/2)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/5, 1/6, 5/6, 1/2)
|
||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/2, 0)
|
||||
}
|
||||
}
|
||||
elements.molten_obsidian = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
behaviors.SOLIDIFY = function(pixel) {
|
||||
pixel.solid = true
|
||||
}
|
||||
|
|
@ -1548,12 +1549,107 @@ grabAllWeights = function(pixel){
|
|||
return results
|
||||
}
|
||||
|
||||
/*elements.Cherries_Ceri_Moji = {
|
||||
color: "#fcd1d7",
|
||||
category: Student,
|
||||
state: High_School,
|
||||
behavior: [Shy, Introverted, Easily_Excited, Kind],
|
||||
pronouns: [She,Her,Herself],
|
||||
sexuality: [Panromantic, Asexual],
|
||||
desc: "Ceri is a 16 year old high school student who loves cats"
|
||||
}*/
|
||||
var modName = "mods/nekonicos_stuff.js";
|
||||
var cookieMod = "mods/cookie_clicker.js";
|
||||
|
||||
if (!enabledMods.includes(cookieMod)) {
|
||||
|
||||
elements.cookie_dough = {
|
||||
color: ["#bfac91","#CDBFAB",],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
reactions: {
|
||||
"chocolate": { elem1:"chocolate_chip_cookie_dough", elem2:null, chance: 0.5 },
|
||||
"chocolate_powder": { elem1:"chocolate_chip_cookie_dough", elem2:null, chance: 0.5 },
|
||||
},
|
||||
category: "food",
|
||||
tempHigh: 74,
|
||||
stateHigh: "plain_cookie",
|
||||
burn:40,
|
||||
burnTime:25,
|
||||
burnInto:"ash",
|
||||
state: "solid",
|
||||
density: 526.9,
|
||||
isFood: true
|
||||
}
|
||||
|
||||
elements.chocolate_chip_cookie_dough = {
|
||||
color: ["#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#4d2818","#3b1b0d","#33160a"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
category: "food",
|
||||
tempHigh: 74,
|
||||
stateHigh: "cookie",
|
||||
burn:40,
|
||||
burnTime:25,
|
||||
burnInto:"ash",
|
||||
state: "solid",
|
||||
density: 526.9,
|
||||
isFood: true
|
||||
}
|
||||
|
||||
clicked = false
|
||||
cookies = 0
|
||||
oldcookies = 0
|
||||
createdcookies = 0
|
||||
|
||||
elements.plain_cookie = {
|
||||
color: ["#C4966C","#C0946B"],
|
||||
behavior: behaviors.POWDER,
|
||||
reactions: {
|
||||
"chocolate": { elem1:"cookie", elem2:null, chance: 0.25 },
|
||||
"chocolate_powder": { elem1:"cookie", elem2:null, chance: 0.25 },
|
||||
},
|
||||
tempHigh: 192,
|
||||
stateHigh: "toast",
|
||||
category: "food",
|
||||
burn: 10,
|
||||
burnTime: 200,
|
||||
burnInto: "toast",
|
||||
breakInto: "crumb",
|
||||
breakIntoColor: ["#c8946a","#c08655","#ba7a45","#a86d3e"],
|
||||
state: "solid",
|
||||
density: 233.96,
|
||||
isFood: true
|
||||
}
|
||||
|
||||
elements.cookie = {
|
||||
color: ["#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#4d2818","#3b1b0d","#33160a"],
|
||||
behavior: behaviors.POWDER,
|
||||
tick: function(pixel) {
|
||||
var top = mousePos.y - Math.floor(mouseSize/2);
|
||||
var bottom = mousePos.y + Math.floor(mouseSize/2);
|
||||
var left = mousePos.x - Math.floor(mouseSize/2);
|
||||
var right = mousePos.x + Math.floor(mouseSize/2);
|
||||
if ((pixel.x >= left && pixel.x <= right && pixel.y >= top && pixel.y <= bottom) && mouseIsDown === true && clicked === false) {
|
||||
clicked = true
|
||||
cookies += 1
|
||||
}
|
||||
else if ((pixel.x >= left && pixel.x <= right && pixel.y >= top && pixel.y <= bottom) && mouseIsDown !== true && clicked === true) {
|
||||
clicked = false
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
tempHigh: 95,
|
||||
stateHigh: ["melted_chocolate","plain_cookie","plain_cookie"],
|
||||
category: "food",
|
||||
burn: 10,
|
||||
burnTime: 200,
|
||||
burnInto: ["melted_chocolate","plain_cookie","plain_cookie"],
|
||||
breakInto: ["crumb","crumb","crumb","crumb","crumb","chocolate","chocolate_powder"],
|
||||
breakIntoColor: ["#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#4d2818","#3b1b0d","#33160a"],
|
||||
state: "solid",
|
||||
density: 233.96,
|
||||
isFood: true,
|
||||
renderer: function(pixel,ctx) {
|
||||
if (!viewInfo[view].effects) { return }
|
||||
if (isEmpty(pixel.x,pixel.y+1) || !outOfBounds(pixel.x,pixel.y+1) || pixelMap[pixel.x][pixel.y+1].element === "pipe") {
|
||||
drawPlus(ctx,"#C4966C",pixel.x,pixel.y,undefined,2)
|
||||
}
|
||||
drawDefault(ctx,pixel)
|
||||
}
|
||||
}
|
||||
|
||||
elements.dough.reactions.sugar = { elem1:"cookie_dough", elem2: null, chance:0.5}
|
||||
elements.dough.reactions.chocolate = { elem1:"chocolate_chip_cookie_dough", elem2: null, chance:0.5}
|
||||
elements.dough.reactions.chocolate_powder = { elem1:"chocolate_chip_cookie_dough", elem2: null, chance:0.5}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
// Gallium is the best element
|
||||
async function _nousersthingsprompt(message, defaultValue = "") { // thanks to ggod for updated prompt function
|
||||
return new Promise(resolve => {
|
||||
promptInput(message, (result) => {
|
||||
resolve(result);
|
||||
}, "nousersthings.js is asking you...", defaultValue);
|
||||
})
|
||||
}
|
||||
behaviors.RADSOLID = [
|
||||
"XX|CR:radiation%1|XX",
|
||||
"CR:radiation%1|XX|CR:radiation%1",
|
||||
|
|
@ -854,11 +861,9 @@ elements.destroyable_e_pipe = {
|
|||
currentChannel = 0;
|
||||
elements.channel_pipe = {
|
||||
color: "#414c4f",
|
||||
onSelect: function() {
|
||||
var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined));
|
||||
if (!answer3) { return }
|
||||
currentChannel = answer3;
|
||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
||||
onSelect: async function() {
|
||||
currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined))
|
||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Channel pipes only give pixels to channel pipes with the same channel.");
|
||||
},
|
||||
tick: function(pixel) {
|
||||
if (pixel.start===pixelTicks){
|
||||
|
|
@ -977,11 +982,9 @@ elements.channel_pipe = {
|
|||
},
|
||||
elements.destroyable_channel_pipe = {
|
||||
color: "#414c4f",
|
||||
onSelect: function() {
|
||||
var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined));
|
||||
if (!answer3) { return }
|
||||
currentChannel = answer3;
|
||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
||||
onSelect: async function() {
|
||||
currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined))
|
||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
||||
},
|
||||
tick: function(pixel) {
|
||||
if (pixel.start === pixelTicks){
|
||||
|
|
@ -1328,8 +1331,8 @@ elements.bridge_pipe = {
|
|||
filterTypeVar = 0;
|
||||
elements.filter = {
|
||||
color: "#599fc2",
|
||||
onSelect: function() {
|
||||
var answer4 = prompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined));
|
||||
onSelect: async function() {
|
||||
var answer4 = await _nousersthingsprompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined));
|
||||
if (!answer4) { return }
|
||||
filterTypeVar = answer4;
|
||||
},
|
||||
|
|
@ -1559,11 +1562,11 @@ elements.converter = {
|
|||
}
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer5 = prompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined));
|
||||
onSelect: async function() {
|
||||
var answer5 = await _nousersthingsprompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined));
|
||||
if (!answer5) { return }
|
||||
converter1Var = answer5;
|
||||
var answer6 = prompt("Please input what it should turn into.",(converter2Var||undefined));
|
||||
var answer6 = await _nousersthingsprompt("Please input what it should turn into.",(converter2Var||undefined));
|
||||
if (!answer6) { return }
|
||||
converter2Var = answer6;
|
||||
},
|
||||
|
|
@ -2302,8 +2305,8 @@ elements.element_filler = {
|
|||
excludeRandom: true,
|
||||
state: "solid",
|
||||
movable: "false",
|
||||
onSelect: function() {
|
||||
var answer6 = prompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined));
|
||||
onSelect: async function() {
|
||||
var answer6 = await _nousersthingsprompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined));
|
||||
if (!answer6) { return }
|
||||
elemfillerVar = mostSimilarElement(answer6);
|
||||
},
|
||||
|
|
@ -2335,8 +2338,8 @@ elements.inner_outliner = {
|
|||
color: elements.filler.color,
|
||||
category: elements.filler.category,
|
||||
excludeRandom: true,
|
||||
onSelect: function() {
|
||||
var answerot = prompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined));
|
||||
onSelect: async function() {
|
||||
var answerot = await _nousersthingsprompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined));
|
||||
if (!answerot) { return }
|
||||
outlinerVar = mostSimilarElement(answerot);
|
||||
},
|
||||
|
|
@ -2566,8 +2569,8 @@ elements.selective_void = {
|
|||
excludeRandom: true,
|
||||
state: "solid",
|
||||
movable: "false",
|
||||
onSelect: function() {
|
||||
var selvoidans = prompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined));
|
||||
onSelect: async function() {
|
||||
var selvoidans = await _nousersthingsprompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined));
|
||||
if (!selvoidans) { return }
|
||||
selvoid = mostSimilarElement(selvoidans);
|
||||
},
|
||||
|
|
@ -2594,8 +2597,8 @@ elements.scuffed_circle_brush = {
|
|||
excludeRandom: true,
|
||||
state: "solid",
|
||||
movable: false,
|
||||
onSelect: function(){
|
||||
var answerE = prompt("Element of the brush.",(circleElem||undefined));
|
||||
onSelect: async function(){
|
||||
var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined));
|
||||
if (!answerE) { return }
|
||||
circleElem = mostSimilarElement(answerE);
|
||||
},
|
||||
|
|
@ -2616,8 +2619,8 @@ elements.scuffed_triangle_brush = {
|
|||
excludeRandom: true,
|
||||
state: "solid",
|
||||
movable: false,
|
||||
onSelect: function(){
|
||||
var answerE = prompt("Element of the brush.",(circleElem||undefined));
|
||||
onSelect: async function(){
|
||||
var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined));
|
||||
if (!answerE) { return }
|
||||
circleElem = mostSimilarElement(answerE);
|
||||
},
|
||||
|
|
@ -2666,8 +2669,8 @@ elements.grid_brush = {
|
|||
behavior: behaviors.WALL,
|
||||
category: "special",
|
||||
movable: false,
|
||||
onSelect: function() {
|
||||
var gridans = prompt("Please input the desired element of this grid brush",(gridElem||undefined));
|
||||
onSelect: async function() {
|
||||
var gridans = await _nousersthingsprompt("Please input the desired element of this grid brush",(gridElem||undefined));
|
||||
if (!gridans) { return }
|
||||
gridElem = mostSimilarElement(gridans);
|
||||
},
|
||||
|
|
@ -2733,11 +2736,11 @@ elements.ray_emitter = {
|
|||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(pixel){
|
||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
onSelect: async function(pixel){
|
||||
var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
if (!rayans) { return }
|
||||
rayElement = mostSimilarElement(rayans);
|
||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
||||
},
|
||||
hoverStat: function(pixel){
|
||||
|
|
@ -2849,37 +2852,37 @@ elements.specific_ray_emitter = {
|
|||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(pixel){
|
||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
onSelect: async function(pixel){
|
||||
var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
if (!rayans) { return }
|
||||
rayElement = mostSimilarElement(rayans);
|
||||
if (rayElement != "ray"){rainbowMode = false}
|
||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
||||
var rayans3 = prompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0));
|
||||
var rayans3 = await _nousersthingsprompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0));
|
||||
if (!rayans3) { return }
|
||||
specificRayStart = rayans3
|
||||
var rayans4 = prompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0));
|
||||
var rayans4 = await _nousersthingsprompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0));
|
||||
if (!rayans4) { return }
|
||||
specificRayEnd = rayans4
|
||||
var rayans5 = prompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0));
|
||||
var rayans5 = await _nousersthingsprompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0));
|
||||
if (!rayans5) { return }
|
||||
specificRayAngle = rayans5
|
||||
if (isNaN(parseFloat(specificRayAngle))){
|
||||
specificRayAngle = "nah"
|
||||
}
|
||||
var rayans6 = prompt("What element should the ray stop at?", (stopAtElement||"wall"));
|
||||
var rayans6 = await _nousersthingsprompt("What element should the ray stop at?", (stopAtElement||"wall"));
|
||||
if (!rayans6) { return }
|
||||
stopAtElement = mostSimilarElement(rayans6)
|
||||
let rayans7
|
||||
if (rayans == "ray"){ rayans7 = prompt("How long should the ray stay on screen in ticks?", (rayLife||10));
|
||||
if (rayans == "ray"){ rayans7 = await _nousersthingsprompt("How long should the ray stay on screen in ticks?", (rayLife||10));
|
||||
if (!rayans7) { return }
|
||||
if (isNaN(parseFloat(rayans7))){
|
||||
rayLife = 10
|
||||
} else {
|
||||
rayLife = rayans7
|
||||
}
|
||||
var rayans8 = prompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no"));
|
||||
var rayans8 = await _nousersthingsprompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no"));
|
||||
if (rayans8 == "yes"){rainbowMode = true} else {rainbowMode = false}
|
||||
}
|
||||
},
|
||||
|
|
@ -2978,8 +2981,8 @@ elements.run_some_code = {
|
|||
category: "tools",
|
||||
canPlace: false,
|
||||
tool: function(){},
|
||||
onSelect: function(){
|
||||
let code = prompt("Enter code to run")
|
||||
onSelect: async function(){
|
||||
let code = await _nousersthingsprompt("Enter code to run")
|
||||
if (code){
|
||||
eval(code)
|
||||
}
|
||||
|
|
@ -3096,8 +3099,8 @@ elements.piston_ray_emitter = {
|
|||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(){
|
||||
var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||
onSelect: async function(){
|
||||
var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||
if (ans1 == "pull"){pullOrPush = 1}
|
||||
else if (ans1 == "push"){pullOrPush = 2}
|
||||
},
|
||||
|
|
@ -3187,22 +3190,22 @@ elements.specific_piston_ray_emitter = {
|
|||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(){
|
||||
var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||
onSelect: async function(){
|
||||
var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||
if (ans1 == "pull"){pullOrPush = 1}
|
||||
else if (ans1 == "push"){pullOrPush = 2}
|
||||
var ans2 = parseInt(prompt("How offset should the start of the push/pulling be?", "0"))
|
||||
var ans2 = parseInt(await _nousersthingsprompt("How offset should the start of the push/pulling be?", "0"))
|
||||
pistonStart = ans2
|
||||
var ans3 = parseInt(prompt("How offset should the end of the push/pulling be?", "20"))
|
||||
var ans3 = parseInt(await _nousersthingsprompt("How offset should the end of the push/pulling be?", "20"))
|
||||
pistonEnd = ans3
|
||||
var ans4 = parseInt(prompt("How far should it push the pixels each charge?", "1"))
|
||||
var ans4 = parseInt(await _nousersthingsprompt("How far should it push the pixels each charge?", "1"))
|
||||
pistonDistance = ans4
|
||||
var ans5 = parseInt(prompt("How many ticks should it wait to be charged again?", "6"))
|
||||
var ans5 = parseInt(await _nousersthingsprompt("How many ticks should it wait to be charged again?", "6"))
|
||||
pistonCooldown = ans5
|
||||
var ans6 = parseInt(prompt("How many times should it repeat the push/pulling?", "1"))
|
||||
var ans6 = parseInt(await _nousersthingsprompt("How many times should it repeat the push/pulling?", "1"))
|
||||
pistonRepeat = ans6
|
||||
if (pistonRepeat != 1){
|
||||
var ans7 = parseInt(prompt("How many ticks should it wait between repeats?", "1"))
|
||||
var ans7 = parseInt(await _nousersthingsprompt("How many ticks should it wait between repeats?", "1"))
|
||||
pistonRepeatCooldown = ans7
|
||||
}
|
||||
},
|
||||
|
|
@ -3468,8 +3471,8 @@ elements.lattice_brush = {
|
|||
color: elements.grid_brush.color,
|
||||
behavior: behaviors.WALL,
|
||||
category: "special",
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||
onSelect: async function(){
|
||||
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||
latticeElem = mostSimilarElement(ans1)
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -3490,8 +3493,8 @@ elements.spaced_lattice_brush = {
|
|||
color: elements.grid_brush.color,
|
||||
behavior: behaviors.WALL,
|
||||
category: "special",
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||
onSelect: async function(){
|
||||
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||
latticeElem = mostSimilarElement(ans1)
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -3516,8 +3519,8 @@ elements.outer_outliner = {
|
|||
color: elements.inner_outliner.color,
|
||||
behavior: behaviors.WALL,
|
||||
category: "special",
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood")
|
||||
onSelect: async function(){
|
||||
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood")
|
||||
outlinerElem = mostSimilarElement(ans1)
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -3622,8 +3625,8 @@ elements.copycat_filler = {
|
|||
color: elements.random.color,
|
||||
behavior:behaviors.WALL,
|
||||
category: "special",
|
||||
onSelect: function(){
|
||||
let ans1 = prompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand")
|
||||
onSelect: async function(){
|
||||
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand")
|
||||
copycatfillerElem = mostSimilarElement(ans1)
|
||||
},
|
||||
tick: function(pixel){
|
||||
|
|
@ -3799,8 +3802,8 @@ elements.pipe_transmitter = {
|
|||
movable: false,
|
||||
canContain: true,
|
||||
insulate: true,
|
||||
onSelect: () => {
|
||||
let newChannel = prompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar);
|
||||
onSelect: async () => {
|
||||
let newChannel = await _nousersthingsprompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar);
|
||||
pipe_transmitter_channelVar = newChannel;
|
||||
},
|
||||
tick: (pixel) => {
|
||||
|
|
@ -3830,8 +3833,8 @@ elements.pipe_receiver = {
|
|||
movable: false,
|
||||
canContain: true,
|
||||
insulate: true,
|
||||
onSelect: () => {
|
||||
let newChannel = prompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar);
|
||||
onSelect: async () => {
|
||||
let newChannel = await _nousersthingsprompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar);
|
||||
pipe_receiver_channelVar = newChannel;
|
||||
},
|
||||
tick: (pixel) => {
|
||||
|
|
@ -3911,8 +3914,8 @@ elements.sign = {
|
|||
color: "#FFFFFF",
|
||||
darkText: true,
|
||||
category: "special",
|
||||
onSelect: function(){
|
||||
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
|
||||
onSelect: async function(){
|
||||
let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!")
|
||||
signInput = signi;
|
||||
},
|
||||
renderer: function(pixel, ctx){
|
||||
|
|
@ -3925,8 +3928,8 @@ elements.e_sign = {
|
|||
darkText: true,
|
||||
category: "special",
|
||||
movable: false,
|
||||
onSelect: () => {
|
||||
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
|
||||
onSelect: async () => {
|
||||
let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!")
|
||||
signInput = signi;
|
||||
},
|
||||
renderer: function(pixel, ctx){
|
||||
|
|
@ -3972,8 +3975,8 @@ elements.mod_dectector = {
|
|||
category: "machines",
|
||||
movable: false,
|
||||
excludeRandom: true,
|
||||
onSelect: () => {
|
||||
let newMod = prompt("What mod should this machine detect?", "nousersthings.js"||modName)
|
||||
onSelect: async () => {
|
||||
let newMod = await _nousersthingsprompt("What mod should this machine detect?", "nousersthings.js"||modName)
|
||||
machinemodName = newMod
|
||||
},
|
||||
tick: (pixel) => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,421 @@
|
|||
emptyList = []
|
||||
|
||||
runPerPixel(function(pixel) {
|
||||
// run any code on each pixel every tick
|
||||
if (pixel.start>pixelTicks) {
|
||||
if (pixel.olderelement != undefined && pixel.oldercolor != undefined && pixel.olderstart != undefined && pixel.oldertemp != undefined && pixel.olderanimal != undefined && pixel.olderage != undefined) {
|
||||
OGChangePixel(pixel)
|
||||
}
|
||||
else {
|
||||
deletePixel(pixel.x,pixel.y)
|
||||
}
|
||||
} /*
|
||||
if (pixel.start>pixelTicks+10) {
|
||||
deletePixel(pixel.x,pixel.y)
|
||||
} */
|
||||
if (pixel.burnStart && pixel.burnStart>pixelTicks) {
|
||||
if (pixel.burning) {
|
||||
delete pixel.burning;
|
||||
delete pixel.burnStart;
|
||||
}
|
||||
}
|
||||
if (pixel.origColor && !pixel.stainStart) {
|
||||
pixel.stainStart = pixelTicks
|
||||
}
|
||||
if (pixel.stainStart && pixel.origColor && pixel.stainStart>pixelTicks) {
|
||||
pixel.color = "rgb("+pixel.origColor[0]+","+pixel.origColor[1]+","+pixel.origColor[2]+")"
|
||||
delete pixel.origColor
|
||||
delete pixel.stainStart
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
changePixel = function(pixel,element,changetemp=true) {
|
||||
if (!element) { return }
|
||||
if (elements[pixel.element].onChange !== undefined) {
|
||||
elements[pixel.element].onChange(pixel,element);
|
||||
}
|
||||
if (!elements[element]) {
|
||||
pixel.invalidElement = element;
|
||||
element = "unknown"
|
||||
}
|
||||
if (!pixel.olderelement) {
|
||||
pixel.olderelement = []
|
||||
}
|
||||
if (!pixel.oldercolor) {
|
||||
pixel.oldercolor = []
|
||||
}
|
||||
if (!pixel.olderstart) {
|
||||
pixel.olderstart = []
|
||||
}
|
||||
if (!pixel.oldertemp) {
|
||||
pixel.oldertemp = []
|
||||
}
|
||||
if (!pixel.olderanimal) {
|
||||
pixel.olderanimal = []
|
||||
}
|
||||
if (!pixel.olderage) {
|
||||
pixel.olderage = []
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.olderelement[i]) {
|
||||
pixel.olderelement[i] = pixel.element
|
||||
if (pixel.element === "human") {
|
||||
pixel.olderelement[i] = "head"
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.oldercolor[i]) {
|
||||
pixel.oldercolor[i] = pixel.color
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.olderstart[i]) {
|
||||
pixel.olderstart[i] = pixel.start
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.oldertemp[i]) {
|
||||
pixel.oldertemp[i] = pixel.temp
|
||||
if (elements[pixel.element].tempHigh && elements[pixel.element].tempHigh < pixel.temp) {
|
||||
pixel.oldertemp[i] = (elements[pixel.element].tempHigh - 1.5)
|
||||
}
|
||||
if (elements[pixel.element].tempLow && elements[pixel.element].tempLow > pixel.temp) {
|
||||
pixel.oldertemp[i] = (elements[pixel.element].tempLow + 1.5)
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.olderanimal[i]) {
|
||||
pixel.olderanimal[i] = pixel.animal
|
||||
if (!pixel.animal) {
|
||||
pixel.olderanimal[i] = pixel.element
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i <= 500; i++) {
|
||||
if (!pixel.olderage[i]) {
|
||||
pixel.olderage[i] = pixel.age
|
||||
if (!pixel.age) {
|
||||
pixel.olderage[i] = pixel.start
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pixel.element = element;
|
||||
pixel.color = pixelColorPick(pixel);
|
||||
pixel.start = pixelTicks;
|
||||
var elementInfo = elements[element];
|
||||
if (elementInfo.burning == true) {
|
||||
pixel.burning = true;
|
||||
pixel.burnStart = pixelTicks;
|
||||
}
|
||||
else if (pixel.burning && !elementInfo.burn) {
|
||||
delete pixel.burning;
|
||||
delete pixel.burnStart;
|
||||
}
|
||||
delete pixel.origColor; // remove stain
|
||||
delete pixel.clone;
|
||||
if (pixel.glow !== undefined) {
|
||||
delete pixel.glow;
|
||||
}
|
||||
if (pixel.r && !elementInfo.rotatable) {
|
||||
delete pixel.r;
|
||||
}
|
||||
if (pixel.flipX && !elementInfo.flippableX) {
|
||||
delete pixel.flipX;
|
||||
}
|
||||
if (pixel.flipY && !elementInfo.flippableY) {
|
||||
delete pixel.flipY;
|
||||
}
|
||||
// If elementInfo.flippableX, set it to true or false randomly
|
||||
if (elementInfo.flipX !== undefined) { pixel.flipX = elementInfo.flipX }
|
||||
else if (elementInfo.flippableX) {
|
||||
pixel.flipX = Math.random() >= 0.5;
|
||||
}
|
||||
// If elementInfo.flippableY, set it to true or false randomly
|
||||
if (elementInfo.flipY !== undefined) { pixel.flipY = elementInfo.flipY }
|
||||
else if (elementInfo.flippableY) {
|
||||
pixel.flipY = Math.random() >= 0.5;
|
||||
}
|
||||
if (elementInfo.temp !== undefined && changetemp) {
|
||||
pixel.temp = (elementInfo.temp+pixel.temp)/2;
|
||||
pixelTempCheck(pixel)
|
||||
}
|
||||
if (pixel.con && !elementInfo.canContain) {
|
||||
delete pixel.con;
|
||||
}
|
||||
// If elementInfo.properties, set each key to its value
|
||||
if (elementInfo.properties !== undefined) {
|
||||
for (var key in elementInfo.properties) {
|
||||
// If it is an array or object, make a copy of it
|
||||
if (typeof elementInfo.properties[key] == "object") {
|
||||
pixel[key] = JSON.parse(JSON.stringify(elementInfo.properties[key]));
|
||||
}
|
||||
else {
|
||||
pixel[key] = elementInfo.properties[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pixel.alpha !== undefined) {
|
||||
delete pixel.alpha;
|
||||
}
|
||||
if (pixel.emit) {
|
||||
delete pixel.emit;
|
||||
}
|
||||
if (elements[element].alpha !== undefined) {
|
||||
pixel.alpha = elements[element].alpha;
|
||||
}
|
||||
if (elements[element].onPlace !== undefined) {
|
||||
elements[element].onPlace(pixel);
|
||||
}
|
||||
checkUnlock(element);
|
||||
}
|
||||
|
||||
OGChangePixel = function(pixel) {
|
||||
if (pixel.olderelement != undefined && pixel.oldercolor != undefined && pixel.olderstart != undefined && pixel.oldertemp != undefined && pixel.olderanimal != undefined && pixel.olderage != undefined && pixel.olderelement.length > emptyList.length && pixel.oldercolor.length > emptyList.length && pixel.olderstart.length > emptyList.length && pixel.oldertemp.length > emptyList.length && pixel.olderanimal.length > emptyList.length && pixel.olderage.length > emptyList.length && pixel.start<pixelTicks+5) {
|
||||
pixel.element = pixel.olderelement[(pixel.olderelement.length - 1)]
|
||||
pixel.color = pixel.oldercolor[(pixel.oldercolor.length - 1)]
|
||||
pixel.start = pixel.olderstart[(pixel.olderstart.length - 1)]
|
||||
pixel.temp = pixel.oldertemp[(pixel.oldertemp.length - 1)]
|
||||
pixel.animal = pixel.olderanimal[(pixel.olderanimal.length - 1)]
|
||||
pixel.age = pixel.olderage[(pixel.olderage.length - 1)]
|
||||
pixel.olderelement.pop()
|
||||
pixel.oldercolor.pop()
|
||||
pixel.olderstart.pop()
|
||||
pixel.oldertemp.pop()
|
||||
pixel.olderanimal.pop()
|
||||
pixel.olderage.pop()
|
||||
}
|
||||
else {
|
||||
deletePixel(pixel.x,pixel.y)
|
||||
}
|
||||
}
|
||||
|
||||
elements.reverse_time = {
|
||||
color: "#f2eeb8",
|
||||
tool: function(pixel) {},
|
||||
perTick: function() {
|
||||
pixelTicks -= 2;
|
||||
},
|
||||
category: "tools",
|
||||
canPlace: false,
|
||||
darkText: true,
|
||||
}
|
||||
/*
|
||||
|
||||
elements.egg = {
|
||||
color: "#e0d3ab",
|
||||
tick: function(pixel) {
|
||||
if (!pixel.animal && pixel.start>pixelTicks) {
|
||||
deletePixel(pixel.x,pixel.y)
|
||||
}
|
||||
else if (pixel.animal && pixel.start-pixelTicks >= 500 && Math.random() < 0.2) {
|
||||
deletePixel(pixel.x,pixel.y)
|
||||
}
|
||||
if (pixel.start === pixelTicks) {return}
|
||||
if (pixel.drag) pixel.fall = 0;
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
|
||||
if (pixel.animal || pixel.fall < 20) {
|
||||
if (Math.random() < 0.5) {
|
||||
if (!tryMove(pixel, pixel.x+1, pixel.y+1)) {
|
||||
tryMove(pixel, pixel.x-1, pixel.y+1);
|
||||
}
|
||||
} else {
|
||||
if (!tryMove(pixel, pixel.x-1, pixel.y+1)) {
|
||||
tryMove(pixel, pixel.x+1, pixel.y+1);
|
||||
}
|
||||
}
|
||||
pixel.fall = 0;
|
||||
}
|
||||
else if (outOfBounds(pixel.x,pixel.y+1) || (!isEmpty(pixel.x,pixel.y+1,true) && elements.egg.ignore.indexOf(pixelMap[pixel.x][pixel.y+1].element) === -1 && elements[pixelMap[pixel.x][pixel.y+1].element].state === "solid")) {
|
||||
changePixel(pixel,"yolk")
|
||||
}
|
||||
else {pixel.fall = 0}
|
||||
if (pixel.animal && pixelTicks-pixel.start >= 500 && Math.random() < 0.2) {
|
||||
changePixel(pixel,pixel.animal)
|
||||
}
|
||||
}
|
||||
else {pixel.fall ++}
|
||||
if (pixel.temp < -2 || pixel.temp > 100) {
|
||||
pixel.animal = null;
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
ignore: ["paper","sponge","straw","wheat","rat","frog","pollen","clay","snow","mud","wet_sand","tinder","feather","bread","ice_cream","dough"],
|
||||
innerColor: "#ffffff",
|
||||
properties: { "fall":0 },
|
||||
tempHigh: 1500,
|
||||
stateHigh: ["steam","calcium","carbon_dioxide","sulfur_gas"],
|
||||
breakInto: "yolk",
|
||||
category: "food",
|
||||
state: "solid",
|
||||
density: 1031,
|
||||
cooldown: defaultCooldown
|
||||
}
|
||||
|
||||
elements.tadpole = {
|
||||
color: "#87b574",
|
||||
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",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
if (pixel.start-pixelTicks > 500) {
|
||||
OGChangePixel(pixel,"egg")
|
||||
pixel.color = pixelColorPick(pixel,"#717c80")
|
||||
pixel.animal = "tadpole"
|
||||
}
|
||||
if (pixelTicks-pixel.start > 500) {
|
||||
changePixel(pixel,"frog");
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"algae": { elem2:null, chance:0.25 },
|
||||
"kelp": { elem2:"water", chance:0.25 }
|
||||
},
|
||||
tempHigh: 100,
|
||||
stateHigh: "steam",
|
||||
tempLow: -10,
|
||||
stateLow: "ice",
|
||||
breakInto: ["slime",null],
|
||||
category:"life",
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 1450,
|
||||
conduct: 0.2
|
||||
}
|
||||
|
||||
elements.frog = {
|
||||
color: "#607300",
|
||||
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",
|
||||
],
|
||||
reactions: {
|
||||
"fly": { elem2:null, chance:0.5, func:behaviors.FEEDPIXEL },
|
||||
"firefly": { elem1:"meat", elem2:null, chance:0.5 },
|
||||
"stink_bug": { elem2:null, chance:0.55, func:behaviors.FEEDPIXEL },
|
||||
"snail": { elem2:"limestone", chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
|
||||
"worm": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
|
||||
"spider": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
|
||||
"algae": { elem2:null, chance:0.5, func:behaviors.FEEDPIXEL },
|
||||
"kelp": { elem2:"water", chance:0.5, func:behaviors.FEEDPIXEL },
|
||||
"oxygen": { elem2:"carbon_dioxide", chance:0.5 },
|
||||
"dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL },
|
||||
"mercury": { elem1:"rotten_meat", chance:0.1 },
|
||||
"bleach": { elem1:"rotten_meat", chance:0.1 },
|
||||
"infection": { elem1:"rotten_meat", chance:0.025 },
|
||||
"uranium": { elem1:"rotten_meat", chance:0.1 },
|
||||
"cyanide": { elem1:"rotten_meat", chance:0.1 },
|
||||
"chlorine": { elem1:"meat", chance:0.1 },
|
||||
"alcohol": { elem1:"meat", chance:0.025 },
|
||||
"dirty_water": { elem1:"rotten_meat", chance:0.0001 },
|
||||
"pool_water": { elem1:"rotten_meat", chance:0.005 },
|
||||
"vinegar": { elem1:"rotten_meat", chance:0.001 },
|
||||
},
|
||||
tick: function(pixel) {
|
||||
if (pixelTicks < pixel.start) {
|
||||
OGChangePixel(pixel,"tadpole");
|
||||
}
|
||||
},
|
||||
foodNeed: 10,
|
||||
baby: "tadpole",
|
||||
eggColor:"#717c80",
|
||||
temp: 19.1,
|
||||
tempHigh: 100,
|
||||
stateHigh: "cooked_meat",
|
||||
stateHighColor: "#CDAF96",
|
||||
onStateHigh: function(pixel) {
|
||||
releaseElement(pixel,"steam");
|
||||
},
|
||||
tempLow: -18,
|
||||
stateLow: "frozen_frog",
|
||||
category:"life",
|
||||
breakInto: "slime",
|
||||
burn:15,
|
||||
burnTime:300,
|
||||
state: "solid",
|
||||
density: 1450,
|
||||
conduct: 0.2
|
||||
}
|
||||
|
||||
elements.fly = {
|
||||
color: "#4c4e42",
|
||||
behaviorOn: [
|
||||
"XX|CR:flash|XX",
|
||||
"CR:flash|CH:ash|CR:flash",
|
||||
"XX|CR:flash|XX",
|
||||
],
|
||||
reactions: {
|
||||
"dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"rotten_meat": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"cheese": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"cheese_powder": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"rotten_cheese": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"vine": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"corn": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"potato": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"crumb": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL },
|
||||
"wheat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
|
||||
"yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"caramel": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL },
|
||||
"sugar_water": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"honey": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL },
|
||||
"soda": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }
|
||||
},
|
||||
tick: function(pixel, onHit) {
|
||||
var nx = pixel.flipX ? -1 : 1;
|
||||
var ny = Math.random() < 0.5 ? -1 : 1;
|
||||
var hit = false;
|
||||
if (!tryMove(pixel, pixel.x+nx, pixel.y+ny)) {
|
||||
if (!tryMove(pixel, pixel.x+nx, pixel.y-ny)) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+ny)) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y-ny)) {hit=[pixel.x, pixel.y-ny]}
|
||||
}else {hit=[pixel.x, pixel.y+ny]}
|
||||
}else {hit=[pixel.x+nx, pixel.y-ny]}
|
||||
}else {hit=[pixel.x+nx, pixel.y+ny]}
|
||||
if (hit && onHit) {
|
||||
if (!isEmpty(hit[0], hit[1], true)) {
|
||||
onHit(pixel, pixelMap[hit[0]][hit[1]]);
|
||||
}
|
||||
else {onHit(pixel);}
|
||||
}
|
||||
if (pixel.del) {return}
|
||||
if (!isEmpty(pixel.x+nx,pixel.y) || Math.random() < 0.02) {
|
||||
pixel.flipX = !pixel.flipX;
|
||||
}
|
||||
if (pixel.charge && elements[pixel.element].behaviorOn) {
|
||||
pixelTick(pixel)
|
||||
}
|
||||
doDefaults(pixel);
|
||||
if (pixel.start-pixelTicks > 500) {
|
||||
OGChangePixel(pixel,"egg")
|
||||
pixel.animal = "fly"
|
||||
}
|
||||
},
|
||||
foodNeed: 15,
|
||||
tempHigh: 100,
|
||||
stateHigh: "ash",
|
||||
tempLow: 0,
|
||||
stateLow: "dead_bug",
|
||||
breakInto: "dead_bug",
|
||||
category:"life",
|
||||
burn:95,
|
||||
burnTime:25,
|
||||
state: "solid",
|
||||
density: 600,
|
||||
conduct: 1
|
||||
} */
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
airResistance = 0.1;
|
||||
terminalVelocity = 5;
|
||||
gravityPull = 0.2;
|
||||
|
||||
validateMoves((pixel,nx,ny) => {
|
||||
if (elements[pixel.element].isGas) return true;
|
||||
if (isEmpty(pixel.x,pixel.y+1) && pixel.y-ny < 0) { //goes down usually
|
||||
pixel.vy = (pixel.vy||0) + gravityPull;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
|
||||
runPerPixel((pixel) => {
|
||||
|
||||
let vx = pixel.vx;
|
||||
let vy = pixel.vy;
|
||||
if (vx === undefined ) vx = 0;
|
||||
else if (Math.abs(vx) > terminalVelocity) vx = (vx + terminalVelocity) / 2;
|
||||
if (vy === undefined ) vy = 0;
|
||||
else if (Math.abs(vy) > terminalVelocity) vy = (vy + terminalVelocity) / 2;
|
||||
|
||||
if (vx !== 0 || vy !== 0) {
|
||||
|
||||
if (!elements[pixel.element].movable) {
|
||||
pixel.vx = 0;
|
||||
pixel.vy = 0;
|
||||
return;
|
||||
};
|
||||
|
||||
// Calculate change in position; Random chance for in-between decimal values
|
||||
const changeX = Math.trunc(vx) +
|
||||
(Math.random() < (vx % 1) ? Math.sign(vx) : 0);
|
||||
const changeY = Math.trunc(vy) +
|
||||
(Math.random() < (vy % 1) ? Math.sign(vy) : 0);
|
||||
|
||||
const loopFor = Math.max(Math.abs(changeX),Math.abs(changeY));
|
||||
// console.log(Math.trunc(vy));
|
||||
|
||||
// let hit = false;
|
||||
for (let i = 0; i < loopFor; i++) {
|
||||
const newX = pixel.x + (changeX ? Math.sign(changeX) : 0);
|
||||
const newY = pixel.y + (changeY ? Math.sign(changeY) : 0);
|
||||
|
||||
if (!tryMove(pixel,newX,newY)) {
|
||||
if (!isEmpty(newX,newY,true)) {
|
||||
const newPixel = pixelMap[newX][newY];
|
||||
newPixel.vx = (newPixel.vx||0) + vx*0.6;
|
||||
newPixel.vy = (newPixel.vy||0) + vy*0.6;
|
||||
}
|
||||
vx = vx*0.4;
|
||||
vy = vy*0.4;
|
||||
};
|
||||
}
|
||||
|
||||
// const newX = pixel.x + changeX;
|
||||
// const newY = pixel.y + changeY;
|
||||
|
||||
const multiplier = (1-airResistance);
|
||||
pixel.vx = vx * multiplier;
|
||||
pixel.vy = vy * multiplier;
|
||||
|
||||
// Cut off very low decimal values
|
||||
if (Math.abs(pixel.vx) < 0.01) pixel.vx = 0;
|
||||
if (Math.abs(pixel.vy) < 0.01) pixel.vy = 0;
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
elements.push_up = {
|
||||
color: "#ffffff",
|
||||
tool: function(pixel) {
|
||||
pixel.vx = (Math.random() * 2) * (Math.random() < 0.5 ? 1 : -1);
|
||||
pixel.vy = (Math.random() * 2) * -1;
|
||||
},
|
||||
category: "special"
|
||||
}
|
||||
|
||||
elements.repeller = {
|
||||
color: "#ffffff",
|
||||
tick: function(pixel) {
|
||||
var coords = circleCoords(pixel.x,pixel.y,5);
|
||||
for (var i = 0; i < coords.length; i++) {
|
||||
var coord = coords[i];
|
||||
if (!isEmpty(coord.x,coord.y,true)) {
|
||||
if (!elements[pixelMap[coord.x][coord.y].element].movable) continue;
|
||||
pixelMap[coord.x][coord.y].vx = (pixelMap[coord.x][coord.y].vx||0) + (Math.random() < 0.5 ? 1 : -1);
|
||||
pixelMap[coord.x][coord.y].vy = (pixelMap[coord.x][coord.y].vy||0) -1;
|
||||
}
|
||||
}
|
||||
},
|
||||
movable: false,
|
||||
category: "machines",
|
||||
emit: true
|
||||
}
|
||||
|
||||
viewInfo["4"] = { // Velocity View
|
||||
name: "velocity",
|
||||
pixel: function(pixel,ctx) {
|
||||
const thermalMin = -5;
|
||||
const thermalMax = 5;
|
||||
|
||||
var temp = pixel.vx || 0;
|
||||
var hue = Math.round((temp - thermalMin) / (thermalMax - thermalMin) * 255);
|
||||
if (hue < 0) {hue = 0}
|
||||
if (hue > 225) {hue = 225}
|
||||
drawSquare(ctx,"hsl("+hue+",100%,50%)",pixel.x,pixel.y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
explodeAt = function(x,y,radius,fire="fire") {
|
||||
// if fire contains , split it into an array
|
||||
if (fire.indexOf(",") !== -1) {
|
||||
fire = fire.split(",");
|
||||
}
|
||||
var coords = circleCoords(x,y,radius);
|
||||
var power = radius/10;
|
||||
//for (var p = 0; p < Math.round(radius/10+1); p++) {
|
||||
for (var i = 0; i < coords.length; i++) {
|
||||
// damage value is based on distance from x and y
|
||||
var distance = (Math.floor(Math.sqrt(Math.pow(coords[i].x-x,2) + Math.pow(coords[i].y-y,2)))) / radius;
|
||||
const dirX = coords[i].x > x ? 1 : -1;
|
||||
const dirY = coords[i].y > y ? 1 : -1;
|
||||
var damage = Math.random() + distance;
|
||||
// invert
|
||||
damage = 1 - damage;
|
||||
if (damage < 0) { damage = 0; }
|
||||
damage *= power;
|
||||
if (isEmpty(coords[i].x,coords[i].y)) {
|
||||
// create smoke or fire depending on the damage if empty
|
||||
if (damage < 0.02) { } // do nothing
|
||||
else if (damage < 0.2) {
|
||||
createPixel("smoke",coords[i].x,coords[i].y);
|
||||
pixelMap[coords[i].x][coords[i].y].vy = power * (1-distance) * -1;
|
||||
pixelMap[coords[i].x][coords[i].y].vx = power * (1-distance) * dirX;
|
||||
}
|
||||
else {
|
||||
// if fire is an array, choose a random item
|
||||
if (Array.isArray(fire)) {
|
||||
createPixel(fire[Math.floor(Math.random() * fire.length)],coords[i].x,coords[i].y);
|
||||
}
|
||||
else {
|
||||
createPixel(fire,coords[i].x,coords[i].y);
|
||||
}
|
||||
pixelMap[coords[i].x][coords[i].y].vy = 2*power * -1;
|
||||
pixelMap[coords[i].x][coords[i].y].vx = 2*power * dirX;
|
||||
}
|
||||
}
|
||||
else if (!outOfBounds(coords[i].x,coords[i].y)) {
|
||||
// damage the pixel
|
||||
var pixel = pixelMap[coords[i].x][coords[i].y];
|
||||
var info = elements[pixel.element];
|
||||
if (info.hardness) { // lower damage depending on hardness(0-1)
|
||||
if (info.hardness < 1) {
|
||||
// more hardness = less damage, logarithmic
|
||||
damage *= Math.pow((1-info.hardness),info.hardness);
|
||||
}
|
||||
else { damage = 0; }
|
||||
}
|
||||
pixel.vy = 3 * (1-distance) * -1;
|
||||
pixel.vx = 3 * (1-distance) * dirX;
|
||||
if (damage > 0.9) {
|
||||
if (Array.isArray(fire)) {
|
||||
var newfire = fire[Math.floor(Math.random() * fire.length)];
|
||||
}
|
||||
else {
|
||||
var newfire = fire;
|
||||
}
|
||||
changePixel(pixel,newfire);
|
||||
// pixel.vy = 10 * damage * (Math.random() < 0.5 ? 1 : -1);
|
||||
// pixel.vx = 10 * damage * (Math.random() < 0.5 ? 1 : -1);
|
||||
continue;
|
||||
}
|
||||
else if (damage > 0.25) {
|
||||
if (isBreakable(pixel)) {
|
||||
breakPixel(pixel);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if (Array.isArray(fire)) {
|
||||
var newfire = fire[Math.floor(Math.random() * fire.length)];
|
||||
}
|
||||
else {
|
||||
var newfire = fire;
|
||||
}
|
||||
if (elements[pixel.element].onBreak !== undefined) {
|
||||
elements[pixel.element].onBreak(pixel);
|
||||
}
|
||||
changePixel(pixel,newfire);
|
||||
// pixel.vy = 10 * damage * (Math.random() < 0.5 ? 1 : -1);
|
||||
// pixel.vx = 10 * damage * (Math.random() < 0.5 ? 1 : -1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (damage > 0.75 && info.burn) {
|
||||
pixel.burning = true;
|
||||
pixel.burnStart = pixelTicks;
|
||||
}
|
||||
pixel.temp += damage*radius*power;
|
||||
pixel.vy = 3 * (1-distance) * -1;
|
||||
pixel.vx = 3 * (1-distance) * dirX;
|
||||
// console.log(pixel.vy);
|
||||
pixelTempCheck(pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
elements.acetobacter = {
|
||||
color: ["#328fa8", "#6bbfd6", "#19718a"],
|
||||
category: "life",
|
||||
tempHigh: "102",
|
||||
tempLow: "-2",
|
||||
stateHigh: ["steam","steam","steam","sugar"],
|
||||
stateLow: ["ice","ice","ice","sugar_ice"],
|
||||
breakInto:["dna","dna","dna","water"],
|
||||
behavior: [
|
||||
["XX","M1%30","XX"],
|
||||
["M1%50","XX","M1%50"],
|
||||
["XX","M1%30","XX"]
|
||||
],
|
||||
reactions:{
|
||||
"alcohol" :{ elem1: "acetobacter", elem2:"vinegar", chance:0.2,}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,20 @@
|
|||
async function _weaponsjsprompt(message, defaultValue = "") {
|
||||
|
||||
|
||||
return new Promise(resolve => {
|
||||
|
||||
|
||||
promptInput(message, (result) => {
|
||||
|
||||
|
||||
resolve(result);
|
||||
|
||||
|
||||
}, "weapons.js is asking you...", defaultValue);
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
elements.tsar_bomba = {
|
||||
color: "#524C41",
|
||||
behavior: [
|
||||
|
|
@ -554,7 +571,7 @@ elements.bombs_for_throwing_at_you_left = {
|
|||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"M1|M1%10 AND EX:10>bomb|XX",
|
||||
"M1 AND EX:10>bomb|M1%10 AND EX:10>bomb|XX",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
|
|
@ -577,7 +594,7 @@ elements.bombs_for_throwing_at_you_right = {
|
|||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|M1%10 AND EX:10>bomb|M1",
|
||||
"XX|M1%10 AND EX:10>bomb|M1 AND EX:10>bomb",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
|
|
@ -873,14 +890,14 @@ createAtYvar = 0;
|
|||
create1var = "";
|
||||
elements.element_spawner = {
|
||||
color: "#71797E",
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input the x value.",(createAtXvar||undefined));
|
||||
onSelect: async function() {
|
||||
var answer1 = await _weaponsjsprompt("Please input the x value.",(createAtXvar||undefined));
|
||||
if (!answer1) {return}
|
||||
createAtXvar = parseInt(answer1);
|
||||
var answer2 = prompt("Please input the y value.",(createAtYvar||undefined));
|
||||
var answer2 = await _weaponsjsprompt("Please input the y value.",(createAtYvar||undefined));
|
||||
if (!answer2) {return}
|
||||
createAtYvar = parseInt(answer2);
|
||||
var answer3 = prompt("Please input what element should spawn.",(create1var||undefined));
|
||||
var answer3 = await _weaponsjsprompt("Please input what element should spawn.",(create1var||undefined));
|
||||
if (!answer3) {return}
|
||||
create1var = answer3;
|
||||
},
|
||||
|
|
@ -1252,4 +1269,18 @@ elements.right_uranium_bullet = {
|
|||
excludeRandom: true,
|
||||
cooldown: defaultCooldown,
|
||||
temp: 4000,
|
||||
},
|
||||
elements.cluster_nuke = {
|
||||
color: "#323232",
|
||||
ignore: "cluster_nuke",
|
||||
category: "weapons",
|
||||
behavior: behaviors.POWDER,
|
||||
maxSize: 1,
|
||||
tick: (pixel) => {
|
||||
for (var y = 1; y < 50; y++) {
|
||||
if (!isEmpty(pixel.x, pixel.y + y, false)) {
|
||||
explodeAt(pixel.x,pixel.y,50,["dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","nuke",])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue