From a6b0aeaaffe47307ba627e3a2643f2ae4ab8ec3f Mon Sep 17 00:00:00 2001 From: John Date: Tue, 14 Jul 2015 01:43:13 +0300 Subject: [PATCH 1/3] HD TV + Tailor Fix --- toontown/battle/BattleCalculatorAI.py | 4 +-- toontown/catalog/CatalogFurnitureItem.py | 32 +++++++++++------------ toontown/catalog/CatalogGenerator.py | 4 +-- toontown/toon/DistributedNPCTailorAI.py | 16 +++--------- toontown/toonbase/TTLocalizerEnglish.py | 1 + toontown/town/TownBattle.py | 33 +++++------------------- 6 files changed, 28 insertions(+), 62 deletions(-) diff --git a/toontown/battle/BattleCalculatorAI.py b/toontown/battle/BattleCalculatorAI.py index b3f9f0ca..c3c97803 100755 --- a/toontown/battle/BattleCalculatorAI.py +++ b/toontown/battle/BattleCalculatorAI.py @@ -1529,9 +1529,7 @@ class BattleCalculatorAI: return self.__suitIsLured(suitId) and self.currentlyLuredSuits[suitId][0] > 0 and random.randint(0, 99) < self.currentlyLuredSuits[suitId][2] def itemIsCredit(self, track, level): - if track == PETSOS: - return 0 - return level < self.creditLevel + return track != PETSOS and level < self.creditLevel def __getActualTrack(self, toonAttack): if toonAttack[TOON_TRACK_COL] == NPCSOS: diff --git a/toontown/catalog/CatalogFurnitureItem.py b/toontown/catalog/CatalogFurnitureItem.py index f33a558a..cd081e6d 100755 --- a/toontown/catalog/CatalogFurnitureItem.py +++ b/toontown/catalog/CatalogFurnitureItem.py @@ -71,6 +71,12 @@ for closetId, maxClothes in ClosetToClothes.items(): MaxClosetIds = (508, 518) MaxTrunkIds = (4000, 4010) + +TvToPosScale = { + 1530: ((-1.15, -0.5, 1.1), (2.5, 1.7, 1.4)), + 1531: ((-2.3, -0.2, 1.6), (5)) +} + FurnitureTypes = { 100: ('phase_5.5/models/estate/chairA', # Model None, # Color @@ -715,6 +721,10 @@ FurnitureTypes = { None, None, 675), + 1531: ('phase_5.5/models/estate/bugRoomTV_50inch', + None, + None, + 1250), 1600: ('phase_5.5/models/estate/vaseA_short', None, None, @@ -947,20 +957,7 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem): return BankToMoney.get(self.furnitureType) def getMaxClothes(self): - index = self.furnitureType % 10 - if index == 0: - return 10 - elif index == 2: - return 15 - elif index == 4: - return 20 - elif index == 6: - return 25 - elif index == 8: - return 50 - else: - return None - return None + return ClosetToClothes[self.furnitureType] def reachedPurchaseLimit(self, avatar): if self.getFlags() & FLBank: @@ -1082,13 +1079,14 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem): model.setScale(scale) model.flattenLight() - if self.furnitureType == 1530 and animate: + if animate and self.furnitureType in TvToPosScale: + pos = TvToPosScale[self.furnitureType] screen = NodePath(CardMaker('tv-screen').generate()) model.find('**/toonTownBugTV_screen').hide() screen.reparentTo(model) - screen.setScale(2.5, 1.7, 1.4) - screen.setPos(-1.15, -0.5, 1.1) + screen.setScale(*pos[1]) + screen.setPos(*pos[0]) self.startVideo(screen) return model diff --git a/toontown/catalog/CatalogGenerator.py b/toontown/catalog/CatalogGenerator.py index 641b5811..d42a05b9 100755 --- a/toontown/catalog/CatalogGenerator.py +++ b/toontown/catalog/CatalogGenerator.py @@ -499,6 +499,7 @@ MonthlySchedule = ((7, CatalogGardenStarterItem(), CatalogNametagItem(0), CatalogFurnitureItem(1530), + CatalogFurnitureItem(1531), CatalogClothingItem(1605, 0, True), CatalogClothingItem(1602, 0, True), CatalogClothingItem(1604, 0, True), @@ -1025,7 +1026,6 @@ WeeklySchedule = ((100, 3510, 4010, 4510, - CatalogFurnitureItem(1530), CatalogFurnitureItem(1640), CatalogFurnitureItem(1441)), (100, @@ -1352,7 +1352,7 @@ WeeklySchedule = ((100, Sale(CatalogClothingItem(116, 0), CatalogClothingItem(216, 0), CatalogClothingItem(408, 0), CatalogClothingItem(117, 0), CatalogClothingItem(217, 0), CatalogClothingItem(409, 0), CatalogClothingItem(118, 0), CatalogClothingItem(218, 0), CatalogClothingItem(410, 0), CatalogClothingItem(119, 0), CatalogClothingItem(219, 0), CatalogClothingItem(120, 0), CatalogClothingItem(220, 0), CatalogClothingItem(121, 0), CatalogClothingItem(221, 0), CatalogClothingItem(222, 0), CatalogClothingItem(123, 0), CatalogClothingItem(224, 0), CatalogClothingItem(411, 0), CatalogClothingItem(311, 0), CatalogClothingItem(310, 0)), Sale(CatalogWindowItem(40), CatalogWindowItem(70), CatalogWindowItem(50), CatalogWindowItem(60), CatalogWindowItem(80), CatalogWindowItem(100), CatalogWindowItem(90), CatalogWindowItem(110)), Sale(CatalogEmoteItem(5), CatalogEmoteItem(9), CatalogEmoteItem(13), CatalogEmoteItem(11), CatalogEmoteItem(6), CatalogEmoteItem(8), CatalogNametagItem(10)), - Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1600), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)), + Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1531), CatalogFurnitureItem(1600), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)), (300, (1, 2020), (2, 2030), diff --git a/toontown/toon/DistributedNPCTailorAI.py b/toontown/toon/DistributedNPCTailorAI.py index e012dfb5..d4b73de9 100755 --- a/toontown/toon/DistributedNPCTailorAI.py +++ b/toontown/toon/DistributedNPCTailorAI.py @@ -5,10 +5,6 @@ import ToonDNA from direct.task.Task import Task from toontown.estate import ClosetGlobals -#Going to code this later. For now lets just have it return false. -def isClosetAlmostFull(av): - return False - class DistributedNPCTailorAI(DistributedNPCToonBaseAI): freeClothes = simbase.config.GetBool('free-clothes', 0) housingEnabled = simbase.config.GetBool('want-housing', 1) @@ -34,7 +30,6 @@ class DistributedNPCTailorAI(DistributedNPCToonBaseAI): self.customerDNA = None self.customerId = None DistributedNPCToonBaseAI.delete(self) - return def avatarEnter(self): avId = self.air.getAvatarIdFromSender() @@ -63,7 +58,7 @@ class DistributedNPCTailorAI(DistributedNPCToonBaseAI): elif self.air.questManager.hasTailorClothingTicket(av, self): flag = NPCToons.PURCHASE_MOVIE_START - if self.housingEnabled and isClosetAlmostFull(av): + if self.housingEnabled and self.isClosetAlmostFull(av): flag = NPCToons.PURCHASE_MOVIE_START_NOROOM self.sendShoppingMovie(avId, flag) @@ -71,14 +66,10 @@ class DistributedNPCTailorAI(DistributedNPCToonBaseAI): def isClosetAlmostFull(self, av): numClothes = len(av.clothesTopsList) / 4 + len(av.clothesBottomsList) / 2 - if numClothes >= av.maxClothes - 1: - return 1 - return 0 + return numClothes >= av.maxClothes - 1 def hasEnoughJbs(self, av): - if av.getTotalMoney() >= self.jbCost: - return True - return False + return av.getTotalMoney() >= self.jbCost def sendShoppingMovie(self, avId, flag): self.busy = avId @@ -126,7 +117,6 @@ class DistributedNPCTailorAI(DistributedNPCToonBaseAI): self.sendClearMovie(None) if self.air.questManager.hasTailorClothingTicket(av, self): self.air.questManager.removeClothingTicket(av, self) - return def setDNA(self, blob, finished, which): avId = self.air.getAvatarIdFromSender() diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index cc9580f7..ae24370b 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -5151,6 +5151,7 @@ FurnitureNames = {100: 'Armchair', 1510: 'Radio', 1520: 'Radio', 1530: 'Television', + 1531: '50" HD Television', 1600: 'Short Vase', 1610: 'Tall Vase', 1620: 'Short Vase', diff --git a/toontown/town/TownBattle.py b/toontown/town/TownBattle.py index adbe7349..79cb54b6 100755 --- a/toontown/town/TownBattle.py +++ b/toontown/town/TownBattle.py @@ -270,33 +270,12 @@ class TownBattle(StateData.StateData): cogPanel.updateHealthBar() cogPanel.setPos(0, 0, 0.62) - if num == 1: - self.cogPanels[0].setX(self.oddPos[1]) - self.cogPanels[0].show() - elif num == 2: - self.cogPanels[0].setX(self.evenPos[1]) - self.cogPanels[0].show() - self.cogPanels[1].setX(self.evenPos[2]) - self.cogPanels[1].show() - elif num == 3: - self.cogPanels[0].setX(self.oddPos[0]) - self.cogPanels[0].show() - self.cogPanels[1].setX(self.oddPos[1]) - self.cogPanels[1].show() - self.cogPanels[2].setX(self.oddPos[2]) - self.cogPanels[2].show() - elif num == 4: - self.cogPanels[0].setX(self.evenPos[0]) - self.cogPanels[0].show() - self.cogPanels[1].setX(self.evenPos[1]) - self.cogPanels[1].show() - self.cogPanels[2].setX(self.evenPos[2]) - self.cogPanels[2].show() - self.cogPanels[3].setX(self.evenPos[3]) - self.cogPanels[3].show() - else: - self.notify.error('Bad number of toons: %s' % num) - return None + pos = self.evenPos if num % 2 == 0 else self.oddPos + + for i, panel in enumerate(self.cogPanels): + if num > i: + panel.setX(pos[i if num >= 3 else i + 1]) + panel.show() def updateChosenAttacks(self, battleIndices, tracks, levels, targets): self.notify.debug('updateChosenAttacks bi=%s tracks=%s levels=%s targets=%s' % (battleIndices, From d9d1d66f373c45d63f20b78c9f584a3154f42d52 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 14 Jul 2015 01:53:57 +0300 Subject: [PATCH 2/3] Pro fix --- toontown/catalog/CatalogFurnitureItem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toontown/catalog/CatalogFurnitureItem.py b/toontown/catalog/CatalogFurnitureItem.py index cd081e6d..a9605468 100755 --- a/toontown/catalog/CatalogFurnitureItem.py +++ b/toontown/catalog/CatalogFurnitureItem.py @@ -74,7 +74,7 @@ MaxTrunkIds = (4000, 4010) TvToPosScale = { 1530: ((-1.15, -0.5, 1.1), (2.5, 1.7, 1.4)), - 1531: ((-2.3, -0.2, 1.6), (5)) + 1531: ((-2.3, -0.2, 1.6), (5, 5, 5)) } FurnitureTypes = { From 5b2f6ce8164ff89aad56b6e274652cbdf65ab74a Mon Sep 17 00:00:00 2001 From: John Date: Tue, 14 Jul 2015 13:01:45 +0300 Subject: [PATCH 3/3] The rounds effective for lure now shows on the battle inventory screen --- toontown/toon/InventoryNew.py | 2 ++ toontown/toonbase/TTLocalizerEnglish.py | 1 + toontown/toonbase/ToontownBattleGlobals.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/toontown/toon/InventoryNew.py b/toontown/toon/InventoryNew.py index 281a8c1f..07cdbb8d 100755 --- a/toontown/toon/InventoryNew.py +++ b/toontown/toon/InventoryNew.py @@ -1131,6 +1131,8 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): def getToonupDmgStr(self, track, level): if track == HEAL_TRACK: return TTLocalizer.InventoryHealString + elif track == LURE_TRACK: + return TTLocalizer.InventoryLureString else: return TTLocalizer.InventoryDamageString diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index ae24370b..bbb71d58 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3999,6 +3999,7 @@ InventoryAffectsAllToons = 'Affects: All Toons' InventoryAffectsAllCogs = 'Affects: All ' + Cogs InventoryHealString = 'Toon-up' InventoryDamageString = 'Damage' +InventoryLureString = 'Rounds effective' InventoryBattleMenu = 'BATTLE MENU' InventoryRun = 'RUN' InventorySOS = 'SOS' diff --git a/toontown/toonbase/ToontownBattleGlobals.py b/toontown/toonbase/ToontownBattleGlobals.py index 2fe00b4a..55e2300a 100755 --- a/toontown/toonbase/ToontownBattleGlobals.py +++ b/toontown/toonbase/ToontownBattleGlobals.py @@ -707,6 +707,8 @@ NumRoundsLured = [2, 15] def getAvPropDamage(attackTrack, attackLevel, exp, organicBonus = False, propBonus = False, propAndOrganicBonusStack = False): + if attackTrack == LURE_TRACK: + return NumRoundsLured[attackLevel] minD = AvPropDamage[attackTrack][attackLevel][0][0] maxD = AvPropDamage[attackTrack][attackLevel][0][1] minE = AvPropDamage[attackTrack][attackLevel][1][0]