visiting and killing

fight-fixes
bobloy 7 years ago
parent 6370eb0faf
commit 10cc998cc8

@ -402,15 +402,17 @@ class Game:
await player.choose(ctx, data)
async def _visit(self, target, source):
await target.role.visit(source)
await self._at_visit(target, source)
async def visit(self, target_id, source):
"""
Night visit target_id
Returns a target for role information (i.e. Seer)
"""
target = await self.get_night_target(target_id, source)
await target.role.visit(source)
await self._at_visit(target, source)
await self._visit(target, source)
return target
@ -496,7 +498,7 @@ class Game:
await self.dead_perms(player.member)
# Add a punishment system for quitting games later
async def kill(self, target_id, source=None, method: str=None):
async def kill(self, target_id, source=None, method: str=None, novisit=False):
"""
Attempt to kill a target
Source allows admin override
@ -515,6 +517,10 @@ class Game:
# Do nothing if blocked, blocker handles text
return
if not novisit:
# Arsonist wouldn't visit before killing
await self._visit(target, source) # Visit before killing
if not target.protected:
target.alive = False
await target.kill(source)

@ -80,14 +80,15 @@ class WolfVote(VoteGroup):
if self.channel is None:
return
target = None
target_id = None
vote_list = list(self.vote_results.values())
if vote_list:
target_id = max(set(vote_list), key=vote_list.count)
if target and self.killer:
if target_id and self.killer:
await self.game.kill(target_id, self.killer, random.choice(self.kill_messages))
await self.channel.send("**{} has left to complete the kill...**".format(self.killer.member.display_name))
else:
await self.channel.send("**No kill will be attempted tonight...**")

Loading…
Cancel
Save