Merge branch 'R74nCom:main' into main

This commit is contained in:
guzzo86 2024-04-30 01:03:36 -04:00 committed by GitHub
commit 5b5c7d3f7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 387 additions and 36 deletions

View File

@ -16243,6 +16243,7 @@ Cancer, Landmine, Grenade, Smoke Grenade">?</span> <input type="button" value="O
<option value="zh_cn">简体中文</option>
</optgroup>
</select></p>
<p>Try our NEW GAME: <a href="https://R74n.com/cook/" target="_blank">Infinite Chef</a></p>
<p>Email us at <a href="mailto:contact@R74n.com">contact@R74n.com</a> for advertising, help, or education!</p>
<div id="newsletterFrame">Be notified when Sandboxels and other R74n projects are updated, along with ramblings from the developer!<br><br>
<form action="https://news.r74n.com/api/v1/free?nojs=true" method="post" class="form _form_1mxvn_6" novalidate="" target="_blank"><input type="hidden" name="first_url" value="https://news.r74n.com/embed"><input type="hidden" name="first_referrer"><input type="hidden" name="current_url" value="https://news.r74n.com/embed"><input type="hidden" name="current_referrer"><input type="hidden" name="referral_code"><input type="hidden" name="source" value="embed"><input type="hidden" name="referring_pub_id"><input type="hidden" name="additional_referring_pub_ids">

View File

@ -189,7 +189,7 @@
"bubble":"buborék",
"acid":"sav",
"neutral_acid":"semleges_sav",
"acid_gas":"savgáz",
"acid_gas":"savgőz",
"glue":"ragasztó",
"soda":"szénsavas_üdítőital",
"gray_goo":"szürke_ragacs",
@ -242,7 +242,7 @@
"sterling":"sterling_ezüst",
"gallium":"gallium",
"molten_gallium":"olvadt_gallium",
"gallium_gas":"gallium_gáz",
"gallium_gas":"galliumz",
"rose_gold":"rózsaarany",
"purple_gold":"lila_arany",
"blue_gold":"kék_arany",
@ -259,7 +259,7 @@
"molten_solder":"olvadt_forrasztó_fém",
"juice":"lé",
"juice_ice":"fagyott_lé",
"broth":"leves_leve",
"broth":"leves",
"milk":"tej",
"chocolate_milk":"csokis_tej",
"fruit_milk":"gyümölcsös_tej",
@ -357,7 +357,7 @@
"liquid_helium":"folyékony_hélium",
"sodium":"nátrium",
"molten_sodium":"olvadt_nátrium",
"sodium_gas":"nátrium_gáz",
"sodium_gas":"nátriumz",
"calcium":"kalcium",
"molten_calcium":"olvadt_kalcium",
"limestone":"mészkő",
@ -377,7 +377,7 @@
"fragrance":"illat",
"perfume":"parfüm",
"cyanide":"cián",
"cyanide_gas":"cián_gáz",
"cyanide_gas":"ciángáz",
"ozone":"ózon",
"cloud":"felfő",
"rain_cloud":"esőfelhő",
@ -394,7 +394,7 @@
"led_b":"kék_led",
"sulfur":"kén",
"molten_sulfur":"olvadt_kén",
"sulfur_gas":"kén_gáz",
"sulfur_gas":"kénz",
"copper_sulfate":"rézgálic",
"snake":"kígyó",
"loopy":"kacskaringós",
@ -426,7 +426,7 @@
"bead":"gyöngy",
"color_sand":"színes_homok",
"borax":"bórax",
"epsom_salt":"epsom_só",
"epsom_salt":"keserűsó",
"potassium_salt":"kálium_só",
"sodium_acetate":"nátrium-acetát",
"lightning":"villámcsapás",
@ -501,7 +501,7 @@
"molten_blue_gold":"olvadt_kék_arany",
"molten_electrum":"olvadt_elektrum",
"molten_pyrite":"olvadt_pirit",
"broth_ice":"fagyott_leves_leve",
"broth_ice":"fagyott_leves",
"frozen_vinegar":"fagyott_ecet",
"sauce_ice":"fagyott_szósz",
"alcohol_ice":"fagyott_alkohol",
@ -519,7 +519,7 @@
"molten_alga":"olvadt_alumínium-gallim_ötvözet",
"molten_metal_scrap":"olvadt_fémtörmelék",
"molten_borax":"olvadt_borax",
"molten_epsom_salt":"olvadt_epsom-só",
"molten_epsom_salt":"olvadt_keserűsó",
"molten_potassium_salt":"olvadt_kálium_só",
"molten_sodium_acetate":"olvadt_nátrium-acetát",
"frozen_nitro":"fagyott_nitroglicerin",
@ -539,5 +539,5 @@
"tsunami": "cunami",
"blaster": "plazmavető",
"propane_ice": "fagyott_propán",
"molten_caustic_potash": "Olvadt_kálium-hidroxid"
"molten_caustic_potash": "olvadt_kálium-hidroxid"
}

