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:
skizzerz 2015-02-16 23:39:27 -06:00
parent 805f49b985
commit 7d18a3b902

View File

@ -2910,6 +2910,9 @@ def transition_day(cli, gameid=0):
bywolves.remove(target)
onlybywolves.remove(target)
killers[target].remove("@wolves")
else:
# bite was unsuccessful, let them try again
var.ALPHA_WOLVES.remove(alpha)
var.BITE_PREFERENCES = {}
@ -4342,14 +4345,17 @@ def bite_cmd(cli, nick, chan, rest):
return
victim = get_victim(cli, nick, re.split(" +",rest)[0], False)
vrole = var.get_role(victim)
vrole = None
# also mark the victim as the kill target
if victim:
kill(cli, nick, chan, rest)
if var.ANGRY_WOLVES:
if not victim:
pm(cli, nick, "Please choose who to bite by specifying their nick.")
return
vrole = var.get_role(victim)
if vrole in var.WOLFCHAT_ROLES:
pm(cli, nick, "You may not bite other wolves.")
return