lykoss / lykos

Werewolf, the popular detective/social party game (a theme of Mafia)
https://werewolf.chat
Other
127 stars 63 forks source link

Remove day phase check from piper win condition #503

Closed fndax closed 2 years ago

fndax commented 2 years ago

The win condition for piper checked whether the current phase was "day". This meant that games that ended on the day transition (e.g. the last uncharmed player got charmed overnight) weren't resolving properly if other roles' win conditions triggered on the same transition (e.g. wolves killed enough people to win at the same time). Additionally, if other roles didn't have a win condition, the game would transition fully to day (lynch instructions and all) and then end the game, which looked odd.

Back in ye olden days, this check was needed because charmings were applied immediately (i.e. without the check, a game might end right after the piper charmed, because all players would then be charmed). However, a separate variable TOBECHARMED now holds newly-charmed players during night and they're added to the CHARMED list during the day transition, so this check seems to be redundant now.

Discussed with moonmoon on IRC, as far as we can tell the only other behavior difference caused by this change should be that wins due to idling (i.e. last uncharmed person idles out) should now resolve immediately instead of waiting until day time, which seems fine to us.

Tested in debug mode in 6p and 8p charming with a few different win types and player behaviors, not seeing any additional issues.

Closes #488, closes #501