Add option for mad scientist to skip over dead players, based on how many players joined the game
This commit is contained in:
parent
d69cd50f8d
commit
b82cc92997
@ -1480,8 +1480,28 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
|
|||||||
targets = []
|
targets = []
|
||||||
target1 = var.ALL_PLAYERS[index - 1]
|
target1 = var.ALL_PLAYERS[index - 1]
|
||||||
target2 = var.ALL_PLAYERS[index + 1 if index < len(var.ALL_PLAYERS) - 1 else 0]
|
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 target1 in pl:
|
||||||
if target2 in pl:
|
if target2 in pl and target1 != target2:
|
||||||
if var.ROLE_REVEAL:
|
if var.ROLE_REVEAL:
|
||||||
r1 = var.get_reveal_role(target1)
|
r1 = var.get_reveal_role(target1)
|
||||||
an1 = "n" if r1[0] in ("a", "e", "i", "o", "u") else ""
|
an1 = "n" if r1[0] in ("a", "e", "i", "o", "u") else ""
|
||||||
|
@ -52,6 +52,10 @@ WOLF_STEALS_GUN = True # at night, the wolf can steal steal the victim's bullet
|
|||||||
ROLE_REVEAL = True
|
ROLE_REVEAL = True
|
||||||
LOVER_WINS_WITH_FOOL = False # if fool is lynched, does their lover win with them?
|
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_BOLD = False
|
||||||
CARE_COLOR = False
|
CARE_COLOR = False
|
||||||
KILL_COLOR = False
|
KILL_COLOR = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user