|
@@ -161,7 +161,7 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "Too many arguments, For help type " + blue + self.helpchar + "players " + reset + ".")
|
|
connection.privmsg(replyto, "Too many arguments, For help type " + blue + self.helpchar + "players " + reset + ".")
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- level, xp, xpspent, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
|
|
|
|
+ level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
ap = xp + xpspent
|
|
ap = xp + xpspent
|
|
|
if ap < 0:
|
|
if ap < 0:
|
|
|
ap = 0
|
|
ap = 0
|
|
@@ -173,7 +173,7 @@ def do_command(self, connection, event):
|
|
|
elif cmdtype == "cmd":
|
|
elif cmdtype == "cmd":
|
|
|
|
|
|
|
|
user = event.source.nick.lower()
|
|
user = event.source.nick.lower()
|
|
|
- level, xp, xpspent, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
|
|
|
|
+ level, xp, xpspent, totalxp, karma, coin, coinspent, coingiven, apspent = GameHelpers.get_info(self, user)
|
|
|
if len(command.split()) == 1:
|
|
if len(command.split()) == 1:
|
|
|
print("XP < 10: " + str(xp < 10))
|
|
print("XP < 10: " + str(xp < 10))
|
|
|
if xp < 10:
|
|
if xp < 10:
|
|
@@ -192,8 +192,11 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "Invalid amount.")
|
|
connection.privmsg(replyto, "Invalid amount.")
|
|
|
elif xp < levels * 10:
|
|
elif xp < levels * 10:
|
|
|
connection.privmsg(replyto, "Insuficcient XP, you need at least " + str(levels * 10) + ".")
|
|
connection.privmsg(replyto, "Insuficcient XP, you need at least " + str(levels * 10) + ".")
|
|
|
|
|
+ if xp - apspent < 1:
|
|
|
|
|
+ connection.privmsg(replyto, "Insufficient AP, you need at least 1.")
|
|
|
|
|
+ return
|
|
|
else:
|
|
else:
|
|
|
- self.db.run("UPDATE users SET level=level+%s, xp_spent=xp_spent+%s WHERE LOWER(name)=LOWER(%s) AND network=%s", (levels, levels * 10, user, self.network, ))
|
|
|
|
|
|
|
+ self.db.run("UPDATE users SET level=level+%s, xp_spent=xp_spent+%s, ap_spent=ap_spent-1 WHERE LOWER(name)=LOWER(%s) AND network=%s", (levels, levels * 10, user, self.network, ))
|
|
|
self.db.run("UPDATE users SET coin=coin+%s WHERE level>0", (self.network, ))
|
|
self.db.run("UPDATE users SET coin=coin+%s WHERE level>0", (self.network, ))
|
|
|
else:
|
|
else:
|
|
|
connection.privmsg(replyto, "Too many arguments. For help type " + blue + self.helpchar + "levelup " + reset + ".")
|
|
connection.privmsg(replyto, "Too many arguments. For help type " + blue + self.helpchar + "levelup " + reset + ".")
|
|
@@ -272,7 +275,7 @@ def do_command(self, connection, event):
|
|
|
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.")
|
|
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.")
|
|
|
elif command.split()[0] == "karma":
|
|
elif command.split()[0] == "karma":
|
|
|
if cmdtype == "help": #Display help text.
|
|
if cmdtype == "help": #Display help text.
|
|
|
- connection.privmsg(replyto, "Karma is a secret formula, based upon on yuor IRC events and how you play the game. It does not increase like XP. Some events, skills and items are karma based.")
|
|
|
|
|
|
|
+ connection.privmsg(replyto, "Karma is a secret formula, based upon on your IRC events and how you play the game. It does not increase like XP. Some events, skills and items are karma based.")
|
|
|
|
|
|
|
|
# elif command.split()[0] == "classup":
|
|
# elif command.split()[0] == "classup":
|
|
|
# if cmdtype == "help": #Display help text.
|
|
# if cmdtype == "help": #Display help text.
|