Merge branch 'R74nCom:main' into main

This commit is contained in:
DoobieRalsei 2024-05-16 09:42:33 -07:00 committed by GitHub
commit 2ad3170ba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 152 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -136,6 +136,7 @@
<tr><td>elementsManager.js</td><td>Create and edit custom elements</td><td>ggod</td></tr>
<tr><td>evenmoretemptools.js</td><td>Adds different temperature-modifying tools (±350/tick, NaN, and Infinity)</td><td>Alice</td></tr>
<tr><td>extra_element_info.js</td><td>Adds descriptions to various vanilla elements. Used to provide the functionality that desc now does before it was added to vanilla</td><td>Melecie</td></tr>
<tr><td>extrasaveslots.js</td><td>Adds extra saves slots !SAVE IMPORTANT SAVES AS FILES!</td><td>Jayd</td></tr>
<tr><td>find.js</td><td>Adds a find mode that highlights a chosen element as pulsating red and yellow <a href="https://github.com/R74nCom/sandboxels/commit/de0dc088ab4d928c77587b9d0e3a7d7663e3f94a">(read commit description)</a></td><td>Alice</td></tr>
<tr><td>jaydsfunctions.js</td><td>Adds extra tools</td><td>Jayd</td></tr>
<tr><td>insane_random_events.js</td><td>Massively buffs random events</td><td>Alice</td></tr>
@ -144,6 +145,7 @@
<tr><td>moretools.js</td><td>Adds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)</td><td>Sightnado</td></tr>
<tr><td>move_tools.js</td><td>Adds tools that move pixels</td><td>Alice</td></tr>
<tr><td>noconfirm.js</td><td>Removes all confirmation pop ups</td><td>mollthecoder</td></tr>
<tr><td>nopixellimit.js</td><td>Removes the pixel limit</td><td>Jayd</td></tr>
<tr><td>page_color.js</td><td>Allows changing the background color outside of the canvas with the “pageColor” query parameter</td><td>Alice</td></tr>
<tr><td>pixelResizeTool.js</td><td>Adds a button to change pixel scale</td><td>feeshmaster</td></tr>
<tr><td>prompt.js</td><td>Adds a primitive command console</td><td>Alice</td></tr>
@ -285,6 +287,7 @@
<tr><td>elem3.js</td><td>Adds all elements and combinations from Elemental 3 [Very Large]</td><td>Sophie</td></tr>
<tr><td>fools+.js</td><td>improves and makes fools.js EXTREMELY annoying.</td><td>SquareScreamYT</td></tr>
<tr><td>funny elements 2022-11-15.js</td><td>Adds a few curated randomly-generated elements</td><td>Alice</td></tr>
<tr><td>funnynames.js</td><td>Adds various ways to mess with the names of elements</td><td>nousernamefound</td></tr>
<tr><td>funny_solid.js</td><td>Adds feces</td><td>Alice</td></tr>
<tr><td>haseulite.js</td><td>Adds Loona-related materials with various properties</td><td>Alice</td></tr>
<tr><td>lactose_intolerance_and_celiac.js</td><td>Makes humans explode on contact with milk, wheat, bread, or toast</td><td>Nubo318</td></tr>
@ -387,4 +390,4 @@
</body>
</html>
</html>

2
mods/nopixellimit.js Normal file
View File

@ -0,0 +1,2 @@
maxPixelCount = settings.maxpixels || Number.MAX_VALUE;
if (settings.maxpixels === 0) { maxPixelCount = Number.MAX_VALUE; }

View File

@ -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)
}
}
}

View File

@ -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",
}
}
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
}