From 369f038b63deac252b584623b3c05d7923ffa266 Mon Sep 17 00:00:00 2001 From: Loudrob Date: Wed, 29 Jul 2015 16:02:57 -0400 Subject: [PATCH] Revert "No XP cap" This reverts commit f42631b4016a32981d71d13d2e97a2b72d4355f2. --- toontown/battle/BattleCalculatorAI.py | 2 +- toontown/toon/InventoryNew.py | 12 +++++++++++- toontown/toonbase/ToontownBattleGlobals.py | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/toontown/battle/BattleCalculatorAI.py b/toontown/battle/BattleCalculatorAI.py index c3c97803..b32d25f8 100755 --- a/toontown/battle/BattleCalculatorAI.py +++ b/toontown/battle/BattleCalculatorAI.py @@ -721,7 +721,7 @@ class BattleCalculatorAI: 0, 0] self.toonSkillPtsGained[id] = expList - expList[trk] = expList[trk] + (lvl + 1) * self.__skillCreditMultiplier + expList[trk] = min(ExperienceCap, expList[trk] + (lvl + 1) * self.__skillCreditMultiplier) return def __clearTgtDied(self, tgt, lastAtk, currAtk): diff --git a/toontown/toon/InventoryNew.py b/toontown/toon/InventoryNew.py index 48ecd678..4eb458fa 100755 --- a/toontown/toon/InventoryNew.py +++ b/toontown/toon/InventoryNew.py @@ -327,6 +327,9 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): def setDetailCredit(self, track, credit): if credit != None: + if self.toon.earnedExperience: + maxCredit = ExperienceCap - self.toon.earnedExperience[track] + credit = min(credit, maxCredit) credit = int(credit * 10 + 0.5) if credit % 10 == 0: credit /= 10 @@ -859,7 +862,14 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): return 1 def itemIsCredit(self, track, level): - return self.battleCreditLevel == None or level < self.battleCreditLevel + if self.toon.earnedExperience: + if self.toon.earnedExperience[track] >= ExperienceCap: + return 0 + if self.battleCreditLevel == None: + return 1 + else: + return level < self.battleCreditLevel + return def getMax(self, track, level): if self.gagTutMode and (track not in (4, 5) or level > 0): diff --git a/toontown/toonbase/ToontownBattleGlobals.py b/toontown/toonbase/ToontownBattleGlobals.py index 55e2300a..c8552b78 100755 --- a/toontown/toonbase/ToontownBattleGlobals.py +++ b/toontown/toonbase/ToontownBattleGlobals.py @@ -92,6 +92,7 @@ Levels = [[0, regMaxSkill = 10000 UberSkill = 500 MaxSkill = UberSkill + regMaxSkill +ExperienceCap = 300 MaxToonAcc = 95 @@ -830,4 +831,4 @@ def getUberFlagSafe(flagMask, index): if flagMask == 'unknown' or flagMask < 0: return -1 else: - return getUberFlag(flagMask, index) \ No newline at end of file + return getUberFlag(flagMask, index)