diff --git a/mod-list.html b/mod-list.html
index e89a809a..0a9f3b8b 100644
--- a/mod-list.html
+++ b/mod-list.html
@@ -301,6 +301,7 @@
| random_liquids.js | Randomly generates liquids on game load | Alice |
| sbmixup.js | Adds silly elements from a Mix-Up! game | stefanblox |
| star_wars.js | Adds various items from Star Wars by Disney | SeaPickle754 |
+
| subspace.js | Adds a Subspace Tripmine sound effect when an explosion happens | nousernamefound |
| sus.js | Adds an Among Us crewmate | Nv7 |
| triggerable_random_powders.js | Adds powders with different abilities, such as heating and cooling | Alice |
| troll.js | Adds various dumb elements that iterate randomly on the entire screen | Alice |
diff --git a/mods/funnynames.js b/mods/funnynames.js
index ef657e4a..749063b2 100644
--- a/mods/funnynames.js
+++ b/mods/funnynames.js
@@ -1,3 +1,169 @@
+function getImportantLetters(input) { // entirely chadgbd i just told it what algoritm to make
+ const isVowel = char => 'AEIOU'.includes(char);
+ const isConsonant = char => /^[BCDFGHJKLMNPQRSTVWXYZ]$/.test(char);
+
+ const removeDuplicates = str => {
+ let seen = new Set();
+ return str.split('').filter(char => {
+ if (seen.has(char)) {
+ return false;
+ } else {
+ seen.add(char);
+ return true;
+ }
+ }).join('');
+ };
+
+ const words = input.replace(/[^a-zA-Z0-9\s_]/g, '').replace(/_/g, ' ').toUpperCase().split(/\s+/);
+
+ if (input.length <= 4) {
+ return input.toUpperCase();
+ } else if (words.length === 1) {
+ const word = removeDuplicates(words[0]);
+ let result = '';
+ let consonantCount = 0;
+ let vowelFound = false;
+
+ for (let char of word) {
+ if (isVowel(char) && !vowelFound) {
+ result += char;
+ vowelFound = true;
+ } else if (isConsonant(char) && consonantCount < 3) {
+ result += char;
+ consonantCount++;
+ }
+ if (result.length === 4) {
+ break;
+ }
+ }
+
+ return result.padEnd(4, result[result.length - 1] || '');
+ } else if (words.length === 2) {
+ const firstWord = words[0];
+ const secondWord = words[1];
+ let result = '';
+
+ if (isNaN(firstWord) && !isNaN(secondWord)) {
+ const word = removeDuplicates(firstWord);
+ let consonantCount = 0;
+ let vowelFound = false;
+
+ for (let char of word) {
+ if (isVowel(char) && !vowelFound) {
+ result += char;
+ vowelFound = true;
+ } else if (isConsonant(char) && consonantCount < 2) {
+ result += char;
+ consonantCount++;
+ }
+ if (result.length === 3) {
+ break;
+ }
+ }
+ result = result.padEnd(3, result[result.length - 1] || '') + secondWord;
+ } else if (!isNaN(firstWord) && isNaN(secondWord)) {
+ const word = removeDuplicates(secondWord);
+ let consonantCount = 0;
+ let vowelFound = false;
+
+ for (let char of word) {
+ if (isVowel(char) && !vowelFound) {
+ result += char;
+ vowelFound = true;
+ } else if (isConsonant(char) && consonantCount < 2) {
+ result += char;
+ consonantCount++;
+ }
+ if (result.length === 3) {
+ break;
+ }
+ }
+ result = result.padEnd(3, result[result.length - 1] || '') + firstWord;
+ } else {
+ result = firstWord[0];
+ let consonants = [];
+ let vowels = [];
+ let allChars = [];
+
+ for (let char of secondWord) {
+ allChars.push(char);
+ if (isConsonant(char)) {
+ consonants.push(char);
+ } else if (isVowel(char)) {
+ vowels.push(char);
+ }
+ }
+
+ if (consonants.length >= 3) {
+ let consonantCount = 0;
+ for (let char of allChars) {
+ if (isConsonant(char) && consonantCount < 3) {
+ result += char;
+ consonantCount++;
+ }
+ if (result.length === 4) {
+ break;
+ }
+ }
+ } else if (consonants.length === 2) {
+ let consonantCount = 0;
+ let vowelCount = 0;
+ for (let char of allChars) {
+ if (isConsonant(char) && consonantCount < 2) {
+ result += char;
+ consonantCount++;
+ } else if (isVowel(char) && vowelCount < 1) {
+ result += char;
+ vowelCount++;
+ }
+ }
+ } else {
+ let consonantCount = 0;
+ let vowelCount = 0;
+ for (let char of allChars) {
+ if (isConsonant(char) && consonantCount < 1) {
+ result += char;
+ consonantCount++;
+ } else if (isVowel(char) && vowelCount < 2) {
+ result += char;
+ vowelCount++;
+ }
+ if (result.length === 4) {
+ break;
+ }
+ }
+ }
+
+ result = result.padEnd(4, result[result.length - 1] || '');
+ }
+
+ return result;
+ } else if (words.length === 3) {
+ const firstWord = words[0];
+ const secondWord = words[1];
+ const thirdWord = words[2];
+ let result = firstWord[0] + secondWord[0];
+ let consonantCount = 0;
+ let vowelFound = false;
+
+ for (let char of thirdWord) {
+ if (isVowel(char) && !vowelFound) {
+ result += char;
+ vowelFound = true;
+ } else if (isConsonant(char) && consonantCount < 1) {
+ result += char;
+ consonantCount++;
+ }
+ if (result.length === 4) {
+ break;
+ }
+ }
+
+ return result.padEnd(4, result[result.length - 1] || '');
+ } else {
+ return words.map(word => word[0]).join('').slice(0, 4);
+ }
+}
function swapObjectValues(obj) {
const keys = Object.keys(obj);
while (keys.length > 1) {
@@ -50,12 +216,15 @@ elements.name_settings = {
if (doNameSwapping == "yes"){settings.funnyname.doNameSwapping = true} else {settings.funnyname.doNameSwapping = false}
var doLetterSwapping = prompt("Would you like to swap the letters in the names? Type yes or no.", "no")
if (doLetterSwapping == "yes"){settings.funnyname.doLetterSwapping = true} else {settings.funnyname.doLetterSwapping = false}
+ var condenseToFour = prompt("Would you like to condense the names to 4 letters? Also known as TPT-ify. Type yes or no.", "no")
+ if (condenseToFour == "yes"){settings.funnyname.condenseToFour = true} else {settings.funnyname.condenseToFour = false}
var doNameRates = prompt("Would you like to make the names a rating? If yes, this will set all others to no (it is incompatible.) Type yes or no.", "no")
if (doNameRates == "yes"){
settings.funnyname.doNameRates = true
settings.funnyname.doNameSwapping = false
settings.funnyname.doVowelSwapping = false
settings.funnyname.doLetterSwapping = false
+ settings.funnyname.condenseToFour = false
} else {settings.funnyname.doNameRates = false}
saveSettings()
var allNamesString = prompt("Would you like to set all names to a custom string? This will set all others to no. Type yes or no.", "no")
@@ -64,6 +233,7 @@ elements.name_settings = {
settings.funnyname.doNameSwapping = false
settings.funnyname.doVowelSwapping = false
settings.funnyname.doLetterSwapping = false
+ settings.funnyname.condenseToFour = false
settings.funnyname.doNameRates = false
customName = prompt("What would you like to set the names to?", "")
settings.funnyname.customName = true
@@ -138,5 +308,13 @@ runAfterAutogen(
}
}
}
+ if (settings.funnyname.condenseToFour){
+ for (let elementname in elements){
+ if (elementname != "name_settings"){
+ let newelementname = getImportantLetters((elements[elementname].name)||elementname)
+ elements[elementname].name = newelementname
+ }
+ }
+ }
}
)
\ No newline at end of file
diff --git a/mods/subspace.js b/mods/subspace.js
new file mode 100644
index 00000000..1dd56f8f
--- /dev/null
+++ b/mods/subspace.js
@@ -0,0 +1,10 @@
+function playSubspace() {
+ var audio = new Audio("https://JustAGenericUsername.github.io/subspaceboom.mp3");
+ audio.play();
+}
+window.addEventListener('load', function() {
+const oldexpfunc = explodeAt;
+explodeAt = function(x,y,radius,fire="fire"){
+ oldexpfunc(x,y,radius,fire)
+ playSubspace()
+}})
\ No newline at end of file