Closed Blizihguh closed 2 years ago
Made a new branch (refactor) to work on this. The infrastructure is done, but every game will need to be updated individually before I can merge.
Keeping track of the games that need to be updated here
FINISHED: Asshole Chameleon Codenames Conspiracy Decrypto Dream Crush Fastlength Goofspiel Letter Jam Madness Mafia Medium Template Tic Tac Toe Trickipedia Werewords
WIP GAMES (need updating at some point, but not blocking for merge): Curios Deception Love Letter
At the moment, games get their list of players indirectly, by accessing message.mentionedUsers. This is simple for the programmer, but has a few backend issues:
The solution here is to refactor the way game start functions work, providing an additional argument with an indexed table of users. If the user starts the game with !start or !vc, Mayor McMott will translate the data from message.mentionedUsers or channel.connectedMembers, respectively, into an indexed table. This neatly sidesteps the first two issues mentioned above, and makes the third much simpler (just call misc.shuffleTable).
Unfortunately, doing this will require moderately invasive changes to the start function of every single Mayor McMott game, as well as to the !start/!vc logic in Mayor McMott itself.