From 45bf67c0a4be6db58afaae51f3a20bd3cabfac96 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 15 Feb 2022 11:50:22 -0500 Subject: [PATCH 01/18] another test amogus pretty angelic mogus the game :eggTF: --- mods/randomness_but_tick.js | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index 9a674f9c..ea958ef0 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -1226,6 +1226,52 @@ elements.ionized_polka_dotted_powder = { tempLow: 8000, stateLow: "vaporized_polka_dotted_powder", hidden: true, +}, + +function log(b, n) { + return Math.log(n) / Math.log(b); +} + +elements.hdet = { + name: "heat- dependent explosion text", + color: "#33aa44", + behavior: behaviors.POWDER, + tick: function(pixel) { + if(pixel.charge > 0) { + var temp = pixel.temp + if(temp < 0) { + temp = 0 + } + if(temp >= 0 && temp < 1) { + temp = 1 + } + if(temp > 56000) { + temp = 56000 + } + if(isNaN(temp) || isNaN(pixel.temp)) { + temp = 20 + pixel.temp = 20 + } + var r = ((Math.sqrt(log(20,temp))*(temp**0.5))/(6000**0.126284318))/2 + explodeAt(pixel.x,pixel.y,Math.floor(r)) + if(temp > 200) { + if(Math.random() < log(56000,temp)**9) { + pixel.charge = 1 + if(pixel.chargeCD) { + delete pixel.chargeCD + } + } + } + if(isNaN(temp) || isNaN(pixel.temp)) { + temp = 20 + pixel.temp = 20 + } + } + }, + density: 1200, + conduct: 0.5, + state: "solid", + category: "special" } runAfterLoad(function() { From 90bcd8b60e991d0c9b74e83e795683377b2f0286 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:57:43 -0500 Subject: [PATCH 02/18] made up some hardnesses --- mods/metals.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/mods/metals.js b/mods/metals.js index 422f4118..bfef7a80 100644 --- a/mods/metals.js +++ b/mods/metals.js @@ -1,3 +1,12 @@ +elements.iron.hardness = 0.74 +//https://www.engineeringtoolbox.com/bhn-brinell-hardness-number-d_1365.html +//https://en.wikipedia.org/wiki/Hardnesses_of_the_elements_(data_page) +//"Annealed chissel steel" hardness and then divided by iron hardness (Brinell) +//sqrt()ed like IACS-derived conductivities and scaled to the 0.8 hardness of steel +//and because 1 means infinite hardness, the others are derived using +//1-(0.26/(otherThingBHN/200)) +//it doesn't matter much anyway but I'd like to have some semblance/veneer of accuracy + //Copper exists elements.ruthenium = { @@ -7,6 +16,7 @@ elements.ruthenium = { category: "solids", density: 12450, conduct: 0.45, + hardness: 0.97593, }, elements.molten_ruthenium = { @@ -20,6 +30,7 @@ elements.rhodium = { category: "solids", density: 12410, conduct: 0.59, + hardness: 0.94694, }, elements.molten_rhodium = { @@ -33,6 +44,7 @@ elements.palladium = { category: "solids", density: 12023, conduct: 0.38, + hardness: 0.82667, }, elements.molten_palladium = { @@ -48,6 +60,7 @@ elements.rhenium = { category: "solids", density: 21020, conduct: 0.29, + hardness: 0.96061, }, elements.molten_rhenium = { @@ -61,6 +74,7 @@ elements.osmium = { category: "solids", density: 22590, conduct: 0.40, + hardness: 0.98673, }, elements.molten_osmium = { @@ -74,6 +88,7 @@ elements.iridium = { category: "solids", density: 22560, conduct: 0.54, + hardness: 0.96886, }, elements.molten_iridium = { @@ -87,6 +102,7 @@ elements.platinum = { category: "solids", density: 21450, conduct: 0.38, + hardness: 0.83226, }, elements.molten_platinum = { @@ -104,7 +120,8 @@ elements.mercury = { stateLow: "frozen_mercury", category: "liquids", density: 13534, - conduct: 0.13 + conduct: 0.13, + breakInto: "mercury_gas", }, elements.frozen_mercury = { @@ -117,6 +134,7 @@ elements.frozen_mercury = { stateHigh: "mercury", category: "solids", hidden: true, + hardness: 0.2775, //(desperately scaled Mohs hardness) }, elements.mercury_gas = { //hg d@bp extrapolated from density change with temperature: 12743 @@ -130,4 +148,4 @@ elements.mercury_gas = { //hg d@bp extrapolated from density change with tempera stateLow: "mercury", category: "gases", hidden: true, -} \ No newline at end of file +} From 24ca5ef90dee43231ba70edaf43e635e5931c3b3 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:01:09 -0500 Subject: [PATCH 03/18] made generated spouts indestructible --- mods/spouts.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/spouts.js b/mods/spouts.js index 4e890049..2974b30b 100644 --- a/mods/spouts.js +++ b/mods/spouts.js @@ -12,6 +12,7 @@ runAfterLoad(function() { ], category: "spouts", temp: elements[liquidArray[i]].temp, + hardness: 1, }; }; liquidArray.push("ketchup") From 4fc9d15d7bba9fdf5f1398ae244344c1ea4a0725 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:05:21 -0500 Subject: [PATCH 04/18] removed use of randomly unreachable function --- mods/randomness_but_tick.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index ea958ef0..55bbbe13 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -1228,10 +1228,6 @@ elements.ionized_polka_dotted_powder = { hidden: true, }, -function log(b, n) { - return Math.log(n) / Math.log(b); -} - elements.hdet = { name: "heat- dependent explosion text", color: "#33aa44", @@ -1252,10 +1248,10 @@ elements.hdet = { temp = 20 pixel.temp = 20 } - var r = ((Math.sqrt(log(20,temp))*(temp**0.5))/(6000**0.126284318))/2 + var r = ((Math.sqrt((Math.log(temp)/Math.log(20)))*(temp**0.5))/(6000**0.126284318))/2 explodeAt(pixel.x,pixel.y,Math.floor(r)) if(temp > 200) { - if(Math.random() < log(56000,temp)**9) { + if(Math.random() < (Math.log(temp)/Math.log(56000))**9) { pixel.charge = 1 if(pixel.chargeCD) { delete pixel.chargeCD From f69121ab404acf73846e2507bded1766246161a8 Mon Sep 17 00:00:00 2001 From: StellarX20 <97905447+StellarX20@users.noreply.github.com> Date: Tue, 15 Feb 2022 19:32:36 -0500 Subject: [PATCH 05/18] Added platinum --- mods/Neutronium Mod.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/Neutronium Mod.js b/mods/Neutronium Mod.js index 4b50d87e..ccf8078e 100644 --- a/mods/Neutronium Mod.js +++ b/mods/Neutronium Mod.js @@ -1088,6 +1088,14 @@ behavior: [ ], density: 1050, }; +elements.platinum = { +color: ["#cfdfe3", "#cfdfe3", "#f7f7f7", "#cfdfe3"], +category: "solids", +state: "solid", +behavior: behaviors.WALL, +tempHigh: 1768, +conduct: 1, +}; /* Unfinished: magnesium hematite mixture From bd595d6d5aa0028ad2ffac1e3d39b0bf420db73b Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Wed, 16 Feb 2022 07:39:56 -0500 Subject: [PATCH 06/18] metal mod compat --- mods/more_breaking.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mods/more_breaking.js b/mods/more_breaking.js index 549b9d61..0239a1dd 100644 --- a/mods/more_breaking.js +++ b/mods/more_breaking.js @@ -66,11 +66,9 @@ elements.oxidized_copper_scrap = { elements.copper.breakInto = ["copper_scrap","copper_scrap","copper_scrap","copper_scrap","copper_scrap","oxidized_copper_scrap"] -elements.gold.breakInto = "gold_coin" - elements.dry_ice.breakInto = "carbon_dioxide" -regularMetalArray = ["iron", "zinc", "tin", "nickel", "silver", "aluminum", "lead", "tungsten", "brass", "bronze", "sterling", "steel", "rose_gold", "solder"] +regularMetalArray = ["iron", "zinc", "tin", "nickel", "silver", "aluminum", "lead", "tungsten", "brass", "bronze", "sterling", "steel", "rose_gold", "solder", "gold"] if(enabledMods.includes("mods/Neutronium Mod.js")) { regularMetalArray.push("mythril") @@ -78,6 +76,17 @@ if(enabledMods.includes("mods/Neutronium Mod.js")) { regularMetalArray.push("titanium") regularMetalArray.push("ilitium") } +if(enabledMods.includes("mods/metals.js")) { + regularMetalArray.push("ruthenium") + regularMetalArray.push("rhodium") + regularMetalArray.push("palladium") + regularMetalArray.push("rhenium") + regularMetalArray.push("osmium") + regularMetalArray.push("iridium") + regularMetalArray.push("platinum") + regularMetalArray.push("frozen_mercury") + elements.mercury.breakInto = "mercury_gas" +} if(enabledMods.includes("mods/ketchup_mod.js")) { regularMetalArray.push("ketchup_metal") From 547187877dc935911ce01a02a8618c813dd80be8 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Wed, 16 Feb 2022 13:35:47 -0500 Subject: [PATCH 07/18] amogus --- mods/randomness_but_tick.js | 118 ++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index 55bbbe13..21efb412 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -1268,6 +1268,124 @@ elements.hdet = { conduct: 0.5, state: "solid", category: "special" +}, + +function randInt(max) { + return Math.floor(Math.random() * (max + 1)) +} + +function randIntR(min,max) { + return Math.floor(Math.random() * (max - min + 1)) + min +} + +elements.test293 = { + color: "#f0e7e0", + behavior: [ + "XX|SA%40 AND ST|XX", + "M2%10 AND SA%40 AND ST|XX|M2%10 AND SA%40 AND ST", + "M2 AND M1%10|M1 AND SA%40 AND ST|M2 AND M1%10" + ], + category: "weapons", + state: "solid", + density: 2222.22, + tick: function(pixel) { + if(pixel.burning) { + if(pixel.burning == true) { + if(isEmpty(pixel.x,pixel.y-1)) { + if(Math.random() < 0.04) { createPixel("fire",pixel.x,pixel.y-1) } + if(Math.random() < 0.04) { pixel.temp++ } + } + if(isEmpty(pixel.x,pixel.y+1)) { + if(Math.random() < 0.04) { createPixel("fire",pixel.x,pixel.y+1) } + if(Math.random() < 0.04) { pixel.temp++ } + } + if(isEmpty(pixel.x-1,pixel.y)) { + if(Math.random() < 0.04) { createPixel("fire",pixel.x-1,pixel.y) } + if(Math.random() < 0.04) { pixel.temp++ } + } + if(isEmpty(pixel.x+1,pixel.y)) { + if(Math.random() < 0.04) { createPixel("fire",pixel.x+1,pixel.y) } + if(Math.random() < 0.04) { pixel.temp++ } + } + if(Math.random() < 0.0001) { explodeAt(pixel.x,pixel.y,randIntR(7,10),("fire,fire,fire,fire,smoke,"+pixel.element+","+pixel.element)) } + } + } + doHeat(pixel); + }, + burn: 300, + burnTime: 500, +}, + +elements.test293b = { + color: "#e0e7f0", + behavior: [ + "XX|SA%40 AND ST|XX", + "M2%10 AND SA%40 AND ST|XX|M2%10 AND SA%40 AND ST", + "M2 AND M1%10|M1 AND SA%40 AND ST|M2 AND M1%10" + ], + category: "weapons", + state: "solid", + density: 2222.22, + tick: function(pixel) { + for(i = -1; i < 2; i++) { + for(j = -1; j < 2; j++) { + if(!isEmpty(pixel.x + i, pixel.y + j) && !outOfBounds(pixel.x + i, pixel.y + j)) { + if(pixelMap[pixel.x + i][pixel.y + j].element == "cold_fire" && !pixel.burning) { + pixel.burning = true + pixel.burnStart = pixelTicks + } + } + } + } + if(pixel.burning) { + if(pixel.burning == true) { + for(i = -1; i < 2; i++) { + for(j = -1; j < 2; j++) { + if(!isEmpty(pixel.x + i, pixel.y + j) && !outOfBounds(pixel.x + i, pixel.y + j)) { + if(pixelMap[pixel.x + i][pixel.y + j].element == "fire") { + deletePixel(pixel.x + i, pixel.y + j) + createPixel("cold_fire", pixel.x + i,pixel.y + j) + } + pixelMap[pixel.x + i][pixel.y + j].temp -= randIntR(1,2) + } + } + } + if(isEmpty(pixel.x,pixel.y-1)) { + if(Math.random() < 0.04) { createPixel("cold_fire",pixel.x,pixel.y-1) } + if(Math.random() < 0.04) { pixel.temp-- } + } + if(isEmpty(pixel.x,pixel.y+1)) { + if(Math.random() < 0.04) { createPixel("cold_fire",pixel.x,pixel.y+1) } + if(Math.random() < 0.04) { pixel.temp-- } + } + if(isEmpty(pixel.x-1,pixel.y)) { + if(Math.random() < 0.04) { createPixel("cold_fire",pixel.x-1,pixel.y) } + if(Math.random() < 0.04) { pixel.temp-- } + } + if(isEmpty(pixel.x+1,pixel.y)) { + if(Math.random() < 0.04) { createPixel("cold_fire",pixel.x+1,pixel.y) } + if(Math.random() < 0.04) { pixel.temp-- } + } + if(Math.random() < 0.0001) { + var amogus = randIntR(8,11) + var amog1 = (Math.ceil(amogus/2))*-1 + var amog2 = (Math.ceil(amogus/2))+1 + explodeAt(pixel.x,pixel.y,amogus,("cold_fire,cold_fire,cold_fire,cold_fire,cold_fire,"+pixel.element+","+pixel.element)) + for(i = amog1; i < amog2; i++) { + for(j = amog1; j < amog2; j++) { + if(!isEmpty(pixel.x + i, pixel.y + j) && !outOfBounds(pixel.x + i, pixel.y + j)) { + pixelMap[pixel.x + i][pixel.y + j].temp -= randIntR(160,240) + } + } + } + } + } + } + doHeat(pixel); + }, + burn: 300, + burnTime: 500, + burnInto: "cold_fire", } runAfterLoad(function() { From f601305af0af1f10c301c8d088fd8740aa94557c Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Thu, 17 Feb 2022 11:40:21 -0500 Subject: [PATCH 08/18] shut up about mercury --- mods/more_breaking.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/more_breaking.js b/mods/more_breaking.js index 0239a1dd..e69c4db0 100644 --- a/mods/more_breaking.js +++ b/mods/more_breaking.js @@ -77,6 +77,8 @@ if(enabledMods.includes("mods/Neutronium Mod.js")) { regularMetalArray.push("ilitium") } if(enabledMods.includes("mods/metals.js")) { + regularMetalArray.push("beryllium") + regularMetalArray.push("boron") regularMetalArray.push("ruthenium") regularMetalArray.push("rhodium") regularMetalArray.push("palladium") @@ -85,7 +87,9 @@ if(enabledMods.includes("mods/metals.js")) { regularMetalArray.push("iridium") regularMetalArray.push("platinum") regularMetalArray.push("frozen_mercury") - elements.mercury.breakInto = "mercury_gas" + if(elements.mercury) { + elements.mercury.breakInto = "mercury_gas" + } } if(enabledMods.includes("mods/ketchup_mod.js")) { From 7f8e5a67f9cfe74e49696147ac4d582254f3300d Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Thu, 17 Feb 2022 14:02:15 -0500 Subject: [PATCH 09/18] npt element mod --- mods/laetium.js | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 mods/laetium.js diff --git a/mods/laetium.js b/mods/laetium.js new file mode 100644 index 00000000..7ee35dc4 --- /dev/null +++ b/mods/laetium.js @@ -0,0 +1,92 @@ +elements.laetium = { + color: "#f57f87", + tempHigh: 2950, + hardness: 0.87252, + density: 6719, + conduct: 4.7E210, + behavior: behaviors.WALL, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(elements[pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element].category) { + if(elements[pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element].category == "cum") { + pixel.temp += 5 + } + } + } + } + }, +} + +elements.molten_laetium = { + color: ['#ff9f44', '#ff7f44', '#ff5f00'], + behavior: behaviors.MOLTEN, + reactions: { + "ash": { "elem1": null, "elem2": "laetium_slag"}, + "dust": { "elem1": null, "elem2": "laetium_slag"}, + "magma": { "elem1": null, "elem2": "laetium_slag"}, + }, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element.category) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element.category == "cum") { + pixel.temp += 5 + } + } + } + } + }, + density: 6100, + temp: 3000, + tempLow: 2944, + stateLow: "laetium", + tempHigh: 5837, + stateHigh: "vaporized_laetium", + viscosity: 1.517, + hidden: true, + state: "liquid", + category: "molten", +} + +elements.vaporized_laetium = { + color: ['#efdf54', '#efbf54', '#efaf10'], + behavior: behaviors.GAS, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element.category) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element.category == "cum") { + pixel.temp += 5 + } + } + } + } + }, + density: 49, + temp: 6000, + tempLow: 5837, + stateLow: "molten_laetium", + viscosity: 0.1, + hidden: true, + state: "gas", + category: "gases", +} + +function splitRgbColor(color) { + var colorTempArray = color.split(",") + var r = colorTempArray[0].split(",")[0].substring(4) + var g = colorTempArray[1] + var b = colorTempArray[2].slice(0,-1) + return [r,g,b] +} + +runAfterLoad(function() { + elements.laetium_slag = JSON.parse(JSON.stringify(elements.slag)) + elements.laetium_slag.color = ['#a05c5a', '#af6967', '#b06d6d', '#ae6b6c', '#b67a7a'] + elements.laetium_slag.tempHigh = 2950 + elements.laetium_slag.stateHigh = ["molten_slag","molten_laetium"] +}); \ No newline at end of file From ea543dcb1827cedf07b79bf1e3554203c256d105 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Thu, 17 Feb 2022 14:02:53 -0500 Subject: [PATCH 10/18] mod that adds one NPT element fixed misleading commit summary --- mods/laetium.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/laetium.js b/mods/laetium.js index 7ee35dc4..6d69d9a5 100644 --- a/mods/laetium.js +++ b/mods/laetium.js @@ -89,4 +89,6 @@ runAfterLoad(function() { elements.laetium_slag.color = ['#a05c5a', '#af6967', '#b06d6d', '#ae6b6c', '#b67a7a'] elements.laetium_slag.tempHigh = 2950 elements.laetium_slag.stateHigh = ["molten_slag","molten_laetium"] -}); \ No newline at end of file +}); + +//dummy edit From f51f2eee6d0133f0337e773be54b6190cd99d31f Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:13:40 -0500 Subject: [PATCH 11/18] added atisanium --- mods/laetium.js | 135 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 127 insertions(+), 8 deletions(-) diff --git a/mods/laetium.js b/mods/laetium.js index 6d69d9a5..a8e8f095 100644 --- a/mods/laetium.js +++ b/mods/laetium.js @@ -1,3 +1,15 @@ +function splitRgbColor(color) { + var colorTempArray = color.split(",") + var r = colorTempArray[0].split(",")[0].substring(4) + var g = colorTempArray[1] + var b = colorTempArray[2].slice(0,-1) + return [r,g,b] +} + +function randomArrayChoice(array) { + return array[Math.floor(Math.random() * array.length)] +} + elements.laetium = { color: "#f57f87", tempHigh: 2950, @@ -5,6 +17,8 @@ elements.laetium = { density: 6719, conduct: 4.7E210, behavior: behaviors.WALL, + state: "solid", + category: "solids", tick: function(pixel) { neighbors = [[-1,0],[0,-1],[1,0],[0,1]] for(i = 0; i < neighbors.length; i++) { @@ -76,12 +90,119 @@ elements.vaporized_laetium = { category: "gases", } -function splitRgbColor(color) { - var colorTempArray = color.split(",") - var r = colorTempArray[0].split(",")[0].substring(4) - var g = colorTempArray[1] - var b = colorTempArray[2].slice(0,-1) - return [r,g,b] +elements.atisanium = { + color: "#8dadb8", + conduct: 0.87, + colorOn: ["#ff00ff", "#e600e6", "#a300cc", "#ce07e8"], + tempLow: -44, + stateLow: "liquid_atisanium", + density: 1.225, + behavior: [ + "M1|M1|M1", + "M1|XX|M1", + "M1|M1|M1", + ], + state: "gas", + category: "gases", + tick: function(pixel) { + var neighbors = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]] + var neighborChoice = randomArrayChoice(neighbors) + if(isEmpty(neighborChoice[0],pixel.y+neighborChoice[1],true)) { + tryMove(pixel,pixel.x+neighborChoice[0],pixel.y+neighborChoice[1]) + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } + }, +} + +elements.liquid_atisanium = { + color: "#3f878a", + conduct: 0.96, + colorOn: ["#8307eb", "#8c00ff", "#9617ff", "#a02eff"], + tempHigh: -45, + stateHigh: "atisanium", + tempLow: -214, + stateLow: "alpha_atisanium", + temp: -100, + density: 15941, + behavior: behaviors.LIQUID, + state: "liquid", + category: "liquids", + tick: function(pixel) { + var moveSpotsA = [[-1,1],[0,1],[1,1]] + var moveSpotsB = [[-1,0],[1,0]] + var msaChoice = randomArrayChoice(moveSpotsA) + var msbChoice = randomArrayChoice(moveSpotsB) + if(isEmpty(msaChoice[0],pixel.y+msaChoice[1],true)) { + if(!tryMove(pixel,pixel.x+msaChoice[0],pixel.y+msaChoice[1])) { + tryMove(pixel,pixel.x+msbChoice[0],pixel.y+msbChoice[1]) + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 1) { + if(Math.random() < 0.2) { + pixel.chargeCD = 1 + } + } + } + }, +} + +elements.alpha_atisanium = { + color: "#00382a", + conduct: 0.987, + colorOn: ["#3700ff", "#6820f7", "#4b15bf"], + tempHigh: -213, + stateHigh: "liquid_atisanium", + tempLow: -261, + stateLow: "beta_atisanium", + temp: -240, + density: 51295, + behavior: behaviors.WALL, + state: "solid", + category: "solid", + tick: function(pixel) { + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 1) { + if(Math.random() < 0.4) { + pixel.chargeCD = 1 + } + } + } + }, +} + +elements.beta_atisanium = { + color: "#750e35", + conduct: Infinity, //This is where I would make it a superconductor. + colorOn: ["#0f0021", "#120324", "#4b106e", "#a6058e", "#42043a"], //pretend this is UV + tempHigh: -260, + stateHigh: "alpha_atisanium", + temp: -270, + density: 111295, + behavior: behaviors.WALL, + state: "solid", + category: "solid", + tick: function(pixel) { + if(pixel.chargeCD) { + if(pixel.chargeCD > 3) { + pixel.chargeCD = 3 + } + } + }, } runAfterLoad(function() { @@ -90,5 +211,3 @@ runAfterLoad(function() { elements.laetium_slag.tempHigh = 2950 elements.laetium_slag.stateHigh = ["molten_slag","molten_laetium"] }); - -//dummy edit From d8efeb0cc95ee5da6800ee7b327bb4ed9b16e288 Mon Sep 17 00:00:00 2001 From: StellarX20 <97905447+StellarX20@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:33:16 -0500 Subject: [PATCH 12/18] Added Uranium-238, Uranium-235, and Uranium-233 --- mods/Neutronium Mod.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/mods/Neutronium Mod.js b/mods/Neutronium Mod.js index ccf8078e..d946248d 100644 --- a/mods/Neutronium Mod.js +++ b/mods/Neutronium Mod.js @@ -1096,6 +1096,44 @@ behavior: behaviors.WALL, tempHigh: 1768, conduct: 1, }; +elements.uranium233 = { +name: "Uranium-233", +color: "#95a395", +category: "powders", +state: "solid", +behavior: behaviors.RADIOACTIVE_POWDER, +tempHigh: 1132, +stateHigh: "molten_uranium233", +density: 19, +}; +elements.uranium235 = { +name: "Uranium-235", +color: "#7a997a", +category: "powders", +state: "solid", +behavior: [ +"XX|XX|XX", +"XX|DL%0.02|XX", +"XX|XX|XX", +], +tempHigh: 1132.2, +stateHigh: "molten_uranium235", +density: 19.1, +}; +elements.uranium238 = { +name: "Uranium-238", +color: "#4a754a", +category: "powders", +state: "solid", +behavior: [ +"XX|XX|XX", +"XX|DL%0.01 AND CH:uranium235%0.05|XX", +"M2|M1|M2", +], +tempHigh: 1131, +stateHigh: "molten_uranium238", +density: 20, +}; /* Unfinished: magnesium hematite mixture From 3cc961d530bcad9f429b61d950bbc6026d654306 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 07:47:53 -0500 Subject: [PATCH 13/18] fixed categorization of solid atisanium phases --- mods/laetium.js | 124 ++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/mods/laetium.js b/mods/laetium.js index a8e8f095..54c1eb14 100644 --- a/mods/laetium.js +++ b/mods/laetium.js @@ -17,8 +17,8 @@ elements.laetium = { density: 6719, conduct: 4.7E210, behavior: behaviors.WALL, - state: "solid", - category: "solids", + state: "solid", + category: "solids", tick: function(pixel) { neighbors = [[-1,0],[0,-1],[1,0],[0,1]] for(i = 0; i < neighbors.length; i++) { @@ -98,23 +98,23 @@ elements.atisanium = { stateLow: "liquid_atisanium", density: 1.225, behavior: [ - "M1|M1|M1", - "M1|XX|M1", - "M1|M1|M1", - ], - state: "gas", - category: "gases", + "M1|M1|M1", + "M1|XX|M1", + "M1|M1|M1", + ], + state: "gas", + category: "gases", tick: function(pixel) { var neighbors = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]] - var neighborChoice = randomArrayChoice(neighbors) - if(isEmpty(neighborChoice[0],pixel.y+neighborChoice[1],true)) { - tryMove(pixel,pixel.x+neighborChoice[0],pixel.y+neighborChoice[1]) - } - if(pixel.chargeCD) { - if(pixel.chargeCD > 2) { - pixel.chargeCD = 2 - } - } + var neighborChoice = randomArrayChoice(neighbors) + if(isEmpty(neighborChoice[0],pixel.y+neighborChoice[1],true)) { + tryMove(pixel,pixel.x+neighborChoice[0],pixel.y+neighborChoice[1]) + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } }, } @@ -126,33 +126,33 @@ elements.liquid_atisanium = { stateHigh: "atisanium", tempLow: -214, stateLow: "alpha_atisanium", - temp: -100, + temp: -100, density: 15941, behavior: behaviors.LIQUID, - state: "liquid", - category: "liquids", + state: "liquid", + category: "liquids", tick: function(pixel) { var moveSpotsA = [[-1,1],[0,1],[1,1]] var moveSpotsB = [[-1,0],[1,0]] - var msaChoice = randomArrayChoice(moveSpotsA) - var msbChoice = randomArrayChoice(moveSpotsB) - if(isEmpty(msaChoice[0],pixel.y+msaChoice[1],true)) { - if(!tryMove(pixel,pixel.x+msaChoice[0],pixel.y+msaChoice[1])) { - tryMove(pixel,pixel.x+msbChoice[0],pixel.y+msbChoice[1]) - } - } - if(pixel.chargeCD) { - if(pixel.chargeCD > 2) { - pixel.chargeCD = 2 - } - } - if(pixel.chargeCD) { - if(pixel.chargeCD > 1) { - if(Math.random() < 0.2) { - pixel.chargeCD = 1 - } - } - } + var msaChoice = randomArrayChoice(moveSpotsA) + var msbChoice = randomArrayChoice(moveSpotsB) + if(isEmpty(msaChoice[0],pixel.y+msaChoice[1],true)) { + if(!tryMove(pixel,pixel.x+msaChoice[0],pixel.y+msaChoice[1])) { + tryMove(pixel,pixel.x+msbChoice[0],pixel.y+msbChoice[1]) + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 1) { + if(Math.random() < 0.2) { + pixel.chargeCD = 1 + } + } + } }, } @@ -164,24 +164,24 @@ elements.alpha_atisanium = { stateHigh: "liquid_atisanium", tempLow: -261, stateLow: "beta_atisanium", - temp: -240, + temp: -240, density: 51295, behavior: behaviors.WALL, - state: "solid", - category: "solid", + state: "solid", + category: "solids", tick: function(pixel) { - if(pixel.chargeCD) { - if(pixel.chargeCD > 2) { - pixel.chargeCD = 2 - } - } - if(pixel.chargeCD) { - if(pixel.chargeCD > 1) { - if(Math.random() < 0.4) { - pixel.chargeCD = 1 - } - } - } + if(pixel.chargeCD) { + if(pixel.chargeCD > 2) { + pixel.chargeCD = 2 + } + } + if(pixel.chargeCD) { + if(pixel.chargeCD > 1) { + if(Math.random() < 0.4) { + pixel.chargeCD = 1 + } + } + } }, } @@ -191,17 +191,17 @@ elements.beta_atisanium = { colorOn: ["#0f0021", "#120324", "#4b106e", "#a6058e", "#42043a"], //pretend this is UV tempHigh: -260, stateHigh: "alpha_atisanium", - temp: -270, + temp: -270, density: 111295, behavior: behaviors.WALL, - state: "solid", - category: "solid", + state: "solid", + category: "solids", tick: function(pixel) { - if(pixel.chargeCD) { - if(pixel.chargeCD > 3) { - pixel.chargeCD = 3 - } - } + if(pixel.chargeCD) { + if(pixel.chargeCD > 3) { + pixel.chargeCD = 3 + } + } }, } From 7b566089e6ad3eae9e0a51c30b4b1554bc966b2e Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 08:17:15 -0500 Subject: [PATCH 14/18] added polusium --- mods/laetium.js | 114 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/mods/laetium.js b/mods/laetium.js index 54c1eb14..52f2405d 100644 --- a/mods/laetium.js +++ b/mods/laetium.js @@ -188,7 +188,7 @@ elements.alpha_atisanium = { elements.beta_atisanium = { color: "#750e35", conduct: Infinity, //This is where I would make it a superconductor. - colorOn: ["#0f0021", "#120324", "#4b106e", "#a6058e", "#42043a"], //pretend this is UV + colorOn: ["#0f0021", "#120324", "#4b106e", "#a6058e", "#42043a"], //pretend this is UV becoming more pronounced tempHigh: -260, stateHigh: "alpha_atisanium", temp: -270, @@ -205,6 +205,118 @@ elements.beta_atisanium = { }, } +elements.polusium = { + color: "#dedc9e", + tempHigh: 1213, + hardness: 0.921952, + density: 4113, + conduct: 0.98, + behavior: behaviors.WALL, + state: "solid", + category: "solids", + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(Math.random() < 0.002) { + changePixel(pixel,"polusium_oxide") + } + } + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == "salt_water") { + if(Math.random() < 0.006) { + changePixel(pixel,"polusium_oxide") + } + } + } + } + }, +} + +elements.molten_polusium = { + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(Math.random() < 0.004) { + changePixel(pixel,"molten_polusium_oxide") + } + } + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == "salt_water") { + if(Math.random() < 0.024) { + changePixel(pixel,"molten_polusium_oxide") + } + } + } + } + }, + density: 3410, + temp: 1300, + tempLow: 1212, + stateLow: "polusium", + tempHigh: 3110, + stateHigh: "vaporized_polusium", + viscosity: 13, +} + +elements.vaporized_polusium = { + color: ["#fdffd1", "#edf2cb", "#fcfac7"], + behavior: behaviors.GAS, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(Math.random() < 0.015) { + changePixel(pixel,"vaporized_polusium_oxide") + } + } + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == "salt_water") { + if(Math.random() < 0.06) { + changePixel(pixel,"vaporized_polusium_oxide") + } + } + } + } + }, + density: 21, + temp: 3200, + tempLow: 3109, + stateLow: "molten_polusium", + viscosity: 0.2, + hidden: true, + state: "gas", + category: "gases", +} + +elements.polusium_oxide = { + color: "#a9b594", + tempHigh: 1300, + hardness: 0.511952, + density: 3717, + behavior: behaviors.POWDER, + state: "solid", + category: "solids", + viscosity: 13, +} + +elements.molten_polusium_oxide = { + temp: 1350, + tempHigh: 1400, + stateHigh: "vaporized_polusium_oxide", + density: 2917, +} + +elements.vaporized_polusium_oxide = { + color: "#faffc7", + temp: 1500, + tempLow: 1399, + stateLow: "molten_polusium_oxide", + density: 10, + behavior: behaviors.GAS, +} + runAfterLoad(function() { elements.laetium_slag = JSON.parse(JSON.stringify(elements.slag)) elements.laetium_slag.color = ['#a05c5a', '#af6967', '#b06d6d', '#ae6b6c', '#b67a7a'] From 187f513f868900582cba597a4538422504f5f67f Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 08:48:55 -0500 Subject: [PATCH 15/18] fast element test --- mods/randomness_but_tick.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index 21efb412..5cef1f05 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -1,3 +1,28 @@ +elements.test337 = { + color: "#7f7f7f", + conduct: 1, + viscosity: 0.000001, + colorOn: ["#cf7fff"], + density: 2000, + behavior: behaviors.POWDER, + state: "solid", + category: "solids", + tick: function(pixel) { + for(i = 0; i < 3; i++) { + var moveSpotsA = [[0,1]] + var moveSpotsB = [[-1,1],[1,1]] + var msaChoice = randomArrayChoice(moveSpotsA) + var msbChoice = randomArrayChoice(moveSpotsB) + if(isEmpty(msaChoice[0],pixel.y+msaChoice[1],true)) { + if(!tryMove(pixel,pixel.x+msaChoice[0],pixel.y+msaChoice[1])) { + tryMove(pixel,pixel.x+msbChoice[0],pixel.y+msbChoice[1]) + } + } + pixelTick(pixel) + } + }, +}, + elements.sencc = { //same element neighbor count check color: "#000000", uwu: 0, From f798ef230ba5379def1f2cf342a42b19a8e8f656 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 18:56:54 -0500 Subject: [PATCH 16/18] 9 more versions of sencc featuring more shitty ruby for print statements --- mods/randomness_but_tick.js | 258 +++++++++++++++++++++++++++++++++++- 1 file changed, 255 insertions(+), 3 deletions(-) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index 5cef1f05..99f313dc 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -2,7 +2,7 @@ elements.test337 = { color: "#7f7f7f", conduct: 1, viscosity: 0.000001, - colorOn: ["#cf7fff"], + colorOn: "#cf7fff", density: 2000, behavior: behaviors.POWDER, state: "solid", @@ -55,8 +55,8 @@ elements.sencc2 = { //same element neighbor count check uwu: 0, tick: function(pixel) { pixel.uwu = 0 - for (let i = -2; i < 3; i++) { - for (let j = -2; j < 3; j++) { + for (let i = -3; i < 4; i++) { + for (let j = -3; j < 4; j++) { if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { pixel.uwu += 1 @@ -77,6 +77,258 @@ elements.sencc2 = { //same element neighbor count check hidden: true, }, +elements.sencc3 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 3 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc4 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 4 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc5 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 5 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc6 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 6 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc7 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 7 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc8 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 8 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc9 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 9 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc10 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 10 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + +elements.sencc11 = { //same element neighbor count check + color: "#000000", + uwu: 0, + tick: function(pixel) { + pixel.uwu = 0 + var squadius = 11 + for (let i = (-1*squadius); i < (squadius+1); i++) { + for (let j = (-1*squadius); j < (squadius+1); j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)) { + if (pixelMap[pixel.x+j][pixel.y+i].element == pixel.element) { + pixel.uwu += 1 + } + } + } + } + pixel.uwu -= 1 + if(pixel.uwu == undefined || pixel.uwu == null || isNaN(pixel.uwu)) { + pixel.color = "rgb(127,127,127)" + } else { + pixel.color = "rgb(" + (255/((((squadius*2)+1)**2)-1))*pixel.uwu + ",0,0)" + } + }, + category: "machines", + insulate: true, + state: "solid", + hidden: true, +}, + elements.sencc2b = { //same element neighbor count check color: "#000000", uwu: 0, From 33799f37667afc56b79b92d3c324f1b3ae600d89 Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 19:28:37 -0500 Subject: [PATCH 17/18] copied CONV from TPT --- mods/randomness_but_tick.js | 185 +++++++++++++++++++++++++++++++++++- 1 file changed, 184 insertions(+), 1 deletion(-) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index 99f313dc..fcce5dfb 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -2,7 +2,7 @@ elements.test337 = { color: "#7f7f7f", conduct: 1, viscosity: 0.000001, - colorOn: "#cf7fff", + colorOn: ["#cf7fff"], density: 2000, behavior: behaviors.POWDER, state: "solid", @@ -620,6 +620,189 @@ elements.void_first = { hardness: 1, }, +elements.converter = { + color: "#2ec408", + tick: function(pixel) { + //store 4 touching pixels in variables if the variables don't exist + if(!outOfBounds(pixel.x,pixel.y-1) && !isEmpty(pixel.x,pixel.y-1)) { + if(!pixel.dc1 && pixelMap[pixel.x][pixel.y-1].element != pixel.element) { + pixel.dc1 = pixelMap[pixel.x][pixel.y-1].element + } + } + if(!outOfBounds(pixel.x+1,pixel.y) && !isEmpty(pixel.x+1,pixel.y)) { + if(!pixel.dc2 && pixelMap[pixel.x+1][pixel.y].element != pixel.element) { + pixel.dc2 = pixelMap[pixel.x+1][pixel.y].element + } + } + if(!outOfBounds(pixel.x,pixel.y+1) && !isEmpty(pixel.x,pixel.y+1)) { + if(!pixel.dc3 && pixelMap[pixel.x][pixel.y+1].element != pixel.element) { + pixel.dc3 = pixelMap[pixel.x][pixel.y+1].element + } + } + if(!outOfBounds(pixel.x-1,pixel.y) && !isEmpty(pixel.x-1,pixel.y)) { + if(!pixel.dc3 && pixelMap[pixel.x-1][pixel.y].element != pixel.element) { + pixel.dc4 = pixelMap[pixel.x-1][pixel.y].element + } + } + //choose from 1 + if(pixel.dc1 && !pixel.dc2 && !pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + pixel.changeTo = pixel.dc1 + } + } + if(!pixel.dc1 && pixel.dc2 && !pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + pixel.changeTo = pixel.dc2 + } + } + if(!pixel.dc1 && !pixel.dc2 && pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + pixel.changeTo = pixel.dc3 + } + } + if(!pixel.dc1 && !pixel.dc2 && !pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + pixel.changeTo = pixel.dc4 + } + } + ggg = Math.random() + hhh = Math.random() + iii = Math.random() + //choose from 2 + //1100 and 0011 + if(pixel.dc1 && pixel.dc2 && !pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc1 + } else { + pixel.changeTo = pixel.dc2 + } + } + } + if(!pixel.dc1 && !pixel.dc2 && pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc3 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //1010 and 0101 + if(pixel.dc1 && !pixel.dc2 && pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc1 + } else { + pixel.changeTo = pixel.dc3 + } + } + } + if(!pixel.dc1 && pixel.dc2 && !pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc2 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //0110 and 1001 + if(!pixel.dc1 && pixel.dc2 && pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc2 + } else { + pixel.changeTo = pixel.dc3 + } + } + } + if(pixel.dc1 && !pixel.dc2 && !pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(ggg < 1/2) { + pixel.changeTo = pixel.dc1 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //choose from 3 + //0111 + if(!pixel.dc1 && pixel.dc2 && pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(hhh < 1/3) { + pixel.changeTo = pixel.dc2 + } else if(hhh < 2/3) { + pixel.changeTo = pixel.dc3 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //1011 + if(pixel.dc1 && !pixel.dc2 && pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(hhh < 1/3) { + pixel.changeTo = pixel.dc1 + } else if(hhh < 2/3) { + pixel.changeTo = pixel.dc3 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //1101 + if(pixel.dc1 && pixel.dc2 && !pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(hhh < 1/3) { + pixel.changeTo = pixel.dc1 + } else if(hhh < 2/3) { + pixel.changeTo = pixel.dc2 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + //1110 + if(pixel.dc1 && pixel.dc2 && pixel.dc3 && !pixel.dc4) { + if(!pixel.changeTo) { + if(hhh < 1/3) { + pixel.changeTo = pixel.dc1 + } else if(hhh < 2/3) { + pixel.changeTo = pixel.dc2 + } else { + pixel.changeTo = pixel.dc3 + } + } + } + //choose from 4 + //1111 + if(pixel.dc1 && pixel.dc2 && pixel.dc3 && pixel.dc4) { + if(!pixel.changeTo) { + if(iii < 1/4) { + pixel.changeTo = pixel.dc1 + } else if(iii < 2/4) { + pixel.changeTo = pixel.dc2 + } else if(iii < 3/4) { + pixel.changeTo = pixel.dc3 + } else { + pixel.changeTo = pixel.dc4 + } + } + } + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + for(i = 0; i < neighbors.length; i++) { + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element != pixel.element) { + changePixel(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]],pixel.changeTo) + } + } + } + }, + category:"special", + hardness: 1, +}, + conveyorIgnoreList = ["conveyor_1","conveyor_2","wall"] elements.conveyor_1 = { From 98336f11b128be783579e1870620fecaf13f77fb Mon Sep 17 00:00:00 2001 From: Lily-129 <68935009+Lily-129@users.noreply.github.com> Date: Fri, 18 Feb 2022 21:15:29 -0500 Subject: [PATCH 18/18] bacteria from bacteria mod --- mods/randomness_but_tick.js | 93 +++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/mods/randomness_but_tick.js b/mods/randomness_but_tick.js index fcce5dfb..3b0f5190 100644 --- a/mods/randomness_but_tick.js +++ b/mods/randomness_but_tick.js @@ -1,3 +1,96 @@ +elements.bacteria = { + color: ["#e6d3f2", "#c098d9", "#6e318f", "#6e318f"], + behavior: behaviors.WALL, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + if(pixel.charge) { //when shocked + if(!outOfBounds(pixel.x,pixel.y+1) && !isEmpty(pixel.x,pixel.y+1)) { //check if a pixel exists below to store the element of + if(!pixel.active && !pixel.target && pixelMap[pixel.x][pixel.y+1].element != pixel.element) { //exclude self and only fire once + pixel.target = pixelMap[pixel.x][pixel.y+1].element + pixel.active = true + } else if(pixel.active || pixel.target || pixelMap[pixel.x][pixel.y+1].element == pixel.element) { + pixel.active = pixel.active + pixel.target = pixel.target + } + } + } + if(pixel.active) { + if(pixel.target) { //safety + for(i = 0; i < neighbors.length; i++) { //iterate through neighbor spots + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { //check for neighbors + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == pixel.target) { //if neighbor element is the target + changePixel(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]],pixel.element) //change neighbors to itself + pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].target = pixel.target //set new bacteria target + pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].active = true //activate new bacteria + } + } + } + } + if(Math.random() < 0.02) { //decay + if(!isEmpty(pixel.x,pixel.y)) { //check if position is empty + if(pixelMap[pixel.x][pixel.y].element == pixel.element) { //check if position is still bacteria + deletePixel(pixel.x,pixel.y) + } + } + } + } + /*if(pixel.active && pixel.target) { //debug + pixel.color = "rgb(255,0,0)" + }*/ + }, + category: "special", + state: "solid", + density: 1, + conduct: elements.water.conduct + 0.1, +}, + +elements.replacer_bacteria = { + color: ["#fcbbc0", "#f28089", "#f04f5c", "#f04f5c"], + behavior: behaviors.WALL, + tick: function(pixel) { + neighbors = [[-1,0],[0,-1],[1,0],[0,1]] + if(pixel.charge) { //when shocked + if(!outOfBounds(pixel.x,pixel.y+1) && !isEmpty(pixel.x,pixel.y+1) && !outOfBounds(pixel.x,pixel.y-1) && !isEmpty(pixel.x,pixel.y-1)) { //check if pixels exists above and below to store the elements of + if(!pixel.active && !pixel.target && !pixel.replacement && pixelMap[pixel.x][pixel.y+1].element != pixel.element) { //exclude self and only fire once + pixel.target = pixelMap[pixel.x][pixel.y+1].element + pixel.replacement = pixelMap[pixel.x][pixel.y-1].element + pixel.active = true + } else if(pixel.active || pixel.target || pixel.replacement || pixelMap[pixel.x][pixel.y+1].element == pixel.element) { + pixel.active = pixel.active + pixel.target = pixel.target + pixel.replacement = pixel.replacement + } + } + } + if(pixel.active) { + if(pixel.target && pixel.replacement) { //safety + for(i = 0; i < neighbors.length; i++) { //iterate through neighbor spots + if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) { //check for neighbors + if(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].element == pixel.target) { //if neighbor element is the target + changePixel(pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]],pixel.element) //change neighbors to itself + pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].target = pixel.target //set new bacteria target + pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].replacement = pixel.replacement //set new bacteria replacement + pixelMap[pixel.x+neighbors[i][0]][pixel.y+neighbors[i][1]].active = true //activate new bacteria + } + } + } + if(!isEmpty(pixel.x,pixel.y)) { //check if own position is empty + if(pixelMap[pixel.x][pixel.y].element == pixel.element) { //check if own position is still bacteria + changePixel(pixelMap[pixel.x][pixel.y],pixel.replacement) + } + } + } + } + /*if(pixel.active && pixel.target && pixel.replacement) { //debug + pixel.color = "rgb(0,255,0)" + }*/ + }, + category: "special", + state: "solid", + density: 1, + conduct: elements.water.conduct + 0.1, +}, + elements.test337 = { color: "#7f7f7f", conduct: 1,