diff --git a/mods/Science_mod.js b/mods/Science_mod.js index 0b14d1a3..1519b005 100644 --- a/mods/Science_mod.js +++ b/mods/Science_mod.js @@ -1,6 +1,6 @@ // Science mod for Sandboxels // (Inspired by survival.js) -// Build 11 +// Build 13 // 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: @@ -1086,52 +1086,275 @@ 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 +} + +// Doing more later (let's hope my phone is charged in the morning :skull:) diff --git a/mods/UAMM.js b/mods/UAMM.js index bb229509..bf134799 100644 --- a/mods/UAMM.js +++ b/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, +}; \ No newline at end of file diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 4ea7fd55..86789235 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -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,