gluxon / phpwolf

The popular Werewolf game (variant of Mafia) powered by a PHP IRC bot
GNU General Public License v3.0
12 stars 7 forks source link

Changed nicknames mess up the game #42

Open Snuupy opened 11 years ago

Snuupy commented 11 years ago

[13:29:14] Snuupy, ishanyx, Pichu, Nascar1996: Welcome to Werewolf, the popular detective/social party game (a theme of Mafia). [13:29:14] --- phpwolf sets modes [##phpwolf +m] [13:29:14] It is now nighttime. All players check for PMs from me for instructions. If you did not receive one, simply sit back, relax, and wait patiently for morning. [13:29:20] Night lasted 00:06. It is now daytime. The villagers awake, thankful for surviving the night, and search the village... [13:29:20] The dead body of ishanyx, a villager, is found. Those remaining mourn his/her death. [13:29:20] --- phpwolf sets modes [##phpwolf -v ishanyx] [13:29:20] The villagers must now vote for whom to lynch. Use "!lynch " to cast your vote. 2 votes are required to lynch. [13:29:26] ish safe [13:29:27] >: ( [13:29:29] !vote Nascar1996 [13:29:30] lol [13:29:30] Snuupy votes for Nascar1996. [13:29:30] --- Nascar1996 is now known as FormulaOne1996 [13:29:39] <seer [13:29:45] !votes [13:29:46] FormulaOne1996: Nascar1996: 1 (Snuupy) [13:29:46] FormulaOne1996: 2 players, 2 votes required to lynch, 2 players available to vote. [13:29:50] xD [13:29:51] I'm seer [13:29:52] lol [13:29:52] !lynch Nas [13:29:58] !lynch Nascar1996 [13:30:05] dafaq [13:30:10] LOLOLOL [13:30:14] !vote for [13:30:15] Pichu votes for FormulaOne1996. [13:30:16] Snuupy: lynch me [13:30:19] !lynch FormulaOne1996 [13:30:20] FormulaOne1996 votes for FormulaOne1996. [13:30:20] The mob drags a protesting FormulaOne1996 to the hanging tree. S/He succumbs to the will of the horde, and is hanged. It is discovered (s)he was a villager. [13:30:20] --- phpwolf sets modes [##phpwolf -v FormulaOne1996] [13:30:20] Game over! There are the same number of wolves as villagers. The wolves eat everyone and win. [13:30:20] Game lasted 01:06. 01:00 was day. 00:06 was night. [13:30:20] The wolf was Nascar1996. The seer was Snuupy. [13:30:20] --- phpwolf sets modes [##phpwolf -m]

ceradon commented 11 years ago

Fixed this bug.

gluxon commented 11 years ago

We need to discuss a potentially different way to store the nicks.

gluxon commented 11 years ago

Here's the issue as it stands. There are two big ones.

If there's a way to change the array key without deleted it, our problem would be solved. Without it, there are two solutions

The second solution is probably the one I'm going to go with.

gluxon commented 11 years ago

http://stackoverflow.com/questions/8883974/change-array-key-without-changing-order