|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
from werewolf.night_powers import pick_target
|
|
|
|
from werewolf.role import Role
|
|
|
|
from werewolf.role import Role
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -59,6 +60,7 @@ class Shifter(Role):
|
|
|
|
def __init__(self, game):
|
|
|
|
def __init__(self, game):
|
|
|
|
super().__init__(game)
|
|
|
|
super().__init__(game)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.shift_target = None
|
|
|
|
self.action_list = [
|
|
|
|
self.action_list = [
|
|
|
|
(self._at_game_start, 1), # (Action, Priority)
|
|
|
|
(self._at_game_start, 1), # (Action, Priority)
|
|
|
|
(self._at_day_start, 0),
|
|
|
|
(self._at_day_start, 0),
|
|
|
@ -74,7 +76,7 @@ class Shifter(Role):
|
|
|
|
async def see_alignment(self, source=None):
|
|
|
|
async def see_alignment(self, source=None):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Interaction for investigative roles attempting
|
|
|
|
Interaction for investigative roles attempting
|
|
|
|
to see alignment (Village, Werewolf Other)
|
|
|
|
to see alignment (Village, Werewolf, Other)
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return "Other"
|
|
|
|
return "Other"
|
|
|
|
|
|
|
|
|
|
|
@ -90,14 +92,38 @@ class Shifter(Role):
|
|
|
|
Interaction for investigative roles.
|
|
|
|
Interaction for investigative roles.
|
|
|
|
More common to be able to deceive this action
|
|
|
|
More common to be able to deceive this action
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return "MyRole"
|
|
|
|
return "Shifter"
|
|
|
|
|
|
|
|
|
|
|
|
async def _at_night_start(self, data=None):
|
|
|
|
async def _at_night_start(self, data=None):
|
|
|
|
await super()._at_night_start(data)
|
|
|
|
await super()._at_night_start(data)
|
|
|
|
|
|
|
|
self.shift_target = None
|
|
|
|
|
|
|
|
await self.game.generate_targets(self.player.member)
|
|
|
|
|
|
|
|
await self.player.send_dm("**Pick a target to shift into**")
|
|
|
|
|
|
|
|
|
|
|
|
async def _at_night_end(self, data=None):
|
|
|
|
async def _at_night_end(self, data=None):
|
|
|
|
await super()._at_night_end(data)
|
|
|
|
await super()._at_night_end(data)
|
|
|
|
|
|
|
|
if self.shift_target is None:
|
|
|
|
|
|
|
|
if self.player.alive:
|
|
|
|
|
|
|
|
await self.player.send_dm("You will not use your powers tonight...")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
target = await self.game.visit(self.shift_target, self.player)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if target and target.player.alive:
|
|
|
|
|
|
|
|
await target.role.assign_player(self.player)
|
|
|
|
|
|
|
|
await self.assign_player(target)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Roles have now been swapped
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await self.player.send_dm("Your role has been stolen...\n"
|
|
|
|
|
|
|
|
"You are now a **Shifter**.")
|
|
|
|
|
|
|
|
await self.player.send_dm(self.game_start_message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await target.send_dm(target.role.game_start_message)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
await self.player.send_dm("**Your shift failed...**")
|
|
|
|
async def choose(self, ctx, data):
|
|
|
|
async def choose(self, ctx, data):
|
|
|
|
"""Handle night actions"""
|
|
|
|
"""Handle night actions"""
|
|
|
|
await super().choose(ctx, data)
|
|
|
|
await super().choose(ctx, data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.shift_target, target = await pick_target(self, ctx, data)
|
|
|
|
|
|
|
|
await ctx.send("**You will attempt to see the role of {} tonight...**".format(target.member.display_name))
|
|
|
|