Added check for gun/bullets for "myrole" command.
Adds additional notification of gun/bullets if the player has them. Minor change in the way messages are sent out for "myrole" command.
This commit is contained in:
parent
609490e87b
commit
e7dad23525
@ -2804,16 +2804,26 @@ def myrole(cli, nick, chan, rest):
|
|||||||
if var.PHASE in ("none", "join"):
|
if var.PHASE in ("none", "join"):
|
||||||
cli.notice(nick, "No game is currently running.")
|
cli.notice(nick, "No game is currently running.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if nick not in var.list_players():
|
ps = var.list_players()
|
||||||
|
if nick not in ps:
|
||||||
cli.notice(nick, "You're currently not playing.")
|
cli.notice(nick, "You're currently not playing.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if var.PLAYERS[nick]["cloak"] in var.SIMPLE_NOTIFY:
|
|
||||||
cli.notice(nick, "You are a \02{0}\02.".format(var.get_role(nick)))
|
|
||||||
else:
|
|
||||||
cli.msg(nick, "You are a \02{0}\02.".format(var.get_role(nick)))
|
|
||||||
|
|
||||||
|
pm(cli, nick, "You are a \02{0}\02.".format(var.get_role(nick)))
|
||||||
|
|
||||||
|
# Check for gun/bullets
|
||||||
|
if nick in ps and nick in var.GUNNERS and var.GUNNERS[nick]:
|
||||||
|
if var.GUNNERS[nick] == 1:
|
||||||
|
pm(cli, nick, "You have a \02gun\02 with {0} {1}.".format(var.GUNNERS[nick], "bullet"))
|
||||||
|
else:
|
||||||
|
pm(cli, nick, "You have a \02gun\02 with {0} {1}.".format(var.GUNNERS[nick], "bullets"))
|
||||||
|
elif nick in ps and nick in var.WOLF_GUNNERS and var.WOLF_GUNNERS[nick]:
|
||||||
|
if var.WOLF_GUNNERS[nick] == 1:
|
||||||
|
pm(cli, nick, "You have a \02gun\02 with {0} {1}.".format(var.WOLF_GUNNERS[nick], "bullet"))
|
||||||
|
else:
|
||||||
|
pm(cli, nick, "You have a \02gun\02 with {0} {1}.".format(var.WOLF_GUNNERS[nick], "bullets"))
|
||||||
|
|
||||||
@pmcmd("myrole")
|
@pmcmd("myrole")
|
||||||
def myrole_pm(cli, nick, rest):
|
def myrole_pm(cli, nick, rest):
|
||||||
myrole(cli, nick, "", rest)
|
myrole(cli, nick, "", rest)
|
||||||
|
Loading…
Reference in New Issue
Block a user