started implementing G.Angel, and fixed a KICK bug
This commit is contained in:
parent
bb264d0552
commit
9151570c73
35
var.py
35
var.py
@ -17,14 +17,19 @@ MANSLAUGHTER_CHANCE = 1/5
|
|||||||
|
|
||||||
GAME_MODES = {}
|
GAME_MODES = {}
|
||||||
|
|
||||||
################################################################################################
|
######################################################################################################
|
||||||
# ROLE INDEX: PLAYERS SEER WOLF CURSED DRUNK HARLOT TRAITOR GUNNER CROW #
|
# ROLE INDEX: PLAYERS SEER WOLF CURSED DRUNK HARLOT TRAITOR GUNNER CROW ANGEL ##
|
||||||
ROLES_GUIDE = { 4 : ( 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ), #
|
######################################################################################################
|
||||||
6 : ( 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 ), #
|
ROLES_GUIDE = { 4 : ( 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0), ##
|
||||||
8 : ( 1 , 2 , 1 , 1 , 1 , 0 , 0 , 0 ), #
|
6 : ( 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0), ##
|
||||||
10 : ( 1 , 2 , 1 , 1 , 1 , 1 , 1 , 0 ), #
|
8 : ( 1 , 2 , 1 , 1 , 1 , 0 , 0 , 0 , 0), ##
|
||||||
None : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )} #
|
10 : ( 1 , 2 , 1 , 1 , 1 , 1 , 1 , 0 , 0), ##
|
||||||
################################################################################################
|
11 : ( 1 , 2 , 1 , 1 , 1 , 1 , 1 , 0 , 1), ##
|
||||||
|
None : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0)} ##
|
||||||
|
######################################################################################################
|
||||||
|
# Notes: ##
|
||||||
|
######################################################################################################
|
||||||
|
|
||||||
|
|
||||||
ROLE_INDICES = {0 : "seer",
|
ROLE_INDICES = {0 : "seer",
|
||||||
1 : "wolf",
|
1 : "wolf",
|
||||||
@ -33,7 +38,8 @@ ROLE_INDICES = {0 : "seer",
|
|||||||
4 : "harlot",
|
4 : "harlot",
|
||||||
5 : "traitor",
|
5 : "traitor",
|
||||||
6 : "gunner",
|
6 : "gunner",
|
||||||
7 : "werecrow"}
|
7 : "werecrow",
|
||||||
|
8 : "guardian angel"}
|
||||||
INDEX_OF_ROLE = dict((v,k) for k,v in ROLE_INDICES.items())
|
INDEX_OF_ROLE = dict((v,k) for k,v in ROLE_INDICES.items())
|
||||||
|
|
||||||
|
|
||||||
@ -90,10 +96,17 @@ CHANGEABLE_ROLES = { "seers" : INDEX_OF_ROLE["seer"],
|
|||||||
"harlots" : INDEX_OF_ROLE["harlot"],
|
"harlots" : INDEX_OF_ROLE["harlot"],
|
||||||
"traitors" : INDEX_OF_ROLE["traitor"],
|
"traitors" : INDEX_OF_ROLE["traitor"],
|
||||||
"gunners" : INDEX_OF_ROLE["gunner"],
|
"gunners" : INDEX_OF_ROLE["gunner"],
|
||||||
"werecrows" : INDEX_OF_ROLE["werecrow"]}
|
"werecrows" : INDEX_OF_ROLE["werecrow"],
|
||||||
|
"angels" : INDEX_OF_ROLE["guardian angel"]}
|
||||||
|
|
||||||
# !game roles=wolves:1 seers:0, x=1
|
|
||||||
|
|
||||||
|
@game_mode("normal")
|
||||||
|
class Normal(object):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Example !game roles=wolves:1,seers:0
|
||||||
# TODO: implement game modes
|
# TODO: implement game modes
|
||||||
@game_mode("roles")
|
@game_mode("roles")
|
||||||
class ChangedRolesMode(object):
|
class ChangedRolesMode(object):
|
||||||
|
18
wolfgame.py
18
wolfgame.py
@ -607,7 +607,7 @@ cmd("!quit")(lambda cli, nick, *rest: leave(cli, "!quit", nick))
|
|||||||
#Functions decorated with hook do not parse the nick by default
|
#Functions decorated with hook do not parse the nick by default
|
||||||
hook("part")(lambda cli, nick, *rest: leave(cli, "part", parse_nick(nick)[0]))
|
hook("part")(lambda cli, nick, *rest: leave(cli, "part", parse_nick(nick)[0]))
|
||||||
hook("quit")(lambda cli, nick, *rest: leave(cli, "quit", parse_nick(nick)[0]))
|
hook("quit")(lambda cli, nick, *rest: leave(cli, "quit", parse_nick(nick)[0]))
|
||||||
hook("kick")(lambda cli, nick, *rest: leave(cli, "kick", parse_nick(nick)[0]))
|
hook("kick")(lambda cli, nick, *rest: leave(cli, "kick", parse_nick(rest[1])[0]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -616,6 +616,7 @@ def begin_day(cli):
|
|||||||
|
|
||||||
# Reset nighttime variables
|
# Reset nighttime variables
|
||||||
var.VICTIM = "" # nickname of kill victim
|
var.VICTIM = "" # nickname of kill victim
|
||||||
|
var.GUARDED = ""
|
||||||
var.KILLER = "" # nickname of who chose the victim
|
var.KILLER = "" # nickname of who chose the victim
|
||||||
var.SEEN = [] # list of seers that have had visions
|
var.SEEN = [] # list of seers that have had visions
|
||||||
var.OBSERVED = {} # those whom werecrows have observed
|
var.OBSERVED = {} # those whom werecrows have observed
|
||||||
@ -635,6 +636,11 @@ def begin_day(cli):
|
|||||||
def transition_day(cli):
|
def transition_day(cli):
|
||||||
var.PHASE = "day"
|
var.PHASE = "day"
|
||||||
chan = botconfig.CHANNEL
|
chan = botconfig.CHANNEL
|
||||||
|
|
||||||
|
if var.DAY_TIME_LIMIT > 0: # Time limit enabled
|
||||||
|
t = threading.Timer(var.DAY_TIME_LIMIT, hurry_up, [cli])
|
||||||
|
var.TIMERS[1] = t
|
||||||
|
t.start()
|
||||||
|
|
||||||
# Reset daytime variables
|
# Reset daytime variables
|
||||||
var.VOTES = {}
|
var.VOTES = {}
|
||||||
@ -1040,6 +1046,7 @@ def transition_night(cli):
|
|||||||
|
|
||||||
# Reset nighttime variables
|
# Reset nighttime variables
|
||||||
var.VICTIM = "" # nickname of kill victim
|
var.VICTIM = "" # nickname of kill victim
|
||||||
|
var.GUARDED = ""
|
||||||
var.KILLER = "" # nickname of who chose the victim
|
var.KILLER = "" # nickname of who chose the victim
|
||||||
var.SEEN = [] # list of seers that have had visions
|
var.SEEN = [] # list of seers that have had visions
|
||||||
var.OBSERVED = {} # those whom werecrows have observed
|
var.OBSERVED = {} # those whom werecrows have observed
|
||||||
@ -1109,6 +1116,15 @@ def transition_night(cli):
|
|||||||
'you will die. Use !visit to visit a player.'))
|
'you will die. Use !visit to visit a player.'))
|
||||||
cli.msg(harlot, "Players: "+", ".join(pl))
|
cli.msg(harlot, "Players: "+", ".join(pl))
|
||||||
|
|
||||||
|
for g_angel in var.ROLES["guardian angel"]:
|
||||||
|
pl = ps[:]
|
||||||
|
pl.remove(g_angel)
|
||||||
|
cli.msg(g_angel, ('You are a \u0002guardian angel\u0002. '+
|
||||||
|
'It is your job to protect the villagers. If you guard a'+
|
||||||
|
' wolf, there is a 50/50 chance of you dying, if you guard '+
|
||||||
|
'a victim, they will live. Use !guard to guard a player.'));
|
||||||
|
cli.msg(g_angel, "Players: ", ", ".join(pl))
|
||||||
|
|
||||||
for d in var.ROLES["village drunk"]:
|
for d in var.ROLES["village drunk"]:
|
||||||
cli.msg(d, 'You have been drinking too much! You are the \u0002village drunk\u0002.')
|
cli.msg(d, 'You have been drinking too much! You are the \u0002village drunk\u0002.')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user