This commit is contained in:
slweeb 2026-01-22 18:58:00 -05:00
parent b140b28ef9
commit 07f47bdd06
34 changed files with 2335 additions and 2431 deletions

View File

@ -376,6 +376,7 @@
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Orchid</td></tr>
<tr><td>amogus.js</td><td>Small Among Us structure</td><td>Alice</td></tr>
<tr><td>bfdi.js</td><td>Several references to Battle for Dream Island</td><td>Taterbob</td></tr>
<tr><td>chess.js</td><td>Play chess in Sandboxels [Press U to start game]</td><td>ggod</td></tr>
<tr><td>citybuilding.js</td><td>Seeds that create miniature buildings and other city-related items</td><td>SquareScreamYT</td></tr>
<tr><td>collab_mod.js</td><td>Created by multiple people, adds random things</td><td>mrapple, ilikepizza, stefanblox</td></tr>
<tr><td>cubesstuff.js</td><td>Some random stuff like Disco Ball, Pyrite, and Nordic Gold</td><td>Cube14yt</td></tr>

View File

@ -520,7 +520,7 @@ elements.RandomGen = {
elements.view_seed = {
category: "edit",
onSelect: function(){
alert(seed);
selectElement("dirt");
promptText(seed, undefined, "Seed");
selectElement(prevElement);
}
}

View File

@ -44986,7 +44986,6 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
function editDistance(s1, s2) {s1 = s1.toLowerCase();s2 = s2.toLowerCase();var costs = new Array();for (var i = 0; i <= s1.length; i++) {var lastValue = i;for (var j = 0; j <= s2.length; j++) {if (i == 0)costs[j] = j;else {if (j > 0) {var newValue = costs[j - 1];if (s1.charAt(i - 1) != s2.charAt(j - 1))newValue = Math.min(Math.min(newValue, lastValue),costs[j]) + 1;costs[j - 1] = lastValue;lastValue = newValue;}}}if (i > 0)costs[s2.length] = lastValue;}return costs[s2.length];}
function similarity(s1, s2) {var longer = s1;var shorter = s2;if (s1.length < s2.length) {longer = s2;shorter = s1;}var longerLength = longer.length;if (longerLength == 0) {return 1.0;}return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);}
function mostSimilarElement(s) {
delete elements;
var max = 0;
var maxElement = "";
for (var e in elements) {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
var modName = "mods/boiling_things.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
//glass {
@ -533,8 +533,4 @@ if(enabledMods.includes(libraryMod)) {
};
});
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -32,7 +32,7 @@ elements.change = {
tool: function(pixel) {
changePixel(pixel,changeTo,true);
},
category: "tools",
category: "edit",
desc: "Changes any pixels it is used on to a specified type.<br/>Currently replacing pixels with \"" + changeTo + "\".<br/><span onclick=changeElementPrompt() style=\"color: #ff00ff;\";>Press [;] or click here</span> to open the change prompt.",
};
@ -41,7 +41,7 @@ elements.alt_change = {
tool: function(pixel) {
pixel.element = changeTo;
},
category: "tools",
category: "edit",
desc: "Changes any pixels it is used on to a specified type, but keeping their non-element-based properties.<br/>Currently replacing pixels with \"" + changeTo + "\".<br/><span onclick=changeElementPrompt() style=\"color: #ff00ff;\";>Press [;] or click here</span> to open the change prompt.",
hidden: true,
};
@ -52,7 +52,7 @@ elements.alt_alt_change = {
pixel.element = changeTo;
pixel.color = pixelColorPick(pixel);
},
category: "tools",
category: "edit",
desc: "Changes any pixels it is used on to a specified type, but keeping their non-element-based properties except for color.<br/>Currently replacing pixels with \"" + changeTo + "\".<br/><span onclick=changeElementPrompt() style=\"color: #ff00ff;\";>Press [;] or click here</span> to open the change prompt.",
hidden: true,
};

File diff suppressed because it is too large Load Diff

View File

@ -1435,7 +1435,7 @@ runAfterLoadList.push(() => {
if (!localStorage.getItem("chessjs-tutorial")) {
// "might break"
// i know damn well it will 100% break on mobile
alert("To start or restart chess board press 'u'. Might break on different resolutions and on mobile.");
promptText("To start or restart chess board press 'u'. Might break on different resolutions and on mobile.");
localStorage.setItem("chessjs-tutorial", true);
}
})

View File

@ -1,7 +1,7 @@
var modName = "mods/colonies.js";
var exoplanetMod = "mods/exoplanet.js";
// var exoplanetMod = "mods/exoplanet.js";
if(enabledMods.includes(exoplanetMod)) {
dependOn("exoplanet.js", function(){
window.addEventListener("load", () => {
document.getElementById("elementButton-base")?.remove()
@ -567,8 +567,4 @@ elements.arriving_rocket = {
cooldown: defaultCooldown
}
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,exoplanetMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${exoplanetMod} mod is required and has been automatically inserted (reload for this to take effect).`)
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/color_tools.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
var colorToolCounter = 0;
saturationAmount = 1;
saturationOp = "add";
@ -290,8 +290,4 @@ if(enabledMods.includes(libraryMod)) {
excludeRandom: true,
desc: "<span style='color:#FF00FF' onClick=colorToolFilterPrompt()>Click here to configure the element filter (applies to all color tools).</span>",
}
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -12,6 +12,6 @@ elements.delete_all_of_element = {
}
}
},
category: "tools",
category: "edit",
excludeRandom: true,
};

View File

@ -65,19 +65,19 @@
// info element
elements.drills_info = {
color: "#000000",
name: "drills.js",
category: "Mods",
behavior: behaviors.SELFDELETE,
maxSize: 1,
tool: function(pixel) {},
onSelect: function(pixel) {
let mod_info = "The drills.js mod adds different kinds of drills to a new 'drills' category.\n\nMod made by: Necrotic_Phantom. \n With help from: voidapex11."
alert(mod_info)
return
},
};
// elements.drills_info = {
// color: "#000000",
// name: "drills.js",
// category: "Mods",
// behavior: behaviors.SELFDELETE,
// maxSize: 1,
// tool: function(pixel) {},
// onSelect: function(pixel) {
// let mod_info = "The drills.js mod adds different kinds of drills to a new 'drills' category.\n\nMod made by: Necrotic_Phantom. \n With help from: voidapex11."
// alert(mod_info)
// return
// },
// };

View File

@ -1152,7 +1152,7 @@ if(enabledMods.includes(loonaMod) && enabledMods.includes(fireMod) && enabledMod
burnTime: 600,
tempHigh: 200,
stateHigh: ["steam", "ash"],
onTryMoveInto: function(pixel,otherPixel) {
onMoveInto: function(pixel,otherPixel) {
var otherInfo = elements[otherPixel.element]
if(typeof(otherInfo.state) === "string" && otherInfo.state !== "gas") {
pixel.attached = false;

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,7 @@
var modName = "mods/life_eater.js";
var fireMod = "mods/fire_mod.js";
if(!enabledMods.includes(fireMod)) {
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${fireMod} mod is required and has been automatically inserted (reload for this to take effect).`);
} else {
dependOn("fire_mod.js", function() {
var lifeEaterCategories = ["life","auto creepers","food","fantastic creatures","fey","auto_fey"];
var lifeEaterBlacklist = ["life_eater_virus","life_eater_slurry","life_eater_infected_dirt"];
@ -166,4 +162,4 @@ if(!enabledMods.includes(fireMod)) {
stateHigh: elements.metal_scrap.stateHigh.concat("life_eater_virus","life_eater_virus","life_eater_virus"),
};
}
}, true);

View File

@ -21,7 +21,7 @@ var modName = "mods/metals.js";
// var changeTempMod = "mods/changeTempReactionParameter.js";
// var runAfterAutogenMod = "mods/runAfterAutogen2.js";
var libraryMod = "mods/code_library.js";
dependOn("library_test.js", function(){
dependOn("code_library.js", function(){
elements.iron.hardness = 0.74
//https://www.engineeringtoolbox.com/bhn-brinell-hardness-number-d_1365.html
//https://en.wikipedia.org/wiki/Hardnesses_of_the_elements_(data_page)

View File

@ -1,27 +1,8 @@
function whenAvailable(names, callback) {
var interval = 10; // ms
window.setTimeout(function() {
let bool = true;
for(let i = 0; i < names.length; i++)
{
if(!window[names[i]])
{
bool = false;
}
}
if (bool) {
callback();
} else {
whenAvailable(names, callback);
}
}, interval);
}
var modName = "mods/neutronium_compressor.js";
var runAfterAutogenMod = "mods/runAfterAutogen2.js";
var libraryMod = "mods/code_library.js";
// var runAfterAutogenMod = "mods/runAfterAutogen2.js";
// var libraryMod = "mods/code_library.js";
if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) {
whenAvailable(["urlParams","runAfterAutogen"], function() {
dependOn("code_library.js", function(){
var singularityColorTemplate = ["#202020", "#505050", "#b0b0b0", "#c7c7c7"];
singularityNumber = 10000;
@ -407,10 +388,4 @@ if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod))
//Post-generation tasks
});
} else {
if(!enabledMods.includes(runAfterAutogenMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,runAfterAutogenMod) };
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
alert(`The "${runAfterAutogenMod}" and "${libraryMod}" mods are required; any missing mods in this list have been automatically inserted (reload for this to take effect).`)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,8 +1,8 @@
var modName = "mods/portal.js";
var onTryMoveIntoMod = "mods/onTryMoveInto.js";
// var onTryMoveIntoMod = "mods/onTryMoveInto.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
//https://stackoverflow.com/a/60922255
if(!enabledMods.includes("mods/mobs.js")) {
headBodyObject = {
@ -17,7 +17,7 @@ if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
_correspondingPortals: null,
},
insulate: true,
onTryMoveInto: function(pixel,otherPixel) {
onMoveInto: function(pixel,otherPixel) {
if(pixel._correspondingPortals == null) {
return;
};
@ -112,9 +112,8 @@ if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
state: "solid",
insulate: true,
}
} else {
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
if(!enabledMods.includes(onTryMoveIntoMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,onTryMoveIntoMod) };
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The "${libraryMod}" and "${onTryMoveIntoMod}" mods are all required; any missing mods in this list have been automatically inserted (reload for this to take effect).`)
};
}, true);
// if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
// if(!enabledMods.includes(onTryMoveIntoMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,onTryMoveIntoMod) };
// localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
// alert(`The "${libraryMod}" and "${onTryMoveIntoMod}" mods are all required; any missing mods in this list have been automatically inserted (reload for this to take effect).`)

View File

@ -3,7 +3,7 @@ var variablesMod = "mods/prop and prompt variables.js";
var promptInputNullishes = ["null","none","","n/a"];
var eightSpaces = " ".repeat(8);
if(enabledMods.includes(variablesMod)) {
dependOn("prop and prompt variables.js", function(){
commandHelpObject = {
"set": "Sets properties for every pixel of a given type.\nUsage: set [property] [element] [value] <type>\nDon't include framing characters []<>.\nThe element can be \"all\" to set the property for every pixel.\nNote: Strings can't have spaces because spaces are the separator used in the parsing split().\nArguments in [brackets] are required and ones in <angle brackets> are optional.",
@ -1208,8 +1208,4 @@ Make sure to save your command in a file if you want to add this preset again.`
desc: "<span style='color:#FF00FF;' onClick=funniPrompt()>Click here or press Shift+1 to open the command prompt.</span>",
category:"special",
};
} else {
alert(`The ${variablesMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,variablesMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/prop.js";
var variablesMod = "mods/prop and prompt variables.js";
if(enabledMods.includes(variablesMod)) {
dependOn("prop and prompt variables.js", function(){
propProperty = "element";
propValue = "sand";
propType = "string";
@ -212,7 +212,7 @@ if(enabledMods.includes(variablesMod)) {
};
pixelTempCheck(pixel);
},
category: "tools",
category: "edit",
desc: `Sets properties of pixels.<br/>Currently setting ${propProperty} to ${propValue} (${propType}).<br/><span onclick=propPrompt() style=\"color: #ff00ff;\";>Press [,] or click here</span> to open the property tool prompt.`,
};
@ -452,15 +452,11 @@ if(enabledMods.includes(variablesMod)) {
pixelTempCheck(pixel);
};
},
category: "tools",
category: "edit",
desc: `Changes properties of pixels.<br/>Currently ${numberAdjusterVerb} ${numberAdjusterValue} ${numberAdjusterPreposition} ${numberAdjusterProperty}.<br/><span onclick=numberAdjusterPrompt() style=\"color: #ff00ff;\";>Press [Shift+,] or click here</span> to open the adjuster tool prompt.`,
};
function updateNumberAdjusterDescription() {
elements.number_adjuster.desc = numberAdjusterReverseOrder ? `Changes numeric properties of pixels.<br/>Currently ${numberAdjusterVerb} ${numberAdjusterProperty} ${numberAdjusterPreposition} ${numberAdjusterValue}.<br/><span onclick=numberAdjusterPrompt() style=\"color: #ff00ff;\";>Press [Shift+,] or click here</span> to open the adjuster tool prompt.` : `Changes numeric properties of pixels.<br/>Currently ${numberAdjusterVerb} ${numberAdjusterValue} ${numberAdjusterPreposition} ${numberAdjusterProperty}.<br/><span onclick=numberAdjusterPrompt() style=\"color: #ff00ff;\";>Press [Shift+,] or click here</span> to open the adjuster tool prompt.`;
};
} else {
alert(`The ${variablesMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,variablesMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -48,18 +48,18 @@ behaviors.SELFDELETE = [
pullerColour = '#e0adb6'
elements.pullersDesc = {
color: pullerColour,
name: 'pullers.js',
category: "Mods",
behavior: behaviors.SELFDELETE,
tool: function(pixel) {},
onSelect: function(pixel) {
let info1stMod = `pullers.js is a mod made by voidapex11 that adds pullers to sandboxels`
alert(info1stMod)
return
},
};
// elements.pullersDesc = {
// color: pullerColour,
// name: 'pullers.js',
// category: "Mods",
// behavior: behaviors.SELFDELETE,
// tool: function(pixel) {},
// onSelect: function(pixel) {
// let info1stMod = `pullers.js is a mod made by voidapex11 that adds pullers to sandboxels`
// alert(info1stMod)
// return
// },
// };
// for the inator reference: if you know you know
elements.immovable_inator = {

View File

@ -1,7 +1,7 @@
var modName = "mods/random_liquids.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
if(urlParams.get('liquidAmount') != null) { //null check
liquidAmount = urlParams.get('liquidAmount')
if(isNaN(liquidAmount) || liquidAmount === "" || liquidAmount === null) { //NaN check
@ -213,8 +213,4 @@ if(enabledMods.includes(libraryMod)) {
if(makeLiquidString == true) {
console.log(`Liquids added to liquidString (length ${liquidString.length})`)
}
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/random_rocks.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
if(urlParams.get('rockAmount') != null) { //null check
rockAmount = urlParams.get('rockAmount')
if(isNaN(rockAmount) || rockAmount === "" || rockAmount === null) { //NaN check
@ -157,8 +157,4 @@ if(enabledMods.includes(libraryMod)) {
if(makeRockString == true) {
console.log(`Rocks added to rockString (length ${rockString.length})`)
}
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/randomness.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
//i made some stupid things
//TPT reference
@ -723,8 +723,4 @@ if(enabledMods.includes(libraryMod)) {
}
}
});
} else {
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
alert(`The "${libraryMod}" mod is required and has been automatically inserted (reload for this to take effect).`)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,28 +1,27 @@
function whenAvailable(names, callback) {
var interval = 10; // ms
window.setTimeout(function() {
let bool = true;
for(let i = 0; i < names.length; i++)
{
if(!window[names[i]])
{
bool = false;
}
}
if (bool) {
callback();
} else {
whenAvailable(names, callback);
}
}, interval);
}
// function whenAvailable(names, callback) {
// var interval = 10; // ms
// window.setTimeout(function() {
// let bool = true;
// for(let i = 0; i < names.length; i++)
// {
// if(!window[names[i]])
// {
// bool = false;
// }
// }
// if (bool) {
// callback();
// } else {
// whenAvailable(names, callback);
// }
// }, interval);
// }
var modName = "mods/rays.js";
var runAfterAutogenMod = "mods/runAfterAutogen2.js";
var libraryMod = "mods/code_library.js";
// var runAfterAutogenMod = "mods/runAfterAutogen2.js";
// var libraryMod = "mods/code_library.js";
if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) {
whenAvailable(["raaLoaded","libraryLoaded"], function() {
dependOn("code_library.js", function(){
runAfterAutogen(function() {
snowAndIceCache = Object.keys(elements).filter(function(name) {
return name.endsWith("snow") || name.endsWith("ice") || name == "rime"
@ -455,10 +454,4 @@ whenAvailable(["raaLoaded","libraryLoaded"], function() {
}
}
};
});
} else {
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
if(!enabledMods.includes(runAfterAutogenMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,runAfterAutogenMod) };
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The "${runAfterAutogenMod}" and "${libraryMod}" mods are required and have been automatically inserted (reload for this to take effect).`);
};
},true);

View File

@ -49,7 +49,7 @@ elements.replace = {
changePixel(pixel,replaceTo,true);
};
},
category: "tools",
category: "edit",
desc: "Changes pixels of a specified type to another specified type.<br/>Currently replacing \"" + replaceFrom + "\" with \"" + replaceTo + "\".<br/><span onclick=replaceElementPrompt() style=\"color: #ff00ff;\";>Press [\"] or click here</span> to open the replace prompt.",
};
@ -60,7 +60,7 @@ elements.alt_replace = {
pixel.element = replaceTo;
};
},
category: "tools",
category: "edit",
desc: "Changes pixels of a specified type to another specified type, but keeping their non-element-based properties.<br/>Currently replacing \"" + replaceFrom + "\" with \"" + replaceTo + "\".<br/><span onclick=replaceElementPrompt() style=\"color: #ff00ff;\";>Press [\"] or click here</span> to open the replace prompt.",
hidden: true,
};
@ -73,7 +73,7 @@ elements.alt_alt_replace = {
pixel.color = pixelColorPick(pixel);
};
},
category: "tools",
category: "edit",
desc: "Changes pixels of a specified type to another specified type, but keeping their non-element-based properties except for color.<br/>Currently replacing \"" + replaceFrom + "\" with \"" + replaceTo + "\".<br/><span onclick=replaceElementPrompt() style=\"color: #ff00ff;\";>Press [\"] or click here</span> to open the replace prompt.",
hidden: true,
};

View File

@ -1,7 +1,7 @@
var modName = "mods/roseyiede.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
/*
//arbitrarily picked
binitialArrayL = ["m","n","p","t","ch","k","b","d","j","g","f","th","s","sh","h","l","r","y","w","z"] //:eggTF:
@ -356,8 +356,4 @@ if(enabledMods.includes(libraryMod)) {
density: 956,
temp: 120,
}
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,74 +1,71 @@
var modName = "mods/random_rocks.js";
var onTryMoveIntoMod = "mods/onTryMoveInto.js";
var libraryMod = "mods/code_library.js";
// var onTryMoveIntoMod = "mods/onTryMoveInto.js";
// var libraryMod = "mods/code_library.js";
if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
elements.solid_rock = {
color: ["#808080","#4f4f4f","#949494"],
behavior: behaviors.WALL,
reactions: {
"water": {elem1: "wet_sand", chance: 0.00035},
"salt_water": {elem1: "wet_sand", chance: 0.0005},
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
"seltzer": {elem1: "wet_sand", chance: 0.0004},
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
"soda": {elem1: "wet_sand", chance: 0.0004},
"lichen": {elem1: "dirt", chance: 0.0025},
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
"root": {elem1: "sand", chance: 0.0004},
"wheat": {elem2: "flour"},
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
},
onTryMoveInto: function(pixel,otherPixel) {
if(elements[otherPixel.element].category === "corruption") {
if(Math.random() < 0.05) {
changePixel(pixel,"corrupt_solid_rock");
return;
};
} else {
reactionStealer(pixel,otherPixel,"rock");
dependOn("code_library.js", function(){
elements.solid_rock = {
color: ["#808080","#4f4f4f","#949494"],
behavior: behaviors.WALL,
reactions: {
"water": {elem1: "wet_sand", chance: 0.00035},
"salt_water": {elem1: "wet_sand", chance: 0.0005},
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
"seltzer": {elem1: "wet_sand", chance: 0.0004},
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
"soda": {elem1: "wet_sand", chance: 0.0004},
"lichen": {elem1: "dirt", chance: 0.0025},
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
"root": {elem1: "sand", chance: 0.0004},
"wheat": {elem2: "flour"},
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
},
onMoveInto: function(pixel,otherPixel) {
if(elements[otherPixel.element].category === "corruption") {
if(Math.random() < 0.05) {
changePixel(pixel,"corrupt_solid_rock");
return;
};
},
tempHigh: 950,
stateHigh: "magma",
category: "land",
state: "solid",
density: 2600,
hardness: 0.55,
breakInto: "rock",
}
} else {
reactionStealer(pixel,otherPixel,"rock");
};
},
tempHigh: 950,
stateHigh: "magma",
category: "land",
state: "solid",
density: 2600,
hardness: 0.55,
breakInto: "rock",
}
if(enabledMods.includes("mods/fey_and_more.js")) {
elements.corrupt_solid_rock = {
color: ["#514c78","#514c78","#2a264d","#2a264d","#514c78","#514c78"],
behavior: behaviors.WALL,
tempHigh: 1200,
category: "corruption",
state: "solid",
density: 1250,
breakInto: "corrupt_rock",
tick: function(pixel) {
var randomNeighborOffset = adjacentCoords[Math.floor(Math.random() * adjacentCoords.length)];
var rfX = pixel.x+randomNeighborOffset[0];
var rfY = pixel.y+randomNeighborOffset[1];
if(!isEmpty(rfX,rfY,true)) {
var otherPixel = pixelMap[rfX][rfY];
if(otherPixel.element === "solid_rock") {
if(Math.random() < 0.05) {
changePixel(otherPixel,"corrupt_solid_rock")
};
if(enabledMods.includes("mods/fey_and_more.js")) {
elements.corrupt_solid_rock = {
color: ["#514c78","#514c78","#2a264d","#2a264d","#514c78","#514c78"],
behavior: behaviors.WALL,
tempHigh: 1200,
category: "corruption",
state: "solid",
density: 1250,
breakInto: "corrupt_rock",
tick: function(pixel) {
var randomNeighborOffset = adjacentCoords[Math.floor(Math.random() * adjacentCoords.length)];
var rfX = pixel.x+randomNeighborOffset[0];
var rfY = pixel.y+randomNeighborOffset[1];
if(!isEmpty(rfX,rfY,true)) {
var otherPixel = pixelMap[rfX][rfY];
if(otherPixel.element === "solid_rock") {
if(Math.random() < 0.05) {
changePixel(otherPixel,"corrupt_solid_rock")
};
};
},
};
};
},
};
runAfterLoad(function() {
elements.corrupt_solid_rock.reactions = elements.corrupt_land.reactions;
});
}
} else {
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
if(!enabledMods.includes(onTryMoveIntoMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,onTryMoveIntoMod) };
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The "${libraryMod}" and "${onTryMoveIntoMod}" mods are all required; any missing mods in this list have been automatically inserted (reload for this to take effect).`)
};
runAfterLoad(function() {
elements.corrupt_solid_rock.reactions = elements.corrupt_land.reactions;
});
}
},true);

View File

@ -1,8 +1,10 @@
var modName = "mods/sponge_edit.js";
var onTryMoveIntoMod = "mods/onTryMoveInto.js";
// var onTryMoveIntoMod = "mods/onTryMoveInto.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
elements.sponge.properties ??= {};
elements.sponge.properties.maxAbsorb = 250;
@ -34,7 +36,7 @@ if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
};
};
elements.sponge.onTryMoveInto = function(pixel,otherPixel) {
elements.sponge.onMoveInto = function(pixel,otherPixel) {
var absorbedElements = Object.keys(pixel.absorbed);
if(absorbedElements.length == 0) {
return false;
@ -68,9 +70,4 @@ if(enabledMods.includes(onTryMoveIntoMod) && enabledMods.includes(libraryMod)) {
};
};
};
} else {
enabledMods.splice(enabledMods.indexOf(modName),0,onTryMoveIntoMod);
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod);
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The ${onTryMoveIntoMod} mod and ${libraryMod} mods are required and have been automatically inserted (reload for this to take effect).`);
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/color_tools.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
stripeFixedDefaultProperties = {
color2: "rgb(0,0,0)",
phase: 0,
@ -103,8 +103,4 @@ if(enabledMods.includes(libraryMod)) {
},
desc: stripePaintDesc
};
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true);

View File

@ -1,10 +1,7 @@
var modName = "mods/structure_test.js";
var libraryMod = "mods/code_library.js";
if(!enabledMods.includes(libraryMod)) {
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod);
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`);
} else {
dependOn("code_library.js", function(){
arrayLoaderVoids = ["air", "null", null];
buildingOneSegmentDoor = ["concrete","wood_plank","concrete","wood_plank","concrete"];
buildingOneSegmentWindows = ["concrete","glass_pane","concrete","glass_pane","concrete"];
@ -752,4 +749,4 @@ if(!enabledMods.includes(libraryMod)) {
worldgentypes.desert.layers.shift();
};
};
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/wifi.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
//https://stackoverflow.com/a/60922255
elements.wifi = {
color: "#bfff7f",
@ -155,8 +155,4 @@ if(enabledMods.includes(libraryMod)) {
state: "solid",
}
} else {
if(!enabledMods.includes(libraryMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod) };
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The "${libraryMod}" mods is required; and has been automatically inserted (reload for this to take effect).`)
};
}, true);

View File

@ -1,7 +1,7 @@
var modName = "mods/wirelike_test.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
dependOn("code_library.js", function(){
//The CMYK is symbolic
elements.start_test = {
color: "#dddddd",
@ -674,8 +674,4 @@ if(enabledMods.includes(libraryMod)) {
};
},
};
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};
}, true)

File diff suppressed because it is too large Load Diff