diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 67f648c8..8da03705 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -4256,20 +4256,20 @@ def cheesyEffect(value, hood=0, expire=0): return 'Invalid cheesy effect value: %d' % value if (hood != 0) and (not 1000 <= hood < ToontownGlobals.DynamicZonesBegin): return 'Invalid hood ID: %d' % hood - invoker = spellbook.getInvoker() - invoker.b_setCheesyEffect(value, hood, expire) - return 'Set your cheesy effect to: %d' % value + target = spellbook.getTarget() + target.b_setCheesyEffect(value, hood, expire) + return 'Set %s\'s cheesy effect to: %d' % (target.getName(), value) @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) def hp(hp): """ - Modify the invoker's current HP. + Modify the target's current HP. """ - invoker = spellbook.getInvoker() - maxHp = invoker.getMaxHp() + target = spellbook.getTarget() + maxHp = target.getMaxHp() if not -1 <= hp <= maxHp: return 'HP must be in range (-1-%d).' % maxHp - invoker.b_setHp(hp) + target.b_setHp(hp) return 'Set your HP to: %d' % hp @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) @@ -4296,14 +4296,14 @@ def textColor(color): @magicWord(category=CATEGORY_MODERATOR, types=[str]) def allSummons(): """ - Max the invoker's summons + Max the target's summons """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() numSuits = len(SuitDNA.suitHeadTypes) fullSetForSuit = 1 | 2 | 4 | 8 | 16 | 32 allSummons = numSuits * [fullSetForSuit] - invoker.b_setCogSummonsEarned(allSummons) + target.b_setCogSummonsEarned(allSummons) return 'Lots of summons!' @magicWord(category=CATEGORY_PROGRAMMER, types=[str]) @@ -4401,17 +4401,17 @@ def maxToon(missingTrack=None): @magicWord(category=CATEGORY_PROGRAMMER) def unlocks(): """ - Unlocks the invoker's teleport access, emotions, and pet trick phrases. + Unlocks the target's teleport access, emotions, and pet trick phrases. """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() # First, unlock their teleport access: hoods = list(ToontownGlobals.HoodsForTeleportAll) - invoker.b_setHoodsVisited(hoods) - invoker.b_setTeleportAccess(hoods) + target.b_setHoodsVisited(hoods) + target.b_setTeleportAccess(hoods) # Next, unlock all of their emotions: - emotes = list(invoker.getEmoteAccess()) + emotes = list(target.getEmoteAccess()) for emoteId in OTPLocalizer.EmoteFuncDict.values(): if emoteId >= len(emotes): continue @@ -4420,20 +4420,20 @@ def unlocks(): if emoteId in (17, 18, 19): continue emotes[emoteId] = 1 - invoker.b_setEmoteAccess(emotes) + target.b_setEmoteAccess(emotes) # Finally, unlock all of their pet phrases: if simbase.wantPets: - invoker.b_setPetTrickPhrases(range(7)) + target.b_setPetTrickPhrases(range(7)) return 'Unlocked teleport access, emotions, and pet trick phrases!' @magicWord(category=CATEGORY_PROGRAMMER, types=[int, str]) def sos(count, name): """ - Modifies the invoker's specified SOS card count. + Modifies the target's specified SOS card count. """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() if not 0 <= count <= 100: return 'Your SOS count must be in range (0-100).' for npcId, npcName in TTLocalizer.NPCToonNames.items(): @@ -4443,43 +4443,43 @@ def sos(count, name): break else: return 'SOS card %s was not found!' % name - if (count == 0) and (npcId in invoker.NPCFriendsDict): - del invoker.NPCFriendsDict[npcId] + if (count == 0) and (npcId in target.NPCFriendsDict): + del target.NPCFriendsDict[npcId] else: - invoker.NPCFriendsDict[npcId] = count - invoker.d_setNPCFriendsDict(invoker.NPCFriendsDict) - return "You were given %d %s SOS cards." % (count, name) + target.NPCFriendsDict[npcId] = count + target.d_setNPCFriendsDict(target.NPCFriendsDict) + return "%s was given %d %s SOS cards." % (target.getName(), count, name) @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) def unites(value=32767): """ Restock all resistance messages. """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() value = min(value, 32767) - invoker.restockAllResistanceMessages(value) - return 'Restocked %d unites!' % value + target.restockAllResistanceMessages(value) + return 'Restocked %d unites for %s!' % (value, target.getName()) @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) def fires(count): """ - Modifies the invoker's pink slip count. + Modifies the target's pink slip count. """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() if not 0 <= count <= 255: return 'Your fire count must be in range (0-255).' - invoker.b_setPinkSlips(count) - return 'You were given %d fires.' % count + target.b_setPinkSlips(count) + return '%s was given %d fires.' % (target.getName(), count) @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) def crateKeys(count): """ Modifies the invoker's crate key count. """ - invoker = spellbook.getInvoker() + target = spellbook.getTarget() if not 0 <= count <= 255: return 'Your crate key must be in range (0-255).' - invoker.b_setCrateKeys(count) + target.b_setCrateKeys(count) return 'You were given %d crate keys.' % count @magicWord(category=CATEGORY_PROGRAMMER, types=[int]) @@ -4577,66 +4577,54 @@ def squish(laff): @magicWord(category=CATEGORY_CREATIVE, types=[int, int]) def hat(hatIndex, hatTex=0): """ - Modify the invoker's hat. + Modify the target's hat. """ if not 0 <= hatIndex < len(ToonDNA.HatModels): return 'Invalid hat index.' if not 0 <= hatTex < len(ToonDNA.HatTextures): return 'Invalid hat texture.' - invoker = spellbook.getInvoker() target = spellbook.getTarget() - if target != invoker: - target.b_setHat(hatIndex, hatTex, 0) - return "Set %s's hat to %d, %d!" % (target.getName(), hatIndex, hatTex) - invoker.b_setHat(hatIndex, hatTex, 0) - return "Set %s's hat to %d, %d!" % (invoker.getName(), hatIndex, hatTex) + target.b_setHat(hatIndex, hatTex, 0) + return "Set %s's hat to %d, %d!" % (target.getName(), hatIndex, hatTex) @magicWord(category=CATEGORY_CREATIVE, types=[int, int]) def glasses(glassesIndex, glassesTex=0): """ - Modify the invoker's glasses. + Modify the target's glasses. """ if not 0 <= glassesIndex < len(ToonDNA.GlassesModels): return 'Invalid glasses index.' if not 0 <= glassesTex < len(ToonDNA.GlassesTextures): return 'Invalid glasses texture.' - invoker = spellbook.getInvoker() target = spellbook.getTarget() - if target != invoker: - target.b_setGlasses(glassesIndex, glassesTex, 0) - return "Set %s's glasses to %d, %d!" % (target.getName(), glassesIndex, glassesTex) - invoker.b_setGlasses(glassesIndex, glassesTex, 0) - return "Set %s's glasses to %d, %d!" % (invoker.getName(), glassesIndex, glassesTex) + target.b_setGlasses(glassesIndex, glassesTex, 0) + return "Set %s's glasses to %d, %d!" % (target.getName(), glassesIndex, glassesTex) @magicWord(category=CATEGORY_CREATIVE, types=[int, int]) def backpack(backpackIndex, backpackTex=0): """ - Modify the invoker's backpack. + Modify the target's backpack. """ if not 0 <= backpackIndex < len(ToonDNA.BackpackModels): return 'Invalid backpack index.' if not 0 <= backpackTex < len(ToonDNA.BackpackTextures): return 'Invalid backpack texture.' - invoker = spellbook.getInvoker() - invoker.b_setBackpack(backpackIndex, backpackTex, 0) - return "Set %s's backpack to %d, %d!" % (invoker.getName(), backpackIndex, backpackTex) + target = spellbook.getTarget() + target.b_setBackpack(backpackIndex, backpackTex, 0) + return "Set %s's backpack to %d, %d!" % (target.getName(), backpackIndex, backpackTex) @magicWord(category=CATEGORY_CREATIVE, types=[int, int]) def shoes(shoesIndex, shoesTex=0): """ - Modify the invoker's shoes. + Modify the target's shoes. """ if not 0 <= shoesIndex < len(ToonDNA.ShoesModels): return 'Invalid shoes index.' if not 0 <= shoesTex < len(ToonDNA.ShoesTextures): return 'Invalid shoes texture.' - invoker = spellbook.getInvoker() target = spellbook.getTarget() - if target != invoker: - target.b_setShoes(shoesIndex, shoesTex, 0) - return "Set %s's shoes to %d, %d!" % (target.getName(), shoesIndex, shoesTex) - invoker.b_setShoes(shoesIndex, shoesTex, 0) - return "Set %s's shoes to %d, %d!" % (invoker.getName(), shoesIndex, shoesTex) + target.b_setShoes(shoesIndex, shoesTex, 0) + return "Set %s's shoes to %d, %d!" % (target.getName(), shoesIndex, shoesTex) @magicWord(category=CATEGORY_COMMUNITY_MANAGER) def ghost(): @@ -4689,8 +4677,8 @@ def cogIndex(index): @magicWord(category=CATEGORY_PROGRAMMER, types=[str, int, int]) def inventory(a, b=None, c=None): - invoker = spellbook.getInvoker() - inventory = invoker.inventory + target = spellbook.getTarget() + inventory = target.inventory if a == 'reset': maxLevelIndex = b or 5 if not 0 <= maxLevelIndex < len(ToontownBattleGlobals.Levels[0]): @@ -4701,7 +4689,7 @@ def inventory(a, b=None, c=None): for track in xrange(0, len(ToontownBattleGlobals.Tracks)): if (targetTrack == -1) or (track == targetTrack): inventory.inventory[track][:maxLevelIndex + 1] = [0] * (maxLevelIndex+1) - invoker.b_setInventory(inventory.makeNetString()) + target.b_setInventory(inventory.makeNetString()) if targetTrack == -1: return 'Inventory reset.' else: @@ -4713,10 +4701,10 @@ def inventory(a, b=None, c=None): targetTrack = -1 or c if not -1 <= targetTrack < len(ToontownBattleGlobals.Tracks): return 'Invalid target track index: ' + str(targetTrack) - if (targetTrack != -1) and (not invoker.hasTrackAccess(targetTrack)): + if (targetTrack != -1) and (not target.hasTrackAccess(targetTrack)): return "You don't have target track index: " + str(targetTrack) inventory.NPCMaxOutInv(targetTrack=targetTrack, maxLevelIndex=maxLevelIndex) - invoker.b_setInventory(inventory.makeNetString()) + target.b_setInventory(inventory.makeNetString()) if targetTrack == -1: return 'Inventory restocked.' else: @@ -4726,14 +4714,14 @@ def inventory(a, b=None, c=None): targetTrack = int(a) except: return 'Invalid first argument.' - if not invoker.hasTrackAccess(targetTrack): + if not target.hasTrackAccess(targetTrack): return "You don't have target track index: " + str(targetTrack) maxLevelIndex = b or 6 if not 0 <= maxLevelIndex < len(ToontownBattleGlobals.Levels[0]): return 'Invalid max level index: ' + str(maxLevelIndex) for _ in xrange(c): inventory.addItem(targetTrack, maxLevelIndex) - invoker.b_setInventory(inventory.makeNetString()) + target.b_setInventory(inventory.makeNetString()) return 'Restored %d Gags to: %d, %d' % (c, targetTrack, maxLevelIndex) @magicWord(category=CATEGORY_CREATIVE, types=[str, str]) @@ -5061,7 +5049,7 @@ def summoncogdo(track="s", difficulty=5): av = spellbook.getInvoker() building = av.findClosestDoor() if building == None: - return "No bldg found!" + return "No Toon building found!" building.cogdoTakeOver(difficulty, 2, track) return 'Successfully spawned cogdo with track %s and difficulty %d' % (track, difficulty)