diff --git a/changelog.txt b/changelog.txt index 4ed50c55..eb60c9e4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -91,9 +91,9 @@ A fancier version of this changelog can be found here: https://sandboxels.R74n.c ~ Fixed: Gaps when drawing fast on mobile ~ Fixed: Middle clicking empty space causes freeze ~ Fixed: Bless and Rock Wall can't be drawn in a line - ~ Fixed: Gapes when drawing Bless and Rock Wall fast + ~ Fixed: Gaps when drawing Bless and Rock Wall fast ~ Fixed: Bless and Rock Wall don't display info - ~ Fixed: Bless and Rock can't use Replace Mode + ~ Fixed: Bless and Rock Wall can't use Replace Mode ~ Fixed: Brown Dwarf Suns can emit Light when eclipsed ~ Fixed: Language selector doesn't update on refresh ~ Fixed: Mouse size continues increasing past max size diff --git a/index.html b/index.html index b1fd40f3..5497b621 100644 --- a/index.html +++ b/index.html @@ -13087,7 +13087,7 @@ behaviorRules = { function circleCoords(x,y,radius) { var coords = []; for (let i = Math.max(0, x - radius); i <= Math.min(width, x + radius); i++) { - for (let j = Math.max(0, y - radius); j <= Math.min(width, y + radius); j++) { + for (let j = Math.max(0, y - radius); j <= Math.min(height, y + radius); j++) { if (Math.pow(i - x, 2) + Math.pow(j - y, 2) <= Math.pow(radius, 2)) { coords.push({x: i,y: j}); } @@ -15492,6 +15492,7 @@ window.onload = function() { function autoGen(newname,element,autoType) { var autoInfo = autoElements[autoType]; var newcolor = elements[element].colorObject; + if (!newcolor) { newcolor = {r:255,g:255,b:255} }; var colorList = []; var colorObjectList = []; // if newcolor is not an array, put it in an array diff --git a/mod-list.html b/mod-list.html index 441c6ccc..e89a809a 100644 --- a/mod-list.html +++ b/mod-list.html @@ -136,6 +136,7 @@ elementsManager.jsCreate and edit custom elementsggod evenmoretemptools.jsAdds different temperature-modifying tools (±350/tick, NaN, and Infinity)Alice extra_element_info.jsAdds descriptions to various vanilla elements. Used to provide the functionality that desc now does before it was added to vanillaMelecie +extrasaveslots.jsAdds extra saves slots !SAVE IMPORTANT SAVES AS FILES!Jayd find.jsAdds a find mode that highlights a chosen element as pulsating red and yellow (read commit description)Alice jaydsfunctions.jsAdds extra toolsJayd insane_random_events.jsMassively buffs random eventsAlice @@ -144,6 +145,7 @@ moretools.jsAdds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)Sightnado move_tools.jsAdds tools that move pixelsAlice noconfirm.jsRemoves all confirmation pop upsmollthecoder +nopixellimit.jsRemoves the pixel limitJayd page_color.jsAllows changing the background color outside of the canvas with the “pageColor” query parameterAlice pixelResizeTool.jsAdds a button to change pixel scalefeeshmaster prompt.jsAdds a primitive command consoleAlice @@ -285,6 +287,7 @@ elem3.jsAdds all elements and combinations from Elemental 3 [Very Large]Sophie fools+.jsimproves and makes fools.js EXTREMELY annoying.SquareScreamYT funny elements 2022-11-15.jsAdds a few curated randomly-generated elementsAlice +funnynames.jsAdds various ways to mess with the names of elementsnousernamefound funny_solid.jsAdds fecesAlice haseulite.jsAdds Loona-related materials with various propertiesAlice lactose_intolerance_and_celiac.jsMakes humans explode on contact with milk, wheat, bread, or toastNubo318 @@ -387,4 +390,4 @@ - + \ No newline at end of file diff --git a/mods/nopixellimit.js b/mods/nopixellimit.js new file mode 100644 index 00000000..a563e1e6 --- /dev/null +++ b/mods/nopixellimit.js @@ -0,0 +1,2 @@ + maxPixelCount = settings.maxpixels || Number.MAX_VALUE; + if (settings.maxpixels === 0) { maxPixelCount = Number.MAX_VALUE; } \ No newline at end of file diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 5aedfe34..e9614c07 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1722,7 +1722,7 @@ elements.pn_explosion = { elements.smasher = { color: "#606060", behavior: behaviors.WALL, - category: "machines", + category: "deprecated", tick: function(pixel){ for (var i = 0; i < squareCoords.length; i++) { var coord = squareCoords[i]; @@ -1735,11 +1735,13 @@ elements.smasher = { } }, movable: false, + hidden: true }, +/* elements.mixer = { color: "#F0F0F0", behavior: behaviors.WALL, - category: "machines", + category: "deprecated", tick: function(pixel){ pixel.mixList = []; for (var i = 0; i < squareCoords.length; i++) { @@ -1767,7 +1769,9 @@ elements.mixer = { }, movable: false, noMix: true, + hidden: true, }, +*/ elements.invisiblesupport = { color: "#000000", behavior: behaviors.WALL, @@ -2898,4 +2902,15 @@ elements.specific_ray_emitter = { } }, insulate: true, +} +elements.run_some_code = { + color: "#68b2cf", + category: "tools", + canPlace: false, + onSelect: function(){ + let code = prompt("Enter code to run") + if (code){ + eval(code) + } + } } \ No newline at end of file diff --git a/mods/pullers.js b/mods/pullers.js index 70602c4a..1f88c621 100644 --- a/mods/pullers.js +++ b/mods/pullers.js @@ -2,6 +2,14 @@ // a sandboxels mod that adds pullers /* ==CHANGELOG== + Version 2.0.0 +@voidapex11 +~set max size of the mod description to 1 ++gravity cells ++black hole + it acts like void but it has gravity +~for modders, the gravity range of black holes and gravity cells is customisable + Version 1.2.1 @voidapex11 ~fixed error @@ -254,8 +262,8 @@ elements.up_puller = { state: "solid", } -if (enabledMods.includes("pushers.js")) { - console.log('compatibility with pushers.js and imovable objects coming in a later update of the pullers.js\neventualy...') +if (enabledMods.includes("mods/pushers.js")) { + console.info('compatibility with pushers.js and imovable objects coming in a later update of the pullers.js') } e_pullerColour='#c3a5d6' @@ -350,4 +358,118 @@ elements.up_e_puller = { hardness: 0.85, conduct: 1, state: "solid", -} \ No newline at end of file +} + +function removeItemOnce(arr, value) { + var index = arr.indexOf(value); + if (index > -1) { + arr.splice(index, 1); + console.log('hit') + } + return arr; +} + +elements.gravity_cell = { + color: pullerColour, + properties: { + range: 3, + }, + tick: function(pixel) { + pixel.color = ("#" + ((192 + Math.abs((pixelTicks * 4) % 64)).toString(16) + "e0ad").padStart(6, '0')); + for (j=0; j <=pixel.range; j++) { + + // generate the cooridinates that nabough the grav cell + cords=circleCoords(pixel.x, pixel.y, j) + for (i in cords) { + pos = cords[i] + if (!isEmpty(pos.x,pos.y)&&!(pos.x==pixel.x&&pos.y==pixel.y)){ + x = (pixel.x-pos.x) + y = (pixel.y-pos.y) + + if (x<0) { + x=-1 + } else if (x>0){ + x=1 + } + + if (y<0) { + y=-1 + } else if (y>0){ + y=1 + } + + try { + tryMove(pixelMap[pos.x][pos.y], pos.x+x, pos.y+y) + } catch (error) {}// if there is an error, its probably out of bounds, not my problem :) + } + } + } + doDefaults(pixel); + }, + category: "machines", + density: 10000, + hardness: 1, + conduct: 0, + state: "solid", +} + + +elements.black_hole = { + color: elements.void.color, + maxSize: 1, + properties: { + range: 10, + immovable: true, + }, + tick: function(pixel) { + + for (j=0; j <=pixel.range; j++) { + + // generate the cooridinates that neighbour the black hole + cords=circleCoords(pixel.x, pixel.y, j) + for (i in cords) { + pos = cords[i] + if (!isEmpty(pos.x,pos.y)&&!(pos.x==pixel.x&&pos.y==pixel.y)){ + x = (pixel.x-pos.x) + y = (pixel.y-pos.y) + + if (x<0) { + x=-1 + } else if (x>0){ + x=1 + } + + if (y<0) { + y=-1 + } else if (y>0){ + y=1 + } + + try { + tryMove(pixelMap[pos.x][pos.y], pos.x+x, pos.y+y) + } catch (error) {}// if there is an error, its probably out of bounds, not my problem :) + } + } + } + + for (let i = -1; i < 2; i++) { + for (let j = -1; j < 2; j++) { + if (!isEmpty(pixel.x+j,pixel.y+i) && !outOfBounds(pixel.x+j,pixel.y+i)&&!((i==0)&&(j==0))) { + deletePixel(pixel.x+j,pixel.y+i) + } + } + } + + doDefaults(pixel); + }, + category: "machines", + density: 10000, + hardness: 1, + temp: -273.15, + insulate:true, + conduct: 0, + excludeRandom: true, + noMix: true, + state: "solid", + movable: false +}