From c42e315a45686c77107564710cdcdb25549dec81 Mon Sep 17 00:00:00 2001 From: ethanf Date: Fri, 2 Feb 2024 01:27:11 -0600 Subject: [PATCH] fix: fk target number + update passion default --- index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 50f8deb..7b7e494 100644 --- a/index.js +++ b/index.js @@ -101,7 +101,7 @@ const avgDiff = (arr) => { // FUN value: Fluctuating Unfairness Normalization value // PASSION: Player Ability/Skill Separation Index Offset Number let funInput = 4; // 1-10 -let passionInput = 2; // 1-5 +let passionInput = 1; // 1-5 // balance attempt counter, not modifiable let attempts = 0; @@ -428,7 +428,7 @@ client.on("interactionCreate", async (interaction) => { ); } - const targetPlayerCount = 3; + const targetPlayerCount = 18; if (pickingPlayers.length + addupPlayers.length < targetPlayerCount) { return await interaction.followUp( `Can't find enough total players, expected ${targetPlayerCount} (found ${ @@ -468,13 +468,13 @@ client.on("interactionCreate", async (interaction) => { } fkAttempts++; const idx = Math.floor(Math.random() * pickingPlayers.length); - let fk = await pickingPlayers.splice(idx, 1)[0]; + let fk = pickingPlayers[idx] if (protectedFk.includes(fk.id)) { protectedStr += `${fk.id}, `; - pickingPlayers.push(fk); - continue; + } else { + pickingPlayers.splice(idx, 1); + fatkids.push(fk); } - fatkids.push(fk); } if (protectedStr.length > 0) { console.log(`Protected fks: ${protectedStr}`);