Alpha tweaks
- Fix bug when using bite and not specifying a victim where victim was None and thus trying to get their role resulted in a KeyError - Forward params from bite onwards to kill so you no longer need to do both (although you can still bite one person and kill someone else if you REALLY wanted to for some reason... it still won't work though) - If the bite failed for any reason (including if they targeted lycan who just instantly turns), refund the bite so the alpha wolf can try again after a wolf dies again during the day.
This commit is contained in:
parent
805f49b985
commit
7d18a3b902
@ -2910,6 +2910,9 @@ def transition_day(cli, gameid=0):
|
|||||||
bywolves.remove(target)
|
bywolves.remove(target)
|
||||||
onlybywolves.remove(target)
|
onlybywolves.remove(target)
|
||||||
killers[target].remove("@wolves")
|
killers[target].remove("@wolves")
|
||||||
|
else:
|
||||||
|
# bite was unsuccessful, let them try again
|
||||||
|
var.ALPHA_WOLVES.remove(alpha)
|
||||||
|
|
||||||
var.BITE_PREFERENCES = {}
|
var.BITE_PREFERENCES = {}
|
||||||
|
|
||||||
@ -4342,14 +4345,17 @@ def bite_cmd(cli, nick, chan, rest):
|
|||||||
return
|
return
|
||||||
|
|
||||||
victim = get_victim(cli, nick, re.split(" +",rest)[0], False)
|
victim = get_victim(cli, nick, re.split(" +",rest)[0], False)
|
||||||
|
vrole = None
|
||||||
vrole = var.get_role(victim)
|
# also mark the victim as the kill target
|
||||||
|
if victim:
|
||||||
|
kill(cli, nick, chan, rest)
|
||||||
|
|
||||||
if var.ANGRY_WOLVES:
|
if var.ANGRY_WOLVES:
|
||||||
if not victim:
|
if not victim:
|
||||||
pm(cli, nick, "Please choose who to bite by specifying their nick.")
|
pm(cli, nick, "Please choose who to bite by specifying their nick.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
vrole = var.get_role(victim)
|
||||||
if vrole in var.WOLFCHAT_ROLES:
|
if vrole in var.WOLFCHAT_ROLES:
|
||||||
pm(cli, nick, "You may not bite other wolves.")
|
pm(cli, nick, "You may not bite other wolves.")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user