visiting and killing
This commit is contained in:
parent
6370eb0faf
commit
10cc998cc8
@ -401,16 +401,18 @@ 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
|
||||
@ -514,7 +516,11 @@ class Game:
|
||||
if source.blocked:
|
||||
# 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…
x
Reference in New Issue
Block a user