From be54eb19dff6cae81f8c41e3420baf7eb2de55c5 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 13 Aug 2015 23:39:09 +0300 Subject: [PATCH] 2X merit multiplier for factories --- toontown/ai/PromotionManagerAI.py | 4 ++-- toontown/building/DistributedBuildingMgrAI.py | 5 ++--- toontown/coghq/DistributedBattleFactoryAI.py | 2 +- toontown/coghq/DistributedCountryClubBattleAI.py | 2 +- toontown/coghq/DistributedMintBattleAI.py | 2 +- toontown/coghq/DistributedStageBattleAI.py | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/toontown/ai/PromotionManagerAI.py b/toontown/ai/PromotionManagerAI.py index a803d431..0c36b767 100755 --- a/toontown/ai/PromotionManagerAI.py +++ b/toontown/ai/PromotionManagerAI.py @@ -15,12 +15,12 @@ class PromotionManagerAI: def getPercentChance(self): return 100.0 - def recoverMerits(self, av, cogList, zoneId, multiplier = 1, extraMerits = None): + def recoverMerits(self, av, cogList, zoneId, multiplier = 1, extraMerits = None, addInvasion = True): avId = av.getDoId() meritsRecovered = [0, 0, 0, 0] if extraMerits is None: extraMerits = [0, 0, 0, 0] - if self.air.suitInvasionManager.getInvading(): + if addInvasion and self.air.suitInvasionManager.getInvading(): multiplier *= getInvasionMultiplier() for i in xrange(len(extraMerits)): if CogDisguiseGlobals.isSuitComplete(av.getCogParts(), i): diff --git a/toontown/building/DistributedBuildingMgrAI.py b/toontown/building/DistributedBuildingMgrAI.py index 240255d8..c4f4ff19 100755 --- a/toontown/building/DistributedBuildingMgrAI.py +++ b/toontown/building/DistributedBuildingMgrAI.py @@ -1,6 +1,5 @@ from direct.directnotify.DirectNotifyGlobal import * import cPickle -from pymongo.errors import AutoReconnect from otp.ai.AIBaseGlobal import * from toontown.building import DistributedBuildingAI @@ -193,7 +192,7 @@ class DistributedBuildingMgrAI: {'$setOnInsert': street, '$set': {'buildings': buildings}}, upsert=True) - except AutoReconnect: # Something happened to our DB, but we can reconnect and retry. + except: # Something happened to our DB, but we can reconnect and retry. taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.save, 'retrySave', extraArgs=[]) else: @@ -219,7 +218,7 @@ class DistributedBuildingMgrAI: street = {'ai': self.air.districtId, 'branch': self.branchId} try: doc = self.air.dbGlobalCursor.streets.find_one(street) - except AutoReconnect: # We're failing over - normally we'd wait to retry, but this is on AI startup so we might want to retry (or refactor the bldgMgr so we can sanely retry). + except: # We're failing over - normally we'd wait to retry, but this is on AI startup so we might want to retry (or refactor the bldgMgr so we can sanely retry). return blocks if not doc: diff --git a/toontown/coghq/DistributedBattleFactoryAI.py b/toontown/coghq/DistributedBattleFactoryAI.py index bd675395..7bbd6794 100755 --- a/toontown/coghq/DistributedBattleFactoryAI.py +++ b/toontown/coghq/DistributedBattleFactoryAI.py @@ -29,7 +29,7 @@ class DistributedBattleFactoryAI(DistributedLevelBattleAI.DistributedLevelBattle self.toonItems[toon.doId][1].extend(notRecovered) meritArray = self.air.promotionMgr.recoverMerits( toon, self.suitsKilled, self.getTaskZoneId(), - getFactoryMeritMultiplier(self.getTaskZoneId())) + getFactoryMeritMultiplier(self.getTaskZoneId()) * 2.0, addInvasion=False) if toon.doId in self.helpfulToons: self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray) else: diff --git a/toontown/coghq/DistributedCountryClubBattleAI.py b/toontown/coghq/DistributedCountryClubBattleAI.py index 6950a9e7..1ca68d69 100755 --- a/toontown/coghq/DistributedCountryClubBattleAI.py +++ b/toontown/coghq/DistributedCountryClubBattleAI.py @@ -34,7 +34,7 @@ class DistributedCountryClubBattleAI(DistributedLevelBattleAI.DistributedLevelBa recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId()) self.toonItems[toon.doId][0].extend(recovered) self.toonItems[toon.doId][1].extend(notRecovered) - meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getCountryClubCreditMultiplier(self.getTaskZoneId()), extraMerits=extraMerits) + meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getCountryClubCreditMultiplier(self.getTaskZoneId()) * 2.0, extraMerits=extraMerits, addInvasion=False) if toon.doId in self.helpfulToons: self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray) else: diff --git a/toontown/coghq/DistributedMintBattleAI.py b/toontown/coghq/DistributedMintBattleAI.py index 47f5f99c..6d2ba1de 100755 --- a/toontown/coghq/DistributedMintBattleAI.py +++ b/toontown/coghq/DistributedMintBattleAI.py @@ -33,7 +33,7 @@ class DistributedMintBattleAI(DistributedLevelBattleAI.DistributedLevelBattleAI) recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId()) self.toonItems[toon.doId][0].extend(recovered) self.toonItems[toon.doId][1].extend(notRecovered) - meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getMintCreditMultiplier(self.getTaskZoneId()), extraMerits=extraMerits) + meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getMintCreditMultiplier(self.getTaskZoneId()) * 2.0, extraMerits=extraMerits, addInvasion=False) if toon.doId in self.helpfulToons: self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray) else: diff --git a/toontown/coghq/DistributedStageBattleAI.py b/toontown/coghq/DistributedStageBattleAI.py index 32e162ba..44f3e41c 100755 --- a/toontown/coghq/DistributedStageBattleAI.py +++ b/toontown/coghq/DistributedStageBattleAI.py @@ -41,7 +41,7 @@ class DistributedStageBattleAI(DistributedLevelBattleAI.DistributedLevelBattleAI recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId()) self.toonItems[toon.doId][0].extend(recovered) self.toonItems[toon.doId][1].extend(notRecovered) - meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getStageCreditMultiplier(self.level.getFloorNum()), extraMerits=extraMerits) + meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getStageCreditMultiplier(self.level.getFloorNum()) * 2.0, extraMerits=extraMerits, addInvasion=False) if toon.doId in self.helpfulToons: self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray) else: