diff --git a/mods/a_bundle_of_tests.js b/mods/a_bundle_of_tests.js
index 2c4e9600..0b5b0778 100644
--- a/mods/a_bundle_of_tests.js
+++ b/mods/a_bundle_of_tests.js
@@ -1,14 +1,14 @@
if(typeof(urlParams) === "undefined") {
urlParams = new URLSearchParams(window.location.search);
};
-if(urlParams.get('loadTheModList') !== null) { //if the variable exists at all
+if(urlParams.get('loadTheModList') !== null || urlParams.get('ltml') !== null) { //if the variable exists at all
loadTheModList = true
} else { //if it doesn't (and it returns null)
loadTheModList = false
}
if(loadTheModList) {
- enabledMods = ["mods/code_library.js", "mods/adjustablepixelsize.js", "mods/boiling_rock.js", "mods/chalcopyrite.js", "mods/clone_liquid.js", "mods/conveyance.js", "mods/CrashTestDummy.js", "mods/crimson.js", "mods/delete_all_of_element.js", "mods/evenmoretemptools.js", "mods/extra_element_info.js", "mods/fairy_chain.js", "mods/fantastic_creatures.js", "mods/fey_and_more.js", "mods/glenn_gases.js", "mods/grav_mudstones.js", "mods/icb.js", "mods/iean.js", "mods/ketchup_mod.js", "mods/laetium.js", "mods/liquid_energy.js", "mods/metals.js", "mods/minecraft.js", "mods/minesweeper.js", "mods/more_breaking.js", "mods/moreliquids.js", "mods/moretools.js", "mods/move_tools.js", "mods/nested_for_reaction_example.js", "mods/Neutronium Mod.js", "mods/portal.js", "mods/pushers.js", "mods/rainbow_tests.js", "mods/random_elems.js", "mods/random_liquids.js", "mods/random_rocks.js", "mods/randomness.js", "mods/randomness_but_tick.js", "mods/randomness_but_tool.js", "mods/slag_fix.js", "mods/some_tf_liquids.js", "mods/structure_test.js", "mods/test.js", "mods/ticking_temp_stuff.js", "mods/time.js", "mods/toothpaste.js", "mods/troll.js", "mods/unhide.js", "mods/worldgen_test.js", "mods/page_color.js", "mods/color_tools.js", "mods/invisible_wall.js", "mods/replace_all.js", "mods/bacteria_mod.js", "mods/controllable_pixel_test.js", "mods/fire_slime.js", "mods/bioooze.js", "mods/more_clouds.js", "mods/color_tools.js", "mods/cells.js", "mods/triggerable_random_powders.js", "mods/replace.js", "mods/change.js", "mods/prompt.js", "mods/miscible_psoup_and_birthpool.js", "mods/primordial_birthpool.js", "mods/liquid_void.js", "mods/solid_rock.js", "mods/invisible_dye.js", "mods/alcohol.js", "mods/a_bundle_of_tests.js", "mods/paint_event.js", "mods/amogus.js", "mods/chem.js", "mods/roseyiede.js", "mods/state_voids.js", "mods/the_ground.js", "mods/lone_urea.js", "mods/fwibblen.js", "mods/velocity.js", "mods/prop and prompt variables.js", "mods/prop.js", "mods/x_dependent_change_test.js", "mods/alkahest.js", "mods/tool_pixel_behavior.js", "mods/onTryMoveInto.js", "mods/human_edit.js", "mods/runAfterAutogen and onload restructure.js", "mods/explodeAtPlus.js", "mods/more_bombs.js", "mods/note_block.js", "mods/wirelike_test.js", "mods/no_random_grbs.js", "mods/bananas.js", "mods/trapdoor.js", "mods/apioforms.js", "mods/cpt_alt.js", "mods/more_fairies.js", "mods/spouts.js", "mods/mobs.js"];
+ enabledMods = ["mods/code_library.js", "mods/adjustablepixelsize.js", "mods/boiling_rock.js", "mods/chalcopyrite.js", "mods/clone_liquid.js", "mods/conveyance.js", "mods/CrashTestDummy.js", "mods/crimson.js", "mods/delete_all_of_element.js", "mods/evenmoretemptools.js", "mods/extra_element_info.js", "mods/fairy_chain.js", "mods/fantastic_creatures.js", "mods/fey_and_more.js", "mods/glenn_gases.js", "mods/grav_mudstones.js", "mods/icb.js", "mods/ketchup_mod.js", "mods/laetium.js", "mods/liquid_energy.js", "mods/metals.js", "mods/minecraft.js", "mods/minesweeper.js", "mods/more_breaking.js", "mods/moreliquids.js", "mods/moretools.js", "mods/move_tools.js", "mods/nested_for_reaction_example.js", "mods/Neutronium Mod.js", "mods/portal.js", "mods/pushers.js", "mods/rainbow_tests.js", "mods/random_elems.js", "mods/random_liquids.js", "mods/random_rocks.js", "mods/randomness.js", "mods/randomness_but_tick.js", "mods/randomness_but_tool.js", "mods/slag_fix.js", "mods/some_tf_liquids.js", "mods/structure_test.js", "mods/test.js", "mods/ticking_temp_stuff.js", "mods/time.js", "mods/toothpaste.js", "mods/troll.js", "mods/unhide.js", "mods/worldgen_test.js", "mods/page_color.js", "mods/invisible_wall.js", "mods/replace_all.js", "mods/bacteria_mod.js", "mods/controllable_pixel_test.js", "mods/fire_slime.js", "mods/bioooze.js", "mods/color_tools.js", "mods/cells.js", "mods/triggerable_random_powders.js", "mods/replace.js", "mods/change.js", "mods/prompt.js", "mods/miscible_psoup_and_birthpool.js", "mods/primordial_birthpool.js", "mods/liquid_void.js", "mods/solid_rock.js", "mods/invisible_dye.js", "mods/alcohol.js", "mods/a_bundle_of_tests.js", "mods/paint_event.js", "mods/amogus.js", "mods/chem.js", "mods/roseyiede.js", "mods/state_voids.js", "mods/the_ground.js", "mods/lone_urea.js", "mods/fwibblen.js", "mods/velocity.js", "mods/prop and prompt variables.js", "mods/prop.js", "mods/x_dependent_change_test.js", "mods/alkahest.js", "mods/tool_pixel_behavior.js", "mods/onTryMoveInto.js", "mods/human_edit.js", "mods/runAfterAutogen and onload restructure.js", "mods/explodeAtPlus.js", "mods/note_block.js", "mods/wirelike_test.js", "mods/no_random_grbs.js", "mods/bananas.js", "mods/iean.js", "mods/cpt_alt.js", "mods/code_library.js", "mods/cold fire revamp and doBurning edits.js", "mods/spouts.js", "mods/funny elements 2022-11-15.js", "mods/spouts.js", "mods/mobs.js", "mods/more_fairies.js", "mods/more_clouds.js", "mods/more_bombs.js", "https://cdn.jsdelivr.net/gh/DimpyRed/cancermod@c2c4fe40d0049c8b56bbbdb7203387778b55b05d/cancermelt.js"];
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert("Mod list loaded. Refresh the page without the loadTheModList query parameter.");
console.log("Mod list loaded. Refresh the page without the loadTheModList query parameter.");
diff --git a/mods/generator_prompt.js b/mods/generator_prompt.js
index 13bed66b..61f88835 100644
--- a/mods/generator_prompt.js
+++ b/mods/generator_prompt.js
@@ -4,6 +4,7 @@ var creeperMod = "mods/mobs.js";
var spoutMod = "mods/spouts.js";
var fairyMod = "mods/more_fairies.js";
var cloudMod = "mods/more_clouds.js";
+var bombMod = "mods/more_bombs.js";
if(enabledMods.includes(creeperMod)) {
lategenOptions.push("creeper");
};
@@ -16,9 +17,12 @@ if(enabledMods.includes(fairyMod)) {
if(enabledMods.includes(cloudMod)) {
lategenOptions.push("cloud");
};
+if(enabledMods.includes(bombMod)) {
+ lategenOptions.push("bomb");
+};
lgoDisplayString = lategenOptions.join(", ");
if(lgoDisplayString === "") {
- lgoDisplayString: "[None. This requires at least one element-generating mod: mobs.js, spouts.js, more_fairies.js, or more_clouds.js!]";
+ lgoDisplayString: "[None. This requires at least one element-generating mod: mobs.js, spouts.js, more_fairies.js, more_clouds.js, or more_bombs.js!]";
};
document.addEventListener("keydown", function(e) { //prop prompt listener
@@ -60,6 +64,9 @@ function generatorPrompt() {
case "cloud":
generateCloud(elements,true);
break;
+ case "bomb":
+ generateBomb(elements,true);
+ break;
default:
alert("An invalid type made it past the if statement. You shouldn't ever see this error.");
throw new Error("An invalid type made it through the if statement.");
@@ -91,4 +98,4 @@ function parseForLateGenerationParameter(input) {
};
};
return input;
-};
\ No newline at end of file
+};
diff --git a/mods/more_bombs.js b/mods/more_bombs.js
index 576f9155..309086c3 100644
--- a/mods/more_bombs.js
+++ b/mods/more_bombs.js
@@ -1,8 +1,30 @@
var modName = "mods/more_bombs.js";
-var explodeAtPlusMod = "mods/explodeAtPlus.js";
+var runAfterAutogenMod = "mods/runAfterAutogen and onload restructure.js";
+var libraryMod = "mods/code_library.js";
-if(enabledMods.includes(explodeAtPlusMod)) {
- urlParams = new URLSearchParams(window.location.search);
+if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) {
+ eLists.BOMB = ["bomb", "tnt", "c4", "grenade", "dynamite", "gunpowder", "firework", "nuke", "h_bomb", "dirty_bomb", "emp_bomb", "sticky_bomb", "cold_bomb", "hot_bomb", "electro_bomb", "water_bomb", "antimatter_bomb", "flashbang", "smoke_grenade", "fireball", "landmine", "cluster_bomb", "cluster_nuke", "op_hottester_bomb", "anti-bomb", "electric_bomblet", "electric_cluster_bomb", "radioactive_popper", "acid_bomb", "amalgamated_bomb"];
+ var excludedBombElements = ["water", "antimatter", "acid"];
+
+ //Generate bombs
+ if(urlParams.get('generateBombs') !== null) { //if the variable exists at all
+ generateBombs = true
+ } else { //if it doesn't (and it returns null)
+ generateBombs = false
+ }
+
+ function tryJoin(stringOrArray,joiner) {
+ //console.log(`tryJoin: ${stringOrArray}`);
+ if(typeof(stringOrArray) === "string") {
+ //console.log("tryJoin: String");
+ return stringOrArray;
+ } else if(Array.isArray(stringOrArray)) {
+ //console.log("tryJoin: Array");
+ return stringOrArray.join(joiner);
+ } else {
+ throw new TypeError(`Unexpected type: ${typeof(stringOrArray)}`);
+ };
+ };
if(urlParams.get('bombAmount') != null) { //null check
bombAmount = urlParams.get('bombAmount')
@@ -20,15 +42,6 @@ if(enabledMods.includes(explodeAtPlusMod)) {
bombAmount = 10
}
- if(typeof(runAfterAutogen) === "function") {
- runAfterAutogen(function() {
- if(typeof(elements.vaporized_rock) === "object") {
- elements.molten_dirt.tempHigh = 3000;
- elements.molten_dirt.stateHigh = "vaporized_rock";
- };
- });
- };
-
function hotterBomb(pixel,x,y,radius,fire,smoke,power,damage) {
//console.log(`Radius: ${radius}\nPower: ${power}\nPixel: (${pixel.x},${pixel.y})\nDamage: ${damage}`);
//console.log(`Expected temperature increase for pixel at (${pixel.x},${pixel.y}): ${800 * ((1 + (7 * damage)) ** 2) * ((power ** 2) * 1.5)}`);
@@ -59,6 +72,7 @@ if(enabledMods.includes(explodeAtPlusMod)) {
state: "solid",
density: 1300,
excludeRandom: true,
+ desc: "It's a nuke that drops more nukes.
To enable automatic bomb generation, set the generateBombs query parameter.",
};
elements.electric_bomblet = {
@@ -210,6 +224,7 @@ if(enabledMods.includes(explodeAtPlusMod)) {
desc: `${5*(i+1)/10} times the radius of the regular bomb`,
cooldown: defaultCooldown,
};
+ eLists.BOMB.push(`bomb_${i}`);
};
elements.anti_bomb = {
@@ -241,11 +256,143 @@ if(enabledMods.includes(explodeAtPlusMod)) {
desc: `${5*(i+1)/10} times the radius of the regular anti-bomb`,
cooldown: defaultCooldown,
};
+ eLists.BOMB.push(`anti_bomb_${i}`);
};
+ //genfunc
+ function generateBomb(bombElements,isAfterScriptLoading=false) {//it can be a single element, though
+ //To specify an array bomb, have the array be inside another array.
+ /*For reasons related to how element colors are loaded, if this function is being run from a JS mod file, isAfterScriptLoading should be false.
+ Otherwise, you'll get TypeErrors for some reason when trying to place your bomb. If this is being run after the game has loaded (e.g. in the console),
+ then isAfterScriptLoading should be true or you might also get TypeErrors (this latter case was a bit inconsistent when I tested it, but
+ the former case wasn't. **isAfterScriptLoading must be false when this function is run from a JS mod file**.*/
+ if(typeof(bombElements) === "string") { //it should be an array, so string check
+ //console.log("String detected");
+ if(bombElements.includes(",")) { //comma-separated string?
+ //console.log("Splitting string to array");
+ bombElements = bombElements.split(","); //,SS to array
+ } else {
+ //console.log("Wrapping string in array");
+ bombElements = [bombElements]; //single string to array
+ };
+ };
+ for(aaf = 0; aaf < bombElements.length; aaf++) {
+ var elementOfBomb = bombElements[aaf];
+ var startColor;
+ //console.log(elementOfBomb);
+
+ var bombName;
+
+ if(typeof(elementOfBomb === "string")) { //comma separated string check
+ if(elementOfBomb.includes(",")) { //if it is
+ elementOfBomb = elementOfBomb.split(","); //to array
+ elementOfBomb = elementOfBomb.filter(function(e) { //strip nonexistent elements
+ return typeof(elements[e]) === "object";
+ });
+ };
+ };
+ if(Array.isArray(elementOfBomb)) {
+ bombName = `${elementOfBomb.join("_")}_bomb`; //auto placer element name
+
+ //array case color concatenator (bombs are always excludeRandom)
+ startColor = [];
+ //console.log(elementOfBomb);
+ for(ll = 0; ll < elementOfBomb.length; ll++) {
+ startColor = startColor.concat(elements[elementOfBomb[ll]].color);
+ };
+ } else { //they should all be strings, so here
+ bombName = `${elementOfBomb}_bomb`; //auto placer element name
+ startColor = elements[elementOfBomb].color;
+ };
+
+ //Color gen
+ if(Array.isArray(startColor)) { //Average arrays, make colors rgb()
+ startColor = averageRgbPrefixedColorArray(startColor);
+ } else {
+ startColor = rgbHexCatcher(startColor);
+ };
+
+ startColor = addColors(changeLuminance(changeSaturation(startColor,0.6,"multiply","hsl_json"),0.5,"multiply","rgb"),"rgb(24,0,0)","rgb");
+
+ var newColorObject = rgbStringToObject(startColor);
+
+ //End color gen
+
+ //The bomb
+
+ //console.log(elementOfBomb);
+ var firstInfo, firstTemp;
+ if(Array.isArray(elementOfBomb)) {
+ firstInfo = elements[elementOfBomb[0]];
+ firstTemp = airTemp;
+ if(typeof(firstInfo.temp) !== "undefined") {
+ firstTemp = firstInfo.temp;
+ };
+ } else {
+ firstInfo = elements[elementOfBomb];
+ firstTemp = airTemp;
+ if(typeof(firstInfo.temp) !== "undefined") {
+ firstTemp = firstInfo.temp;
+ };
+ };
+
+ elementOfBomb = tryJoin(elementOfBomb,",");
+
+ //console.log(elementOfBomb);
+
+ if(!elementExists(bombName)) {
+ elements[bombName] = {
+ color: startColor,
+ insulate: true,
+ flippableX: true,
+ colorObject: newColorObject,
+ behavior: [
+ ["XX",`EX:10>${elementOfBomb}`,"XX"],
+ ["XX","XX","XX"],
+ ["M2",`M1 AND EX:10>${elementOfBomb}`,"M2"]
+ ],
+ category: "auto_bombs",
+ temp: firstTemp,
+ excludeRandom: true,
+ };
+ if(typeof(eLists) === "undefined") {
+ eLists = {};
+ };
+ if(typeof(eLists.BOMB) === "undefined") {
+ eLists.BOMB = [];
+ };
+ eLists.BOMB.push(bombName);
+ if(typeof(bombChoices) === "undefined") {
+ bombChoices = []
+ };
+ if(!bombChoices.includes(bombName)) {
+ bombChoices.push(bombName);
+ };
+ if(isAfterScriptLoading) {
+ elements[bombName].flippableX = true;
+ elementCount++; //increment for new bomb element
+ createElementButton(bombName);
+ elements[bombName].id = nextid++;
+ document.getElementById("extraInfo").innerHTML = "
There are " + elementCount + " elements, including " + hiddenCount + " hidden ones.
©2021-" + new Date().getFullYear() + ". All Rights Reserved. R74n
"; //update extra info counts (and the copyright year, due to the method used) + }; + }; + }; + }; + + runAfterAutogen(function() { + if(elementExists("vaporized_rock")) { + elements.molten_dirt.tempHigh = 3000; + elements.molten_dirt.stateHigh = "vaporized_rock"; + }; + if(generateBombs) { + var tempArray = Object.keys(elements); + tempArray.push(["rock", "sand"]); + generateBomb(tempArray,false) + }; + }); + runAfterLoad(function() { if(enabledMods.includes("mods/fey_and_more.js")) { - elements.lower_color_copy.breakInto.push("magic") amalgamatedBombFire += ",poisonwater".repeat(8); amalgamatedBombFire += ",mystic_fire".repeat(4); amalgamatedBombFire += ",firesea".repeat(6); @@ -261,6 +408,8 @@ if(enabledMods.includes(explodeAtPlusMod)) { amalgamatedBombFire += ",warp".repeat(6); amalgamatedBombFire += ",bomb_3".repeat(3); amalgamatedBombFire += ",op_hottester_bomb".repeat(3); + eLists.BOMB.push("unnamed_bomb"); + eLists.BOMB.push("warp_bomb"); }; if(enabledMods.includes("mods/glenn_gases.js")) { amalgamatedBombFire += ",electric_gas".repeat(3); @@ -289,7 +438,8 @@ if(enabledMods.includes(explodeAtPlusMod)) { }; }); } else { - alert(`The ${explodeAtPlusMod} mod is required and has been automatically inserted (reload for this to take effect).`) - enabledMods.splice(enabledMods.indexOf(modName),0,explodeAtPlusMod) + 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 all required; any missing mods in this list have been automatically inserted (reload for this to take effect).`) localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); }; diff --git a/mods/more_fairies.js b/mods/more_fairies.js index 9bd31c24..e3eccda8 100644 --- a/mods/more_fairies.js +++ b/mods/more_fairies.js @@ -289,9 +289,11 @@ if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod) //Post-generation tasks //Manual eLists.FAIRY updates - eLists.FAIRY.push("acid_fairy"); - eLists.FAIRY.push("oil_fairy"); - eLists.FAIRY.push("honey_fairy"); + runAfterLoad(function() { + eLists.FAIRY.push("acid_fairy"); + eLists.FAIRY.push("oil_fairy"); + eLists.FAIRY.push("honey_fairy"); + }); //Revamp fairykill behaviors.FAIRYKILL_OLD = behaviors.FAIRYKILL; diff --git a/mods/runAfterAutogen and onload restructure.js b/mods/runAfterAutogen and onload restructure.js index e3ad3daa..0d2b9f58 100644 --- a/mods/runAfterAutogen and onload restructure.js +++ b/mods/runAfterAutogen and onload restructure.js @@ -506,6 +506,7 @@ function addKeyboardListeners() { document.getElementById("underDiv").style.display = "block"; document.getElementById("pagetitle").style.display = "block"; document.getElementById("colorSelector").style.display = "block"; + document.getElementById("bottomInfoBox").style.display = "block"; } else { document.getElementById("underDiv").style.display = "none"; if (showingMenu) { @@ -513,6 +514,7 @@ function addKeyboardListeners() { }; document.getElementById("pagetitle").style.display = "none"; document.getElementById("colorSelector").style.display = "none"; + document.getElementById("bottomInfoBox").style.display = "none"; } } if (showingMenu) { @@ -849,4 +851,4 @@ You can also join our Di var firstDiv = document.getElementsByClassName("category")[0]; var firstElementButton = firstDiv.getElementsByClassName("elementButton")[0]; selectElement(firstElementButton.getAttribute("element")); -}; \ No newline at end of file +};