diff --git a/werewolf/game.py b/werewolf/game.py index 1a6641f..438659f 100644 --- a/werewolf/game.py +++ b/werewolf/game.py @@ -636,6 +636,7 @@ class Game: target = await self.get_day_target(target_id, source) else: target = await self.get_night_target(target_id, source) + if source is not None: if source.role.blocked: # Do nothing if blocked, blocker handles text diff --git a/werewolf/role.py b/werewolf/role.py index a2e0a52..3e4124d 100644 --- a/werewolf/role.py +++ b/werewolf/role.py @@ -48,7 +48,7 @@ class Role: ) description = ( "This is the basic role\n" - "All roles are based on this Class" + "All roles are based on this Class\n" "Has no special significance" ) icon_url = None # Adding a URL here will enable a thumbnail of the role @@ -110,14 +110,14 @@ class Role: Interaction for powerful access of role Unlikely to be able to deceive this """ - return "Default" + return "Role" async def see_role(self, source=None): """ Interaction for investigative roles. More common to be able to deceive this action """ - return "Role" + return "Default" async def _at_game_start(self, data=None): if self.channel_id: @@ -153,7 +153,7 @@ class Role: """ Called when someone is trying to kill you! Can you do anything about it? - self.alive is now set to False, set to True to stay alive + self.player.alive is now set to False, set to True to stay alive """ pass diff --git a/werewolf/roles/vanillawerewolf.py b/werewolf/roles/vanillawerewolf.py index d780eb8..5abce61 100644 --- a/werewolf/roles/vanillawerewolf.py +++ b/werewolf/roles/vanillawerewolf.py @@ -31,29 +31,6 @@ class VanillaWerewolf(Role): (self._at_visit, 0) ] - # async def on_event(self, event, data): - # """ - # See Game class for event guide - # """ - - # await self.action_list[event][0](data) - - # async def assign_player(self, player): - # """ - # Give this role a player - # Can be used after the game has started (Cult, Mason, role swap) - # """ - - # player.role = self - # self.player = player - - # async def get_alignment(self, source=None): - # """ - # Interaction for power access of team (Village, Werewolf, Other) - # Unlikely to be able to deceive this - # """ - # return self.alignment - async def see_alignment(self, source=None): """ Interaction for investigative roles attempting @@ -82,45 +59,6 @@ class VanillaWerewolf(Role): await self.player.send_dm(self.game_start_message) - # async def _at_day_start(self, data=None): - # super()._at_day_start(data) - - # async def _at_voted(self, data=None): - # super()._at_voted(data) - - # async def _at_kill(self, data=None): - # super()._at_kill(data) - - # async def _at_hang(self, data=None): - # super()._at_hang(data) - - # async def _at_day_end(self, data=None): - # super()._at_day_end(data) - - # async def _at_night_start(self, data=None): - # super()._at_night_start(data) - - # async def _at_night_end(self, data=None): - # super()._at_night_end(data) - - # async def _at_visit(self, data=None): - # pass - - # async def kill(self, source): - # """ - # Called when someone is trying to kill you! - # Can you do anything about it? - # self.alive is now set to False, set to True to stay alive - # """ - # pass - - # async def visit(self, source): - # """ - # Called whenever a night action targets you - # Source is the player who visited you - # """ - # pass - async def choose(self, ctx, data): """Handle night actions""" await self.player.member.send("Use `[p]ww vote` in your werewolf channel") diff --git a/werewolf/roles/villager.py b/werewolf/roles/villager.py index 4935275..040e34d 100644 --- a/werewolf/roles/villager.py +++ b/werewolf/roles/villager.py @@ -15,46 +15,6 @@ class Villager(Role): def __init__(self, game): super().__init__(game) - # self.game = game - # self.player = None - # self.blocked = False - # self.properties = {} # Extra data for other roles (i.e. arsonist) - # - # self.action_list = [ - # (self._at_game_start, 0), # (Action, Priority) - # (self._at_day_start, 0), - # (self._at_voted, 0), - # (self._at_kill, 0), - # (self._at_hang, 0), - # (self._at_day_end, 0), - # (self._at_night_start, 0), - # (self._at_night_end, 0), - # (self._at_visit, 0) - # ] - - # async def on_event(self, event, data): - # """ - # See Game class for event guide - # """ - # - # await self.action_list[event][0](data) - # - # - # async def assign_player(self, player): - # """ - # Give this role a player - # Can be used after the game has started (Cult, Mason, other role swap) - # """ - # - # player.role = self - # self.player = player - # - # async def get_alignment(self, source=None): - # """ - # Interaction for power access of team (Village, Werewolf, Other) - # Unlikely to be able to deceive this - # """ - # return self.alignment async def see_alignment(self, source=None): """ @@ -76,49 +36,3 @@ class Villager(Role): More common to be able to deceive these roles """ return "Villager" - - # async def _at_game_start(self, data=None): - # pass - # - # async def _at_day_start(self, data=None): - # pass - # - # async def _at_voted(self, target=None): - # pass - # - # async def _at_kill(self, target=None): - # pass - # - # async def _at_hang(self, target=None): - # pass - # - # async def _at_day_end(self): - # pass - # - # async def _at_night_start(self): - # pass - # - # async def _at_night_end(self): - # pass - # - # async def _at_visit(self, data=None): - # pass - # - # async def kill(self, source): - # """ - # Called when someone is trying to kill you! - # Can you do anything about it? - # self.alive is now set to False, set to True to stay alive - # """ - # pass - # - # async def visit(self, source): - # """ - # Called whenever a night action targets you - # Source is the player who visited you - # """ - # pass - # - # async def choose(self, ctx, data): - # """Handle night actions""" - # pass