From ab4e5a69a217b4ae7973eeb988c7d25dd8e4b0fe Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Fri, 20 Sep 2024 20:28:54 -0700 Subject: [PATCH 1/4] made the mod actually good --- mods/sandboxels.js | 358 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 351 insertions(+), 7 deletions(-) diff --git a/mods/sandboxels.js b/mods/sandboxels.js index afa6e439..b9d044ed 100644 --- a/mods/sandboxels.js +++ b/mods/sandboxels.js @@ -11,15 +11,17 @@ elements.sandboxels_screen_off = { stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], conduct: 1, breakInto: "glass_shard", - tempLow: -50, + tempLow: -80, stateLow: "glass_shard", category: "digital", state: "solid", density: 1200, - }, + desc: "Shock to turn on." +}, - elements.sandboxels_screen = { +elements.sandboxels_screen = { name:"screen", + hidden:true, color: "#1D1D1D", behavior: [ "XX|XX|XX", @@ -35,16 +37,20 @@ elements.sandboxels_screen_off = { category: "digital", state: "solid", density: 1200, - }, +}, - elements.sand_screen = { +elements.sand_screen = { name:"screen", + hidden:true, color: "#e6d577", behavior: [ "XX|XX|XX", "XX|XX|XX", - "SW:sandboxels_screen|SW:sandboxels_screen|SW:sandboxels_screen", + "XX|XX|XX", ], + properties: { + dtemp: 20, + }, tempHigh: 1500, stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], conduct: 1, @@ -52,7 +58,345 @@ elements.sandboxels_screen_off = { tempLow: -45, stateLow: "sandboxels_screen_off", category: "digital", + tick: function(pixel) { + if (!isEmpty(pixel.x,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"sand_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"sand_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"sand_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"sand_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"sandboxels_screen"); + } + } + else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"sand_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"sand_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + } + } + }, state: "solid", density: 1200, - }; +}, + +elements.rock_screen = { + name:"screen", + hidden:true, + color: ["#808080","#4f4f4f","#949494"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + properties: { + dtemp: 20, + }, + tempHigh: 1500, + stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], + conduct: 1, + breakInto: ["glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","sand"], + tempLow: -45, + stateLow: "sandboxels_screen_off", + category: "digital", + tick: function(pixel) { + if (!isEmpty(pixel.x,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"rock_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"rock_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"rock_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"rock_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"sandboxels_screen"); + } + } + else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"rock_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"rock_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + } + } + }, + state: "solid", + density: 1200, +}, + +elements.water_screen = { + name:"screen", + hidden:true, + color: "#2167ff", + behavior: [ + "XX|XX|XX", + "SW:sandboxels_screen|XX|SW:sandboxels_screen", + "SW:sandboxels_screen|XX|SW:sandboxels_screen", + ], + properties: { + dtemp: 20, + }, + tempHigh: 1500, + stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], + conduct: 1, + breakInto: ["glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","water"], + tempLow: -45, + stateLow: "sandboxels_screen_off", + category: "digital", + tick: function(pixel) { + if (Math.random() > 0.2 && !isEmpty(pixel.x,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"water_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"water_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + } + else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"water_screen"); + + changePixel(pixel,"sandboxels_screen"); + } + } + } + else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"water_screen"); + changePixel(pixel,"sandboxels_screen"); + } + } + else if (!isEmpty(pixel.x-1,pixel.y,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"water_screen"); + changePixel(pixel,"sandboxels_screen"); + } + } + if (pixel.dtemp < 1) { changePixel(pixel,"ice_screen") } + }, + state: "solid", + density: 1200, +}, + +elements.ice_screen = { + name:"screen", + hidden:true, + color: "#b2daeb", + behavior: behaviors.WALL, + properties: { + dtemp: 0, + }, + tempHigh: 1500, + stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], + conduct: 1, + breakInto: ["glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","ice"], + tempLow: -45, + stateLow: "sandboxels_screen_off", + category: "digital", + tick: function(pixel) { + if (pixel.dtemp > 0) { changePixel(pixel,"water_screen") } + }, + state: "solid", + density: 1200, +}, + +elements.digital_sand = { + color: "#e6d577", + behavior: [ + "CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen", + "CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen", + "CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen|CH:sandboxels_screen>sand_screen", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sandboxels_screen.id) { + changePixel(pixel,"sand_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on screen to place digital sand." +}, + +elements.digital_rock = { + color: ["#808080","#4f4f4f","#949494"], + behavior: [ + "CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen", + "CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen", + "CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen|CH:sandboxels_screen>rock_screen", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sandboxels_screen.id) { + changePixel(pixel,"rock_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on screen to place digital sand." +}, + +elements.digital_water = { + color: "#2167ff", + behavior: [ + "CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen", + "CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen", + "CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen|CH:sandboxels_screen>water_screen", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sandboxels_screen.id) { + changePixel(pixel,"water_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to place digital water." +}, + +elements.digital_ice = { + color: "#b2daeb", + behavior: [ + "CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen", + "CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen", + "CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen|CH:sandboxels_screen>ice_screen", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sandboxels_screen.id) { + changePixel(pixel,"ice_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to place digital ice." +}, + +elements.digital_heat = { + color: "#ff0000", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sand_screen.id) { + pixel.dtemp += 2 + } + else if (elements[pixel.element].id === elements.rock_screen.id) { + pixel.dtemp += 2 + } + else if (elements[pixel.element].id === elements.water_screen.id) { + pixel.dtemp += 2 + } + else if (elements[pixel.element].id === elements.ice_screen.id) { + pixel.dtemp += 2 + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to heat digital elements." +}, + +elements.digital_cool = { + color: "#0000ff", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sand_screen.id) { + pixel.dtemp -= 2 + } + else if (elements[pixel.element].id === elements.rock_screen.id) { + pixel.dtemp -= 2 + } + else if (elements[pixel.element].id === elements.water_screen.id) { + pixel.dtemp -= 2 + } + else if (elements[pixel.element].id === elements.ice_screen.id) { + pixel.dtemp -= 2 + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to cool digital elements." +}, + +elements.digital_smash = { + color: ["#666666","#888888","#666666"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.rock_screen.id) { + changePixel(pixel,"sand_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to smash digital elements." +}; From e467df979c53ee8285d12c9a3d25139676a676c4 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Fri, 20 Sep 2024 20:31:05 -0700 Subject: [PATCH 2/4] added my mod to the mod list --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index a955aaac..126f54e6 100644 --- a/mod-list.html +++ b/mod-list.html @@ -229,6 +229,7 @@ portal.jsAdds portals that can teleport pixelsAlice pullers.jsAdds pixels that pull pixels towards themvoidapex11 pushers.jsAdds pixels that push elements away from themAlice +sandboxels.jsAdds a digital screen to play a mini version of sandboxels, in sandboxels!Nekonico spouts.jsAdds spouts for all liquidskaeud state_voids.jsAdds several elements that each delete a specific state of matter (and combinations thereof)Alice switches.jsAdds electrical switches that can be toggledAlice From ceaf2f5d1b72b8350733b37f2d39cc55f5ce2862 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:33:17 -0700 Subject: [PATCH 3/4] Semi-accurate heat transfer --- mods/sandboxels.js | 458 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 417 insertions(+), 41 deletions(-) diff --git a/mods/sandboxels.js b/mods/sandboxels.js index b9d044ed..8f3aaf56 100644 --- a/mods/sandboxels.js +++ b/mods/sandboxels.js @@ -63,7 +63,9 @@ elements.sand_screen = { var newPixel = pixelMap[pixel.x][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"sand_screen"); + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; } else if (newPixel.element === "water_screen") { changePixel(newPixel,"sand_screen"); @@ -71,26 +73,29 @@ elements.sand_screen = { newPixel.dtemp = pixel.dtemp; changePixel(pixel,"water_screen"); } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { var newPixel = pixelMap[pixel.x+1][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"sand_screen"); - - changePixel(pixel,"sandboxels_screen"); - } - else if (newPixel.element === "water_screen") { - changePixel(newPixel,"sand_screen"); - pixel.dtemp = newPixel.dtemp; newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); - } - } - else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { - var newPixel = pixelMap[pixel.x-1][pixel.y+1]; - if (newPixel.element === "sandboxels_screen") { - changePixel(newPixel,"sand_screen"); - - changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; } else if (newPixel.element === "water_screen") { changePixel(newPixel,"sand_screen"); @@ -98,6 +103,53 @@ elements.sand_screen = { newPixel.dtemp = pixel.dtemp; changePixel(pixel,"water_screen"); } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"sand_screen"); + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"sand_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } } } }, @@ -129,7 +181,9 @@ elements.rock_screen = { var newPixel = pixelMap[pixel.x][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"rock_screen"); + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; } else if (newPixel.element === "water_screen") { changePixel(newPixel,"rock_screen"); @@ -137,26 +191,29 @@ elements.rock_screen = { newPixel.dtemp = pixel.dtemp; changePixel(pixel,"water_screen"); } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { var newPixel = pixelMap[pixel.x+1][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"rock_screen"); - - changePixel(pixel,"sandboxels_screen"); - } - else if (newPixel.element === "water_screen") { - changePixel(newPixel,"rock_screen"); - pixel.dtemp = newPixel.dtemp; newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); - } - } - else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { - var newPixel = pixelMap[pixel.x-1][pixel.y+1]; - if (newPixel.element === "sandboxels_screen") { - changePixel(newPixel,"rock_screen"); - - changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; } else if (newPixel.element === "water_screen") { changePixel(newPixel,"rock_screen"); @@ -164,6 +221,53 @@ elements.rock_screen = { newPixel.dtemp = pixel.dtemp; changePixel(pixel,"water_screen"); } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + changePixel(newPixel,"rock_screen"); + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "water_screen") { + changePixel(newPixel,"rock_screen"); + pixel.dtemp = newPixel.dtemp; + newPixel.dtemp = pixel.dtemp; + changePixel(pixel,"water_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } } } }, @@ -195,22 +299,74 @@ elements.water_screen = { var newPixel = pixelMap[pixel.x][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"water_screen"); + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; } else if (Math.random() > 0.5 && !isEmpty(pixel.x+1,pixel.y+1,true)) { var newPixel = pixelMap[pixel.x+1][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"water_screen"); - + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; } } else if (!isEmpty(pixel.x-1,pixel.y+1,true)) { var newPixel = pixelMap[pixel.x-1][pixel.y+1]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"water_screen"); - + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; } } } @@ -218,17 +374,176 @@ elements.water_screen = { var newPixel = pixelMap[pixel.x+1][pixel.y]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"water_screen"); + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; } } else if (!isEmpty(pixel.x-1,pixel.y,true)) { var newPixel = pixelMap[pixel.x-1][pixel.y]; if (newPixel.element === "sandboxels_screen") { changePixel(newPixel,"water_screen"); + newPixel.dtemp = pixel.dtemp; changePixel(pixel,"sandboxels_screen"); + pixel.dtemp = 0; + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "steam_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; } } - if (pixel.dtemp < 1) { changePixel(pixel,"ice_screen") } + if (pixel.dtemp < 0) { changePixel(pixel,"ice_screen") } + if (pixel.dtemp > 99) { changePixel(pixel,"steam_screen") } + }, + state: "solid", + density: 1200, +}, + +elements.steam_screen = { + name:"screen", + hidden:true, + color: "#abd6ff", + behavior: [ + "SW:sandboxels_screen|XX|SW:sandboxels_screen", + "XX|XX|XX", + "SW:sandboxels_screen|XX|SW:sandboxels_screen", + ], + properties: { + dtemp: 150, + }, + tempHigh: 1500, + stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"], + conduct: 1, + breakInto: ["glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","glass_shard","water"], + tempLow: -45, + stateLow: "sandboxels_screen_off", + category: "digital", + tick: function(pixel) { + if (Math.random() > 0.75 && !isEmpty(pixel.x+1,pixel.y-1,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y-1]; + if (newPixel.element === "sandboxels_screen") { + newPixel.dtemp = pixel.dtemp; + changePixel(newPixel,"steam_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "water_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + else if (Math.random() > 0.75 && !isEmpty(pixel.x-1,pixel.y-1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y-1]; + if (newPixel.element === "sandboxels_screen") { + newPixel.dtemp = pixel.dtemp; + changePixel(newPixel,"steam_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "water_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + else if (Math.random() > 0.75 && !isEmpty(pixel.x+1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x+1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + newPixel.dtemp = pixel.dtemp; + changePixel(newPixel,"steam_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "water_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + else if (Math.random() > 0.5 && !isEmpty(pixel.x-1,pixel.y+1,true)) { + var newPixel = pixelMap[pixel.x-1][pixel.y+1]; + if (newPixel.element === "sandboxels_screen") { + newPixel.dtemp = pixel.dtemp; + changePixel(newPixel,"steam_screen"); + changePixel(pixel,"sandboxels_screen"); + } + else if (newPixel.element === "ice_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "water_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "sand_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + else if (newPixel.element === "rock_screen") { + newPixel.dtemp = ((pixel.dtemp + newPixel.dtemp) / 2); + pixel.dtemp = newPixel.dtemp; + } + } + if (pixel.dtemp < 100) { changePixel(pixel,"water_screen") } }, state: "solid", density: 1200, @@ -250,7 +565,7 @@ elements.ice_screen = { stateLow: "sandboxels_screen_off", category: "digital", tick: function(pixel) { - if (pixel.dtemp > 0) { changePixel(pixel,"water_screen") } + if (pixel.dtemp > 5) { changePixel(pixel,"water_screen") } }, state: "solid", density: 1200, @@ -328,6 +643,24 @@ elements.digital_ice = { desc: "Use on a screen to place digital ice." }, +elements.digital_steam = { + color: "#abd6ff", + behavior: [ + "CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen", + "CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen", + "CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen|CH:sandboxels_screen>steam_screen", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sandboxels_screen.id) { + changePixel(pixel,"steam_screen"); + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to place digital ice." +}, + elements.digital_heat = { color: "#ff0000", behavior: [ @@ -337,16 +670,19 @@ elements.digital_heat = { ], tool: function(pixel) { if (elements[pixel.element].id === elements.sand_screen.id) { - pixel.dtemp += 2 + pixel.dtemp += 1 } else if (elements[pixel.element].id === elements.rock_screen.id) { - pixel.dtemp += 2 + pixel.dtemp += 1 } else if (elements[pixel.element].id === elements.water_screen.id) { - pixel.dtemp += 2 + pixel.dtemp += 1 + } + else if (elements[pixel.element].id === elements.steam_screen.id) { + pixel.dtemp += 1 } else if (elements[pixel.element].id === elements.ice_screen.id) { - pixel.dtemp += 2 + pixel.dtemp += 1 } }, insulate:true, @@ -364,16 +700,19 @@ elements.digital_cool = { ], tool: function(pixel) { if (elements[pixel.element].id === elements.sand_screen.id) { - pixel.dtemp -= 2 + pixel.dtemp -= 1 } else if (elements[pixel.element].id === elements.rock_screen.id) { - pixel.dtemp -= 2 + pixel.dtemp -= 1 } else if (elements[pixel.element].id === elements.water_screen.id) { - pixel.dtemp -= 2 + pixel.dtemp -= 1 + } + else if (elements[pixel.element].id === elements.steam_screen.id) { + pixel.dtemp -= 1 } else if (elements[pixel.element].id === elements.ice_screen.id) { - pixel.dtemp -= 2 + pixel.dtemp -= 1 } }, insulate:true, @@ -382,6 +721,36 @@ elements.digital_cool = { desc: "Use on a screen to cool digital elements." }, +elements.digital_roomtemp = { + color: "#b1c96d", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + tool: function(pixel) { + if (elements[pixel.element].id === elements.sand_screen.id) { + pixel.dtemp = 20 + } + else if (elements[pixel.element].id === elements.rock_screen.id) { + pixel.dtemp = 20 + } + else if (elements[pixel.element].id === elements.water_screen.id) { + pixel.dtemp = 20 + } + else if (elements[pixel.element].id === elements.steam_screen.id) { + pixel.dtemp = 20 + } + else if (elements[pixel.element].id === elements.ice_screen.id) { + pixel.dtemp = 20 + } + }, + insulate:true, + canPlace: false, + category: "digital", + desc: "Use on a screen to make digital elements room temperature." +}, + elements.digital_smash = { color: ["#666666","#888888","#666666"], behavior: [ @@ -399,4 +768,11 @@ elements.digital_smash = { category: "digital", desc: "Use on a screen to smash digital elements." }; - + +if (!elements.malware.reactions) { elements.malware.reactions = {} } + elements.malware.reactions.sandboxels_screen = { "elem2": ["sand_screen","sandboxels_screen_off",null], chance:0.1 }; + elements.malware.reactions.sand_screen = { "elem2": ["ice_screen","sandboxels_screen_off",null], chance:0.1 }; + elements.malware.reactions.rock_screen = { "elem2": ["water_screen","sandboxels_screen_off",null], chance:0.1 }; + elements.malware.reactions.water_screen = { "elem2": ["steam_screen","sandboxels_screen_off",null], chance:0.1 }; + elements.malware.reactions.steam_screen = { "elem2": ["rock_screen","sandboxels_screen_off",null], chance:0.1 }; + elements.malware.reactions.ice_screen = { "elem2": ["sand_screen","sandboxels_screen_off",null], chance:0.1 }; From 2c2a32c36e8b61392fccfcffe97c533bc7266581 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:57:46 -0400 Subject: [PATCH 4/4] Update mod-list.html - fix grammar --- mod-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index 126f54e6..34ffb190 100644 --- a/mod-list.html +++ b/mod-list.html @@ -229,7 +229,7 @@ portal.jsAdds portals that can teleport pixelsAlice pullers.jsAdds pixels that pull pixels towards themvoidapex11 pushers.jsAdds pixels that push elements away from themAlice -sandboxels.jsAdds a digital screen to play a mini version of sandboxels, in sandboxels!Nekonico +sandboxels.jsAdds a digital screen to play a mini version of SandboxelsNekonico spouts.jsAdds spouts for all liquidskaeud state_voids.jsAdds several elements that each delete a specific state of matter (and combinations thereof)Alice switches.jsAdds electrical switches that can be toggledAlice