View File

@ -117,11 +117,12 @@
<tr><td>velocity.js</td><td>Beta for explosion velocity, and later wind, which may come to the base game in the future</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<!----><tr><td class="modCat" colspan="3">Tools & Settings</td></tr><!---->
<tr><td>adjustablepixelsize.js</td><td>Allows you to set the pixelSize with a URL parameter</td><td>Alice</td></tr>
<!-- <tr><td>adjustablepixelsize.js</td><td>Allows you to set the pixelSize with a URL parameter</td><td>Alice</td></tr> -->
<tr><td>betaworldgen.js</td><td>adds a more advanced world generation to the game</td><td>Adora</td></tr>
<tr><td>betterModManager.js</td><td>Improvements to the Mod Manager</td><td>ggod</td></tr>
<tr><td>betterSettings.js</td><td>Adds additional settings and functionality</td><td>ggod</td></tr>
<tr><td>betterStats.js</td><td>Separate “real” and “set” TPS, meaning you can see what the TPS actually is, instead of only seeing what its set to</td><td>mollthecoder</td></tr>
<tr><td>buildingreplicator.js</td><td>Scans and replicates builds anywhere on the screen, along with some preset submitted builds</td><td>nousernamefound</td></tr>
<tr><td>change.js</td><td>Adds a tool that only replaces existing pixels</td><td>Alice</td></tr>
<tr><td>color_tools.js</td><td>Adds tools that manipulate colors</td><td>Alice</td></tr>
<tr><td>controllable_pixel_test.js</td><td>Adds a pixel that can be controlled with the keyboard keys. <a href="https://github.com/R74nCom/sandboxels/commit/58dfa9477f2ed7ec9c44b00a35162e7c63bc129c">Read the commit description for more info.</a> [PC ONLY]</td><td>Alice</td></tr>

View File

@ -38,8 +38,8 @@ var randomProperty = function (obj) {
if (Math.abs(settings.randomcount) == settings.randomcount){
if (!settings.skineasteregg){
for (var i = 1; i <= settings.randomcount; i++){
var f = Math.random() < 0.2
var co = Math.random() < 0.2
var canHeat = Math.random() < 0.2
var canCold = Math.random() < 0.2
elements["element_"+i] = {
color: "#" + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)] + color[Math.floor(Math.random()*color.length)],
category: "random",
@ -49,11 +49,11 @@ if (Math.abs(settings.randomcount) == settings.randomcount){
density: randomIntFromInterval(1, 10000)
}
total = i
if (f){
if (canHeat){
elements["element_"+i].tempHigh = 20 + randomIntFromInterval(10, 6000)
elements["element_"+i].stateHigh = elementslist[Math.floor(Math.random()*elementslist.length)]
}
if (co){
if (canCold){
elements["element_"+i].tempLow = 20 - randomIntFromInterval(10, 270)
elements["element_"+i].stateLow = elementslist[Math.floor(Math.random()*elementslist.length)]
}

View File

@ -1,10 +1,8 @@
// Science mod for Sandboxels
// (Inspired by survival.js)
// Build 19
// By: Lucifer (@a_british_proto (Discord))
// If there is anything you want to suggest or there's a bug then just dm me on discord
// Build 20
// If there is anything you want to suggest or there's a bug then just dm me on discord (@a_british_proto)
// Todo:
// - Try to get the mod to work by making different ways to craft all the (116) elements in the mod
// - Make new substances that you can get after mixing different elements
// - Make a way to get the different substances by mixing different elements and different substances
// - Create different proporties for the substances (doing now)
@ -1383,7 +1381,7 @@ substance.Silver_Sulfate = {
hidden:true
}
// I have finally gotten my motivation back! :D
// Decided to just change the console.log to a comment because it got me confused between the github page and VSC
substance.Silver_Selenide = {
behavior: behaviors.WALL,
@ -1446,25 +1444,24 @@ substance.Aluminum_Diboride = {
hidden:true
}
// Doing this later as my schools blocked chatgpt and the definition is not on Ptable.com :/
// substance.Aluminum_Dodecaboride = {
// behavior: behaviors.NULL,
// color: "000000",
// category: "null",
// state: "null",
// hidden:true
// }
substance.Aluminum_Dodecaboride = {
behavior: behaviors.WALL,
color: "000000",
category: "lands",
state: "solid",
hidden:true
}
// substance.Aluminum_Bromate_Nonahydrate = {
// behavior: behaviors.NULL,
// color: "000000",
// category: "null",
// state: "null",
// hidden:true
// }
substance.Aluminum_Bromate_Nonahydrate = {
behavior: behaviors.WALL,
color: "FFFFFF",
category: "lands",
state: "solid",
hidden:true
}
substance.Aluminum_Tribromide = {
behavior: behavior.NULL, // It's meant to be a powder but I'm too tired to go look plus I need to go to my next lesson now
behavior: behavior.POWDER,
color: "FF0000",
category: "lands",
state: "powder",

213
mods/buildingreplicator.js Normal file
View File

@ -0,0 +1,213 @@
function playSound(soundFile) {
var audio = new Audio("https://JustAGenericUsername.github.io/" + soundFile);
audio.play();
}
function reverseObject(obj) {
const reversedObj = {};
for (const key in obj) {
const value = obj[key];
reversedObj[value] = key;
}
return reversedObj;
}
let blueprint = [
["0","0","0","0","0","G","G","G","G","G","0","0","0","0","0"],
["0","0","0","G","G","S","W","W","W","S","G","G","0","0","0"],
["0","0","G","W","W","S","W","W","W","S","W","W","G","0","0"],
["0","G","W","W","W","S","0","0","0","S","W","W","W","G","0"],
["0","G","W","W","0","0","0","0","0","0","0","W","W","G","0"],
["G","S","S","S","0","0","0","0","0","0","0","S","S","S","G"],
["G","W","W","0","0","0","0","0","0","0","0","0","W","W","G"],
["G","W","W","0","0","0","0","0","0","0","0","0","W","W","G"],
["G","W","W","0","0","0","0","0","0","0","0","0","W","W","G"],
["G","S","S","S","0","0","0","0","0","0","0","S","S","S","G"],
["0","G","W","W","0","0","0","0","0","0","0","W","W","G","0"],
["0","G","W","W","W","S","0","0","0","S","W","W","W","G","0"],
["0","0","G","W","W","S","W","W","W","S","W","W","G","0","0"],
["0","0","0","G","G","S","W","W","W","S","G","G","0","0","0"],
["0","0","0","0","0","G","G","G","G","G","0","0","0","0","0"]
]
let decaybp = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],
[0,2,2,2,2,0,2,2,2,2,2,2,2,3,1,3,0,4,0],
[5,2,2,6,6,7,6,6,6,6,6,6,6,8,8,8,8,8,0],
[5,2,9,6,6,0,6,0,6,0,6,0,6,9,0,0,0,10,0],
[8,2,11,6,6,0,6,0,6,0,6,0,6,8,8,8,8,8,0],
[5,2,9,6,6,6,0,0,0,0,0,0,6,9,2,2,0,10,0],
[5,2,2,2,9,6,9,9,6,9,9,6,9,9,2,2,0,10,0],
[0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,10,0],
[0,0,9,9,0,9,9,0,9,0,9,9,0,9,9,2,2,2,2]]
function getRandomPixelCoordinates(pixel, offsetx, offsety, bp, keyobject) {
let x, y, r;
let attempts = 0;
const maxAttempts = 1000;
do {
x = Math.floor(Math.random() * bp[0].length);
y = Math.floor(Math.random() * bp.length);
r = bp[y][x];
r = keyobject[r];
if (r !== undefined) {
attempts++;
}
if (attempts >= maxAttempts) {
return "terminated";
}
} while (r === undefined || r === 0 || r === "0" || !isEmpty(pixel.x + x - offsetx, pixel.y + y - offsety, true));
return { x, y, r };
}
elements.turn_into = {
color: "#000000",
behavior: behaviors.WALL,
state: "gas",
hidden: true,
properties: {
timer: 8,
},
category: "special",
tick: function(pixel){
if (!pixel.turninto){deletePixel(pixel.x, pixel.y); return}
if (pixel.timer == 8){pixel.color = pixelColorPick({element: pixel.turninto})}
//console.log(elements[pixel.turninto].color)
pixel.timer --
if (pixel.timer <= 0){
deletePixel(pixel.x, pixel.y);
createPixel(pixel.turninto, pixel.x, pixel.y);
}
}
}
elements.submitted_blueprint_1_creator = {
color: "#64abfd",
behavior: behaviors.WALL,
state: "solid",
category: "special",
tick: function(pixel){
if(!pixel.done){
if (pixelTicks % 3 == 0){
let randomcoord = getRandomPixelCoordinates(pixel, 7, 7, blueprint, {G: "glass", S: "steel", W: "silver"});
if (randomcoord == "terminated"){pixel.done = true; return;}
let rx = pixel.x + randomcoord.x-7;
let ry = pixel.y + randomcoord.y-7;
playSound("synth.wav")
try {
createPixel("turn_into", rx, ry);
pixelMap[rx][ry].turninto = randomcoord.r;
pixelMap[rx][ry].timer = 8;
} catch (error) {
console.error("Error occurred at coordinates:", rx, ",", ry);
console.error("Error message:", error);
}
}
if(pixelTicks == pixel.start){
// playSound("nocmusic.mp3")
}
}
}
}
elements.submitted_blueprint_2_creator = {
color: "#64abfd",
behavior: behaviors.WALL,
state: "solid",
category: "special",
tick: function(pixel){
if(!pixel.done){
if (pixelTicks % 3 == 0){
let randomcoord = getRandomPixelCoordinates(pixel, -1, -1, decaybp, {1: "led_r", 2:"porcelain", 3: "glass", 4: "tungsten", 5: "zinc", 6: "aluminum", 7: "copper", 8: "copper", 9: "steel", 10: "bronze", 11: "sterling"});
if (randomcoord == "terminated"){pixel.done = true; return;}
let rx = pixel.x + randomcoord.x+1;
let ry = pixel.y + randomcoord.y+1;
playSound("synth.wav")
try {
createPixel("turn_into", rx, ry);
pixelMap[rx][ry].turninto = randomcoord.r;
pixelMap[rx][ry].timer = 8;
} catch (error) {
console.error("Error occurred at coordinates:", rx, ",", ry);
console.error("Error message:", error);
}
}
if(pixelTicks == pixel.start){
// playSound("nocmusic.mp3")
}
}
}
}
elements.custom_bp_spawner = {
color: "#64abfd",
behavior: behaviors.WALL,
state: "solid",
category: "special",
tick: function(pixel){
if(!pixel.done){
if (pixelTicks % 3 == 0){
let randomcoord = getRandomPixelCoordinates(pixel, -1, -1, customBP, customBPKey);
if (randomcoord == "terminated"){pixel.done = true; return;}
let rx = pixel.x + randomcoord.x+1;
let ry = pixel.y + randomcoord.y+1;
playSound("synth.wav")
try {
createPixel("turn_into", rx, ry);
pixelMap[rx][ry].turninto = randomcoord.r;
pixelMap[rx][ry].timer = 8;
} catch (error) {
console.error("Error occurred at coordinates:", rx, ",", ry);
console.error("Error message:", error);
}
}
if(pixelTicks == pixel.start){
// playSound("nocmusic.mp3")
}
}
}
}
var customBP = []
var customBPKey = {}
let bpsizeH = 15;
let bpsizeW = 15;
let generatedBP = [];
let seenElements = {};
elements.bp_scanner = {
color: "#64abfd",
behavior: behaviors.SOLID,
state: "solid",
category: "special",
onSelect: function(pixel){
bpsizeH = prompt("Enter the height of the blueprint. It will be scanned from the TOP LEFT corner.", 15);
bpsizeW = prompt("Enter the width of the blueprint", 15);
generatedBP = [];
for (let y = 1; y <= bpsizeH; y++){
generatedBP.push([]);
}
},
tick: function(pixel){
if(pixelTicks == pixel.start){
let elementCounter = 1;
seenElements = {};
for (let y = 0; y < bpsizeH; y++){
for (let x = 1; x <= bpsizeW; x++){
if (!isEmpty(pixel.x + x, pixel.y + y, true)){
var opElement = pixelMap[pixel.x + x][pixel.y + y].element;
if (!seenElements[opElement]){
generatedBP[y].push(elementCounter);
seenElements[opElement] = elementCounter;
elementCounter++;
//console.log(elementCounter)
//console.log(seenElements)
//console.log(opElement)
} else {
generatedBP[y].push(seenElements[opElement]);
}
} else {
generatedBP[y].push(0);
}
}
}
console.log(generatedBP)
console.log(seenElements)
generatedBP.shift();
deletePixel(pixel.x, pixel.y);
customBP = generatedBP;
customBPKey = reverseObject(seenElements);
}
}
}

View File

@ -1798,6 +1798,7 @@ elements.invisiblewall = {
category: "solids",
movable: false,
noMix: true,
hardness: 1,
},
elements.bismuth = {
color: ["#818181","#989898","#b0b0b0","#c9c9c9"],

138
mods/spaceship.js Normal file
View File

@ -0,0 +1,138 @@
elements.power_core = {
color: ["#10F7F3", "#5AEDEB", "#BDFCFB"],
behavior: behaviors.WALL,
temp: 250,
category: "special",
stateHigh: "n_explosion",
tempHigh: 9500,
state: "solid",
desc: "The power core for your spaceship! Make sure it doesnt reach 9500 degrees!" ,
tick: function(pixel) {
const elementToCheck = "core_casing";
let isValid = true;
for (let i = pixel.x - 4; i < pixel.x + 4; i++) {
for (let j = pixel.y - 4; j < pixel.y + 4; j++) {
if (Math.abs(pixel.x - i) === 4 || Math.abs(pixel.y - j) === 4) {isValid &= pixelMap[i][j]?.element === elementToCheck;}
else if (i !== pixel.x && j !== pixel.y) isValid &= isEmpty(i, j);
}
}
// if (!pixel.alerted) {
// if (isValid) { alert("Power Core succesfully stored") }
// else { alert("Invalid core! Make sure its a 9x9 hollow box with the pixel in the middle!"); }
// pixel.alerted = true;
// } Not finished Yet
if (pixel.temp === 5000) { pixel.color = pixelColorPick(pixel,"#F92810");}
else if ( pixel.temp < 2000) { pixel.color = pixelColorPick(pixel,"#F9B610");}
else { pixel.color = pixelColorPick(pixel,"#5AEDEB");}
if (isValid) { if (pixelMap[pixel.x][pixel.y-4].element === "core_casing")
{createPixel("core_energizer", pixel.x, pixel.y-5);}}
else {{createPixel("core_energizer", pixel.x, pixel.y-4);}
}
},
};
elements.thrusters = {
color: ["#8D8D8C", "#666666"],
behavior: behaviors.WALL,
category: "special",
behaviorOn: [
"XX|XX|XX",
"XX|XX|CR:fire",
"XX|XX|XX",
],
state: "solid",
desc: "Use this to drive your ship! (Cosmetic)",
conduct:1,
};
elements.core_wall = {
color: ["#6EB5F1", "#708494"],
behavior: behaviors.WALL,
hardness: 1,
density: 90000000,
desc: "Harder than anything in the world!",
category: "special",
};
elements.space_blaster = {
color: ["#10F7F3", "#5AEDEB", "#BDFCFB"],
tick: function(pixel) {
for (var i = 0; i < 3; i++) {
var skip = false;
if (!isEmpty(pixel.x,pixel.y-1,true)) {
var p = pixelMap[pixel.x][pixel.y-1];
if (p.element === "space_blaster") { skip = true; }
if (Math.random() < 0.9 && elements[p.element].hardness !== 1) {
deletePixel(p.x,p.y);
}
}
if (!tryMove(pixel,pixel.x-1,pixel.y,["flash","heat_ray","electric"]) && !skip) {
explodeAt(pixel.x,pixel.y,30,"plasma");
var coords = circleCoords(pixel.x,pixel.y,15);
coords.forEach(function(coord) {
var x = coord.x;
var y = coord.y;
if (!isEmpty(x,y,true)) {
pixelMap[x][y].temp += 10000;
pixelTempCheck(pixelMap[x][y]);
}
})
deletePixel(pixel.x,pixel.y);
return;
}
}
},
category: "energy",
state: "solid",
density: 100000000,
temp: 10000,
hardness: 1,
maxSize: 3,
cooldown: defaultCooldown,
excludeRandom: true,
desc: "A energized blaster pixel",
};
elements.space_gunner_LEFT = {
color: ["#708494", "#5A6873"],
behavior: behaviors.WALL,
category: "special",
behaviorOn: [
"XX|XX|XX",
"CR:space_blaster|XX|XX",
"XX|XX|XX",
],
state: "solid",
desc: "Use this to shoot your enemies! (Shoots Left)",
conduct:1,
};
elements.space_gunner_RIGHT = {
color: ["#708494", "#5A6873"],
behavior: behaviors.WALL,
category: "special",
behaviorOn: [
"XX|XX|XX",
"XX|XX|CR:space_blaster",
"XX|XX|XX",
],
state: "solid",
desc: "Use this to shoot your enemies! (Shoots Right)",
conduct:1,
};
elements.core_energizer = {
color: "#FFFB00",
hidden: true,
behavior: behaviors.WALL,
state: "solid",
tick: function(pixel) {
createPixel("radiation", pixel.x, pixel.y+1)
},
};
elements.core_casing = {
color: ["#4A7375","#C1D875","#8BFCF3"],
reactions: {
"radiation": { elem2:"electric", temp1:200 }
},
behavior: behaviors.WALL,
category: "special",
density: 2710,
conduct: 0.73,
hardness: 1,
desc: "Casing for the inner core!",
};