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)
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)
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)