Merge pull request #69 from skizzerz/master
Add settings to disable abstain and also limit it
This commit is contained in:
commit
1013d8dc0a
@ -836,8 +836,10 @@ def chk_decision(cli, force = ""):
|
|||||||
not_lynching.add(p)
|
not_lynching.add(p)
|
||||||
|
|
||||||
# we only need 50%+ to not lynch, instead of an actual majority, because a tie would time out day anyway
|
# we only need 50%+ to not lynch, instead of an actual majority, because a tie would time out day anyway
|
||||||
|
# don't check for ABSTAIN_ENABLED here since we may have a case where the majority of people have pacifism totems or something
|
||||||
if len(not_lynching) >= math.ceil(avail / 2):
|
if len(not_lynching) >= math.ceil(avail / 2):
|
||||||
cli.msg(botconfig.CHANNEL, "The villagers have agreed to not lynch anybody today.")
|
cli.msg(botconfig.CHANNEL, "The villagers have agreed to not lynch anybody today.")
|
||||||
|
var.ABSTAINED = True
|
||||||
transition_night(cli)
|
transition_night(cli)
|
||||||
return
|
return
|
||||||
aftermessage = None
|
aftermessage = None
|
||||||
@ -2720,10 +2722,16 @@ def no_lynch(cli, nick, chan, rest):
|
|||||||
elif nick not in var.list_players() or nick in var.DISCONNECTED.keys():
|
elif nick not in var.list_players() or nick in var.DISCONNECTED.keys():
|
||||||
cli.notice(nick, "You're not currently playing.")
|
cli.notice(nick, "You're not currently playing.")
|
||||||
return
|
return
|
||||||
if var.PHASE != "day":
|
elif not var.ABSTAIN_ENABLED:
|
||||||
|
cli.notice(nick, "This command has been disabled by the admins.")
|
||||||
|
return
|
||||||
|
elif var.LIMIT_ABSTAIN and var.ABSTAINED:
|
||||||
|
cli.notice(nick, "The village has already abstained once this game and may not do so again.")
|
||||||
|
return
|
||||||
|
elif var.PHASE != "day":
|
||||||
cli.notice(nick, "Lynching is only during the day. Please wait patiently for morning.")
|
cli.notice(nick, "Lynching is only during the day. Please wait patiently for morning.")
|
||||||
return
|
return
|
||||||
if nick in var.WOUNDED:
|
elif nick in var.WOUNDED:
|
||||||
cli.msg(chan, "{0}: You are wounded and resting, thus you are unable to vote for the day.".format(nick))
|
cli.msg(chan, "{0}: You are wounded and resting, thus you are unable to vote for the day.".format(nick))
|
||||||
return
|
return
|
||||||
candidates = var.VOTES.keys()
|
candidates = var.VOTES.keys()
|
||||||
@ -4879,6 +4887,7 @@ def start(cli, nick, chann_, rest):
|
|||||||
var.EXCHANGED = []
|
var.EXCHANGED = []
|
||||||
var.TOBEEXCHANGED = []
|
var.TOBEEXCHANGED = []
|
||||||
var.ACTED_EXTRA = 0
|
var.ACTED_EXTRA = 0
|
||||||
|
var.ABSTAINED = False
|
||||||
|
|
||||||
for role, count in addroles.items():
|
for role, count in addroles.items():
|
||||||
if role in var.TEMPLATE_RESTRICTIONS.keys():
|
if role in var.TEMPLATE_RESTRICTIONS.keys():
|
||||||
|
@ -44,6 +44,8 @@ PART_STASIS_PENALTY = 1
|
|||||||
|
|
||||||
GOAT_HERDER = True
|
GOAT_HERDER = True
|
||||||
|
|
||||||
|
ABSTAIN_ENABLED = True # whether village can !abstain in order to not vote anyone during day
|
||||||
|
LIMIT_ABSTAIN = True # if true, village will be limited to successfully !abstaining a vote only once
|
||||||
SELF_LYNCH_ALLOWED = True
|
SELF_LYNCH_ALLOWED = True
|
||||||
HIDDEN_TRAITOR = True
|
HIDDEN_TRAITOR = True
|
||||||
HIDDEN_AMNESIAC = False # amnesiac still shows as amnesiac if killed even after turning
|
HIDDEN_AMNESIAC = False # amnesiac still shows as amnesiac if killed even after turning
|
||||||
|
Loading…
Reference in New Issue
Block a user