From 30455c3a67f274afabe59b46a78db53adbe7f18f Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Wed, 2 Apr 2025 17:48:00 -0700 Subject: [PATCH 01/18] Update nekonicos_stuff.js --- mods/nekonicos_stuff.js | 114 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 105 insertions(+), 9 deletions(-) diff --git a/mods/nekonicos_stuff.js b/mods/nekonicos_stuff.js index 70169cd6..9f2b6824 100644 --- a/mods/nekonicos_stuff.js +++ b/mods/nekonicos_stuff.js @@ -1,3 +1,4 @@ + behaviors.SOLIDIFY = function(pixel) { pixel.solid = true } @@ -1548,12 +1549,107 @@ grabAllWeights = function(pixel){ return results } -/*elements.Cherries_Ceri_Moji = { - color: "#fcd1d7", - category: Student, - state: High_School, - behavior: [Shy, Introverted, Easily_Excited, Kind], - pronouns: [She,Her,Herself], - sexuality: [Panromantic, Asexual], - desc: "Ceri is a 16 year old high school student who loves cats" -}*/ +var modName = "mods/nekonicos_stuff.js"; +var cookieMod = "mods/cookie_clicker.js"; + +if (!enabledMods.includes(cookieMod)) { + +elements.cookie_dough = { + color: ["#bfac91","#CDBFAB",], + behavior: behaviors.STURDYPOWDER, + reactions: { + "chocolate": { elem1:"chocolate_chip_cookie_dough", elem2:null, chance: 0.5 }, + "chocolate_powder": { elem1:"chocolate_chip_cookie_dough", elem2:null, chance: 0.5 }, + }, + category: "food", + tempHigh: 74, + stateHigh: "plain_cookie", + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true +} + +elements.chocolate_chip_cookie_dough = { + color: ["#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#4d2818","#3b1b0d","#33160a"], + behavior: behaviors.STURDYPOWDER, + category: "food", + tempHigh: 74, + stateHigh: "cookie", + burn:40, + burnTime:25, + burnInto:"ash", + state: "solid", + density: 526.9, + isFood: true +} + +clicked = false +cookies = 0 +oldcookies = 0 +createdcookies = 0 + +elements.plain_cookie = { + color: ["#C4966C","#C0946B"], + behavior: behaviors.POWDER, + reactions: { + "chocolate": { elem1:"cookie", elem2:null, chance: 0.25 }, + "chocolate_powder": { elem1:"cookie", elem2:null, chance: 0.25 }, + }, + tempHigh: 192, + stateHigh: "toast", + category: "food", + burn: 10, + burnTime: 200, + burnInto: "toast", + breakInto: "crumb", + breakIntoColor: ["#c8946a","#c08655","#ba7a45","#a86d3e"], + state: "solid", + density: 233.96, + isFood: true +} + +elements.cookie = { + color: ["#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#C4966C","#C0946B","#4d2818","#3b1b0d","#33160a"], + behavior: behaviors.POWDER, + tick: function(pixel) { + var top = mousePos.y - Math.floor(mouseSize/2); + var bottom = mousePos.y + Math.floor(mouseSize/2); + var left = mousePos.x - Math.floor(mouseSize/2); + var right = mousePos.x + Math.floor(mouseSize/2); + if ((pixel.x >= left && pixel.x <= right && pixel.y >= top && pixel.y <= bottom) && mouseIsDown === true && clicked === false) { + clicked = true + cookies += 1 + } + else if ((pixel.x >= left && pixel.x <= right && pixel.y >= top && pixel.y <= bottom) && mouseIsDown !== true && clicked === true) { + clicked = false + } + doDefaults(pixel); + }, + tempHigh: 95, + stateHigh: ["melted_chocolate","plain_cookie","plain_cookie"], + category: "food", + burn: 10, + burnTime: 200, + burnInto: ["melted_chocolate","plain_cookie","plain_cookie"], + breakInto: ["crumb","crumb","crumb","crumb","crumb","chocolate","chocolate_powder"], + breakIntoColor: ["#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#bfac91","#CDBFAB","#4d2818","#3b1b0d","#33160a"], + state: "solid", + density: 233.96, + isFood: true, + renderer: function(pixel,ctx) { + if (!viewInfo[view].effects) { return } + if (isEmpty(pixel.x,pixel.y+1) || !outOfBounds(pixel.x,pixel.y+1) || pixelMap[pixel.x][pixel.y+1].element === "pipe") { + drawPlus(ctx,"#C4966C",pixel.x,pixel.y,undefined,2) + } + drawDefault(ctx,pixel) + } +} + +elements.dough.reactions.sugar = { elem1:"cookie_dough", elem2: null, chance:0.5} +elements.dough.reactions.chocolate = { elem1:"chocolate_chip_cookie_dough", elem2: null, chance:0.5} +elements.dough.reactions.chocolate_powder = { elem1:"chocolate_chip_cookie_dough", elem2: null, chance:0.5} + +} From da3c02fb647461b4d39f1e6152af427d09efca66 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:55:46 -0400 Subject: [PATCH 02/18] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dfa4a21d..66e6eeaa 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Sandboxels -A falling sand simulation game. +A falling sand simulation game with hundreds of elements, heat simulation, chemical reactions, fire, density, electricity, and more. -Play at [Sandboxels.R74n.com](https://sandboxels.r74n.com/). +Play for free at [Sandboxels.R74n.com](https://sandboxels.r74n.com/). Join the [Discord server](https://discord.com/invite/ejUc6YPQuS). -![Landscape made in Sandboxels](https://raw.githubusercontent.com/R74nCom/sandboxels/main/icons/wallpaper.png) +![Landscape made in Sandboxels](https://raw.githubusercontent.com/R74nCom/sandboxels/main/icons/cover-3840x1240px-text.png) # Controls * Left Click = Draw pixels @@ -29,7 +29,7 @@ Join the [Discord server](https://discord.com/invite/ejUc6YPQuS). # Button Info * Pause = Pause/play the simulation - * Step = Run a single frame + * Step (>) = Run a single frame * Minus (-) = Decrease the cursor size * Plus (+) = Increase the cursor size * Reset = Clears the entire simulation @@ -37,5 +37,6 @@ Join the [Discord server](https://discord.com/invite/ejUc6YPQuS). * E = Select any element by name * TPS = Change how fast the simulation runs * Info = Open the element info screen + * Saves = Open the Save & Load menu * Mods = Open the Mod Manager * Settings = Open the settings menu From e10fd4ecbf4f4efd095e00ebd637b6616452e359 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:56:14 -0400 Subject: [PATCH 03/18] Update controls.txt --- controls.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controls.txt b/controls.txt index 827321c0..92a80ba9 100644 --- a/controls.txt +++ b/controls.txt @@ -56,5 +56,6 @@ Replace = Override existing pixels when placing E = Select any element by name TPS = Change how fast the simulation runs Info = Open the element info screen +Saves = Open the Save & Load menu Mods = Open the Mod Manager -Settings = Open the Settings Menu \ No newline at end of file +Settings = Open the Settings Menu From 9e28d2f00263ff253d07eb7f086b35e7daf31e82 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:56:33 -0400 Subject: [PATCH 04/18] Update controls.html --- controls.html | 1 + 1 file changed, 1 insertion(+) diff --git a/controls.html b/controls.html index 6b8fbf4f..26714878 100644 --- a/controls.html +++ b/controls.html @@ -128,6 +128,7 @@ E Select any element by name TPS Change how fast the simulation runs (Default 30tps) Info Open the element info screen + Saves Open the Save & Load menu Mods Open the Mod Manager Settings Open the Settings Menu From 5737a00238ed8abe3340c8676598e0b498904cbd Mon Sep 17 00:00:00 2001 From: Phi Date: Thu, 1 May 2025 17:29:41 +0100 Subject: [PATCH 05/18] 2.10.20 - The Ironheart Update 2 Makes Ironheart Radioactive and fixes some things --- mods/mars.js | 63 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/mods/mars.js b/mods/mars.js index cd33c235..22d17f11 100644 --- a/mods/mars.js +++ b/mods/mars.js @@ -1,4 +1,3 @@ - elements.mars_gunk = { color: "#121212", behavior: behaviors.DGAS, @@ -29,8 +28,8 @@ elements.mars_basalt = { state: "solid", density: 5000, extraInfo: "Woah", - tempHigh: "molten_mars", - stateHigh: "600", + tempHigh: "700", + stateHigh: "molten_mars", hardness: 0.7, breakInto: ["mars_dust", "mars_rock", "mars_rock", "mars_rock", "molten_mars", "mars_debris", "mars_debris", "gunk", "mars_rock_wall"] } @@ -113,7 +112,11 @@ elements.mars_ironheart_ore = { } elements.mars_ironheart = { color: ["#e8e8e8", "#bd1102"], - behavior: behaviors.STURDYPOWDER, + behavior: [ + "XX|CR:radiation%3|XX", + "XX|XX|XX", + "XX|XX|XX", + ], category: "mars", state: "solid", density: 1500, @@ -155,10 +158,10 @@ elements.nosmoker = { breakInto: ["ironheart", "mars_ironheart", "ironheart_ore", "antigunk"] } elements.ironheart = { - color: "#e9825a", + color: "#FF6B5A", behavior: [ - "XX|XX|XX|", - "XX|XX|XX|", + "XX|CR:radiation%2|XX|", + "XX|CH:feynmanium%0.1|XX|", "M2|M1|M2|", ], category: "mars", @@ -166,6 +169,40 @@ elements.ironheart = { state: "solid", stateHigh: "molten_mars", extraInfo: "Very Sturdy.", + stateLow: "depleted_ironheart", + tempLow: -50, + tempHigh: 1500, + reactions: { + "electric": { elem1: "smint", elem2: "null" }, + }, +} +elements.depleted_ironheart = { + color: "#e9825a", + behavior: [ + "XX|XX|XX|", + "XX|XX|XX|", + "M2|M1|M2|", + ], + category: "mars", + density: 1200, + state: "solid", + stateHigh: "molten_mars", + reactions: { + "electric": { elem1: "smint", elem2: "null" }, + }, +} +elements.feynmanium = { + color: "#8C7656", + behavior: [ + "XX|XX|XX|", + "XX|XX|XX|", + "M2|M1|M2|", + ], + category: "mars", + density: 1200, + state: "solid", + stateHigh: "molten_mars", + tempHigh: 6000, reactions: { "electric": { elem1: "smint", elem2: "null" }, }, @@ -190,7 +227,7 @@ elements.red_gold_powder = { } elements.red_gold = { color: ["#D20103", "#E4080A", "#EFC3CA"], - behavior: behaviors.POWDER, + behavior: behaviors.WALL, category: "mars", state: "solid", density: 1350, @@ -240,7 +277,7 @@ elements.mars_coal = { stateHigh: "molten_mars", temp: 10, reactions: { - "electric": { elem2: "useless", chance: 0.01 }, + "electric": { elem2: "smint", chance: 0.01 }, } } elements.mars_ice = { @@ -354,7 +391,8 @@ elements.ironheart_core = { conduct: 1, extraInfo: "wha" } -// 2.9.17.1 + +// 2.10.20 // most elements done :D // iron heart ore // iron heart @@ -385,7 +423,10 @@ elements.ironheart_core = { // added cores that emit electricity // its like plants // dumbed down ironheart a bit, im thinking about its behaviour - +// Ironheart is Radioactive +// Red Gold is Solid +// Feynmanium +// make things have recaitons // Creditssss // Ghanisma - idea for 2.9.16 From 8de1840c55e626a9ba68021cf8188cf005fa0ea1 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Thu, 1 May 2025 21:59:58 -0400 Subject: [PATCH 06/18] Create velocity2.js --- mods/velocity2.js | 207 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 mods/velocity2.js diff --git a/mods/velocity2.js b/mods/velocity2.js new file mode 100644 index 00000000..ad65ee8f --- /dev/null +++ b/mods/velocity2.js @@ -0,0 +1,207 @@ +airResistance = 0.1; +terminalVelocity = 5; +gravityPull = 0.2; + +validateMoves((pixel,nx,ny) => { + if (elements[pixel.element].isGas) return true; + if (isEmpty(pixel.x,pixel.y+1) && pixel.y-ny < 0) { //goes down usually + pixel.vy = (pixel.vy||0) + gravityPull; + } + return true; +}) + +runPerPixel((pixel) => { + + let vx = pixel.vx; + let vy = pixel.vy; + if (vx === undefined ) vx = 0; + else if (Math.abs(vx) > terminalVelocity) vx = (vx + terminalVelocity) / 2; + if (vy === undefined ) vy = 0; + else if (Math.abs(vy) > terminalVelocity) vy = (vy + terminalVelocity) / 2; + + if (vx !== 0 || vy !== 0) { + + if (!elements[pixel.element].movable) { + pixel.vx = 0; + pixel.vy = 0; + return; + }; + + // Calculate change in position; Random chance for in-between decimal values + const changeX = Math.trunc(vx) + + (Math.random() < (vx % 1) ? Math.sign(vx) : 0); + const changeY = Math.trunc(vy) + + (Math.random() < (vy % 1) ? Math.sign(vy) : 0); + + const loopFor = Math.max(Math.abs(changeX),Math.abs(changeY)); + // console.log(Math.trunc(vy)); + + // let hit = false; + for (let i = 0; i < loopFor; i++) { + const newX = pixel.x + (changeX ? Math.sign(changeX) : 0); + const newY = pixel.y + (changeY ? Math.sign(changeY) : 0); + + if (!tryMove(pixel,newX,newY)) { + if (!isEmpty(newX,newY,true)) { + const newPixel = pixelMap[newX][newY]; + newPixel.vx = (newPixel.vx||0) + vx*0.6; + newPixel.vy = (newPixel.vy||0) + vy*0.6; + } + vx = vx*0.3; + vy = vy*0.3; + }; + } + + // const newX = pixel.x + changeX; + // const newY = pixel.y + changeY; + + const multiplier = (1-airResistance); + pixel.vx = vx * multiplier; + pixel.vy = vy * multiplier; + + // Cut off very low decimal values + if (Math.abs(pixel.vx) < 0.01) pixel.vx = 0; + if (Math.abs(pixel.vy) < 0.01) pixel.vy = 0; + + } + +}) + +elements.push_up = { + color: "#ffffff", + tool: function(pixel) { + pixel.vx = (Math.random() * 2) * (Math.random() < 0.5 ? 1 : -1); + pixel.vy = (Math.random() * 2) * -1; + }, + category: "special" +} + +elements.repeller = { + color: "#ffffff", + tick: function(pixel) { + var coords = circleCoords(pixel.x,pixel.y,5); + for (var i = 0; i < coords.length; i++) { + var coord = coords[i]; + if (!isEmpty(coord.x,coord.y,true)) { + if (!elements[pixelMap[coord.x][coord.y].element].movable) continue; + pixelMap[coord.x][coord.y].vx = (pixelMap[coord.x][coord.y].vx||0) + (Math.random() < 0.5 ? 1 : -1); + pixelMap[coord.x][coord.y].vy = (pixelMap[coord.x][coord.y].vy||0) -1; + } + } + }, + movable: false, + category: "machines", + emit: true +} + +viewInfo["4"] = { // Velocity View + name: "velocity", + pixel: function(pixel,ctx) { + const thermalMin = -5; + const thermalMax = 5; + + var temp = pixel.vx || 0; + var hue = Math.round((temp - thermalMin) / (thermalMax - thermalMin) * 255); + if (hue < 0) {hue = 0} + if (hue > 225) {hue = 225} + drawSquare(ctx,"hsl("+hue+",100%,50%)",pixel.x,pixel.y) + } +} + + +explodeAt = function(x,y,radius,fire="fire") { + // if fire contains , split it into an array + if (fire.indexOf(",") !== -1) { + fire = fire.split(","); + } + var coords = circleCoords(x,y,radius); + var power = radius/10; + //for (var p = 0; p < Math.round(radius/10+1); p++) { + for (var i = 0; i < coords.length; i++) { + // damage value is based on distance from x and y + var distance = (Math.floor(Math.sqrt(Math.pow(coords[i].x-x,2) + Math.pow(coords[i].y-y,2)))) / radius; + const dirX = coords[i].x > x ? 1 : -1; + const dirY = coords[i].y > y ? 1 : -1; + var damage = Math.random() + distance; + // invert + damage = 1 - damage; + if (damage < 0) { damage = 0; } + damage *= power; + if (isEmpty(coords[i].x,coords[i].y)) { + // create smoke or fire depending on the damage if empty + if (damage < 0.02) { } // do nothing + else if (damage < 0.2) { + createPixel("smoke",coords[i].x,coords[i].y); + pixelMap[coords[i].x][coords[i].y].vy = power * (1-distance) * -1; + pixelMap[coords[i].x][coords[i].y].vx = power * (1-distance) * dirX; + } + else { + // if fire is an array, choose a random item + if (Array.isArray(fire)) { + createPixel(fire[Math.floor(Math.random() * fire.length)],coords[i].x,coords[i].y); + } + else { + createPixel(fire,coords[i].x,coords[i].y); + } + pixelMap[coords[i].x][coords[i].y].vy = 2*power * (1-distance) * -1; + pixelMap[coords[i].x][coords[i].y].vx = 2*power * (1-distance) * dirX; + } + } + else if (!outOfBounds(coords[i].x,coords[i].y)) { + // damage the pixel + var pixel = pixelMap[coords[i].x][coords[i].y]; + var info = elements[pixel.element]; + if (info.hardness) { // lower damage depending on hardness(0-1) + if (info.hardness < 1) { + // more hardness = less damage, logarithmic + damage *= Math.pow((1-info.hardness),info.hardness); + } + else { damage = 0; } + } + pixel.vy = 3 * (1-distance) * -1; + pixel.vx = 3 * (1-distance) * dirX; + if (damage > 0.9) { + if (Array.isArray(fire)) { + var newfire = fire[Math.floor(Math.random() * fire.length)]; + } + else { + var newfire = fire; + } + changePixel(pixel,newfire); + // pixel.vy = 10 * damage * (Math.random() < 0.5 ? 1 : -1); + // pixel.vx = 10 * damage * (Math.random() < 0.5 ? 1 : -1); + continue; + } + else if (damage > 0.25) { + if (isBreakable(pixel)) { + breakPixel(pixel); + continue; + } + else { + if (Array.isArray(fire)) { + var newfire = fire[Math.floor(Math.random() * fire.length)]; + } + else { + var newfire = fire; + } + if (elements[pixel.element].onBreak !== undefined) { + elements[pixel.element].onBreak(pixel); + } + changePixel(pixel,newfire); + // pixel.vy = 10 * damage * (Math.random() < 0.5 ? 1 : -1); + // pixel.vx = 10 * damage * (Math.random() < 0.5 ? 1 : -1); + continue; + } + } + if (damage > 0.75 && info.burn) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + pixel.temp += damage*radius*power; + pixel.vy = 3 * (1-distance) * -1; + pixel.vx = 3 * (1-distance) * dirX; + // console.log(pixel.vy); + pixelTempCheck(pixel); + } + } +} \ No newline at end of file From 439c4619b21b72e7799989808120d88d8ed942b8 Mon Sep 17 00:00:00 2001 From: Salmonfishyy <160120816+Salmonfishyy@users.noreply.github.com> Date: Sun, 4 May 2025 18:12:14 +0700 Subject: [PATCH 07/18] add barista.js mod --- mods/barista.js | 132 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 mods/barista.js diff --git a/mods/barista.js b/mods/barista.js new file mode 100644 index 00000000..2a2fa9dd --- /dev/null +++ b/mods/barista.js @@ -0,0 +1,132 @@ +/* +Barista Mods by Salmonfishyy (eu) +Add many ingredients for drinks + +Changelog - Foundation Level (v0.1) + - Matcha Elements +*/ + +elements.matcha_powder = { + behavior: behaviors.POWDER, + category: "food", + state: "solid", + color: ["#74A662","#74A12E"], + density: 400, + tempHigh: 80, + stateHigh: "burn_matcha", + isFood: true, + desc: "Fine green powder from tea leaves. Vibrant color, earthy taste, and packed with antioxidants. Used in drinks, desserts, and rituals. Basically, classy leaf dust. Watch out for heat and oxygen!", + reactions: { + "oxygen": { elem2: "broke_matcha", chance: 0.5 }, + "dirty_water": { elem2: "null", chance: 0.5 }, + "pool_water": { elem2: "null", chance: 0.5 }, + "water": { elem2: "matcha_tea", chance: 0.5 }, + "seltzer": { elem2: "matcha_soda", chance: 0.5 }, + "salt_water": { elem2: "salty_matcha", chance: 0.5 }, + "sugar_water": { elem2: "sweet_matcha", chance: 0.5 } + } +}; + +elements.broke_matcha = { + behavior: behaviors.POWDER, + category: "food", + state: "solid", + color: ["#556B2F","#8B4513"], + density: 400, + desc: "Broke matcha—once a proud green powder, now a sad, terrible mess. Faded, bitter, and questioning its life choices. Now useless." +}; + +elements.matcha_tea = { + behavior: behaviors.LIQUID, + category: "food", + state: "liquid", + color: ["#5F8A3D"], + density: 1000, + isFood: true, + desc: "Thick green drink, kinda earthy, kinda bitter. Looks like a magic potion, feels like a forest hug. Smooth, strong, and definitely plotting something...", + reactions: { + "milk": { elem2: "matcha_latte", chance: 0.5 }, + "cream": { elem2: "matcha_latte", chance: 0.5 }, + "salt": { elem2: "salty_matcha", chance: 0.5 }, + "sugar": { elem2: "sweet_matcha", chance: 0.5 }, + "carbon_dioxide": { elem2: "matcha_soda", chance: 0.5 } + } +}; + +elements.matcha_latte = { + behavior: behaviors.LIQUID, + category: "food", + state: "liquid", + color: ["#DDEEAF"], + density: 1000, + isFood: true, + desc: "Green tea and milk mixed together. Smooth, slightly sweet, and a bit earthy. Looks fancy, tastes cozy.", + reactions: { + "milk": { elem2:null, chance: 0.5 }, + "cream": { elem2:null, chance: 0.5 } + } +}; + +elements.salty_matcha = { + behavior: behaviors.LIQUID, + category: "food", + state: "liquid", + color: ["#A2B57D"], + density: 1000, + isFood: true, + desc: "Green tea but slightly salty. Confusing, kinda wrong, yet somehow still drinkable. Like matcha decided to rebel.", + reactions: { + "salt": { elem2:null, chance: 0.5 } + } +}; + +elements.matcha_soda = { + behavior: behaviors.LIQUID, + behavior: [ + "XX|CR:foam%3|XX", + "M2|XX|M2", + "M2|M1|M2", + ], +tick: function(pixel) { + if (Math.random() < 0.05 && isEmpty(pixel.x,pixel.y-1)) { + let foam = releaseElement(pixel, "foam"); + if (foam) foam.color = pixelColorPick(foam,"#7EBF5C"); + } +}, + + onMix: function(pixel) { + releaseElement(pixel, "foam", shiftDown) + }, + + category: "food", + state: "liquid", + color: ["#7EBF5C"], + density: 1000, + isFood: true, + desc: "Carbonated green tea. Slightly bitter, extra fizzy. Tastes fresh, feels weird...", + reactions: { + "carbon_dioxide": { elem2:null, chance: 0.5 } + } +}; + +elements.oolong_leaves = { + behavior: behaviors.POWDER, + category: "food", + state: "solid", + color: ["#CDB361","#8F6B3A"], + density: 200, + isFood: true, + tempHigh: 120, + stateHigh: "roasted_oolong", + desc: "Dark, twisty tea leaves that look kinda serious. Smell fancy, taste like tea that went through a phase. Smooth, strong, and slightly dramatic. UNDER CONSTRUCTION AHAHAHAHA" +}; + +elements.roasted_oolong = { + behavior: behaviors.POWDER, + category: "food", + state: "solid", + color: ["#8F6B3A","#654321"], + density: 220, + isFood: true, + desc: "Roasted oolong—deeper flavor, slightly smoky, and probably wiser now. UNDER CONSTRUCTION AHAHAHAHA" +}; \ No newline at end of file From 76b867339d17ad9805e8a9435da74efef81676ed Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Sun, 4 May 2025 20:56:29 -0700 Subject: [PATCH 08/18] time reversal mod! finally at last --- mods/reverse_time.js | 421 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 421 insertions(+) create mode 100644 mods/reverse_time.js diff --git a/mods/reverse_time.js b/mods/reverse_time.js new file mode 100644 index 00000000..f02876a7 --- /dev/null +++ b/mods/reverse_time.js @@ -0,0 +1,421 @@ +emptyList = [] + +runPerPixel(function(pixel) { + // run any code on each pixel every tick + if (pixel.start>pixelTicks) { + if (pixel.olderelement != undefined && pixel.oldercolor != undefined && pixel.olderstart != undefined && pixel.oldertemp != undefined && pixel.olderanimal != undefined && pixel.olderage != undefined) { + OGChangePixel(pixel) + } + else { + deletePixel(pixel.x,pixel.y) + } + } /* + if (pixel.start>pixelTicks+10) { + deletePixel(pixel.x,pixel.y) + } */ + if (pixel.burnStart && pixel.burnStart>pixelTicks) { + if (pixel.burning) { + delete pixel.burning; + delete pixel.burnStart; + } + } + if (pixel.origColor && !pixel.stainStart) { + pixel.stainStart = pixelTicks + } + if (pixel.stainStart && pixel.origColor && pixel.stainStart>pixelTicks) { + pixel.color = "rgb("+pixel.origColor[0]+","+pixel.origColor[1]+","+pixel.origColor[2]+")" + delete pixel.origColor + delete pixel.stainStart + } +}) + + +changePixel = function(pixel,element,changetemp=true) { + if (!element) { return } + if (elements[pixel.element].onChange !== undefined) { + elements[pixel.element].onChange(pixel,element); + } + if (!elements[element]) { + pixel.invalidElement = element; + element = "unknown" + } + if (!pixel.olderelement) { + pixel.olderelement = [] + } + if (!pixel.oldercolor) { + pixel.oldercolor = [] + } + if (!pixel.olderstart) { + pixel.olderstart = [] + } + if (!pixel.oldertemp) { + pixel.oldertemp = [] + } + if (!pixel.olderanimal) { + pixel.olderanimal = [] + } + if (!pixel.olderage) { + pixel.olderage = [] + } + for (var i = 0; i <= 500; i++) { + if (!pixel.olderelement[i]) { + pixel.olderelement[i] = pixel.element + if (pixel.element === "human") { + pixel.olderelement[i] = "head" + } + break; + } + } + for (var i = 0; i <= 500; i++) { + if (!pixel.oldercolor[i]) { + pixel.oldercolor[i] = pixel.color + break; + } + } + for (var i = 0; i <= 500; i++) { + if (!pixel.olderstart[i]) { + pixel.olderstart[i] = pixel.start + break; + } + } + for (var i = 0; i <= 500; i++) { + if (!pixel.oldertemp[i]) { + pixel.oldertemp[i] = pixel.temp + if (elements[pixel.element].tempHigh && elements[pixel.element].tempHigh < pixel.temp) { + pixel.oldertemp[i] = (elements[pixel.element].tempHigh - 1.5) + } + if (elements[pixel.element].tempLow && elements[pixel.element].tempLow > pixel.temp) { + pixel.oldertemp[i] = (elements[pixel.element].tempLow + 1.5) + } + break; + } + } + for (var i = 0; i <= 500; i++) { + if (!pixel.olderanimal[i]) { + pixel.olderanimal[i] = pixel.animal + if (!pixel.animal) { + pixel.olderanimal[i] = pixel.element + } + break; + } + } + for (var i = 0; i <= 500; i++) { + if (!pixel.olderage[i]) { + pixel.olderage[i] = pixel.age + if (!pixel.age) { + pixel.olderage[i] = pixel.start + } + break; + } + } + pixel.element = element; + pixel.color = pixelColorPick(pixel); + pixel.start = pixelTicks; + var elementInfo = elements[element]; + if (elementInfo.burning == true) { + pixel.burning = true; + pixel.burnStart = pixelTicks; + } + else if (pixel.burning && !elementInfo.burn) { + delete pixel.burning; + delete pixel.burnStart; + } + delete pixel.origColor; // remove stain + delete pixel.clone; + if (pixel.glow !== undefined) { + delete pixel.glow; + } + if (pixel.r && !elementInfo.rotatable) { + delete pixel.r; + } + if (pixel.flipX && !elementInfo.flippableX) { + delete pixel.flipX; + } + if (pixel.flipY && !elementInfo.flippableY) { + delete pixel.flipY; + } + // If elementInfo.flippableX, set it to true or false randomly + if (elementInfo.flipX !== undefined) { pixel.flipX = elementInfo.flipX } + else if (elementInfo.flippableX) { + pixel.flipX = Math.random() >= 0.5; + } + // If elementInfo.flippableY, set it to true or false randomly + if (elementInfo.flipY !== undefined) { pixel.flipY = elementInfo.flipY } + else if (elementInfo.flippableY) { + pixel.flipY = Math.random() >= 0.5; + } + if (elementInfo.temp !== undefined && changetemp) { + pixel.temp = (elementInfo.temp+pixel.temp)/2; + pixelTempCheck(pixel) + } + if (pixel.con && !elementInfo.canContain) { + delete pixel.con; + } + // If elementInfo.properties, set each key to its value + if (elementInfo.properties !== undefined) { + for (var key in elementInfo.properties) { + // If it is an array or object, make a copy of it + if (typeof elementInfo.properties[key] == "object") { + pixel[key] = JSON.parse(JSON.stringify(elementInfo.properties[key])); + } + else { + pixel[key] = elementInfo.properties[key]; + } + } + } + if (pixel.alpha !== undefined) { + delete pixel.alpha; + } + if (pixel.emit) { + delete pixel.emit; + } + if (elements[element].alpha !== undefined) { + pixel.alpha = elements[element].alpha; + } + if (elements[element].onPlace !== undefined) { + elements[element].onPlace(pixel); + } + checkUnlock(element); +} + +OGChangePixel = function(pixel) { + if (pixel.olderelement != undefined && pixel.oldercolor != undefined && pixel.olderstart != undefined && pixel.oldertemp != undefined && pixel.olderanimal != undefined && pixel.olderage != undefined && pixel.olderelement.length > emptyList.length && pixel.oldercolor.length > emptyList.length && pixel.olderstart.length > emptyList.length && pixel.oldertemp.length > emptyList.length && pixel.olderanimal.length > emptyList.length && pixel.olderage.length > emptyList.length && pixel.startpixelTicks) { + deletePixel(pixel.x,pixel.y) + } + else if (pixel.animal && pixel.start-pixelTicks >= 500 && Math.random() < 0.2) { + deletePixel(pixel.x,pixel.y) + } + if (pixel.start === pixelTicks) {return} + if (pixel.drag) pixel.fall = 0; + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + if (pixel.animal || pixel.fall < 20) { + if (Math.random() < 0.5) { + if (!tryMove(pixel, pixel.x+1, pixel.y+1)) { + tryMove(pixel, pixel.x-1, pixel.y+1); + } + } else { + if (!tryMove(pixel, pixel.x-1, pixel.y+1)) { + tryMove(pixel, pixel.x+1, pixel.y+1); + } + } + pixel.fall = 0; + } + else if (outOfBounds(pixel.x,pixel.y+1) || (!isEmpty(pixel.x,pixel.y+1,true) && elements.egg.ignore.indexOf(pixelMap[pixel.x][pixel.y+1].element) === -1 && elements[pixelMap[pixel.x][pixel.y+1].element].state === "solid")) { + changePixel(pixel,"yolk") + } + else {pixel.fall = 0} + if (pixel.animal && pixelTicks-pixel.start >= 500 && Math.random() < 0.2) { + changePixel(pixel,pixel.animal) + } + } + else {pixel.fall ++} + if (pixel.temp < -2 || pixel.temp > 100) { + pixel.animal = null; + } + doDefaults(pixel); + }, + ignore: ["paper","sponge","straw","wheat","rat","frog","pollen","clay","snow","mud","wet_sand","tinder","feather","bread","ice_cream","dough"], + innerColor: "#ffffff", + properties: { "fall":0 }, + tempHigh: 1500, + stateHigh: ["steam","calcium","carbon_dioxide","sulfur_gas"], + breakInto: "yolk", + category: "food", + state: "solid", + density: 1031, + cooldown: defaultCooldown +} + +elements.tadpole = { + color: "#87b574", + behavior: [ + "XX|XX|M2%25 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14", + "XX|FX%0.5|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14", + "XX|M1|SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%14", + ], + tick: function(pixel) { + if (pixel.start-pixelTicks > 500) { + OGChangePixel(pixel,"egg") + pixel.color = pixelColorPick(pixel,"#717c80") + pixel.animal = "tadpole" + } + if (pixelTicks-pixel.start > 500) { + changePixel(pixel,"frog"); + } + }, + reactions: { + "algae": { elem2:null, chance:0.25 }, + "kelp": { elem2:"water", chance:0.25 } + }, + tempHigh: 100, + stateHigh: "steam", + tempLow: -10, + stateLow: "ice", + breakInto: ["slime",null], + category:"life", + hidden: true, + state: "solid", + density: 1450, + conduct: 0.2 +} + +elements.frog = { + color: "#607300", + behavior: [ + "XX|XX|M2%3 AND SW:water,salt_water,sugar_water,dirty_water,seltzer%7", + "XX|FX%0.5|CR:slime%0.01 AND BO", + "XX|M1|XX", + ], + reactions: { + "fly": { elem2:null, chance:0.5, func:behaviors.FEEDPIXEL }, + "firefly": { elem1:"meat", elem2:null, chance:0.5 }, + "stink_bug": { elem2:null, chance:0.55, func:behaviors.FEEDPIXEL }, + "snail": { elem2:"limestone", chance:0.05, func:behaviors.FEEDPIXEL }, + "slug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "worm": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "spider": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "algae": { elem2:null, chance:0.5, func:behaviors.FEEDPIXEL }, + "kelp": { elem2:"water", chance:0.5, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "dead_bug": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "mercury": { elem1:"rotten_meat", chance:0.1 }, + "bleach": { elem1:"rotten_meat", chance:0.1 }, + "infection": { elem1:"rotten_meat", chance:0.025 }, + "uranium": { elem1:"rotten_meat", chance:0.1 }, + "cyanide": { elem1:"rotten_meat", chance:0.1 }, + "chlorine": { elem1:"meat", chance:0.1 }, + "alcohol": { elem1:"meat", chance:0.025 }, + "dirty_water": { elem1:"rotten_meat", chance:0.0001 }, + "pool_water": { elem1:"rotten_meat", chance:0.005 }, + "vinegar": { elem1:"rotten_meat", chance:0.001 }, + }, + tick: function(pixel) { + if (pixelTicks < pixel.start) { + OGChangePixel(pixel,"tadpole"); + } + }, + foodNeed: 10, + baby: "tadpole", + eggColor:"#717c80", + temp: 19.1, + tempHigh: 100, + stateHigh: "cooked_meat", + stateHighColor: "#CDAF96", + onStateHigh: function(pixel) { + releaseElement(pixel,"steam"); + }, + tempLow: -18, + stateLow: "frozen_frog", + category:"life", + breakInto: "slime", + burn:15, + burnTime:300, + state: "solid", + density: 1450, + conduct: 0.2 +} + +elements.fly = { + color: "#4c4e42", + behaviorOn: [ + "XX|CR:flash|XX", + "CR:flash|CH:ash|CR:flash", + "XX|CR:flash|XX", + ], + reactions: { + "dead_plant": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL }, + "cheese": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL }, + "cheese_powder": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL }, + "rotten_cheese": { elem2:[null,null,"ammonia"], chance:0.15, func:behaviors.FEEDPIXEL }, + "vine": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "potato": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "wheat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yeast": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "caramel": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "sugar_water": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "honey": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "soda": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL } + }, + tick: function(pixel, onHit) { + var nx = pixel.flipX ? -1 : 1; + var ny = Math.random() < 0.5 ? -1 : 1; + var hit = false; + if (!tryMove(pixel, pixel.x+nx, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x+nx, pixel.y-ny)) { + if (!tryMove(pixel, pixel.x, pixel.y+ny)) { + if (!tryMove(pixel, pixel.x, pixel.y-ny)) {hit=[pixel.x, pixel.y-ny]} + }else {hit=[pixel.x, pixel.y+ny]} + }else {hit=[pixel.x+nx, pixel.y-ny]} + }else {hit=[pixel.x+nx, pixel.y+ny]} + if (hit && onHit) { + if (!isEmpty(hit[0], hit[1], true)) { + onHit(pixel, pixelMap[hit[0]][hit[1]]); + } + else {onHit(pixel);} + } + if (pixel.del) {return} + if (!isEmpty(pixel.x+nx,pixel.y) || Math.random() < 0.02) { + pixel.flipX = !pixel.flipX; + } + if (pixel.charge && elements[pixel.element].behaviorOn) { + pixelTick(pixel) + } + doDefaults(pixel); + if (pixel.start-pixelTicks > 500) { + OGChangePixel(pixel,"egg") + pixel.animal = "fly" + } + }, + foodNeed: 15, + tempHigh: 100, + stateHigh: "ash", + tempLow: 0, + stateLow: "dead_bug", + breakInto: "dead_bug", + category:"life", + burn:95, + burnTime:25, + state: "solid", + density: 600, + conduct: 1 +} */ \ No newline at end of file From 1ea7b0a310d8f5ff72e5ecc792607f6d70e18056 Mon Sep 17 00:00:00 2001 From: CO1 <107355287+Ghanisma@users.noreply.github.com> Date: Sat, 10 May 2025 08:22:23 +0700 Subject: [PATCH 09/18] Update aScientistsWish.js 1.10 Add Lithium and its compounds, Phosphorus, and Phosphorus Bomb --- mods/aScientistsWish.js | 237 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 234 insertions(+), 3 deletions(-) diff --git a/mods/aScientistsWish.js b/mods/aScientistsWish.js index 0df99162..56f2077a 100644 --- a/mods/aScientistsWish.js +++ b/mods/aScientistsWish.js @@ -1,6 +1,6 @@ -//Main version +//Main version. Still in WIP //reminder for creator: human code is on index.html line 3242. - +//Ini adalah aScientistsWish.js, mod dari Sandboxels yang diciptakan oleh Carbon Monoxide dengan bantuan startup oleh Salmonfishy, bertema sains dan semi fiktif dengan adanya zombie, mod ini masih dalam tahap pengembangan. elements.carbon_monoxide = { color: ["#b5b5b5", "#404040", "#2b2b2b",], behavior: behaviors.GAS, @@ -232,7 +232,7 @@ reactions: { } }; -elements.radiated_metal = { +elements.radiated_metal = { behavior: [ ["XX","CR:radiation%25","XX"], ["CR:radiation%25","XX","CR:radiation%25"], @@ -929,6 +929,7 @@ elements.liquid_phosgene = { category: "states", density: 7.50, tempLow: -118, + hidden: true, temp: -10, stateLow: "solid_phosgene", tempHigh: 8, @@ -939,6 +940,7 @@ elements.solid_phosgene = { behavior: behaviors.WALL, state: "solid", category: "states", + hidden: true, density: 12.45, temp: -150, tempHigh: -117, @@ -962,3 +964,232 @@ elements.chlorophyll = { "acid": { elem1: ["magnesium"], } } } +elements.lithium = { //Unsur lithium, buat versi baru, masih WIP. + color: ["#928c96", "#9c9c9c",], + state: "powder", + category: "powders", + behavior: behaviors.POWDER, + density: 0.5, + tempHigh: 180, + stateHigh: "molten_lithium", + conduct: 0.2, + burn: 85, + burnTime: 500, + reactions: { + "water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "salt_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "pool_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "dirty_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "sugar_water": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "steam": { elem1: ["pop","explosion","hydrogen","lithium_hydroxide"] }, + "oxygen": { elem1: "lithium_oxide" }, + "chlorine": { elem1: "lithium_chloride" }, + "acid": { elem1: ["lithium_chloride","hydrogen"], chance: 0.2 }, + "carbon_dioxide": { elem1: "lithium_carbonate" }, + "carbon_monoxide": { elem1: "lithium_carbonate" }, + "nitrogen": { elem1: "lithium_nitride", chance: 0.1 } + } + } +elements.molten_lithium = { + color: ["#c0c0c0", "#d0d0d0", "#b0b0b0"], + behavior: behaviors.LIQUID, + temp: 250, // temperatur normal + density: 0.5, + conduct: 0.5, + state: "liquid", + category: "states", + hidden: true, + tempLow: 180, + stateLow: "lithium", + burn: 50, + burnTime: 300, + burnInto: "lithium_oxide", +} + +elements.lithium_hydroxide = { + color: "#c8e4d8", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 1500, + tempHigh: 462, // titik leleh LiOH + stateHigh: "molten_lithium_hydroxide", + reactions: {}, +}; + +// Molten Lithium Hydroxide +elements.molten_lithium_hydroxide = { + color: "#dff7f2", + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + density: 1400, + hidden: true, + temp: 463, + tempHigh: 924, // perkiraan titik didih + stateHigh: "lithium_hydroxide_gas", // opsional + reactions: {}, +}; + +// Lithium Oxide (hasil reaksi lithium dengan oksigen) +elements.lithium_oxide = { + color: "#d0d0d0", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 2013, + tempHigh: 1438, + stateHigh: "molten_lithium_oxide", + reactions: {}, +}; + +// Molten Lithium Oxide +elements.molten_lithium_oxide = { + color: "#e8e8e8", + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + density: 1800, + hidden: true, + temp: 1440, + reactions: {}, +}; + +// Lithium Carbonate (hasil reaksi lithium dengan karbon dioksida) +elements.lithium_carbonate = { + color: "#f0f0f0", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 2110, + tempHigh: 723, + stateHigh: "molten_lithium_carbonate", + reactions: {}, +}; + +// Molten Lithium Carbonate +elements.molten_lithium_carbonate = { + color: "#fafafa", + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + density: 1900, + hidden: true, + temp: 725, + reactions: {}, +}; + +// Lithium Chloride (hasil reaksi lithium dengan klorin atau asam) +elements.lithium_chloride = { + color: "#e0e0f8", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 2068, + tempHigh: 614, + stateHigh: "molten_lithium_chloride", + reactions: {}, +}; + +// Molten Lithium Chloride +elements.molten_lithium_chloride = { + color: "#f0f0ff", + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + hidden: true, + density: 1900, + temp: 615, + reactions: {}, +}; + +// Lithium Nitride (hasil reaksi lithium dengan nitrogen) +elements.lithium_nitride = { + color: "#b8b8b8", + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 1270, + tempHigh: 813, + stateHigh: "molten_lithium_nitride", + reactions: {}, +}; + +// Molten Lithium Nitride +elements.molten_lithium_nitride = { + color: "#c8c8c8", + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + hidden: true, + density: 1100, + temp: 815, + reactions: {}, +}; +elements.phosphorus = { + color: ["#ffffcc", "#ffff99", "#ffff66"], + behavior: behaviors.POWDER, + category: "powders", + state: "solid", + density: 1820, + burn: 100, + burnTime: 100, + burnInto: "fire", + reactions: { + "oxygen": { elem1: "fire", chance: 0.5 }, + "water": { elem1: "explosion", }, + }, + tempHigh: 44, + stateHigh: "molten_phosphorus", + hidden: false, +}; +elements.molten_phosphorus = { + color: ["#ffcc00", "#ff9900"], + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + density: 1600, + hidden: true, + burning: true, + burnTime: 2000, + burnInto: "fire", + reactions: { + "oxygen": { elem1: "fire", chance: 1 }, + }, + temp: 100, + tempLow: 43, + stateLow: "phosphorus", + viscosity: 20, +}; +elements.phosphorus_bomb = { + color: "#ffdd66", + behavior: behaviors.POWDER, + category: "weapons", + state: "solid", + density: 1200, + desc: "Bom fosfor – meledak saat menyentuh elemen lain dan menyebarkan molten_phosphorus.", + tick: function(pixel) { + // Periksa apakah ada elemen lain di sekitarnya + for (let dx = -1; dx <= 1; dx++) { + for (let dy = -1; dy <= 1; dy++) { + if (dx === 0 && dy === 0) continue; + let x = pixel.x + dx; + let y = pixel.y + dy; + if (!isEmpty(x, y)) { + // Meledak: ubah area sekitar jadi molten_phosphorus + for (let ex = -3; ex <= 3; ex++) { + for (let ey = -3; ey <= 3; ey++) { + let nx = pixel.x + ex; + let ny = pixel.y + ey; + if (isEmpty(nx, ny) && Math.random() < 0.6) { + createPixel("molten_phosphorus", nx, ny); + } + } + } + deletePixel(pixel.x, pixel.y); // Hancurkan bomb setelah meledak + return; + } + } + } + } +}; From 5164a75013b33e233647c4513ececc66c67bdce3 Mon Sep 17 00:00:00 2001 From: Salmonfishyy <160120816+Salmonfishyy@users.noreply.github.com> Date: Sat, 10 May 2025 13:09:00 +0700 Subject: [PATCH 10/18] Update barista.js v0.2 --- mods/barista.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/mods/barista.js b/mods/barista.js index 2a2fa9dd..7f4e024e 100644 --- a/mods/barista.js +++ b/mods/barista.js @@ -4,8 +4,25 @@ Add many ingredients for drinks Changelog - Foundation Level (v0.1) - Matcha Elements +Changelog - Foundation Level (v0.2) + - Oolong tea + - cinnamon tea */ +elements.tencha = { + behavior: behaviors.POWDER, + category: "food", + state: "solid", + color: ["#25360c","#324a0c"], + density: 500, + breakInto: "matcha_powder", + isFood: true, + desc: "Tea leaves, can break into matcha, look pretty sussy.", +reactions: { + "water": { elem2:"tea", tempMin:80 } + } +}; + elements.matcha_powder = { behavior: behaviors.POWDER, category: "food", @@ -118,7 +135,10 @@ elements.oolong_leaves = { isFood: true, tempHigh: 120, stateHigh: "roasted_oolong", - desc: "Dark, twisty tea leaves that look kinda serious. Smell fancy, taste like tea that went through a phase. Smooth, strong, and slightly dramatic. UNDER CONSTRUCTION AHAHAHAHA" + desc: "Dark, twisty tea leaves that look kinda serious. Smell fancy, taste like tea that went through a phase. Smooth, strong, and slightly dramatic.", +reactions: { + "water": { elem2:"oolong_tea", tempMin:80 }, + } }; elements.roasted_oolong = { @@ -128,5 +148,62 @@ elements.roasted_oolong = { color: ["#8F6B3A","#654321"], density: 220, isFood: true, - desc: "Roasted oolong—deeper flavor, slightly smoky, and probably wiser now. UNDER CONSTRUCTION AHAHAHAHA" -}; \ No newline at end of file + desc: "Roasted oolong—deeper flavor, slightly smoky, and probably wiser now.", +reactions: { + "water": { elem2:"oolong_tea", tempMin:80 }, + } +}; + + +elements.cinnamon = { + behavior: behaviors.SUPPORTPOWDER, + category: "food", + state: "solid", + color: ["#6a462f","#4a3120"], + density: 500, + breakInto: "cinnamon_powder", + isFood: true, + desc: "Cinnamon, a thingy things with spicy flavour.", + reactions: { + "water": { elem2:"cinnamon_tea", tempMin:80, color2:"#6c3213" }, + } +}; + +elements.cinnamon_powder = { + behavior: behaviors.SUPPORTPOWDER, + category: "food", + state: "solid", + color: ["#986544"], + density: 589, + isFood: true, + desc: "Cinnamon powder, from cinnamon, a thingy things powder with spicy flavour.", +reactions: { + "water": { elem2:"cinnamon_tea", chance: 0.5, color2:"#6c3213" }, + } +}; + +elements.cinnamon_tea = { + behavior: behaviors.LIQUID, + category: "food", + state: "solid", + color: ["#723900"], + density: 1000, + isFood: true, + desc: "Cozy tea with spicy taste.", +reactions: { + "cinnamon_powder": { elem2:"null", chance: 0.5 }, + } +}; + +elements.oolong_tea = { + behavior: behaviors.LIQUID, + category: "food", + state: "solid", + color: ["#ADA07B"], + density: 1000, + isFood: true, + desc: "it's just tea, make from oolong.", +reactions: { + "sugar": { elem2:"null", chance: 0.5 }, + } +}; From d764f49082e4a363b06faab79685b8287a756d48 Mon Sep 17 00:00:00 2001 From: Aitorbrine <140336973+Aitorbrine@users.noreply.github.com> Date: Sat, 10 May 2025 22:47:00 +0200 Subject: [PATCH 11/18] Create vinegar.js In this mod you can make vinegar with acetobacter --- mods/vinegar.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 mods/vinegar.js diff --git a/mods/vinegar.js b/mods/vinegar.js new file mode 100644 index 00000000..ae952ab4 --- /dev/null +++ b/mods/vinegar.js @@ -0,0 +1,17 @@ +elements.acetobacter = { + color: ["#328fa8", "#6bbfd6", "#19718a"], + category: "life", + tempHigh: "102", + tempLow: "-2", + stateHigh: ["steam","steam","steam","sugar"], + stateLow: ["ice","ice","ice","sugar_ice"], + breakInto:["dna","dna","dna","water"], + behavior: [ + ["XX","M1%30","XX"], + ["M1%50","XX","M1%50"], + ["XX","M1%30","XX"] + ], + reactions:{ + "alcohol" :{ elem1: "acetobacter", elem2:"vinegar", chance:0.2,} + } +} From d7def9a2f1865c24e1f8d0ab7523652bc1c6a7ea Mon Sep 17 00:00:00 2001 From: CO1 <107355287+Ghanisma@users.noreply.github.com> Date: Sun, 11 May 2025 07:57:45 +0700 Subject: [PATCH 12/18] aScientistsWish.js 1.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oh hell i forgot to change the Indonesian desc on phosphorus bomb👁️👄👁️ --- mods/aScientistsWish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/aScientistsWish.js b/mods/aScientistsWish.js index 56f2077a..b984795b 100644 --- a/mods/aScientistsWish.js +++ b/mods/aScientistsWish.js @@ -1167,7 +1167,7 @@ elements.phosphorus_bomb = { category: "weapons", state: "solid", density: 1200, - desc: "Bom fosfor – meledak saat menyentuh elemen lain dan menyebarkan molten_phosphorus.", + desc: "Don't let UN see this...", tick: function(pixel) { // Periksa apakah ada elemen lain di sekitarnya for (let dx = -1; dx <= 1; dx++) { From 9bb962c188ae89f02bdda94b56d4ac041013157b Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 13 May 2025 18:57:26 -0400 Subject: [PATCH 13/18] d --- mods/10kelements.js | 19 ++++-- mods/explosionsound.js | 19 ++++++ mods/minecraft.js | 62 ++++++++++-------- mods/nousersthings.js | 141 +++++++++++++++++++++-------------------- 4 files changed, 141 insertions(+), 100 deletions(-) create mode 100644 mods/explosionsound.js diff --git a/mods/10kelements.js b/mods/10kelements.js index a7c371e7..d325bd03 100644 --- a/mods/10kelements.js +++ b/mods/10kelements.js @@ -2,18 +2,25 @@ var elementslist = [] for (elementi in elements){ elementslist.push(elementi) } +async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod + return new Promise(resolve => { + promptInput(message, (result) => { + resolve(result); + }, title, defaultValue); + }) +} elements.change_count = { color: "#34eb86", canPlace: false, behavior: behaviors.SELFDELETE, - onSelect: function() { - var cans = prompt("Please input how many elements you would like to be generared each time.", 10000); + onSelect: async function() { + var cans = _GNPrompt("Please input how many elements you would like to be generared each time.", "10kelements.js is asking you...", 10000); if (!cans) { return } - if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); alert("skin"); return} - if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); alert("sand"); return} - if (cans > 100000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return} + if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); promptText("skin"); return} + if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); promptText("sand"); return} + if (cans > 100000){promptText("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return} if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return} - if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return} + if (isNaN(parseInt(cans))){promptText("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return} settings.randomcount = parseInt(cans) settings.skineasteregg = false; settings.sandeasteregg = false; diff --git a/mods/explosionsound.js b/mods/explosionsound.js new file mode 100644 index 00000000..5658ad72 --- /dev/null +++ b/mods/explosionsound.js @@ -0,0 +1,19 @@ +const oldExplode = explodeAt; +let explosionCooldown = 0 +playExplosionSound = function(){ + var audio = new Audio("https://JustAGenericUsername.github.io/explosion.mp3"); + audio.play(); +} +explodeAt = function(x,y,radius,fire="fire"){ + oldExplode(x,y,radius,fire); + if(explosionCooldown <= 0){ + playExplosionSound(); + explosionCooldown = 7 + //console.log("success") + } //else { + //console.log("yeah no") + //} +} +runEveryTick(function(){ + explosionCooldown -= 1; +}) \ No newline at end of file diff --git a/mods/minecraft.js b/mods/minecraft.js index 42d84d9e..50171a06 100644 --- a/mods/minecraft.js +++ b/mods/minecraft.js @@ -69,7 +69,7 @@ elements.soul_sand = { category: "minecraft", state: "solid", tempHigh: 2575, - stateHigh: "soul_glass", + stateHigh: "molten_soul_glass", density: 1375, reactions: { "water": { "elem1":"wet_soul_sand", "elem2":null }, @@ -114,6 +114,19 @@ elements.wet_soul_sand = { stateHigh: "soul_sand", density: 1660, }; +elements.molten_soul_glass = { + color: ["#36d7ec", "#2fbacd", "#289faf", "#218491", "#1a6a75"], + fireColor: "#36d7ec", + viscosity: 1000, + behavior: behaviors.MOLTEN, + category: "minecraft", + density: 1625, + hidden: true, + tempLow: 2540, + stateLow: "soul_glass", + state: "liquid", + temp: 2700, +} /* unfinished but near: Soul Adobe, Molten Soul Glass, @@ -135,6 +148,13 @@ function playShriek() { var audio = new Audio("https://JustAGenericUsername.github.io/shriek" + Math.floor((Math.random()*4) +1) + ".ogg"); audio.play(); } +async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod + return new Promise(resolve => { + promptInput(message, (result) => { + resolve(result); + }, title, defaultValue); + }) +} function turnIntoSpecific(pixel){ newPixel = pixel.storedPixel newPixel.x = pixel.x; @@ -597,8 +617,8 @@ elements.sculk_wifi_transmitter = { hoverStat: function(pixel){ return pixel.channel || "unset" }, - onSelect: function(){ - let ans1 = prompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0) + onSelect: async function(){ + let ans1 = await _GNPrompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...",channelVar||0) channelVar = ans1 }, tick: function(pixel){ @@ -636,8 +656,8 @@ elements.sculk_wifi_receiver = { hoverStat: function(pixel){ return pixel.channel || "unset" }, - onSelect: function(){ - let ans1 = prompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0) + onSelect: async function(){ + let ans1 = _GNPrompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...", channelVar||0) channelVar = ans1 }, tick: function(pixel){ @@ -772,26 +792,18 @@ elements.obsidian = { //subject to change density: 2400, renderer: function(pixel, ctx){ autoFillColorRectangle(ctx, pixel, "#06030B", 1, 1, 0, 0) - autoFillColorRectangle(ctx, pixel, "#000001", 0.5, 1/6, 0, 0) - autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 1/6, 5/6) - autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 5/6, 2/3) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 0, 5/6) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/5, 1/6, 0.5) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/3, 1/3, 1/3) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 2/3, 0) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 0.5, 2/3, 0.5) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 2/3, 0.5) - autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 0.5, 5/6) - autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0, 2/3) - autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/6, 1/3) - autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0.5, 0) - autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 5/6, 1/3) - autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 5/6) - autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 0, 1/3) - autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/6, 1/6) - autoFillColorRectangle(ctx, pixel, "#3B2754", 1/3, 1/6, 1/3, 2/3) - autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 2/3, 1/3) - autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 5/6, 1/6) + autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 5/6, 5/6) + autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/3, 1/3, 2/3) + autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 2/3) + autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 0, 1/6) + autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 0) + autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/3, 1/2, 0) + autoFillColorRectangle(ctx, pixel, "#271E3D", 1/2, 1/6, 1/3, 1/6) + autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/6, 2/3, 2/3) + autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 1/2) + autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/3, 0, 1/2) + autoFillColorRectangle(ctx, pixel, "#3B2754", 1/5, 1/6, 5/6, 1/2) + autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/2, 0) } } elements.molten_obsidian = { diff --git a/mods/nousersthings.js b/mods/nousersthings.js index ac5316f0..d4c995cb 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1,4 +1,11 @@ // Gallium is the best element +async function _nousersthingsprompt(message, defaultValue = "") { // thanks to ggod for updated prompt function + return new Promise(resolve => { + promptInput(message, (result) => { + resolve(result); + }, "nousersthings.js is asking you...", defaultValue); + }) +} behaviors.RADSOLID = [ "XX|CR:radiation%1|XX", "CR:radiation%1|XX|CR:radiation%1", @@ -854,11 +861,9 @@ elements.destroyable_e_pipe = { currentChannel = 0; elements.channel_pipe = { color: "#414c4f", - onSelect: function() { - var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined)); - if (!answer3) { return } - currentChannel = answer3; - logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes."); + onSelect: async function() { + currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined)) + logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Channel pipes only give pixels to channel pipes with the same channel."); }, tick: function(pixel) { if (pixel.start===pixelTicks){ @@ -977,11 +982,9 @@ elements.channel_pipe = { }, elements.destroyable_channel_pipe = { color: "#414c4f", - onSelect: function() { - var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined)); - if (!answer3) { return } - currentChannel = answer3; - logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes."); + onSelect: async function() { + currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined)) + logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes."); }, tick: function(pixel) { if (pixel.start === pixelTicks){ @@ -1328,8 +1331,8 @@ elements.bridge_pipe = { filterTypeVar = 0; elements.filter = { color: "#599fc2", - onSelect: function() { - var answer4 = prompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined)); + onSelect: async function() { + var answer4 = await _nousersthingsprompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined)); if (!answer4) { return } filterTypeVar = answer4; }, @@ -1559,11 +1562,11 @@ elements.converter = { } } }, - onSelect: function() { - var answer5 = prompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined)); + onSelect: async function() { + var answer5 = await _nousersthingsprompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined)); if (!answer5) { return } converter1Var = answer5; - var answer6 = prompt("Please input what it should turn into.",(converter2Var||undefined)); + var answer6 = await _nousersthingsprompt("Please input what it should turn into.",(converter2Var||undefined)); if (!answer6) { return } converter2Var = answer6; }, @@ -2302,8 +2305,8 @@ elements.element_filler = { excludeRandom: true, state: "solid", movable: "false", - onSelect: function() { - var answer6 = prompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined)); + onSelect: async function() { + var answer6 = await _nousersthingsprompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined)); if (!answer6) { return } elemfillerVar = mostSimilarElement(answer6); }, @@ -2335,8 +2338,8 @@ elements.inner_outliner = { color: elements.filler.color, category: elements.filler.category, excludeRandom: true, - onSelect: function() { - var answerot = prompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined)); + onSelect: async function() { + var answerot = await _nousersthingsprompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined)); if (!answerot) { return } outlinerVar = mostSimilarElement(answerot); }, @@ -2566,8 +2569,8 @@ elements.selective_void = { excludeRandom: true, state: "solid", movable: "false", - onSelect: function() { - var selvoidans = prompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined)); + onSelect: async function() { + var selvoidans = await _nousersthingsprompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined)); if (!selvoidans) { return } selvoid = mostSimilarElement(selvoidans); }, @@ -2594,8 +2597,8 @@ elements.scuffed_circle_brush = { excludeRandom: true, state: "solid", movable: false, - onSelect: function(){ - var answerE = prompt("Element of the brush.",(circleElem||undefined)); + onSelect: async function(){ + var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined)); if (!answerE) { return } circleElem = mostSimilarElement(answerE); }, @@ -2616,8 +2619,8 @@ elements.scuffed_triangle_brush = { excludeRandom: true, state: "solid", movable: false, - onSelect: function(){ - var answerE = prompt("Element of the brush.",(circleElem||undefined)); + onSelect: async function(){ + var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined)); if (!answerE) { return } circleElem = mostSimilarElement(answerE); }, @@ -2666,8 +2669,8 @@ elements.grid_brush = { behavior: behaviors.WALL, category: "special", movable: false, - onSelect: function() { - var gridans = prompt("Please input the desired element of this grid brush",(gridElem||undefined)); + onSelect: async function() { + var gridans = await _nousersthingsprompt("Please input the desired element of this grid brush",(gridElem||undefined)); if (!gridans) { return } gridElem = mostSimilarElement(gridans); }, @@ -2733,11 +2736,11 @@ elements.ray_emitter = { behavior: behaviors.WALL, category: "machines", movable: false, - onSelect: function(pixel){ - var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined)); + onSelect: async function(pixel){ + var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined)); if (!rayans) { return } rayElement = mostSimilarElement(rayans); - var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false)); + var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false)); if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true} }, hoverStat: function(pixel){ @@ -2849,37 +2852,37 @@ elements.specific_ray_emitter = { behavior: behaviors.WALL, category: "machines", movable: false, - onSelect: function(pixel){ - var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined)); + onSelect: async function(pixel){ + var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined)); if (!rayans) { return } rayElement = mostSimilarElement(rayans); if (rayElement != "ray"){rainbowMode = false} - var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false)); + var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false)); if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true} - var rayans3 = prompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0)); + var rayans3 = await _nousersthingsprompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0)); if (!rayans3) { return } specificRayStart = rayans3 - var rayans4 = prompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0)); + var rayans4 = await _nousersthingsprompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0)); if (!rayans4) { return } specificRayEnd = rayans4 - var rayans5 = prompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0)); + var rayans5 = await _nousersthingsprompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0)); if (!rayans5) { return } specificRayAngle = rayans5 if (isNaN(parseFloat(specificRayAngle))){ specificRayAngle = "nah" } - var rayans6 = prompt("What element should the ray stop at?", (stopAtElement||"wall")); + var rayans6 = await _nousersthingsprompt("What element should the ray stop at?", (stopAtElement||"wall")); if (!rayans6) { return } stopAtElement = mostSimilarElement(rayans6) let rayans7 - if (rayans == "ray"){ rayans7 = prompt("How long should the ray stay on screen in ticks?", (rayLife||10)); + if (rayans == "ray"){ rayans7 = await _nousersthingsprompt("How long should the ray stay on screen in ticks?", (rayLife||10)); if (!rayans7) { return } if (isNaN(parseFloat(rayans7))){ rayLife = 10 } else { rayLife = rayans7 } - var rayans8 = prompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no")); + var rayans8 = await _nousersthingsprompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no")); if (rayans8 == "yes"){rainbowMode = true} else {rainbowMode = false} } }, @@ -2978,8 +2981,8 @@ elements.run_some_code = { category: "tools", canPlace: false, tool: function(){}, - onSelect: function(){ - let code = prompt("Enter code to run") + onSelect: async function(){ + let code = await _nousersthingsprompt("Enter code to run") if (code){ eval(code) } @@ -3096,8 +3099,8 @@ elements.piston_ray_emitter = { behavior: behaviors.WALL, category: "machines", movable: false, - onSelect: function(){ - var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase(); + onSelect: async function(){ + var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase(); if (ans1 == "pull"){pullOrPush = 1} else if (ans1 == "push"){pullOrPush = 2} }, @@ -3187,22 +3190,22 @@ elements.specific_piston_ray_emitter = { behavior: behaviors.WALL, category: "machines", movable: false, - onSelect: function(){ - var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase(); + onSelect: async function(){ + var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase(); if (ans1 == "pull"){pullOrPush = 1} else if (ans1 == "push"){pullOrPush = 2} - var ans2 = parseInt(prompt("How offset should the start of the push/pulling be?", "0")) + var ans2 = parseInt(await _nousersthingsprompt("How offset should the start of the push/pulling be?", "0")) pistonStart = ans2 - var ans3 = parseInt(prompt("How offset should the end of the push/pulling be?", "20")) + var ans3 = parseInt(await _nousersthingsprompt("How offset should the end of the push/pulling be?", "20")) pistonEnd = ans3 - var ans4 = parseInt(prompt("How far should it push the pixels each charge?", "1")) + var ans4 = parseInt(await _nousersthingsprompt("How far should it push the pixels each charge?", "1")) pistonDistance = ans4 - var ans5 = parseInt(prompt("How many ticks should it wait to be charged again?", "6")) + var ans5 = parseInt(await _nousersthingsprompt("How many ticks should it wait to be charged again?", "6")) pistonCooldown = ans5 - var ans6 = parseInt(prompt("How many times should it repeat the push/pulling?", "1")) + var ans6 = parseInt(await _nousersthingsprompt("How many times should it repeat the push/pulling?", "1")) pistonRepeat = ans6 if (pistonRepeat != 1){ - var ans7 = parseInt(prompt("How many ticks should it wait between repeats?", "1")) + var ans7 = parseInt(await _nousersthingsprompt("How many ticks should it wait between repeats?", "1")) pistonRepeatCooldown = ans7 } }, @@ -3468,8 +3471,8 @@ elements.lattice_brush = { color: elements.grid_brush.color, behavior: behaviors.WALL, category: "special", - onSelect: function(){ - let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood") + onSelect: async function(){ + let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood") latticeElem = mostSimilarElement(ans1) }, tick: function(pixel){ @@ -3490,8 +3493,8 @@ elements.spaced_lattice_brush = { color: elements.grid_brush.color, behavior: behaviors.WALL, category: "special", - onSelect: function(){ - let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood") + onSelect: async function(){ + let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood") latticeElem = mostSimilarElement(ans1) }, tick: function(pixel){ @@ -3516,8 +3519,8 @@ elements.outer_outliner = { color: elements.inner_outliner.color, behavior: behaviors.WALL, category: "special", - onSelect: function(){ - let ans1 = prompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood") + onSelect: async function(){ + let ans1 = await _nousersthingsprompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood") outlinerElem = mostSimilarElement(ans1) }, tick: function(pixel){ @@ -3622,8 +3625,8 @@ elements.copycat_filler = { color: elements.random.color, behavior:behaviors.WALL, category: "special", - onSelect: function(){ - let ans1 = prompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand") + onSelect: async function(){ + let ans1 = await _nousersthingsprompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand") copycatfillerElem = mostSimilarElement(ans1) }, tick: function(pixel){ @@ -3799,8 +3802,8 @@ elements.pipe_transmitter = { movable: false, canContain: true, insulate: true, - onSelect: () => { - let newChannel = prompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar); + onSelect: async () => { + let newChannel = await _nousersthingsprompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar); pipe_transmitter_channelVar = newChannel; }, tick: (pixel) => { @@ -3830,8 +3833,8 @@ elements.pipe_receiver = { movable: false, canContain: true, insulate: true, - onSelect: () => { - let newChannel = prompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar); + onSelect: async () => { + let newChannel = await _nousersthingsprompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar); pipe_receiver_channelVar = newChannel; }, tick: (pixel) => { @@ -3911,8 +3914,8 @@ elements.sign = { color: "#FFFFFF", darkText: true, category: "special", - onSelect: function(){ - let signi = prompt("What text should the sign display?", signInput||"Hello World!") + onSelect: async function(){ + let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!") signInput = signi; }, renderer: function(pixel, ctx){ @@ -3925,8 +3928,8 @@ elements.e_sign = { darkText: true, category: "special", movable: false, - onSelect: () => { - let signi = prompt("What text should the sign display?", signInput||"Hello World!") + onSelect: async () => { + let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!") signInput = signi; }, renderer: function(pixel, ctx){ @@ -3972,8 +3975,8 @@ elements.mod_dectector = { category: "machines", movable: false, excludeRandom: true, - onSelect: () => { - let newMod = prompt("What mod should this machine detect?", "nousersthings.js"||modName) + onSelect: async () => { + let newMod = await _nousersthingsprompt("What mod should this machine detect?", "nousersthings.js"||modName) machinemodName = newMod }, tick: (pixel) => { From 9f2a58146a2f673d53a0b6de64a97eb83ee89f88 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 13 May 2025 18:59:37 -0400 Subject: [PATCH 14/18] d --- mods/10kelements.js | 2 +- mods/minecraft.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/10kelements.js b/mods/10kelements.js index d325bd03..f449d333 100644 --- a/mods/10kelements.js +++ b/mods/10kelements.js @@ -14,7 +14,7 @@ elements.change_count = { canPlace: false, behavior: behaviors.SELFDELETE, onSelect: async function() { - var cans = _GNPrompt("Please input how many elements you would like to be generared each time.", "10kelements.js is asking you...", 10000); + var cans = await _GNPrompt("Please input how many elements you would like to be generared each time.", "10kelements.js is asking you...", 10000); if (!cans) { return } if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); promptText("skin"); return} if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); promptText("sand"); return} diff --git a/mods/minecraft.js b/mods/minecraft.js index 50171a06..45b3a391 100644 --- a/mods/minecraft.js +++ b/mods/minecraft.js @@ -657,7 +657,7 @@ elements.sculk_wifi_receiver = { return pixel.channel || "unset" }, onSelect: async function(){ - let ans1 = _GNPrompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...", channelVar||0) + let ans1 = await _GNPrompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...", channelVar||0) channelVar = ans1 }, tick: function(pixel){ From d6382dea93260fec34bd93cad36b92d7e50fa934 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Wed, 14 May 2025 17:31:19 -0400 Subject: [PATCH 15/18] this is the weapons.js update everyone has been waiting for --- mods/jaydsfunctions.js | 43 +++++++++---- mods/jaydstuff.js | 138 ++++++++++++++++++++++++++++++++++++++--- mods/weapons.js | 39 ++++++++++-- 3 files changed, 193 insertions(+), 27 deletions(-) diff --git a/mods/jaydsfunctions.js b/mods/jaydsfunctions.js index 61f0c00c..0d392c1d 100644 --- a/mods/jaydsfunctions.js +++ b/mods/jaydsfunctions.js @@ -1,4 +1,21 @@ //jaydsfunctions +async function _jaydfunctionjsprompt(message, defaultValue = "") { + + + return new Promise(resolve => { + + + promptInput(message, (result) => { + + + resolve(result); + + + }, "jaydfunction.js is asking you...", defaultValue); + + + }) +} erase1Var = 0; elements.selective_eraser = { color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"], @@ -8,8 +25,8 @@ elements.selective_eraser = { deletePixel(pixel.x, pixel.y); } }, - onSelect: function() { - var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what element should be erased.",(erase1Var||undefined)); if (!answer1) { return } erase1Var = answer1; } @@ -23,8 +40,8 @@ elements.selective_exploder = { changePixel(pixel, "explosion") } }, - onSelect: function() { - var answer1 = prompt("Please input what element to explode.",(explode1Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what element to explode.",(explode1Var||undefined)); if (!answer1) { return } explode1Var = answer1; } @@ -40,11 +57,11 @@ elements.converter_tool = { changePixel(pixel, convert22Var) } }, - onSelect: function() { - var answer1 = prompt("Please input what should element be converted.",(convert11Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what should element be converted.",(convert11Var||undefined)); if (!answer1) { return } convert11Var = answer1; - var answer2 = prompt("Please input what element to convert into.",(convert22Var||undefined)); + var answer2 = await _jaydfunctionjsprompt("Please input what element to convert into.",(convert22Var||undefined)); if (!answer2) { return } convert22Var = answer2; } @@ -81,8 +98,8 @@ elements.exclusive_eraser = { deletePixel(pixel.x, pixel.y); } }, - onSelect: function() { - var answer1 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what element shouldn't be erased.",(exclude1Var||undefined)); if (!answer1) { return } exclude1Var = answer1; } @@ -128,8 +145,8 @@ elements.selective_paint_tool = { delete pixel.origColor; } }, - onSelect: function() { - var answer1 = prompt("Please input what element should be painted.",(paint1Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint1Var||undefined)); if (!answer1) { return } paint1Var = answer1; }, @@ -157,8 +174,8 @@ elements.exclusive_paint_tool = { delete pixel.origColor; } }, - onSelect: function() { - var answer1 = prompt("Please input what element should be painted.",(paint2Var||undefined)); + onSelect: async function() { + var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint2Var||undefined)); if (!answer1) { return } paint2Var = answer1; }, diff --git a/mods/jaydstuff.js b/mods/jaydstuff.js index 54cc0a71..52747cce 100644 --- a/mods/jaydstuff.js +++ b/mods/jaydstuff.js @@ -1,7 +1,23 @@ //jaydstuff //ooooo dependencies -if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); alert("'nousersthings.js' is (not) a dependency for 'jaydstuff.js.js' and has been added. Please reload for it to take effect, also im dumb.") } -else { +if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); window.location.reload(); }; +async function _jaydstuffjsprompt(message, defaultValue = "") { + + + return new Promise(resolve => { + + + promptInput(message, (result) => { + + + resolve(result); + + + }, "jaydstuff.js is asking you...", defaultValue); + + + }) +} elements.super_raincloud = { color: "#0000ff", behavior: [ @@ -132,7 +148,7 @@ elements.heavy_steam = { "iron": { elem1:"oxygen", elem2:"rust", chance:0.005 }, "steel": { elem1:"oxygen", elem2:"rust", chance:0.004 }, }, - temp: 150, + temp: 150, tempLow: 95, extraTempLow: { 0: "heavy_rime" @@ -633,19 +649,124 @@ elements.upquake = { cooldown: defaultCooldown, excludeRandom: true, }, +elements.legacy_earthquake = { + color: ["#bda791","#997756","#613d19"], + tick: function(pixel) { + if (pixel.stage) { + var coords = circleCoords(pixel.x,pixel.y,pixel.stage); + if (pixel.stage >= pixel.mag) { + deletePixel(pixel.x,pixel.y); + return; + } + coords.forEach(function(coord){ + var x = coord.x; + var y = coord.y; + if (!isEmpty(x,y,true)) { + var p = pixelMap[x][y]; + if (p.element === "legacy_earthquake") { + if (pixel !== p) { + pixel.mag += 3; + deletePixel(p.x,p.y); + } + return; + } + if (elements[p.element].breakInto) { + if (Math.random() < (elements[p.element].hardness || 1) * 0.25) { + breakPixel(p); + } + } + if (p.del || !elements[p.element].movable) { return } + tryMove(p,p.x,p.y-1); + } + }) + pixel.stage++; + } + else if (!tryMove(pixel,pixel.x,pixel.y+1)) { + // random 10 to 20 + pixel.mag = Math.floor(Math.random() * 10) + 20; + pixel.stage = 1; + } + }, + category: "weapons", + state: "solid", + density: 100000000, + maxSize: 1, + cooldown: defaultCooldown, + excludeRandom: true, +}, +// textures.rue = [ +// [8,8,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +// [8,9,8,0,0,0,0,0,0,0,0,0,14,7,8,7,14,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0], +// [9,10,9,8,0,9,10,9,9,9,8,14,7,8,9,8,14,14,14,14,14,14,14,0,0,0,0,0,0,0,0,0], +// [8,9,10,9,8,10,10,9,9,9,9,7,8,9,8,7,14,14,14,14,14,14,14,14,14,0,0,0,0,0,0,0], +// [8,8,9,10,8,9,9,9,9,9,9,7,9,8,7,7,13,13,13,13,13,13,13,14,14,13,0,0,0,0,0,0], +// [8,8,9,10,8,8,9,9,9,9,7,7,9,8,7,7,13,13,13,13,13,13,13,13,13,14,13,0,0,0,0,0], +// [8,9,10,9,8,8,8,8,8,8,7,7,8,9,8,7,13,13,13,13,13,13,13,13,13,13,14,12,0,0,0,0], +// [9,10,9,8,14,8,8,8,8,7,7,13,7,8,9,8,13,13,13,13,13,13,13,13,13,13,13,12,11,0,0,0], +// [8,9,8,14,14,14,14,13,13,13,13,13,1,7,8,7,13,13,13,13,13,13,1,1,13,13,13,13,12,17,0,0], +// [8,8,14,14,14,14,13,13,13,13,13,1,1,1,7,7,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0,0], +// [0,14,14,14,14,13,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0], +// [0,14,14,14,14,13,13,13,1,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,1,13,12,17,0], +// [0,14,14,14,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,13,12,17,0], +// [14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17], +// [14,14,14,14,13,13,13,13,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,13,13,13,12,17], +// [14,14,14,14,13,13,13,13,1,1,1,1,16,16,2,13,13,13,13,13,13,1,1,1,1,16,16,2,13,13,12,17], +// [14,14,14,13,13,13,1,16,14,14,14,1,1,1,16,16,1,13,13,1,16,14,14,14,1,1,1,16,16,1,12,17], +// [14,14,14,13,13,13,1,14,14,14,13,1,1,1,16,16,1,13,13,1,14,14,14,13,1,1,1,16,16,1,12,17], +// [14,14,14,14,13,13,1,1,14,13,1,1,1,1,16,16,1,13,13,1,1,14,13,1,1,1,1,16,16,1,12,17], +// [14,14,14,14,13,13,1,1,1,1,1,16,14,1,16,16,1,13,13,1,1,1,1,1,16,14,1,16,16,1,12,17], +// [0,14,14,14,13,13,1,1,1,1,1,14,12,2,16,16,1,13,13,1,1,1,1,1,14,12,2,16,16,1,17,0], +// [0,14,14,14,13,13,1,1,1,1,1,1,1,16,16,16,1,13,13,1,1,1,1,1,1,1,16,16,16,1,17,0], +// [0,14,14,14,14,13,13,1,1,1,1,2,16,16,16,16,1,13,13,1,1,1,1,1,2,16,16,16,16,1,17,0], +// [0,0,14,14,14,14,13,1,16,16,16,16,16,16,16,1,13,13,13,13,1,16,16,16,16,16,16,16,1,17,0,0], +// [0,0,14,14,14,14,13,13,1,16,16,16,16,16,1,13,13,13,13,13,13,1,16,16,16,16,16,1,12,17,0,0], +// [0,0,0,13,14,14,14,14,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,12,17,0,0,0], +// [0,0,0,0,13,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17,0,0,0,0], +// [0,0,0,0,0,12,12,13,13,14,14,14,13,13,13,13,13,13,1,13,13,13,13,13,13,12,17,0,0,0,0,0], +// [0,0,0,0,0,0,12,12,12,13,13,13,14,14,14,13,13,1,13,1,13,13,13,12,12,17,0,0,0,0,0,0], +// [0,0,0,0,0,0,0,11,11,12,12,12,13,13,13,13,13,13,13,13,12,12,12,17,17,0,0,0,0,0,0,0], +// [0,0,0,0,0,0,0,0,0,17,17,17,12,12,12,12,12,12,12,12,17,17,17,0,0,0,0,0,0,0,0,0], +// [0,0,0,0,0,0,0,0,0,0,0,0,17,17,17,17,17,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0], + +// ] +// elements.rue = { +// color: ["#000000","#111111","#333333","#555555","#777777","#999999","#bbbbbb","#dddddd","#ffffff"], +// colorPattern: textures.rue, +// colorKey: { +// "0": "#000000", +// "1": "#000000", +// "2": "#111111", +// "3": "#333333", +// "4": "#444444", +// "5": "#555555", +// "6": "#666666", +// "7": "#19bb20", +// "8": "#19bebe", +// "9": "#32d458", +// "10": "#32d5c6", +// "11": "#ddc231", +// "12": "#ebcc28", +// "13": "#ffe458", +// "14": "#ffed91", +// "15": "#f0f0f0", +// "16": "#ffffff", +// "17": "#cdb322", +// }, +// }, + createAtXvar = 0; createAtYvar = 0; create1var = ""; elements.element_spawner = { color: "#71797E", - onSelect: function() { - var answer1 = prompt("Please input the x value.",(createAtXvar||undefined)); + onSelect: async function() { + var answer1 = await _jaydstuffjsprompt("Please input the x value.",(createAtXvar||undefined)); if (!answer1) {return} createAtXvar = parseInt(answer1); - var answer2 = prompt("Please input the y value.",(createAtYvar||undefined)); + var answer2 = await _jaydstuffjsprompt("Please input the y value.",(createAtYvar||undefined)); if (!answer2) {return} createAtYvar = parseInt(answer2); - var answer3 = prompt("Please input what element should spawn.",(create1var||undefined)); + var answer3 = await _jaydstuffjsprompt("Please input what element should spawn.",(create1var||undefined)); if (!answer3) {return} create1var = answer3; }, @@ -659,7 +780,4 @@ elements.element_spawner = { conduct: 1, state: "solid", category: "machines" -//hello nouser if you are reading this: }; -}; -//get triggered \ No newline at end of file diff --git a/mods/weapons.js b/mods/weapons.js index c44cb455..461641b2 100644 --- a/mods/weapons.js +++ b/mods/weapons.js @@ -1,3 +1,20 @@ +async function _weaponsjsprompt(message, defaultValue = "") { + + + return new Promise(resolve => { + + + promptInput(message, (result) => { + + + resolve(result); + + + }, "weapons.js is asking you...", defaultValue); + + + }) +} elements.tsar_bomba = { color: "#524C41", behavior: [ @@ -873,14 +890,14 @@ createAtYvar = 0; create1var = ""; elements.element_spawner = { color: "#71797E", - onSelect: function() { - var answer1 = prompt("Please input the x value.",(createAtXvar||undefined)); + onSelect: async function() { + var answer1 = await _weaponsjsprompt("Please input the x value.",(createAtXvar||undefined)); if (!answer1) {return} createAtXvar = parseInt(answer1); - var answer2 = prompt("Please input the y value.",(createAtYvar||undefined)); + var answer2 = await _weaponsjsprompt("Please input the y value.",(createAtYvar||undefined)); if (!answer2) {return} createAtYvar = parseInt(answer2); - var answer3 = prompt("Please input what element should spawn.",(create1var||undefined)); + var answer3 = await _weaponsjsprompt("Please input what element should spawn.",(create1var||undefined)); if (!answer3) {return} create1var = answer3; }, @@ -1252,4 +1269,18 @@ elements.right_uranium_bullet = { excludeRandom: true, cooldown: defaultCooldown, temp: 4000, +}, +elements.cluster_nuke = { + color: "#323232", + ignore: "cluster_nuke", + category: "weapons", + behavior: behaviors.POWDER, + maxSize: 1, + tick: (pixel) => { + for (var y = 1; y < 50; y++) { + if (!isEmpty(pixel.x, pixel.y + y, false)) { + explodeAt(pixel.x,pixel.y,50,["dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","nuke",]) + } + } + } } \ No newline at end of file From 27514551153ebb3919853ff0270aecf1609e35e4 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Wed, 14 May 2025 17:35:35 -0400 Subject: [PATCH 16/18] Add files via upload --- mods/weapons.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/weapons.js b/mods/weapons.js index 461641b2..4f03a2ce 100644 --- a/mods/weapons.js +++ b/mods/weapons.js @@ -571,7 +571,7 @@ elements.bombs_for_throwing_at_you_left = { behavior: [ "XX|EX:10>bomb|XX", "XX|XX|XX", - "M1|M1%10 AND EX:10>bomb|XX", + "M1 AND EX:10>bomb|M1%10 AND EX:10>bomb|XX", ], density: 1300, excludeRandom: true, @@ -594,7 +594,7 @@ elements.bombs_for_throwing_at_you_right = { behavior: [ "XX|EX:10>bomb|XX", "XX|XX|XX", - "XX|M1%10 AND EX:10>bomb|M1", + "XX|M1%10 AND EX:10>bomb|M1 AND EX:10>bomb", ], density: 1300, excludeRandom: true, From 4213f0945c42d7f341c24683a581b95a7603b5c2 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Fri, 16 May 2025 13:09:56 -0400 Subject: [PATCH 17/18] Version 1.11.2 - May 16, 2025 - Steam Release [Version 1.11.2 - May 16, 2025 - Steam Release] + Sandboxels is now on Steam! https://store.steampowered.com/app/3664820/Sandboxels/ + Theme color setting + Destroyable border mode + Support for Korean, Italian, Serbian, and Australian English [Changes] ~ Backgrounds of menus are blurred ~ Solids are no longer affected by Void or Loop borders ~ World gen is surrounded by Wall with Void or Loop borders + Notice when window is resized for the first time ~ Saves Menu, Mod Manager, Debug, and Reset settings use native Sandboxels prompts [Bug Fixes] ~ Fixed: Category buttons show underscores in names ~ Fixed: World gen doesn't fill entire canvas horizontally ~ Fixed: Elements dynamically added repeatedly aren't selectable [Technical] + Multiple mods can be added at once, separated by semicolon (;) + 'locked' element property, will prevent selection when set to true + 'fancy' view property, will allow rendering with Fancy Pixels off when set to false --- changelog.html | 22 ++ changelog.txt | 20 ++ index.html | 561 ++++++++++++++++++----------- lang/en.json | 1 - lang/en_au.json | 2 +- lang/es.json | 2 +- lang/fr.json | 2 +- lang/he.json | 2 +- lang/id.json | 2 +- lang/it.json | 2 +- lang/ko.json | 2 +- lang/nl.json | 2 +- lang/pt_br.json | 2 +- lang/qha.json | 2 +- lang/qvp.json | 2 +- lang/ru.json | 2 +- lang/sr.json | 2 +- lang/vi.json | 2 +- lang/xem.json | 2 +- lang/zh_cn.json | 2 +- mods/velocity2.js | 8 +- style.css | 895 ++++++++++++++++++++++++---------------------- 22 files changed, 879 insertions(+), 660 deletions(-) delete mode 100644 lang/en.json diff --git a/changelog.html b/changelog.html index f47bedb6..c569cf65 100644 --- a/changelog.html +++ b/changelog.html @@ -109,6 +109,28 @@

The original plain text version of this is still maintained.

+

[Version 1.11.2 - May 16, 2025 - Steam Release]

+ +

[Version 1.11.1 - April 1, 2025 - FOOLS-2-5]