示例#1
0
文件: game.py 项目: Phxntxm/Tanya
    async def choose_godfather(self):
        godfather = self._rand.choice(
            [
                p
                for p in self.players
                # We don't want to choose special mafia
                if p.role.__class__ is role_mapping.get("Mafia")
            ]
        )
        godfather.role.is_godfather = True

        await godfather.channel.send("You are the godfather!")
示例#2
0
 def is_jailor(self) -> bool:
     jailor_role = role_mapping.get("Jailor")
     return jailor_role is not None and isinstance(self.role, jailor_role)
示例#3
0
 def is_citizen(self) -> bool:
     citizen_role = role_mapping.get("Citizen")
     return citizen_role is not None and isinstance(self.role, citizen_role)
示例#4
0
 def is_independent(self) -> bool:
     independent_role = role_mapping.get("Independent")
     return independent_role is not None and isinstance(
         self.role, independent_role)
示例#5
0
 def is_mafia(self) -> bool:
     mafia_role = role_mapping.get("Mafia")
     return mafia_role is not None and isinstance(self.role, mafia_role)