Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion js/bingoBoard-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
23 changes: 20 additions & 3 deletions js/bingov7.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var randomWeaponPool = [];
var isRandomWeaponsPoolPopulated = false;
var myBingoBoard;
var myWeaponRandomizer;
var isSplatScreenEnabled;

var bingo = function(weaponMap) {

Expand All @@ -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

Expand All @@ -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 ("<p>Splatoon3Bingo.com <strong>v7</strong>&emsp;Mode: <strong>" + MODE[0].toUpperCase() + MODE.substring(1) + "</strong>&emsp;Seed: <strong>" +
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion js/weaponRandomizer.js
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down Expand Up @@ -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]);
}
}
Expand Down
7 changes: 7 additions & 0 deletions tables/s3weaponsv7.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion v7/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ <h2>Generate a new card</h2>
<h2>Settings</h2>
<a class="sortButton" href="#" onclick="refreshBoard(false);">Hide Weapon Names</a>
<a class="sortButton" href="#" onclick="refreshBoard(true);">Show Weapon Names</a>
<br>
<br><br>
<p>Allow Weapons with Splattercolor Screen?</p>
<input type="radio" id="yesSplatScreen" name="radioSplatScreen" onclick="reseedPage(true);" value="1">
<label for="yesSplatScreen">Yes</label><br>
<input type="radio" id="noSplatScreen" name="radioSplatScreen" onclick="reseedPage(true);" value="0">
<label for="noSplatScreen">No</label><br>
<h2>Random Weapon Assignment</h2>
<input type="radio" id="randomIgnore" name="radioRandom" onclick="disableSeed()" value="0">
<label for="randomIgnore">Ignore Seed</label><br>
Expand Down