Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
9be789a926
|
|
@ -219,7 +219,9 @@
|
|||
|
||||
<!----><tr><td class="modCat" colspan="3">Food & Cooking</td></tr><!---->
|
||||
<tr><td>aChefsDream.js</td><td>Adds more foods, animals, tools and many other cooking related items. Updates can be found in <a href="https://www.youtube.com/watch?v=pQFTtlNPODQ&list=PLWHqGb75vC8o7CLv-pMoVb56JL9BY9F0t">this YouTube Playlist</a></td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>aChefsDream_beta.js</td><td>Beta testing for aChefsDream. The code can be found <a href="https://www.github.com/SquareScreamYT/aChefsDream.js">on GitHub</a></td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>bananas.js</td><td>Adds bananas and banana plants</td><td>Alice</td></tr>
|
||||
<tr><td>community_desserts.js</td><td>Adds various desserts from community suggestions</td><td>Tisquares</td></tr>
|
||||
<tr><td>greenitemsandmore.js</td><td>Adds various green things, including apples and more food</td><td>zonneschijn7</td>
|
||||
<tr><td>ketchup_mod.js</td><td>Adds a bunch of ketchup related stuff, plus a few other condiments</td><td>Nubo318 (main dev), Devi, Alice (contributors)</td></tr>
|
||||
<tr><td>lemonade.js</td><td>Adds lemons and lemonade</td><td>personman / baconthemyth</td></tr>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Science mod for Sandboxels
|
||||
// (Inspired by survival.js)
|
||||
// Build 11
|
||||
// Build 17
|
||||
// By: Lucifer (@a_british_proto (Discord))
|
||||
// If there is anything you want to suggest or there's a bug then just dm me on discord
|
||||
// Todo:
|
||||
|
|
@ -19,6 +19,7 @@ if (!settings.Science_mod) {
|
|||
"Beryllium": 9.223372036854776e+18,
|
||||
"Boron": 9.223372036854776e+18,
|
||||
"Carbon": 9.223372036854776e+18,
|
||||
"Nitrogen": 9.223372036854776e+18,
|
||||
"Oxygen": 9.223372036854776e+18,
|
||||
"Flourine": 9.223372036854776e+18,
|
||||
"Neon": 9.223372036854776e+18,
|
||||
|
|
@ -1086,52 +1087,303 @@ element.Oganesson = {
|
|||
// Substance proporties (These are the properties of the substances, not the elements These properties
|
||||
// use hidden:true as you don't start with these but instead have to craft them):
|
||||
|
||||
substance.Polystyrene = {
|
||||
behavior: behaviors.WALL,
|
||||
color:"FFFFFF",
|
||||
category:"land",
|
||||
// I replaced all of it with this because it might get in the way in future updates
|
||||
|
||||
substance.Silver_Hexafluoroarsenate = {
|
||||
behavior: behaviours.WALL,
|
||||
color:"FFFFFE",
|
||||
category:"lands",
|
||||
state:"solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Styrene = {
|
||||
substance.Silver_Tetrafluoroborate = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "FAF9F6",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Bromide = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FDFD96",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden: true
|
||||
}
|
||||
|
||||
substance.Silver_Bromate = {
|
||||
behavior: behaviors.POWDER,
|
||||
colour: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Picrate_Monohydrate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "E4D99F",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Chloride = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Perchlorate_Hydrate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// I can't believe i almost forgor about the "."
|
||||
subtance.Silver_Perchlorate_Monohydrate = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Chlorite = {
|
||||
behavior: behaviors.WALL,
|
||||
colour: "FFFF00",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Chlorate ={
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Perchlorate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Fluoride = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "9B7A01",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// Basically the same as Silver_Floride but instead the second version
|
||||
subtance.Silver_Difluoride = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "9B7A01",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// Only just realised that this had spaces :skull:
|
||||
substance.Silver_Hydrogen_Sluoride = {
|
||||
// I'm guessing that this is a liquid
|
||||
behavior: behaviors.LIQUID,
|
||||
color:"FFFFED",
|
||||
category:"liquids",
|
||||
state:"liquid",
|
||||
color: "FFFFFF",
|
||||
category: "liquid",
|
||||
state: "liquid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Cinnamaldehyde = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color:"FDFD96",
|
||||
category:"liquids",
|
||||
state:"liquid",
|
||||
// Why are a bunch of these just silver compounds? Really weird :/
|
||||
subtance.Silver_Hexafluorophosphate = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Acetone = {
|
||||
behavior: behaviors.LIQUID,
|
||||
color:"DADEDF",
|
||||
category:"liquids",
|
||||
state:"liquid",
|
||||
substance.Silver_Hexafluoroantimonate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFDD0",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Methane = {
|
||||
behavior: behaviors.GAS,
|
||||
color:"C1C7C9",
|
||||
category:"gases",
|
||||
state:"gas",
|
||||
// There's a purple crystal version and a brown powder version
|
||||
// Why does this sound like something you'd get at a posh (maybe Italian) restruant (without the "01" and the "_")
|
||||
subtance.Silver_permanganate_01 = {
|
||||
behavior: behaviours.WALL,
|
||||
color: "800080",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Ethane = {
|
||||
behavior: behaviors.GAS,
|
||||
color:"C1C7C9",
|
||||
category:"gases",
|
||||
state:"gas",
|
||||
subtance.Silver_permanganate_02 = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "964B00",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// Doing more tmrw
|
||||
substance.Silver_Vandium_Trioxide = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFF00",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// Why is this fun? How is this not torture? This is line 1247! (at the time I am making this comment)
|
||||
|
||||
// I think there's two silver iodides I'm just not so sure (and I ain't editing this after)
|
||||
// Nvm it's only one , I got silver iodide and silver iodate mixed up :skull:
|
||||
subtance.Silver_Iodide = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "E4D99F",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Iodate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden: true
|
||||
}
|
||||
|
||||
// I was confused at first on why there were two silver nitrates, but now I understand
|
||||
substance.Silver_Nitrate_01 = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Nitrate_02 = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
subtance.Silver_Azide = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// This one is powder and crystals
|
||||
substance.Silver_Oxzide_01 = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "000001",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Oxzide_02 = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "000001",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Metaphospahte = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFF00",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Perrhenate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Acetylide = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "C0C0C0",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Chromate = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "A52A2A",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Dichromate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "A52A2A",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Subfluoride = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "CD7F32",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Sulfide = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "3f3f3f",
|
||||
category: "lands",
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
substance.Silver_Oxzide = {
|
||||
behavior: behaviors.POWDER,
|
||||
color: "000002",
|
||||
category: "lands",
|
||||
state: "powder",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// Editing this later on when I get back home
|
||||
substance.Silver_Sulfate = {
|
||||
behavior: behaviors.WALL,
|
||||
color: "FFFFFF",
|
||||
category: "lands"
|
||||
state: "solid",
|
||||
hidden:true
|
||||
}
|
||||
|
||||
// I done this on my school computers :skull:
|
||||
// doing more later
|
||||
|
||||
// I accidentally pressed Ctrl+V instead of Ctrl+C so it deleted my work D:
|
||||
|
|
|
|||
283
mods/UAMM.js
283
mods/UAMM.js
|
|
@ -15,7 +15,7 @@ elements.rubidium = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if(!isEmpty(x, y, true)){
|
||||
if (!isEmpty(x, y, true)){
|
||||
var otherPixel = pixelMap[x][y]
|
||||
if (otherPixel.element == "liquid_ammonia"){foundelem1 = true; break}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ elements.rubidium = {
|
|||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if(!isEmpty(x, y, true)){
|
||||
if (!isEmpty(x, y, true)){
|
||||
var otherPixel = pixelMap[x][y]
|
||||
if (otherPixel.element == "oxygen"){foundelem2 = true; break}
|
||||
}
|
||||
|
|
@ -122,11 +122,21 @@ elements.radiocesium = {
|
|||
tempHigh: 29,
|
||||
stateHigh: "liquid_radiocesium",
|
||||
density: 1873,
|
||||
tick: function (pixel) {
|
||||
if (Math.random()<0.007) {
|
||||
if (Math.random()<0.5) {
|
||||
changePixel(pixel, "barium")
|
||||
}
|
||||
else {
|
||||
changePixel(pixel, "radiobarium")
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: ["rad_steam", "fallout"], elem2: "explosion"}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.liquid_radiocesium = {
|
||||
color: ["#e8dcc1", "#d4c6a5", "#bfbaae", "#f5f1e9"],
|
||||
|
|
@ -136,21 +146,270 @@ elements.liquid_radiocesium = {
|
|||
tempLow: 28,
|
||||
stateLow: "radiocesium",
|
||||
density: 1842,
|
||||
tick: function (pixel) {
|
||||
if (Math.random()<0.007) {
|
||||
if (Math.random()<0.5) {
|
||||
changePixel(pixel, "barium")
|
||||
}
|
||||
else {
|
||||
changePixel(pixel, "radiobarium")
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"water": {func: (pixel1) => {pixel1.burning=true;pixel1.burnStart=pixelTicks},
|
||||
elem1: ["rad_steam", "fallout"], elem2: "explosion"}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.lithium = {
|
||||
color: ["#e3a814", "#dbab32", "#e8bc4f", "#fabf2d"],
|
||||
elements.barium = {
|
||||
color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
fireColor: "#8c21de",
|
||||
burn: 1,
|
||||
burnTime: 500,
|
||||
tempHigh: 29,
|
||||
stateHigh: "liquid_cesium",
|
||||
density: 534,
|
||||
tempHigh: 730,
|
||||
stateHigh: "liquid_barium",
|
||||
density: 3510,
|
||||
reactions: {
|
||||
"water": {elem1: "barium_hydroxide", elem2: "pop"}
|
||||
}
|
||||
};
|
||||
|
||||
elements.liquid_barium = {
|
||||
color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
tempLow: 729,
|
||||
stateLow: "barium",
|
||||
density: 3338
|
||||
}
|
||||
|
||||
elements.radiobarium = {
|
||||
color: ["#1e1e1e", "#353535", "#4e4e4e", "#696969"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 3510,
|
||||
tick: function (pixel) {
|
||||
if (Math.random()<0.007) {
|
||||
changePixel(pixel, "barium")
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
var rays = 0;
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("gamma_ray", x, y)
|
||||
rays += 1
|
||||
if (rays == 2) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.barium_hydroxide = {
|
||||
color: ["#f4f4f4", "#ffffff", "#ebebeb", "#e5e5e5"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 3510
|
||||
}
|
||||
|
||||
elements.gamma_ray = {
|
||||
color: "#ffffff",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|DL%5|XX",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
hidden: true,
|
||||
temp: 1000,
|
||||
state: "gas",
|
||||
density: 0.00001,
|
||||
ignoreAir: true,
|
||||
tick: behaviors.BOUNCY
|
||||
};
|
||||
|
||||
elements.lithium = {
|
||||
color: ["#e8e8e8", "#f5f5f5", "#c9c9c9", "#d4d4d4"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
tempHigh: 180.5,
|
||||
stateHigh: "liquid_lithium",
|
||||
density: 534,
|
||||
tick: function (pixel){
|
||||
var otherPixel;
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y, true)){
|
||||
if(Math.random()<0.003) {
|
||||
changePixel(pixel, "dull_lithium")
|
||||
}
|
||||
}
|
||||
if (!isEmpty(x, y, true)) {
|
||||
otherPixel = pixelMap[x][y];
|
||||
if (otherPixel.element != "mineral_oil") {
|
||||
if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") {
|
||||
if(Math.random()<0.0007) {
|
||||
changePixel(pixel, "dull_lithium")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400},
|
||||
"hydrogen": {elem1:"lithium_hydride", elem2: null, chance: 0.5}
|
||||
}
|
||||
};
|
||||
|
||||
elements.dull_lithium = {
|
||||
color: ["#d4d4d4", "#e3e3e3", "#b3b3b3", "#bfbfbf"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
tempHigh: 180.5,
|
||||
stateHigh: "liquid_lithium",
|
||||
density: 534,
|
||||
tick: function (pixel){
|
||||
var otherPixel;
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y, true)){
|
||||
if(Math.random()<0.003) {
|
||||
changePixel(pixel, "dull_lithium")
|
||||
}
|
||||
}
|
||||
if (!isEmpty(x, y, true)) {
|
||||
otherPixel = pixelMap[x][y];
|
||||
if (otherPixel.element != "mineral_oil") {
|
||||
if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") {
|
||||
if(Math.random()<0.0007) {
|
||||
changePixel(pixel, "dull_lithium")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"water": {elem1: "lithium_hydroxide", elem2: "hydrogen", temp2: 400},
|
||||
"hydrogen": {elem1:"lithium_hydride", elem2: null, chance: 0.5}
|
||||
}
|
||||
};
|
||||
|
||||
elements.tarnished_lithium = {
|
||||
color: ["#212121", "#303030", "#0d0d0d", "#404040"],
|
||||
behavior: behaviors.POWDER,
|
||||
state: "solid",
|
||||
hidden: true,
|
||||
tempHigh: 180.5,
|
||||
stateHigh: "liquid_lithium"
|
||||
};
|
||||
|
||||
elements.liquid_lithium = {
|
||||
color: ["#e8e8e8", "#f5f5f5", "#c9c9c9", "#d4d4d4"],
|
||||
behavior: behaviors.LIQUID,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
tempLow: 179.5,
|
||||
stateLow: "lithium",
|
||||
density: 511.7
|
||||
};
|
||||
|
||||
elements.lithium_hydroxide = {
|
||||
color: ["#ffffff", "#f1f1f1", "#e7e7e7", "#ededed"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
tempHigh: 180.5,
|
||||
stateHigh: "liquid_lithium",
|
||||
density: 1540,
|
||||
};
|
||||
|
||||
elements.lithium_hydride = {
|
||||
color: ["#8a8a8a", "#b5b5b5", "#bbbbbb"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 820,
|
||||
tick: function (pixel){
|
||||
var otherPixel;
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y, true)){
|
||||
var chance = Math.random()
|
||||
if(Math.random()<0.003) {
|
||||
if (chance<0.3) {
|
||||
changePixel(pixel, "lithium_hydroxide")
|
||||
}
|
||||
else if (chance>0.3 && chance<0.7) {
|
||||
changePixel(pixel, "lithium_oxide")
|
||||
}
|
||||
else {
|
||||
changePixel(pixel, "lithium_carbonate")
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isEmpty(x, y, true)) {
|
||||
otherPixel = pixelMap[x][y];
|
||||
if (otherPixel.element != "mineral_oil") {
|
||||
if (otherPixel.element != "lithium" && otherPixel.element != "dull_lithium" && otherPixel.element != "tarnished_lithium") {
|
||||
var chance = Math.random()
|
||||
if(Math.random()<0.0007) {
|
||||
if (chance<0.3) {
|
||||
changePixel(pixel, "lithium_hydroxide")
|
||||
}
|
||||
else if (chance>0.3 && chance<0.7) {
|
||||
changePixel(pixel, "lithium_oxide")
|
||||
}
|
||||
else {
|
||||
changePixel(pixel, "lithium_carbonate")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
elements.lithium_oxide = {
|
||||
color: ["#ffffff", "#ececec", "#dbdbdb"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 2013,
|
||||
reactions: {
|
||||
"water": {elem1: "lithium_hydroxide", elem2: "pop", chance: 0.2},
|
||||
"carbon_dioxide": {elem1: "lithium_carbonate", elem2: null}
|
||||
}
|
||||
};
|
||||
|
||||
elements.lithium_carbonate = {
|
||||
color: ["#ffffff", "#e0e0e0", "#c9c8c8"],
|
||||
behavior: behaviors.POWDER,
|
||||
hidden: true,
|
||||
state: "solid",
|
||||
density: 2110
|
||||
};
|
||||
|
||||
elements.mineral_oil = {
|
||||
color: ["#cdf6fa", "#e6fdff", "#bff9ff", "#f5feff"],
|
||||
behavior: behaviors.LIQUID,
|
||||
state: "liquid",
|
||||
category: "liquids",
|
||||
density: 870,
|
||||
};
|
||||
|
|
@ -3,12 +3,14 @@ Created by SquareScreamYT/sqec <@918475812884344852>
|
|||
Thanks to RealerRaddler <@914371295561535508>, Alice <@697799964985786450>, nousernamefound <@316383921346707468>, Adora the Transfem <@778753696804765696>, ryan(R74n) <@101070932608561152> and Fioushemastor <@738828785482203189> for helping :)
|
||||
Compatibility with plants.js coming soon
|
||||
Works well with community_desserts.js
|
||||
Beta testing at aChefsDream_beta.js or SquareScreamYT/aChefsDream.js on github
|
||||
|
||||
v1.13
|
||||
v1.13.7
|
||||
|
||||
you can support me at my youtube: https://youtube.com/@sqec
|
||||
|
||||
Upcoming Features:
|
||||
- pudding/cream
|
||||
- extract tool
|
||||
- cinnamon
|
||||
- spring onions
|
||||
|
|
@ -21,7 +23,6 @@ Upcoming Features:
|
|||
- stainless steel
|
||||
- pepper plants
|
||||
- hot chocolate
|
||||
- cows and beef
|
||||
- celery
|
||||
- kiwis
|
||||
- guavas
|
||||
|
|
@ -31,7 +32,9 @@ Upcoming Features:
|
|||
- dates
|
||||
- figs
|
||||
- avocados
|
||||
- apricots and plums
|
||||
- apricots and almonds (roasted)
|
||||
- hazelnuts
|
||||
- plums
|
||||
- curry/chicken tikka masala
|
||||
- raisins
|
||||
- peaches
|
||||
|
|
@ -41,9 +44,13 @@ Upcoming Features:
|
|||
- squids
|
||||
- tofu
|
||||
- miso
|
||||
- juice reaction with milk makes average color
|
||||
- juice reaction with other juices
|
||||
- jackfruit
|
||||
- fruit soda (any juice + co2 or seltzer)
|
||||
- rambutan
|
||||
- shrimp/prawn meat
|
||||
- sheep, goats, mutton, wool/fabric, filter
|
||||
- filter (like in nousersthing.js)
|
||||
|
||||
Changelog (v1.0)
|
||||
- added chickens
|
||||
|
|
@ -441,6 +448,25 @@ Changelog (v1.13)
|
|||
|
||||
|
||||
|
||||
Changelog (v1.13.5)
|
||||
- added hard jelly
|
||||
- soda can mix colors
|
||||
- added soda jelly
|
||||
- added fanta (orange juice + carbon dioxide)
|
||||
|
||||
|
||||
|
||||
|
||||
Changelog (v1.13.7)
|
||||
- rename nut to peanut
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -483,25 +509,28 @@ elements.knife = {
|
|||
if(cutInto instanceof Array) { cutInto = cutInto[Math.floor(Math.random() * cutInto.length)] };
|
||||
//change pixel into the (chosen) element
|
||||
//changePixel(pixel, cutInto)
|
||||
|
||||
//var cutIntoEmit = elements[pixel.element].cutIntoEmit;
|
||||
//if (!cutIntoEmit) { return };
|
||||
//if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] };
|
||||
//var thiselement = pixel.element;
|
||||
if (shiftDown) {
|
||||
if (Math.random() < 0.5) {
|
||||
changePixel(pixel, cutInto)
|
||||
//if (elements[thiselement].cutIntoEmit && Math.random() < 0.5 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
// createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
//}
|
||||
var cutIntoEmit = elements[pixel.element].cutIntoEmit;
|
||||
if (!cutIntoEmit) { return };
|
||||
if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] };
|
||||
var thiselement = pixel.element;
|
||||
if (elements[thiselement].cutIntoEmit && Math.random() < 0.7 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!shiftDown) {
|
||||
if (Math.random() < 0.1) {
|
||||
changePixel(pixel, cutInto)
|
||||
//if (elements[thiselement].cutIntoEmit && Math.random() < 0.5 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
// createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
//}
|
||||
var cutIntoEmit = elements[pixel.element].cutIntoEmit;
|
||||
if (!cutIntoEmit) { return };
|
||||
if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] };
|
||||
var thiselement = pixel.element;
|
||||
if (elements[thiselement].cutIntoEmit && Math.random() < 0.4 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -5268,7 +5297,7 @@ elements.onion = {
|
|||
density: 1050,
|
||||
cutInto: "cut_onion",
|
||||
breakInto:"onion_powder",
|
||||
//cutIntoEmit: "stench",
|
||||
cutIntoEmit: "stench",
|
||||
}
|
||||
elements.cut_onion = {
|
||||
color: "#dcc5ed",
|
||||
|
|
@ -7756,3 +7785,62 @@ elements.raw_beef = {
|
|||
"fire": {elem1: "barbecued_beef"}
|
||||
}
|
||||
};
|
||||
|
||||
elements.juice.reactions.milk = { elem1:"fruit_milk", elem2:null, chance:0.05, func: function(pixel1, pixel2){
|
||||
let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.25);
|
||||
pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}}
|
||||
elements.juice.reactions.cream = { elem1:"fruit_milk", elem2:null, chance:0.05, func: function(pixel1, pixel2){
|
||||
let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.25);
|
||||
pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}}
|
||||
elements.soda.reactions.soda = {
|
||||
func: function(pixel1, pixel2){
|
||||
if(pixel1.color != pixel2.color){
|
||||
if(Math.floor(Math.random() * 1000) == 1){
|
||||
let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.5);
|
||||
pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.juice.reactions.soda = {
|
||||
chance:70,
|
||||
func: function(pixel1, pixel2){
|
||||
if(pixel1.color != pixel2.color){
|
||||
if(Math.floor(Math.random() * 1000) == 1){
|
||||
let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.5);
|
||||
changePixel(pixelMap[pixel1.x][pixel1.y],"soda")
|
||||
pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!elements.orange_juice.reactions) { elements.orange_juice.reactions = {} }
|
||||
elements.orange_juice.reactions.seltzer = { elem1:"soda", elem2:"foam", color1:"#ffb319"}
|
||||
elements.orange_juice.reactions.carbon_dioxide = { elem1:"soda", elem2:"foam", color1:"#ffb319"}
|
||||
elements.agar.reactions.soda = { elem1:"jelly", elem2:null, chance:0.05, func: function(pixel1, pixel2){
|
||||
let newrgb = interpolateRgb(getRGB('rgb(250,250,250)'), getRGB(pixel2.color), 0.7);
|
||||
pixel1.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}}
|
||||
elements.hard_jelly = {
|
||||
color: "#c372b8",
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
tempHigh: 200,
|
||||
stateHigh: ["smoke","sugar"],
|
||||
category: "food",
|
||||
state: "solid",
|
||||
density: 1245,
|
||||
isFood: true,
|
||||
hidden: true,
|
||||
temp: 0
|
||||
}
|
||||
elements.jelly.stateLow = "hard_jelly"
|
||||
elements.jelly.stateLowColorMultiplier = 1.2
|
||||
elements.jelly.temp = 0
|
||||
|
||||
elements.nut.name = "peanut";
|
||||
elements.nut_meat.name = "peanut_meat";
|
||||
elements.nut_butter.name = "peanut_butter";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
// created by SquareScreamYT
|
||||
// please visit the repo to see the code
|
||||
|
||||
fetch('https://raw.githubusercontent.com/SquareScreamYT/aChefsDream.js/main/aChefsDream.js')
|
||||
.then(response => response.text())
|
||||
.then(code => {
|
||||
eval(code);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching or executing code:', error);
|
||||
alert("There was an error loading aChefsDream beta. Please reload or check your internet. If not, please try again or use the stable one at aChefsDream.js.")
|
||||
});
|
||||
4123
mods/chem.js
4123
mods/chem.js
File diff suppressed because it is too large
Load Diff
|
|
@ -20,7 +20,6 @@ function whenAvailable(names, callback) {
|
|||
}
|
||||
}, interval);
|
||||
}
|
||||
var runAfterAutogenMod = "mods/runAfterAutogen2.js";
|
||||
|
||||
function getName(elementList)
|
||||
{
|
||||
|
|
@ -274,11 +273,14 @@ function mixture(elementList)
|
|||
reactions: {},
|
||||
};
|
||||
|
||||
elementCount++;
|
||||
elements[name].hidden = true;
|
||||
hiddenCount++;
|
||||
elements[name].id = nextid++;
|
||||
document.getElementById("extraInfo").innerHTML = "<small><p>There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.</p><p>©2021-" + new Date().getFullYear() + ". All Rights Reserved. <a href='https://r74n.com'>R74n</a></p></small>"; //update extra info counts (and the copyright year, due to the method used)
|
||||
if(typeof elementCount !== 'undefined')
|
||||
{
|
||||
elementCount++;
|
||||
elements[name].hidden = true;
|
||||
hiddenCount++;
|
||||
elements[name].id = nextid++;
|
||||
document.getElementById("extraInfo").innerHTML = "<small><p>There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.</p><p>©2021-" + new Date().getFullYear() + ". All Rights Reserved. <a href='https://r74n.com'>R74n</a></p></small>"; //update extra info counts (and the copyright year, due to the method used)
|
||||
}
|
||||
}
|
||||
else if(!elements[name].mixture)
|
||||
{
|
||||
|
|
@ -498,15 +500,11 @@ function isValidMixture(elementList)
|
|||
return true;
|
||||
}
|
||||
|
||||
if(enabledMods.includes(runAfterAutogenMod)){
|
||||
whenAvailable(["runAfterAutogen"], function() {
|
||||
runAfterAutogen(function() {
|
||||
mixture2(["water","blood"]);
|
||||
mixture2(["water","cough_drugs","cellulose_gum","carbon_dioxide","sugar","milk"]);
|
||||
|
||||
});
|
||||
runAfterAutogen(function() {
|
||||
mixture2(["water","blood"]);
|
||||
mixture2(["water","cough_drugs","cellulose_gum","carbon_dioxide","sugar","milk"]);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
predefinedColors = [
|
||||
|
|
|
|||
|
|
@ -0,0 +1,440 @@
|
|||
function getName(elementList)
|
||||
{
|
||||
if(elementList.filter(function(item, pos, self) {
|
||||
return self.indexOf(item) == pos;
|
||||
}).length == 1)
|
||||
{
|
||||
return elementList[0];
|
||||
}
|
||||
let name = elementList.join("_") + "_mixture";
|
||||
if(nameList[name])
|
||||
{
|
||||
name = nameList[name];
|
||||
};
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
function makeColors(elementList)
|
||||
{
|
||||
return elementList.map((c) => elements[c].color instanceof Array ? elements[c].color : [elements[c].color]);
|
||||
}
|
||||
|
||||
function mixture(elementList)
|
||||
{
|
||||
elementList.sort();
|
||||
|
||||
let name = getName(elementList);
|
||||
|
||||
if(!elements[name])
|
||||
{
|
||||
elements[name] = true;
|
||||
let minTempHigh = Infinity;
|
||||
let stateHigh = null;
|
||||
let indexStateHigh = -1;
|
||||
|
||||
let maxTempLow = -Infinity;
|
||||
let stateLow = null;
|
||||
let indexStateLow = -1;
|
||||
|
||||
|
||||
for(let i = 0; i < elementList.length; i++)
|
||||
{
|
||||
if(elements[elementList[i]])
|
||||
{
|
||||
if(typeof elements[elementList[i]].tempHigh === "number" && elements[elementList[i]].stateHigh)
|
||||
{
|
||||
if(elements[elementList[i]].tempHigh < minTempHigh)
|
||||
{
|
||||
minTempHigh = elements[elementList[i]].tempHigh;
|
||||
indexStateHigh = i;
|
||||
stateHigh = elements[elementList[i]].stateHigh;
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof elements[elementList[i]].tempLow === "number" && elements[elementList[i]].stateLow)
|
||||
{
|
||||
if(elements[elementList[i]].tempLow > maxTempLow)
|
||||
{
|
||||
maxTempLow = elements[elementList[i]].tempLow;
|
||||
indexStateLow = i;
|
||||
stateLow = elements[elementList[i]].stateLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let elementList2 = elementList.slice();
|
||||
let elementHigh = null;
|
||||
if(indexStateHigh >= 0)
|
||||
{
|
||||
if(stateHigh instanceof Array)
|
||||
{
|
||||
elementHigh = [];
|
||||
for(let i = 0; i < stateHigh.length; i++)
|
||||
{
|
||||
elementList2[indexStateHigh] = stateHigh[i];
|
||||
elementHigh.push(mixture(elementList2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList2[indexStateHigh] = stateHigh;
|
||||
elementHigh = mixture(elementList2);
|
||||
}
|
||||
}
|
||||
|
||||
let elementList3 = elementList.slice();
|
||||
let elementLow = null;
|
||||
if(indexStateLow >= 0)
|
||||
{
|
||||
if(stateLow instanceof Array)
|
||||
{
|
||||
elementLow = [];
|
||||
for(let i = 0; i < stateLow.length; i++)
|
||||
{
|
||||
elementList3[indexStateLow] = stateLow[i];
|
||||
elementLow.push(mixture(elementList3));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList3[indexStateLow] = stateLow;
|
||||
elementLow = mixture(elementList3);
|
||||
}
|
||||
}
|
||||
|
||||
if(elementHigh instanceof Array && elementHigh.length === 0)
|
||||
{
|
||||
minTempHigh = Infinity;
|
||||
elementHigh = null;
|
||||
}
|
||||
if(elementLow instanceof Array && elementLow.length === 0)
|
||||
{
|
||||
maxTempLow = -Infinity;
|
||||
elementLow = null;
|
||||
}
|
||||
|
||||
let colors = makeColors(elementList.slice());
|
||||
let colors2 = [];
|
||||
let maxLength = Math.max(...(colors.map((c) => c.length)));
|
||||
|
||||
for(let i = 0; i < maxLength; i++)
|
||||
{
|
||||
let colors3 = [];
|
||||
for(let j = 0; j < colors.length; j++)
|
||||
{
|
||||
colors3.push(toObject(colors[j][i%colors[j].length]));
|
||||
}
|
||||
colors2.push(averageRGB(colors3));
|
||||
}
|
||||
let temp = airTemp;
|
||||
if(maxTempLow < airTemp && minTempHigh > airTemp)
|
||||
{
|
||||
|
||||
}
|
||||
else if(maxTempLow > -Infinity && minTempHigh < Infinity)
|
||||
{
|
||||
temp = (maxTempLow + minTempHigh)/2;
|
||||
}
|
||||
else if(maxTempLow > -Infinity)
|
||||
{
|
||||
temp = maxTempLow+20;
|
||||
}
|
||||
else if(minTempHigh < Infinity)
|
||||
{
|
||||
temp = Math.max(minTempHigh-20,absoluteZero);
|
||||
}
|
||||
|
||||
|
||||
let movable = elementList.some((c) => elements[c].movable || elements[c].movable === undefined);
|
||||
|
||||
let density = elementList.map((c) => elements[c].density ? elements[c].density : 0).reduce((a,b)=>a+b)/elementList.length;
|
||||
let stain = elementList.map((c) => elements[c].stain ? elements[c].stain : 0).reduce((a,b)=>a+b)/elementList.length;
|
||||
|
||||
let states = elementList.map((c) => elements[c].state);
|
||||
if(states.includes("gas"))
|
||||
{
|
||||
state = "gas";
|
||||
density = 0;
|
||||
}
|
||||
else if(!movable)
|
||||
{
|
||||
state = "solid";
|
||||
}
|
||||
else if(states.includes("liquid"))
|
||||
{
|
||||
state = "liquid";
|
||||
}
|
||||
else
|
||||
{
|
||||
state = "solid";
|
||||
}
|
||||
|
||||
elements[name] = {
|
||||
color: colors2.length == 1 ? colors2[0] : colors2,
|
||||
colorObject: colors2.length == 1 ? toObject(colors2[0]) :colors2.map((c) => toObject(c)),
|
||||
tick: function(pixel) {
|
||||
mixtureBehavior(pixel, elementList);
|
||||
},
|
||||
tempHigh: minTempHigh,
|
||||
stateHigh: elementHigh,
|
||||
tempLow: maxTempLow,
|
||||
stateLow: elementLow,
|
||||
temp: temp,
|
||||
category: "mixture",
|
||||
mixture: elementList,
|
||||
movable: movable,
|
||||
density: density,
|
||||
state: state,
|
||||
stain: stain,
|
||||
reactions: {},
|
||||
isGas: state === "gas"
|
||||
};
|
||||
|
||||
for(let i in elements)
|
||||
{
|
||||
for(let j = 0; j < elementList.length; j++)
|
||||
{
|
||||
if(elements[i].reactions && elements[i].reactions[elementList[j]] !== undefined)
|
||||
{
|
||||
if(name === i)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
elements[i].reactions[name] = {elem2: name, func: function(a,b){mixtureReact(b,a,elementList)}}
|
||||
}
|
||||
if(elements[elementList[j]].reactions && elements[elementList[j]].reactions[i] !== undefined)
|
||||
{
|
||||
if(name === i)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
elements[name].reactions[i] = {elem2: i, func: function(a,b){mixtureReact(a,b,elementList)}}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(typeof elementCount !== 'undefined')
|
||||
{
|
||||
elementCount++;
|
||||
elements[name].hidden = true;
|
||||
elements[name].id = nextid++;
|
||||
if (elements[name].hidden && (!settings["unhide"] || ( settings["unhide"]===2 && !settings.unlocked[name] ))) { hiddenCount++; }
|
||||
else
|
||||
{
|
||||
var categoryDiv = document.getElementById("category-mixture");
|
||||
if (categoryDiv == null) {
|
||||
createCategoryDiv("mixture");
|
||||
}
|
||||
createElementButton(name);
|
||||
}
|
||||
document.getElementById("extraInfo").innerHTML = "<small><p>There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.</p><p>©2021-" + new Date().getFullYear() + ". All Rights Reserved. <a href='https://r74n.com'>R74n</a></p></small>"; //update extra info counts (and the copyright year, due to the method used)
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
function mixtureBehavior(pixel, elementList)
|
||||
{
|
||||
let prevCol = pixel.color;
|
||||
let previous = pixel.element;
|
||||
let elem = elementList[Math.floor(Math.random()*elementList.length)];
|
||||
if (elements[elem].tick) { // Run tick function if it exists
|
||||
elements[elem].tick(pixel);
|
||||
}
|
||||
|
||||
if (pixel.del) {return}
|
||||
|
||||
if (elements[elem].behavior) { // Parse behavior if it exists
|
||||
pixelTick(pixel,elements[elem].behavior);
|
||||
}
|
||||
if(pixel.element === previous)
|
||||
{
|
||||
pixel.color = prevCol;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mixtureReact(pixel, pixel2, elementList)
|
||||
{
|
||||
elementList = elementList.slice();
|
||||
shuffleArray(elementList);
|
||||
let previous = pixel.element;
|
||||
let prevCol = pixel.color;
|
||||
let previous2 = pixel2.element;
|
||||
let prevCol2 = pixel2.color;
|
||||
for(let i = 0; i < elementList.length; i++)
|
||||
{
|
||||
let elem = elementList[i];
|
||||
if(pixel.del)
|
||||
{
|
||||
return;
|
||||
}
|
||||
changePixel(pixel,elem, false);
|
||||
let rr1 = false;
|
||||
if (elements[elem].reactions !== undefined && elements[elem].reactions[pixel2.element] !== undefined) {
|
||||
rr1 = reactPixels(pixel,pixel2);
|
||||
}
|
||||
if (!rr1 && elements[pixel2.element].reactions !== undefined && elements[pixel2.element].reactions[elem] !== undefined && !elements[pixel2.element].reactions[elem].oneway) {
|
||||
reactPixels(pixel2,pixel);
|
||||
}
|
||||
if(pixel2.element === previous2)
|
||||
{
|
||||
pixel2.color = prevCol2;
|
||||
}
|
||||
if(!pixel.del && pixel.element === elem)
|
||||
{
|
||||
}
|
||||
else if(pixel.del)
|
||||
{
|
||||
elementList.splice(elementList.indexOf(elem),1);
|
||||
createPixel(mixture(elementList),pixel.x,pixel.y);
|
||||
currentPixels[currentPixels.length-1].temp = pixel.temp;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList.splice(elementList.indexOf(elem),1)
|
||||
changePixel(pixel, mixture(elementList.concat([pixel.element])), false);
|
||||
return;
|
||||
}
|
||||
if(pixel2.del)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
changePixel(pixel, previous, false);
|
||||
pixel.color = prevCol;
|
||||
}
|
||||
|
||||
nameList = [];
|
||||
|
||||
function toObject(color)
|
||||
{
|
||||
color = color.match(/\d+/g);
|
||||
return {
|
||||
r: parseInt(color[0]),
|
||||
g: parseInt(color[1]),
|
||||
b: parseInt(color[2])
|
||||
};
|
||||
}
|
||||
|
||||
function averageRGB2(colors)
|
||||
{
|
||||
return toObject(averageRGB(colors.map((d) => (toObject(d)))));
|
||||
}
|
||||
|
||||
function averageRGB(rgblist) {
|
||||
var r = 0;
|
||||
var g = 0;
|
||||
var b = 0;
|
||||
for (var i = 0; i < rgblist.length; i++) {
|
||||
var rgb = rgblist[i];
|
||||
r += parseInt(rgb.r);
|
||||
g += parseInt(rgb.g);
|
||||
b += parseInt(rgb.b);
|
||||
}
|
||||
r = Math.floor(r/rgblist.length);
|
||||
g = Math.floor(g/rgblist.length);
|
||||
b = Math.floor(b/rgblist.length);
|
||||
return "rgb("+r+","+g+","+b+")";
|
||||
}
|
||||
|
||||
|
||||
function blendColors(colorA, colorB, amount = 0.5) {
|
||||
const [rA, gA, bA] = colorA.match(/\w\w/g).map((c) => parseInt(c, 16));
|
||||
const [rB, gB, bB] = colorB.match(/\w\w/g).map((c) => parseInt(c, 16));
|
||||
const r = Math.round(rA + (rB - rA) * amount).toString(16).padStart(2, '0');
|
||||
const g = Math.round(gA + (gB - gA) * amount).toString(16).padStart(2, '0');
|
||||
const b = Math.round(bA + (bB - bA) * amount).toString(16).padStart(2, '0');
|
||||
return '#' + r + g + b;
|
||||
}
|
||||
|
||||
changePixel = function (pixel,element,changetemp=true) {
|
||||
if (!elements[element]) {
|
||||
pixel.invalidElement = element;
|
||||
element = "unknown"
|
||||
}
|
||||
if(pixel.element !== element)
|
||||
{
|
||||
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
|
||||
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;
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
checkUnlock(element);
|
||||
}
|
||||
|
||||
|
||||
elements.mixer = {
|
||||
color: "#999999",
|
||||
ignore: ["mixer"],
|
||||
category:"machines",
|
||||
insulate:true,
|
||||
hardness: 1,
|
||||
tick: function(pixel) {
|
||||
if (!isEmpty(pixel.x-1,pixel.y,true) && !isEmpty(pixel.x+1,pixel.y,true) && isEmpty(pixel.x,pixel.y+1,false))
|
||||
{
|
||||
if(elements.mixer.ignore.includes(pixelMap[pixel.x-1][pixel.y].element) || elements.mixer.ignore.includes(pixelMap[pixel.x+1][pixel.y].element))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
createPixel(mixture([pixelMap[pixel.x-1][pixel.y].element,pixelMap[pixel.x+1][pixel.y].element]),pixel.x,pixel.y+1);
|
||||
deletePixel(pixel.x-1,pixel.y);
|
||||
deletePixel(pixel.x+1,pixel.y);
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
maxSize: 1
|
||||
};
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
// Gallium is the best element
|
||||
behaviors.RADSOLID = [
|
||||
"XX|CR:radiation%1|XX",
|
||||
"CR:radiation%1|XX|CR:radiation%1",
|
||||
"XX|CR:radiation%1|XX"
|
||||
]
|
||||
elements.caesium = {
|
||||
color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"],
|
||||
behavior: behaviors.WALL,
|
||||
|
|
@ -24,6 +29,7 @@ elements.molten_caesium = {
|
|||
state: "liquid",
|
||||
tempLow: 27.44,
|
||||
stateLow: "caesium",
|
||||
hidden: true,
|
||||
tempHigh: 671,
|
||||
stateHigh: "caesium_vapor",
|
||||
density: 1842,
|
||||
|
|
@ -44,10 +50,165 @@ elements.caesium_vapor = {
|
|||
category: "states",
|
||||
state: "gas",
|
||||
tempLow: 660,
|
||||
hidden: true,
|
||||
stateLow: "molten_caesium",
|
||||
density: 1.7,
|
||||
temp: 700
|
||||
}
|
||||
elements.caesium_137 = {
|
||||
color: ["#917921", "#ebcb59", "#a48b2d", "#d6b84c"],
|
||||
behavior: behaviors.RADSOLID,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
tempHigh: 28.44,
|
||||
stateHigh: "molten_caesium_137",
|
||||
density: 1873,
|
||||
conduct: 0.90,
|
||||
reactions: {
|
||||
"water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"sugar_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"dirty_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"pool_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"salt_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"seltzer": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
},
|
||||
tick: function(pixel){
|
||||
if (Math.random()<0.0002){
|
||||
changePixel(pixel, "barium", false)
|
||||
if (Math.random() >= 0.946){
|
||||
pixelMap[pixel.x][pixel.y].excited = true
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("electric", x, y)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
elements.molten_caesium_137 = {
|
||||
color: ["#735c0a", "#a68e37", "#7e6715", "#9b832e"],
|
||||
behavior: behaviors.RADLIQUID,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
tempLow: 27.44,
|
||||
stateLow: "caesium_137",
|
||||
tempHigh: 671,
|
||||
hidden: true,
|
||||
stateHigh: "caesium_vapor_137",
|
||||
density: 1842,
|
||||
temp: 29,
|
||||
conduct: 0.90,
|
||||
reactions: {
|
||||
"water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"sugar_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"dirty_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"pool_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"salt_water": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
"seltzer": { "elem1":"pop", "elem2":"hydrogen" },
|
||||
},
|
||||
tick: function(pixel){
|
||||
if (Math.random()<0.0002){
|
||||
changePixel(pixel, "barium", false)
|
||||
if (Math.random() >= 0.946){
|
||||
pixelMap[pixel.x][pixel.y].excited = true
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("electric", x, y)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
elements.caesium_137_vapor = {
|
||||
color: ["#d89e77", "#cd9064", "#af6f34", "#a26320"],
|
||||
behavior: behaviors.RADSOLID,
|
||||
category: "states",
|
||||
state: "gas",
|
||||
tempLow: 660,
|
||||
stateLow: "molten_caesium_137",
|
||||
density: 1.7,
|
||||
temp: 700,
|
||||
hidden: true,
|
||||
tick: function(pixel){
|
||||
behaviors.GAS(pixel)
|
||||
if (Math.random()<0.0002){
|
||||
changePixel(pixel, "barium", false)
|
||||
if (Math.random() >= 0.946){
|
||||
pixelMap[pixel.x][pixel.y].excited = true
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("electric", x, y)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.barium = {
|
||||
color: ["#191f19", "#2c332c", "#3f483f", "#545e54", "#6a756a"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
reactions: elements.caesium.reactions,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
tempHigh: 730,
|
||||
stateHigh: "molten_barium",
|
||||
density: 3594,
|
||||
tick: function(pixel){
|
||||
if(pixel.excited && Math.random() < 0.005){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("laser", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 120
|
||||
delete pixel.excited
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.molten_barium = {
|
||||
color: ["#c26d24", "#cf8225", "#da9727", "#e4ad2b", "#ecc432"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
reactions: elements.caesium.reactions,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
tempLow: 728,
|
||||
hidden: true,
|
||||
stateLow: "barium",
|
||||
density: 3338,
|
||||
tick: function(pixel){
|
||||
if(pixel.excited && Math.random() < 0.005){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (isEmpty(x, y)){
|
||||
createPixel("laser", x, y)
|
||||
pixelMap[x][y].temp = pixel.temp + 120
|
||||
delete pixel.excited
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.subzero_grass_seed = {
|
||||
color: ["#022c14", "#032911", "#032205", "#021f00"],
|
||||
behavior: [
|
||||
|
|
@ -97,7 +258,7 @@ elements.acid_gas.ignore.push("ruthenium"),
|
|||
elements.acid_gas.ignore.push("molten_ruthenium")
|
||||
elements.technetium = {
|
||||
color: ["#e7d9bb", "#bab195", "#8f8a70", "#66654e"],
|
||||
behavior: behaviors.WALL,
|
||||
behavior: behaviors.RADSOLID,
|
||||
tick: function(pixel){
|
||||
if(Math.random() < 0.0007){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
|
|
@ -121,7 +282,7 @@ elements.technetium = {
|
|||
},
|
||||
elements.molten_technetium = {
|
||||
color: ["#d16b42", "#da904c", "#dfb360", "#e2d57f"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
behavior: behaviors.RADMOLTEN,
|
||||
tick: function(pixel){
|
||||
if(Math.random() < 0.0007){
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
|
|
@ -1485,6 +1646,7 @@ elements.plutonium = {
|
|||
}
|
||||
}
|
||||
}
|
||||
behaviors.RADSOLID
|
||||
},
|
||||
reactions: {
|
||||
"neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 },
|
||||
|
|
@ -1493,7 +1655,7 @@ elements.plutonium = {
|
|||
}
|
||||
elements.molten_plutonium = {
|
||||
color: ["#6b5133", "#743f26", "#7c2727"],
|
||||
behavior: behaviors.LIQUID,
|
||||
behavior: behaviors.RADMOLTEN,
|
||||
category: "states",
|
||||
state: "liquid",
|
||||
tempLow: 620,
|
||||
|
|
@ -2445,6 +2607,9 @@ elements.scuffed_circle_brush = {
|
|||
createPixel(circleElem, thisx, thisy)
|
||||
}
|
||||
}
|
||||
function randomIntFromInterval(min, max) { // min and max included
|
||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||
}
|
||||
elements.spacedust_cola = {
|
||||
color: ["#090033", "#0a0027", "#0a001b", "#0b000f"],
|
||||
behavior: elements.soda.behavior,
|
||||
|
|
|
|||
|
|
@ -231,6 +231,23 @@ drawPixels = function(forceTick=false) {
|
|||
if (ctx.globalAlpha < 1) {
|
||||
ctx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
if (elements[currentElement].maxSize < mouseSize) {
|
||||
var mouseOffset = Math.trunc(elements[currentElement].maxSize/2);
|
||||
}
|
||||
else {
|
||||
var mouseOffset = Math.trunc(mouseSize/2);
|
||||
}
|
||||
var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset];
|
||||
var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset];
|
||||
// Draw a square around the mouse
|
||||
ctx.strokeStyle = "white";
|
||||
ctx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize);
|
||||
// draw one transparent pixel in the center
|
||||
if (settings.precision) {
|
||||
ctx.fillStyle = "rgba(255,255,255,0.5)";
|
||||
ctx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize);
|
||||
}
|
||||
if ((!paused) || forceTick) {pixelTicks++};
|
||||
}
|
||||
|
||||
|
|
|
|||
144
mods/weapons.js
144
mods/weapons.js
|
|
@ -76,6 +76,9 @@ elements.left_missile = {
|
|||
"M2|EX:10|XX",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.right_missile = {
|
||||
color: "#4c4e42",
|
||||
|
|
@ -85,6 +88,9 @@ elements.right_missile = {
|
|||
"XX|EX:10|M2",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.up_missile = {
|
||||
color: "#4c4e42",
|
||||
|
|
@ -94,7 +100,9 @@ elements.up_missile = {
|
|||
"XX|EX:10|XX",
|
||||
],
|
||||
category:"ammunition",
|
||||
alias: "the element that some guy try to add to my mod without my permission but when doing so fucked the behavior grid up",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.cluster_munition = {
|
||||
color: "#444444",
|
||||
|
|
@ -160,6 +168,9 @@ elements.left_bullet = {
|
|||
"M2|XX|XX",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.right_bullet = {
|
||||
color: "#4c4e42",
|
||||
|
|
@ -169,6 +180,9 @@ elements.left_bullet = {
|
|||
"XX|XX|M2",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.e_gun_left = {
|
||||
color: "#C0C0C0",
|
||||
|
|
@ -226,6 +240,9 @@ elements.left_rocket = {
|
|||
"XX|XX|XX",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.right_rocket = {
|
||||
color: "#4c4e42",
|
||||
|
|
@ -235,6 +252,9 @@ elements.left_rocket = {
|
|||
"XX|XX|XX",
|
||||
],
|
||||
category:"ammunition",
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.e_rocket_launcher_left = {
|
||||
color: "#C0C0C0",
|
||||
|
|
@ -529,6 +549,9 @@ elements.bombs_for_throwing_at_you_left = {
|
|||
"XX|XX|XX",
|
||||
"M1|M1%10 AND EX:10>bomb|XX",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
}
|
||||
elements.machine_for_throwing_bombs_at_right = {
|
||||
color: "#524c41",
|
||||
|
|
@ -549,6 +572,9 @@ elements.bombs_for_throwing_at_you_right = {
|
|||
"XX|XX|XX",
|
||||
"XX|M1%10 AND EX:10>bomb|M1",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.energized_orb_left = {
|
||||
color: ["#e0e000","#f3f300"],
|
||||
|
|
@ -592,4 +618,120 @@ elements.fast_bomb = {
|
|||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.liquid_bomb = {
|
||||
color: "#524c41",
|
||||
tick: function(pixel) {
|
||||
if (pixel.start === pixelTicks) {return}
|
||||
if (pixel.charge && elements[pixel.element].behaviorOn) {
|
||||
pixelTick(pixel)
|
||||
}
|
||||
if (elements[pixel.element].viscosity && (!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) {
|
||||
var move1Spots = [
|
||||
[pixel.x, pixel.y+1]
|
||||
]
|
||||
}
|
||||
else {
|
||||
var move1Spots = [
|
||||
[pixel.x+1, pixel.y+1],
|
||||
[pixel.x, pixel.y+1],
|
||||
[pixel.x-1, pixel.y+1],
|
||||
]
|
||||
}
|
||||
var moved = false;
|
||||
for (var i = 0; i < move1Spots.length; i++) {
|
||||
var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)];
|
||||
if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; }
|
||||
else { move1Spots.splice(move1Spots.indexOf(coords), 1); }
|
||||
}
|
||||
if (!moved) {
|
||||
if (elements[pixel.element].viscosity===undefined || !(!((Math.random()*100) < 100 / Math.pow(elements[pixel.element].viscosity, 0.25)))) {
|
||||
if (Math.random() < 0.5) {
|
||||
if (!tryMove(pixel, pixel.x+1, pixel.y)) {
|
||||
tryMove(pixel, pixel.x-1, pixel.y);
|
||||
}
|
||||
} else {
|
||||
if (!tryMove(pixel, pixel.x-1, pixel.y)) {
|
||||
tryMove(pixel, pixel.x+1, pixel.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
category: "weapons",
|
||||
state: "liquid",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|EX:10>explosion|XX",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
ignore: "gas_bomb",
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
elements.gas_bomb = {
|
||||
color: "#524c41",
|
||||
tick: function(pixel) {
|
||||
if (pixel.start === pixelTicks) {return}
|
||||
if (pixel.charge && elements[pixel.element].behaviorOn) {
|
||||
pixelTick(pixel)
|
||||
}
|
||||
var move1Spots = [
|
||||
[pixel.x, pixel.y+1],
|
||||
[pixel.x, pixel.y-1],
|
||||
[pixel.x+1, pixel.y],
|
||||
[pixel.x-1, pixel.y],
|
||||
]
|
||||
var moved = false;
|
||||
for (var i = 0; i < move1Spots.length; i++) {
|
||||
var coords = move1Spots[Math.floor(Math.random()*move1Spots.length)];
|
||||
if (tryMove(pixel, coords[0], coords[1])) { moved = true; break; }
|
||||
else { move1Spots.splice(move1Spots.indexOf(coords), 1);}
|
||||
}
|
||||
if (!moved) {
|
||||
var move2Spots = [
|
||||
[pixel.x+1, pixel.y+1],
|
||||
[pixel.x-1, pixel.y+1],
|
||||
[pixel.x+1, pixel.y-1],
|
||||
[pixel.x-1, pixel.y-1],
|
||||
]
|
||||
for (var i = 0; i < move2Spots.length; i++) {
|
||||
var coords = move2Spots[Math.floor(Math.random()*move2Spots.length)];
|
||||
if (tryMove(pixel, coords[0], coords[1])) { break; }
|
||||
else { move2Spots.splice(move2Spots.indexOf(coords), 1); }
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
category: "weapons",
|
||||
state: "gas",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|EX:10>explosion|XX",
|
||||
],
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
ignore: "liquid_bomb",
|
||||
cooldown: defaultCooldown
|
||||
}
|
||||
elements.tank_left = {
|
||||
color: "#bcc6cc",
|
||||
category: "vehicles",
|
||||
behavior: [
|
||||
"M2 AND CR:fast_bullet_left|XX|XX",
|
||||
"M1|XX|XX",
|
||||
"M1|M1|XX",
|
||||
],
|
||||
},
|
||||
elements.tank_right = {
|
||||
color: "#bcc6cc",
|
||||
category: "vehicles",
|
||||
behavior: [
|
||||
"XX|XX|M2 AND CR:fast_bullet_right",
|
||||
"XX|XX|M1",
|
||||
"XX|M1|M1",
|
||||
],
|
||||
}
|
||||
Loading…
Reference in New Issue