本文整理汇总了Python中role.Voter类的典型用法代码示例。如果您正苦于以下问题:Python Voter类的具体用法?Python Voter怎么用?Python Voter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Voter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gameStart
def gameStart(self):
Voter.gameStart(self)
sk_name = self.game.get_role("SK")
self.game.tell("Role: Witness", self.game.names[self])
self.game.tell("You: " + self.description, self.game.names[self])
self.game.tell("You saw: " + self.game.roles[sk_name].description, self.game.names[self])
self.game.commentary(self.game.names[self] + ": " + "Sane Witness")
示例2: action
def action(self, msg):
args = msg.split(" ")
if ((args[0] == "kill") and (self.game.phase == "night")):
if ((len(args) >= 2) and (args[1] in self.game.roles)):
self.game.nk = args[1]
self.game.tell(args[1] + " has been nightkilled.", self.game.names[self])
self.game.mkDay()
else:
self.game.tell("You must pick a valid target.", self.game.names[self])
else:
Voter.action(self, msg)
示例3: action
def action(self, msg):
args = msg.split(" ")
if ((args[0] == "cop") and (self.game.phase == "night")):
if ((len(args) >= 2) and (args[1] in self.game.roles)):
self.game.cop = args[1]
randalign = random.choice(['Scum','Town'])
self.game.tell(args[1] + " is %s." % randalign, self.game.names[self])
self.game.mkDay()
else:
self.game.tell("You must pick a valid target.", self.game.names[self])
else:
Voter.action(self, msg)
示例4: __init__
def __init__(self, game, rolename):
Voter.__init__(self, game, rolename)
self.role = "Delusional"
self.description = game.descriptions.pop()
示例5: __init__
def __init__(self, game, rolename):
Voter.__init__(self, game, rolename)
self.role = "ParanoidCop"
self.alignment = "Town"
self.alignmentinsane = "Scum"
self.sanity = "Paranoid"
示例6: gameStart
def gameStart(self):
"""When the game starts up, this is called."""
Voter.gameStart(self)
self.game.tell("Role: " + self.role[1] + ".", self.game.names[self])
self.game.commentary(self.game.names[self] + ": " + self.rolename[0])
示例7: __init__
def __init__(self, game, rolename="Voter"):
Voter.__init__(self, game, rolename)
self.role = rolename
示例8: gameStart
def gameStart(self):
Voter.gameStart(self)
self.game.tell("Role: Serial Killer", self.game.names[self])
self.game.commentary(self.game.names[self] + ": " + "Serial Killer")
示例9: __init__
def __init__(self, game, rolename):
Voter.__init__(self, game, rolename)
self.role = "Townie"