Add option for mad scientist to skip over dead players, based on how many players joined the game

This commit is contained in:
skizzerz 2014-08-22 01:02:38 -05:00
parent d69cd50f8d
commit b82cc92997
2 changed files with 25 additions and 1 deletions

View File

@ -1480,8 +1480,28 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
targets = []
target1 = var.ALL_PLAYERS[index - 1]
target2 = var.ALL_PLAYERS[index + 1 if index < len(var.ALL_PLAYERS) - 1 else 0]
if len(var.ALL_PLAYERS) >= var.MAD_SCIENTIST_SKIPS_DEAD_PLAYERS:
# determine left player
i = index
while True:
i -= 1
if i < 0:
i = len(var.ALL_PLAYERS) - 1
if var.ALL_PLAYERS[i] in pl or var.ALL_PLAYERS[i] == nick:
target1 = var.ALL_PLAYERS[i]
break
# determine right player
i = index
while True:
i += 1
if i >= len(var.ALL_PLAYERS):
i = 0
if var.ALL_PLAYERS[i] in pl or var.ALL_PLAYERS[i] == nick:
target2 = var.ALL_PLAYERS[i]
break
if target1 in pl:
if target2 in pl:
if target2 in pl and target1 != target2:
if var.ROLE_REVEAL:
r1 = var.get_reveal_role(target1)
an1 = "n" if r1[0] in ("a", "e", "i", "o", "u") else ""

View File

@ -52,6 +52,10 @@ WOLF_STEALS_GUN = True # at night, the wolf can steal steal the victim's bullet
ROLE_REVEAL = True
LOVER_WINS_WITH_FOOL = False # if fool is lynched, does their lover win with them?
# Minimum number of players needed for mad scientist to skip over dead people when determining who is next to them
# Set to 0 to always skip over dead players. Note this is number of players that !joined, NOT number of players currently alive
MAD_SCIENTIST_SKIPS_DEAD_PLAYERS = 99
CARE_BOLD = False
CARE_COLOR = False
KILL_COLOR = False