Organic gag display in the battle GUI and better ~trackBonus command

This commit is contained in:
John 2015-08-13 03:55:51 +03:00
parent 3d5a138a68
commit 6bdc129b67
2 changed files with 8 additions and 4 deletions

View file

@ -4878,18 +4878,20 @@ def givePies(pieType, numPies=0):
else: else:
target.b_setNumPies(ToontownGlobals.FullPies) target.b_setNumPies(ToontownGlobals.FullPies)
@magicWord(category=CATEGORY_PROGRAMMER, types=[int]) @magicWord(category=CATEGORY_PROGRAMMER, types=[int, int])
def trackBonus(trackIndex): def trackBonus(trackIndex, level):
""" """
Modify the invoker's track bonus level. Modify the invoker's track bonus level.
""" """
invoker = spellbook.getInvoker() invoker = spellbook.getInvoker()
if not 0 <= trackIndex < 7: if not 0 <= trackIndex < 7:
return 'Invalid track index!' return 'Invalid track index!'
if not -1 <= level <= 6:
return 'Invalid level!'
trackBonusLevel = [0] * 7 trackBonusLevel = [0] * 7
trackBonusLevel[trackIndex] = 1 trackBonusLevel[trackIndex] = level
invoker.b_setTrackBonusLevel(trackBonusLevel) 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]) @magicWord(category=CATEGORY_PROGRAMMER, types=[str, str, int])
def track(command, track, value=None): def track(command, track, value=None):

View file

@ -126,6 +126,8 @@ class TownBattleToonPanel(DirectFrame):
self.gag.setScale(0.8) self.gag.setScale(0.8)
self.gag.setPos(0, 0, 0.02) self.gag.setPos(0, 0, 0.02)
self.hasGag = 1 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: if numTargets is not None and targetIndex is not None and localNum is not None:
self.whichText.show() self.whichText.show()
self.whichText['text'] = self.determineWhichText(numTargets, targetIndex, localNum, index) self.whichText['text'] = self.determineWhichText(numTargets, targetIndex, localNum, index)