Rebalance likelihoods

There are now 5 general brackets of game likelihoods:
- default gets 40 because it's default
- game modes which have proven to be popular and which don't modify core gameplay get 10
- game modes which modify core gameplay a small amount or do not modify it but aren't as popular get 5
- game modes which modify core gameplay a lot or should only rarely appear in rotation get 1
- game modes which are not balanced get 0 (joke/fun modes)

Default likelihoods add up to 95, so the likelihood is approximately also the % chance of it showing up without any votes.
This commit is contained in:
Ryan Schmidt 2018-07-01 12:09:38 -07:00
parent 974f67360d
commit 38505ba9a9

View File

@ -15,7 +15,7 @@ from src.decorators import handle_error, command
from src.containers import UserList, UserSet, UserDict, DefaultUserDict from src.containers import UserList, UserSet, UserDict, DefaultUserDict
from src import events, channels, users from src import events, channels, users
def game_mode(name, minp, maxp, likelihood = 0): def game_mode(name, minp, maxp, likelihood=0):
def decor(c): def decor(c):
c.name = name c.name = name
var.GAME_MODES[name] = (c, minp, maxp, likelihood) var.GAME_MODES[name] = (c, minp, maxp, likelihood)
@ -95,7 +95,7 @@ class GameMode:
evt.data["winner"] = "everyone" evt.data["winner"] = "everyone"
evt.data["message"] = messages["everyone_died_won"] evt.data["message"] = messages["everyone_died_won"]
@game_mode("roles", minp = 4, maxp = 35) @game_mode("roles", minp=4, maxp=35)
class ChangedRolesMode(GameMode): class ChangedRolesMode(GameMode):
"""Example: !fgame roles=wolf:1,seer:0,guardian angel:1""" """Example: !fgame roles=wolf:1,seer:0,guardian angel:1"""
@ -131,7 +131,7 @@ class ChangedRolesMode(GameMode):
except ValueError: except ValueError:
raise InvalidModeException(messages["bad_role_value"]) raise InvalidModeException(messages["bad_role_value"])
@game_mode("default", minp = 4, maxp = 24, likelihood = 20) @game_mode("default", minp=4, maxp=24, likelihood=40)
class DefaultMode(GameMode): class DefaultMode(GameMode):
"""Default game mode.""" """Default game mode."""
def __init__(self, arg="", role_index=var.ROLE_INDEX, role_guide=var.ROLE_GUIDE): def __init__(self, arg="", role_index=var.ROLE_INDEX, role_guide=var.ROLE_GUIDE):
@ -157,7 +157,7 @@ class DefaultMode(GameMode):
else: else:
del evt.data["votelist"][users.Bot] del evt.data["votelist"][users.Bot]
@game_mode("villagergame", minp = 4, maxp = 9, likelihood = 0) @game_mode("villagergame", minp=4, maxp=9, likelihood=0)
class VillagergameMode(GameMode): class VillagergameMode(GameMode):
"""This mode definitely does not exist, now please go away.""" """This mode definitely does not exist, now please go away."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -262,7 +262,7 @@ class VillagergameMode(GameMode):
else: else:
del evt.data["votelist"][users.Bot] del evt.data["votelist"][users.Bot]
@game_mode("foolish", minp = 8, maxp = 24, likelihood = 8) @game_mode("foolish", minp=8, maxp=24, likelihood=10)
class FoolishMode(GameMode): class FoolishMode(GameMode):
"""Contains the fool, be careful not to lynch them!""" """Contains the fool, be careful not to lynch them!"""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -291,7 +291,7 @@ class FoolishMode(GameMode):
"mayor" : ( 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ), "mayor" : ( 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ),
}) })
@game_mode("mad", minp = 7, maxp = 22, likelihood = 4) @game_mode("mad", minp=7, maxp=22, likelihood=5)
class MadMode(GameMode): class MadMode(GameMode):
"""This game mode has mad scientist and many things that may kill you.""" """This game mode has mad scientist and many things that may kill you."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -325,7 +325,7 @@ class MadMode(GameMode):
"assassin" : ( 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 ), "assassin" : ( 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 ),
}) })
@game_mode("evilvillage", minp = 6, maxp = 18, likelihood = 1) @game_mode("evilvillage", minp=6, maxp=18, likelihood=5)
class EvilVillageMode(GameMode): class EvilVillageMode(GameMode):
"""Majority of the village is wolf aligned, safes must secretly try to kill the wolves.""" """Majority of the village is wolf aligned, safes must secretly try to kill the wolves."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -384,7 +384,7 @@ class EvilVillageMode(GameMode):
evt.data["winner"] = None evt.data["winner"] = None
@game_mode("classic", minp = 4, maxp = 21, likelihood = 0) @game_mode("classic", minp=4, maxp=21, likelihood=0)
class ClassicMode(GameMode): class ClassicMode(GameMode):
"""Classic game mode from before all the changes.""" """Classic game mode from before all the changes."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -407,7 +407,7 @@ class ClassicMode(GameMode):
"gunner" : ( 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ), "gunner" : ( 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ),
}) })
@game_mode("rapidfire", minp = 6, maxp = 24, likelihood = 0) @game_mode("rapidfire", minp=6, maxp=24, likelihood=0)
class RapidFireMode(GameMode): class RapidFireMode(GameMode):
"""Many roles that lead to multiple chain deaths.""" """Many roles that lead to multiple chain deaths."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -447,7 +447,7 @@ class RapidFireMode(GameMode):
def teardown(self): def teardown(self):
events.remove_listener("chk_win", self.all_dead_chk_win) events.remove_listener("chk_win", self.all_dead_chk_win)
@game_mode("drunkfire", minp = 8, maxp = 17, likelihood = 0) @game_mode("drunkfire", minp=8, maxp=17, likelihood=0)
class DrunkFireMode(GameMode): class DrunkFireMode(GameMode):
"""Most players get a gun, quickly shoot all the wolves!""" """Most players get a gun, quickly shoot all the wolves!"""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -485,7 +485,7 @@ class DrunkFireMode(GameMode):
def teardown(self): def teardown(self):
events.remove_listener("chk_win", self.all_dead_chk_win) events.remove_listener("chk_win", self.all_dead_chk_win)
@game_mode("noreveal", minp = 4, maxp = 21, likelihood = 2) @game_mode("noreveal", minp=4, maxp=21, likelihood=1)
class NoRevealMode(GameMode): class NoRevealMode(GameMode):
"""Roles are not revealed when players die.""" """Roles are not revealed when players die."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -513,7 +513,7 @@ class NoRevealMode(GameMode):
"cursed villager" : ( 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ), "cursed villager" : ( 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ),
}) })
@game_mode("lycan", minp = 7, maxp = 21, likelihood = 6) @game_mode("lycan", minp=7, maxp=21, likelihood=5)
class LycanMode(GameMode): class LycanMode(GameMode):
"""Many lycans will turn into wolves. Hunt them down before the wolves overpower the village.""" """Many lycans will turn into wolves. Hunt them down before the wolves overpower the village."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -539,7 +539,7 @@ class LycanMode(GameMode):
"mayor" : ( 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ), "mayor" : ( 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 ),
}) })
@game_mode("valentines", minp = 8, maxp = 24, likelihood = 0) @game_mode("valentines", minp=8, maxp=24, likelihood=0)
class MatchmakerMode(GameMode): class MatchmakerMode(GameMode):
"""Love is in the air!""" """Love is in the air!"""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -561,7 +561,7 @@ class MatchmakerMode(GameMode):
def teardown(self): def teardown(self):
events.remove_listener("chk_win", self.lovers_chk_win) events.remove_listener("chk_win", self.lovers_chk_win)
@game_mode("random", minp = 8, maxp = 24, likelihood = 0) @game_mode("random", minp=8, maxp=24, likelihood=0)
class RandomMode(GameMode): class RandomMode(GameMode):
"""Completely random and hidden roles.""" """Completely random and hidden roles."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -634,7 +634,7 @@ class RandomMode(GameMode):
# Credits to Metacity for designing and current name # Credits to Metacity for designing and current name
# Blame arkiwitect for the original name of KrabbyPatty # Blame arkiwitect for the original name of KrabbyPatty
@game_mode("aleatoire", minp = 8, maxp = 24, likelihood = 4) @game_mode("aleatoire", minp=8, maxp=24, likelihood=10)
class AleatoireMode(GameMode): class AleatoireMode(GameMode):
"""Game mode created by Metacity and balanced by woffle.""" """Game mode created by Metacity and balanced by woffle."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -723,7 +723,7 @@ class AlphaMode(GameMode):
}) })
# original idea by Rossweisse, implemented by Vgr with help from woffle and jacob1 # original idea by Rossweisse, implemented by Vgr with help from woffle and jacob1
@game_mode("guardian", minp = 8, maxp = 16, likelihood = 5) @game_mode("guardian", minp=8, maxp=16, likelihood=1)
class GuardianMode(GameMode): class GuardianMode(GameMode):
"""Game mode full of guardian angels, wolves need to pick them apart!""" """Game mode full of guardian angels, wolves need to pick them apart!"""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -802,7 +802,7 @@ class GuardianMode(GameMode):
else: else:
evt.data["winner"] = None evt.data["winner"] = None
@game_mode("charming", minp = 6, maxp = 24, likelihood = 4) @game_mode("charming", minp=6, maxp=24, likelihood=10)
class CharmingMode(GameMode): class CharmingMode(GameMode):
"""Charmed players must band together to find the piper in this game mode.""" """Charmed players must band together to find the piper in this game mode."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -832,7 +832,7 @@ class CharmingMode(GameMode):
"assassin" : ( 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 ), "assassin" : ( 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 ),
}) })
@game_mode("sleepy", minp=10, maxp=24, likelihood=5) @game_mode("sleepy", minp=10, maxp=24, likelihood=1)
class SleepyMode(GameMode): class SleepyMode(GameMode):
"""A small village has become the playing ground for all sorts of supernatural beings.""" """A small village has become the playing ground for all sorts of supernatural beings."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -1054,7 +1054,7 @@ class SleepyMode(GameMode):
cultist.send(messages["sleepy_demoniac_turn"]) cultist.send(messages["sleepy_demoniac_turn"])
# NOTE: chk_win is called by del_player, don't need to call it here even though this has a chance of ending game # NOTE: chk_win is called by del_player, don't need to call it here even though this has a chance of ending game
@game_mode("maelstrom", minp = 8, maxp = 24, likelihood = 0) @game_mode("maelstrom", minp=8, maxp=24, likelihood=0)
class MaelstromMode(GameMode): class MaelstromMode(GameMode):
"""Some people just want to watch the world burn.""" """Some people just want to watch the world burn."""
def __init__(self, arg=""): def __init__(self, arg=""):
@ -1255,7 +1255,7 @@ class MaelstromMode(GameMode):
return addroles return addroles
# someone let woffle commit while drunk again... tsk tsk # someone let woffle commit while drunk again... tsk tsk
@game_mode("mudkip", minp=5, maxp=15, likelihood=1) @game_mode("mudkip", minp=5, maxp=15, likelihood=5)
class MudkipMode(GameMode): class MudkipMode(GameMode):
"""Why are all the professors named after trees?""" """Why are all the professors named after trees?"""
def __init__(self, arg=""): def __init__(self, arg=""):