当前位置: 首页>>代码示例>>Python>>正文


Python role.Voter类代码示例

本文整理汇总了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")
开发者ID:infina,项目名称:Thingy--1_0,代码行数:8,代码来源:shirts.py

示例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)
开发者ID:infina,项目名称:Thingy--1_0,代码行数:11,代码来源:mtttl.py

示例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)
开发者ID:infina,项目名称:Thingy--1_0,代码行数:12,代码来源:dethy.py

示例4: __init__

 def __init__(self, game, rolename):
     Voter.__init__(self, game, rolename)
     self.role = "Delusional"
     self.description = game.descriptions.pop()
开发者ID:infina,项目名称:Thingy--1_0,代码行数:4,代码来源:shirts.py

示例5: __init__

 def __init__(self, game, rolename):
         Voter.__init__(self, game, rolename)
         self.role = "ParanoidCop"
         self.alignment = "Town"
         self.alignmentinsane = "Scum"
         self.sanity = "Paranoid"
开发者ID:infina,项目名称:Thingy--1_0,代码行数:6,代码来源:dethy.py

示例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])
开发者ID:MartianW,项目名称:Thingy,代码行数:5,代码来源:manual.py

示例7: __init__

 def __init__(self, game, rolename="Voter"):
         Voter.__init__(self, game, rolename)
         self.role = rolename
开发者ID:MartianW,项目名称:Thingy,代码行数:3,代码来源:manual.py

示例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")
开发者ID:infina,项目名称:Thingy--1_0,代码行数:4,代码来源:mtttl.py

示例9: __init__

 def __init__(self, game, rolename):
         Voter.__init__(self, game, rolename)
         self.role = "Townie"
开发者ID:infina,项目名称:Thingy--1_0,代码行数:3,代码来源:mtttl.py


注:本文中的role.Voter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。