Merge branch 'R74nCom:main' into main

This commit is contained in:
Nekonico 2024-11-23 15:07:50 -08:00 committed by GitHub
commit f426943b8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1489 additions and 32 deletions

View File

@ -17768,7 +17768,7 @@ Cancer, Landmine, Grenade, Smoke Grenade">?</span>
<!-- <p>If you'd like to support us, consider donating on <a href="https://www.paypal.com/donate/?hosted_button_id=GCX4VHQ7SZWTN" target="_blank">PayPal</a> or <a href="https://cash.app/$emojiartist" target="_blank" title="$emojiartist">CashApp</a>, or subscribing on Discord.</p> -->
<p>Business inquiries? Education stories? Help needed? Email us at <a href="mailto:contact@R74n.com?subject=%5BSandboxels%5D">contact@R74n.com</a>!</p>
<p>More links: <a href="https://sandboxels.R74n.com/help" rel="help">Help</a><a href="https://sandboxels.R74n.com/tips">Tips</a><a href="https://sandboxels.R74n.com/mod-list">Mods</a><a href="https://sandboxels.R74n.com/mobile-use">Mobile</a><a href="https://sandboxels.R74n.com/offline-use">Offline</a><a href="https://R74n.com/privacy">Privacy</a></p>
<p>Thanks to our Patrons: Serioustar, ggod, Midi_png, personman, fnl4y, PitsPower, swagg boi, moss, WeiChei, Trent, u2ce</p>
<p>Thanks to our Patrons: Serioustar, ggod, Midi_png, personman, fnl4y, PitsPower, swagg boi, moss, Suss, WeiChei, Trent, u2ce</p>
<p style="display:none" id="langCredit">Translation by R74n</p>
<p>Sandboxels is developed by R74n. Check out <a href="https://R74n.com" rel="author" target="_blank">our other projects</a>!</p>
<script>

View File

@ -158,7 +158,6 @@
<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>
<tr><td>invertscroll.js</td><td>Inverts the scroll wheel for adjusting brush size</td><td>SquareScreamYT</td></tr>
<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>
@ -370,7 +369,6 @@
<tr><td>changePixelDebug.js</td><td>Makes the changePixel() function abort and log to console when it tries to change to a non-existent element</td><td>Alice</td></tr>
<tr><td>changeTempReactionParameter.js</td><td>Adds the changeTemp property to modded reactions</td><td>Alice</td></tr>
<tr><td>code_library.js</td><td>Adds functions and variables common to some other mods</td><td>Alice</td></tr>
<tr><td>CrashTestDummy.js</td><td>Originally a test to see if certain code broke the game, but now just adds a tool that turns things into sand</td><td>StellarX20</td></tr>
<tr><td>customexplosion.js</td><td>Added a custom explosion element and interface for it. check out its <a href="https://sandboxels-mods.the-enchanteden.repl.co/Mods/customexplosion.js">source code</a> for how modders can use it.</td><td>Alex</td></tr>
<tr><td>date_test.js</td><td>K-pop idol birthday testing stuff</td><td>Alice</td></tr>
<tr><td>drawPixels_change_test.js</td><td>A test of altering drawPixels(). Gives burning pixels a red overlay similar to the yellow overlay for charged pixels</td><td>Alice</td></tr>
@ -398,6 +396,7 @@
<!----><tr><td class="modCat" colspan="3">Broken or Deprecated</td></tr><!---->
<tr class="deprecated"><td>humans.js</td><td>Adds humans. Now part of the base game</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>invertscroll.js</td><td>Inverts the scroll wheel for adjusting brush size (now a setting)</td><td>SquareScreamYT</td></tr>
<tr class="deprecated"><td>mobile_shift.js</td><td>Adds a button for shift on mobile (Now in the base game)</td><td>SquareScreamYT</td></tr>
<tr class="deprecated"><td>nopixellimit.js</td><td>Removes the pixel limit. (now a setting)</td><td>Jayd</td></tr>
<tr class="deprecated"><td>unhide.js</td><td>Unhides all elements except molten ones. (This functionality now exists as a vanilla setting)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>

View File

@ -1,8 +0,0 @@
// This new crashtestdummy mod will be more used for code that I'm not sure will actually work
elements.sandreplacer = {
color: "#ff80ff",
tool: function(pixel) {
pixel.element = "sand"
},
category: "tools",
};

View File

@ -303,7 +303,7 @@ elements.e_SuperHeater = {
desc: "Works like the Super Heater but needs power to work",
hardness: 0.5,
state: "solid",
behavior: behaviors.WALL,
color: "#595656",
conduct: 1,
category: "machines",
color: "#881111",
@ -775,7 +775,7 @@ elements.Destructive_Filter = {
color: "#3c6c85",
desc: "A filter that destroys anything that isn't allowed to get through",
onSelect: function() {
var answer4 = prompt("Please input the desired element of this filter. It is case senstive.",(filterTypeVar||undefined));
var answer4 = prompt("Please input the desired element of this filter.The the desired element will not get destroyed but everything else will.",(filterTypeVar||undefined));
if (!answer4) { return }
filterTypeVar2 = answer4;
},
@ -860,7 +860,10 @@ elements.Destructive_Filter = {
pixel.con.del;
moved = true;
break;
}
} else if (!(newPixel.element == pixel.filterType) && !(newPixel.element == pixel.element)) {
deletePixel(newPixel.x,newPixel.y);
}
}
}
@ -1201,6 +1204,7 @@ elements.E_Spout = {
conduct: 1,
}
elements.DestroyableWire = {
color: "#4d0a03",
behavior: behaviors.WALL,
@ -1899,27 +1903,23 @@ elements.Missile_Up = {
"uranium_particles": { elem1:null, elem2:"supernova", chance:0.000001}
},
category: "???????",
}
}
ignoreGate = ["wall", "wire", "battery"];
elements.air_filter = {
color: "#414c4f",
tick: function(pixel) {
pixel.stage = 2
if (!pixel.stage && pixelTicks-pixel.start > 60) {
for (var i = 0; i < squareCoords.length; i++) {
var coord = squareCoords[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
// delete this bc it makes the pipe walls
// if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable) {
// deletePixel(x,y)
// }
// if (isEmpty(x,y)) {
// createPixel("pipe_wall",x,y);
// }
}
pixel.stage = 2;
}
@ -1929,12 +1929,7 @@ elements.Missile_Up = {
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
pixel.stage = 2;
// this makes the thing blue and keep pixel.stage = 2 cuz without it it breaks the code
// if (isEmpty(x,y)) {
// pixel.stage = 2; //blue
// pixel.color = pixelColorPick(pixel,"#000036");
// break;
// }
}
}
else if (pixel.stage > 1 && pixelTicks % 3 === pixel.stage-2) { //initialized
@ -1947,9 +1942,7 @@ elements.Missile_Up = {
if (newPixel.stage === 1) {
var newColor;
switch (pixel.stage) {
case 2: newPixel.stage = 3; newColor = "#003600"; break; //green
case 3: newPixel.stage = 4; newColor = "#360000"; break; //red
case 4: newPixel.stage = 2; newColor = "#000036"; break; //blue
}
newPixel.color = pixelColorPick(newPixel,newColor);
}
@ -2023,3 +2016,323 @@ elements.Missile_Up = {
canContain: true,
}
function checkPixels(pixel, upOrDown) {
var change = null;
var x = pixel.x;
var y = pixel.y;
for (let i = 0; i < 7; i++) {
if (upOrDown == true) {
if (!isEmpty(x, y - i)) {
var sensed = pixelMap[x][pixel.y - i];
if (!(sensed.element == pixel.element)) {
// if (sensed.element.category === "solids") {
tryMove(sensed, sensed.x, sensed.y - 1);
// }
}
}
} else if (upOrDown == false) {
if (!isEmpty(x, y + i)) {
var sensed = pixelMap[x][pixel.y + i];
if (!(sensed.element == pixel.element)) {
// if (sensed.element.category === "solids") {
tryMove(sensed, sensed.x, sensed.y + 1);
// }
}
}
}
}
}
function checkPixels2(pixel, BringupOrDown) {
var change = null;
var x = pixel.x;
var y = pixel.y;
for (let i = 0; i < 7; i++) {
if (BringupOrDown == true) {
if (!isEmpty(x, y - i)) {
var sensed = pixelMap[x][pixel.y - i];
if (!(sensed.element == pixel.element)) {
// if (sensed.element.category === "solids") {
tryMove(sensed, sensed.x, sensed.y + 1);
// }
}
}
} else if (BringupOrDown == false) {
if (!isEmpty(x, y + i)) {
var sensed = pixelMap[x][pixel.y + i];
if (!(sensed.element == pixel.element)) {
// if (sensed.element.category === "solids") {
tryMove(sensed, sensed.x, sensed.y - 1);
// }
}
}
}
}
}
elements.Repel_Up_Magnet = {
color: "#595656",
behavior: behaviors.WALL,
singleColor: true,
category: "machines",
state: "solid",
tick: function(pixel){
checkPixels(pixel,true)
}
}
elements.Repel_Down_Magnet = {
color: "#595656",
singleColor: true,
category: "machines",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
checkPixels(pixel,false)
}
}
elements.Magnet_Pull_Down = {
color: "#595656",
singleColor: true,
category: "machines",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
checkPixels2(pixel,true)
}
}
elements.Magnet_Pull_Up = {
color: "#595656",
singleColor: true,
category: "machines",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
checkPixels2(pixel,false)
}
}
elements.Nucler_Fusion = {
color: "#595656",
maxSize: 1,
behavior: behaviors.WALL,
tick: function(pixel) {
if(pixel.start) {
explodeAt(pixel.x, pixel.y, 13, ["fire","fire","plasma","plasma","plasma","plasma"]);
}
}
}
SelectedX = null;
SelectedY = null;
elements.WireLessPower = {
color: "#595656",
singleColor: true,
category: "machines",
state: "solid",
behavior: behaviors.WALL,
conduct : 1,
onSelect: function() {
var answer4 = prompt("X pos",(SelectedX||undefined));
if (!answer4) { return }
SelectedX = answer4;
var answer5 = prompt("Y pos",(SelectedY||undefined));
if (!answer5) { return }
SelectedY = answer5;
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.SelX = SelectedX;
pixel.SelY = SelectedY;
pixel.placed = false;
}
if(isEmpty(pixel.SelX,pixel.SelY) && pixel.placed == false){
createPixel("wire",pixel.SelX,pixel.SelY);
pixel.placed = true;
}
if(pixel.chargeCD) {
if (!isEmpty(pixel.SelX,pixel.SelY)) {
var sensed = pixelMap[pixel.SelX][pixel.SelY];
if(!sensed) {return}
if (!sensed.chargeCD && !sensed.charge) sensed.charge = 1;
}
}
}
}
// elements.E_Gate = {
// name: "E-Gate",
// color: "#414c4f",
// conduct : 1,
// tick: function(pixel) {
// pixel.stage = 2
// if (!pixel.stage && pixelTicks-pixel.start > 60) {
// for (var i = 0; i < squareCoords.length; i++) {
// var coord = squareCoords[i];
// var x = pixel.x+coord[0];
// var y = pixel.y+coord[1];
// }
// pixel.stage = 2;
// }
// else if (pixel.stage === 1 && pixelTicks-pixel.start > 70) { //uninitialized
// for (var i = 0; i < adjacentCoords.length; i++) {
// var coord = adjacentCoords[i];
// var x = pixel.x+coord[0];
// var y = pixel.y+coord[1];
// pixel.stage = 2;
// }
// }
// else if (pixel.stage > 1 && pixelTicks % 3 === pixel.stage-2) { //initialized
// for (var i = 0; i < squareCoords.length; i++) {
// var coord = squareCoords[i];
// var x = pixel.x+coord[0];
// var y = pixel.y+coord[1];
// if (!isEmpty(x,y,true) && pixelMap[x][y].element === "pipe") {
// var newPixel = pixelMap[x][y];
// if (newPixel.stage === 1) {
// var newColor;
// switch (pixel.stage) {
// }
// newPixel.color = pixelColorPick(newPixel,newColor);
// }
// }
// }
// var moved = false;
// shuffleArray(squareCoordsShuffle);
// for (var i = 0; i < squareCoordsShuffle.length; i++) {
// var coord = squareCoordsShuffle[i];
// var x = pixel.x+coord[0];
// var y = pixel.y+coord[1];
// if (!isEmpty(x,y,true)) {
// var newPixel = pixelMap[x][y];
// if (newPixel.element === "pipe") {
// var nextStage;
// switch (pixel.stage) {
// }
// if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to jacent pipe
// newPixel.con = pixel.con;
// newPixel.con.x = newPixel.x;
// newPixel.con.y = newPixel.y;
// pixel.con = null;
// moved = true;
// break;
// }
// }
// else if (!pixel.con && pixel.chargeCD & !(newPixel.element == pixel.element)&& !(ignoreGate.includes(newPixel.element))) { //suck up pixel
// pixel.con = newPixel;
// deletePixel(newPixel.x,newPixel.y);
// pixel.con.x = pixel.x;
// pixel.con.y = pixel.y;
// pixel.con.del;
// moved = true;
// break;
// }
// }
// }
// if (pixel.con && !moved) { // move to same stage if none other
// for (var i = 0; i < squareCoordsShuffle.length; i++) {
// var coord = squareCoordsShuffle[i];
// var x = pixel.x+coord[0];
// var y = pixel.y+coord[1];
// if (isEmpty(x,y)) {
// delete pixel.con.del;
// pixel.con.x = x;
// pixel.con.y = y;
// pixelMap[x][y] = pixel.con;
// currentPixels.push(pixel.con);
// pixel.con = null;
// break;
// }
// if (!isEmpty(x,y,true) && pixelMap[x][y].element === "pipe") {
// var newPixel = pixelMap[x][y];
// if (pixel.con && !newPixel.con && newPixel.stage === pixel.stage) {
// newPixel.con = pixel.con;
// newPixel.con.x = newPixel.x;
// newPixel.con.y = newPixel.y;
// pixel.con = null;
// break;
// }
// }
// }
// }
// }
// doDefaults(pixel);
// },
// category: "machines",
// movable: false,
// canContain: true,
// }
// RangeSelected = null;
// elements.fan = {
// color: "#595656",
// category: "machines",
// state: "solid",
// conduct : 1,
// behavior : behaviors.WALL,
// onSelect: function() {
// var answer4 = prompt("Enter a range for how far the fan blows.",(RangeSelected||undefined));
// if (!answer4) { return }
// RangeSelected = answer4;
// },
// tick: function(pixel){
// if (pixel.start === pixelTicks) {
// pixel.RangeBlow = RangeSelected
// }
// for (let i = 0; i < pixel.RangeBlow; i++) {
// if (!isEmpty(pixel.x+1, pixel.y)) {
// var sensed = pixelMap[pixel.x+1][pixel.y];
// if (!sensed) {return}
// if (!(sensed.element == pixel.element)) {
// if (elements[sensed.element].category == "gases" || elements[sensed.element].category == "powders") {
// tryMove(sensed, sensed.x+1, sensed.y );
// }
// }
// }
// }
// },
// }
// elements.test_Element = {
// color: "#595656",
// singleColor: true,
// category: "test",
// state: "solid",
// behavior : [
// ["XX","DL","XX"],
// ["DL","XX","DL"],
// ["M2","M1 AND DL","M2"]
// ],
// tick: function(pixel) {},
// conduct : 1,
// }

1124
mods/eklegems.js Normal file

File diff suppressed because it is too large Load Diff

29
mods/incinerators.js Normal file
View File

@ -0,0 +1,29 @@
elements.incinerator = {
color: "#e600ff",
desc: "A machine that works like the incinerate tool.",
behavior: [
"XX|HT:10000|XX",
"HT:10000|XX|HT:10000",
"XX|HT:10000|XX",
],
category: "machines",
state: "solid",
insulate:true,
};
elements.e_incinerator = {
color: "#9802a8",
desc: "It works like the incinerator but it needs power to work.",
behavior: behaviors.WALL,
hardness: 0.5,
conduct: 1,
behaviorOn: [
"XX|HT:10000|XX",
"HT:10000|XX|HT:10000",
"XX|HT:10000|XX",
],
name: "E-Incinerator",
category: "machines",
state: "solid",
insulate:true,
};