Ejemplo n.º 1
0
 def check_villager(self, checker, victim):
     """
     If checker has the sufficient permission, return the role string of
     victim. Otherwise, will raise a GamePrivilegeError.
     """
     if NotedPlayers.can_kill(checker.role):
         return victim.role
     else:
         raise GamePrivilegeError(checker)
Ejemplo n.º 2
0
 def guard_villager(self, guardian, taker):
     """
     If guardian has the sufficient permission, set taker's health_guard
     to true. Otherwise, will raise a GamePrivilegeError.
     """
     if NotedPlayers.can_guard(guardian.role):
         taker.health_guard = True
     else:
         raise GamePrivilegeError(guardian)
Ejemplo n.º 3
0
 def kill_villager(self, killer, victim):
     """
     If killer has the sufficient permission, kill the victim. Otherwise, will
     raise a GamePrivilegeError.
     """
     if NotedPlayers.can_kill(killer.role):
         self.__game_environment.kill_villager(victim)
     else:
         raise GamePrivilegeError(killer)