From 35b646c4e6c5900e6c65e5d707ff3a4598175c3e Mon Sep 17 00:00:00 2001 From: John Date: Tue, 16 Jun 2015 20:26:44 +0300 Subject: [PATCH] Revert "Spring cleaning" This reverts commit 1e4bad8c6bd55a66e065e34483f7b2190f02cf21. --- dev/tools/rpc/generate_key.py | 4 + dev/tools/rpc/rpc-invasions.py | 94 ++++----- otp/ai/MagicWordManagerAI.py | 19 +- otp/ai/TimeManager.py | 2 +- otp/ai/TimeManagerAI.py | 8 +- otp/avatar/AvatarHandle.py | 2 +- otp/avatar/DistributedAvatarUD.py | 1 + otp/avatar/DistributedPlayer.py | 4 +- otp/avatar/LocalAvatar.py | 2 +- otp/avatar/ShadowCaster.py | 2 +- otp/chat/ChatAgent.py | 1 + otp/chat/ChatAgentAI.py | 2 +- otp/chat/ChatAgentUD.py | 3 + otp/chat/ChatManager.py | 2 +- otp/chat/SequenceList.py | 2 +- otp/chat/TalkAssistant.py | 4 +- otp/chat/WhiteList.py | 2 +- otp/distributed/AccountAI.py | 1 + otp/distributed/AccountUD.py | 1 + otp/distributed/DistributedDirectoryAI.py | 2 +- otp/distributed/DistributedDistrictUD.py | 1 + otp/friends/FriendManagerAI.py | 2 +- otp/level/AmbientSound.py | 2 +- otp/level/CollisionSolidEntity.py | 2 +- otp/level/DistributedEntityAI.py | 2 +- otp/level/DistributedInteractiveEntityAI.py | 1 + otp/level/DistributedLevelAI.py | 2 +- otp/level/Entity.py | 2 +- otp/level/EntrancePoint.py | 2 +- otp/level/Level.py | 2 +- otp/level/LevelConstants.py | 2 +- otp/level/LevelMgrAI.py | 2 +- otp/level/LocatorEntity.py | 2 +- otp/level/PathEntity.py | 2 +- otp/level/PropSpinner.py | 2 +- otp/level/VisibilityExtender.py | 2 +- otp/level/ZoneEntity.py | 2 +- otp/movement/CMover.py | 3 +- otp/otpbase/OTPBase.py | 2 +- otp/otpbase/OTPGlobals.py | 2 +- toontown/ai/HalloweenHolidayDecorator.py | 2 +- toontown/ai/NewsManager.py | 6 +- toontown/battle/BattleCalculatorAI.py | 6 +- toontown/battle/BattleManagerAI.py | 2 +- toontown/battle/BattleParticles.py | 2 +- toontown/battle/BattleSounds.py | 2 +- toontown/battle/DistributedBattleAI.py | 2 +- toontown/battle/Movie.py | 6 +- toontown/battle/MovieFire.py | 2 +- toontown/battle/MovieSquirt.py | 2 +- toontown/battle/ParticleDefs.py | 2 + .../building/DistributedBoardingPartyAI.py | 12 +- toontown/building/DistributedBuildingAI.py | 14 +- toontown/building/DistributedCJElevatorAI.py | 1 + toontown/building/DistributedElevatorIntAI.py | 6 +- .../building/DistributedToonHallInterior.py | 18 +- toontown/building/DoorTypes.py | 2 +- toontown/building/PetshopBuildingAI.py | 4 +- toontown/building/SuitBuildingGlobals.py | 2 +- toontown/catalog/AccountDate.py | 12 +- toontown/catalog/AccountDateAI.py | 10 +- toontown/catalog/CatalogAccessoryItem.py | 2 +- .../catalog/CatalogAccessoryItemGlobals.py | 2 +- toontown/catalog/CatalogClothingItem.py | 2 +- toontown/catalog/CatalogEmoteItem.py | 2 +- toontown/catalog/CatalogFurnitureItem.py | 10 +- toontown/catalog/CatalogGenerator.py | 4 +- toontown/catalog/CatalogHouseItem.py | 15 +- toontown/catalog/CatalogManagerAI.py | 7 +- toontown/catalog/CatalogScreen.py | 6 +- toontown/catalog/CatalogSurfaceItem.py | 1 + toontown/catalog/MailboxScreen.py | 4 +- toontown/chat/TTTalkAssistant.py | 2 +- toontown/cogdominium/CogdoCraneGame.py | 2 +- toontown/cogdominium/DistCogdoFlyingGameAI.py | 4 +- .../cogdominium/DistributedCogdoInterior.py | 4 +- toontown/coghq/ActiveCell.py | 2 +- toontown/coghq/BarrelBase.py | 2 +- toontown/coghq/BattleBlocker.py | 2 +- toontown/coghq/BattleBlockerAI.py | 2 +- toontown/coghq/BossbotCogHQLoader.py | 2 +- toontown/coghq/ConveyorBelt.py | 2 +- toontown/coghq/CountryClubRoomBase.py | 2 +- toontown/coghq/DistributedBarrelBaseAI.py | 2 +- toontown/coghq/DistributedCogKart.py | 2 +- toontown/coghq/DistributedCrusherEntityAI.py | 20 +- toontown/coghq/DistributedDoorEntity.py | 2 +- toontown/coghq/DistributedDoorEntityAI.py | 2 +- toontown/coghq/DistributedLawOfficeFloorAI.py | 2 +- toontown/coghq/DistributedLift.py | 2 +- toontown/coghq/DistributedMegaCorp.py | 2 +- toontown/coghq/DistributedMintRoomAI.py | 2 +- toontown/coghq/DistributedSellbotHQDoorAI.py | 1 + toontown/coghq/DistributedStomper.py | 2 +- toontown/coghq/DistributedStomperAI.py | 2 +- toontown/coghq/DistributedSwitch.py | 2 +- toontown/coghq/DistributedSwitchAI.py | 2 +- toontown/coghq/FactoryBase.py | 2 +- toontown/coghq/FactoryLevelMgr.py | 2 +- toontown/coghq/FactoryManagerAI.py | 2 +- toontown/coghq/FactorySpecs.py | 2 +- toontown/coghq/GearEntity.py | 2 +- toontown/coghq/LaserGameAvoid.py | 2 + toontown/coghq/LaserGameBase.py | 2 + toontown/coghq/LaserGameDrag.py | 2 +- toontown/coghq/LaserGameMineSweeper.py | 2 + toontown/coghq/LaserGameRoll.py | 2 + toontown/coghq/LawOfficeBase.py | 2 +- toontown/coghq/LawOfficeLayout.py | 2 + toontown/coghq/LevelBattleManagerAI.py | 2 +- toontown/coghq/MintProduct.py | 2 +- toontown/coghq/MintRoomBase.py | 2 +- toontown/coghq/PathMasterEntity.py | 2 +- toontown/coghq/PlatformEntity.py | 2 +- toontown/coghq/SellbotCogHQLoader.py | 6 +- toontown/coghq/SellbotMegaCorpLegCogs.py | 4 +- toontown/coghq/SellbotMegaCorpLegSpec.py | 12 +- toontown/coghq/StageRoomBase.py | 2 +- toontown/distributed/DistributedTimerAI.py | 1 + toontown/estate/DistributedCannon.py | 1 + toontown/estate/DistributedClosetAI.py | 16 +- toontown/estate/DistributedEstateAI.py | 6 +- toontown/estate/DistributedHouseDoor.py | 4 +- toontown/estate/DistributedHouseInterior.py | 2 +- toontown/estate/DistributedPhoneAI.py | 10 +- toontown/estate/GardenDropGame.py | 2 +- toontown/estate/TrunkGUI.py | 16 +- toontown/fishing/BingoCardGui.py | 2 +- .../fishing/DistributedPondBingoManager.py | 2 +- toontown/friends/FriendInviter.py | 4 +- toontown/friends/FriendsListPanel.py | 4 +- toontown/friends/TTSFriendsManager.py | 6 +- toontown/friends/TTSFriendsManagerUD.py | 2 +- toontown/golf/DistributedGolfHoleAI.py | 2 +- toontown/golf/GolfGlobals.py | 78 +++---- toontown/hood/MMHoodAI.py | 2 +- toontown/hood/Place.py | 2 +- toontown/hood/ZoneUtil.py | 4 +- toontown/language/LanguageSelector.py | 4 +- toontown/launcher/TTSLauncher.py | 4 +- toontown/makeatoon/NameGenerator.py | 2 +- toontown/minigame/CogThiefGameGlobals.py | 2 +- toontown/minigame/CogThiefWalk.py | 2 +- toontown/minigame/DistributedCogThiefGame.py | 2 +- .../minigame/DistributedCogThiefGameAI.py | 2 +- toontown/minigame/DistributedMinigame.py | 2 +- toontown/minigame/DistributedMinigameAI.py | 2 +- toontown/minigame/DistributedPatternGame.py | 2 +- toontown/minigame/DistributedTagGame.py | 2 +- toontown/minigame/MinigameGlobals.py | 2 +- toontown/minigame/PatternGameGlobals.py | 2 +- toontown/nametag/Nametag2d.py | 2 +- toontown/parties/DistributedPartyAI.py | 5 +- .../parties/DistributedPartyActivityAI.py | 1 + toontown/parties/DistributedPartyCannonAI.py | 14 +- .../DistributedPartyCannonActivityAI.py | 3 +- .../DistributedPartyCatchActivityAI.py | 16 +- .../parties/DistributedPartyCogActivityAI.py | 1 + .../DistributedPartyDance20ActivityAI.py | 1 + .../DistributedPartyDanceActivityAI.py | 1 + .../DistributedPartyDanceActivityBaseAI.py | 10 +- .../DistributedPartyFireworksActivity.py | 2 +- .../DistributedPartyFireworksActivityAI.py | 12 +- .../DistributedPartyJukebox40ActivityAI.py | 1 + .../DistributedPartyJukeboxActivityAI.py | 3 +- .../DistributedPartyJukeboxActivityBaseAI.py | 2 +- .../parties/DistributedPartyTeamActivityAI.py | 1 + .../DistributedPartyTrampolineActivityAI.py | 23 ++- .../DistributedPartyTugOfWarActivityAI.py | 1 + ...tributedPartyValentineDance20ActivityAI.py | 1 + ...istributedPartyValentineDanceActivityAI.py | 1 + ...ibutedPartyValentineJukebox40ActivityAI.py | 1 + ...tributedPartyValentineJukeboxActivityAI.py | 1 + ...butedPartyValentineTrampolineActivityAI.py | 1 + ...ributedPartyVictoryTrampolineActivityAI.py | 1 + .../DistributedPartyWinterCatchActivityAI.py | 1 + .../DistributedPartyWinterCogActivityAI.py | 1 + ...tributedPartyWinterTrampolineActivityAI.py | 1 + toontown/parties/GlobalPartyManager.py | 2 +- toontown/parties/GlobalPartyManagerAI.py | 18 +- toontown/parties/GlobalPartyManagerUD.py | 22 +- toontown/parties/ServerTimeGui.py | 2 +- toontown/pets/DistributedPetAI.py | 6 +- toontown/quest/QuestMapGlobals.py | 2 +- toontown/quest/QuestParser.py | 14 +- toontown/quest/QuestPoster.py | 6 +- toontown/quest/QuestRewardCounter.py | 2 +- toontown/quest/QuestScripts.py | 20 +- toontown/quest/Quests.py | 20 +- toontown/racing/DistributedGagAI.py | 15 +- toontown/racing/DistributedKartPadAI.py | 14 +- toontown/racing/DistributedLeaderBoardAI.py | 1 + toontown/racing/DistributedProjectileAI.py | 1 + toontown/racing/DistributedRacePadAI.py | 51 ++--- toontown/racing/DistributedStartingBlock.py | 2 +- toontown/racing/DistributedStartingBlockAI.py | 30 +-- toontown/racing/DistributedViewPadAI.py | 13 +- toontown/safezone/BRPlayground.py | 2 +- toontown/safezone/BRSafeZoneLoader.py | 2 +- toontown/safezone/DDSafeZoneLoader.py | 2 +- toontown/safezone/DGPlayground.py | 2 +- toontown/safezone/DGSafeZoneLoader.py | 2 +- toontown/safezone/DistributedCheckersAI.py | 195 +++++++++--------- .../safezone/DistributedChineseCheckersAI.py | 178 ++++++++-------- toontown/safezone/DistributedFindFourAI.py | 176 ++++++++-------- toontown/safezone/DistributedFishingSpotAI.py | 6 +- toontown/safezone/DistributedMMPiano.py | 10 +- toontown/safezone/DistributedMMPianoAI.py | 16 +- toontown/safezone/DistributedPartyGateAI.py | 2 +- toontown/safezone/DistributedPicnicTableAI.py | 13 +- toontown/safezone/GSPlayground.py | 2 +- toontown/safezone/GSSafeZoneLoader.py | 2 +- toontown/safezone/GameMenu.py | 2 +- toontown/safezone/GameTutorials.py | 2 +- toontown/safezone/MMPlayground.py | 2 + toontown/safezone/MMSafeZoneLoader.py | 2 +- toontown/safezone/Playground.py | 4 +- toontown/safezone/TTPlayground.py | 2 +- toontown/safezone/TTSafeZoneLoader.py | 1 + toontown/shtiker/DeleteManagerAI.py | 1 + toontown/shtiker/EventsPage.py | 2 +- toontown/shtiker/NPCFriendPage.py | 2 +- toontown/shtiker/OptionsPage.py | 14 +- toontown/shtiker/PhotoAlbumPage.py | 8 +- toontown/shtiker/PurchaseManager.py | 2 +- toontown/shtiker/PurchaseManagerAI.py | 2 +- toontown/speedchat/TTSpeedChatTypes.py | 2 +- toontown/suit/BossCog.py | 10 +- toontown/suit/DistributedCashbotBossAI.py | 2 +- toontown/suit/DistributedGridGoonAI.py | 1 + toontown/suit/DistributedLawbotBossAI.py | 2 +- toontown/suit/DistributedSuitBaseAI.py | 2 +- toontown/suit/DistributedSuitPlannerAI.py | 6 +- toontown/suit/Suit.py | 14 +- toontown/suit/SuitBase.py | 2 +- toontown/suit/SuitGlobals.py | 1 + toontown/suit/SuitInvasionGlobals.py | 2 +- toontown/suit/SuitInvasionManagerAI.py | 4 +- toontown/suit/SuitPlannerBase.py | 6 +- toontown/toon/AvatarPanelBase.py | 4 +- .../toon/DistributedNPCFlippyInToonHall.py | 2 +- toontown/toon/DistributedNPCPetclerkAI.py | 6 +- toontown/toon/DistributedNPCScientist.py | 6 +- toontown/toon/DistributedNPCScientistAI.py | 4 +- toontown/toon/DistributedSmartNPCAI.py | 9 +- toontown/toon/DistributedToon.py | 26 +-- toontown/toon/DistributedToonAI.py | 46 ++--- toontown/toon/DistributedToonUD.py | 6 +- toontown/toon/GroupInvitee.py | 4 +- toontown/toon/InventoryBase.py | 2 +- toontown/toon/LaughingManGlobals.py | 4 +- toontown/toon/LocalToon.py | 6 +- toontown/toon/NPCFriendPanel.py | 2 +- toontown/toon/QuestionMgr.py | 2 +- toontown/toon/QuestionMgrCustom.py | 4 +- toontown/toon/Toon.py | 8 +- toontown/toon/ToonDNA.py | 14 +- toontown/toonbase/ClientStart.py | 2 +- toontown/toonbase/TTLocalizerEnglish.py | 14 +- toontown/town/BRStreet.py | 2 +- toontown/town/DDStreet.py | 1 + toontown/town/DDTownLoader.py | 1 + toontown/town/DGStreet.py | 2 +- toontown/town/DGTownLoader.py | 1 + toontown/town/DLStreet.py | 2 +- toontown/town/DLTownLoader.py | 1 + toontown/town/MMStreet.py | 2 +- toontown/town/MMTownLoader.py | 1 + toontown/town/Street.py | 2 +- toontown/town/TTStreet.py | 2 +- toontown/town/TTTownLoader.py | 1 + toontown/town/TownBattle.py | 4 +- toontown/town/TownBattleCogPanel.py | 34 +-- .../tutorial/DistributedBattleTutorialAI.py | 4 +- toontown/tutorial/TutorialManagerAI.py | 4 +- toontown/uberdog/ClientServicesManagerUD.py | 2 +- toontown/uberdog/DistributedPartyManagerUD.py | 1 + toontown/uberdog/GlobalLobbyManagerAI.py | 18 +- toontown/uberdog/GlobalLobbyManagerUD.py | 10 +- 279 files changed, 1050 insertions(+), 967 deletions(-) diff --git a/dev/tools/rpc/generate_key.py b/dev/tools/rpc/generate_key.py index de1c01f7..81c81363 100644 --- a/dev/tools/rpc/generate_key.py +++ b/dev/tools/rpc/generate_key.py @@ -32,3 +32,7 @@ print 'Encrypted string:', encoded # decode the encoded string decoded = DecodeAES(cipher, encoded) print 'Decrypted string:', decoded + + + + diff --git a/dev/tools/rpc/rpc-invasions.py b/dev/tools/rpc/rpc-invasions.py index bb8ac209..d9aaecd6 100644 --- a/dev/tools/rpc/rpc-invasions.py +++ b/dev/tools/rpc/rpc-invasions.py @@ -29,50 +29,50 @@ def generate_token(accessLevel): random.seed() while True: - try: - res = client.ping(generate_token(700), 12345) - if res != 12345: - print "Is the server accessable?\n" - exit - - # How many times a day is this script going to be called? - ChecksPerDay = 60.0*24.0 # Once a minute - InvasionsPerDay = 72.0 # How many invasions a day per district - BaseInvasionChance = InvasionsPerDay/ChecksPerDay - - safeHarbor = {'Wacky Falls'} - superDistricts = {'Nuttyboro'} - - - while True: - shards = client.listShards(generate_token(700)) - print shards - count = 0 - for skey in shards: - shard = shards[skey] - if shard['invasion'] != None: - count = count + 1 - for skey in shards: - shard = shards[skey] - if shard['invasion'] == None: - if shard['name'] in superDistricts: - typ = int(float(random.random()) * 4.0) - suit = int(float(random.random()) * 4.0) + 4 # Bias the cogs to be big - client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0) - count = count + 1 - print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit) - if count < 3: - for skey in shards: - shard = shards[skey] - if shard['invasion'] == None and not shard['name'] in safeHarbor: - r = random.random() - if r < BaseInvasionChance and not shard['name'] in superDistricts: - typ = int(float(random.random()) * 4.0) - suit = int(float(random.random()) * 8.0) - client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0) - print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit) - print "tick..(was %d)\n"%(count) - time.sleep(60) - except Exception, e: - print e - time.sleep(300) + try: + res = client.ping(generate_token(700), 12345) + if res != 12345: + print "Is the server accessable?\n" + exit + + # How many times a day is this script going to be called? + ChecksPerDay = 60.0*24.0 # Once a minute + InvasionsPerDay = 72.0 # How many invasions a day per district + BaseInvasionChance = InvasionsPerDay/ChecksPerDay + + safeHarbor = {'Wacky Falls'} + superDistricts = {'Nuttyboro'} + + + while True: + shards = client.listShards(generate_token(700)) + print shards + count = 0 + for skey in shards: + shard = shards[skey] + if shard['invasion'] != None: + count = count + 1 + for skey in shards: + shard = shards[skey] + if shard['invasion'] == None: + if shard['name'] in superDistricts: + typ = int(float(random.random()) * 4.0) + suit = int(float(random.random()) * 4.0) + 4 # Bias the cogs to be big + client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0) + count = count + 1 + print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit) + if count < 3: + for skey in shards: + shard = shards[skey] + if shard['invasion'] == None and not shard['name'] in safeHarbor: + r = random.random() + if r < BaseInvasionChance and not shard['name'] in superDistricts: + typ = int(float(random.random()) * 4.0) + suit = int(float(random.random()) * 8.0) + client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0) + print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit) + print "tick..(was %d)\n"%(count) + time.sleep(60) + except Exception, e: + print e + time.sleep(300) diff --git a/otp/ai/MagicWordManagerAI.py b/otp/ai/MagicWordManagerAI.py index 5bdcc7f8..9393001b 100755 --- a/otp/ai/MagicWordManagerAI.py +++ b/otp/ai/MagicWordManagerAI.py @@ -14,7 +14,7 @@ class MagicWordManagerAI(DistributedObjectAI): if not 'DistributedToonAI' in str(self.air.doId2do.get(targetId)): self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['Target is not a toon object!']) return - + if not invoker: self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['missing invoker']) return @@ -56,20 +56,21 @@ def help(wordName=None): return 'Did you mean %s' % (spellbook.words.get(key).name) return 'I have no clue what %s is referring to' % (wordName) return word.doc - + @magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[]) def words(): accessLevel = spellbook.getInvoker().getAdminAccess() wordString = None for key in spellbook.words: - word = spellbook.words.get(key) - if word.access <= accessLevel: - if wordString is None: - wordString = key - else: - wordString += ", "; - wordString += key; + word = spellbook.words.get(key) + if word.access <= accessLevel: + if wordString is None: + wordString = key + else: + wordString += ", "; + wordString += key; if wordString is None: return "You are chopped liver" else: return wordString + diff --git a/otp/ai/TimeManager.py b/otp/ai/TimeManager.py index ee0e0062..dd72c36f 100755 --- a/otp/ai/TimeManager.py +++ b/otp/ai/TimeManager.py @@ -125,4 +125,4 @@ class TimeManager(DistributedObject.DistributedObject): info = PythonUtil.describeException() self.notify.info('Client exception: %s' % info) self.sendUpdate('setExceptionInfo', [info]) - self.cr.flush() + self.cr.flush() \ No newline at end of file diff --git a/otp/ai/TimeManagerAI.py b/otp/ai/TimeManagerAI.py index 44cea38b..6ebd9a63 100755 --- a/otp/ai/TimeManagerAI.py +++ b/otp/ai/TimeManagerAI.py @@ -10,13 +10,13 @@ class TimeManagerAI(DistributedObjectAI): def __init__(self, air): DistributedObjectAI.__init__(self, air) self.avId2DcReason = {} - + def requestServerTime(self, context): self.sendUpdateToAvatarId(self.air.getAvatarIdFromSender(), 'serverTime', [context, globalClockDelta.getRealNetworkTime(bits=32), int(time.time())]) def setDisconnectReason(self, reason): avId = self.air.getAvatarIdFromSender() - + if reason == OTPGlobals.DisconnectNone and avId in self.avId2DcReason: del self.avId2DcReason[avId] else: @@ -25,6 +25,6 @@ class TimeManagerAI(DistributedObjectAI): def setExceptionInfo(self, exception): avId = self.air.getAvatarIdFromSender() self.air.writeServerEvent('client-exception', avId, exception) - + def getDisconnectReason(self, avId): - return self.avId2DcReason.get(avId, 0) + return self.avId2DcReason.get(avId, 0) \ No newline at end of file diff --git a/otp/avatar/AvatarHandle.py b/otp/avatar/AvatarHandle.py index 1744b487..98e38152 100755 --- a/otp/avatar/AvatarHandle.py +++ b/otp/avatar/AvatarHandle.py @@ -12,4 +12,4 @@ class AvatarHandle: def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags): newText, scrubbed = localAvatar.scrubTalk(chat, mods) - base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed) + base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed) \ No newline at end of file diff --git a/otp/avatar/DistributedAvatarUD.py b/otp/avatar/DistributedAvatarUD.py index 8f4fe20e..00c3c441 100755 --- a/otp/avatar/DistributedAvatarUD.py +++ b/otp/avatar/DistributedAvatarUD.py @@ -15,3 +15,4 @@ class DistributedAvatarUD(DistributedObjectUD): def confirmAvOnShard(self, todo0, todo1): pass + diff --git a/otp/avatar/DistributedPlayer.py b/otp/avatar/DistributedPlayer.py index 8075aa53..6c24fbc0 100755 --- a/otp/avatar/DistributedPlayer.py +++ b/otp/avatar/DistributedPlayer.py @@ -306,7 +306,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa def teleportQuery(self, requesterId): avatar = base.cr.identifyFriend(requesterId) - + if avatar is None: self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId) elif base.localAvatar.isIgnored(requesterId): @@ -319,7 +319,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa else: if self.failedTeleportMessageOk(requesterId): self.setSystemMessage(requesterId, OTPLocalizer.WhisperFailedVisit % avatar.getName()) - + self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId) def failedTeleportMessageOk(self, fromId): diff --git a/otp/avatar/LocalAvatar.py b/otp/avatar/LocalAvatar.py index e97bc65c..cf29d310 100755 --- a/otp/avatar/LocalAvatar.py +++ b/otp/avatar/LocalAvatar.py @@ -1150,7 +1150,7 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis def clickedWhisper(self, doId): friend = base.cr.identifyFriend(doId) - + if friend != None: messenger.send('clickedNametag', [friend]) self.chatMgr.whisperTo(friend.getName(), doId) diff --git a/otp/avatar/ShadowCaster.py b/otp/avatar/ShadowCaster.py index 57290246..5446bdbd 100755 --- a/otp/avatar/ShadowCaster.py +++ b/otp/avatar/ShadowCaster.py @@ -125,4 +125,4 @@ class ShadowCaster: def __globalDropShadowGrayLevelChanged(self): if self.dropShadow != None: - self.dropShadow.setColor(0.0, 0.0, 0.0, globalDropShadowGrayLevel, 1) + self.dropShadow.setColor(0.0, 0.0, 0.0, globalDropShadowGrayLevel, 1) \ No newline at end of file diff --git a/otp/chat/ChatAgent.py b/otp/chat/ChatAgent.py index 32a84a24..0de10879 100755 --- a/otp/chat/ChatAgent.py +++ b/otp/chat/ChatAgent.py @@ -52,3 +52,4 @@ def chatmode(mode=-1): return "Chat mode 1 is reserved for moderators." base.cr.chatAgent.chatMode = mode return "You are now talking in the %s chat mode." % mode2name.get(mode, "N/A") + diff --git a/otp/chat/ChatAgentAI.py b/otp/chat/ChatAgentAI.py index 810fa484..be09fa56 100755 --- a/otp/chat/ChatAgentAI.py +++ b/otp/chat/ChatAgentAI.py @@ -12,4 +12,4 @@ class ChatAgentAI: pass def setWhiteList(self, todo0): - pass + pass \ No newline at end of file diff --git a/otp/chat/ChatAgentUD.py b/otp/chat/ChatAgentUD.py index cc8122d5..cc1f700a 100755 --- a/otp/chat/ChatAgentUD.py +++ b/otp/chat/ChatAgentUD.py @@ -134,3 +134,6 @@ class ChatAgentUD(DistributedObjectGlobalUD): offset += len(word) + 1 return modifications + + + diff --git a/otp/chat/ChatManager.py b/otp/chat/ChatManager.py index ce205af2..ef856764 100755 --- a/otp/chat/ChatManager.py +++ b/otp/chat/ChatManager.py @@ -296,4 +296,4 @@ class ChatManager(DirectObject.DirectObject): pass def exitOtherDialog(self): - pass + pass \ No newline at end of file diff --git a/otp/chat/SequenceList.py b/otp/chat/SequenceList.py index 5bc1bcc9..61f00d49 100755 --- a/otp/chat/SequenceList.py +++ b/otp/chat/SequenceList.py @@ -275,7 +275,7 @@ pose:eh pound:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself pounds:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself pour:on,no -pro:st i tut,stick tut +pro:st i tut,stick tut purr:cee,say,says,sea,seas,see,sees,she,shes,she's,si push:y,ye,cee,say,says,sea,seas,see,sees,she,shes,she's,si put:cee,say,says,sea,seas,see,sees,she,shes,she's,si diff --git a/otp/chat/TalkAssistant.py b/otp/chat/TalkAssistant.py index 9ca1453a..f041e5df 100755 --- a/otp/chat/TalkAssistant.py +++ b/otp/chat/TalkAssistant.py @@ -147,7 +147,7 @@ class TalkAssistant(DirectObject.DirectObject): def findAvatarName(self, id): info = base.cr.identifyAvatar(id) - + return info.getName() if info else '' def whiteListFilterMessage(self, text): @@ -457,4 +457,4 @@ class TalkAssistant(DirectObject.DirectObject): self.historyComplete.append(newMessage) self.addToHistoryDoId(newMessage, localAvatar.doId) messenger.send('NewOpenMessage', [newMessage]) - return error + return error \ No newline at end of file diff --git a/otp/chat/WhiteList.py b/otp/chat/WhiteList.py index ca318d4b..94dc8b3c 100755 --- a/otp/chat/WhiteList.py +++ b/otp/chat/WhiteList.py @@ -37,4 +37,4 @@ class WhiteList: while j < self.numWords and self.words[j].startswith(text): j += 1 - return self.words[i:j] + return self.words[i:j] diff --git a/otp/distributed/AccountAI.py b/otp/distributed/AccountAI.py index 939fe0d8..64309a20 100755 --- a/otp/distributed/AccountAI.py +++ b/otp/distributed/AccountAI.py @@ -3,3 +3,4 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class AccountAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("AccountAI") + diff --git a/otp/distributed/AccountUD.py b/otp/distributed/AccountUD.py index 99adbece..4d473460 100755 --- a/otp/distributed/AccountUD.py +++ b/otp/distributed/AccountUD.py @@ -3,3 +3,4 @@ from direct.distributed.DistributedObjectUD import DistributedObjectUD class AccountUD(DistributedObjectUD): notify = DirectNotifyGlobal.directNotify.newCategory("AccountUD") + diff --git a/otp/distributed/DistributedDirectoryAI.py b/otp/distributed/DistributedDirectoryAI.py index e94b78ef..dcccb9fd 100755 --- a/otp/distributed/DistributedDirectoryAI.py +++ b/otp/distributed/DistributedDirectoryAI.py @@ -2,4 +2,4 @@ from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedDirectoryAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI") + notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI") \ No newline at end of file diff --git a/otp/distributed/DistributedDistrictUD.py b/otp/distributed/DistributedDistrictUD.py index 8ed7d0ce..4d23f3b1 100755 --- a/otp/distributed/DistributedDistrictUD.py +++ b/otp/distributed/DistributedDistrictUD.py @@ -9,3 +9,4 @@ class DistributedDistrictUD(DistributedObjectUD): def setAvailable(self, todo0): pass + diff --git a/otp/friends/FriendManagerAI.py b/otp/friends/FriendManagerAI.py index 82b33029..f51c1501 100755 --- a/otp/friends/FriendManagerAI.py +++ b/otp/friends/FriendManagerAI.py @@ -110,4 +110,4 @@ class FriendManagerAI(DistributedObjectAI): pass def inviteeCancelFriendQuery(self, todo0): - pass + pass \ No newline at end of file diff --git a/otp/level/AmbientSound.py b/otp/level/AmbientSound.py index fb23bfc4..c78d8acc 100755 --- a/otp/level/AmbientSound.py +++ b/otp/level/AmbientSound.py @@ -30,4 +30,4 @@ class AmbientSound(BasicEntities.NodePathEntity): self.soundIval.pause() del self.soundIval if hasattr(self, 'sound'): - del self.sound + del self.sound \ No newline at end of file diff --git a/otp/level/CollisionSolidEntity.py b/otp/level/CollisionSolidEntity.py index 03b77f9b..e11f3505 100755 --- a/otp/level/CollisionSolidEntity.py +++ b/otp/level/CollisionSolidEntity.py @@ -31,4 +31,4 @@ class CollisionSolidEntity(BasicEntities.NodePathEntity): if self.collNodePath is not None: self.collNodePath.removeNode() self.collNodePath = None - return + return \ No newline at end of file diff --git a/otp/level/DistributedEntityAI.py b/otp/level/DistributedEntityAI.py index 5b4969f2..2aca6fce 100755 --- a/otp/level/DistributedEntityAI.py +++ b/otp/level/DistributedEntityAI.py @@ -34,4 +34,4 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI, Entity.Entity return self.levelDoId def getEntId(self): - return self.entId + return self.entId \ No newline at end of file diff --git a/otp/level/DistributedInteractiveEntityAI.py b/otp/level/DistributedInteractiveEntityAI.py index 716b7617..978ed871 100755 --- a/otp/level/DistributedInteractiveEntityAI.py +++ b/otp/level/DistributedInteractiveEntityAI.py @@ -21,3 +21,4 @@ class DistributedInteractiveEntityAI(DistributedEntityAI): def setState(self, todo0, todo1): pass + diff --git a/otp/level/DistributedLevelAI.py b/otp/level/DistributedLevelAI.py index 3b62d964..7a8a3680 100755 --- a/otp/level/DistributedLevelAI.py +++ b/otp/level/DistributedLevelAI.py @@ -95,4 +95,4 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): av.takeDamage(penalty) if av.getHp() <= 0: av.inventory.zeroInv() - av.d_setInventory(av.inventory.makeNetString()) + av.d_setInventory(av.inventory.makeNetString()) \ No newline at end of file diff --git a/otp/level/Entity.py b/otp/level/Entity.py index 8e2e65bf..ac47b34d 100755 --- a/otp/level/Entity.py +++ b/otp/level/Entity.py @@ -84,4 +84,4 @@ class Entity(DirectObject): return def setAttribInit(self, attrib, value): - self.__dict__[attrib] = value + self.__dict__[attrib] = value \ No newline at end of file diff --git a/otp/level/EntrancePoint.py b/otp/level/EntrancePoint.py index 1ba2aa90..fedfab86 100755 --- a/otp/level/EntrancePoint.py +++ b/otp/level/EntrancePoint.py @@ -30,4 +30,4 @@ class EntrancePoint(BasicEntities.NodePathEntity): def destroyEntrancePoint(self): if self.entranceId >= 0: if self.entranceId in self.level.entranceId2entity: - del self.level.entranceId2entity[self.entranceId] + del self.level.entranceId2entity[self.entranceId] \ No newline at end of file diff --git a/otp/level/Level.py b/otp/level/Level.py index 1b2d16d9..c2859dae 100755 --- a/otp/level/Level.py +++ b/otp/level/Level.py @@ -216,4 +216,4 @@ class Level: self.createdEntIds.remove(entId) def handleVisChange(self): - pass + pass \ No newline at end of file diff --git a/otp/level/LevelConstants.py b/otp/level/LevelConstants.py index df5ddd00..b890c882 100755 --- a/otp/level/LevelConstants.py +++ b/otp/level/LevelConstants.py @@ -1,4 +1,4 @@ MinZoneNum = 0 MaxZoneNum = 999 UberZoneEntId = 0 -LevelMgrEntId = 1000 +LevelMgrEntId = 1000 \ No newline at end of file diff --git a/otp/level/LevelMgrAI.py b/otp/level/LevelMgrAI.py index 13700191..fa5fece2 100755 --- a/otp/level/LevelMgrAI.py +++ b/otp/level/LevelMgrAI.py @@ -30,4 +30,4 @@ class LevelMgrAI(LevelMgrBase.LevelMgrBase): zoneNums.sort() self.level.zoneIds = [] for zoneNum in zoneNums: - self.level.zoneIds.append(self.level.zoneNum2zoneId[zoneNum]) + self.level.zoneIds.append(self.level.zoneNum2zoneId[zoneNum]) \ No newline at end of file diff --git a/otp/level/LocatorEntity.py b/otp/level/LocatorEntity.py index e0f14dbc..6363e074 100755 --- a/otp/level/LocatorEntity.py +++ b/otp/level/LocatorEntity.py @@ -25,4 +25,4 @@ class LocatorEntity(Entity.Entity, NodePath): LocatorEntity.notify.warning("could not find '%s'" % self.searchPath) self.reparentTo(hidden) else: - self.reparentTo(parent) + self.reparentTo(parent) \ No newline at end of file diff --git a/otp/level/PathEntity.py b/otp/level/PathEntity.py index 54784e86..335d4edc 100755 --- a/otp/level/PathEntity.py +++ b/otp/level/PathEntity.py @@ -42,4 +42,4 @@ class PathEntity(BasicEntities.NodePathEntity): duration = distance / velocity track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint)) - return track + return track \ No newline at end of file diff --git a/otp/level/PropSpinner.py b/otp/level/PropSpinner.py index ced535ae..545e740b 100755 --- a/otp/level/PropSpinner.py +++ b/otp/level/PropSpinner.py @@ -49,4 +49,4 @@ class PropSpinner(Entity): def destroyProps(self): if hasattr(self, 'spinTracks'): self.spinTracks.pause() - del self.spinTracks + del self.spinTracks \ No newline at end of file diff --git a/otp/level/VisibilityExtender.py b/otp/level/VisibilityExtender.py index 1b840a16..2ad13657 100755 --- a/otp/level/VisibilityExtender.py +++ b/otp/level/VisibilityExtender.py @@ -41,4 +41,4 @@ class VisibilityExtender(Entity.Entity): def destroy(self): self.destroyVisExt() - Entity.Entity.destroy(self) + Entity.Entity.destroy(self) \ No newline at end of file diff --git a/otp/level/ZoneEntity.py b/otp/level/ZoneEntity.py index 8d7a55d9..dd4b697f 100755 --- a/otp/level/ZoneEntity.py +++ b/otp/level/ZoneEntity.py @@ -31,4 +31,4 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs): for zoneNum in zoneNumList: self.visibleZoneNums[zoneNum] -= 1 if self.visibleZoneNums[zoneNum] == 0: - del self.visibleZoneNums[zoneNum] + del self.visibleZoneNums[zoneNum] \ No newline at end of file diff --git a/otp/movement/CMover.py b/otp/movement/CMover.py index cc301c16..c450b542 100755 --- a/otp/movement/CMover.py +++ b/otp/movement/CMover.py @@ -1,8 +1,9 @@ from pandac.PandaModules import * class CMover: - + def __init__(self, objNodePath, fwdSpeed=1, rotSpeed=1): self.objNodePath = objNodePath self.fwdSpeed = fwdSpeed self.rotSpeed = rotSpeed + \ No newline at end of file diff --git a/otp/otpbase/OTPBase.py b/otp/otpbase/OTPBase.py index 89953ab6..be55e7a3 100755 --- a/otp/otpbase/OTPBase.py +++ b/otp/otpbase/OTPBase.py @@ -276,4 +276,4 @@ def backgroundColor(r=None, g=1, b=1, a=1): if r is None: r, g, b, a = OTPGlobals.DefaultBackgroundColor base.setBackgroundColor(Vec4(r, g, b, a)) - return 'The background color has been changed.' + return 'The background color has been changed.' \ No newline at end of file diff --git a/otp/otpbase/OTPGlobals.py b/otp/otpbase/OTPGlobals.py index 5c49cca4..24ef7a83 100755 --- a/otp/otpbase/OTPGlobals.py +++ b/otp/otpbase/OTPGlobals.py @@ -306,4 +306,4 @@ ChatFeedback_Whitelist = 64 ChatFeedback_OpenChat = 128 AvatarPendingCreate = -1 AvatarSlotUnavailable = -2 -AvatarSlotAvailable = -3 +AvatarSlotAvailable = -3 \ No newline at end of file diff --git a/toontown/ai/HalloweenHolidayDecorator.py b/toontown/ai/HalloweenHolidayDecorator.py index e55283fb..bdd1800f 100755 --- a/toontown/ai/HalloweenHolidayDecorator.py +++ b/toontown/ai/HalloweenHolidayDecorator.py @@ -37,7 +37,7 @@ class HalloweenHolidayDecorator(HolidayDecorator.HolidayDecorator): base.cr.playGame.getPlace().loader.hood.loader and hasattr(base.cr.playGame.getPlace().loader.hood.loader, 'geom') and base.cr.playGame.getPlace().loader.hood.loader.geom): - return True + return True else: if hasattr(base.cr.playGame, 'getPlace') and base.cr.playGame.getPlace(): self.notify.debug('Failed Hood Check %s' % base.cr.playGame.getPlace()) diff --git a/toontown/ai/NewsManager.py b/toontown/ai/NewsManager.py index eb9ac9ef..04fdb48f 100755 --- a/toontown/ai/NewsManager.py +++ b/toontown/ai/NewsManager.py @@ -515,11 +515,11 @@ class NewsManager(DistributedObject.DistributedObject): base.localAvatar.setSystemMessage(0, TTLocalizer.LaughingManHolidayStart) for currToon in base.cr.toons.values(): currToon.generateLaughingMan() - + def setLaughingManHolidayEnd(self): for currToon in base.cr.toons.values(): currToon.swapToonHead(laughingMan=currToon.getWantLaughingMan()) - + def setTopToonsMarathonStart(self): base.localAvatar.setSystemMessage(0, TTLocalizer.TopToonsMarathonStart) @@ -714,7 +714,7 @@ def getHoliday(id): return int(id) elif hasattr(ToontownGlobals, id): return getattr(ToontownGlobals, id) - + return -1 @magicWord(category=CATEGORY_PROGRAMMER, types=[str]) diff --git a/toontown/battle/BattleCalculatorAI.py b/toontown/battle/BattleCalculatorAI.py index 5be586e0..55964e51 100755 --- a/toontown/battle/BattleCalculatorAI.py +++ b/toontown/battle/BattleCalculatorAI.py @@ -98,7 +98,7 @@ class BattleCalculatorAI: debug = self.notify.getDebug() attack = self.battle.toonAttacks[attackIndex] atkTrack, atkLevel = self.__getActualTrackLevel(attack) - + hasAccuracyBuff = False toon = simbase.air.doId2do.get(attack[TOON_ID_COL]) if toon: @@ -106,7 +106,7 @@ class BattleCalculatorAI: if not ZoneUtil.isDynamicZone(toon.zoneId): if ZoneUtil.getWhereName(toon.zoneId, True) in ('street', 'factoryExterior', 'cogHQExterior'): hasAccuracyBuff = True - + if atkTrack == NPCSOS: return (1, 95) if atkTrack == FIRE: @@ -519,7 +519,7 @@ class BattleCalculatorAI: suit = self.battle.findSuit(targetId) if suit: slips = toon.getPinkSlips() - + if slips < 1: simbase.air.writeServerEvent('suspicious', toonId, 'Toon attempting to fire a cog without any pinkslips') else: diff --git a/toontown/battle/BattleManagerAI.py b/toontown/battle/BattleManagerAI.py index 542692ec..09c22520 100755 --- a/toontown/battle/BattleManagerAI.py +++ b/toontown/battle/BattleManagerAI.py @@ -38,4 +38,4 @@ class BattleManagerAI: cellId = battle.battleCellId self.notify.debug('BattleManager - destroying battle %d' % cellId) del self.cellId2battle[cellId] - battle.requestDelete() + battle.requestDelete() \ No newline at end of file diff --git a/toontown/battle/BattleParticles.py b/toontown/battle/BattleParticles.py index d5a1241d..15c6636d 100755 --- a/toontown/battle/BattleParticles.py +++ b/toontown/battle/BattleParticles.py @@ -146,4 +146,4 @@ def __makeShiftLift(): particles.emitter.setRadius(0.01) effect.setHpr(0, 180, 0) effect.setPos(0, 0, 0) - return effect + return effect \ No newline at end of file diff --git a/toontown/battle/BattleSounds.py b/toontown/battle/BattleSounds.py index 94dac20c..905ada38 100755 --- a/toontown/battle/BattleSounds.py +++ b/toontown/battle/BattleSounds.py @@ -43,4 +43,4 @@ class BattleSounds: return self.mgr.getSound(filename.getFullpath()) return self.mgr.getNullSound() -globalBattleSoundCache = BattleSounds() +globalBattleSoundCache = BattleSounds() \ No newline at end of file diff --git a/toontown/battle/DistributedBattleAI.py b/toontown/battle/DistributedBattleAI.py index 7be99f36..a29da21a 100755 --- a/toontown/battle/DistributedBattleAI.py +++ b/toontown/battle/DistributedBattleAI.py @@ -124,4 +124,4 @@ class DistributedBattleAI(DistributedBattleBaseAI.DistributedBattleBaseAI): DistributedBattleBaseAI.DistributedBattleBaseAI.enterResume(self) if self.finishCallback: self.finishCallback(self.zoneId) - self.battleMgr.destroy(self) + self.battleMgr.destroy(self) \ No newline at end of file diff --git a/toontown/battle/Movie.py b/toontown/battle/Movie.py index f98d6dd8..c3b3245b 100755 --- a/toontown/battle/Movie.py +++ b/toontown/battle/Movie.py @@ -311,9 +311,9 @@ class Movie(DirectObject.DirectObject): elif tutTrack >= len(earnedXp): self.playTutorialReward_2() return - + xp = earnedXp[tutTrack] - + if xp > 0: self.tutRewardDialog = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward1 % (xp, TTLocalizer.BattleGlobalTracks[tutTrack].capitalize()), command=self.playTutorialReward_1, extraArgs=[earnedXp, tutTrack + 1], style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8) sequence = Sequence() @@ -321,7 +321,7 @@ class Movie(DirectObject.DirectObject): sequence.start() else: self.playTutorialReward_1(None, earnedXp, tutTrack + 1) - + def playTutorialReward_2(self, value=None): from toontown.toon import Toon from toontown.toon import ToonDNA diff --git a/toontown/battle/MovieFire.py b/toontown/battle/MovieFire.py index cf7b7813..eba46f0b 100755 --- a/toontown/battle/MovieFire.py +++ b/toontown/battle/MovieFire.py @@ -342,4 +342,4 @@ ActorInterval(kapow, 'kapow'), Func(kapow.hide)), LerpPosInterval(suit, 3.0, Poi return [toonTrack, soundTrack, buttonTrack, - suitResponseTrack] + suitResponseTrack] \ No newline at end of file diff --git a/toontown/battle/MovieSquirt.py b/toontown/battle/MovieSquirt.py index 77592ac3..9866c94d 100755 --- a/toontown/battle/MovieSquirt.py +++ b/toontown/battle/MovieSquirt.py @@ -745,4 +745,4 @@ squirtfn_array = (__doFlower, __doSeltzerBottle, __doFireHose, __doStormCloud, - __doGeyser) + __doGeyser) \ No newline at end of file diff --git a/toontown/battle/ParticleDefs.py b/toontown/battle/ParticleDefs.py index 234e1c20..02db034b 100755 --- a/toontown/battle/ParticleDefs.py +++ b/toontown/battle/ParticleDefs.py @@ -4902,3 +4902,5 @@ def bossCogFrontAttack(self): force0.setActive(1) f0.addForce(force0) self.addForceGroup(f0) + + diff --git a/toontown/building/DistributedBoardingPartyAI.py b/toontown/building/DistributedBoardingPartyAI.py index 678a162a..fde21ef9 100755 --- a/toontown/building/DistributedBoardingPartyAI.py +++ b/toontown/building/DistributedBoardingPartyAI.py @@ -96,7 +96,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi # to merge groups. # mergeDict - This is a link that points back to the original # invitee before we mapped it to the leader of the other group. - + def requestInvite(self, inviteeId): self.notify.debug('requestInvite %s' % inviteeId) inviterId = self.air.getAvatarIdFromSender() @@ -167,7 +167,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi reason = BoardingPartyBase.BOARDCODE_PROMOTION self.sendUpdateToAvatarId(inviterId, 'postInviteNotQualify', [inviterId, reason, self.elevatorIdList[0]]) return - # Is the inviter already in the avIdDict? It follows they either must be in a group or have a pending invite... + # Is the inviter already in the avIdDict? It follows they either must be in a group or have a pending invite... if inviterId in self.avIdDict: self.notify.debug('old group') # Everything is indexed by the leaders @@ -184,7 +184,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi if len(self.getGroupMemberList(leaderId)) >= self.maxSize: self.sendUpdate('postSizeReject', [leaderId, inviterId, inviteeId]) elif merger: - # We cannot muck with the avIdDict because they are pointing to their original groups. + # We cannot muck with the avIdDict because they are pointing to their original groups. # We shall stash away the info into a different # dictionary.. This way, if something goes wrong, # the original groups with their original data @@ -195,12 +195,12 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi self.mergeDict[inviteeId] = originalInviteeId self.sendUpdateToAvatarId(inviteeId, 'postInvite', [leaderId, inviterId, True]) # notify everybody in the inviters group of the - # invitation.. + # invitation.. for memberId in groupList[0]: if not memberId == inviterId: self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId]) elif inviterId not in groupList[1] and inviterId not in groupList[2]: - # If the invitee isn't already in the group, add them.. + # If the invitee isn't already in the group, add them.. if inviteeId not in groupList[1]: groupList[1].append(inviteeId) self.groupListDict[leaderId] = groupList @@ -213,7 +213,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi for memberId in groupList[0]: if not memberId == inviterId: self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId]) - # The inviter was kicked.. so, we cannot let them back in since they are not the leader... + # The inviter was kicked.. so, we cannot let them back in since they are not the leader... elif inviterId in groupList[2]: self.sendUpdate('postKickReject', [leaderId, inviterId, inviteeId]) else: diff --git a/toontown/building/DistributedBuildingAI.py b/toontown/building/DistributedBuildingAI.py index 5e3e5ace..b4c506e7 100755 --- a/toontown/building/DistributedBuildingAI.py +++ b/toontown/building/DistributedBuildingAI.py @@ -144,9 +144,9 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): print 'Building %s (%s): cogdoTakeOver' % (self.doId, self.zoneId) if not self.isToonBlock(): return None - + self.updateSavedBy(None) - + self.track = track self.realTrack = track self.difficulty = difficulty @@ -321,21 +321,21 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): toon = None if t: toon = self.getToon(t) - + if toon != None: activeToons.append(toon) continue - + for t in victorList: toon = None if t: toon = self.getToon(t) self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track, self.numFloors, self.zoneId, victorList)) - + if toon != None: self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons, 1) continue - + victorList.extend([None, None, None, None]) for i in range(0, 4): victor = victorList[i] @@ -345,7 +345,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): event = self.air.getAvatarExitEvent(victor) self.accept(event, self.setVictorExited, extraArgs = [ victor]) - + self.b_setVictorList(victorList[:4]) self.updateSavedBy(savedBy) self.victorResponses = [ diff --git a/toontown/building/DistributedCJElevatorAI.py b/toontown/building/DistributedCJElevatorAI.py index 1c63809f..23930989 100755 --- a/toontown/building/DistributedCJElevatorAI.py +++ b/toontown/building/DistributedCJElevatorAI.py @@ -7,3 +7,4 @@ class DistributedCJElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorA DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle, minLaff=minLaff) self.type = ELEVATOR_CJ self.countdownTime = ElevatorData[self.type]['countdown'] + diff --git a/toontown/building/DistributedElevatorIntAI.py b/toontown/building/DistributedElevatorIntAI.py index 55631ee2..7b116d06 100755 --- a/toontown/building/DistributedElevatorIntAI.py +++ b/toontown/building/DistributedElevatorIntAI.py @@ -11,7 +11,7 @@ from direct.directnotify import DirectNotifyGlobal from toontown.battle import BattleBase class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI): - + def __init__(self, air, bldg, avIds): DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg) self.countdownTime = simbase.config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME) @@ -35,7 +35,7 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI): numFullSeats = self.countFullSeats() if not numFullSeats <= len(self.avIds): self.notify.warning('we are about to crash. self.seats=%s self.avIds=%s' % (self.seats, self.avIds)) - + if numFullSeats == len(self.avIds): self.fsm.request('allAboard') @@ -133,4 +133,4 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI): def enterClosed(self): DistributedElevatorAI.DistributedElevatorAI.enterClosed(self) - self.__doorsClosed() + self.__doorsClosed() \ No newline at end of file diff --git a/toontown/building/DistributedToonHallInterior.py b/toontown/building/DistributedToonHallInterior.py index 8fd4fb29..7fe4d11b 100755 --- a/toontown/building/DistributedToonHallInterior.py +++ b/toontown/building/DistributedToonHallInterior.py @@ -40,7 +40,7 @@ class DistributedToonHallInterior(DistributedToonInterior): self.interior.flattenMedium() for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase.DistributedNPCToonBase): npcToon.initToonState() - + self.createSillyMeter() def createSillyMeter(self): @@ -83,19 +83,19 @@ class DistributedToonHallInterior(DistributedToonInterior): self.arrowSfx = self.audio3d.loadSfx('phase_4/audio/sfx/tt_s_prp_sillyMeterArrow.ogg') self.arrowSfx.setLoop(False) self.audio3d.setDropOffFactor(0.1) - + self.startSillyMeter(config.GetInt('silly-meter-phase', 12)) - + def startSillyMeter(self, phase): self.stopSillyMeter() - + if hasattr(self, 'enterPhase%s' % phase): getattr(self, 'enterPhase%s' % phase)() self.phase = phase - + def stopSillyMeter(self): if hasattr(self, 'phase') and hasattr(self, 'exitPhase%s' % self.phase): - getattr(self, 'exitPhase%s' % self.phase)() + getattr(self, 'exitPhase%s' % self.phase)() def enterPhase0(self): self.animSeq = Parallel(ActorInterval(self.sillyMeter, 'arrowTube', partName='arrow', duration=604800, constrainedLoop=1, startFrame=1, endFrame=30), Sequence(Func(self.phase1Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase1Sfx, self.sillyMeter))) @@ -421,9 +421,9 @@ def sillyPhase(phase): """ Set the silly meter phase. """ - + if phase < -1 or phase > 14: return 'Phase number must be between 0 and 14!' - + messenger.send('SillyMeterPhase', [phase]) - return 'Successfully set the silly meter phase!' + return 'Successfully set the silly meter phase!' \ No newline at end of file diff --git a/toontown/building/DoorTypes.py b/toontown/building/DoorTypes.py index 97e85de4..325710b9 100755 --- a/toontown/building/DoorTypes.py +++ b/toontown/building/DoorTypes.py @@ -7,4 +7,4 @@ INT_HOUSE = 6 EXT_COGHQ = 7 INT_COGHQ = 8 EXT_KS = 9 -INT_KS = 10 +INT_KS = 10 \ No newline at end of file diff --git a/toontown/building/PetshopBuildingAI.py b/toontown/building/PetshopBuildingAI.py index da14a164..b77f9f69 100755 --- a/toontown/building/PetshopBuildingAI.py +++ b/toontown/building/PetshopBuildingAI.py @@ -35,7 +35,7 @@ class PetshopBuildingAI: self.interior.generateWithRequired(self.interiorZone) self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone) - + door = DistributedDoorAI.DistributedDoorAI( self.air, blockNumber, DoorTypes.EXT_STANDARD) insideDoor = DistributedDoorAI.DistributedDoorAI( @@ -50,4 +50,4 @@ class PetshopBuildingAI: self.insideDoor = insideDoor def createPet(self, ownerId, seed): - return + return \ No newline at end of file diff --git a/toontown/building/SuitBuildingGlobals.py b/toontown/building/SuitBuildingGlobals.py index f606ea5c..ffc29c64 100755 --- a/toontown/building/SuitBuildingGlobals.py +++ b/toontown/building/SuitBuildingGlobals.py @@ -201,7 +201,7 @@ buildingMinMax = { ToontownGlobals.PajamaPlace: [config.GetInt('pajama-place-building-min', 6), config.GetInt('pajama-place-building-max', 12)], ToontownGlobals.RockAByeRoad: [config.GetInt('rock-a-bye-road-building-min', 6), - config.GetInt('rock-a-bye-road-building-max', 12)], + config.GetInt('rock-a-bye-road-building-max', 12)], ToontownGlobals.SellbotHQ: [0, 0], ToontownGlobals.SellbotFactoryExt: [0, 0], ToontownGlobals.CashbotHQ: [0, 0], diff --git a/toontown/catalog/AccountDate.py b/toontown/catalog/AccountDate.py index 32f37780..610227e1 100755 --- a/toontown/catalog/AccountDate.py +++ b/toontown/catalog/AccountDate.py @@ -5,7 +5,7 @@ from datetime import datetime class AccountDate(DistributedObject): neverDisable = 1 notify = directNotify.newCategory('AccountDate') - + def __init__(self, cr): DistributedObject.__init__(self, cr) self.accountDays = 0 @@ -20,20 +20,20 @@ class AccountDate(DistributedObject): if base.cr.accountDateMgr is self: del base.cr.accountDateMgr DistributedObject.delete(self) - + def getAccountDays(self): return self.accountDays - + def requestDate(self, task=None): self.sendUpdate('requestDate') - + if task is not None: return task.done - + def requestDateResult(self, result): if result is None: notify.warning('Invalid response from server.') self.accountDays = 0 else: date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y") - self.accountDays = (datetime.now() - date).days + self.accountDays = (datetime.now() - date).days \ No newline at end of file diff --git a/toontown/catalog/AccountDateAI.py b/toontown/catalog/AccountDateAI.py index dd96e7f5..654048ea 100755 --- a/toontown/catalog/AccountDateAI.py +++ b/toontown/catalog/AccountDateAI.py @@ -3,21 +3,21 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class AccountDateAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI") - + def announceGenerate(self): DistributedObjectAI.announceGenerate(self) - + def requestDate(self): avId = self.air.getAvatarIdFromSender() av = self.air.doId2do.get(avId) if not av: return - + def callback(dclass, fields): if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'): self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')]) else: self.sendUpdateToAvatarId(avId, 'requestDateResult', [None]) - - self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback) + + self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback) \ No newline at end of file diff --git a/toontown/catalog/CatalogAccessoryItem.py b/toontown/catalog/CatalogAccessoryItem.py index 92b1caa9..366fa278 100755 --- a/toontown/catalog/CatalogAccessoryItem.py +++ b/toontown/catalog/CatalogAccessoryItem.py @@ -408,4 +408,4 @@ def getAllAccessories(*accessoryTypes): base = CatalogAccessoryItem(accessoryType) list.append(base) - return list + return list \ No newline at end of file diff --git a/toontown/catalog/CatalogAccessoryItemGlobals.py b/toontown/catalog/CatalogAccessoryItemGlobals.py index db1652dd..c87f58d6 100755 --- a/toontown/catalog/CatalogAccessoryItemGlobals.py +++ b/toontown/catalog/CatalogAccessoryItemGlobals.py @@ -739,4 +739,4 @@ AccessoryTypes = {101: (AHat, 449: (AShoes, 'shw2', APriceCool, - 7)} + 7)} \ No newline at end of file diff --git a/toontown/catalog/CatalogClothingItem.py b/toontown/catalog/CatalogClothingItem.py index ba741337..2a1ef3b7 100755 --- a/toontown/catalog/CatalogClothingItem.py +++ b/toontown/catalog/CatalogClothingItem.py @@ -580,4 +580,4 @@ def getAllClothes(*clothingTypes): for n in range(1, len(base.getColorChoices())): list.append(CatalogClothingItem(clothingType, n)) - return list + return list \ No newline at end of file diff --git a/toontown/catalog/CatalogEmoteItem.py b/toontown/catalog/CatalogEmoteItem.py index 7e139110..fa173bc6 100755 --- a/toontown/catalog/CatalogEmoteItem.py +++ b/toontown/catalog/CatalogEmoteItem.py @@ -124,4 +124,4 @@ class CatalogEmoteItem(CatalogItem.CatalogItem): dg.addBool(self.isSpecial) def isGift(self): - return not self.getEmblemPrices() + return not self.getEmblemPrices() \ No newline at end of file diff --git a/toontown/catalog/CatalogFurnitureItem.py b/toontown/catalog/CatalogFurnitureItem.py index 80e0c4be..50e4c7d8 100755 --- a/toontown/catalog/CatalogFurnitureItem.py +++ b/toontown/catalog/CatalogFurnitureItem.py @@ -1131,12 +1131,12 @@ def nextAvailableCloset(avatar, duplicateItems): def nextAvailableBank(avatar, duplicateItems): if not avatar.getMaxBankMoney() in MoneyToBank: return CatalogFurnitureItem(1300) - + currentBank = MoneyToBank[avatar.getMaxBankMoney()] - + if currentBank == MaxBankId: return - + return CatalogFurnitureItem(currentBank + 10) def get50ItemCloset(avatar, duplicateItems): @@ -1168,10 +1168,10 @@ def getAllClosets(): def getAllBanks(): list = [] - + for bankId in BankToMoney.keys(): list.append(CatalogFurnitureItem(bankId)) - + return list def get50ItemTrunk(avatar, duplicateItems): diff --git a/toontown/catalog/CatalogGenerator.py b/toontown/catalog/CatalogGenerator.py index 73dccde5..b430fbb9 100755 --- a/toontown/catalog/CatalogGenerator.py +++ b/toontown/catalog/CatalogGenerator.py @@ -1540,10 +1540,10 @@ class CatalogGenerator: if nextAvailableCloset not in schedule: weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0) - + if nextAvailableBank not in schedule: weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0) - + weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0) if time.time() < 1096617600.0: diff --git a/toontown/catalog/CatalogHouseItem.py b/toontown/catalog/CatalogHouseItem.py index 35b539ed..fe1d3faa 100755 --- a/toontown/catalog/CatalogHouseItem.py +++ b/toontown/catalog/CatalogHouseItem.py @@ -9,10 +9,10 @@ class CatalogHouseItem(CatalogItem.CatalogItem): def makeNewItem(self, houseId): self.houseId = houseId CatalogItem.CatalogItem.makeNewItem(self) - + def notOfferedTo(self, avatar): return 1 - + def requestPurchase(self, phone, callback): from toontown.toontowngui import TTDialog avatar = base.localAvatar @@ -43,16 +43,16 @@ class CatalogHouseItem(CatalogItem.CatalogItem): def getDeliveryTime(self): return 0 - + def getEmblemPrices(self): return HouseGlobals.HouseEmblemPrices[self.houseId] - + def getPicture(self, avatar): model = loader.loadModel(HouseGlobals.houseModels[self.houseId]) model.setBin('unsorted', 0, 1) self.hasPicture = True return self.makeFrameModel(model) - + def decodeDatagram(self, di, versionNumber, store): CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) self.houseId = di.getUint8() @@ -60,12 +60,13 @@ class CatalogHouseItem(CatalogItem.CatalogItem): def encodeDatagram(self, dg, store): CatalogItem.CatalogItem.encodeDatagram(self, dg, store) dg.addUint8(self.houseId) - + def recordPurchase(self, av, optional): house = simbase.air.doId2do.get(av.getHouseId()) if house: house.b_setHouseType(self.houseId) return ToontownGlobals.P_ItemAvailable - + def getAllHouses(): return [CatalogHouseItem(i) for i in xrange(6)] + diff --git a/toontown/catalog/CatalogManagerAI.py b/toontown/catalog/CatalogManagerAI.py index f1b12ccb..92b2cddd 100755 --- a/toontown/catalog/CatalogManagerAI.py +++ b/toontown/catalog/CatalogManagerAI.py @@ -6,7 +6,7 @@ import time class CatalogManagerAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("CatalogManagerAI") - + def __init__(self, air): DistributedObjectAI.__init__(self, air) self.catalogGenerator = CatalogGenerator() @@ -15,8 +15,8 @@ class CatalogManagerAI(DistributedObjectAI): avId = self.air.getAvatarIdFromSender() av = self.air.doId2do.get(avId) if av: - self.deliverCatalogFor(av) - + self.deliverCatalogFor(av) + def deliverCatalogFor(self, av): monthlyCatalog = self.catalogGenerator.generateMonthlyCatalog(av, time.time() / 60) newWeek = (av.catalogScheduleCurrentWeek + 1) % ToontownGlobals.CatalogNumWeeks @@ -25,3 +25,4 @@ class CatalogManagerAI(DistributedObjectAI): av.b_setCatalog(monthlyCatalog, weeklyCatalog, backCatalog) av.b_setCatalogSchedule(newWeek, int((time.time() + 604800)/60)) av.b_setCatalogNotify(ToontownGlobals.NewItems, av.mailboxNotify) + diff --git a/toontown/catalog/CatalogScreen.py b/toontown/catalog/CatalogScreen.py index 81d469ec..36eb9d3c 100755 --- a/toontown/catalog/CatalogScreen.py +++ b/toontown/catalog/CatalogScreen.py @@ -614,7 +614,7 @@ class CatalogScreen(DirectFrame): if item in allBankItems and item.furnitureType == CatalogFurnitureItem.MaxBankId: isMaxBankOffered = True break - + for item in itemList: if isinstance(item, CatalogInvalidItem.CatalogInvalidItem): self.notify.warning('skipping catalog invalid item %s' % item) @@ -972,13 +972,13 @@ class CatalogScreen(DirectFrame): if not self.clarabelleChatBalloon: self.clarabelleChatBalloon = loader.loadModel('phase_3/models/props/chatbox') - + self.clarabelleChat = CatalogChatBalloon.CatalogChatBalloon(self.clarabelleChatBalloon) chatNode = self.clarabelleChat.generate(str, ToontownGlobals.getInterfaceFont())[0] self.clarabelleChatNP = self.attachNewNode(chatNode.node(), 1000) self.clarabelleChatNP.setScale(0.08) self.clarabelleChatNP.setPos(0.7, 0, 0.6) - + if timeout: taskMgr.doMethodLater(timeout, self.clearClarabelleChat, 'clearClarabelleChat') diff --git a/toontown/catalog/CatalogSurfaceItem.py b/toontown/catalog/CatalogSurfaceItem.py index 62691408..f9c3f1a9 100755 --- a/toontown/catalog/CatalogSurfaceItem.py +++ b/toontown/catalog/CatalogSurfaceItem.py @@ -32,3 +32,4 @@ class CatalogSurfaceItem(CatalogAtticItem.CatalogAtticItem): def getDeliveryTime(self): return 1 + diff --git a/toontown/catalog/MailboxScreen.py b/toontown/catalog/MailboxScreen.py index e2236f04..dbafd661 100755 --- a/toontown/catalog/MailboxScreen.py +++ b/toontown/catalog/MailboxScreen.py @@ -512,5 +512,5 @@ class MailboxScreen(DirectObject.DirectObject): def getSenderName(self, avId): sender = base.cr.identifyFriend(avId) - - return sender.getName() if sender else TTLocalizer.MailboxGiftTagAnonymous + + return sender.getName() if sender else TTLocalizer.MailboxGiftTagAnonymous \ No newline at end of file diff --git a/toontown/chat/TTTalkAssistant.py b/toontown/chat/TTTalkAssistant.py index 863b6b12..bf6d4b63 100755 --- a/toontown/chat/TTTalkAssistant.py +++ b/toontown/chat/TTTalkAssistant.py @@ -31,4 +31,4 @@ class TTTalkAssistant(TalkAssistant): toNpcId, toonProgress, msgIndex]) - return error + return error \ No newline at end of file diff --git a/toontown/cogdominium/CogdoCraneGame.py b/toontown/cogdominium/CogdoCraneGame.py index 6c2a8ed7..653012dc 100755 --- a/toontown/cogdominium/CogdoCraneGame.py +++ b/toontown/cogdominium/CogdoCraneGame.py @@ -71,4 +71,4 @@ class CogdoCraneGame(DirectObject): del self.toonId2Player[player.toon.doId] def handleToonLeft(self, toonId): - self._removePlayer(self.toonId2Player[toonId]) + self._removePlayer(self.toonId2Player[toonId]) \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoFlyingGameAI.py b/toontown/cogdominium/DistCogdoFlyingGameAI.py index 500004b8..013a06eb 100755 --- a/toontown/cogdominium/DistCogdoFlyingGameAI.py +++ b/toontown/cogdominium/DistCogdoFlyingGameAI.py @@ -59,7 +59,7 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI): damage = int(20 * self.getDifficulty()) self.__damage(av, damage) else: - self.notify.warning('Client requested unknown action \'%s\'' %action) + self.notify.warning('Client requested unknown action \'%s\'' %action) def requestPickUp(self, pickupNum, pickupType): avId = self.air.getAvatarIdFromSender() @@ -74,7 +74,7 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI): if pickupType == Globals.Level.GatherableTypes.Memo: self.totalMemos += 1 else: - self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType) + self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType) def handleStart(self): for toon in self.toons: diff --git a/toontown/cogdominium/DistributedCogdoInterior.py b/toontown/cogdominium/DistributedCogdoInterior.py index f2744066..ab1d7bb3 100755 --- a/toontown/cogdominium/DistributedCogdoInterior.py +++ b/toontown/cogdominium/DistributedCogdoInterior.py @@ -229,7 +229,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): def isBossFloor(self, floorNum): if not self.layout.hasBossBattle(): return False - + return (self.layout.getBossBattleFloor() + 0) == floorNum def __cleanup(self): @@ -799,7 +799,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): if self.FOType == "l": speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot - + else: speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName diff --git a/toontown/coghq/ActiveCell.py b/toontown/coghq/ActiveCell.py index 3f4d9aba..b576b8c7 100755 --- a/toontown/coghq/ActiveCell.py +++ b/toontown/coghq/ActiveCell.py @@ -31,4 +31,4 @@ class ActiveCell(BasicEntities.DistributedNodePathEntity): def setState(self, state, objId): self.state = state - self.occupantId = objId + self.occupantId = objId \ No newline at end of file diff --git a/toontown/coghq/BarrelBase.py b/toontown/coghq/BarrelBase.py index a269455b..ac3b09ec 100755 --- a/toontown/coghq/BarrelBase.py +++ b/toontown/coghq/BarrelBase.py @@ -28,4 +28,4 @@ class BarrelBase: self._gagTrack = self.getRng().choice(tracks) else: self._gagTrack = self.gagTrack - return self._gagTrack + return self._gagTrack \ No newline at end of file diff --git a/toontown/coghq/BattleBlocker.py b/toontown/coghq/BattleBlocker.py index ea1f9f18..7babece6 100755 --- a/toontown/coghq/BattleBlocker.py +++ b/toontown/coghq/BattleBlocker.py @@ -86,4 +86,4 @@ class BattleBlocker(BasicEntities.DistributedNodePathEntity): track = Sequence() if callback: track.append(Func(callback)) - track.start() + track.start() \ No newline at end of file diff --git a/toontown/coghq/BattleBlockerAI.py b/toontown/coghq/BattleBlockerAI.py index 04e1b4b5..b633f395 100755 --- a/toontown/coghq/BattleBlockerAI.py +++ b/toontown/coghq/BattleBlockerAI.py @@ -63,4 +63,4 @@ class BattleBlockerAI(DistributedEntityAI.DistributedEntityAI): messenger.send(self.getOutputEventName(), [1]) def d_setBattleFinished(self): - self.sendUpdate('setBattleFinished', []) + self.sendUpdate('setBattleFinished', []) \ No newline at end of file diff --git a/toontown/coghq/BossbotCogHQLoader.py b/toontown/coghq/BossbotCogHQLoader.py index d1e6acea..5f5aee0d 100755 --- a/toontown/coghq/BossbotCogHQLoader.py +++ b/toontown/coghq/BossbotCogHQLoader.py @@ -132,4 +132,4 @@ class BossbotCogHQLoader(CogHQLoader.CogHQLoader): self.exitPlace() self.placeClass = None del self.countryClubId - return + return \ No newline at end of file diff --git a/toontown/coghq/ConveyorBelt.py b/toontown/coghq/ConveyorBelt.py index 5705364e..e5fc0b22 100755 --- a/toontown/coghq/ConveyorBelt.py +++ b/toontown/coghq/ConveyorBelt.py @@ -98,4 +98,4 @@ class ConveyorBelt(BasicEntities.NodePathEntity): del self.tailClipPath self.clearClipPlane() for tread in self.treads: - tread.parentingNode.clearClipPlane() + tread.parentingNode.clearClipPlane() \ No newline at end of file diff --git a/toontown/coghq/CountryClubRoomBase.py b/toontown/coghq/CountryClubRoomBase.py index cac432ac..4b21f8de 100755 --- a/toontown/coghq/CountryClubRoomBase.py +++ b/toontown/coghq/CountryClubRoomBase.py @@ -13,4 +13,4 @@ class CountryClubRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack + return self.cogTrack \ No newline at end of file diff --git a/toontown/coghq/DistributedBarrelBaseAI.py b/toontown/coghq/DistributedBarrelBaseAI.py index 06e3f24b..f6f6da73 100755 --- a/toontown/coghq/DistributedBarrelBaseAI.py +++ b/toontown/coghq/DistributedBarrelBaseAI.py @@ -27,4 +27,4 @@ class DistributedBarrelBaseAI(DistributedEntityAI.DistributedEntityAI, BarrelBas self.sendUpdate('setReject') def d_setGrab(self, avId): - self.sendUpdate('setGrab', [avId]) + self.sendUpdate('setGrab', [avId]) \ No newline at end of file diff --git a/toontown/coghq/DistributedCogKart.py b/toontown/coghq/DistributedCogKart.py index 9070dc3d..6319e012 100755 --- a/toontown/coghq/DistributedCogKart.py +++ b/toontown/coghq/DistributedCogKart.py @@ -372,4 +372,4 @@ class DistributedCogKart(DistributedElevatorExt.DistributedElevatorExt): elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntB: return TTLocalizer.ElevatorBossBotCourse1 elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntC: - return TTLocalizer.ElevatorBossBotCourse2 + return TTLocalizer.ElevatorBossBotCourse2 \ No newline at end of file diff --git a/toontown/coghq/DistributedCrusherEntityAI.py b/toontown/coghq/DistributedCrusherEntityAI.py index 19a5a5d3..c4bdefef 100755 --- a/toontown/coghq/DistributedCrusherEntityAI.py +++ b/toontown/coghq/DistributedCrusherEntityAI.py @@ -5,33 +5,33 @@ from direct.directnotify import DirectNotifyGlobal class DistributedCrusherEntityAI(DistributedEntityAI.DistributedEntityAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedCrusherEntityAI') - + def __init__(self, level, entId): self.isCrusher = 0 self.crushCell = None DistributedEntityAI.DistributedEntityAI.__init__(self, level, entId) self.crushMsg = self.getUniqueName('crusherDoCrush') - + def generate(self): DistributedEntityAI.DistributedEntityAI.generate(self) self.setActiveCrushCell() - + def delete(self): self.ignoreAll() DistributedEntityAI.DistributedEntityAI.delete(self) - + def destroy(self): self.notify.info('destroy entity %s' % self.entId) if self.crushCell != None: self.crushCell.unregisterCrusher(self.entId) self.crushCell = None - + DistributedEntityAI.DistributedEntityAI.destroy(self) - + def setActiveCrushCell(self): self.notify.debug('setActiveCrushCell, entId: %d' % self.entId) if self.crushCellId != None: @@ -41,17 +41,17 @@ class DistributedCrusherEntityAI(DistributedEntityAI.DistributedEntityAI): else: self.isCrusher = 1 self.crushCell.registerCrusher(self.entId) + - - + def sendCrushMsg(self, axis = 0): if self.isCrusher: messenger.send(self.crushMsg, [ self.entId, axis]) + - - + def getPosition(self): if hasattr(self, 'pos'): return self.pos diff --git a/toontown/coghq/DistributedDoorEntity.py b/toontown/coghq/DistributedDoorEntity.py index 7f9286a2..2d5f6412 100755 --- a/toontown/coghq/DistributedDoorEntity.py +++ b/toontown/coghq/DistributedDoorEntity.py @@ -442,4 +442,4 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase, self.doorLeft.unstash() self.doorRight.unstash() self.doorLeft.setPos(Vec3(0.0)) - self.doorRight.setPos(Vec3(0.0)) + self.doorRight.setPos(Vec3(0.0)) \ No newline at end of file diff --git a/toontown/coghq/DistributedDoorEntityAI.py b/toontown/coghq/DistributedDoorEntityAI.py index 443c7253..2c2a0a3c 100755 --- a/toontown/coghq/DistributedDoorEntityAI.py +++ b/toontown/coghq/DistributedDoorEntityAI.py @@ -206,4 +206,4 @@ class DistributedDoorEntityAI(DistributedDoorEntityBase.DistributedDoorEntityBas def requestOpen(self): if self.isUnlocked(): if self.fsm.getCurrentState() is not self.states[2]: - self.fsm.request(self.states[1]) + self.fsm.request(self.states[1]) \ No newline at end of file diff --git a/toontown/coghq/DistributedLawOfficeFloorAI.py b/toontown/coghq/DistributedLawOfficeFloorAI.py index 98182b5f..6385d28b 100755 --- a/toontown/coghq/DistributedLawOfficeFloorAI.py +++ b/toontown/coghq/DistributedLawOfficeFloorAI.py @@ -124,4 +124,4 @@ class DistributedLawOfficeFloorAI(DistributedLevelAI.DistributedLevelAI, LawOffi suitIds = [] for suit in self.reserveSuits: suitIds.append(suit[0].doId) - return suitIds + return suitIds \ No newline at end of file diff --git a/toontown/coghq/DistributedLift.py b/toontown/coghq/DistributedLift.py index 18ad914c..c8e02291 100755 --- a/toontown/coghq/DistributedLift.py +++ b/toontown/coghq/DistributedLift.py @@ -199,4 +199,4 @@ class DistributedLift(BasicEntities.DistributedNodePathEntity): self.notify.debug('enterWaiting') def exitWaiting(self): - pass + pass \ No newline at end of file diff --git a/toontown/coghq/DistributedMegaCorp.py b/toontown/coghq/DistributedMegaCorp.py index 6d35f2d0..b0b47006 100755 --- a/toontown/coghq/DistributedMegaCorp.py +++ b/toontown/coghq/DistributedMegaCorp.py @@ -6,6 +6,6 @@ class DistributedMegaCorp(DistributedFactory.DistributedFactory): def __init__(self, cr): DistributedFactory.DistributedFactory.__init__(self, cr) - + def getFloorOuchLevel(self): return 8 diff --git a/toontown/coghq/DistributedMintRoomAI.py b/toontown/coghq/DistributedMintRoomAI.py index c0adb380..60216f6c 100755 --- a/toontown/coghq/DistributedMintRoomAI.py +++ b/toontown/coghq/DistributedMintRoomAI.py @@ -128,4 +128,4 @@ class DistributedMintRoomAI(DistributedLevelAI.DistributedLevelAI, MintRoomBase. mint.allToonsGone() else: self.notify.warning('no mint %s in allToonsGone' % self.mintDoId) - return + return \ No newline at end of file diff --git a/toontown/coghq/DistributedSellbotHQDoorAI.py b/toontown/coghq/DistributedSellbotHQDoorAI.py index 0bfb895c..40fbe4ea 100755 --- a/toontown/coghq/DistributedSellbotHQDoorAI.py +++ b/toontown/coghq/DistributedSellbotHQDoorAI.py @@ -6,3 +6,4 @@ class DistributedSellbotHQDoorAI(DistributedCogHQDoorAI): def informPlayer(self, todo0): pass + diff --git a/toontown/coghq/DistributedStomper.py b/toontown/coghq/DistributedStomper.py index 7eedd706..dd5fac9c 100755 --- a/toontown/coghq/DistributedStomper.py +++ b/toontown/coghq/DistributedStomper.py @@ -344,4 +344,4 @@ class DistributedStomper(DistributedCrusherEntity.DistributedCrusherEntity): yRange = 5 if tPos[2] < zRange and tPos[2] > -zRange and tPos[0] < xRange and tPos[0] > -xRange and tPos[1] < yRange / 10.0 and tPos[1] > -yRange: self.level.b_setOuch(self.damage, 'Squish') - base.localAvatar.setZ(self.getZ(render) + 0.025) + base.localAvatar.setZ(self.getZ(render) + 0.025) \ No newline at end of file diff --git a/toontown/coghq/DistributedStomperAI.py b/toontown/coghq/DistributedStomperAI.py index 0f1033c7..2bc71c40 100755 --- a/toontown/coghq/DistributedStomperAI.py +++ b/toontown/coghq/DistributedStomperAI.py @@ -35,7 +35,7 @@ class DistributedStomperAI(DistributedCrusherEntityAI.DistributedCrusherEntityAI for id in self.crushCell.occupantIds: if id in self.crushCell.crushables: crushedList.append(id) - + self.sendCrushMsg() self.sendUpdate('setMovie', [StomperGlobals.STOMPER_STOMP, ClockDelta.globalClockDelta.getRealNetworkTime(), crushedList]) else: diff --git a/toontown/coghq/DistributedSwitch.py b/toontown/coghq/DistributedSwitch.py index b9e8ee31..7a1c14e1 100755 --- a/toontown/coghq/DistributedSwitch.py +++ b/toontown/coghq/DistributedSwitch.py @@ -121,4 +121,4 @@ class DistributedSwitch(DistributedSwitchBase.DistributedSwitchBase, BasicEntiti if self.track: self.track.finish() self.track = None - return + return \ No newline at end of file diff --git a/toontown/coghq/DistributedSwitchAI.py b/toontown/coghq/DistributedSwitchAI.py index 2b5a8f03..54bfd389 100755 --- a/toontown/coghq/DistributedSwitchAI.py +++ b/toontown/coghq/DistributedSwitchAI.py @@ -107,4 +107,4 @@ class DistributedSwitchAI(DistributedSwitchBase.DistributedSwitchBase, Distribut if self.doLaterTask: self.doLaterTask.remove() self.doLaterTask = None - return + return \ No newline at end of file diff --git a/toontown/coghq/FactoryBase.py b/toontown/coghq/FactoryBase.py index c4ec6afe..e5254a0a 100755 --- a/toontown/coghq/FactoryBase.py +++ b/toontown/coghq/FactoryBase.py @@ -14,4 +14,4 @@ class FactoryBase: return self.cogTrack def getFactoryType(self): - return self.factoryType + return self.factoryType \ No newline at end of file diff --git a/toontown/coghq/FactoryLevelMgr.py b/toontown/coghq/FactoryLevelMgr.py index 16914472..ea6b9c10 100755 --- a/toontown/coghq/FactoryLevelMgr.py +++ b/toontown/coghq/FactoryLevelMgr.py @@ -33,4 +33,4 @@ class FactoryLevelMgr(LevelMgr.LevelMgr): LevelMgr.LevelMgr.destroy(self) def setFarPlaneDistance(self, farPlaneDistance): - base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance) + base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance) \ No newline at end of file diff --git a/toontown/coghq/FactoryManagerAI.py b/toontown/coghq/FactoryManagerAI.py index 17e947a6..6899538f 100755 --- a/toontown/coghq/FactoryManagerAI.py +++ b/toontown/coghq/FactoryManagerAI.py @@ -21,7 +21,7 @@ class FactoryManagerAI(DirectObject.DirectObject): factoryId = FactoryManagerAI.factoryId if entranceId == 2: factory = DistributedMegaCorpAI.DistributedMegaCorpAI(self.air, factoryId, factoryZone, entranceId, players) - else: + else: factory = DistributedFactoryAI.DistributedFactoryAI(self.air, factoryId, factoryZone, entranceId, players) factory.generateWithRequired(factoryZone) return factoryZone diff --git a/toontown/coghq/FactorySpecs.py b/toontown/coghq/FactorySpecs.py index b753cacb..7761dc43 100755 --- a/toontown/coghq/FactorySpecs.py +++ b/toontown/coghq/FactorySpecs.py @@ -21,4 +21,4 @@ if config.GetBool('want-brutal-factory', True): import SellbotMegaCorpLegSpec import SellbotMegaCorpLegCogs FactorySpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegSpec - CogSpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegCogs + CogSpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegCogs \ No newline at end of file diff --git a/toontown/coghq/GearEntity.py b/toontown/coghq/GearEntity.py index 27569f1d..41c74b04 100755 --- a/toontown/coghq/GearEntity.py +++ b/toontown/coghq/GearEntity.py @@ -82,4 +82,4 @@ class GearEntity(BasicEntities.NodePathEntity): def stopRotate(self): if hasattr(self, 'rotateIval'): self.rotateIval.pause() - del self.rotateIval + del self.rotateIval \ No newline at end of file diff --git a/toontown/coghq/LaserGameAvoid.py b/toontown/coghq/LaserGameAvoid.py index 314e8753..79eea8b3 100755 --- a/toontown/coghq/LaserGameAvoid.py +++ b/toontown/coghq/LaserGameAvoid.py @@ -79,3 +79,5 @@ class LaserGameAvoid(LaserGameBase.LaserGameBase): self.funcSendGrid() return Task.done + + diff --git a/toontown/coghq/LaserGameBase.py b/toontown/coghq/LaserGameBase.py index 16e44eac..2a085916 100755 --- a/toontown/coghq/LaserGameBase.py +++ b/toontown/coghq/LaserGameBase.py @@ -65,3 +65,5 @@ class LaserGameBase: def checkForWin(self): return 0 + + diff --git a/toontown/coghq/LaserGameDrag.py b/toontown/coghq/LaserGameDrag.py index 7ec8479e..5476ca7f 100755 --- a/toontown/coghq/LaserGameDrag.py +++ b/toontown/coghq/LaserGameDrag.py @@ -114,4 +114,4 @@ class LaserGameDrag(LaserGameBase.LaserGameBase): for symbol in self.symbolList: if not self.checkForClear(symbol): return 0 - return 1 + return 1 \ No newline at end of file diff --git a/toontown/coghq/LaserGameMineSweeper.py b/toontown/coghq/LaserGameMineSweeper.py index 4cb079f1..2451dad5 100755 --- a/toontown/coghq/LaserGameMineSweeper.py +++ b/toontown/coghq/LaserGameMineSweeper.py @@ -167,3 +167,5 @@ class LaserGameMineSweeper(LaserGameBase.LaserGameBase): return sum + + diff --git a/toontown/coghq/LaserGameRoll.py b/toontown/coghq/LaserGameRoll.py index 085fc0fe..e5164929 100755 --- a/toontown/coghq/LaserGameRoll.py +++ b/toontown/coghq/LaserGameRoll.py @@ -73,3 +73,5 @@ class LaserGameRoll(LaserGameBase.LaserGameBase): return 0 else: return 1 + + diff --git a/toontown/coghq/LawOfficeBase.py b/toontown/coghq/LawOfficeBase.py index 2384db82..768d80c1 100755 --- a/toontown/coghq/LawOfficeBase.py +++ b/toontown/coghq/LawOfficeBase.py @@ -16,4 +16,4 @@ class LawOfficeBase: return self.cogTrack def getFactoryType(self): - return self.factoryType + return self.factoryType \ No newline at end of file diff --git a/toontown/coghq/LawOfficeLayout.py b/toontown/coghq/LawOfficeLayout.py index 5de7ac5a..deb566e5 100755 --- a/toontown/coghq/LawOfficeLayout.py +++ b/toontown/coghq/LawOfficeLayout.py @@ -41,3 +41,5 @@ class LawOfficeLayout: def getFloorIds(self): return self.floorIds + + diff --git a/toontown/coghq/LevelBattleManagerAI.py b/toontown/coghq/LevelBattleManagerAI.py index 5cedf6f2..329352a0 100755 --- a/toontown/coghq/LevelBattleManagerAI.py +++ b/toontown/coghq/LevelBattleManagerAI.py @@ -46,4 +46,4 @@ class LevelBattleManagerAI(BattleManagerAI.BattleManagerAI): def addBattleBlocker(self, blocker, cellId): self.battleBlockers[cellId] = blocker - messenger.send(self.level.planner.getBattleBlockerEvent(cellId)) + messenger.send(self.level.planner.getBattleBlockerEvent(cellId)) \ No newline at end of file diff --git a/toontown/coghq/MintProduct.py b/toontown/coghq/MintProduct.py index 3d06a308..bc17789d 100755 --- a/toontown/coghq/MintProduct.py +++ b/toontown/coghq/MintProduct.py @@ -30,4 +30,4 @@ class MintProduct(BasicEntities.NodePathEntity): self.model.setScale(self.Scales[self.mintId]) self.model.flattenStrong() if self.model: - self.model.reparentTo(self) + self.model.reparentTo(self) \ No newline at end of file diff --git a/toontown/coghq/MintRoomBase.py b/toontown/coghq/MintRoomBase.py index c1fcbf2a..cec265ef 100755 --- a/toontown/coghq/MintRoomBase.py +++ b/toontown/coghq/MintRoomBase.py @@ -13,4 +13,4 @@ class MintRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack + return self.cogTrack \ No newline at end of file diff --git a/toontown/coghq/PathMasterEntity.py b/toontown/coghq/PathMasterEntity.py index 8e6a1d60..c7288c9f 100755 --- a/toontown/coghq/PathMasterEntity.py +++ b/toontown/coghq/PathMasterEntity.py @@ -149,4 +149,4 @@ class PathMasterEntity(PathEntity.PathEntity): duration = distance / velocity track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint)) - return track + return track \ No newline at end of file diff --git a/toontown/coghq/PlatformEntity.py b/toontown/coghq/PlatformEntity.py index e047183e..5e10f84f 100755 --- a/toontown/coghq/PlatformEntity.py +++ b/toontown/coghq/PlatformEntity.py @@ -40,4 +40,4 @@ class PlatformEntity(BasicEntities.NodePathEntity): del self.moveIval if hasattr(self, 'platform'): self.platform.destroy() - del self.platform + del self.platform \ No newline at end of file diff --git a/toontown/coghq/SellbotCogHQLoader.py b/toontown/coghq/SellbotCogHQLoader.py index 36fb38c1..cf93f6d1 100755 --- a/toontown/coghq/SellbotCogHQLoader.py +++ b/toontown/coghq/SellbotCogHQLoader.py @@ -26,7 +26,7 @@ class SellbotCogHQLoader(CogHQLoader.CogHQLoader): state.addTransition('factoryExterior') self.fsm.addState(State.State('factoryInterior', self.enterFactoryInterior, self.exitFactoryInterior, ['quietZone', 'factoryExterior'])) - self.fsm.addState(State.State('megaCorpInterior', self.enterMegaCorpInterior, self.exitMegaCorpInterior, ['quietZone', 'factoryExterior'])) + self.fsm.addState(State.State('megaCorpInterior', self.enterMegaCorpInterior, self.exitMegaCorpInterior, ['quietZone', 'factoryExterior'])) for stateName in ['quietZone']: state = self.fsm.getStateNamed(stateName) state.addTransition('factoryInterior') @@ -176,10 +176,10 @@ class SellbotCogHQLoader(CogHQLoader.CogHQLoader): def enterMegaCorpInterior(self, requestStatus): self.placeClass = MegaCorpInterior.MegaCorpInterior self.enterPlace(requestStatus) - + def exitMegaCorpInterior(self): self.exitPlace() - self.placeClass = None + self.placeClass = None def enterFactoryInterior(self, requestStatus): self.placeClass = FactoryInterior.FactoryInterior diff --git a/toontown/coghq/SellbotMegaCorpLegCogs.py b/toontown/coghq/SellbotMegaCorpLegCogs.py index 5fabe13f..fcaeed16 100755 --- a/toontown/coghq/SellbotMegaCorpLegCogs.py +++ b/toontown/coghq/SellbotMegaCorpLegCogs.py @@ -336,7 +336,7 @@ CogData = [{'type': 'm', 'behavior': 'chase', 'path': 20111, 'skeleton': 0, - 'revives': 1}, + 'revives': 1}, {'type': 'ms', 'parentEntId': PipeRightParent, 'boss': 0, @@ -490,7 +490,7 @@ CogData = [{'type': 'm', 'behavior': 'stand', 'path': None, 'skeleton': 0, - 'revives': 1}, + 'revives': 1}, {'type': 'ms', 'parentEntId': PaintMixerStorageParent, 'boss': 0, diff --git a/toontown/coghq/SellbotMegaCorpLegSpec.py b/toontown/coghq/SellbotMegaCorpLegSpec.py index 232feadb..e25047ae 100755 --- a/toontown/coghq/SellbotMegaCorpLegSpec.py +++ b/toontown/coghq/SellbotMegaCorpLegSpec.py @@ -1962,7 +1962,7 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'scale': 1, 'entranceId': 2, 'radius': 15, - 'theta': 20}, + 'theta': 20}, 10021: {'type': 'gagBarrel', 'name': '', 'comment': '', @@ -2022,7 +2022,7 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'gagLevelMax': 0, 'gagTrack': 1, 'rewardPerGrab': 5, - 'rewardPerGrabMax': 0}, + 'rewardPerGrabMax': 0}, 20020: {'type': 'gagBarrel', 'name': '', 'comment': '', @@ -3091,28 +3091,28 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'parentEntId': 11, 'pos': Point3(0, 7.2, 0), 'hpr': Vec3(-180, 0, 0), - 'scale': 1}, + 'scale': 1}, 10661: {'type': 'nodepath', 'name': 'battleCell', 'comment': 'East Catwalk', 'parentEntId': 9, 'pos': Point3(-64.82, 69.84, 0), 'hpr': Vec3(-90, 0, 0), - 'scale': 1}, + 'scale': 1}, 10662: {'type': 'nodepath', 'name': 'battleCell', 'comment': 'West Catwalk', 'parentEntId': 21, 'pos': Point3(109, 250.38, 0), 'hpr': Vec3(-180, 0, 0), - 'scale': 1}, + 'scale': 1}, 10663: {'type': 'nodepath', 'name': 'battleCell', 'comment': 'Outside Center Silo', 'parentEntId': 35, 'pos': Point3(-4, -10, 0), 'hpr': Vec3(0, 0, 0), - 'scale': 1}, + 'scale': 1}, 10064: {'type': 'nodepath', 'name': 'battleCell', 'comment': '', diff --git a/toontown/coghq/StageRoomBase.py b/toontown/coghq/StageRoomBase.py index bf28c4e5..818ede13 100755 --- a/toontown/coghq/StageRoomBase.py +++ b/toontown/coghq/StageRoomBase.py @@ -13,4 +13,4 @@ class StageRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack + return self.cogTrack \ No newline at end of file diff --git a/toontown/distributed/DistributedTimerAI.py b/toontown/distributed/DistributedTimerAI.py index 50f92a59..d583b6e8 100755 --- a/toontown/distributed/DistributedTimerAI.py +++ b/toontown/distributed/DistributedTimerAI.py @@ -15,3 +15,4 @@ class DistributedTimerAI(DistributedObjectAI): def getStartTime(self): return self.startTime + diff --git a/toontown/estate/DistributedCannon.py b/toontown/estate/DistributedCannon.py index da9c2808..e67a82c2 100755 --- a/toontown/estate/DistributedCannon.py +++ b/toontown/estate/DistributedCannon.py @@ -1581,3 +1581,4 @@ class DistributedCannon(DistributedObject.DistributedObject): def turnOnBumperCollision(self, whatever = 0): if self.bumperCol: self.bumperCol.setCollideMask(ToontownGlobals.WallBitmask) + diff --git a/toontown/estate/DistributedClosetAI.py b/toontown/estate/DistributedClosetAI.py index fcd79408..c09ad46e 100755 --- a/toontown/estate/DistributedClosetAI.py +++ b/toontown/estate/DistributedClosetAI.py @@ -126,8 +126,8 @@ class DistributedClosetAI(DistributedFurnitureItemAI): if not finished: testDna.makeFromNetString(dnaString) if not self.__checkValidDNAChange(av, testDna): - self.air.writeServerEvent('suspicious', avId, 'Tried to change their DNA temporarily!') - return + self.air.writeServerEvent('suspicious', avId, 'Tried to change their DNA temporarily!') + return self.sendUpdate('setCustomerDNA', [avId, dnaString]) return elif finished == 1: @@ -159,12 +159,12 @@ class DistributedClosetAI(DistributedFurnitureItemAI): self.customerDNA.botTex = testDna.botTex self.customerDNA.botTexColor = testDna.botTexColor if self.customerDNA.torso != testDna.torso: - if self.customerDNA.gender == 'm': - self.air.writeServerEvent('suspicious', avId, 'Tried to change their torso size!') - return - elif self.customerDNA.torso[0] != testDna.torso[0]: - self.air.writeServerEvent('suspicious', avId, 'Tried to change their torso size!') - return + if self.customerDNA.gender == 'm': + self.air.writeServerEvent('suspicious', avId, 'Tried to change their torso size!') + return + elif self.customerDNA.torso[0] != testDna.torso[0]: + self.air.writeServerEvent('suspicious', avId, 'Tried to change their torso size!') + return self.customerDNA.torso = testDna.torso else: self.air.writeServerEvent('suspicious', avId, 'Tried to set their shorts to a pair they don\'t own!') diff --git a/toontown/estate/DistributedEstateAI.py b/toontown/estate/DistributedEstateAI.py index 048776a3..f53b1c2f 100755 --- a/toontown/estate/DistributedEstateAI.py +++ b/toontown/estate/DistributedEstateAI.py @@ -256,14 +256,14 @@ class DistributedEstateAI(DistributedObjectAI): self.plots[slot][item[0]].planted = newItem self.plots[slot][item[0]].sendUpdate('plantedItem', [newItem.doId]) self.plots[slot][item[0]].sendUpdate('setMovie', [GardenGlobals.MOVIE_PLANT, 999999999]) - + def destroy(self): for house in self.houses: if house: house.requestDelete() del self.houses[:] - + if self.pond: self.pond.requestDelete() for spot in self.spots: @@ -613,7 +613,7 @@ class DistributedEstateAI(DistributedObjectAI): def gameTableOver(self): pass - + def placeStarterGarden(self, avatar): # TODO: Place garden if a toon already owns one. avId = avatar.doId diff --git a/toontown/estate/DistributedHouseDoor.py b/toontown/estate/DistributedHouseDoor.py index 70430262..48e3d69c 100755 --- a/toontown/estate/DistributedHouseDoor.py +++ b/toontown/estate/DistributedHouseDoor.py @@ -54,11 +54,11 @@ class DistributedHouseDoor(DistributedDoor.DistributedDoor): self.doPostAnnounceGenerate() self.bHasFlat = not self.findDoorNode('door*flat', True).isEmpty() self.hideDoorParts() - + building = self.getBuilding() doorTrigger = building.find('**/door_trigger*') doorTrigger.setName(self.getTriggerName()) - + self.accept(self.getEnterTriggerEvent(), self.doorTrigger) self.acceptOnce('clearOutToonInterior', self.doorTrigger) self.zoneDoneLoading = 0 diff --git a/toontown/estate/DistributedHouseInterior.py b/toontown/estate/DistributedHouseInterior.py index b6447885..136b5da1 100755 --- a/toontown/estate/DistributedHouseInterior.py +++ b/toontown/estate/DistributedHouseInterior.py @@ -155,7 +155,7 @@ class DistributedHouseInterior(DistributedObject.DistributedObject): model.reparentTo(viewBase) if self.exteriorWindowsHidden: model.findAllMatches('**/outside').stash() - + def hideExteriorWindows(self): self.exteriorWindowsHidden = 1 for item in self.windows: diff --git a/toontown/estate/DistributedPhoneAI.py b/toontown/estate/DistributedPhoneAI.py index 4f9b0a1f..aa08fd29 100755 --- a/toontown/estate/DistributedPhoneAI.py +++ b/toontown/estate/DistributedPhoneAI.py @@ -61,11 +61,11 @@ class DistributedPhoneAI(DistributedFurnitureItemAI): av.b_setCatalogNotify(ToontownGlobals.NoItems, av.mailboxNotify) def __gotHouse(self, dclass, fields): - if dclass != self.air.dclassesByName['DistributedHouseAI']: - return + if dclass != self.air.dclassesByName['DistributedHouseAI']: + return - numItems = len(CatalogItemList(fields['setInteriorItems'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticItems'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticWallpaper'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticWindows'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setInteriorWallpaper'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setInteriorWindows'][0], store=CatalogItem.Customization)) - self.sendUpdateToAvatarId(fields['setAvatarId'][0], 'setLimits', [numItems]) + numItems = len(CatalogItemList(fields['setInteriorItems'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticItems'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticWallpaper'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setAtticWindows'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setInteriorWallpaper'][0], store=CatalogItem.Customization)) + len(CatalogItemList(fields['setInteriorWindows'][0], store=CatalogItem.Customization)) + self.sendUpdateToAvatarId(fields['setAvatarId'][0], 'setLimits', [numItems]) def avatarExit(self): avId = self.air.getAvatarIdFromSender() @@ -144,7 +144,7 @@ class DistributedPhoneAI(DistributedFurnitureItemAI): resp = item.recordPurchase(av, optional) if resp < 0: - av.addMoney(price) + av.addMoney(price) self.sendUpdateToAvatarId(avId, 'requestPurchaseResponse', [context, resp]) taskMgr.doMethodLater(0.2, self.sendUpdateToAvatarId, 'purchaseItemComplete-%d' % self.getDoId(), extraArgs=[avId, 'purchaseItemComplete', []]) diff --git a/toontown/estate/GardenDropGame.py b/toontown/estate/GardenDropGame.py index 6abe3f08..461f4c02 100755 --- a/toontown/estate/GardenDropGame.py +++ b/toontown/estate/GardenDropGame.py @@ -425,7 +425,7 @@ class GardenDropGame: def __run(self, Task): if self.lastTime == None: - self.lastTime = globalClock.getRealTime() + self.lastTime = globalClock.getRealTime() timeDelta = 0.0265 self.lastTime = globalClock.getRealTime() diff --git a/toontown/estate/TrunkGUI.py b/toontown/estate/TrunkGUI.py index 9f3dd15b..fb0a4c37 100755 --- a/toontown/estate/TrunkGUI.py +++ b/toontown/estate/TrunkGUI.py @@ -254,17 +254,17 @@ class TrunkGUI(StateData.StateData): self.shoesChoice = 0 if (self.toon.hat[0] != 0 or self.toon.hat[1] != 0 or self.toon.hat[2] != 0): - self.hatChoice = 1 - self.hats.append((self.toon.hat[0], self.toon.hat[1], self.toon.hat[2])) + self.hatChoice = 1 + self.hats.append((self.toon.hat[0], self.toon.hat[1], self.toon.hat[2])) if (self.toon.glasses[0] != 0 or self.toon.glasses[1] != 0 or self.toon.glasses[2] != 0): - self.glassesChoice = 1 - self.glasses.append((self.toon.glasses[0], self.toon.glasses[1], self.toon.glasses[2])) + self.glassesChoice = 1 + self.glasses.append((self.toon.glasses[0], self.toon.glasses[1], self.toon.glasses[2])) if (self.toon.backpack[0] != 0 or self.toon.backpack[1] != 0 or self.toon.backpack[2] != 0): - self.backpackChoice = 1 - self.backpacks.append((self.toon.backpack[0], self.toon.backpack[1], self.toon.backpack[2])) + self.backpackChoice = 1 + self.backpacks.append((self.toon.backpack[0], self.toon.backpack[1], self.toon.backpack[2])) if (self.toon.shoes[0] != 0 or self.toon.shoes[1] != 0 or self.toon.shoes[2] != 0): - self.shoesChoice = 1 - self.shoes.append((self.toon.shoes[0], self.toon.shoes[1], self.toon.shoes[2])) + self.shoesChoice = 1 + self.shoes.append((self.toon.shoes[0], self.toon.shoes[1], self.toon.shoes[2])) i = 0 while i < len(self.hatList): diff --git a/toontown/fishing/BingoCardGui.py b/toontown/fishing/BingoCardGui.py index d9e1daa7..1e62a7df 100755 --- a/toontown/fishing/BingoCardGui.py +++ b/toontown/fishing/BingoCardGui.py @@ -439,4 +439,4 @@ class BingoCardGui(DirectFrame): if taskMgr.hasTaskNamed(self.taskNameFlashFish): if not base.localAvatar.fishBingoMarkTutorialDone: self.showTutorial(BG.TutorialMark) - base.localAvatar.b_setFishBingoMarkTutorialDone(True) + base.localAvatar.b_setFishBingoMarkTutorialDone(True) \ No newline at end of file diff --git a/toontown/fishing/DistributedPondBingoManager.py b/toontown/fishing/DistributedPondBingoManager.py index fd8b2f6a..529be4ce 100755 --- a/toontown/fishing/DistributedPondBingoManager.py +++ b/toontown/fishing/DistributedPondBingoManager.py @@ -154,7 +154,7 @@ class DistributedPondBingoManager(DistributedObject.DistributedObject, FSM.FSM): self.setPond(self.cr.doId2do[pondId]) else: self.acceptOnce('generate-%d' % pondId, self.setPond) - + def setPond(self, pond): self.pond = pond self.pond.setPondBingoManager(self) diff --git a/toontown/friends/FriendInviter.py b/toontown/friends/FriendInviter.py index 5553c8e1..06c44890 100755 --- a/toontown/friends/FriendInviter.py +++ b/toontown/friends/FriendInviter.py @@ -109,10 +109,10 @@ class FriendInviter(DirectFrame): def getName(self): name = self.toonName - + if name == None: name = TTLocalizer.FriendInviterThatToon - + return name def enterOff(self): diff --git a/toontown/friends/FriendsListPanel.py b/toontown/friends/FriendsListPanel.py index 840eeaea..f5a792f7 100755 --- a/toontown/friends/FriendsListPanel.py +++ b/toontown/friends/FriendsListPanel.py @@ -14,7 +14,7 @@ globalFriendsList = None def determineFriendName(friendTuple): if len(friendTuple) < 0: return None - + handle = base.cr.identifyFriend(friendTuple[0]) return handle.getName() if handle else None @@ -386,4 +386,4 @@ class FriendsListPanel(DirectFrame, StateData.StateData): self.__updateScrollList() def __friendsListChanged(self, arg1 = None, arg2 = None): - self.__updateScrollList() + self.__updateScrollList() \ No newline at end of file diff --git a/toontown/friends/TTSFriendsManager.py b/toontown/friends/TTSFriendsManager.py index 70c91ccb..2dead968 100755 --- a/toontown/friends/TTSFriendsManager.py +++ b/toontown/friends/TTSFriendsManager.py @@ -40,10 +40,10 @@ class TTSFriendsManager(DistributedObjectGlobal): ['setDNAString' , dnaString], ] base.cr.n_handleGetAvatarDetailsResp(avId, fields=fields) - + def d_getPetDetails(self, avId): self.sendUpdate('getPetDetails', [avId]) - + def petDetails(self, avId, ownerId, petName, traitSeed, sz, traits, moods, dna, lastSeen): fields = list(zip(("setHead", "setEars", "setNose", "setTail", "setBodyTexture", "setColor", "setColorScale", "setEyeColor", "setGender"), dna)) fields.extend(zip(("setBoredom", "setRestlessness", "setPlayfulness", "setLoneliness", @@ -59,7 +59,7 @@ class TTSFriendsManager(DistributedObjectGlobal): fields.append(("setTraitSeed", traitSeed)) fields.append(("setSafeZone", sz)) fields.append(("setLastSeenTimestamp", lastSeen)) - base.cr.n_handleGetAvatarDetailsResp(avId, fields=fields) + base.cr.n_handleGetAvatarDetailsResp(avId, fields=fields) def d_teleportQuery(self, toId): self.sendUpdate('routeTeleportQuery', [toId]) diff --git a/toontown/friends/TTSFriendsManagerUD.py b/toontown/friends/TTSFriendsManagerUD.py index db7c9c97..75b23311 100755 --- a/toontown/friends/TTSFriendsManagerUD.py +++ b/toontown/friends/TTSFriendsManagerUD.py @@ -252,7 +252,7 @@ class TTSFriendsManagerUD(DistributedObjectGlobalUD): # Inventory, trackAccess, trophies, Hp, maxHp, defaultshard, lastHood, dnastring self.sendUpdateToAvatarId(senderId, 'friendDetails', [avId, inventory, trackAccess, trophies, hp, maxHp, defaultShard, lastHood, dnaString, experience, trackBonusLevel]) self.air.dbInterface.queryObject(self.air.dbId, avId, handleToon) - + def getPetDetails(self, avId): senderId = self.air.getAvatarIdFromSender() def handlePet(dclass, fields): diff --git a/toontown/golf/DistributedGolfHoleAI.py b/toontown/golf/DistributedGolfHoleAI.py index 9772927e..b3fb03af 100755 --- a/toontown/golf/DistributedGolfHoleAI.py +++ b/toontown/golf/DistributedGolfHoleAI.py @@ -277,7 +277,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, def chooseAvatarToSimulate(self): stillPlaying = self.golfCourse.getStillPlayingAvIds() - + return stillPlaying[0] if stillPlaying else 0 def ballMovie2AI(self, cycleTime, avId, movie, spinMovie, ballInFrame, ballTouchedHoleFrame, ballFirstTouchedHoleFrame, commonObjectData): diff --git a/toontown/golf/GolfGlobals.py b/toontown/golf/GolfGlobals.py index 11bee4e5..f510e2c6 100755 --- a/toontown/golf/GolfGlobals.py +++ b/toontown/golf/GolfGlobals.py @@ -1,51 +1,51 @@ from direct.directnotify import DirectNotifyGlobal;import random;MAX_PLAYERS_PER_HOLE=4;GOLF_BALL_RADIUS=0.25;GOLF_BALL_VOLUME=4.0/3.0*3.14159*GOLF_BALL_RADIUS**3;GOLF_BALL_MASS=0.5;GOLF_BALL_DENSITY=GOLF_BALL_MASS/GOLF_BALL_VOLUME;GRASS_SURFACE=0;BALL_SURFACE=1;HARD_SURFACE=2;HOLE_SURFACE=3;SLICK_SURFACE=4;OOB_RAY_COLLIDE_ID=-1;GRASS_COLLIDE_ID=2;HARD_COLLIDE_ID=3;TOON_RAY_COLLIDE_ID=4;MOVER_COLLIDE_ID=7;WINDMILL_BASE_COLLIDE_ID=8;CAMERA_RAY_COLLIDE_ID=10;BALL_COLLIDE_ID=42;HOLE_CUP_COLLIDE_ID=64;SKY_RAY_COLLIDE_ID=78;SLICK_COLLIDE_ID=13;BALL_CONTACT_FRAME=9;BALL_CONTACT_TIME=(BALL_CONTACT_FRAME+1)/24.0;AIM_DURATION=60;TEE_DURATION=15;RANDOM_HOLES=True;KICKOUT_SWINGS=2;TIME_TIE_BREAKER=True;CourseInfo={0:{'holeIds':(2,3,4,5,6,7,8,12,13,15,16),'numHoles':3,'name':''},1:{'holeIds':((0,5),(1,5),2,3,4,5,6,7,8,9,10,(11,5),12,13,(14,5),15,16,(17,5),(20,5),(21,5),(22,5),(23,5),(24,5),(25,5),(26,5),(28,5),(30,5),(31,5),(33,5),(34,5)),'numHoles':6,'name':''},2:{'holeIds':((1,5),4,5,6,7,8,9,10,11,12,13,(14,5),15,(17,5),(18,20),(19,20),(20,20),(21,5),(22,5),(23,20),(24,20),(25,20),(26,20),(27,20),(28,20),(29,20),(30,5),(31,20),(32,20),(33,5),(34,20),(35,20)),'numHoles':9,'name':''}};HoleInfo={0:{'optionalMovers':(),'maxSwing':6,'terrainModel':'phase_6/models/golf/hole18.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen18'},1:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole1.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen1'},2:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole2.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen2'},3:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole3.bam','name':'','blockers':(),'par':2,'physicsData':'golfGreen3'},4:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole4.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen4'},5:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole5.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen2'},6:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole6.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen6'},7:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole7.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen7'},8:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole8.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen8'},9:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole9.bam','name':'','blockers':2,'par':3,'physicsData':'golfGreen9'},10:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole10.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen10'},11:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole11.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen11'},12:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole12.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen12'},13:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole13.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen13'},14:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole14.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen14'},15:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole15.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen15'},16:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole16.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen16'},17:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole17.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen17'},18:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole18.bam','name':'','blockers':(1,2),'par':3,'physicsData':'golfGreen18'},19:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole1.bam','name':'','blockers':(2,5),'par':3,'physicsData':'golfGreen1'},20:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole2.bam','name':'','blockers':(1,3),'par':3,'physicsData':'golfGreen2'},21:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole3.bam','name':'','blockers':(1,2,3),'par':3,'physicsData':'golfGreen3'},22:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole4.bam','name':'','blockers':2,'par':3,'physicsData':'golfGreen4'},23:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole5.bam','name':'','blockers':(3,4),'par':3,'physicsData':'golfGreen5'},24:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole6.bam','name':'','blockers':1,'par':3,'physicsData':'golfGreen6'},25:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole7.bam','name':'','blockers':3,'par':3,'physicsData':'golfGreen7'},26:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole8.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen8'},27:{'optionalMovers':(1,2),'maxSwing':6,'terrainModel':'phase_6/models/golf/hole9.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen9'},28:{'optionalMovers':(1,2),'maxSwing':6,'terrainModel':'phase_6/models/golf/hole10.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen10'},29:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole11.bam','name':'','blockers':(),'par':3,'physicsData':'golfGreen11'},30:{'maxSwing':6,'terrainModel':'phase_6/models/golf/hole12.bam','name':'','blockers':(1,2,3),'par':3,'physicsData':'golfGreen12'},31:{'optionalMovers':1,'maxSwing':7,'terrainModel':'phase_6/models/golf/hole13.bam','name':'','blockers':(3,4),'par':4,'physicsData':'golfGreen13'},32:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole14.bam','name':'','blockers':1,'par':3,'physicsData':'golfGreen14'},33:{'optionalMovers':(1,2),'maxSwing':6,'terrainModel':'phase_6/models/golf/hole15.bam','name':'','blockers':(1,2,3),'par':3,'physicsData':'golfGreen15'},34:{'optionalMovers':1,'maxSwing':6,'terrainModel':'phase_6/models/golf/hole16.bam','name':'','blockers':(1,2,5,6),'par':3,'physicsData':'golfGreen16'},35:{'maxSwing':7,'terrainModel':'phase_6/models/golf/hole17.bam','name':'','blockers':(3,4,5),'par':4,'physicsData':'golfGreen17'}} for hi in HoleInfo: - if type(HoleInfo[hi]['blockers'])==type(0):blockerNum=HoleInfo[hi]['blockers'];HoleInfo[hi]['blockers']=(blockerNum,) - if 'optionalMovers' in HoleInfo[hi] and type(HoleInfo[hi]['optionalMovers'])==type(0):blockerNum=HoleInfo[hi]['optionalMovers'];HoleInfo[hi]['optionalMovers']=(blockerNum,) + if type(HoleInfo[hi]['blockers'])==type(0):blockerNum=HoleInfo[hi]['blockers'];HoleInfo[hi]['blockers']=(blockerNum,) + if 'optionalMovers' in HoleInfo[hi] and type(HoleInfo[hi]['optionalMovers'])==type(0):blockerNum=HoleInfo[hi]['optionalMovers'];HoleInfo[hi]['optionalMovers']=(blockerNum,) DistanceToBeInHole=0.75;CoursesCompleted=0;CoursesUnderPar=1;HoleInOneShots=2;EagleOrBetterShots=3;BirdieOrBetterShots=4;ParOrBetterShots=5;MultiPlayerCoursesCompleted=6;CourseZeroWins=7;CourseOneWins=8;CourseTwoWins=9;TwoPlayerWins=10;ThreePlayerWins=11;FourPlayerWins=12;MaxHistoryIndex=9;NumHistory=MaxHistoryIndex+1;CalcOtherHoleBest = False;CalcOtherCourseBest = False;TrophyRequirements={CoursesCompleted:(4,40,400),CoursesUnderPar:(1,10,100),HoleInOneShots:(1,10,100),EagleOrBetterShots:(2,20,200),BirdieOrBetterShots:(3,30,300),ParOrBetterShots:(4,40,400),MultiPlayerCoursesCompleted:(6,60,600),CourseZeroWins:(1,10,100),CourseOneWins:(1,10,100),CourseTwoWins:(1,10,100)};PlayerColors=[(0.925,0.168,0.168,1),(0.13,0.59,0.973,1),(0.973,0.809,0.129,1),(0.598,0.402,0.875,1)];KartColors=[[[0,50],[90,255],[0,85]],[[160,255],[-15,15],[0,120]],[[160,255],[0,110],[0,110]]];NumTrophies=0 for key in TrophyRequirements:NumTrophies += len(TrophyRequirements[key]) NumCups=3;TrophiesPerCup=NumTrophies/NumCups def calcTrophyListFromHistory(h): - rv,hi=[],0 - for ti in xrange(NumHistory): - r=TrophyRequirements[ti] - for an in r: - if h[hi]>=an:rv.append(True) - else:rv.append(False) - hi+=1 - return rv + rv,hi=[],0 + for ti in xrange(NumHistory): + r=TrophyRequirements[ti] + for an in r: + if h[hi]>=an:rv.append(True) + else:rv.append(False) + hi+=1 + return rv def calcCupListFromHistory(h): - rv,tl,nt=[False]*NumCups,calcTrophyListFromHistory(h),0 - for gt in tl: - if gt:nt+=1 - for ci in xrange(len(rv)): - tr=(ci+1)*TrophiesPerCup - if tr<=nt:rv[ci]=True - return rv + rv,tl,nt=[False]*NumCups,calcTrophyListFromHistory(h),0 + for gt in tl: + if gt:nt+=1 + for ci in xrange(len(rv)): + tr=(ci+1)*TrophiesPerCup + if tr<=nt:rv[ci]=True + return rv def getCourseName(ci): - from toontown.toonbase import TTLocalizer - if ci in CourseInfo: - if not CourseInfo[ci]['name']:CourseInfo[ci]['name']=TTLocalizer.GolfCourseNames[ci] - return CourseInfo[ci]['name'] - else:return '' + from toontown.toonbase import TTLocalizer + if ci in CourseInfo: + if not CourseInfo[ci]['name']:CourseInfo[ci]['name']=TTLocalizer.GolfCourseNames[ci] + return CourseInfo[ci]['name'] + else:return '' def getHoleName(hi): - from toontown.toonbase import TTLocalizer - if hi in HoleInfo: - if not HoleInfo[hi]['name']:HoleInfo[hi]['name']=TTLocalizer.GolfHoleNames[hi] - return HoleInfo[hi]['name'] - else:return '' + from toontown.toonbase import TTLocalizer + if hi in HoleInfo: + if not HoleInfo[hi]['name']:HoleInfo[hi]['name']=TTLocalizer.GolfHoleNames[hi] + return HoleInfo[hi]['name'] + else:return '' def getHistoryIndexForTrophy(ti): - rv,db=-1,int(ti/3) - if db>4;rv.append(hb) - return rv + rv=[] + for ph in phb:lb=ph&15;rv.append(lb);hb=(ph & 240)>>4;rv.append(hb) + return rv diff --git a/toontown/hood/MMHoodAI.py b/toontown/hood/MMHoodAI.py index cae126a7..a8ae2a11 100755 --- a/toontown/hood/MMHoodAI.py +++ b/toontown/hood/MMHoodAI.py @@ -22,7 +22,7 @@ class MMHoodAI(HoodAI.HoodAI): self.createTrolley() self.piano = DistributedMMPianoAI.DistributedMMPianoAI(self.air) - self.piano.generateWithRequired(self.zoneId) + self.piano.generateWithRequired(self.zoneId) if simbase.air.wantHalloween: self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) diff --git a/toontown/hood/Place.py b/toontown/hood/Place.py index 39313d82..fafd69cc 100755 --- a/toontown/hood/Place.py +++ b/toontown/hood/Place.py @@ -821,4 +821,4 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def handleQuietZoneDone(self): how = base.cr.handlerArgs['how'] - self.fsm.request(how, [base.cr.handlerArgs]) + self.fsm.request(how, [base.cr.handlerArgs]) \ No newline at end of file diff --git a/toontown/hood/ZoneUtil.py b/toontown/hood/ZoneUtil.py index c2064d20..af307e6d 100755 --- a/toontown/hood/ZoneUtil.py +++ b/toontown/hood/ZoneUtil.py @@ -109,7 +109,7 @@ def getWhereName(zoneId, isToon): if getHoodId(zoneId) == SellbotHQ: if suffix == 600: where = 'megaCorpInterior' - else: + else: where = 'factoryInterior' elif getHoodId(zoneId) == CashbotHQ: where = 'mintInterior' @@ -245,5 +245,5 @@ def getWakeInfo(hoodId = None, zoneId = None): def canWearSuit(zoneId): zoneId = getCanonicalHoodId(zoneId) - + return zoneId >= DynamicZonesBegin or zoneId in [LawbotHQ, CashbotHQ, SellbotHQ, BossbotHQ] diff --git a/toontown/language/LanguageSelector.py b/toontown/language/LanguageSelector.py index 53a23296..65c93b10 100755 --- a/toontown/language/LanguageSelector.py +++ b/toontown/language/LanguageSelector.py @@ -42,11 +42,11 @@ class LanguageSelector: self.french = DirectButton(aspect2d, relief=None, text='French', text_fg=(1, 0.549, 0, 1), text_scale=0.09, text_font=ToontownGlobals.getSuitFont(), pos=(0, 0, -0.25), text_shadow=(1, 0.27, 0, 1), command=self.switchLanguage, extraArgs=['French']) - + self.portuguese = DirectButton(aspect2d, relief=None, text='Portuguese', text_fg=(1, 0.549, 0, 1), text_scale=0.09, text_font=ToontownGlobals.getSuitFont(), pos=(0, 0, -0.35), text_shadow=(1, 0.27, 0, 1), command=self.switchLanguage, extraArgs=['Portuguese']) - + self.german = DirectButton(aspect2d, relief=None, text='German', text_fg=(1, 0.549, 0, 1), text_scale=0.09, text_font=ToontownGlobals.getSuitFont(), pos=(0, 0, -0.45), text_shadow=(1, 0.27, 0, 1), command=self.switchLanguage, extraArgs=['German']) diff --git a/toontown/launcher/TTSLauncher.py b/toontown/launcher/TTSLauncher.py index ee624843..6ce25287 100755 --- a/toontown/launcher/TTSLauncher.py +++ b/toontown/launcher/TTSLauncher.py @@ -53,10 +53,10 @@ class TTSLauncher: def setPandaErrorCode(self): pass - + def setDisconnectDetails(self, disconnectCode, disconnectMsg): self.disconnectCode = disconnectCode self.disconnectMsg = disconnectMsg - + def setDisconnectDetailsNormal(self): self.setDisconnectDetails(0, 'normal') diff --git a/toontown/makeatoon/NameGenerator.py b/toontown/makeatoon/NameGenerator.py index 4119c64b..c7f36632 100755 --- a/toontown/makeatoon/NameGenerator.py +++ b/toontown/makeatoon/NameGenerator.py @@ -359,4 +359,4 @@ class NameGenerator: totalTitleFirstLasts = neutralTitleFirstLasts + boyTitleFirstLasts + girlTitleFirstLasts print 'Total title first lasts: ' + str(totalTitleFirstLasts) totalNames = firsts + lasts + totalTitleFirsts + totalTitleLasts + totalFirstLasts + totalTitleFirstLasts - print 'Total Names: ' + str(totalNames) + print 'Total Names: ' + str(totalNames) \ No newline at end of file diff --git a/toontown/minigame/CogThiefGameGlobals.py b/toontown/minigame/CogThiefGameGlobals.py index 1b9784a5..e52afe39 100755 --- a/toontown/minigame/CogThiefGameGlobals.py +++ b/toontown/minigame/CogThiefGameGlobals.py @@ -128,4 +128,4 @@ def calculateCogSpeed(numPlayers, safezone): if numPlayers <= len(NumCogsTable): if safezone in CogSpeedTable[numPlayers - 1]: result = CogSpeedTable[numPlayers - 1][safezone] - return result + return result \ No newline at end of file diff --git a/toontown/minigame/CogThiefWalk.py b/toontown/minigame/CogThiefWalk.py index a1de3669..95b60897 100755 --- a/toontown/minigame/CogThiefWalk.py +++ b/toontown/minigame/CogThiefWalk.py @@ -22,4 +22,4 @@ class CogThiefWalk(Walk.Walk): base.localAvatar.stopBlink() base.localAvatar.stopGlitchKiller() base.localAvatar.collisionsOff() - base.localAvatar.controlManager.placeOnFloor() + base.localAvatar.controlManager.placeOnFloor() \ No newline at end of file diff --git a/toontown/minigame/DistributedCogThiefGame.py b/toontown/minigame/DistributedCogThiefGame.py index 588cafd8..9c438929 100755 --- a/toontown/minigame/DistributedCogThiefGame.py +++ b/toontown/minigame/DistributedCogThiefGame.py @@ -904,4 +904,4 @@ class DistributedCogThiefGame(DistributedMinigame): def getIntroTrack(self): base.camera.setPosHpr(0, -13.66, 13.59, 0, -51.6, 0) result = Sequence(Wait(2), LerpPosHprInterval(base.camera, 13, Point3(self.cameraTopView[0], self.cameraTopView[1], self.cameraTopView[2]), Point3(self.cameraTopView[3], self.cameraTopView[4], self.cameraTopView[5]), blendType='easeIn')) - return result + return result \ No newline at end of file diff --git a/toontown/minigame/DistributedCogThiefGameAI.py b/toontown/minigame/DistributedCogThiefGameAI.py index d3dd8539..997e8337 100755 --- a/toontown/minigame/DistributedCogThiefGameAI.py +++ b/toontown/minigame/DistributedCogThiefGameAI.py @@ -406,4 +406,4 @@ class DistributedCogThiefGameAI(DistributedMinigameAI.DistributedMinigameAI): if not result: safezone = self.getSafezoneId() result = CTGG.calculateCogs(self.numPlayers, safezone) - return result + return result \ No newline at end of file diff --git a/toontown/minigame/DistributedMinigame.py b/toontown/minigame/DistributedMinigame.py index 3ee597de..95974584 100755 --- a/toontown/minigame/DistributedMinigame.py +++ b/toontown/minigame/DistributedMinigame.py @@ -426,4 +426,4 @@ class DistributedMinigame(DistributedObject.DistributedObject): Emote.globalEmote.disableAll(base.localAvatar) def unsetEmotes(self): - Emote.globalEmote.releaseAll(base.localAvatar) + Emote.globalEmote.releaseAll(base.localAvatar) \ No newline at end of file diff --git a/toontown/minigame/DistributedMinigameAI.py b/toontown/minigame/DistributedMinigameAI.py index 82f22981..ced56f2a 100755 --- a/toontown/minigame/DistributedMinigameAI.py +++ b/toontown/minigame/DistributedMinigameAI.py @@ -362,4 +362,4 @@ class DistributedMinigameAI(DistributedObjectAI.DistributedObjectAI): def logAllPerfect(self): for avId in self.avIdList: - self.logPerfectGame(avId) + self.logPerfectGame(avId) \ No newline at end of file diff --git a/toontown/minigame/DistributedPatternGame.py b/toontown/minigame/DistributedPatternGame.py index fa7f9eb1..ed9e6850 100755 --- a/toontown/minigame/DistributedPatternGame.py +++ b/toontown/minigame/DistributedPatternGame.py @@ -210,7 +210,7 @@ class DistributedPatternGame(DistributedMinigame): self.lt.pose(anim, 0) self.toonAnimSpeedMult = {} - + for anim in self.toonAnimNames: numFrames = self.lt.getNumFrames(anim) self.toonAnimSpeedMult[anim] = float(self.__numPingPongFrames(numFrames)) / float(self.stdNumDanceStepPingPongFrames) diff --git a/toontown/minigame/DistributedTagGame.py b/toontown/minigame/DistributedTagGame.py index 6c483286..8ec567ca 100755 --- a/toontown/minigame/DistributedTagGame.py +++ b/toontown/minigame/DistributedTagGame.py @@ -285,4 +285,4 @@ class DistributedTagGame(DistributedMinigame): return self.notify.debug('setTreasureScore: %s' % scores) for i in xrange(len(self.scorePanels)): - self.scorePanels[i].setScore(scores[i]) + self.scorePanels[i].setScore(scores[i]) \ No newline at end of file diff --git a/toontown/minigame/MinigameGlobals.py b/toontown/minigame/MinigameGlobals.py index 075f4386..7032da44 100755 --- a/toontown/minigame/MinigameGlobals.py +++ b/toontown/minigame/MinigameGlobals.py @@ -33,4 +33,4 @@ def getSafezoneId(trolleyZone): def getScoreMult(trolleyZone): szId = getSafezoneId(trolleyZone) multiplier = PythonUtil.lerp(1.0, 1.5, float(SafeZones.index(szId)) / (len(SafeZones) - 1)) - return multiplier + return multiplier \ No newline at end of file diff --git a/toontown/minigame/PatternGameGlobals.py b/toontown/minigame/PatternGameGlobals.py index a330d580..80a97447 100755 --- a/toontown/minigame/PatternGameGlobals.py +++ b/toontown/minigame/PatternGameGlobals.py @@ -6,4 +6,4 @@ NUM_ROUNDS = 4 InputTime = 10 TOONTOWN_WORK = 1 ClientsReadyTimeout = 5 + MinigameGlobals.latencyTolerance -InputTimeout = InputTime + MinigameGlobals.latencyTolerance +InputTimeout = InputTime + MinigameGlobals.latencyTolerance \ No newline at end of file diff --git a/toontown/nametag/Nametag2d.py b/toontown/nametag/Nametag2d.py index fca077f9..4797fbc9 100755 --- a/toontown/nametag/Nametag2d.py +++ b/toontown/nametag/Nametag2d.py @@ -239,7 +239,7 @@ class Nametag2d(Nametag, Clickable2d, MarginVisible): self.panelWidth = self.textNode.getWidth() + self.PANEL_X_PADDING self.panelHeight = self.textNode.getHeight() + self.PANEL_Z_PADDING self.panel.setScale(self.panelWidth, 1, self.panelHeight) - + # Add an arrow: self.arrow = NametagGlobals.arrowModel.copyTo(self.contents) self.arrow.setZ(self.ARROW_OFFSET + self.textNode.getBottom()) diff --git a/toontown/parties/DistributedPartyAI.py b/toontown/parties/DistributedPartyAI.py index 7e4cd6ec..887be743 100755 --- a/toontown/parties/DistributedPartyAI.py +++ b/toontown/parties/DistributedPartyAI.py @@ -63,7 +63,7 @@ class DistributedPartyAI(DistributedObjectAI): ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI, ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI, ActivityIds.PartyCatch: DistributedPartyCatchActivityAI, - ActivityIds.PartyDance: DistributedPartyDanceActivityAI, + ActivityIds.PartyDance: DistributedPartyDanceActivityAI, ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI, ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI, ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI, @@ -146,9 +146,10 @@ class DistributedPartyAI(DistributedObjectAI): if not avId in self.avIdsAtParty: self.air.globalPartyMgr.d_toonJoinedParty(self.info.get('partyId', 0), avId) self.avIdsAtParty.append(avId) - + def _removeAvatar(self, avId): if avId in self.avIdsAtParty: print 'REMOVE FROM PARTTY!' self.air.globalPartyMgr.d_toonLeftParty(self.info.get('partyId', 0), avId) self.avIdsAtParty.remove(avId) + diff --git a/toontown/parties/DistributedPartyActivityAI.py b/toontown/parties/DistributedPartyActivityAI.py index 6f026de9..63c8d5c1 100755 --- a/toontown/parties/DistributedPartyActivityAI.py +++ b/toontown/parties/DistributedPartyActivityAI.py @@ -78,3 +78,4 @@ class DistributedPartyActivityAI(DistributedObjectAI): def showJellybeanReward(self, todo0, todo1, todo2): pass + diff --git a/toontown/parties/DistributedPartyCannonAI.py b/toontown/parties/DistributedPartyCannonAI.py index 653a5ecd..3b55a2df 100755 --- a/toontown/parties/DistributedPartyCannonAI.py +++ b/toontown/parties/DistributedPartyCannonAI.py @@ -5,27 +5,27 @@ import PartyGlobals class DistributedPartyCannonAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyCannonAI") - + def __init__(self, air): DistributedObjectAI.__init__(self, air) self.actId = 0 self.posHpr = [0, 0, 0, 0, 0, 0] self.avId = 0 - + def delete(self): taskMgr.remove('removeToon%d' % self.doId) DistributedObjectAI.delete(self) - + def setActivityDoId(self, actId): self.actId = actId - + def getActivityDoId(self): return self.actId def setPosHpr(self, x, y, z, h, p, r): self.posHpr = [x, y, z, h, p, r] - + def getPosHpr(self): return self.posHpr @@ -72,8 +72,8 @@ class DistributedPartyCannonAI(DistributedObjectAI): if avId != self.avId: self.air.writeServerEvent('suspicious',avId,'Toon tried to start timer for someone else!') taskMgr.doMethodLater(PartyGlobals.CANNON_TIMEOUT, self.__removeToon, 'removeToon%d' % self.doId, extraArgs=[avId]) - - + + def __removeToon(self, avId): if avId != self.avId: return diff --git a/toontown/parties/DistributedPartyCannonActivityAI.py b/toontown/parties/DistributedPartyCannonActivityAI.py index 2305ef81..8f4f2d5b 100755 --- a/toontown/parties/DistributedPartyCannonActivityAI.py +++ b/toontown/parties/DistributedPartyCannonActivityAI.py @@ -5,7 +5,7 @@ import PartyGlobals class DistributedPartyCannonActivityAI(DistributedPartyActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyCannonActivityAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyActivityAI.__init__(self, air, parent, activityTuple) self.cloudColors = {} @@ -67,3 +67,4 @@ class DistributedPartyCannonActivityAI(DistributedPartyActivityAI): def updateToonTrajectoryStartVel(self, todo0, todo1, todo2, todo3): pass + diff --git a/toontown/parties/DistributedPartyCatchActivityAI.py b/toontown/parties/DistributedPartyCatchActivityAI.py index 709032ee..f9fb4135 100755 --- a/toontown/parties/DistributedPartyCatchActivityAI.py +++ b/toontown/parties/DistributedPartyCatchActivityAI.py @@ -8,7 +8,7 @@ import PartyGlobals class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPartyCatchActivityBase): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyCatchActivityAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyActivityAI.__init__(self, air, parent, activityTuple) self.numGenerations = 1 @@ -16,7 +16,7 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar self.player2catches = {} self.startTimestamp = globalClockDelta.getRealNetworkTime(bits=32) self.playing = False - + def delete(self): taskMgr.remove('newGeneration%d' % self.doId) DistributedPartyActivityAI.delete(self) @@ -29,7 +29,7 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar def setGenerations(self, generations): self.generations = generations - + def toonJoinRequest(self): DistributedPartyActivityAI.toonJoinRequest(self) avId = self.air.getAvatarIdFromSender() @@ -37,7 +37,7 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar if not self.playing: self.__startGame() self.sendUpdate('setState', ['Active', globalClockDelta.getRealNetworkTime()]) - + def toonExitDemand(self): avId = self.air.getAvatarIdFromSender() if not avId in self.toonsPlaying: @@ -54,7 +54,7 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar self.sendUpdateToAvatarId(avId, 'showJellybeanReward', [catches, av.getMoney(), TTLocalizer.PartyCatchRewardMessage % (catches, catches)]) av.addMoney(catches) DistributedPartyActivityAI.toonExitDemand(self) - + def __startGame(self): self.playing = True self.calcDifficultyConstants(len(self.toonsPlaying)) @@ -62,12 +62,12 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar self.numGenerations += 1 self.sendUpdate('setGenerations', [self.generations]) taskMgr.doMethodLater(self.generationDuration, self.__newGeneration, 'newGeneration%d' % self.doId, extraArgs=[]) - + def __newGeneration(self): if len(self.toonsPlaying) > 0: self.__startGame() else: - self.playing = False + self.playing = False def getGenerations(self): return self.generations @@ -84,4 +84,4 @@ class DistributedPartyCatchActivityAI(DistributedPartyActivityAI, DistributedPar return if PartyGlobals.DOTypeId2Name[objType] != 'anvil': self.player2catches[avId] += 1 - self.sendUpdate('setObjectCaught', [avId, generation, objNum]) + self.sendUpdate('setObjectCaught', [avId, generation, objNum]) \ No newline at end of file diff --git a/toontown/parties/DistributedPartyCogActivityAI.py b/toontown/parties/DistributedPartyCogActivityAI.py index 328120e4..466b1487 100755 --- a/toontown/parties/DistributedPartyCogActivityAI.py +++ b/toontown/parties/DistributedPartyCogActivityAI.py @@ -18,3 +18,4 @@ class DistributedPartyCogActivityAI(DistributedPartyTeamActivityAI): def setHighScore(self, todo0, todo1): pass + diff --git a/toontown/parties/DistributedPartyDance20ActivityAI.py b/toontown/parties/DistributedPartyDance20ActivityAI.py index 2b8f0eaa..659f759b 100755 --- a/toontown/parties/DistributedPartyDance20ActivityAI.py +++ b/toontown/parties/DistributedPartyDance20ActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyDanceActivityBaseAI import DistributedPart class DistributedPartyDance20ActivityAI(DistributedPartyDanceActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyDance20ActivityAI") + diff --git a/toontown/parties/DistributedPartyDanceActivityAI.py b/toontown/parties/DistributedPartyDanceActivityAI.py index 7d78271a..53489582 100755 --- a/toontown/parties/DistributedPartyDanceActivityAI.py +++ b/toontown/parties/DistributedPartyDanceActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyDanceActivityBaseAI import DistributedPart class DistributedPartyDanceActivityAI(DistributedPartyDanceActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyDanceActivityAI") + diff --git a/toontown/parties/DistributedPartyDanceActivityBaseAI.py b/toontown/parties/DistributedPartyDanceActivityBaseAI.py index 19e651cd..6c1fecf1 100755 --- a/toontown/parties/DistributedPartyDanceActivityBaseAI.py +++ b/toontown/parties/DistributedPartyDanceActivityBaseAI.py @@ -5,12 +5,12 @@ import PartyGlobals class DistributedPartyDanceActivityBaseAI(DistributedPartyActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyDanceActivityBaseAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyActivityAI.__init__(self, air, parent, activityTuple) self.toons = [] self.headings = [] - + def generate(self): DistributedPartyActivityAI.generate(self) self.sendUpdate('setState', ['Active', globalClockDelta.getRealNetworkTime()]) @@ -22,7 +22,7 @@ class DistributedPartyDanceActivityBaseAI(DistributedPartyActivityAI): return self.sendUpdate('setDancingToonState', [avId, state, anim]) - + def toonJoinRequest(self): avId = self.air.getAvatarIdFromSender() if avId in self.toons: @@ -35,7 +35,7 @@ class DistributedPartyDanceActivityBaseAI(DistributedPartyActivityAI): self.toons.append(avId) self.headings.append(av.getH()) self.sendUpdate('setToonsPlaying', [self.toons, self.headings]) - + def toonExitRequest(self): avId = self.air.getAvatarIdFromSender() if not avId in self.toons: @@ -44,4 +44,4 @@ class DistributedPartyDanceActivityBaseAI(DistributedPartyActivityAI): index = self.toons.index(avId) self.toons.remove(avId) self.headings.pop(index) - self.sendUpdate('setToonsPlaying', [self.toons, self.headings]) + self.sendUpdate('setToonsPlaying', [self.toons, self.headings]) \ No newline at end of file diff --git a/toontown/parties/DistributedPartyFireworksActivity.py b/toontown/parties/DistributedPartyFireworksActivity.py index e0b164b2..ea0def43 100755 --- a/toontown/parties/DistributedPartyFireworksActivity.py +++ b/toontown/parties/DistributedPartyFireworksActivity.py @@ -35,7 +35,7 @@ class DistributedPartyFireworksActivity(DistributedPartyActivity, FireworkShowMi def setShowStyle(self, showStyle): DistributedPartyFireworksActivity.notify.debug('setShowStyle( %d )' % showStyle) self.showStyle = showStyle - + def setSongId(self, songId): self.songId = songId diff --git a/toontown/parties/DistributedPartyFireworksActivityAI.py b/toontown/parties/DistributedPartyFireworksActivityAI.py index 27f3622a..b4ce4a34 100755 --- a/toontown/parties/DistributedPartyFireworksActivityAI.py +++ b/toontown/parties/DistributedPartyFireworksActivityAI.py @@ -8,18 +8,18 @@ import random class DistributedPartyFireworksActivityAI(DistributedPartyActivityAI, FSM): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyFireworksActivityAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyActivityAI.__init__(self, air, parent, activityTuple) FSM.__init__(self, 'DistributedPartyActivityAI') self.state = 'Idle' - + def getEventId(self): return PartyGlobals.FireworkShows.Summer - + def getShowStyle(self): return random.randint(0, len(FireworkShows.shows[PartyGlobals.FireworkShows.Summer]) - 1) - + def getSongId(self): return random.randint(0, 1) @@ -33,6 +33,6 @@ class DistributedPartyFireworksActivityAI(DistributedPartyActivityAI, FSM): def enterActive(self): self.sendUpdate('setState', ['Active', globalClockDelta.getRealNetworkTime()]) - + def enterIdle(self): - self.sendUpdate('setState', ['Idle', globalClockDelta.getRealNetworkTime()]) + self.sendUpdate('setState', ['Idle', globalClockDelta.getRealNetworkTime()]) \ No newline at end of file diff --git a/toontown/parties/DistributedPartyJukebox40ActivityAI.py b/toontown/parties/DistributedPartyJukebox40ActivityAI.py index 576d825e..d392b804 100755 --- a/toontown/parties/DistributedPartyJukebox40ActivityAI.py +++ b/toontown/parties/DistributedPartyJukebox40ActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyJukeboxActivityBaseAI import DistributedPa class DistributedPartyJukebox40ActivityAI(DistributedPartyJukeboxActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyJukebox40ActivityAI") + diff --git a/toontown/parties/DistributedPartyJukeboxActivityAI.py b/toontown/parties/DistributedPartyJukeboxActivityAI.py index edc65083..7cef2a1f 100755 --- a/toontown/parties/DistributedPartyJukeboxActivityAI.py +++ b/toontown/parties/DistributedPartyJukeboxActivityAI.py @@ -4,7 +4,8 @@ import PartyGlobals class DistributedPartyJukeboxActivityAI(DistributedPartyJukeboxActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyJukeboxActivityAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyJukeboxActivityBaseAI.__init__(self, air, parent, activityTuple) self.music = PartyGlobals.PhaseToMusicData + diff --git a/toontown/parties/DistributedPartyJukeboxActivityBaseAI.py b/toontown/parties/DistributedPartyJukeboxActivityBaseAI.py index bb732470..d9b36b95 100755 --- a/toontown/parties/DistributedPartyJukeboxActivityBaseAI.py +++ b/toontown/parties/DistributedPartyJukeboxActivityBaseAI.py @@ -127,4 +127,4 @@ class DistributedPartyJukeboxActivityBaseAI(DistributedPartyActivityAI): self.queue.insert(0, song) for toon in self.toonsPlaying: - self.sendUpdateToAvatarId(toon, 'moveHostSongToTop', []) + self.sendUpdateToAvatarId(toon, 'moveHostSongToTop', []) \ No newline at end of file diff --git a/toontown/parties/DistributedPartyTeamActivityAI.py b/toontown/parties/DistributedPartyTeamActivityAI.py index af3ecd30..3c45e2d2 100755 --- a/toontown/parties/DistributedPartyTeamActivityAI.py +++ b/toontown/parties/DistributedPartyTeamActivityAI.py @@ -33,3 +33,4 @@ class DistributedPartyTeamActivityAI(DistributedPartyActivityAI): def switchTeamRequestDenied(self, todo0): pass + diff --git a/toontown/parties/DistributedPartyTrampolineActivityAI.py b/toontown/parties/DistributedPartyTrampolineActivityAI.py index 8f4bcc3c..103d6e91 100755 --- a/toontown/parties/DistributedPartyTrampolineActivityAI.py +++ b/toontown/parties/DistributedPartyTrampolineActivityAI.py @@ -8,7 +8,7 @@ import PartyGlobals class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyTrampolineActivityAI") - + def __init__(self, air, parent, activityTuple): DistributedPartyActivityAI.__init__(self, air, parent, activityTuple) FSM.__init__(self, 'DistributedPartyTrampolineActivityAI') @@ -16,7 +16,7 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): self.record = 0 self.jellybeans = [] self.collected = 0 - + def generate(self): self.demand('Idle') @@ -44,7 +44,7 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): # Ideally, we shouldn't even be passing strings that *should* be localized. self.sendUpdateToAvatarId(avId, 'showJellybeanReward', [reward, av.getMoney(), message]) av.addMoney(reward) - + def reportHeightInformation(self, height): avId = self.air.getAvatarIdFromSender() @@ -57,21 +57,21 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): self.sendUpdate('setBestHeightInfo', [av.getName(), height]) else: self.air.writeServerEvent('suspicious',avId,'Toon incorrectly reported height!') - + def enterActive(self): self.jellybeans = range(PartyGlobals.TrampolineNumJellyBeans) taskMgr.doMethodLater(PartyGlobals.TrampolineDuration, self.sendUpdate, 'exitTrampoline%d' % self.doId, extraArgs=['leaveTrampoline', []]) self.sendUpdate('setState', ['Active', globalClockDelta.getRealNetworkTime()]) self.collected = 0 - + def enterIdle(self): self.sendUpdate('setState', ['Idle', globalClockDelta.getRealNetworkTime()]) self.currentAv = 0 self.updateToonsPlaying() - + def enterRules(self): self.sendUpdate('setState', ['Rules', globalClockDelta.getRealNetworkTime()]) - + def requestAnim(self, anim): avId = self.air.getAvatarIdFromSender() if self.state != 'Active': @@ -97,7 +97,7 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): else: self.collected += 1 self.sendUpdate('removeBeansEcho', [beans]) - + def updateToonsPlaying(self): if self.currentAv == 0: self.sendUpdate('setToonsPlaying', [[]]) @@ -118,7 +118,7 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): if self.state != 'Active': self.air.writeServerEvent('suspicious',avId,'Toon tried to leave a trampoline that was not running!') return - if self.currentAv != avId: + if self.currentAv != avId: self.air.writeServerEvent('suspicious',avId,'Toon tried to exit trampoline for someone else!') return taskMgr.remove('exitTrampoline'%self.doId) @@ -130,7 +130,7 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): self.air.writeServerEvent('suspicious',avId,'Toon tried to exit trampoline they\'re not using!') return self.demand('Idle') - + def toonReady(self): avId = self.air.getAvatarIdFromSender() if self.state != 'Rules': @@ -140,3 +140,6 @@ class DistributedPartyTrampolineActivityAI(DistributedPartyActivityAI, FSM): self.air.writeServerEvent('suspicious',avId,'Toon tried to verify rules for someone else!') return self.demand('Active') + + + diff --git a/toontown/parties/DistributedPartyTugOfWarActivityAI.py b/toontown/parties/DistributedPartyTugOfWarActivityAI.py index 96f4634f..51276dbe 100755 --- a/toontown/parties/DistributedPartyTugOfWarActivityAI.py +++ b/toontown/parties/DistributedPartyTugOfWarActivityAI.py @@ -18,3 +18,4 @@ class DistributedPartyTugOfWarActivityAI(DistributedPartyTeamActivityAI): def updateToonPositions(self, todo0): pass + diff --git a/toontown/parties/DistributedPartyValentineDance20ActivityAI.py b/toontown/parties/DistributedPartyValentineDance20ActivityAI.py index 68f80906..a9a13c51 100755 --- a/toontown/parties/DistributedPartyValentineDance20ActivityAI.py +++ b/toontown/parties/DistributedPartyValentineDance20ActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyDanceActivityBaseAI import DistributedPart class DistributedPartyValentineDance20ActivityAI(DistributedPartyDanceActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyValentineDance20ActivityAI") + diff --git a/toontown/parties/DistributedPartyValentineDanceActivityAI.py b/toontown/parties/DistributedPartyValentineDanceActivityAI.py index 6575d0b7..7f4c0e20 100755 --- a/toontown/parties/DistributedPartyValentineDanceActivityAI.py +++ b/toontown/parties/DistributedPartyValentineDanceActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyDanceActivityBaseAI import DistributedPart class DistributedPartyValentineDanceActivityAI(DistributedPartyDanceActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyValentineDanceActivityAI") + diff --git a/toontown/parties/DistributedPartyValentineJukebox40ActivityAI.py b/toontown/parties/DistributedPartyValentineJukebox40ActivityAI.py index 1004610f..9218195d 100755 --- a/toontown/parties/DistributedPartyValentineJukebox40ActivityAI.py +++ b/toontown/parties/DistributedPartyValentineJukebox40ActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyJukeboxActivityBaseAI import DistributedPa class DistributedPartyValentineJukebox40ActivityAI(DistributedPartyJukeboxActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyValentineJukebox40ActivityAI") + diff --git a/toontown/parties/DistributedPartyValentineJukeboxActivityAI.py b/toontown/parties/DistributedPartyValentineJukeboxActivityAI.py index 6239747e..84e031af 100755 --- a/toontown/parties/DistributedPartyValentineJukeboxActivityAI.py +++ b/toontown/parties/DistributedPartyValentineJukeboxActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyJukeboxActivityBaseAI import DistributedPa class DistributedPartyValentineJukeboxActivityAI(DistributedPartyJukeboxActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyValentineJukeboxActivityAI") + diff --git a/toontown/parties/DistributedPartyValentineTrampolineActivityAI.py b/toontown/parties/DistributedPartyValentineTrampolineActivityAI.py index 884a537b..fa073533 100755 --- a/toontown/parties/DistributedPartyValentineTrampolineActivityAI.py +++ b/toontown/parties/DistributedPartyValentineTrampolineActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyTrampolineActivityAI import DistributedPar class DistributedPartyValentineTrampolineActivityAI(DistributedPartyTrampolineActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyValentineTrampolineActivityAI") + diff --git a/toontown/parties/DistributedPartyVictoryTrampolineActivityAI.py b/toontown/parties/DistributedPartyVictoryTrampolineActivityAI.py index b32f900c..032480aa 100755 --- a/toontown/parties/DistributedPartyVictoryTrampolineActivityAI.py +++ b/toontown/parties/DistributedPartyVictoryTrampolineActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyTrampolineActivityAI import DistributedPar class DistributedPartyVictoryTrampolineActivityAI(DistributedPartyTrampolineActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyVictoryTrampolineActivityAI") + diff --git a/toontown/parties/DistributedPartyWinterCatchActivityAI.py b/toontown/parties/DistributedPartyWinterCatchActivityAI.py index 1ea5f5f1..247b3088 100755 --- a/toontown/parties/DistributedPartyWinterCatchActivityAI.py +++ b/toontown/parties/DistributedPartyWinterCatchActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyCatchActivityAI import DistributedPartyCat class DistributedPartyWinterCatchActivityAI(DistributedPartyCatchActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyWinterCatchActivityAI") + diff --git a/toontown/parties/DistributedPartyWinterCogActivityAI.py b/toontown/parties/DistributedPartyWinterCogActivityAI.py index 65360d68..44e31183 100755 --- a/toontown/parties/DistributedPartyWinterCogActivityAI.py +++ b/toontown/parties/DistributedPartyWinterCogActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyCogActivityAI import DistributedPartyCogAc class DistributedPartyWinterCogActivityAI(DistributedPartyCogActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyWinterCogActivityAI") + diff --git a/toontown/parties/DistributedPartyWinterTrampolineActivityAI.py b/toontown/parties/DistributedPartyWinterTrampolineActivityAI.py index d681a81e..ab9efe9b 100755 --- a/toontown/parties/DistributedPartyWinterTrampolineActivityAI.py +++ b/toontown/parties/DistributedPartyWinterTrampolineActivityAI.py @@ -3,3 +3,4 @@ from toontown.parties.DistributedPartyTrampolineActivityAI import DistributedPar class DistributedPartyWinterTrampolineActivityAI(DistributedPartyTrampolineActivityAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyWinterTrampolineActivityAI") + diff --git a/toontown/parties/GlobalPartyManager.py b/toontown/parties/GlobalPartyManager.py index 379afe04..2543e654 100755 --- a/toontown/parties/GlobalPartyManager.py +++ b/toontown/parties/GlobalPartyManager.py @@ -3,4 +3,4 @@ from direct.distributed.PyDatagram import * from direct.directnotify.DirectNotifyGlobal import directNotify class GlobalPartyManager(DistributedObjectGlobal): - notify = directNotify.newCategory('GlobalPartyManager') + notify = directNotify.newCategory('GlobalPartyManager') \ No newline at end of file diff --git a/toontown/parties/GlobalPartyManagerAI.py b/toontown/parties/GlobalPartyManagerAI.py index 650f50da..74d8bc85 100755 --- a/toontown/parties/GlobalPartyManagerAI.py +++ b/toontown/parties/GlobalPartyManagerAI.py @@ -4,7 +4,7 @@ from direct.directnotify.DirectNotifyGlobal import directNotify class GlobalPartyManagerAI(DistributedObjectGlobalAI): notify = directNotify.newCategory('GlobalPartyManagerAI') - + def announceGenerate(self): DistributedObjectGlobalAI.announceGenerate(self) # Inform the UD that we as an AI have started up, and tell him the doId of our partymanager, so they can talk @@ -12,42 +12,42 @@ class GlobalPartyManagerAI(DistributedObjectGlobalAI): def sendAddParty(self, avId, partyId, start, end, isPrivate, inviteTheme, activities, decorations, inviteeIds): self.sendUpdate('addParty', [avId, partyId, start, end, isPrivate, inviteTheme, activities, decorations, inviteeIds]) - + def queryPartyForHost(self, hostId): self.sendUpdate('queryParty', [hostId]) def d_partyStarted(self, partyId, shardId, zoneId, hostName): self.sendUpdate('partyHasStarted', [partyId, shardId, zoneId, hostName]) - + def partyStarted(self, partyId, shardId, zoneId, hostName): pass def d_partyDone(self, partyId): self.sendUpdate('partyDone', [partyId]) - + def partyDone(self, partyId): pass def d_toonJoinedParty(self, partyId, avId): self.sendUpdate('toonJoinedParty', [partyId, avId]) - + def toonJoinedParty(self, partyId, avId): pass def d_toonLeftParty(self, partyId, avId): self.sendUpdate('toonLeftParty', [partyId, avId]) - + def toonLeftParty(self, partyId, avId): pass - + def d_requestPartySlot(self, partyId, avId, gateId): self.sendUpdate('requestPartySlot', [partyId, avId, gateId]) - + def requestPartySlot(self, partyId, avId, gateId): pass def d_allocIds(self, numIds): self.sendUpdate('allocIds', [numIds]) - + def allocIds(self, numIds): pass diff --git a/toontown/parties/GlobalPartyManagerUD.py b/toontown/parties/GlobalPartyManagerUD.py index ace0c58e..1afc0129 100755 --- a/toontown/parties/GlobalPartyManagerUD.py +++ b/toontown/parties/GlobalPartyManagerUD.py @@ -10,7 +10,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): notify = directNotify.newCategory('GlobalPartyManagerUD') # This uberdog MUST be up before the AIs, as AIs talk to this UD - + def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GPMUD generated") @@ -39,7 +39,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): sender = self.air.getAvatarIdFromSender() dg = self._makeAIMsg(field, values, self.senders2Mgrs.get(sender, sender + 8)) self.air.send(dg) - + # GPMUD -> toon messaging def _makeAvMsg(self, field, values, recipient): return self.air.dclassesByName['DistributedToonUD'].getFieldByName(field).aiFormatUpdate(recipient, recipient, simbase.air.ourChannel, values) @@ -47,7 +47,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): def sendToAv(self, avId, field, values): dg = self._makeAvMsg(field, values, avId) self.air.send(dg) - + # Task stuff def runAtNextInterval(self): now = datetime.now() @@ -166,15 +166,15 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): self.__updatePartyCount(partyId) def partyManagerAIHello(self, channel): - # Upon AI boot, DistributedPartyManagerAIs are supposed to say hello. + # Upon AI boot, DistributedPartyManagerAIs are supposed to say hello. # They send along the DPMAI's doId as well, so that I can talk to them later. print 'AI with base channel %s, will send replies to DPM %s' % (simbase.air.getAvatarIdFromSender(), channel) self.senders2Mgrs[simbase.air.getAvatarIdFromSender()] = channel self.sendToAI('partyManagerUdStartingUp', []) - + # In addition, set up a postRemove where we inform this AI that the UD has died self.air.addPostRemove(self._makeAIMsg('partyManagerUdLost', [], channel)) - + def addParty(self, avId, partyId, start, end, isPrivate, inviteTheme, activities, decorations, inviteeIds): PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' print 'start time: %s' % start @@ -191,7 +191,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): taskMgr.remove('GlobalPartyManager_checkStarts') taskMgr.doMethodLater(15, self.__checkPartyStarts, 'GlobalPartyManager_checkStarts') return - + def queryParty(self, hostId): # An AI is wondering if the host has a party. We'll tell em! if hostId in self.host2PartyId: @@ -220,10 +220,10 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): self.__updatePartyCount(partyId) # note that they might not show up self.tempSlots[avId] = partyId - + #give the client a minute to connect before freeing their slot taskMgr.doMethodLater(60, self._removeTempSlot, 'partyManagerTempSlot%d' % avId, extraArgs=[avId]) - + # now format the pubPartyInfo actIds = [] for activity in self.id2Party[partyId]['activities']: @@ -236,7 +236,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): sender = simbase.air.getAvatarIdFromSender() # try to pretend the AI sent it. ily2 cfsworks dg = self.air.dclassesByName['DistributedPartyGateAI'].getFieldByName('setParty').aiFormatUpdate(gateId, recipient, sender, [info, hostId]) self.air.send(dg) - + def _removeTempSlot(self, avId): partyId = self.tempSlots.get(avId) if partyId: @@ -248,4 +248,4 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD): ids = [] while len(ids) < numIds: ids.append(self.partyAllocator.allocate()) - self.sendToAI('receiveId', ids) + self.sendToAI('receiveId', ids) \ No newline at end of file diff --git a/toontown/parties/ServerTimeGui.py b/toontown/parties/ServerTimeGui.py index 6adcc4b6..e4a76827 100755 --- a/toontown/parties/ServerTimeGui.py +++ b/toontown/parties/ServerTimeGui.py @@ -49,4 +49,4 @@ class ServerTimeGui(DirectFrame): self.hourLabel['text'] = self.hourLabel['text'][1:] self.minutesLabel['text'] = curServerDate.strftime('%M') self.amLabel['text'] = curServerDate.strftime(self.ampm) - return + return \ No newline at end of file diff --git a/toontown/pets/DistributedPetAI.py b/toontown/pets/DistributedPetAI.py index 705bec3f..0c00a561 100755 --- a/toontown/pets/DistributedPetAI.py +++ b/toontown/pets/DistributedPetAI.py @@ -637,7 +637,7 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke self.air.writeServerEvent('Late Pet Move Call', self.doId, ' ') taskMgr.remove(task.name) return Task.done - + numNearby = len(self.brain.nearbyAvs) - 1 minNearby = 5 if numNearby > minNearby: @@ -942,7 +942,7 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke def enableLockMover(self): if not hasattr(self, 'brain'): return - + if self.lockMoverEnabled == 0: self.brain._startMovie() self.lockMoverEnabled += 1 @@ -953,7 +953,7 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke def disableLockMover(self): if not hasattr(self, 'brain'): return - + if self.lockMoverEnabled > 0: self.lockMoverEnabled -= 1 if self.lockMoverEnabled == 0: diff --git a/toontown/quest/QuestMapGlobals.py b/toontown/quest/QuestMapGlobals.py index f1f042dd..08af68fa 100755 --- a/toontown/quest/QuestMapGlobals.py +++ b/toontown/quest/QuestMapGlobals.py @@ -67,4 +67,4 @@ CornerPosTable = {'daisys_garden_5200_english': [Point3(781.219727, 476.963623, 'daisys_garden_5100_english': [Point3(760.089722, 526.236206, 0), Point3(-139.510132, -373.3638, 0)], 'toontown_central_2300_english': [Point3(870.224243, 536.165771, 0), Point3(-89.175751, -423.234344, 0)], 'toontown_central_2100_english': [Point3(161.735336, -59.985107, 0), Point3(-512.664612, -734.385193, 0)], - 'the_burrrgh_3200_english': [Point3(429.647949, 561.224304, 0), Point3(-31.951935, 99.624283, 0)]} + 'the_burrrgh_3200_english': [Point3(429.647949, 561.224304, 0), Point3(-31.951935, 99.624283, 0)]} \ No newline at end of file diff --git a/toontown/quest/QuestParser.py b/toontown/quest/QuestParser.py index eee9b170..bce91616 100755 --- a/toontown/quest/QuestParser.py +++ b/toontown/quest/QuestParser.py @@ -40,13 +40,13 @@ def clear(): def readFile(): global curId script = StringIO.StringIO(QuestScripts.script) - + def readLine(): return script.readline().replace('\r', '') - + gen = tokenize.generate_tokens(readLine) line = getLineOfTokens(gen) - + while line is not None: if line == []: line = getLineOfTokens(gen) @@ -58,7 +58,7 @@ def readFile(): else: lineDict[curId].append(line) line = getLineOfTokens(gen) - + script.close() def getLineOfTokens(gen): @@ -889,12 +889,12 @@ class NPCMoviePlayer(DirectObject.DirectObject): return curGagLevel = newGagLevel access = [0, 0, 0, 0, 0, 0, 0] - + for i in xrange(len(self.oldTrackAccess)): access[i] = curGagLevel if self.oldTrackAccess[i] > 0 else 0 - + base.localAvatar.setTrackAccess(access) return Sequence(Func(grabCurTrackAccess), LerpFunctionInterval(updateGagLevel, fromData=1, toData=7, duration=0.3), WaitInterval(3.5), LerpFunctionInterval(updateGagLevel, fromData=7, toData=1, duration=0.3), Func(restoreTrackAccess), Func(messenger.send, 'donePreview')) -readFile() +readFile() \ No newline at end of file diff --git a/toontown/quest/QuestPoster.py b/toontown/quest/QuestPoster.py index 5c6ed9ea..35c75714 100755 --- a/toontown/quest/QuestPoster.py +++ b/toontown/quest/QuestPoster.py @@ -436,14 +436,14 @@ class QuestPoster(DirectFrame): frameBgColor = 'green' invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons') track1, track2 = quest.getChoices(base.localAvatar) - + lIconGeom = invModel.find('**/' + AvPropsNew[track1][1]) - + if not fComplete: auxText = TTLocalizer.QuestPosterAuxOr lPos.setX(-0.18) rIconGeom = invModel.find('**/' + AvPropsNew[track2][1]) - + infoText = TTLocalizer.QuestPageNameAndDestination % (toNpcName, toNpcBuildingName, toNpcStreetName, diff --git a/toontown/quest/QuestRewardCounter.py b/toontown/quest/QuestRewardCounter.py index faf74eb1..8bc91e19 100755 --- a/toontown/quest/QuestRewardCounter.py +++ b/toontown/quest/QuestRewardCounter.py @@ -78,7 +78,7 @@ class QuestRewardCounter: suitHp += 1 else: break - + self.notify.debug('Adding %s hp for cog suits' % suitHp) self.maxHp += suitHp kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup) diff --git a/toontown/quest/QuestScripts.py b/toontown/quest/QuestScripts.py index acea9782..271919d5 100755 --- a/toontown/quest/QuestScripts.py +++ b/toontown/quest/QuestScripts.py @@ -193,9 +193,9 @@ FUNCTION npc "stopLookAround" POS camera 0.0 6.0 4.0 HPR camera 180.0 0.0 0.0 LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_1 -WAIT 0.8 +WAIT 0.8 LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_2 -WAIT 0.8 +WAIT 0.8 POS camera -5.0 -9.0 6.0 HPR camera -25.0 -10.0 0.0 POS localToon 203.8 18.64 -0.475 @@ -204,8 +204,8 @@ SHOW localToon LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_3 OBSCURE_CHAT 1 0 SHOW chatScButton -WAIT 0.6 -ARROWS_ON -1.3644 0.91 180 -1.5644 0.74 -90 +WAIT 0.6 +ARROWS_ON -1.3644 0.91 180 -1.5644 0.74 -90 LOCAL_CHAT_PERSIST npc QuestScriptTutorialBlocker_4 WAIT_EVENT "enterSpeedChat" ARROWS_OFF @@ -217,17 +217,17 @@ CLEAR_CHAT localToon REPARENTTO camera localToon LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_5 "CFReversed" LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_6 "CFReversed" -OBSCURE_CHAT 0 0 +OBSCURE_CHAT 0 0 SHOW chatNormalButton -WAIT 0.6 +WAIT 0.6 LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_7 "CFReversed" LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_8 1 "CFReversed" LOOP_ANIM npc "walk" LERP_HPR npc 270 0 0 0.5 WAIT 0.5 LOOP_ANIM npc "run" -LERP_POS npc 217.4 18.81 -0.475 0.75 -LERP_HPR npc 240 0 0 0.75 +LERP_POS npc 217.4 18.81 -0.475 0.75 +LERP_HPR npc 240 0 0 0.75 WAIT 0.75 LERP_POS npc 222.4 15.0 -0.475 0.35 LERP_HPR npc 180 0 0 0.35 @@ -237,7 +237,7 @@ WAIT 0.75 REPARENTTO npc hidden FREE_LOCALTOON UPON_TIMEOUT ARROWS_OFF -UPON_TIMEOUT OBSCURE_CHAT 0 0 +UPON_TIMEOUT OBSCURE_CHAT 0 0 UPON_TIMEOUT REPARENTTO camera localToon FINISH_QUEST_MOVIE @@ -359,4 +359,4 @@ CHAT_CONFIRM npc QuestScript150_4 1 UPON_TIMEOUT HIDE_FRIENDS_LIST UPON_TIMEOUT ARROWS_OFF FINISH_QUEST_MOVIE -''' +''' \ No newline at end of file diff --git a/toontown/quest/Quests.py b/toontown/quest/Quests.py index dd7c6ca8..a59bd8ae 100755 --- a/toontown/quest/Quests.py +++ b/toontown/quest/Quests.py @@ -245,7 +245,7 @@ class Quest: def checkBuildingFloors(self, floors): self.check(floors >= 1 and floors <= 5, 'invalid num floors: %s' % floors) - + def checkBuildingType(self, cogdo): self.check(cogdo != 0 and cogdo != 1, 'invalid cogdo value: %s' % cogdo) @@ -1028,7 +1028,7 @@ class BuildingQuest(CogQuest): def getBuildingTrack(self): return self.quest[2] - + def isCogdo(self): return self.quest[4] @@ -1068,7 +1068,7 @@ class BuildingQuest(CogQuest): text = TTLocalizer.QuestsCogdoQuestDesc if count == 1 else TTLocalizer.QuestsCogdoQuestDescM else: floors = TTLocalizer.QuestsBuildingQuestFloorNumbers[self.getNumFloors() - 1] - + if count == 1: text = TTLocalizer.QuestsBuildingQuestDesc if floors == '' else TTLocalizer.QuestsBuildingQuestDescF else: @@ -1087,12 +1087,12 @@ class BuildingQuest(CogQuest): count = self.getNumBuildings() buildingTrack = self.getBuildingTrack() floors = '' - + if buildingTrack == Any: type = TTLocalizer.Cog else: type = self.trackNames[self.trackCodes.index(buildingTrack)] - + if self.isCogdo(): if buildingTrack == Any: text = TTLocalizer.QuestsCogdoQuestDescU if count == 1 else TTLocalizer.QuestsCogdoQuestDescMUI @@ -1100,7 +1100,7 @@ class BuildingQuest(CogQuest): text = TTLocalizer.QuestsCogdoQuestDesc if count == 1 else TTLocalizer.QuestsCogdoQuestDescMI else: floors = TTLocalizer.QuestsBuildingQuestFloorNumbers[self.getNumFloors() - 1] - + if count == 1: text = TTLocalizer.QuestsBuildingQuestDesc if floors == '' else TTLocalizer.QuestsBuildingQuestDescF else: @@ -1744,7 +1744,7 @@ class TrackChoiceQuest(Quest): trackAccess = av.getTrackAccess() first = None second = None - + for i in xrange(len(trackAccess)): if trackAccess[i] == 0: if first is None: @@ -1752,10 +1752,10 @@ class TrackChoiceQuest(Quest): elif second is None: second = i break - + if first is None or second is None: return (0, 1) - + return (first, second) def getCompletionStatus(self, av, questDesc, npc = None): @@ -4225,7 +4225,7 @@ class TrackTrainingReward(Reward): if track == None: track = 0 trackAccess = av.getTrackAccess() - + for i in xrange(len(trackAccess)): if trackAccess[i] == 0: return i diff --git a/toontown/racing/DistributedGagAI.py b/toontown/racing/DistributedGagAI.py index adaf6ebe..4ab4285c 100755 --- a/toontown/racing/DistributedGagAI.py +++ b/toontown/racing/DistributedGagAI.py @@ -3,46 +3,47 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedGagAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedGagAI") - + def __init__(self, air): DistributedObjectAI.__init__(self, air) self.owner = 0 def setInitTime(self, initTime): self.initTime = initTime - + def getInitTime(self): return self.initTime def setActivateTime(self, activateTime): self.activateTime = activateTime - + def getActivateTime(self): return self.activateTime def setPos(self, x, y, z): self.pos = [x, y, z] - + def getPos(self): return self.pos def setRace(self, raceId): self.race = self.air.doId2do[raceId] - + def getRace(self): return self.race.getDoId() def setOwnerId(self, ownerId): self.owner = ownerId - + def getOwnerId(self): return self.owner def setType(self, type): self.type = type - + def getType(self): return self.type def hitSomebody(self, avId, timestamp): self.requestDelete() + diff --git a/toontown/racing/DistributedKartPadAI.py b/toontown/racing/DistributedKartPadAI.py index 118f32c8..ff9a0feb 100755 --- a/toontown/racing/DistributedKartPadAI.py +++ b/toontown/racing/DistributedKartPadAI.py @@ -3,32 +3,32 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedKartPadAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedKartPadAI") - + def __init__(self, air): DistributedObjectAI.__init__(self, air) self.air = air self.startingBlocks = [] self.area = None - + def setArea(self, area): self.area = area - + def d_setArea(self, area): self.sendUpdate('setArea', [area]) - + def b_setArea(self, area): self.setArea(area) self.d_setArea(self, area) - + def getArea(self): return self.area def addStartingBlock(self, block): self.startingBlocks.append(block) - + def updateMovieState(self): pass - + def removeStartingBlock(self, block): if self.startingBlocks.count(block): self.startingBlocks.remove(block) diff --git a/toontown/racing/DistributedLeaderBoardAI.py b/toontown/racing/DistributedLeaderBoardAI.py index ab82ef80..96e3c0c9 100755 --- a/toontown/racing/DistributedLeaderBoardAI.py +++ b/toontown/racing/DistributedLeaderBoardAI.py @@ -9,3 +9,4 @@ class DistributedLeaderBoardAI(DistributedObjectAI): def setDisplay(self, todo0): pass + diff --git a/toontown/racing/DistributedProjectileAI.py b/toontown/racing/DistributedProjectileAI.py index 33a4ca0b..e2a641c9 100755 --- a/toontown/racing/DistributedProjectileAI.py +++ b/toontown/racing/DistributedProjectileAI.py @@ -21,3 +21,4 @@ class DistributedProjectileAI(DistributedObjectAI): def hitSomebody(self, todo0, todo1): pass + diff --git a/toontown/racing/DistributedRacePadAI.py b/toontown/racing/DistributedRacePadAI.py index 3d90a620..eca1573c 100755 --- a/toontown/racing/DistributedRacePadAI.py +++ b/toontown/racing/DistributedRacePadAI.py @@ -19,7 +19,7 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): 'AllAboard'], 'WaitBoarding': ['AllAboard', 'WaitEmpty', 'Off'], 'AllAboard': ['Off', 'WaitEmpty', 'WaitCountdown']} - + def __init__(self, air): DistributedKartPadAI.__init__(self, air) FSM.__init__(self, 'DistributedRacePadAI') @@ -29,49 +29,49 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): self.shouldStart = False self.index = -1 self.nameType = 'urban' - + def generate(self): - DistributedKartPadAI.generate(self) + DistributedKartPadAI.generate(self) self.b_setState('WaitEmpty', globalClockDelta.getRealNetworkTime()) - + def enterOff(self): pass - + def exitOff(self): pass - + def enterWaitEmpty(self): for block in self.startingBlocks: block.b_setOccupied(0) self.shouldStart = False taskMgr.doMethodLater(30, DistributedRacePadAI.changeTrack, 'changeTrack%i' % self.doId, [self]) - + def exitWaitEmpty(self): taskMgr.remove('changeTrack%i' % self.doId) - + def enterWaitCountdown(self): taskMgr.doMethodLater(30, DistributedRacePadAI.startRace, 'startRace%i' % self.doId, [self]) - + def exitWaitCountdown(self): taskMgr.remove('startRace%i' % self.doId) - + def enterWaitBoarding(self): pass - + def exitWaitBoarding(self): pass - + def enterAllAboard(self): taskMgr.doMethodLater(2, DistributedRacePadAI.createRace, 'createRace%i' % self.doId, [self]) - + def exitAllAboard(self): pass - + def changeTrack(self): nri = RaceGlobals.getNextRaceInfo(self.trackId, self.nameType, self.index) self.b_setTrackInfo([nri[0], nri[1]]) taskMgr.doMethodLater(30, DistributedRacePadAI.changeTrack, 'changeTrack%i' % self.doId, [self]) - + def updateTimer(self): hasAvatars = False for block in self.startingBlocks: @@ -82,7 +82,7 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): self.b_setState('WaitCountdown', globalClockDelta.getRealNetworkTime()) elif not hasAvatars and self.state == 'WaitCountdown': self.b_setState('WaitEmpty', globalClockDelta.getRealNetworkTime()) - + def updateMovieState(self): if self.state == 'WaitBoarding': for block in self.startingBlocks: @@ -112,7 +112,7 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): self.b_setState('WaitEmpty', globalClockDelta.getRealNetworkTime()) return self.b_setState('AllAboard', globalClockDelta.getRealNetworkTime()) - + def createRace(self): self.raceZone = self.air.allocateZone() avatars = [] @@ -143,29 +143,30 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): def setState(self, state, timeStamp): self.lastTime = globalClockDelta.getRealNetworkTime() self.request(state) - + def d_setState(self, state, timeStamp): self.sendUpdate('setState', [state, timeStamp]) - + def b_setState(self, state, timeStamp): self.setState(state, timeStamp) self.d_setState(state, timeStamp) - + def getState(self): return [self.state, self.lastTime] - + def setRaceZone(self, todo0): pass - + def getTrackInfo(self): return [self.trackId, self.trackType] - + def setTrackInfo(self, trackInfo): self.trackId, self.trackType = trackInfo - + def d_setTrackInfo(self, trackInfo): self.sendUpdate('setTrackInfo', [trackInfo]) - + def b_setTrackInfo(self, trackInfo): self.setTrackInfo(trackInfo) self.d_setTrackInfo(trackInfo) + diff --git a/toontown/racing/DistributedStartingBlock.py b/toontown/racing/DistributedStartingBlock.py index 66f9e3a3..bbeb332a 100755 --- a/toontown/racing/DistributedStartingBlock.py +++ b/toontown/racing/DistributedStartingBlock.py @@ -115,7 +115,7 @@ class DistributedStartingBlock(DistributedObject.DistributedObject, FSM): self.setPad(self.cr.doId2do[padDoId]) else: self.acceptOnce('generate-%d' % padDoId, self.setPad) - + def setPad(self, pad): self.kartPad = pad self.kartPad.addStartingBlock(self) diff --git a/toontown/racing/DistributedStartingBlockAI.py b/toontown/racing/DistributedStartingBlockAI.py index 30e8fdba..2ccafd77 100755 --- a/toontown/racing/DistributedStartingBlockAI.py +++ b/toontown/racing/DistributedStartingBlockAI.py @@ -5,7 +5,7 @@ from toontown.racing import RaceGlobals class DistributedStartingBlockAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedStartingBlockAI") - + def __init__(self, air): DistributedObjectAI.__init__(self, air) self.air = air @@ -16,19 +16,19 @@ class DistributedStartingBlockAI(DistributedObjectAI): def setPadDoId(self, padDoId): self.pad = self.air.doId2do[padDoId] - + def getPadDoId(self): return self.pad.getDoId() def setPosHpr(self, x, y, z, h, p, r): self.posHpr = [x, y, z, h, p, r] - + def getPosHpr(self): return self.posHpr - + def setPadLocationId(self, padLocationId): self.padLocationId = padLocationId - + def getPadLocationId(self): return self.padLocationId @@ -42,7 +42,7 @@ class DistributedStartingBlockAI(DistributedObjectAI): return if av.getTickets() < RaceGlobals.getEntryFee(self.pad.trackId, self.pad.trackType): self.sendUpdateToAvatarId(avId, 'rejectEnter', [KartGlobals.ERROR_CODE.eTickets]) - return + return if self.pad.state == 'AllAboard' or self.pad.state == 'WaitBoarding' : self.sendUpdateToAvatarId(avId, 'rejectEnter', [KartGlobals.ERROR_CODE.eBoardOver]) return @@ -53,7 +53,7 @@ class DistributedStartingBlockAI(DistributedObjectAI): return self.b_setOccupied(avId) self.b_setMovie(KartGlobals.ENTER_MOVIE) - + def rejectEnter(self, errCode): pass @@ -66,21 +66,21 @@ class DistributedStartingBlockAI(DistributedObjectAI): def setOccupied(self, avId): self.avId = avId self.pad.updateTimer() - + def d_setOccupied(self, avId): self.sendUpdate('setOccupied', [avId]) - + def b_setOccupied(self, avId): self.setOccupied(avId) self.d_setOccupied(avId) - + def setMovie(self, movie): self.currentMovie = movie self.pad.updateMovieState() - + def d_setMovie(self, movie): self.sendUpdate('setMovie', [movie]) - + def b_setMovie(self, movie): self.setMovie(movie) self.d_setMovie(movie) @@ -99,11 +99,11 @@ class DistributedStartingBlockAI(DistributedObjectAI): class DistributedViewingBlockAI(DistributedStartingBlockAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedViewingBlockAI") - + def __init__(self, air): DistributedStartingBlockAI.__init__(self, air) self.air = air - + def requestEnter(self): avId = self.air.getAvatarIdFromSender() av = self.air.doId2do[avId] @@ -118,7 +118,7 @@ class DistributedViewingBlockAI(DistributedStartingBlockAI): self.b_setOccupied(avId) self.b_setMovie(KartGlobals.ENTER_MOVIE) taskMgr.doMethodLater(30, DistributedViewingBlockAI.b_setMovie, 'removePlayer%i' % self.doId, [self, KartGlobals.EXIT_MOVIE]) - + def requestExit(self): DistributedStartingBlockAI.requestExit(self) taskMgr.remove('removePlayer%i' % self.doId) diff --git a/toontown/racing/DistributedViewPadAI.py b/toontown/racing/DistributedViewPadAI.py index df7bff07..aeba1310 100755 --- a/toontown/racing/DistributedViewPadAI.py +++ b/toontown/racing/DistributedViewPadAI.py @@ -4,23 +4,24 @@ from direct.distributed.ClockDelta import * class DistributedViewPadAI(DistributedKartPadAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedViewPadAI") - + def __init__(self, air): DistributedKartPadAI.__init__(self, air) self.timestamp = globalClockDelta.getRealNetworkTime() - + def setLastEntered(self, timestamp): self.timestamp = timestamp - + def d_setLastEntered(self, timestamp): self.sendUpdate('setLastEntered', [timestamp]) - + def b_setLastEntered(self, timestamp): self.setLastEntered(timestamp) self.d_setLastEntered(timestamp) - + def getLastEntered(self): return self.timestamp - + def updateTimer(self): self.b_setLastEntered(globalClockDelta.getRealNetworkTime()) + diff --git a/toontown/safezone/BRPlayground.py b/toontown/safezone/BRPlayground.py index 9138dea5..4a9fb253 100755 --- a/toontown/safezone/BRPlayground.py +++ b/toontown/safezone/BRPlayground.py @@ -15,4 +15,4 @@ class BRPlayground(Playground.Playground): base.playSfx(random.choice(self.loader.windSound)) time = random.random() * 8.0 + 1 taskMgr.doMethodLater(time, self.__windTask, 'BR-wind') - return Task.done + return Task.done \ No newline at end of file diff --git a/toontown/safezone/BRSafeZoneLoader.py b/toontown/safezone/BRSafeZoneLoader.py index 01402188..fbae63be 100755 --- a/toontown/safezone/BRSafeZoneLoader.py +++ b/toontown/safezone/BRSafeZoneLoader.py @@ -36,4 +36,4 @@ class BRSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): def exit(self): SafeZoneLoader.SafeZoneLoader.exit(self) self.snow.cleanup() - self.snowRender.removeNode() + self.snowRender.removeNode() \ No newline at end of file diff --git a/toontown/safezone/DDSafeZoneLoader.py b/toontown/safezone/DDSafeZoneLoader.py index 977ce257..5ba6d683 100755 --- a/toontown/safezone/DDSafeZoneLoader.py +++ b/toontown/safezone/DDSafeZoneLoader.py @@ -37,7 +37,7 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): self.donald.setPos(0, -1, 3.95) self.donald.reparentTo(self.boat) self.donald.setHat(48, 0, 0) - + random.shuffle(TTLocalizer.DonaldChatter) self.donaldSpeech = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15) self.donaldSpeech.loop(0) diff --git a/toontown/safezone/DGPlayground.py b/toontown/safezone/DGPlayground.py index 7d6e8ded..6e72d2f8 100755 --- a/toontown/safezone/DGPlayground.py +++ b/toontown/safezone/DGPlayground.py @@ -15,4 +15,4 @@ class DGPlayground(Playground.Playground): base.playSfx(random.choice(self.loader.birdSound)) time = random.random() * 20.0 + 1 taskMgr.doMethodLater(time, self.__birds, 'DG-birds') - return Task.done + return Task.done \ No newline at end of file diff --git a/toontown/safezone/DGSafeZoneLoader.py b/toontown/safezone/DGSafeZoneLoader.py index be30a0a2..7b5870a7 100755 --- a/toontown/safezone/DGSafeZoneLoader.py +++ b/toontown/safezone/DGSafeZoneLoader.py @@ -20,4 +20,4 @@ class DGSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): def unload(self): SafeZoneLoader.SafeZoneLoader.unload(self) - del self.birdSound + del self.birdSound \ No newline at end of file diff --git a/toontown/safezone/DistributedCheckersAI.py b/toontown/safezone/DistributedCheckersAI.py index d2a8ad35..8ec45a1f 100755 --- a/toontown/safezone/DistributedCheckersAI.py +++ b/toontown/safezone/DistributedCheckersAI.py @@ -9,7 +9,7 @@ from direct.distributed.ClockDelta import * from toontown.safezone import CheckersBoard class DistributedCheckersAI(DistributedNodeAI): - + def __init__(self, air, parent, name, x, y, z, h, p, r): DistributedNodeAI.__init__(self, air) self.name = name @@ -94,22 +94,22 @@ class DistributedCheckersAI(DistributedNodeAI): 'waitingToBegin'])], 'waitingToBegin', 'waitingToBegin') self.fsm.enterInitialState() - + def announceGenerate(self): self.parent.setGameDoId(self.doId) - + def getTableDoId(self): return self.parentDo - + def delete(self): self.fsm.requestFinalState() self.board.delete() del self.fsm DistributedNodeAI.delete(self) - + def informGameOfPlayer(self): self.playersSitting += 1 if self.playersSitting < 2: @@ -121,11 +121,11 @@ class DistributedCheckersAI(DistributedNodeAI): 1]) elif self.playersSitting > 2: pass - + self.sendUpdate('setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def informGameOfPlayerLeave(self): self.playersSitting -= 1 if self.playersSitting < 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': @@ -133,7 +133,7 @@ class DistributedCheckersAI(DistributedNodeAI): self.parent.isAccepting = True self.parent.sendUpdate('setIsPlaying', [ 0]) - + if self.playersSitting > 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': pass 1 @@ -145,43 +145,43 @@ class DistributedCheckersAI(DistributedNodeAI): self.sendUpdate('setTimer', [ 0]) - + def setGameCountdownTime(self): self.timerEnd = globalClock.getRealTime() + 10 - + def setTurnCountdownTime(self): self.turnEnd = globalClock.getRealTime() + 40 - + def getTimer(self): if self.timerEnd != 0: return 0 else: return 0 - + def getTurnTimer(self): return globalClockDelta.localToNetworkTime(self.turnEnd) - + def requestTimer(self): avId = self.air.getAvatarIdFromSender() self.sendUpdateToAvatarId(avId, 'setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def handlePlayerExit(self, avId): if avId in self.wantStart: self.wantStart.remove(avId) - + if self.fsm.getCurrentState().getName() == 'playing': gamePos = self.playersGamePos.index(avId) self.playersGamePos[gamePos] = None self.fsm.request('gameOver') + - - + def handleEmptyGame(self): self.movesMade = 0 self.playersTurn = 1 @@ -189,29 +189,29 @@ class DistributedCheckersAI(DistributedNodeAI): self.fsm.request('waitingToBegin') self.parent.isAccepting = True - + def requestWin(self): avId = self.air.getAvatarIdFromSender() - + def distributeLaffPoints(self): for x in self.parent.seats: if x != None: av = self.air.doId2do.get(x) av.toonUp(self.winLaffPoints) continue + - - + def enterWaitingToBegin(self): self.setGameCountdownTime() self.parent.isAccepting = True - + def exitWaitingToBegin(self): self.turnEnd = 0 - + def enterPlaying(self): self.parent.isAccepting = False for x in self.playersGamePos: @@ -220,16 +220,16 @@ class DistributedCheckersAI(DistributedNodeAI): self.d_sendTurn(self.playersTurn + 1) break continue - + self.setTurnCountdownTime() self.sendUpdate('setTurnTimer', [ globalClockDelta.localToNetworkTime(self.turnEnd)]) - + def exitPlaying(self): pass - + def enterGameOver(self): self.timerEnd = 0 isAccepting = True @@ -250,33 +250,33 @@ class DistributedCheckersAI(DistributedNodeAI): self.parent.isAccepting = True self.fsm.request('waitingToBegin') - + def exitGameOver(self): pass - + def requestBegin(self): avId = self.air.getAvatarIdFromSender() if avId not in self.wantStart: self.wantStart.append(avId) - + numPlayers = 0 for x in self.parent.seats: if x != None: numPlayers = numPlayers + 1 continue - + if len(self.wantStart) == numPlayers and numPlayers >= 2: self.d_gameStart(avId) self.parent.sendIsPlaying() + - - + def d_gameStart(self, avId): for x in self.playersObserving: self.sendUpdateToAvatarId(x, 'gameStart', [ 255]) - + zz = 0 numPlayers = 0 for x in self.parent.seats: @@ -284,7 +284,7 @@ class DistributedCheckersAI(DistributedNodeAI): numPlayers += 1 self.playersPlaying.append(x) continue - + if numPlayers == 2: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -292,26 +292,26 @@ class DistributedCheckersAI(DistributedNodeAI): self.playersGamePos[0] = player1 for x in self.startingPositions[0]: self.board.setState(x, 1) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 2]) self.playersGamePos[1] = player2 for x in self.startingPositions[1]: self.board.setState(x, 2) - - + + self.sendGameState([]) self.wantStart = [] self.fsm.request('playing') self.parent.getTableState() - + def d_sendTurn(self, playersTurn): self.sendUpdate('sendTurn', [ playersTurn]) - + def advancePlayerTurn(self): if self.playersTurn == 0: self.playersTurn = 1 @@ -320,7 +320,7 @@ class DistributedCheckersAI(DistributedNodeAI): self.playerNum = 1 self.playersTurn = 0 - + def requestMove(self, moveList): if self.checkLegalMoves(moveList) == True: self.makeMove(moveList) @@ -334,7 +334,7 @@ class DistributedCheckersAI(DistributedNodeAI): self.sendUpdateToAvatarId(avId, 'illegalMove', []) self.air.writeServerEvent('suspicious', avId, 'has requested an illegal move in Regular checkers - not possible') - + def checkLegalMoves(self, moveList): if self.board.squareList[moveList[0]].getState() >= 3: moveType = 'king' @@ -353,28 +353,28 @@ class DistributedCheckersAI(DistributedNodeAI): else: return True return False - + elif len(moveList) > 2: for x in range(len(moveList) - 1): y = self.checkLegalJump(self.board.getSquare(moveList[x]), self.board.getSquare(moveList[x + 1]), moveType) if y == False: return False continue - + return True + - - + def makeMove(self, moveList): for x in range(len(moveList) - 1): firstSquare = self.board.squareList[moveList[x]] secondSquare = self.board.squareList[moveList[x + 1]] if firstSquare.getNum() in secondSquare.getAdjacent(): break - + index = firstSquare.jumps.index(secondSquare.getNum()) self.board.squareList[firstSquare.getAdjacent()[index]].setState(0) - + haveMoved = False squareState = self.board.squareList[moveList[0]].getState() if squareState <= 2: @@ -397,31 +397,31 @@ class DistributedCheckersAI(DistributedNodeAI): self.board.squareList[lastElement].setState(3) haveMoved = True self.sendGameState(moveList) - + elif lastElement in self.kingPositions[1]: self.board.squareList[moveList[0]].setState(0) self.board.squareList[lastElement].setState(4) haveMoved = True self.sendGameState(moveList) - - + + if haveMoved == False: spot1 = self.board.squareList[moveList[0]].getState() self.board.squareList[moveList[0]].setState(0) self.board.squareList[moveList[len(moveList) - 1]].setState(spot1) self.sendGameState(moveList) - + temp = self.playerNum self.playerNum = 1 if self.hasWon == True: return None - + if self.hasPeicesAndMoves(1, 3) == False: self.parent.announceWinner('Checkers', self.playersPlaying[1]) self.fsm.request('gameOver') self.hasWon = True return None - + self.playerNum = temp temp = self.playerNum self.playerNum = 2 @@ -430,63 +430,63 @@ class DistributedCheckersAI(DistributedNodeAI): self.fsm.request('gameOver') self.hasWon = True return None - + self.playerNum = temp - + def hasPeicesAndMoves(self, normalNum, kingNum): for x in self.board.squareList: if x.getState() == normalNum: if self.existsLegalMovesFrom(x.getNum(), 'normal') == True: return True - + if self.existsLegalJumpsFrom(x.getNum(), 'normal') == True: return True - + self.existsLegalJumpsFrom(x.getNum(), 'normal') == True if x.getState() == kingNum: if self.existsLegalMovesFrom(x.getNum(), 'king') == True: return True - + if self.existsLegalJumpsFrom(x.getNum(), 'king') == True: return True - + self.existsLegalJumpsFrom(x.getNum(), 'king') == True - + return False - + def getState(self): return self.fsm.getCurrentState().getName() - + def getName(self): return self.name - + def getGameState(self): return [ self.board.getStates(), []] - + def sendGameState(self, moveList): gameState = self.board.getStates() self.sendUpdate('setGameState', [ gameState, moveList]) - + def clearBoard(self): for x in self.board.squareList: x.setState(0) + - - + def getPosHpr(self): return self.posHpr - + def existsLegalJumpsFrom(self, index, peice): if peice == 'king': for x in range(4): @@ -499,9 +499,9 @@ class DistributedCheckersAI(DistributedNodeAI): pass elif jump.getState() == 0: return True - + adj.getState() == self.playerNum + 2 - + return False elif peice == 'normal': if self.playerNum == 1: @@ -512,7 +512,7 @@ class DistributedCheckersAI(DistributedNodeAI): moveForward = [ 0, 3] - + for x in moveForward: if self.board.squareList[index].getAdjacent()[x] != None and self.board.squareList[index].getJumps()[x] != None: adj = self.board.squareList[self.board.squareList[index].getAdjacent()[x]] @@ -523,22 +523,22 @@ class DistributedCheckersAI(DistributedNodeAI): pass elif jump.getState() == 0: return True - + adj.getState() == self.playerNum + 2 - + return False + - - + def existsLegalMovesFrom(self, index, peice): if peice == 'king': for x in self.board.squareList[index].getAdjacent(): if x != None: if self.board.squareList[x].getState() == 0: return True - + self.board.squareList[x].getState() == 0 - + return False elif peice == 'normal': if self.playerNum == 1: @@ -549,19 +549,19 @@ class DistributedCheckersAI(DistributedNodeAI): moveForward = [ 0, 3] - + for x in moveForward: if self.board.squareList[index].getAdjacent()[x] != None: adj = self.board.squareList[self.board.squareList[index].getAdjacent()[x]] if adj.getState() == 0: return True - + adj.getState() == 0 - + return False + - - + def existsLegalJumpsFrom(self, index, peice): if peice == 'king': for x in range(4): @@ -574,9 +574,9 @@ class DistributedCheckersAI(DistributedNodeAI): pass elif jump.getState() == 0: return True - + adj.getState() == self.playerNum + 2 - + return False elif peice == 'normal': if self.playerNum == 1: @@ -587,7 +587,7 @@ class DistributedCheckersAI(DistributedNodeAI): moveForward = [ 0, 3] - + for x in moveForward: if self.board.squareList[index].getAdjacent()[x] != None and self.board.squareList[index].getJumps()[x] != None: adj = self.board.squareList[self.board.squareList[index].getAdjacent()[x]] @@ -598,13 +598,13 @@ class DistributedCheckersAI(DistributedNodeAI): pass elif jump.getState() == 0: return True - + adj.getState() == self.playerNum + 2 - + return False + - - + def checkLegalMove(self, firstSquare, secondSquare, peice): if self.playerNum == 1: moveForward = [ @@ -619,22 +619,22 @@ class DistributedCheckersAI(DistributedNodeAI): if firstSquare.getAdjacent()[x] != None: if self.board.squareList[firstSquare.getAdjacent()[x]].getState() == 0: return True - + self.board.squareList[firstSquare.getAdjacent()[x]].getState() == 0 - + return False elif peice == 'normal': for x in moveForward: if firstSquare.getAdjacent()[x] != None: if self.board.squareList[firstSquare.getAdjacent()[x]].getState() == 0: return True - + self.board.squareList[firstSquare.getAdjacent()[x]].getState() == 0 - + return False + - - + def checkLegalJump(self, firstSquare, secondSquare, peice): if self.playerNum == 1: moveForward = [ @@ -657,7 +657,7 @@ class DistributedCheckersAI(DistributedNodeAI): return True else: return False - + elif peice == 'normal': if secondSquare.getNum() in firstSquare.getJumps(): index = firstSquare.getJumps().index(secondSquare.getNum()) @@ -670,3 +670,6 @@ class DistributedCheckersAI(DistributedNodeAI): return False else: return False + + + diff --git a/toontown/safezone/DistributedChineseCheckersAI.py b/toontown/safezone/DistributedChineseCheckersAI.py index ff3f93d7..c7648720 100755 --- a/toontown/safezone/DistributedChineseCheckersAI.py +++ b/toontown/safezone/DistributedChineseCheckersAI.py @@ -9,7 +9,7 @@ from direct.distributed.ClockDelta import * from toontown.safezone import ChineseCheckersBoard class DistributedChineseCheckersAI(DistributedNodeAI): - + def __init__(self, air, parent, name, x, y, z, h, p, r): DistributedNodeAI.__init__(self, air) self.name = name @@ -125,15 +125,15 @@ class DistributedChineseCheckersAI(DistributedNodeAI): 'waitingToBegin'])], 'waitingToBegin', 'waitingToBegin') self.fsm.enterInitialState() - + def announceGenerate(self): self.parent.setGameDoId(self.doId) - + def getTableDoId(self): return self.parentDo - + def delete(self): self.fsm.requestFinalState() self.board.delete() @@ -141,7 +141,7 @@ class DistributedChineseCheckersAI(DistributedNodeAI): del self.fsm DistributedNodeAI.delete(self) - + def requestSeatPositions(self): avId = self.air.getAvatarIdFromSender() self.sendUpdateToAvatarId(avId, 'announceSeatPositions', [ @@ -149,7 +149,7 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.sendUpdateToAvatarId(avId, 'sendTurn', [ self.playersTurn + 1]) - + def informGameOfPlayer(self): self.playersSitting += 1 if self.playersSitting < 2: @@ -158,16 +158,16 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.timerEnd = globalClock.getRealTime() + 60 elif self.playersSitting > 2: pass - + self.sendUpdate('setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def informGameOfPlayerLeave(self): self.playersSitting -= 1 if self.playersSitting < 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': self.timerEnd = 0 - + if self.playersSitting > 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': pass 1 @@ -179,32 +179,32 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.sendUpdate('setTimer', [ 0]) - + def setGameCountdownTime(self): self.timerEnd = globalClock.getRealTime() + 60 - + def setTurnCountdownTime(self): self.turnEnd = globalClock.getRealTime() + 60 - + def getTimer(self): if self.timerEnd != 0: return 0 else: return 0 - + def getTurnTimer(self): return globalClockDelta.localToNetworkTime(self.turnEnd) - + def requestTimer(self): avId = self.air.getAvatarIdFromSender() self.sendUpdateToAvatarId(avId, 'setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def handlePlayerExit(self, avId): playerOrder = [ 1, @@ -215,7 +215,7 @@ class DistributedChineseCheckersAI(DistributedNodeAI): 6] if avId in self.wantStart: self.wantStart.remove(avId) - + playstate = self.fsm.getStateNamed('playing') if self.fsm.getCurrentState().getName() == 'playing': gamePos = self.playersGamePos.index(avId) @@ -224,18 +224,18 @@ class DistributedChineseCheckersAI(DistributedNodeAI): if x.getState() == gamePos + 1: x.setState(0) continue - + self.sendGameState([]) if self.playersTurn == gamePos: self.advancePlayerTurn() self.d_sendTurn(self.playersTurn + 1) - + remainingPlayers = 0 for x in self.playersGamePos: if x != None: remainingPlayers += 1 continue - + if remainingPlayers == 1: for x in self.playersGamePos: if x != None: @@ -254,77 +254,77 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersTurn = 1 self.fsm.request('waitingToBegin') - + def requestWin(self): avId = self.air.getAvatarIdFromSender() if avId not in self.playersGamePos: self.air.writeServerEvent('suspicious', avId, 'Has requested a Chinese Checkers win and is NOT playing! SeatList of the table - %s - PlayersGamePos - %s' % (self.parent.seats, self.playersGamePos)) return None - + requestWinGamePos = self.playersGamePos.index(avId) + 1 checkSquares = [] for x in self.board.squareList: if x.getState() == requestWinGamePos: checkSquares.append(x.getNum()) continue - + if requestWinGamePos == 1: if checkSquares == self.startingPositions[3]: self.distributeLaffPoints() self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - + elif requestWinGamePos == 2: if checkSquares == self.startingPositions[4]: self.distributeLaffPoints() self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - + elif requestWinGamePos == 3: if checkSquares == self.startingPositions[5]: self.distributeLaffPoints() self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - + elif requestWinGamePos == 4: if checkSquares == self.startingPositions[0]: self.distributeLaffPoints() self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - + elif requestWinGamePos == 5: if checkSquares == self.startingPositions[1]: self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - + elif requestWinGamePos == 6: if checkSquares == self.startingPositions[2]: self.distributeLaffPoints() self.fsm.request('gameOver') self.parent.announceWinner('Chinese Checkers', avId) - - + + self.parent = None - + def distributeLaffPoints(self): for x in self.parent.seats: if x != None: av = self.air.doId2do.get(x) av.toonUp(self.winLaffPoints) continue + - - + def enterWaitingToBegin(self): self.setGameCountdownTime() self.parent.isAccepting = True - + def exitWaitingToBegin(self): self.turnEnd = 0 - + def enterPlaying(self): self.parent.isAccepting = False for x in self.playersGamePos: @@ -333,16 +333,16 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.d_sendTurn(self.playersTurn + 1) break continue - + self.setTurnCountdownTime() self.sendUpdate('setTurnTimer', [ globalClockDelta.localToNetworkTime(self.turnEnd)]) - + def exitPlaying(self): pass - + def enterGameOver(self): self.timerEnd = 0 isAccepting = True @@ -362,33 +362,33 @@ class DistributedChineseCheckersAI(DistributedNodeAI): None] self.fsm.request('waitingToBegin') - + def exitGameOver(self): pass - + def requestBegin(self): avId = self.air.getAvatarIdFromSender() if avId not in self.wantStart: self.wantStart.append(avId) - + numPlayers = 0 for x in self.parent.seats: if x != None: numPlayers = numPlayers + 1 continue - + if len(self.wantStart) == numPlayers and numPlayers >= 2: self.d_gameStart(avId) self.parent.sendIsPlaying() + - - + def d_gameStart(self, avId): for x in self.playersObserving: self.sendUpdateToAvatarId(x, 'gameStart', [ 255]) - + playerJoinOrder = [ 1, 4, @@ -403,7 +403,7 @@ class DistributedChineseCheckersAI(DistributedNodeAI): numPlayers += 1 self.playersPlaying.append(x) continue - + if numPlayers == 2: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -411,14 +411,14 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersGamePos[0] = player1 for x in self.startingPositions[0]: self.board.setState(x, 1) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 4]) self.playersGamePos[3] = player2 for x in self.startingPositions[3]: self.board.setState(x, 4) - + elif numPlayers == 3: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -426,21 +426,21 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersGamePos[1] = player1 for x in self.startingPositions[1]: self.board.setState(x, 2) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 4]) self.playersGamePos[3] = player2 for x in self.startingPositions[3]: self.board.setState(x, 4) - + player3 = self.playersPlaying[2] self.sendUpdateToAvatarId(player3, 'gameStart', [ 6]) self.playersGamePos[5] = player3 for x in self.startingPositions[5]: self.board.setState(x, 6) - + elif numPlayers == 4: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -448,28 +448,28 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersGamePos[0] = player1 for x in self.startingPositions[0]: self.board.setState(x, 1) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 4]) self.playersGamePos[3] = player2 for x in self.startingPositions[3]: self.board.setState(x, 4) - + player3 = self.playersPlaying[2] self.sendUpdateToAvatarId(player3, 'gameStart', [ 2]) self.playersGamePos[1] = player3 for x in self.startingPositions[1]: self.board.setState(x, 2) - + player4 = self.playersPlaying[3] self.sendUpdateToAvatarId(player4, 'gameStart', [ 5]) self.playersGamePos[4] = player4 for x in self.startingPositions[4]: self.board.setState(x, 5) - + elif numPlayers == 5: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -477,35 +477,35 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersGamePos[0] = player1 for x in self.startingPositions[0]: self.board.setState(x, 1) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 4]) self.playersGamePos[3] = player2 for x in self.startingPositions[3]: self.board.setState(x, 4) - + player3 = self.playersPlaying[2] self.sendUpdateToAvatarId(player3, 'gameStart', [ 2]) self.playersGamePos[1] = player3 for x in self.startingPositions[1]: self.board.setState(x, 2) - + player4 = self.playersPlaying[3] self.sendUpdateToAvatarId(player4, 'gameStart', [ 5]) self.playersGamePos[4] = player4 for x in self.startingPositions[4]: self.board.setState(x, 5) - + player5 = self.playersPlaying[4] self.sendUpdateToAvatarId(player5, 'gameStart', [ 3]) self.playersGamePos[2] = player5 for x in self.startingPositions[2]: self.board.setState(x, 3) - + elif numPlayers == 6: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -513,43 +513,43 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.playersGamePos[0] = player1 for x in self.startingPositions[0]: self.board.setState(x, 1) - + player2 = self.playersPlaying[1] self.sendUpdateToAvatarId(player2, 'gameStart', [ 4]) self.playersGamePos[3] = player2 for x in self.startingPositions[3]: self.board.setState(x, 4) - + player3 = self.playersPlaying[2] self.sendUpdateToAvatarId(player3, 'gameStart', [ 2]) self.playersGamePos[1] = player3 for x in self.startingPositions[1]: self.board.setState(x, 2) - + player4 = self.playersPlaying[3] self.sendUpdateToAvatarId(player4, 'gameStart', [ 5]) self.playersGamePos[4] = player4 for x in self.startingPositions[4]: self.board.setState(x, 5) - + player5 = self.playersPlaying[4] self.sendUpdateToAvatarId(player5, 'gameStart', [ 3]) self.playersGamePos[2] = player5 for x in self.startingPositions[2]: self.board.setState(x, 3) - + player6 = self.playersPlaying[5] self.sendUpdateToAvatarId(player6, 'gameStart', [ 6]) self.playersGamePos[5] = player6 for x in self.startingPositions[5]: self.board.setState(x, 6) - - + + playerSeatPos = [ 0, 0, @@ -562,7 +562,7 @@ class DistributedChineseCheckersAI(DistributedNodeAI): if id != None: playerSeatPos[self.parent.seats.index(id)] = x + 1 continue - + self.sendUpdate('announceSeatPositions', [ playerSeatPos]) self.playerSeatPos = playerSeatPos @@ -571,24 +571,24 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.fsm.request('playing') self.parent.getTableState() - + def d_sendTurn(self, playersTurn): self.sendUpdate('sendTurn', [ playersTurn]) - + def advancePlayerTurn(self): foundNewPlayer = False while foundNewPlayer == False: self.playersTurn += 1 if self.playersTurn > 5: self.playersTurn = 0 - + if self.playersGamePos[self.playersTurn] != None: foundNewPlayer = True continue - + def requestMove(self, moveList): playerOrder = [ 1, @@ -605,24 +605,24 @@ class DistributedChineseCheckersAI(DistributedNodeAI): self.setTurnCountdownTime() self.sendUpdate('setTurnTimer', [ globalClockDelta.localToNetworkTime(self.turnEnd)]) + - - + def checkLegalMoves(self, moveList): if not moveList: return False elif self.board.squareList[moveList[0]].getState() == 0: return False - + for x in range(len(moveList) - 1): y = self.checkLegalMove(self.board.getSquare(moveList[x]), self.board.getSquare(moveList[x + 1])) if y == False: return False continue - + return True - + def checkLegalMove(self, firstSquare, secondSquare): if secondSquare.getNum() in firstSquare.getAdjacent(): return True @@ -635,58 +635,60 @@ class DistributedChineseCheckersAI(DistributedNodeAI): if self.board.squareList[x].getAdjacent()[firstSquare.getAdjacent().index(x)] == secondSquare.getNum(): return True continue - + return False - + def makeMove(self, moveList): spot1 = self.board.squareList[moveList[0]].getState() self.board.squareList[moveList[0]].setState(0) self.board.squareList[moveList[len(moveList) - 1]].setState(spot1) self.sendGameState(moveList) - + def getState(self): return self.fsm.getCurrentState().getName() - + def getName(self): return self.name - + def getGameState(self): return [ self.board.getStates(), []] - + def sendGameState(self, moveList): gameState = self.board.getStates() self.sendUpdate('setGameState', [ gameState, moveList]) - + def clearBoard(self): for x in self.board.squareList: x.setState(0) + - - + def getPosHpr(self): return self.posHpr - + def testWin(self): self.clearBoard() for x in self.startingPositions[0]: self.board.squareList[x].setState(4) - + self.board.squareList[self.startingPositions[0][len(self.startingPositions[0]) - 1]].setState(0) self.board.squareList[51].setState(4) for x in self.startingPositions[3]: self.board.squareList[x].setState(1) - + self.board.squareList[120].setState(0) self.board.squareList[104].setState(1) self.sendGameState([]) + + diff --git a/toontown/safezone/DistributedFindFourAI.py b/toontown/safezone/DistributedFindFourAI.py index 88183c90..79b8d893 100755 --- a/toontown/safezone/DistributedFindFourAI.py +++ b/toontown/safezone/DistributedFindFourAI.py @@ -9,7 +9,7 @@ from direct.distributed.ClockDelta import * from direct.interval.IntervalGlobal import * class DistributedFindFourAI(DistributedNodeAI): - + def __init__(self, air, parent, name, x, y, z, h, p, r): DistributedNodeAI.__init__(self, air) self.name = name @@ -104,15 +104,15 @@ class DistributedFindFourAI(DistributedNodeAI): 'waitingToBegin'])], 'waitingToBegin', 'waitingToBegin') self.fsm.enterInitialState() - + def announceGenerate(self): self.parent.setGameDoId(self.doId) - + def getTableDoId(self): return self.parentDo - + def delete(self): self.fsm.requestFinalState() self.parent = None @@ -121,7 +121,7 @@ class DistributedFindFourAI(DistributedNodeAI): del self.fsm DistributedNodeAI.delete(self) - + def informGameOfPlayer(self): self.playersSitting += 1 if self.playersSitting < 2: @@ -133,11 +133,11 @@ class DistributedFindFourAI(DistributedNodeAI): 1]) elif self.playersSitting > 2: pass - + self.sendUpdate('setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def informGameOfPlayerLeave(self): self.playersSitting -= 1 if self.playersSitting < 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': @@ -145,7 +145,7 @@ class DistributedFindFourAI(DistributedNodeAI): self.parent.isAccepting = True self.parent.sendUpdate('setIsPlaying', [ 0]) - + if self.playersSitting > 2 and self.fsm.getCurrentState().getName() == 'waitingToBegin': pass 1 @@ -157,43 +157,43 @@ class DistributedFindFourAI(DistributedNodeAI): self.sendUpdate('setTimer', [ 0]) - + def setGameCountdownTime(self): self.timerEnd = globalClock.getRealTime() + 10 - + def setTurnCountdownTime(self): self.turnEnd = globalClock.getRealTime() + 25 - + def getTimer(self): if self.timerEnd != 0: return 0 else: return 0 - + def getTurnTimer(self): return globalClockDelta.localToNetworkTime(self.turnEnd) - + def requestTimer(self): avId = self.air.getAvatarIdFromSender() self.sendUpdateToAvatarId(avId, 'setTimer', [ globalClockDelta.localToNetworkTime(self.timerEnd)]) - + def handlePlayerExit(self, avId): if avId in self.wantStart: self.wantStart.remove(avId) - + if self.fsm.getCurrentState().getName() == 'playing': gamePos = self.playersGamePos.index(avId) self.playersGamePos[gamePos] = None self.fsm.request('gameOver') + - - + def handleEmptyGame(self): self.movesMade = 0 self.playersPlaying = [] @@ -202,7 +202,7 @@ class DistributedFindFourAI(DistributedNodeAI): self.fsm.request('waitingToBegin') self.parent.isAccepting = True - + def requestWin(self, pieceNum): avId = self.air.getAvatarIdFromSender() playerNum = self.playersGamePos.index(avId) + 1 @@ -219,25 +219,25 @@ class DistributedFindFourAI(DistributedNodeAI): else: self.sendUpdateToAvatarId(avId, 'illegalMove', []) - + def distributeLaffPoints(self): for x in self.parent.seats: if x != None: av = self.air.doId2do.get(x) av.toonUp(self.winLaffPoints) continue + - - + def enterWaitingToBegin(self): self.setGameCountdownTime() self.parent.isAccepting = True - + def exitWaitingToBegin(self): self.turnEnd = 0 - + def enterPlaying(self): self.parent.isAccepting = False for x in self.playersGamePos: @@ -246,16 +246,16 @@ class DistributedFindFourAI(DistributedNodeAI): self.d_sendTurn(self.playersTurn + 1) break continue - + self.setTurnCountdownTime() self.sendUpdate('setTurnTimer', [ globalClockDelta.localToNetworkTime(self.turnEnd)]) - + def exitPlaying(self): pass - + def enterGameOver(self): self.timerEnd = 0 isAccepting = True @@ -271,33 +271,33 @@ class DistributedFindFourAI(DistributedNodeAI): self.parent.isAccepting = True self.fsm.request('waitingToBegin') - + def exitGameOver(self): pass - + def requestBegin(self): avId = self.air.getAvatarIdFromSender() if avId not in self.wantStart: self.wantStart.append(avId) - + numPlayers = 0 for x in self.parent.seats: if x != None: numPlayers = numPlayers + 1 continue - + if len(self.wantStart) == numPlayers and numPlayers >= 2: self.d_gameStart(avId) self.parent.sendIsPlaying() + - - + def d_gameStart(self, avId): for x in self.playersObserving: self.sendUpdateToAvatarId(x, 'gameStart', [ 255]) - + zz = 0 numPlayers = 0 for x in self.parent.seats: @@ -305,7 +305,7 @@ class DistributedFindFourAI(DistributedNodeAI): numPlayers += 1 self.playersPlaying.append(x) continue - + if numPlayers == 2: player1 = self.playersPlaying[0] self.sendUpdateToAvatarId(player1, 'gameStart', [ @@ -315,17 +315,17 @@ class DistributedFindFourAI(DistributedNodeAI): self.sendUpdateToAvatarId(player2, 'gameStart', [ 2]) self.playersGamePos[1] = player2 - + self.wantStart = [] self.fsm.request('playing') self.parent.getTableState() - + def d_sendTurn(self, playersTurn): self.sendUpdate('sendTurn', [ playersTurn]) - + def advancePlayerTurn(self): if self.playersTurn == 0: self.playersTurn = 1 @@ -334,23 +334,23 @@ class DistributedFindFourAI(DistributedNodeAI): self.playerNum = 1 self.playersTurn = 0 - + def requestMove(self, moveColumn): avId = self.air.getAvatarIdFromSender() turn = self.playersTurn if avId in self.playersGamePos: if self.playersGamePos.index(avId) != self.playersTurn: pass - - + + if self.board[0][moveColumn] != 0: self.sendUpdateToAvatarId(avId, 'illegalMove', []) - + for x in range(6): if self.board[x][moveColumn] == 0: movePos = x continue - + self.board[movePos][moveColumn] = self.playersTurn + 1 if self.checkForTie() == True: self.sendUpdate('setGameState', [ @@ -362,7 +362,7 @@ class DistributedFindFourAI(DistributedNodeAI): winnersSequence = Sequence(Wait(8.0), Func(self.fsm.request, 'gameOver')) winnersSequence.start() return None - + self.movesMade += 1 self.advancePlayerTurn() self.setTurnCountdownTime() @@ -375,24 +375,24 @@ class DistributedFindFourAI(DistributedNodeAI): movePos, turn]) - + def checkForTie(self): for x in range(7): if self.board[0][x] == 0: return False continue - + return True - + def getState(self): return self.fsm.getCurrentState().getName() - + def getName(self): return self.name - + def getGameState(self): return [ self.board, @@ -400,17 +400,17 @@ class DistributedFindFourAI(DistributedNodeAI): 0, 0] - + def clearBoard(self): for x in self.board.squareList: x.setState(0) + - - + def getPosHpr(self): return self.posHpr - + def tempSetBoardState(self): self.board = [ [ @@ -467,7 +467,7 @@ class DistributedFindFourAI(DistributedNodeAI): 0, 1]) - + def checkWin(self, rVal, cVal, playerNum): if self.checkHorizontal(rVal, cVal, playerNum) == True: self.winDirection = 0 @@ -482,155 +482,157 @@ class DistributedFindFourAI(DistributedNodeAI): self.winDirection = None return False - + def checkHorizontal(self, rVal, cVal, playerNum): if cVal == 3: for x in range(1, 4): if self.board[rVal][cVal - x] != playerNum: break - + if self.board[rVal][cVal - x] == playerNum and x == 3: return True continue - + for x in range(1, 4): if self.board[rVal][cVal + x] != playerNum: break - + if self.board[rVal][cVal + x] == playerNum and x == 3: return True continue - + return False elif cVal == 2: for x in range(1, 4): if self.board[rVal][cVal + x] != playerNum: break - + if self.board[rVal][cVal + x] == playerNum and x == 3: return True continue - + return False elif cVal == 4: for x in range(1, 4): if self.board[rVal][cVal - x] != playerNum: break - + if self.board[rVal][cVal - x] == playerNum and x == 3: return True continue - + return False else: return False - + def checkVertical(self, rVal, cVal, playerNum): if rVal == 2: for x in range(1, 4): if self.board[rVal + x][cVal] != playerNum: break - + if self.board[rVal + x][cVal] == playerNum and x == 3: return True continue - + return False elif rVal == 3: for x in range(1, 4): if self.board[rVal - x][cVal] != playerNum: break - + if self.board[rVal - x][cVal] == playerNum and x == 3: return True continue - + return False else: return False - + def checkDiagonal(self, rVal, cVal, playerNum): if cVal <= 2: if rVal == 2: for x in range(1, 4): if self.board[rVal + x][cVal + x] != playerNum: break - + if self.board[rVal + x][cVal + x] == playerNum and x == 3: return True continue - + return False elif rVal == 3: for x in range(1, 4): if self.board[rVal - x][cVal + x] != playerNum: break - + if self.board[rVal - x][cVal + x] == playerNum and x == 3: return True continue - + return False - + elif cVal >= 4: if rVal == 2: for x in range(1, 4): if self.board[rVal + x][cVal - x] != playerNum: break - + if self.board[rVal + x][cVal - x] == playerNum and x == 3: return True continue - + return False elif rVal == 3: for x in range(1, 4): if self.board[rVal - x][cVal - x] != playerNum: break - + if self.board[rVal - x][cVal - x] == playerNum and x == 3: return True continue - + return False - + elif rVal == 3 and rVal == 4 or rVal == 5: for x in range(1, 4): if self.board[rVal - x][cVal - x] != playerNum: break - + if self.board[rVal - x][cVal - x] == playerNum and x == 3: return True continue - + for x in range(1, 4): if self.board[rVal + x][cVal - x] != playerNum: break - + if self.board[rVal + x][cVal - x] == playerNum and x == 3: return True continue - + return False elif rVal == 0 and rVal == 1 or rVal == 2: for x in range(1, 4): if self.board[rVal + x][cVal - x] != playerNum: break - + if self.board[rVal + x][cVal - x] == playerNum and x == 3: return True continue - + for x in range(1, 4): if self.board[rVal + x][cVal + x] != playerNum: break - + if self.board[rVal + x][cVal + x] == playerNum and x == 3: return True continue - + return False - + return False + + diff --git a/toontown/safezone/DistributedFishingSpotAI.py b/toontown/safezone/DistributedFishingSpotAI.py index 65e82f25..a7cfe4db 100755 --- a/toontown/safezone/DistributedFishingSpotAI.py +++ b/toontown/safezone/DistributedFishingSpotAI.py @@ -137,11 +137,11 @@ class DistributedFishingSpotAI(DistributedObjectAI): self.air.writeServerEvent('suspicious', self.avId, 'Toon tried to fish without casting!') return av = self.air.doId2do[self.avId] - + catch = self.air.fishManager.generateCatch(av, self.air.doId2do[self.pondDoId].getArea()) - + self.lastFish = catch - + self.d_setMovie(FishGlobals.PullInMovie, catch[0], catch[1], catch[2], catch[3], 0, 0) self.cast = False diff --git a/toontown/safezone/DistributedMMPiano.py b/toontown/safezone/DistributedMMPiano.py index 69762c9a..a3e9522c 100755 --- a/toontown/safezone/DistributedMMPiano.py +++ b/toontown/safezone/DistributedMMPiano.py @@ -11,7 +11,7 @@ ChangeDirectionTime = 1.0 class DistributedMMPiano(DistributedObject.DistributedObject): whitePartNodeName = 'midkey_floor_1' - + def __init__(self, cr): DistributedObject.DistributedObject.__init__(self, cr) self.spinStartTime = 0.0 @@ -25,9 +25,9 @@ class DistributedMMPiano(DistributedObject.DistributedObject): def generate(self): DistributedObject.DistributedObject.generate(self) taskMgr.doMethodLater(4, self.setupGeom, self.uniqueName('setup-geom')) - + def setupGeom(self, task): - geom = self.cr.playGame.getPlace().loader.geom + geom = self.cr.playGame.getPlace().loader.geom self.piano = geom.find('**/center_icon') if self.piano.isEmpty(): loader.notify.error('Piano not found') @@ -58,7 +58,7 @@ class DistributedMMPiano(DistributedObject.DistributedObject): def __updateSpin(self, task): if self.degreesPerSecond == 0: return Task.cont - + elapsed = globalClock.getRealTime() - self.spinStartTime offset = self.offset heading = ((self.degreesPerSecond * elapsed) + offset) % 360 @@ -115,4 +115,4 @@ class DistributedMMPiano(DistributedObject.DistributedObject): self.sendUpdate('requestChangeDirection', []) base.playSfx(self.changeDirectionSound) else: - loader.notify.debug('Rejecting change direction.') + loader.notify.debug('Rejecting change direction.') \ No newline at end of file diff --git a/toontown/safezone/DistributedMMPianoAI.py b/toontown/safezone/DistributedMMPianoAI.py index eebc2ec3..18930d31 100755 --- a/toontown/safezone/DistributedMMPianoAI.py +++ b/toontown/safezone/DistributedMMPianoAI.py @@ -10,7 +10,7 @@ PianoSlowDownInterval = 6.0 PianoSlowDownMinimum = 0.1 class DistributedMMPianoAI(DistributedObjectAI.DistributedObjectAI): - + def __init__(self, air): DistributedObjectAI.DistributedObjectAI.__init__(self, air) self.spinStartTime = 0.0 @@ -24,9 +24,9 @@ class DistributedMMPianoAI(DistributedObjectAI.DistributedObjectAI): for speed in PianoSpeeds: if speed > self.rpm: break - + self.updateSpeed(speed, self.direction) - + self.d_playSpeedUp(self.air.getAvatarIdFromSender()) self.__slowDownLater() @@ -34,20 +34,20 @@ class DistributedMMPianoAI(DistributedObjectAI.DistributedObjectAI): rpm = self.rpm if rpm == 0.0: rpm = PianoSpeeds[0] - + self.updateSpeed(rpm, -(self.direction)) self.__slowDownLater() self.d_playChangeDirection(self.air.getAvatarIdFromSender()) - + def d_setSpeed(self, rpm, offset, startTime): self.sendUpdate('setSpeed', [rpm, offset, globalClockDelta.localToNetworkTime(startTime)]) def d_playSpeedUp(self, avId): self.sendUpdate('playSpeedUp', [avId]) - + def d_playChangeDirection(self, avId): self.sendUpdate('playChangeDirection', [avId]) - + def updateSpeed(self, rpm, direction): now = globalClock.getFrameTime() heading = self.degreesPerSecond * (now - self.spinStartTime) + self.offset @@ -57,7 +57,7 @@ class DistributedMMPianoAI(DistributedObjectAI.DistributedObjectAI): self.offset = heading % 360.0 self.spinStartTime = now self.d_setSpeed(self.rpm * self.direction, self.offset, self.spinStartTime) - + def __slowDownLater(self): taskName = self.uniqueName('slowDown') taskMgr.remove(taskName) diff --git a/toontown/safezone/DistributedPartyGateAI.py b/toontown/safezone/DistributedPartyGateAI.py index 4faf9e1a..9749533e 100755 --- a/toontown/safezone/DistributedPartyGateAI.py +++ b/toontown/safezone/DistributedPartyGateAI.py @@ -33,4 +33,4 @@ class DistributedPartyGateAI(DistributedObjectAI): if not party: self.sendUpdateToAvatarId(self.air.getAvatarIdFromSender(), 'partyRequestDenied', [PartyGlobals.PartyGateDenialReasons.Unavailable]) return #dafuq - self.air.globalPartyMgr.d_requestPartySlot(pid, self.air.getAvatarIdFromSender(), self.doId) + self.air.globalPartyMgr.d_requestPartySlot(pid, self.air.getAvatarIdFromSender(), self.doId) \ No newline at end of file diff --git a/toontown/safezone/DistributedPicnicTableAI.py b/toontown/safezone/DistributedPicnicTableAI.py index 9bbba74a..1e5ec7a1 100755 --- a/toontown/safezone/DistributedPicnicTableAI.py +++ b/toontown/safezone/DistributedPicnicTableAI.py @@ -9,7 +9,7 @@ from toontown.safezone import DistributedFindFourAI from toontown.safezone import GameGlobals class DistributedPicnicTableAI(DistributedNodeAI): - + def __init__(self, air, zone, name, x, y, z, h, p, r): DistributedNodeAI.__init__(self, air) self.name = name @@ -103,7 +103,7 @@ class DistributedPicnicTableAI(DistributedNodeAI): self.notify.debug('acceptBoarder %d' % avId) if self.findAvatar(avId) != None: return None - + isEmpty = True for xx in self.seats: if xx != None: @@ -153,7 +153,7 @@ class DistributedPicnicTableAI(DistributedNodeAI): def pickGame(self, gameNum): if self.game: return - + x = 0 for x in self.seats: if x != None: @@ -183,7 +183,7 @@ class DistributedPicnicTableAI(DistributedNodeAI): def requestZone(self): if not self.game: return - + avId = self.air.getAvatarIdFromSender() self.sendUpdateToAvatarId(avId, 'setZone', [ self.game.zoneId]) @@ -335,9 +335,10 @@ class DistributedPicnicTableAI(DistributedNodeAI): def setCheckersZoneId(self, zoneId): self.checkersZoneId = zoneId - + def setTableIndex(self, index): self._tableIndex = index - + def getTableIndex(self): return self._tableIndex + \ No newline at end of file diff --git a/toontown/safezone/GSPlayground.py b/toontown/safezone/GSPlayground.py index 14ee9734..540dad34 100755 --- a/toontown/safezone/GSPlayground.py +++ b/toontown/safezone/GSPlayground.py @@ -90,4 +90,4 @@ class GSPlayground(Playground.Playground): self.doneStatus = doneStatus messenger.send(self.doneEvent) else: - self.notify.error('Unknown mode: ' + where + ' in handleStartingBlockDone') + self.notify.error('Unknown mode: ' + where + ' in handleStartingBlockDone') \ No newline at end of file diff --git a/toontown/safezone/GSSafeZoneLoader.py b/toontown/safezone/GSSafeZoneLoader.py index ea32ced9..537d4e4b 100755 --- a/toontown/safezone/GSSafeZoneLoader.py +++ b/toontown/safezone/GSSafeZoneLoader.py @@ -78,4 +78,4 @@ class GSSafeZoneLoader(SafeZoneLoader): 'hoodId': 8000, 'shardId': None} self.fsm.request('quietZone', [req]) - return + return \ No newline at end of file diff --git a/toontown/safezone/GameMenu.py b/toontown/safezone/GameMenu.py index 975e96ef..3bd8c300 100755 --- a/toontown/safezone/GameMenu.py +++ b/toontown/safezone/GameMenu.py @@ -157,4 +157,4 @@ class GameMenu(DirectFrame): self.picnicFunction = lambda gameIndex: None def doNothing(self): - pass + pass \ No newline at end of file diff --git a/toontown/safezone/GameTutorials.py b/toontown/safezone/GameTutorials.py index 212755f4..2f994763 100755 --- a/toontown/safezone/GameTutorials.py +++ b/toontown/safezone/GameTutorials.py @@ -333,4 +333,4 @@ class FindFourTutorial(DirectFrame, FSM.FSM): self.doneFunction() if task != None: task.done - return + return \ No newline at end of file diff --git a/toontown/safezone/MMPlayground.py b/toontown/safezone/MMPlayground.py index 2cc964b0..f0eaeb46 100755 --- a/toontown/safezone/MMPlayground.py +++ b/toontown/safezone/MMPlayground.py @@ -20,3 +20,5 @@ class MMPlayground(Playground.Playground): def exitOnPiano(self): base.localAvatar.b_setParent(ToontownGlobals.SPRender) + + diff --git a/toontown/safezone/MMSafeZoneLoader.py b/toontown/safezone/MMSafeZoneLoader.py index 06b399f8..7a7d0d28 100755 --- a/toontown/safezone/MMSafeZoneLoader.py +++ b/toontown/safezone/MMSafeZoneLoader.py @@ -9,4 +9,4 @@ class MMSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): self.musicFile = 'phase_6/audio/bgm/MM_nbrhood.ogg' self.activityMusicFile = 'phase_6/audio/bgm/MM_SZ_activity.ogg' self.dnaFile = 'phase_6/dna/minnies_melody_land_sz.pdna' - self.safeZoneStorageDNAFile = 'phase_6/dna/storage_MM_sz.pdna' + self.safeZoneStorageDNAFile = 'phase_6/dna/storage_MM_sz.pdna' \ No newline at end of file diff --git a/toontown/safezone/Playground.py b/toontown/safezone/Playground.py index 7b4493a5..0522365d 100755 --- a/toontown/safezone/Playground.py +++ b/toontown/safezone/Playground.py @@ -387,7 +387,7 @@ class Playground(Place.Place): def exitHFAReject(self): pass - + def enterNPCFA(self, requestStatus): self.acceptOnce(self.npcfaDoneEvent, self.enterNPCFACallback, [requestStatus]) self.npcfa = NPCForceAcknowledge.NPCForceAcknowledge(self.npcfaDoneEvent) @@ -600,4 +600,4 @@ class Playground(Place.Place): def removeLandmarkBlockNodes(self): npc = self.geom.findAllMatches('**/suit_building_origin') for i in xrange(npc.getNumPaths()): - npc.getPath(i).removeNode() + npc.getPath(i).removeNode() \ No newline at end of file diff --git a/toontown/safezone/TTPlayground.py b/toontown/safezone/TTPlayground.py index 20893438..41e3d56c 100755 --- a/toontown/safezone/TTPlayground.py +++ b/toontown/safezone/TTPlayground.py @@ -15,4 +15,4 @@ class TTPlayground(Playground.Playground): base.playSfx(random.choice(self.loader.birdSound)) time = random.random() * 20.0 + 1 taskMgr.doMethodLater(time, self.__birds, 'TT-birds') - return Task.done + return Task.done \ No newline at end of file diff --git a/toontown/safezone/TTSafeZoneLoader.py b/toontown/safezone/TTSafeZoneLoader.py index b6e5b245..ba307e8f 100755 --- a/toontown/safezone/TTSafeZoneLoader.py +++ b/toontown/safezone/TTSafeZoneLoader.py @@ -22,3 +22,4 @@ class TTSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): def unload(self): SafeZoneLoader.SafeZoneLoader.unload(self) del self.birdSound + diff --git a/toontown/shtiker/DeleteManagerAI.py b/toontown/shtiker/DeleteManagerAI.py index dd0343df..fcc249f2 100755 --- a/toontown/shtiker/DeleteManagerAI.py +++ b/toontown/shtiker/DeleteManagerAI.py @@ -6,3 +6,4 @@ class DeleteManagerAI(DistributedObjectAI): def setInventory(self, todo0): pass + diff --git a/toontown/shtiker/EventsPage.py b/toontown/shtiker/EventsPage.py index e2d1e98b..12d7c50d 100755 --- a/toontown/shtiker/EventsPage.py +++ b/toontown/shtiker/EventsPage.py @@ -579,4 +579,4 @@ class EventsPage(ShtikerPage.ShtikerPage): self.cancelPartyResultGui.hide() def updateToontownTime(self): - self.toontownTimeGui.updateTime() + self.toontownTimeGui.updateTime() \ No newline at end of file diff --git a/toontown/shtiker/NPCFriendPage.py b/toontown/shtiker/NPCFriendPage.py index db3ff097..f48db77f 100755 --- a/toontown/shtiker/NPCFriendPage.py +++ b/toontown/shtiker/NPCFriendPage.py @@ -29,4 +29,4 @@ class NPCFriendPage(ShtikerPage.ShtikerPage): ShtikerPage.ShtikerPage.enter(self) def exit(self): - ShtikerPage.ShtikerPage.exit(self) + ShtikerPage.ShtikerPage.exit(self) \ No newline at end of file diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index b9572142..359c9fdd 100755 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -242,7 +242,7 @@ class OptionsPage(ShtikerPage.ShtikerPage): self.optionsTab['state'] = DGG.NORMAL self.optionsTabPage.exit() self.extraOptionsTab['state'] = DGG.NORMAL - self.extraOptionsTabPage.exit() + self.extraOptionsTabPage.exit() self.codesTab['state'] = DGG.DISABLED self.codesTabPage.enter() elif mode == PageMode.Extra: @@ -252,7 +252,7 @@ class OptionsPage(ShtikerPage.ShtikerPage): self.codesTab['state'] = DGG.NORMAL self.codesTabPage.exit() self.extraOptionsTab['state'] = DGG.DISABLED - self.extraOptionsTabPage.enter() + self.extraOptionsTabPage.enter() class OptionsTabPage(DirectFrame): notify = directNotify.newCategory('OptionsTabPage') @@ -680,7 +680,7 @@ class CodesTabPage(DirectFrame): self.resultPanel['text'] = TTLocalizer.CdrResultNotReady elif result == 6: self.resultPanel['image'] = self.resultPanelErrorGui - self.resultPanel['text'] = TTLocalizer.CdrResultNotEligible + self.resultPanel['text'] = TTLocalizer.CdrResultNotEligible if result == 0: self.successSfx.play() else: @@ -713,10 +713,10 @@ class ExtraOptionsTabPage(DirectFrame): def destroy(self): self.parent = None - + if self.dialog: self.dialog.destroy() - + del self.dialog DirectFrame.destroy(self) @@ -733,10 +733,10 @@ class ExtraOptionsTabPage(DirectFrame): button_textpos = (0, -0.02) options_text_scale = 0.052 disabled_arrow_color = Vec4(0.6, 0.6, 0.6, 1.0) - self.speed_chat_scale = 0.055 + self.speed_chat_scale = 0.055 self.cogLevel_toggleButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), command=self.__doToggleCogLevelGui) self.cogLevel_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight)) - self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), + self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045)) gui.removeNode() guiButton.removeNode() diff --git a/toontown/shtiker/PhotoAlbumPage.py b/toontown/shtiker/PhotoAlbumPage.py index 4a4a829e..a130daca 100755 --- a/toontown/shtiker/PhotoAlbumPage.py +++ b/toontown/shtiker/PhotoAlbumPage.py @@ -70,7 +70,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage): self.dCancel = DirectButton(parent=self.deletePanel, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.PhotoPageCancel, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.1, 0.0, -0.1), command=self.deleteCancel) self.deletePanel.hide() self.errorPanel = DirectFrame(parent=self, relief=None, pos=(0.45, 0, -0.45), image=DGG.getDefaultDialogGeom(), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.0, 0.6), text='', text_wordwrap=16, text_scale=0.06, text_pos=(0.0, 0.13), sortOrder=NO_FADE_SORT_INDEX) - self.bClose = DirectButton(parent=self.errorPanel, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.PhotoPageClose, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.1), command=self.errorConfirm) + self.bClose = DirectButton(parent=self.errorPanel, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.PhotoPageClose, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.1), command=self.errorConfirm) self.errorPanel.hide() self.scroll = loader.loadModel('phase_3/models/gui/toon_council').find('**/scroll') self.scroll.reparentTo(self) @@ -162,7 +162,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage): self.notify.debug(self.selectedFileName) def deleteConfirm(self): - if os.path.isfile(self.photoPath + self.selectedFileName): + if os.path.isfile(self.photoPath + self.selectedFileName): os.remove(self.photoPath + self.selectedFileName) self.selectedFileName = None self.deleteCleanup() @@ -232,7 +232,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage): photos = [] for fileName in files: if fileName[0:17] == 'stride-screenshot' and fileName[-4:] == '.jpg': - photos.append(fileName) + photos.append(fileName) return photos @@ -250,7 +250,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage): self.updateScrollList() def updateScrollList(self): - newPhotos = self.getPhotos() + newPhotos = self.getPhotos() for photo in self.photos.keys(): if photo not in newPhotos: photoButton = self.photos[photo] diff --git a/toontown/shtiker/PurchaseManager.py b/toontown/shtiker/PurchaseManager.py index 3ce5860e..10356413 100755 --- a/toontown/shtiker/PurchaseManager.py +++ b/toontown/shtiker/PurchaseManager.py @@ -92,4 +92,4 @@ class PurchaseManager(DistributedObject.DistributedObject): if self.hasLocalToon: self.ignore('boughtGag') self.d_setInventory(base.localAvatar.inventory.makeNetString(), base.localAvatar.getMoney(), 1) - messenger.send('purchaseOver', [self.playAgain]) + messenger.send('purchaseOver', [self.playAgain]) \ No newline at end of file diff --git a/toontown/shtiker/PurchaseManagerAI.py b/toontown/shtiker/PurchaseManagerAI.py index 1684f6a9..f4af7288 100755 --- a/toontown/shtiker/PurchaseManagerAI.py +++ b/toontown/shtiker/PurchaseManagerAI.py @@ -314,4 +314,4 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): return def handlePlayerLeaving(self, avId): - pass + pass \ No newline at end of file diff --git a/toontown/speedchat/TTSpeedChatTypes.py b/toontown/speedchat/TTSpeedChatTypes.py index 0359c51c..1f7fe344 100755 --- a/toontown/speedchat/TTSpeedChatTypes.py +++ b/toontown/speedchat/TTSpeedChatTypes.py @@ -23,4 +23,4 @@ from TTSCHalloweenMenu import TTSCHalloweenMenu from TTSCWinterMenu import TTSCWinterMenu from TTSCSellbotInvasionMenu import TTSCSellbotInvasionMenu from TTSCSellbotFieldOfficeMenu import TTSCSellbotFieldOfficeMenu -from TTSCIdesOfMarchMenu import TTSCIdesOfMarchMenu +from TTSCIdesOfMarchMenu import TTSCIdesOfMarchMenu \ No newline at end of file diff --git a/toontown/suit/BossCog.py b/toontown/suit/BossCog.py index 88cd2685..8e57397b 100755 --- a/toontown/suit/BossCog.py +++ b/toontown/suit/BossCog.py @@ -188,15 +188,15 @@ class BossCog(Avatar.Avatar): elif health > 0.7: condition = 3#Yellow elif health > 0.6: - condition = 4 + condition = 4 elif health > 0.5: - condition = 5 + condition = 5 elif health > 0.3: condition = 6#Orange elif health > 0.15: condition = 7 elif health > 0.05: - condition = 8#Red + condition = 8#Red elif health > 0.0: condition = 9#Blinking Red else: @@ -214,10 +214,10 @@ class BossCog(Avatar.Avatar): self.healthBar.setColor(self.healthColors[condition], 1) self.healthBarGlow.setColor(self.healthGlowColors[condition], 1) self.healthCondition = condition - + def __blinkRed(self, task): if not self.healthBar: - return + return self.healthBar.setColor(self.healthColors[8], 1) self.healthBarGlow.setColor(self.healthGlowColors[8], 1) if self.healthCondition == 10: diff --git a/toontown/suit/DistributedCashbotBossAI.py b/toontown/suit/DistributedCashbotBossAI.py index 7b4d7694..69eb5004 100755 --- a/toontown/suit/DistributedCashbotBossAI.py +++ b/toontown/suit/DistributedCashbotBossAI.py @@ -554,4 +554,4 @@ def killCFO(): if not boss: return "You aren't in a CFO" boss.b_setState('Victory') - return 'Killed CFO.' + return 'Killed CFO.' diff --git a/toontown/suit/DistributedGridGoonAI.py b/toontown/suit/DistributedGridGoonAI.py index dc4f4960..3e22b27d 100755 --- a/toontown/suit/DistributedGridGoonAI.py +++ b/toontown/suit/DistributedGridGoonAI.py @@ -6,3 +6,4 @@ class DistributedGridGoonAI(DistributedGoonAI): def setPathPts(self, todo0, todo1, todo2, todo3, todo4, todo5): pass + diff --git a/toontown/suit/DistributedLawbotBossAI.py b/toontown/suit/DistributedLawbotBossAI.py index ed189366..5382d670 100755 --- a/toontown/suit/DistributedLawbotBossAI.py +++ b/toontown/suit/DistributedLawbotBossAI.py @@ -694,7 +694,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM possibleSummonType = ['single', 'building', 'invasion'] typeWeights = ['single'] * 70 + ['building'] * 27 + ['invasion'] * 3 if not foundOne: - for i in xrange(5): + for i in xrange(5): randomCogLevel = random.choice(possibleCogLevel) randomSummonType = random.choice(typeWeights) randomDeptIndex = random.choice(possibleDeptIndex) diff --git a/toontown/suit/DistributedSuitBaseAI.py b/toontown/suit/DistributedSuitBaseAI.py index 2ed9526e..687bdc91 100755 --- a/toontown/suit/DistributedSuitBaseAI.py +++ b/toontown/suit/DistributedSuitBaseAI.py @@ -195,4 +195,4 @@ class DistributedSuitBaseAI(DistributedAvatarAI.DistributedAvatarAI, SuitBase.Su self.d_setWaiter(flag) def getWaiter(self): - return self.waiter + return self.waiter \ No newline at end of file diff --git a/toontown/suit/DistributedSuitPlannerAI.py b/toontown/suit/DistributedSuitPlannerAI.py index 1b9d5373..b85e0231 100755 --- a/toontown/suit/DistributedSuitPlannerAI.py +++ b/toontown/suit/DistributedSuitPlannerAI.py @@ -30,7 +30,7 @@ if config.GetBool('want-bossbot-cogdo', False): ALLOWED_FO_TRACKS += 'b' if config.GetBool('want-omni-cogdo', False): ALLOWED_FO_TRACKS += 'slcb' - + DEFAULT_COGDO_RATIO = .5 class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlannerBase.SuitPlannerBase): @@ -581,7 +581,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan def cogdoTakeOver(self, blockNumber, difficulty, buildingHeight, dept): if self.pendingBuildingHeights.count(buildingHeight) > 0: - self.pendingBuildingHeights.remove(buildingHeight) + self.pendingBuildingHeights.remove(buildingHeight) building = self.buildingMgr.getBuilding(blockNumber) building.cogdoTakeOver(difficulty, buildingHeight, dept) @@ -865,7 +865,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan holidayId = trackToHolidayDict[tentativeBonusTrack] if simbase.air.holidayManager.isHolidayRunning(holidayId):#and simbase.air.holidayManager.getCurPhase(holidayId) >= 1: interactivePropTrackBonus = tentativeBonusTrack - + self.battleMgr.newBattle( zoneId, zoneId, pos, suit, toonId, self.__battleFinished, self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_SMAX], diff --git a/toontown/suit/Suit.py b/toontown/suit/Suit.py index 87ddedd8..13ea1f4a 100755 --- a/toontown/suit/Suit.py +++ b/toontown/suit/Suit.py @@ -327,12 +327,12 @@ class Suit(Avatar.Avatar): healthGlowColors = (Vec4(0.25, 1, 0.25, 0.5),#Green Vec4(0.5, 1, 0.25, .5),#1 Green-Yellow Vec4(0.75, 1, 0.25, .5),#2 Yellow-Green - Vec4(1, 1, 0.25, 0.5),#Yellow + Vec4(1, 1, 0.25, 0.5),#Yellow Vec4(1, 0.866, 0.25, .5),#4 Yellow-Orange Vec4(1, 0.6, 0.25, .5),#5 Orange-Yellow Vec4(1, 0.5, 0.25, 0.5),#6 Orange - Vec4(1, 0.25, 0.25, 0.5),#7 Red-Orange - Vec4(1, 0.25, 0.25, 0.5),#8 Red + Vec4(1, 0.25, 0.25, 0.5),#7 Red-Orange + Vec4(1, 0.25, 0.25, 0.5),#8 Red Vec4(0.3, 0.3, 0.3, 0))#9 Grey medallionColors = {'c': Vec4(0.863, 0.776, 0.769, 1.0), 's': Vec4(0.843, 0.745, 0.745, 1.0), @@ -642,15 +642,15 @@ class Suit(Avatar.Avatar): elif health > 0.7: condition = 3#Yellow elif health > 0.6: - condition = 4 + condition = 4 elif health > 0.5: - condition = 5 + condition = 5 elif health > 0.3: condition = 6#Orange elif health > 0.15: condition = 7 elif health > 0.05: - condition = 8#Red + condition = 8#Red elif health > 0.0: condition = 9#Blinking Red else: @@ -671,7 +671,7 @@ class Suit(Avatar.Avatar): def __blinkRed(self, task): if not self.healthBar: - return Task.done + return Task.done self.healthBar.setColor(self.healthColors[8], 1) self.healthBarGlow.setColor(self.healthGlowColors[8], 1) if self.healthCondition == 7: diff --git a/toontown/suit/SuitBase.py b/toontown/suit/SuitBase.py index 001e1dd6..852d76aa 100755 --- a/toontown/suit/SuitBase.py +++ b/toontown/suit/SuitBase.py @@ -41,7 +41,7 @@ class SuitBase: return self.maxHP else: self.notify.error('maxHP is None') - return 'unknown' + return 'unknown' def getStyleName(self): if hasattr(self, 'dna') and self.dna: diff --git a/toontown/suit/SuitGlobals.py b/toontown/suit/SuitGlobals.py index e5043702..0ca0258f 100755 --- a/toontown/suit/SuitGlobals.py +++ b/toontown/suit/SuitGlobals.py @@ -51,3 +51,4 @@ suitProperties = {'f': (4.0 / cSize, SuitDNA.corpPolyColor, ['flunky', 'glasses' 'm': (5.75 / aSize, SuitDNA.salesPolyColor, ['twoface'], 'mingler.jpg', 7.61), 'mh': (7.0 / aSize, SuitDNA.salesPolyColor, ['yesman'], '', 8.95), } + diff --git a/toontown/suit/SuitInvasionGlobals.py b/toontown/suit/SuitInvasionGlobals.py index 868bb537..be8467e7 100755 --- a/toontown/suit/SuitInvasionGlobals.py +++ b/toontown/suit/SuitInvasionGlobals.py @@ -7,4 +7,4 @@ INVASION_TYPE_BRUTAL = 2 IFSkelecog = 1 << 0 IFWaiter = 1 << 1 IFV2 = 1 << 2 -IFV3 = 1 << 3 +IFV3 = 1 << 3 \ No newline at end of file diff --git a/toontown/suit/SuitInvasionManagerAI.py b/toontown/suit/SuitInvasionManagerAI.py index 4009af12..36d80b6a 100755 --- a/toontown/suit/SuitInvasionManagerAI.py +++ b/toontown/suit/SuitInvasionManagerAI.py @@ -99,12 +99,12 @@ class SuitInvasionManagerAI: if type == INVASION_TYPE_NORMAL: timeout = config.GetInt('invasion-timeout', 1800) taskMgr.doMethodLater(timeout, self.stopInvasion, 'invasionTimeout') - + # If this is a mega invasion, and the players take to long to defeat # all of the cogs, we want the invasion to take a bit longer to timeout: if type == INVASION_TYPE_MEGA: timeout = config.GetInt('invasion-timeout', 3200) - + # If this is a brutal invasion, the players will have a very long time to # Defeat the cogs before the invasion times out: if type == INVASION_TYPE_BRUTAL: diff --git a/toontown/suit/SuitPlannerBase.py b/toontown/suit/SuitPlannerBase.py index 38216e4d..41f6698c 100755 --- a/toontown/suit/SuitPlannerBase.py +++ b/toontown/suit/SuitPlannerBase.py @@ -543,7 +543,7 @@ class SuitPlannerBase: for i in xrange(self.dnaStore.getNumDNAVisGroupsAI()): vg = self.dnaStore.getDNAVisGroupAI(i) zoneId = int(self.extractGroupName(vg.getName())) - + if vg.getNumBattleCells() == 1: battleCell = vg.getBattleCell(0) self.battlePosDict[zoneId] = vg.getBattleCell(0).getPos() @@ -551,10 +551,10 @@ class SuitPlannerBase: self.notify.warning('multiple battle cells for zone: %d' % zoneId) self.battlePosDict[zoneId] = vg.getBattleCell(0).getPos() - if True: + if True: for i in xrange(vg.getNumChildren()): childDnaGroup = vg.at(i) - + if isinstance(childDnaGroup, DNAInteractiveProp): self.notify.debug('got interactive prop %s' % childDnaGroup) battleCellId = childDnaGroup.getCellId() diff --git a/toontown/toon/AvatarPanelBase.py b/toontown/toon/AvatarPanelBase.py index 69272508..699fffc5 100755 --- a/toontown/toon/AvatarPanelBase.py +++ b/toontown/toon/AvatarPanelBase.py @@ -163,12 +163,12 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel): def handleReportCategoryConfirm(self, value): self.cleanupDialog() removed = 0 - + if value > 0: if base.cr.isFriend(self.avId): base.cr.removeFriend(self.avId) removed = 1 - + base.cr.reportMgr.sendReport(self.avId, self.category) self.reportComplete(removed) else: diff --git a/toontown/toon/DistributedNPCFlippyInToonHall.py b/toontown/toon/DistributedNPCFlippyInToonHall.py index 99408281..1604c42a 100755 --- a/toontown/toon/DistributedNPCFlippyInToonHall.py +++ b/toontown/toon/DistributedNPCFlippyInToonHall.py @@ -18,4 +18,4 @@ class DistributedNPCFlippyInToonHall(DistributedNPCToon): self.sendUpdate('avatarEnter', []) self.nametag3d.setDepthTest(0) self.nametag3d.setBin('fixed', 0) - self.lookAt(base.localAvatar) + self.lookAt(base.localAvatar) \ No newline at end of file diff --git a/toontown/toon/DistributedNPCPetclerkAI.py b/toontown/toon/DistributedNPCPetclerkAI.py index 6e6a8456..beb7b5c2 100755 --- a/toontown/toon/DistributedNPCPetclerkAI.py +++ b/toontown/toon/DistributedNPCPetclerkAI.py @@ -40,7 +40,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI): self.d_setMovie(avId, flag) taskMgr.doMethodLater(PetConstants.PETCLERK_TIMER, self.sendTimeoutMovie, self.uniqueName('clearMovie')) DistributedNPCToonBaseAI.avatarEnter(self) - + def rejectAvatar(self, avId): self.notify.warning('rejectAvatar: should not be called by a fisherman!') @@ -127,8 +127,8 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI): if av: simbase.air.petMgr.deleteToonsPet(avId) self.transactionType = 'return' - - self.transactionDone() + + self.transactionDone() def transactionDone(self): avId = self.air.getAvatarIdFromSender() diff --git a/toontown/toon/DistributedNPCScientist.py b/toontown/toon/DistributedNPCScientist.py index 5be3e2d7..f9ef6995 100755 --- a/toontown/toon/DistributedNPCScientist.py +++ b/toontown/toon/DistributedNPCScientist.py @@ -16,7 +16,7 @@ class DistributedNPCScientist(DistributedNPCToonBase): def setModelHand(self, path): model = loader.loadModel(path) - + for hand in self.getRightHands(): placeholder = hand.attachNewNode('RightHandObj') placeholder.setH(180) @@ -33,7 +33,7 @@ class DistributedNPCScientist(DistributedNPCToonBase): def startLookAround(self): pass - + def startSequence(self, phase): if not self.style.getAnimal() == 'horse': return @@ -63,4 +63,4 @@ class DistributedNPCScientist(DistributedNPCToonBase): def disable(self): self.stopSequence() self.ignore('SillyMeterPhase') - DistributedNPCToonBase.disable(self) + DistributedNPCToonBase.disable(self) \ No newline at end of file diff --git a/toontown/toon/DistributedNPCScientistAI.py b/toontown/toon/DistributedNPCScientistAI.py index e71f66c4..0b5281d5 100755 --- a/toontown/toon/DistributedNPCScientistAI.py +++ b/toontown/toon/DistributedNPCScientistAI.py @@ -3,6 +3,6 @@ import DistributedNPCToonBaseAI, random Animation = random.choice(["ScientistPlay", "ScientistWork", "ScientistLessWork", "ScientistJealous"]) class DistributedNPCScientistAI(DistributedNPCToonBaseAI.DistributedNPCToonBaseAI): - + def getStartAnimState(self): - return 'ScientistEmcee' if self.npcId == 2020 else Animation + return 'ScientistEmcee' if self.npcId == 2020 else Animation \ No newline at end of file diff --git a/toontown/toon/DistributedSmartNPCAI.py b/toontown/toon/DistributedSmartNPCAI.py index a5c56964..4a0a0b9b 100755 --- a/toontown/toon/DistributedSmartNPCAI.py +++ b/toontown/toon/DistributedSmartNPCAI.py @@ -20,7 +20,7 @@ class DistributedSmartNPCAI(DistributedNPCToonBaseAI): self.brain = self.engine.create_session() self.myTask = taskMgr.doMethodLater(0.5, self.tylerTask, 'tylerTask') self.index = 0 - + def tylerTask(self, task): if task.time >= 5: self.index = 0 @@ -31,7 +31,7 @@ class DistributedSmartNPCAI(DistributedNPCToonBaseAI): self.personOfInterest = 0 self.nameOfInterest = '' return task.done - + def restartTask(self): taskMgr.remove(self.myTask) taskMgr.add(self.myTask) @@ -51,7 +51,7 @@ class DistributedSmartNPCAI(DistributedNPCToonBaseAI): else: #Tyler is busy! pass - + def talkMessage(self, sender, message): if sender == self.personOfInterest: self.index += 1 @@ -65,7 +65,7 @@ class DistributedSmartNPCAI(DistributedNPCToonBaseAI): return self.restartTask() self.generateAnswer(message, sender) - + def generateAnswer(self, message, sender): name = self.air.doId2do.get(sender).getName() answer = self.brain.think(message) @@ -74,3 +74,4 @@ class DistributedSmartNPCAI(DistributedNPCToonBaseAI): def response(self, response, sendTo): self.sendUpdate('respond', [self.npcId, response, sendTo]) self.restartTask() + diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 922d4982..20a86fc6 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -1317,7 +1317,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute def setMaxMoney(self, maxMoney): self.maxMoney = maxMoney - + def getMaxMoney(self): return self.maxMoney @@ -2576,36 +2576,36 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute def setRedeemedCodes(self, redeemedCodes): self.redeemedCodes = redeemedCodes - + def b_setIgnored(self, ignored): self.setIgnored(ignored) self.d_setIgnored(ignored) - + def setIgnored(self, ignored): self.ignored = ignored - + def d_setIgnored(self, ignored): self.sendUpdate('setIgnored', [ignored]) - + def isIgnored(self, doId): return doId in self.ignored - + def addIgnore(self, doId): if not self.isIgnored(doId): self.ignored.append(doId) self.d_setIgnored(self.ignored) - + def removeIgnore(self, doId): if self.isIgnored(doId): self.ignored.remove(doId) self.d_setIgnored(self.ignored) - + def setReported(self, reported): self.reported = reported - + def isReported(self, doId): return doId in self.reported - + def addReport(self, doId): if not self.isReported(doId): self.reported.append(doId) @@ -2657,11 +2657,11 @@ def showParticle(name): """ Shows a particle. """ - + particle = BattleParticles.createParticleEffect(name) - + if particle: particle.start(spellbook.getTarget()) return 'Successfully started particle!' - + return 'Particle %s does not exist.' % name diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 9cdf81d8..44108ee4 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -408,26 +408,26 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def getExperience(self): return self.experience.makeNetString() - + def b_setIgnored(self, ignored): self.d_setIgnored(ignored) self.setIgnored(ignored) - + def d_setIgnored(self, ignored): self.sendUpdate('setIgnored', [ignored]) - + def setIgnored(self, ignored): self.ignored = ignored - + def getIgnored(self): return self.ignored - + def setReported(self, reported): self.reported = reported - + def getReported(self): return self.reported - + def isReported(self, doId): return doId in self.reported @@ -591,7 +591,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def attemptAddNPCFriend(self, npcFriend): numCalls = simbase.air.config.GetInt('sos-card-reward', 1) - + if numCalls <= 0: self.notify.warning('invalid numCalls: %d' % numCalls) return 0 @@ -1168,7 +1168,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if types[i] == SuitDNA.suitsPerDept - 1: zoneId = SuitDNA.suitDeptZones[i] tpAccess = self.getTeleportAccess() - + if zoneId not in tpAccess: tpAccess.append(zoneId) self.b_setTeleportAccess(tpAccess) @@ -2298,33 +2298,33 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def b_setMaxMoney(self, maxMoney): self.d_setMaxMoney(maxMoney) self.setMaxMoney(maxMoney) - + if self.getMoney() > maxMoney: self.b_setBankMoney(self.bankMoney + (self.getMoney() - maxMoney)) self.b_setMoney(maxMoney) - + def d_setMaxMoney(self, maxMoney): self.sendUpdate('setMaxMoney', [maxMoney]) - + def setMaxMoney(self, maxMoney): self.maxMoney = maxMoney - + def getMaxMoney(self): return self.maxMoney - + def b_setMaxBankMoney(self, maxBankMoney): self.d_setMaxBankMoney(maxBankMoney) self.setMaxBankMoney(maxBankMoney) - + if self.getBankMoney() > maxBankMoney: self.b_setBankMoney(maxBankMoney) - + def d_setMaxBankMoney(self, maxBankMoney): self.sendUpdate('setMaxBankMoney', [maxBankMoney]) - + def setMaxBankMoney(self, maxBankMoney): self.maxBankMoney = maxBankMoney - + def getMaxBankMoney(self): return self.maxBankMoney @@ -2390,7 +2390,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def getBankMoney(self): return self.bankMoney - + def b_setEmblems(self, emblems): self.setEmblems(emblems) self.d_setEmblems(emblems) @@ -4346,7 +4346,7 @@ def bank(money): """ target = spellbook.getTarget() maxMoney = target.getMaxBankMoney() - + if not 0 <= money <= maxMoney: return 'Bank money must be in xrange (0-%d.)' % maxMoney target.b_setBankMoney(money) @@ -4936,14 +4936,14 @@ def unlimitedGags(): av.setUnlimitedGags(not av.unlimitedGags) return 'Toggled unlimited gags %s for %s' % ('ON' if av.unlimitedGags else 'OFF', av.getName()) -@magicWord(category=CATEGORY_PROGRAMMER) +@magicWord(category=CATEGORY_PROGRAMMER) def immortal(): """ Make target (if 500+) or self (if 499-) immortal. """ av = spellbook.getTarget() if spellbook.getInvokerAccess() >= 500 else spellbook.getInvoker() av.setImmortalMode(not av.immortalMode) return 'Toggled immortal mode %s for %s' % ('ON' if av.immortalMode else 'OFF', av.getName()) -@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int]) +@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int]) def summoncogdo(track="s", difficulty=5): tracks = ['s'] if config.GetBool('want-lawbot-cogdo', True): @@ -4959,7 +4959,7 @@ def summoncogdo(track="s", difficulty=5): building.cogdoTakeOver(difficulty, 2, track) return 'Successfully spawned cogdo with track %s and difficulty %d' % (track, difficulty) -@magicWord(category=CATEGORY_PROGRAMMER, types=[int, int]) +@magicWord(category=CATEGORY_PROGRAMMER, types=[int, int]) def emblems(silver=10, gold=10): spellbook.getTarget().addEmblems((gold, silver)) return 'Restocked with Gold: %s Silver: %d' % (gold, silver) diff --git a/toontown/toon/DistributedToonUD.py b/toontown/toon/DistributedToonUD.py index 01d291c0..806eb479 100755 --- a/toontown/toon/DistributedToonUD.py +++ b/toontown/toon/DistributedToonUD.py @@ -15,7 +15,7 @@ class DistributedToonUD(DistributedObjectUD): def setBankMoney(self, todo0): pass - + def setMaxMoney(self, todo0): pass @@ -207,7 +207,7 @@ class DistributedToonUD(DistributedObjectUD): def checkTeleportAccess(self, todo0): pass - + def setScavengerHunt(self, todo0): pass @@ -539,4 +539,4 @@ class DistributedToonUD(DistributedObjectUD): pass def setRedeemedCodes(self, redeemedCodes): - pass + pass \ No newline at end of file diff --git a/toontown/toon/GroupInvitee.py b/toontown/toon/GroupInvitee.py index 9b5d260c..c4dfcde8 100755 --- a/toontown/toon/GroupInvitee.py +++ b/toontown/toon/GroupInvitee.py @@ -23,9 +23,9 @@ class GroupInvitee(ToonHeadDialog.ToonHeadDialog): self.avDNA = toon.getStyle() self.party = party if merger: - text = TTLocalizer.BoardingInviteeMergeMessage % self.avName + text = TTLocalizer.BoardingInviteeMergeMessage % self.avName else: - text = TTLocalizer.BoardingInviteeMessage % self.avName + text = TTLocalizer.BoardingInviteeMessage % self.avName style = TTDialog.TwoChoice buttonTextList = [OTPLocalizer.FriendInviteeOK, OTPLocalizer.FriendInviteeNo] command = self.__handleButton diff --git a/toontown/toon/InventoryBase.py b/toontown/toon/InventoryBase.py index d64609fe..7d337a5a 100755 --- a/toontown/toon/InventoryBase.py +++ b/toontown/toon/InventoryBase.py @@ -298,4 +298,4 @@ class InventoryBase(DirectObject.DirectObject): self.inventory[track][UBER_GAG_LEVEL_INDEX] = 1 self.calcTotalProps() - return None + return None \ No newline at end of file diff --git a/toontown/toon/LaughingManGlobals.py b/toontown/toon/LaughingManGlobals.py index 4349cc6f..dbe48c7d 100755 --- a/toontown/toon/LaughingManGlobals.py +++ b/toontown/toon/LaughingManGlobals.py @@ -32,10 +32,10 @@ def addHeadEffect(head, book=False): card = makeCard(book=book) card.setScale(1.45 if book else 2.5) card.setZ(0.05 if book else 0.5) - + for nodePath in head.getChildren(): nodePath.hide() - + card.instanceTo(head) def addToonEffect(toon): diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index 552a32a4..baee8074 100755 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -1690,7 +1690,7 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): def getAccountDays(self): return base.cr.accountDateMgr.getAccountDays() - + def hasActiveBoardingGroup(self): if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty: return localAvatar.boardingParty.hasActiveGroup(localAvatar.doId) @@ -1763,13 +1763,13 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): def hasPet(self): return self.petId != 0 - + def getPetDNA(self): if self.hasPet(): pet = base.cr.doId2do(self.petId) return pet.petDNA return None - + def setPetId(self, petId): self.petId = petId if petId == 0: diff --git a/toontown/toon/NPCFriendPanel.py b/toontown/toon/NPCFriendPanel.py index 8c69ee20..422578fa 100755 --- a/toontown/toon/NPCFriendPanel.py +++ b/toontown/toon/NPCFriendPanel.py @@ -236,4 +236,4 @@ class NPCFriendCard(DirectFrame): child.reparentTo(geomXform) geomXform.setPosHprScale(-mid[0], -mid[1] + 1, -mid[2], 180, 0, 0, s, s, s) - geomXform.reparentTo(geom) + geomXform.reparentTo(geom) \ No newline at end of file diff --git a/toontown/toon/QuestionMgr.py b/toontown/toon/QuestionMgr.py index a61444ac..e21d89bf 100755 --- a/toontown/toon/QuestionMgr.py +++ b/toontown/toon/QuestionMgr.py @@ -136,4 +136,4 @@ def _utils_string_at_index(strings, index): if len(strings) > index: return strings[index] else: - return '' + return '' \ No newline at end of file diff --git a/toontown/toon/QuestionMgrCustom.py b/toontown/toon/QuestionMgrCustom.py index c1c10d30..f59f8fba 100755 --- a/toontown/toon/QuestionMgrCustom.py +++ b/toontown/toon/QuestionMgrCustom.py @@ -2,13 +2,13 @@ import random class QuestionMgr: - + def __init__(self): self.greetings = ['hi', 'hello', 'hey', 'sup', 'howdy', 'yo'] self.greetingResp = ['Hello there, ', 'Howdy there, ', 'Hows it hanging, ', 'How do you do, ', 'Whats up, ', 'Woah! You scared me there '] self.response = '' self.confused = 1 - + def ask(self, message, sender): msg = message.lower() vbls = msg.split() diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index 84e56c21..ea6cb43f 100755 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -974,7 +974,7 @@ class Toon(Avatar.Avatar, ToonHead): def generateLaughingMan(self, force=False): if force or self.getWantLaughingMan(): self.swapToonHead(laughingMan=True) - + def generateHat(self, fromRTM = False): hat = self.getHat() if hat[0] >= len(ToonDNA.HatModels): @@ -1147,13 +1147,13 @@ class Toon(Avatar.Avatar, ToonHead): def getHat(self): return self.hat - + def getWantLaughingMan(self): return self.style.laughingMan or self.getWantLaughingManHoliday() - + def getWantLaughingManHoliday(self): return base.cr.newsManager and base.cr.newsManager.isHolidayRunning(ToontownGlobals.LAUGHING_MAN) - + def setGlasses(self, glassesIdx, textureIdx, colorIdx, fromRTM = False): self.glasses = (glassesIdx, textureIdx, colorIdx) self.generateGlasses(fromRTM=fromRTM) diff --git a/toontown/toon/ToonDNA.py b/toontown/toon/ToonDNA.py index 663ab9af..e697fd22 100755 --- a/toontown/toon/ToonDNA.py +++ b/toontown/toon/ToonDNA.py @@ -634,7 +634,7 @@ ClothesColors = [VBase4(0.933594, 0.265625, 0.28125, 1.0), VBase4(0.3, 0.3, 0.35, 1.0), VBase4(0.196078, 0.803921, 0.196078, 1.0), VBase4(0.462745098039216, 0.0901960784313725, 0.0901960784313725, 1.0)] - + ShirtStyles = {'bss1': [0, 0, [(0, 0), (1, 1), (2, 2), @@ -1690,13 +1690,13 @@ if mergeMATTailor: TailorCollections[MAKE_A_TOON][GIRL_BOTTOMS].append(girlBottoms) for boyShorts in TailorCollections[tailors][BOY_SHORTS]: if boyShorts not in TailorCollections[MAKE_A_TOON][BOY_SHORTS]: - TailorCollections[MAKE_A_TOON][BOY_SHORTS].append(boyShorts) + TailorCollections[MAKE_A_TOON][BOY_SHORTS].append(boyShorts) for girlShirts in TailorCollections[tailors][GIRL_SHIRTS]: if girlShirts not in TailorCollections[MAKE_A_TOON][GIRL_SHIRTS]: - TailorCollections[MAKE_A_TOON][GIRL_SHIRTS].append(girlShirts) + TailorCollections[MAKE_A_TOON][GIRL_SHIRTS].append(girlShirts) for boyShirts in TailorCollections[tailors][BOY_SHIRTS]: if boyShirts not in TailorCollections[MAKE_A_TOON][BOY_SHIRTS]: - TailorCollections[MAKE_A_TOON][BOY_SHIRTS].append(boyShirts) + TailorCollections[MAKE_A_TOON][BOY_SHIRTS].append(boyShirts) for style in TailorCollections[MAKE_A_TOON][BOY_SHORTS]: index = BottomStyles[style][0] @@ -2510,7 +2510,7 @@ class ToonDNA(AvatarDNA.AvatarDNA): return dgi.getUint8() except: return fallback - + def isValidNetString(self, string): dg = PyDatagram(string) dgi = PyDatagramIterator(dg) @@ -2873,10 +2873,10 @@ class ToonDNA(AvatarDNA.AvatarDNA): def getWhiteColor(self): return allColorsList[0] - + def isLaughingMan(self): return self.laughingMan - + def setTemporary(self, newHead, newArmColor, newLegColor, newHeadColor): if not self.cache and self.getArmColor != newArmColor: self.cache = (self.head, diff --git a/toontown/toonbase/ClientStart.py b/toontown/toonbase/ClientStart.py index 18d18bbf..8192a286 100755 --- a/toontown/toonbase/ClientStart.py +++ b/toontown/toonbase/ClientStart.py @@ -28,7 +28,7 @@ from panda3d.core import loadPrcFile if __debug__: import wx, sys from direct.stdpy import threading - + loadPrcFile('dependencies/config/general.prc') loadPrcFile('dependencies/config/release/dev.prc') diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index e024021b..53bbbe83 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3014,7 +3014,7 @@ SuitAttackTaunts = {'Audit': ["I believe your books don't balance.", 'Objection!', 'Under article 14 subsection C...', 'I see you have broken the law!', - "It seems you don't understand the authority of law.", + "It seems you don't understand the authority of law.", "I'll see you in court, Toon."], 'Tremor': ['Did you feel that?', 'Not afraid of a little tremor are you?', @@ -5411,7 +5411,7 @@ SpecialEventNames = {1: 'Generic Award', 18: 'Most C.F.O.s Defeated', 19: 'Operation Cashbot Chaos Event', 20: 'Most C.E.O.s Defeated', - 21: 'Operation Besiege Bossbot Event'} + 21: 'Operation Besiege Bossbot Event'} NewCatalogNotify = 'There are new items available to order at your phone!' NewDeliveryNotify = 'A new delivery has just arrived at your mailbox!' CatalogNotifyFirstCatalog = 'Your first cattlelog has arrived! You may use this to order new items for yourself or for your house.' @@ -8407,8 +8407,8 @@ id = 0 for dictionary in [BoyPetNames, GirlPetNames, NeutralPetNames]: for name in dictionary: - PetNameDictionary[id] = name - id += 1 + PetNameDictionary[id] = name + id += 1 def getPetName(uniqueID): try: @@ -8419,14 +8419,14 @@ def getPetName(uniqueID): def getRandomPetName(gender = None, seed = None): if seed is not None: random.seed(seed) - + nameList = list(NeutralPetNames) - + if gender == 0: nameList += BoyPetNames else: nameList += GirlPetNames - + return random.choice(nameList) def getPetNameId(name): diff --git a/toontown/town/BRStreet.py b/toontown/town/BRStreet.py index 283112eb..2a6b0fce 100755 --- a/toontown/town/BRStreet.py +++ b/toontown/town/BRStreet.py @@ -17,4 +17,4 @@ class BRStreet(Street.Street): base.playSfx(random.choice(self.loader.windSound)) time = random.random() * 8.0 + 1 taskMgr.doMethodLater(time, self.__windTask, 'BR-wind') - return Task.done + return Task.done \ No newline at end of file diff --git a/toontown/town/DDStreet.py b/toontown/town/DDStreet.py index 8edf7c37..5120add4 100755 --- a/toontown/town/DDStreet.py +++ b/toontown/town/DDStreet.py @@ -9,3 +9,4 @@ class DDStreet(Street.Street): def exit(self): Street.Street.exit(self) self.loader.hood.setNoFog() + diff --git a/toontown/town/DDTownLoader.py b/toontown/town/DDTownLoader.py index d9fce400..2a53faf2 100755 --- a/toontown/town/DDTownLoader.py +++ b/toontown/town/DDTownLoader.py @@ -20,3 +20,4 @@ class DDTownLoader(TownLoader.TownLoader): def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(2) + diff --git a/toontown/town/DGStreet.py b/toontown/town/DGStreet.py index fdf42f1e..76973d9b 100755 --- a/toontown/town/DGStreet.py +++ b/toontown/town/DGStreet.py @@ -2,4 +2,4 @@ from toontown.town import Street class DGStreet(Street.Street): - pass + pass \ No newline at end of file diff --git a/toontown/town/DGTownLoader.py b/toontown/town/DGTownLoader.py index 89ddca97..cc58b8d8 100755 --- a/toontown/town/DGTownLoader.py +++ b/toontown/town/DGTownLoader.py @@ -20,3 +20,4 @@ class DGTownLoader(TownLoader.TownLoader): def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(3) + diff --git a/toontown/town/DLStreet.py b/toontown/town/DLStreet.py index 55d7645f..abdbe94e 100755 --- a/toontown/town/DLStreet.py +++ b/toontown/town/DLStreet.py @@ -2,4 +2,4 @@ from toontown.town import Street class DLStreet(Street.Street): - pass + pass \ No newline at end of file diff --git a/toontown/town/DLTownLoader.py b/toontown/town/DLTownLoader.py index 8bccd1b7..14266537 100755 --- a/toontown/town/DLTownLoader.py +++ b/toontown/town/DLTownLoader.py @@ -20,3 +20,4 @@ class DLTownLoader(TownLoader.TownLoader): def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(3) + diff --git a/toontown/town/MMStreet.py b/toontown/town/MMStreet.py index 69edcbc8..a402d880 100755 --- a/toontown/town/MMStreet.py +++ b/toontown/town/MMStreet.py @@ -2,4 +2,4 @@ from toontown.town import Street class MMStreet(Street.Street): - pass + pass \ No newline at end of file diff --git a/toontown/town/MMTownLoader.py b/toontown/town/MMTownLoader.py index 66b68a44..7f0bb227 100755 --- a/toontown/town/MMTownLoader.py +++ b/toontown/town/MMTownLoader.py @@ -20,3 +20,4 @@ class MMTownLoader(TownLoader.TownLoader): def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(2) + diff --git a/toontown/town/Street.py b/toontown/town/Street.py index d360f79c..18fc9759 100755 --- a/toontown/town/Street.py +++ b/toontown/town/Street.py @@ -397,4 +397,4 @@ class Street(BattlePlace.BattlePlace): if inDreamland: sign.setColorScale(0.525, 0.525, 0.525, 1) - return + return \ No newline at end of file diff --git a/toontown/town/TTStreet.py b/toontown/town/TTStreet.py index ed57a07a..ea9ecf03 100755 --- a/toontown/town/TTStreet.py +++ b/toontown/town/TTStreet.py @@ -2,4 +2,4 @@ from toontown.town import Street class TTStreet(Street.Street): - pass + pass \ No newline at end of file diff --git a/toontown/town/TTTownLoader.py b/toontown/town/TTTownLoader.py index 109c817e..91a8257f 100755 --- a/toontown/town/TTTownLoader.py +++ b/toontown/town/TTTownLoader.py @@ -20,3 +20,4 @@ class TTTownLoader(TownLoader.TownLoader): def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(1) + diff --git a/toontown/town/TownBattle.py b/toontown/town/TownBattle.py index bfb322da..d981f96d 100755 --- a/toontown/town/TownBattle.py +++ b/toontown/town/TownBattle.py @@ -133,7 +133,7 @@ class TownBattle(StateData.StateData): self.cogPanels = (TownBattleCogPanel.TownBattleCogPanel(0), TownBattleCogPanel.TownBattleCogPanel(1), TownBattleCogPanel.TownBattleCogPanel(2), - TownBattleCogPanel.TownBattleCogPanel(3)) + TownBattleCogPanel.TownBattleCogPanel(3)) self.timer = ToontownTimer.ToontownTimer() self.timer.posInTopRightCorner() self.timer.setScale(0.4) @@ -296,7 +296,7 @@ class TownBattle(StateData.StateData): self.cogPanels[3].show() else: self.notify.error('Bad number of toons: %s' % num) - return None + return None def updateChosenAttacks(self, battleIndices, tracks, levels, targets): self.notify.debug('updateChosenAttacks bi=%s tracks=%s levels=%s targets=%s' % (battleIndices, diff --git a/toontown/town/TownBattleCogPanel.py b/toontown/town/TownBattleCogPanel.py index 5b080329..a4677c14 100755 --- a/toontown/town/TownBattleCogPanel.py +++ b/toontown/town/TownBattleCogPanel.py @@ -25,14 +25,14 @@ class TownBattleCogPanel(DirectFrame): healthGlowColors = (Vec4(0.25, 1, 0.25, 0.5),#Green Vec4(0.5, 1, 0.25, .5),#1 Green-Yellow Vec4(0.75, 1, 0.25, .5),#2 Yellow-Green - Vec4(1, 1, 0.25, 0.5),#Yellow + Vec4(1, 1, 0.25, 0.5),#Yellow Vec4(1, 0.866, 0.25, .5),#4 Yellow-Orange Vec4(1, 0.6, 0.25, .5),#5 Orange-Yellow Vec4(1, 0.5, 0.25, 0.5),#6 Orange - Vec4(1, 0.25, 0.25, 0.5),#7 Red-Orange - Vec4(1, 0.25, 0.25, 0.5),#8 Red + Vec4(1, 0.25, 0.25, 0.5),#7 Red-Orange + Vec4(1, 0.25, 0.25, 0.5),#8 Red Vec4(0.3, 0.3, 0.3, 0))#9 Grey - + def __init__(self, id): gui = loader.loadModel('phase_3.5/models/gui/battle_gui') DirectFrame.__init__(self, relief=None, image=gui.find('**/ToonBtl_Status_BG'), image_color=Vec4(0.86, 0.86, 0.86, 0.7)) @@ -53,7 +53,7 @@ class TownBattleCogPanel(DirectFrame): self.hide() gui.removeNode() return - + def setSuit(self, suit): if self.suit == suit: messenger.send(self.suit.uniqueName('hpChange')) @@ -117,7 +117,7 @@ class TownBattleCogPanel(DirectFrame): button.flattenLight() self.healthBarGlow = glow self.healthBar.hide() - self.healthCondition = 0 + self.healthCondition = 0 def updateHealthBar(self): if not self.suit: @@ -133,27 +133,27 @@ class TownBattleCogPanel(DirectFrame): elif health > 0.7: condition = 3#Yellow elif health > 0.6: - condition = 4 + condition = 4 elif health > 0.5: - condition = 5 + condition = 5 elif health > 0.3: condition = 6#Orange elif health > 0.15: condition = 7 elif health > 0.05: - condition = 8#Red + condition = 8#Red elif health > 0.0: condition = 9#Blinking Red else: condition = 10 if self.healthCondition != condition: if condition == 9: - self.blinkTask = self.uniqueName('blink-task') + self.blinkTask = self.uniqueName('blink-task') blinkTask = Task.loop(Task(self.__blinkRed), Task.pause(0.75), Task(self.__blinkGray), Task.pause(0.1)) taskMgr.add(blinkTask, self.blinkTask) elif condition == 10: if self.healthCondition == 9: - self.blinkTask = self.uniqueName('blink-task') + self.blinkTask = self.uniqueName('blink-task') taskMgr.remove(self.blinkTask) self.blinkTask = None blinkTask = Task.loop(Task(self.__blinkRed), Task.pause(0.25), Task(self.__blinkGray), Task.pause(0.1)) @@ -168,7 +168,7 @@ class TownBattleCogPanel(DirectFrame): def __blinkRed(self, task): if not self.blinkTask or not self.healthBar: - return Task.done + return Task.done self.healthBar.setColor(self.healthColors[8], 1) self.healthBarGlow.setColor(self.healthGlowColors[8], 1) if self.healthCondition == 7: @@ -188,18 +188,18 @@ class TownBattleCogPanel(DirectFrame): if self.healthCondition == 9 or self.healthCondition == 10: if self.blinkTask: taskMgr.remove(self.blinkTask) - self.blinkTask = None + self.blinkTask = None if self.healthBar: self.healthBar.removeNode() self.healthBar = None self.healthCondition = 0 return - + def getDisplayedCurrHp(self): return self.currHP - + def getDisplayedMaxHp(self): - return self.maxHP + return self.maxHP def setMaxHp(self, hp): self.maxHP = hp @@ -209,7 +209,7 @@ class TownBattleCogPanel(DirectFrame): def show(self): DirectFrame.show(self) - + def cleanup(self): self.ignoreAll() self.removeHealthBar() diff --git a/toontown/tutorial/DistributedBattleTutorialAI.py b/toontown/tutorial/DistributedBattleTutorialAI.py index 3ee50761..2f837856 100755 --- a/toontown/tutorial/DistributedBattleTutorialAI.py +++ b/toontown/tutorial/DistributedBattleTutorialAI.py @@ -17,6 +17,6 @@ class DistributedBattleTutorialAI(DistributedBattleAI): def exitReward(self): av = simbase.air.doId2do.get(self.air.getAvatarIdFromSender()) - + if av: - av.b_setQuests([[101, 1, 1000, 100, 1]]) + av.b_setQuests([[101, 1, 1000, 100, 1]]) \ No newline at end of file diff --git a/toontown/tutorial/TutorialManagerAI.py b/toontown/tutorial/TutorialManagerAI.py index 1303980d..d29215f9 100755 --- a/toontown/tutorial/TutorialManagerAI.py +++ b/toontown/tutorial/TutorialManagerAI.py @@ -160,11 +160,11 @@ class TutorialManagerAI(DistributedObjectAI): av.b_setMaxHp(15) av.inventory.zeroInv(killUber=True) access = av.getTrackAccess() - + for i in xrange(len(access)): if access[i] == 1: av.inventory.addItem(i, 0) - + av.d_setInventory(av.inventory.makeNetString()) av.experience.zeroOutExp() av.d_setExperience(av.experience.makeNetString()) diff --git a/toontown/uberdog/ClientServicesManagerUD.py b/toontown/uberdog/ClientServicesManagerUD.py index dc89a35d..fa5c28d9 100755 --- a/toontown/uberdog/ClientServicesManagerUD.py +++ b/toontown/uberdog/ClientServicesManagerUD.py @@ -117,7 +117,7 @@ def judgeName(name): return False for banned in blacklist: if banned in namePart: - return False + return False return True # --- ACCOUNT DATABASES --- diff --git a/toontown/uberdog/DistributedPartyManagerUD.py b/toontown/uberdog/DistributedPartyManagerUD.py index c93addd2..de7f1562 100755 --- a/toontown/uberdog/DistributedPartyManagerUD.py +++ b/toontown/uberdog/DistributedPartyManagerUD.py @@ -128,3 +128,4 @@ class DistributedPartyManagerUD(DistributedObjectUD): def mwResponseUdToAllAi(self, todo0, todo1, todo2, todo3): pass + diff --git a/toontown/uberdog/GlobalLobbyManagerAI.py b/toontown/uberdog/GlobalLobbyManagerAI.py index f6a98a11..055fc4fc 100644 --- a/toontown/uberdog/GlobalLobbyManagerAI.py +++ b/toontown/uberdog/GlobalLobbyManagerAI.py @@ -4,49 +4,49 @@ from direct.directnotify.DirectNotifyGlobal import directNotify class GlobalLobbyManagerAI(DistributedObjectGlobalAI): notify = directNotify.newCategory('GlobalLobbyManagerAI') - + def announceGenerate(self): DistributedObjectGlobalAI.announceGenerate(self) self.sendUpdate('lobbyManagerAIHello', [simbase.air.lobbyManager.doId]) def sendAddLobby(self, avId, lobbyId): self.sendUpdate('addLobby', [avId, lobbyId]) - + def queryLobbyForHost(self, hostId): self.sendUpdate('queryLobby', [hostId]) def d_lobbyStarted(self, lobbyId, shardId, zoneId, hostName): self.sendUpdate('lobbyHasStarted', [lobbyId, shardId, zoneId, hostName]) - + def lobbyStarted(self, lobbyId, shardId, zoneId, hostName): pass def d_lobbyDone(self, lobbyId): self.sendUpdate('lobbyDone', [lobbyId]) - + def lobbyDone(self, lobbyId): pass def d_toonJoinedLobby(self, lobbyId, avId): self.sendUpdate('toonJoinedLobby', [lobbyId, avId]) - + def toonJoinedLobby(self, lobbyId, avId): pass def d_toonLeftLobby(self, lobbyId, avId): self.sendUpdate('toonLeftLobby', [lobbyId, avId]) - + def toonLeftLobby(self, lobbyId, avId): pass - + def d_requestLobbySlot(self, lobbyId, avId): self.sendUpdate('requestLobbySlot', [lobbyId, avId]) - + def requestLobbySlot(self, lobbyId, avId): pass def d_allocIds(self, numIds): self.sendUpdate('allocIds', [numIds]) - + def allocIds(self, numIds): pass diff --git a/toontown/uberdog/GlobalLobbyManagerUD.py b/toontown/uberdog/GlobalLobbyManagerUD.py index 6ce36d0e..d8f8a67b 100644 --- a/toontown/uberdog/GlobalLobbyManagerUD.py +++ b/toontown/uberdog/GlobalLobbyManagerUD.py @@ -8,7 +8,7 @@ from pandac.PandaModules import * class GlobalLobbyManagerUD(DistributedObjectGlobalUD): notify = directNotify.newCategory('GlobalLobbyManagerUD') - + def announceGenerate(self): DistributedObjectGlobalUD.announceGenerate(self) self.notify.debug("GLMUD generated") @@ -74,14 +74,14 @@ class GlobalLobbyManagerUD(DistributedObjectGlobalUD): self.senders2Mgrs[simbase.air.getAvatarIdFromSender()] = channel self.sendToAI('lobbyManagerUdStartingUp', []) self.air.addPostRemove(self._makeAIMsg('lobbyManagerUdLost', [], channel)) - + def addLobby(self, avId, lobbyId): if avId in self.host2LobbyId: self.sendToAI('addLobbyResponseUdToAi', [lobbyId, AddLobbyErrorCode.TooManyHostedLobbies, self._formatLobby(self.id2Lobby[lobbyId])]) self.id2Lobby[lobbyId] = {'lobbyId': lobbyId, 'hostId': avId} self.host2LobbyId[avId] = lobbyId self.sendToAI('addLobbyResponseUdToAi', [lobbyId, AddLobbyErrorCode.AllOk, self._formatLobby(self.id2Lobby[lobbyId])]) - + def queryLobby(self, hostId): if hostId in self.host2LobbyId: lobby = self.id2Lobby[self.host2LobbyId[hostId]] @@ -100,7 +100,7 @@ class GlobalLobbyManagerUD(DistributedObjectGlobalUD): lobby['numGuests'] += 1 self.__updateLobbyCount(lobbyId) self.tempSlots[avId] = lobbyId - + taskMgr.doMethodLater(60, self._removeTempSlot, 'lobbyManagerTempSlot%d' % avId, extraArgs=[avId]) info = [lobby['shardId'], lobby['zoneId'], lobby['numGuests'], lobby['hostName']] @@ -109,7 +109,7 @@ class GlobalLobbyManagerUD(DistributedObjectGlobalUD): sender = simbase.air.getAvatarIdFromSender() #dg = self.air.dclassesByName['DistributedPartyGateAI'].getFieldByName('setParty').aiFormatUpdate(gateId, recipient, sender, [info, hostId]) #self.air.send(dg) - + def _removeTempSlot(self, avId): lobbyId = self.tempSlots.get(avId) if lobbyId: