From 19b98a6030311f47fa6718d294c3fdc7f05ed397 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 9 Jan 2021 12:09:28 -0500 Subject: [PATCH] Don't allow blue vs purple in c4 --- commands/games-mp/connect-four.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/games-mp/connect-four.js b/commands/games-mp/connect-four.js index 10c45952..5a3963e0 100644 --- a/commands/games-mp/connect-four.js +++ b/commands/games-mp/connect-four.js @@ -83,7 +83,11 @@ module.exports = class ConnectFourCommand extends Command { this.client.games.delete(msg.channel.id); return msg.say('Looks like they declined...'); } - const available = Object.keys(colors).filter(clr => color !== clr); + const available = Object.keys(colors).filter(clr => { + if (color === 'blue' && clr === 'purple') return false; + if (color === 'purple' && clr === 'blue') return false; + return color !== clr; + }); await msg.say(`${opponent}, what color do you want to be? Either ${list(available, 'or')}.`); const filter = res => res.author.id === opponent.id && available.includes(res.content.toLowerCase()); const p2Color = await msg.channel.awaitMessages(filter, {