added a few admin features.
This commit is contained in:
parent
de35286d9d
commit
177982f9db
4
var.py
4
var.py
@ -7,8 +7,8 @@ DRUNK_SHOTS_MULTIPLIER = 3
|
|||||||
NIGHT_TIME_LIMIT = 90
|
NIGHT_TIME_LIMIT = 90
|
||||||
DAY_TIME_LIMIT = 333
|
DAY_TIME_LIMIT = 333
|
||||||
START_WITH_DAY = False
|
START_WITH_DAY = False
|
||||||
KILL_IDLE_TIME = 300
|
KILL_IDLE_TIME = 0 #300
|
||||||
WARN_IDLE_TIME = 180
|
WARN_IDLE_TIME = 0 #180
|
||||||
|
|
||||||
# HIT MISS SUICIDE
|
# HIT MISS SUICIDE
|
||||||
GUN_CHANCES = ( 5/7 , 1/7 , 1/7 )
|
GUN_CHANCES = ( 5/7 , 1/7 , 1/7 )
|
||||||
|
35
wolfgame.py
35
wolfgame.py
@ -578,6 +578,9 @@ def reaper(cli):
|
|||||||
var.IDLE_KILLED = []
|
var.IDLE_KILLED = []
|
||||||
var.IDLE_WARNED = []
|
var.IDLE_WARNED = []
|
||||||
|
|
||||||
|
if not var.WARN_IDLE_TIME or not var.KILL_IDLE_TIME:
|
||||||
|
return
|
||||||
|
|
||||||
while var.PHASE != "none":
|
while var.PHASE != "none":
|
||||||
to_warn = []
|
to_warn = []
|
||||||
for nick in var.list_players():
|
for nick in var.list_players():
|
||||||
@ -788,11 +791,6 @@ def transition_day(cli, gameid=0):
|
|||||||
var.VOTES = {}
|
var.VOTES = {}
|
||||||
var.WOUNDED = []
|
var.WOUNDED = []
|
||||||
var.DAY_START_TIME = datetime.now()
|
var.DAY_START_TIME = datetime.now()
|
||||||
if not var.NIGHT_START_TIME:
|
|
||||||
for plr in var.list_players():
|
|
||||||
cli.msg(plr, "You are a \u0002{0}\u0002.".format(var.get_role(plr)))
|
|
||||||
begin_day(cli)
|
|
||||||
return
|
|
||||||
|
|
||||||
td = var.DAY_START_TIME - var.NIGHT_START_TIME
|
td = var.DAY_START_TIME - var.NIGHT_START_TIME
|
||||||
var.NIGHT_START_TIME = None
|
var.NIGHT_START_TIME = None
|
||||||
@ -1127,13 +1125,35 @@ def hvisit(cli, nick, rest):
|
|||||||
chk_nightdone(cli)
|
chk_nightdone(cli)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@cmd("!give", admin_only=True)
|
||||||
|
def give(cli, nick, chan, rest):
|
||||||
|
rst = rest.split(" ")
|
||||||
|
if len(rst) < 2:
|
||||||
|
cli.msg(chan, "The syntax is incorrect.")
|
||||||
|
who = rst.pop(0).strip()
|
||||||
|
rol = " ".join(rst).strip()
|
||||||
|
|
||||||
|
if who in var.list_players():
|
||||||
|
var.del_player(who)
|
||||||
|
if rol not in var.ROLES.keys():
|
||||||
|
cli.msg(chan, "Not a valid role.")
|
||||||
|
return
|
||||||
|
var.ROLES[rol].append(who)
|
||||||
|
cli.msg(chan, "Operation successful.")
|
||||||
|
chk_win(cli)
|
||||||
|
|
||||||
|
|
||||||
@cmd("!force", admin_only=True)
|
@cmd("!force", admin_only=True)
|
||||||
def forcepm(cli, nick, chan, rest):
|
def forcepm(cli, nick, chan, rest):
|
||||||
rst = rest.split(" ")
|
rst = rest.split(" ")
|
||||||
if len(rst) > 2:
|
if len(rst) < 2:
|
||||||
cli.msg(chan, "The syntax is incorrect.")
|
cli.msg(chan, "The syntax is incorrect.")
|
||||||
return
|
return
|
||||||
who = rst.pop(0)
|
who = rst.pop(0).strip()
|
||||||
|
if not who:
|
||||||
|
cli.msg(chan, "That won't work.")
|
||||||
|
return
|
||||||
if who[0].isalpha() or who[0] == "!" and who[0] != "\\":
|
if who[0].isalpha() or who[0] == "!" and who[0] != "\\":
|
||||||
if not who.lower().endswith("serv"):
|
if not who.lower().endswith("serv"):
|
||||||
cli.msg(chan, "This can only be done on fake nicks.")
|
cli.msg(chan, "This can only be done on fake nicks.")
|
||||||
@ -1442,6 +1462,7 @@ def start(cli, nick, chan, rest):
|
|||||||
if not var.START_WITH_DAY:
|
if not var.START_WITH_DAY:
|
||||||
transition_night(cli)
|
transition_night(cli)
|
||||||
else:
|
else:
|
||||||
|
#todo: notify roles
|
||||||
transition_day(cli)
|
transition_day(cli)
|
||||||
|
|
||||||
# DEATH TO IDLERS!
|
# DEATH TO IDLERS!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user