|
|
@@ -161,8 +161,7 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "Too many arguments, For help type " + blue + self.helpchar + "players " + reset + ".")
|
|
|
return
|
|
|
|
|
|
- level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
- ap = xp + xpspent
|
|
|
+ level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, ap, apspent = GameHelpers.get_info(self, user)
|
|
|
if ap < 0:
|
|
|
ap = 0
|
|
|
connection.privmsg(replyto, message + "Level: " + str(level) + grey + ", " + reset + "XP: " + grey + str(xpspent) + "/" + reset + str(round(xp + xpspent, 4)) + grey + ", " + reset + "AP: " + str(int(ap - float(apspent))) + grey + ", " + reset + "coin: " + str(coin) + grey + "[S " + str(coinspent) + ", G " + str(coingiven) + "], " + reset + "karma: " + str(round(karma, 4)))
|
|
|
@@ -173,7 +172,7 @@ def do_command(self, connection, event):
|
|
|
elif cmdtype == "cmd":
|
|
|
|
|
|
user = event.source.nick.lower()
|
|
|
- level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
+ level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, ap, apspent = GameHelpers.get_info(self, user)
|
|
|
if len(command.split()) == 1:
|
|
|
print("XP < 10: " + str(xp < 10))
|
|
|
if xp < 10:
|
|
|
@@ -192,7 +191,7 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "Invalid amount.")
|
|
|
elif xp < levels * 10:
|
|
|
connection.privmsg(replyto, "Insuficcient XP, you need at least " + str(levels * 10) + ".")
|
|
|
- if xp - apspent < 1:
|
|
|
+ if ap < 1:
|
|
|
connection.privmsg(replyto, "Insufficient AP, you need at least 1.")
|
|
|
return
|
|
|
else:
|
|
|
@@ -217,7 +216,7 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "You already have your own coin. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
|
|
|
return
|
|
|
|
|
|
- level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, event.source.nick)
|
|
|
+ level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, ap, apspent = GameHelpers.get_info(self, event.source.nick)
|
|
|
receivingrecord = self.db.one("SELECT level, away FROM users WHERE LOWER(name)=%s AND network=%s", (command.split()[1], self.network, ))
|
|
|
if level < 1:
|
|
|
connection.privmsg(replyto, "You need to " + blue + self.cmdchar + "levelup " + reset + "to be able to give coin.")
|
|
|
@@ -234,7 +233,7 @@ def do_command(self, connection, event):
|
|
|
elif receivingrecord[1] == True:
|
|
|
connection.privmsg(replyto, red + trigger.split()[1] + reset + "is not here right now.")
|
|
|
return
|
|
|
- elif apspent >= totalxp:
|
|
|
+ elif ap < 1:
|
|
|
connection.privmsg(replyto, "You have no action points, go use IRC some more...")
|
|
|
return
|
|
|
if len(command.split()) == 2:
|
|
|
@@ -269,7 +268,7 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "XP is earned by using IRC and playing the game, in channels with " + red + connection.get_nickname() + reset + ". Ask any operator in " + red + self.homechannel + reset + " to add a channel. XP is used to level up, advance classes, as a limit and as a multiplier. Once XP is expended it keeps counting towards your total.")
|
|
|
elif command.split()[0] == "ap":
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
- connection.privmsg(replyto, "XP is earned by using IRC and playing the game in channels with " + red + connection.get_nickname() + reset + ". Ask any operator in " + red + self.homechannel + reset + " to add a channel. AP is expended for every action you take in the game.")
|
|
|
+ connection.privmsg(replyto, "AP is earned by using IRC and playing the game in channels with " + red + connection.get_nickname() + reset + ". Ask any operator in " + red + self.homechannel + reset + " to add a channel. AP is expended for every action you take in the game.")
|
|
|
elif command.split()[0] == "coin":
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
connection.privmsg(replyto, "Coin is earned when certain events occur, for instance when a player expends XP. Coin is used to buy items and classes. To give a player coin use " + blue + self.cmdchar + "givecoin" + reset + ". Coin affects karma.")
|