From 6bdc129b6714321865b194375b2fbd2f2a230786 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 13 Aug 2015 03:55:51 +0300 Subject: [PATCH] Organic gag display in the battle GUI and better ~trackBonus command --- toontown/toon/DistributedToonAI.py | 10 ++++++---- toontown/town/TownBattleToonPanel.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 23330411..0f52a725 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -4878,18 +4878,20 @@ def givePies(pieType, numPies=0): else: target.b_setNumPies(ToontownGlobals.FullPies) -@magicWord(category=CATEGORY_PROGRAMMER, types=[int]) -def trackBonus(trackIndex): +@magicWord(category=CATEGORY_PROGRAMMER, types=[int, int]) +def trackBonus(trackIndex, level): """ Modify the invoker's track bonus level. """ invoker = spellbook.getInvoker() if not 0 <= trackIndex < 7: return 'Invalid track index!' + if not -1 <= level <= 6: + return 'Invalid level!' trackBonusLevel = [0] * 7 - trackBonusLevel[trackIndex] = 1 + trackBonusLevel[trackIndex] = level invoker.b_setTrackBonusLevel(trackBonusLevel) - return 'Your track bonus level has been set!' + return 'Your track bonus level has been set to %s!' % level @magicWord(category=CATEGORY_PROGRAMMER, types=[str, str, int]) def track(command, track, value=None): diff --git a/toontown/town/TownBattleToonPanel.py b/toontown/town/TownBattleToonPanel.py index 932e7c54..388ec7c6 100755 --- a/toontown/town/TownBattleToonPanel.py +++ b/toontown/town/TownBattleToonPanel.py @@ -126,6 +126,8 @@ class TownBattleToonPanel(DirectFrame): self.gag.setScale(0.8) self.gag.setPos(0, 0, 0.02) self.hasGag = 1 + if self.avatar is not None and self.avatar.checkGagBonus(track, level): + self.gag.setColor((1, 0, 0, 1) if track == 1 and level == 5 else (0, 1, 0, 1)) if numTargets is not None and targetIndex is not None and localNum is not None: self.whichText.show() self.whichText['text'] = self.determineWhichText(numTargets, targetIndex, localNum, index)