Allow specifying lover wins with fool in !fgame roles

This commit is contained in:
nyuszika7h 2016-10-24 17:25:51 +02:00
parent 430fa3c7c7
commit 0580915150
2 changed files with 6 additions and 1 deletions

View File

@ -683,6 +683,7 @@
"invalid_reveal": "Did not recognize value \u0002{0}\u0002 for role reveal. Allowed values: on, off, team",
"invalid_stats": "Did not recognize value \u0002{0}\u0002 for stats type. Allowed values: default, accurate, team, disabled",
"invalid_abstain": "Did not recognize value \u0002{0}\u0002 for abstain. Allowed values: enabled, restricted, disabled",
"invalid_lover_wins_with_fool": "Did not recognize value \u0002{0}\u0002 for lover wins with fool. Allowed values: true, false",
"lovers_win": "Game over! The remaining villagers through their inseparable love for each other have agreed to stop all of this senseless violence and coexist in peace forever more. All remaining players win.",
"everyone_died_won": "Game over! Everyone is dead, and it is in death that they realize this is what they wanted all along. They remain in the village as joyful spirits ever since. Everyone wins.",
"role_disabled": "The role \u0002{0}\u0002 has been disabled.",

View File

@ -92,6 +92,10 @@ class GameMode:
self.LIMIT_ABSTAIN = True
elif val == "disabled":
self.ABSTAIN_ENABLED = False
elif key == "lover wins with fool":
if val not in ("true", "false"):
raise InvalidModeException(messages["invalid_lover_wins_with_fool"].format(val))
self.LOVER_WINS_WITH_FOOL = True if val == "true" else False
def startup(self):
pass
@ -148,7 +152,7 @@ class ChangedRolesMode(GameMode):
self.ROLE_GUIDE[role.lower()] = tuple([int(num)] * len(var.ROLE_INDEX))
elif role.lower() == "default" and num.lower() in self.ROLE_GUIDE:
self.DEFAULT_ROLE = num.lower()
elif role.lower() in ("role reveal", "reveal roles", "stats type", "stats", "abstain"):
elif role.lower() in ("role reveal", "reveal roles", "stats type", "stats", "abstain", "lover wins with fool"):
# handled in parent constructor
pass
else: