diff --git a/toontown/battle/FireCogPanel.py b/toontown/battle/FireCogPanel.py index f6c7f564..45a94da7 100755 --- a/toontown/battle/FireCogPanel.py +++ b/toontown/battle/FireCogPanel.py @@ -47,7 +47,7 @@ class FireCogPanel(StateData.StateData): del self.backButton self.loaded = 0 - def enter(self, numAvatars, localNum = None, luredIndices = None, trappedIndices = None, track = None, fireCosts = None): + def enter(self, numAvatars, localNum = None, luredIndices = None, trappedIndices = None, track = None): if not self.loaded: self.load() self.frame.show() @@ -59,7 +59,7 @@ class FireCogPanel(StateData.StateData): if len(trappedIndices) > 0: if track == BattleBase.TRAP: invalidTargets += trappedIndices - self.__placeButtons(numAvatars, invalidTargets, localNum, fireCosts) + self.__placeButtons(numAvatars, invalidTargets, localNum) def exit(self): self.frame.hide() @@ -87,23 +87,24 @@ class FireCogPanel(StateData.StateData): def adjustToons(self, numToons, localNum): self.__placeButtons(numToons, [], localNum) - def __placeButtons(self, numAvatars, invalidTargets, localNum, fireCosts): - canfire = 0 + def __placeButtons(self, numAvatars, invalidTargets, localNum): + canFire = 0 + for i in xrange(4): if numAvatars > i and i not in invalidTargets and i != localNum: self.avatarButtons[i].show() self.avatarButtons[i]['text'] = '' - if fireCosts[i] <= localAvatar.getPinkSlips(): + if localAvatar.getPinkSlips(): self.avatarButtons[i]['state'] = DGG.NORMAL self.avatarButtons[i]['text_fg'] = (0, 0, 0, 1) - canfire = 1 + canFire = 1 else: self.avatarButtons[i]['state'] = DGG.DISABLED self.avatarButtons[i]['text_fg'] = (1.0, 0, 0, 1) else: self.avatarButtons[i].hide() - if canfire: + if canFire: self.textFrame['text'] = TTLocalizer.FireCogTitle % localAvatar.getPinkSlips() else: self.textFrame['text'] = TTLocalizer.FireCogLowTitle % localAvatar.getPinkSlips() diff --git a/toontown/toon/InventoryNew.py b/toontown/toon/InventoryNew.py index 4eb458fa..5e2585a8 100755 --- a/toontown/toon/InventoryNew.py +++ b/toontown/toon/InventoryNew.py @@ -773,7 +773,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): self.sosButton.show() self.passButton.show() self.fireButton.show() - if localAvatar.getPinkSlips() > 0: + if localAvatar.getPinkSlips(): self.fireButton['state'] = DGG.NORMAL self.fireButton['image_color'] = Vec4(0, 0.6, 1, 1) else: diff --git a/toontown/town/TownBattle.py b/toontown/town/TownBattle.py index 2f788092..e44e7862 100755 --- a/toontown/town/TownBattle.py +++ b/toontown/town/TownBattle.py @@ -122,10 +122,6 @@ class TownBattle(StateData.StateData): self.SOSPetInfoPanel = TownBattleSOSPetInfoPanel.TownBattleSOSPetInfoPanel(self.SOSPetInfoPanelDoneEvent) self.fireCogPanelDoneEvent = 'fire-cog-panel-done' self.FireCogPanel = FireCogPanel.FireCogPanel(self.fireCogPanelDoneEvent) - self.cogFireCosts = [None, - None, - None, - None] self.toonPanels = (TownBattleToonPanel.TownBattleToonPanel(0), TownBattleToonPanel.TownBattleToonPanel(1), TownBattleToonPanel.TownBattleToonPanel(2), @@ -460,11 +456,8 @@ class TownBattle(StateData.StateData): toonIds = map(lambda toon: toon.doId, toons) self.notify.debug('adjustCogsAndToons() toonIds: %s self.toons: %s' % (toonIds, self.toons)) maxSuitLevel = 0 - cogFireCostIndex = 0 for cog in cogs: maxSuitLevel = max(maxSuitLevel, cog.getActualLevel()) - self.cogFireCosts[cogFireCostIndex] = 1 - cogFireCostIndex += 1 creditLevel = maxSuitLevel resetActivateMode = 0 @@ -603,7 +596,7 @@ class TownBattle(StateData.StateData): def enterFire(self): canHeal, canTrap, canLure = self.checkHealTrapLure() - self.FireCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track, fireCosts=self.cogFireCosts) + self.FireCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track) self.accept(self.fireCogPanelDoneEvent, self.__handleCogFireDone) return None