diff --git a/js/bingoBoard-v5.js b/js/bingoBoard-v5.js index 13d8288..a1737dc 100644 --- a/js/bingoBoard-v5.js +++ b/js/bingoBoard-v5.js @@ -11,11 +11,12 @@ class BingoBoard { #t8 = [[0, 9, 13, 16, 22], [1, 7, 14, 18, 20], [2, 8, 11, 15, 24], [3, 5, 12, 19, 21], [4, 6, 10, 17, 23]]; #allTemplates = [this.#t1, this.#t2, this.#t3, this.#t4, this.#t5, this.#t6, this.#t7, this.#t8]; - constructor(weaponMap, seed, isBalancedCard) { + constructor(weaponMap, seed, isBalancedCard, isSplatScreenEnabled) { Math.seedrandom(seed); this.seed = seed; this.weaponMap = weaponMap; this.isBalancedCard = isBalancedCard; + this.isSplatScreenEnabled = isSplatScreenEnabled; this.template = this.#allTemplates[Math.floor(Math.random() * this.#allTemplates.length)]; this.board = this.setupBoard(); } @@ -46,6 +47,10 @@ class BingoBoard { let index = Math.floor(Math.random() * tempWeapons.length); let chosenWeapon = tempWeapons[index]; board[i] = chosenWeapon; + if (this.isSplatScreenEnabled === false && splatScreenWeapons.includes(chosenWeapon.name)) { + // pick a different weapon + i--; + } tempWeapons.splice(index, 1); } return board; @@ -70,6 +75,10 @@ class BingoBoard { let chosenWeapon = currentWeaponList[index]; let boardIndex = this.template[j][k]; board[boardIndex] = chosenWeapon; + if (this.isSplatScreenEnabled === false && splatScreenWeapons.includes(chosenWeapon.name)) { + // pick a different weapon + k--; + } currentWeaponList.splice(index, 1); } tempWeaponsMap.set(currentKey, currentWeaponList); diff --git a/js/bingov7.js b/js/bingov7.js index 8d9df97..ab58489 100644 --- a/js/bingov7.js +++ b/js/bingov7.js @@ -3,6 +3,7 @@ var randomWeaponPool = []; var isRandomWeaponsPoolPopulated = false; var myBingoBoard; var myWeaponRandomizer; +var isSplatScreenEnabled; var bingo = function(weaponMap) { @@ -11,7 +12,7 @@ var bingo = function(weaponMap) { let SEED = urlParams.get('seed'); if(SEED === undefined || SEED === null || SEED === "") { - return reseedPage(true); + return reseedPage(true, true); } Math.seedrandom(SEED); //sets up the RNG @@ -25,7 +26,20 @@ var bingo = function(weaponMap) { isBalancedCard = false; } - myBingoBoard = new BingoBoard(weaponMap, SEED, isBalancedCard); + let SPLATSCREEN = urlParams.get('splatscreen'); + if(SPLATSCREEN === undefined || SPLATSCREEN === null || SPLATSCREEN.toLowerCase() !== "disabled") { + SPLATSCREEN = "enabled"; + } + + if(SPLATSCREEN.toLowerCase() == "disabled") { + isSplatScreenEnabled = false; + $("input[id=noSplatScreen]").prop("checked", true); + } else { + isSplatScreenEnabled = true; + $("input[id=yesSplatScreen]").prop("checked", true); + } + + myBingoBoard = new BingoBoard(weaponMap, SEED, isBalancedCard, isSplatScreenEnabled); var results = $("#results"); results.append ("

Splatoon3Bingo.com v7 Mode: " + MODE[0].toUpperCase() + MODE.substring(1) + " Seed: " + @@ -128,7 +142,7 @@ function initializeRandomizer() { if (document.getElementById("randomSet").checked === true) { seed = document.getElementById("mySeed").value; } - myWeaponRandomizer = new WeaponRandomizer(myBingoBoard, seed, isUsingAllWeapons, isAllowingRepeats, isIgnoreSeed); + myWeaponRandomizer = new WeaponRandomizer(myBingoBoard, seed, isUsingAllWeapons, isAllowingRepeats, isIgnoreSeed, isSplatScreenEnabled); } function updateRandomWeapon(currentObj) { @@ -172,6 +186,9 @@ function reseedPage(isBalancedCard) { var urlParams = "?seed=" + Math.ceil(999999 * Math.random()); if (!isBalancedCard) { urlParams = urlParams + "&mode=chaos"; + } + if (document.getElementById("noSplatScreen").checked === true) { + urlParams = urlParams + "&splatscreen=disabled"; } window.location = urlParams; return false; diff --git a/js/weaponRandomizer.js b/js/weaponRandomizer.js index a6e6a3f..4dbdeee 100644 --- a/js/weaponRandomizer.js +++ b/js/weaponRandomizer.js @@ -1,11 +1,12 @@ class WeaponRandomizer { - constructor(bingoBoard, seed, isUsingAllWeapons, isAllowingRepeats, isIgnoreSeed) { + constructor(bingoBoard, seed, isUsingAllWeapons, isAllowingRepeats, isIgnoreSeed, isSplatScreenEnabled) { this.weaponMap = bingoBoard.weaponMap; this.board = bingoBoard.board; this.seed = seed; this.isIgnoreSeed = isIgnoreSeed; this.isUsingAllWeapons = isUsingAllWeapons; this.isAllowingRepeats = isAllowingRepeats; + this.isSplatScreenEnabled = isSplatScreenEnabled; this.pool = this.setupPool(); this.index = -1; } @@ -42,6 +43,11 @@ class WeaponRandomizer { for (let key in mapKeys) { let value = this.weaponMap.get(mapKeys[key]); for (let val in value) { + console.log(value[val].name); + if (this.isSplatScreenEnabled === false && splatScreenWeapons.includes(value[val].name)) { + // skip this weapon + continue; + } result.push(value[val]); } } diff --git a/tables/s3weaponsv7.js b/tables/s3weaponsv7.js index 4168ced..df4866e 100644 --- a/tables/s3weaponsv7.js +++ b/tables/s3weaponsv7.js @@ -158,6 +158,13 @@ var miscList = [ {name: "Neo Splatana Stamper", image:"../weapons/107.png", types: "Splatana"} ] +var splatScreenWeapons = [ + "Foil Flingza Roller", + "Undercover Sorella Brella", + "Foil Squeezer", + ".52 Gal Deco" +] + weaponMap.set('Frontline', frontLineShooterList); weaponMap.set('Backline', backLineShooterList); weaponMap.set('Splattershot', splattershotList); diff --git a/v7/index.html b/v7/index.html index b1d6c02..69c6265 100644 --- a/v7/index.html +++ b/v7/index.html @@ -33,7 +33,12 @@

Generate a new card

Settings

Hide Weapon Names Show Weapon Names -
+

+

Allow Weapons with Splattercolor Screen?

+ +
+ +

Random Weapon Assignment