diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 843f70f..31669dc 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -4874,7 +4874,7 @@ def start(cli, nick, chann_, rest): else: possiblegamemodes = [] for gamemode in var.GAME_MODES.keys(): - if len(villagers) >= var.GAME_MODES[gamemode][1] and len(villagers) <= var.GAME_MODES[gamemode][2]: + if len(villagers) >= var.GAME_MODES[gamemode][1] and len(villagers) <= var.GAME_MODES[gamemode][2] and var.GAME_MODES[gamemode][3] > 0: possiblegamemodes += [gamemode]*(var.GAME_MODES[gamemode][3]+votes.get(gamemode, 0)*7) cgamemode(cli, random.choice(possiblegamemodes)) @@ -5945,7 +5945,7 @@ def game(cli, nick, chan, rest): gamemode = rest.lower().split()[0] else: gamemodes = ", ".join(["\002{}\002".format(gamemode) if len(var.list_players()) in range(var.GAME_MODES[gamemode][1], - var.GAME_MODES[gamemode][2]+1) else gamemode for gamemode in var.GAME_MODES.keys() if var.GAME_MODES[gamemode][3] > 0]) + var.GAME_MODES[gamemode][2]+1) else gamemode for gamemode in var.GAME_MODES.keys() if gamemode != "roles"]) cli.notice(nick, "No game mode specified. Available game modes: " + gamemodes) return @@ -5953,9 +5953,9 @@ def game(cli, nick, chan, rest): #players can vote by only using partial name matches = 0 possiblegamemode = gamemode - for gamemode in var.GAME_MODES.keys(): - if gamemode.startswith(gamemode) and var.GAME_MODES[gamemode][3] > 0: - possiblegamemode = gamemode + for mode in var.GAME_MODES.keys(): + if mode.startswith(gamemode) and mode != "roles": + possiblegamemode = mode matches += 1 if matches != 1: cli.notice(nick, "\002{0}\002 is not a valid game mode.".format(gamemode)) @@ -5963,7 +5963,7 @@ def game(cli, nick, chan, rest): else: gamemode = possiblegamemode - if var.GAME_MODES[gamemode][3] > 0: + if gamemode != "roles": var.GAMEMODE_VOTES[cloak] = gamemode cli.msg(chan, "\002{0}\002 votes for the \002{1}\002 game mode.".format(nick, gamemode)) else: @@ -5972,7 +5972,7 @@ def game(cli, nick, chan, rest): def game_help(args=''): return "Votes to make a specific game mode more likely. Available game mode setters: " +\ ", ".join(["\002{}\002".format(gamemode) if len(var.list_players()) in range(var.GAME_MODES[gamemode][1], var.GAME_MODES[gamemode][2]+1) - else gamemode for gamemode in var.GAME_MODES.keys() if var.GAME_MODES[gamemode][3] > 0]) + else gamemode for gamemode in var.GAME_MODES.keys() if gamemode != "roles"]) game.__doc__ = game_help @cmd("fpull", admin_only=True) diff --git a/settings/wolfgame.py b/settings/wolfgame.py index f6dbc98..b7955d4 100644 --- a/settings/wolfgame.py +++ b/settings/wolfgame.py @@ -296,7 +296,7 @@ def reset_roles(index): return newguide # TODO: implement more game modes -@game_mode("roles", 4, 35) +@game_mode("roles", minp = 4, maxp = 35) class ChangedRolesMode(object): """Example: !fgame roles=wolf:1,seer:0,guardian angel:1""" @@ -339,14 +339,14 @@ class ChangedRolesMode(object): except ValueError: raise InvalidModeException("A bad value was used in mode roles.") -@game_mode("default", 4, 24, 7) +@game_mode("default", minp = 4, maxp = 24, likelihood = 10) class DefaultMode(object): """Default game mode.""" def __init__(self): # No extra settings, just an explicit way to revert to default settings pass -@game_mode("foolish", 8, 24, 3) +@game_mode("foolish", minp = 8,maxp = 24, likelihood = 7) class FoolishMode(object): """Contains the fool, be careful not to lynch them!""" def __init__(self): @@ -374,7 +374,7 @@ class FoolishMode(object): "mayor" : ( 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ), }) -@game_mode("mad", 7, 22, 3) +@game_mode("mad", minp = 7, maxp = 22, likelihood = 7) class MadMode(object): """This game mode has mad scientist and many things that may kill you.""" def __init__(self): @@ -404,7 +404,8 @@ class MadMode(object): "assassin" : ( 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 ), }) -@game_mode("evilvillage", 6, 18) +# evilvillage is broken, disable for now +#@game_mode("evilvillage", minp = 6, maxp = 18) class EvilVillageMode(object): """Majority of the village is wolf aligned, safes must secretly try to kill the wolves.""" def __init__(self): @@ -425,7 +426,7 @@ class EvilVillageMode(object): "fool" : ( 0 , 1 , 1 ), }) -@game_mode("classic", 4, 21, 3) +@game_mode("classic", minp = 4, maxp = 21, likelihood = 4) class ClassicMode(object): """Classic game mode from before all the changes.""" def __init__(self): @@ -446,7 +447,7 @@ class ClassicMode(object): "gunner" : ( 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ), }) -@game_mode("rapidfire", 6, 24, 2) +@game_mode("rapidfire", minp = 6, maxp = 24, likelihood = 0) class RapidFireMode(object): """Many roles that lead to multiple chain deaths.""" def __init__(self): @@ -478,7 +479,7 @@ class RapidFireMode(object): "sharpshooter" : ( 0 , 0 , 1 , 1 , 1 , 1 , 1 ), }) -@game_mode("drunkfire", 8, 17, 1) +@game_mode("drunkfire", minp = 8, maxp = 17, likelihood = 0) class DrunkFireMode(object): """Most players get a gun, quickly shoot all the wolves!""" def __init__(self): @@ -509,7 +510,7 @@ class DrunkFireMode(object): "sharpshooter" : ( 2 , 2 , 3 , 3 , 4 ), }) -@game_mode("noreveal", 4, 21, 2) +@game_mode("noreveal", minp = 4, maxp = 21, likelihood = 2) class NoRevealMode(object): """Roles are not revealed when players die.""" def __init__(self): @@ -537,7 +538,7 @@ class NoRevealMode(object): "cursed villager" : ( 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ), }) -@game_mode("lycan", 7, 21, 2) +@game_mode("lycan", minp = 7, maxp = 21, likelihood = 2) class LycanMode(object): """Many lycans will turn into wolves. Hunt them down before the wolves overpower the village.""" def __init__(self): @@ -562,7 +563,7 @@ class LycanMode(object): "mayor" : ( 0 , 0 , 1 , 1 , 1 , 1 , 1 ), }) -@game_mode("amnesia", 10, 24) +@game_mode("amnesia", minp = 10, maxp = 24, likelihood = 0) class AmnesiaMode(object): """Everyone gets assigned a random role on night 3.""" def __init__(self): @@ -578,7 +579,7 @@ class AmnesiaMode(object): # Credits to Metacity for designing and current name # Blame arkiwitect for the original name of KrabbyPatty -@game_mode("aleatoire", 4, 24, 2) +@game_mode("aleatoire", minp = 4, maxp = 24, likelihood = 2) class AleatoireMode(object): """Game mode created by Metacity and balanced by woffle.""" def __init__(self):