visiting and killing
This commit is contained in:
parent
6370eb0faf
commit
10cc998cc8
@ -402,15 +402,17 @@ class Game:
|
|||||||
await player.choose(ctx, data)
|
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):
|
async def visit(self, target_id, source):
|
||||||
"""
|
"""
|
||||||
Night visit target_id
|
Night visit target_id
|
||||||
Returns a target for role information (i.e. Seer)
|
Returns a target for role information (i.e. Seer)
|
||||||
"""
|
"""
|
||||||
target = await self.get_night_target(target_id, source)
|
target = await self.get_night_target(target_id, source)
|
||||||
await target.role.visit(source)
|
await self._visit(target, source)
|
||||||
await self._at_visit(target, source)
|
|
||||||
|
|
||||||
return target
|
return target
|
||||||
|
|
||||||
|
|
||||||
@ -496,7 +498,7 @@ class Game:
|
|||||||
await self.dead_perms(player.member)
|
await self.dead_perms(player.member)
|
||||||
# Add a punishment system for quitting games later
|
# 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
|
Attempt to kill a target
|
||||||
Source allows admin override
|
Source allows admin override
|
||||||
@ -515,6 +517,10 @@ class Game:
|
|||||||
# Do nothing if blocked, blocker handles text
|
# Do nothing if blocked, blocker handles text
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not novisit:
|
||||||
|
# Arsonist wouldn't visit before killing
|
||||||
|
await self._visit(target, source) # Visit before killing
|
||||||
|
|
||||||
if not target.protected:
|
if not target.protected:
|
||||||
target.alive = False
|
target.alive = False
|
||||||
await target.kill(source)
|
await target.kill(source)
|
||||||
|
@ -80,14 +80,15 @@ class WolfVote(VoteGroup):
|
|||||||
if self.channel is None:
|
if self.channel is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
target = None
|
target_id = None
|
||||||
vote_list = list(self.vote_results.values())
|
vote_list = list(self.vote_results.values())
|
||||||
|
|
||||||
if vote_list:
|
if vote_list:
|
||||||
target_id = max(set(vote_list), key=vote_list.count)
|
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.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:
|
else:
|
||||||
await self.channel.send("**No kill will be attempted tonight...**")
|
await self.channel.send("**No kill will be attempted tonight...**")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user