diff --git a/toontown/catalog/CatalogGenerator.py b/toontown/catalog/CatalogGenerator.py index 71162d45..63547c15 100755 --- a/toontown/catalog/CatalogGenerator.py +++ b/toontown/catalog/CatalogGenerator.py @@ -12,6 +12,7 @@ from CatalogMouldingItem import CatalogMouldingItem, getAllMouldings from CatalogWainscotingItem import CatalogWainscotingItem, getAllWainscotings from CatalogWindowItem import CatalogWindowItem from CatalogPoleItem import nextAvailablePole, getAllPoles +from CatalogTankItem import nextAvailableTank, getAllTanks from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks from CatalogGardenItem import CatalogGardenItem from CatalogToonStatueItem import CatalogToonStatueItem @@ -843,7 +844,8 @@ WeeklySchedule = ((100, CatalogFurnitureItem(100), nextAvailablePole, nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (100, (5, 2000), CatalogFurnitureItem(1420), @@ -866,7 +868,8 @@ WeeklySchedule = ((100, CatalogClothingItem(117, 0), CatalogClothingItem(217, 0), nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (100, (5, 2000), CatalogFurnitureItem(1430), @@ -889,7 +892,8 @@ WeeklySchedule = ((100, CatalogClothingItem(409, 0), nextAvailablePole, nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (300, (5, 2000), CatalogEmoteItem(13), @@ -910,7 +914,8 @@ WeeklySchedule = ((100, CatalogClothingItem(118, 0), CatalogClothingItem(218, 0), nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (100, (5, 2000), 3000, @@ -930,7 +935,8 @@ WeeklySchedule = ((100, CatalogFurnitureItem(620), nextAvailablePole, nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (300, (5, 2000), 3000, @@ -952,7 +958,8 @@ WeeklySchedule = ((100, CatalogEmoteItem(11), CatalogNametagItem(11), nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (100, (2, 2000), (3, 2010), @@ -978,7 +985,8 @@ WeeklySchedule = ((100, nextAvailablePole, 5000, nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (100, (2, 2000), (3, 2010), @@ -1001,7 +1009,8 @@ WeeklySchedule = ((100, CatalogFurnitureItem(1500), CatalogEmoteItem(6), nextAvailableCloset, - nextAvailableBank), + nextAvailableBank, + nextAvailableTank), (300, (2, 2000), (3, 2010), @@ -1547,6 +1556,9 @@ class CatalogGenerator: if nextAvailableBank not in schedule: weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0) + if nextAvailableTank not in schedule: + weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0) + weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0) if time.time() < 1096617600.0: @@ -1784,6 +1796,8 @@ class CatalogGenerator: item = getAllClosets() elif item == nextAvailableBank: item = getAllBanks() + elif item == nextAvailableTank: + item = getAllTanks() elif item == get50ItemCloset: item = getMaxClosets() elif item == get50ItemTrunk: diff --git a/toontown/catalog/CatalogItemTypes.py b/toontown/catalog/CatalogItemTypes.py index b1c7443d..8fa3e898 100755 --- a/toontown/catalog/CatalogItemTypes.py +++ b/toontown/catalog/CatalogItemTypes.py @@ -19,6 +19,7 @@ import CatalogToonStatueItem import CatalogAnimatedFurnitureItem import CatalogAccessoryItem import CatalogHouseItem +import CatalogTankItem INVALID_ITEM = 0 FURNITURE_ITEM = 1 CHAT_ITEM = 2 @@ -40,6 +41,7 @@ TOON_STATUE_ITEM = 17 ANIMATED_FURNITURE_ITEM = 18 ACCESSORY_ITEM = 19 HOUSE_ITEM = 20 +TANK_ITEM = 21 NonPermanentItemTypes = (RENTAL_ITEM,) CatalogItemTypes = {CatalogInvalidItem.CatalogInvalidItem: INVALID_ITEM, CatalogFurnitureItem.CatalogFurnitureItem: FURNITURE_ITEM, @@ -61,7 +63,8 @@ CatalogItemTypes = {CatalogInvalidItem.CatalogInvalidItem: INVALID_ITEM, CatalogToonStatueItem.CatalogToonStatueItem: TOON_STATUE_ITEM, CatalogAnimatedFurnitureItem.CatalogAnimatedFurnitureItem: ANIMATED_FURNITURE_ITEM, CatalogAccessoryItem.CatalogAccessoryItem: ACCESSORY_ITEM, - CatalogHouseItem.CatalogHouseItem: HOUSE_ITEM} + CatalogHouseItem.CatalogHouseItem: HOUSE_ITEM, + CatalogTankItem.CatalogTankItem: TANK_ITEM} CatalogItemType2multipleAllowed = {INVALID_ITEM: False, FURNITURE_ITEM: True, CHAT_ITEM: False, @@ -82,7 +85,8 @@ CatalogItemType2multipleAllowed = {INVALID_ITEM: False, TOON_STATUE_ITEM: False, ANIMATED_FURNITURE_ITEM: True, ACCESSORY_ITEM: False, - HOUSE_ITEM: False} + HOUSE_ITEM: False, + TANK_ITEM: False} CatalogItemTypeMask = 31 CatalogItemSaleFlag = 128 CatalogItemGiftTag = 64 diff --git a/toontown/catalog/CatalogTankItem.py b/toontown/catalog/CatalogTankItem.py new file mode 100644 index 00000000..1ac7d23e --- /dev/null +++ b/toontown/catalog/CatalogTankItem.py @@ -0,0 +1,95 @@ +import CatalogItem +from toontown.toonbase import ToontownGlobals +from toontown.fishing import FishGlobals +from direct.actor import Actor +from toontown.toonbase import TTLocalizer +from direct.interval.IntervalGlobal import * + +class CatalogTankItem(CatalogItem.CatalogItem): + sequenceNumber = 0 + + def makeNewItem(self, maxTank): + self.maxTank = maxTank + CatalogItem.CatalogItem.makeNewItem(self) + + def getPurchaseLimit(self): + return 1 + + def reachedPurchaseLimit(self, avatar): + return avatar.getMaxFishTank() >= self.maxTank or self in avatar.onOrder or self in avatar.mailboxContents + + def saveHistory(self): + return 1 + + def getTypeName(self): + return TTLocalizer.TankTypeName + + def getName(self): + return TTLocalizer.FishTank % TTLocalizer.FishTankNameDict[self.maxTank] + + def recordPurchase(self, avatar, optional): + if self.maxTank < 0 or self.maxTank > FishGlobals.MaxTank: + return ToontownGlobals.P_InvalidIndex + if self.maxTank <= avatar.getMaxFishTank(): + return ToontownGlobals.P_ItemUnneeded + avatar.b_setMaxFishTank(self.maxTank) + return ToontownGlobals.P_ItemAvailable + + def isGift(self): + return 0 + + def getDeliveryTime(self): + return 1 + + def getPicture(self, avatar): + gui = loader.loadModel('phase_4/models/gui/fishingGui') + bucket = gui.find('**/bucket') + bucket.setScale(2.7) + bucket.setPos(-3.15, 0, 3.2) + + frame = self.makeFrame() + bucket.reparentTo(frame) + gui.removeNode() + return (frame, None) + + def getAcceptItemErrorText(self, retcode): + if retcode == ToontownGlobals.P_ItemAvailable: + return TTLocalizer.CatalogAcceptTank + elif retcode == ToontownGlobals.P_ItemUnneeded: + return TTLocalizer.CatalogAcceptTankUnneeded + return CatalogItem.CatalogItem.getAcceptItemErrorText(self, retcode) + + def output(self, store = -1): + return 'CatalogTankItem(%s%s)' % (self.maxTank, self.formatOptionalData(store)) + + def compareTo(self, other): + return self.maxTank - other.maxTank + + def getHashContents(self): + return self.maxTank + + def getBasePrice(self): + return FishGlobals.TankPriceDict[self.maxTank] + + def decodeDatagram(self, di, versionNumber, store): + CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) + self.maxTank = di.getUint8() + + def encodeDatagram(self, dg, store): + CatalogItem.CatalogItem.encodeDatagram(self, dg, store) + dg.addUint8(self.maxTank) + +def nextAvailableTank(avatar, duplicateItems): + tank = avatar.getMaxFishTank() + + if not tank in FishGlobals.NextTank: + return None + + return CatalogTankItem(FishGlobals.NextTank[tank]) + +def getAllTanks(): + list = [] + for old, new in FishGlobals.NextTank: + list.append(CatalogPoleItem(new)) + + return list \ No newline at end of file diff --git a/toontown/fishing/FishGlobals.py b/toontown/fishing/FishGlobals.py index 15fcfd72..2911ba15 100755 --- a/toontown/fishing/FishGlobals.py +++ b/toontown/fishing/FishGlobals.py @@ -51,12 +51,22 @@ RodPriceDict = {0: 0, 2: 800, 3: 1200, 4: 2000} +TankPriceDict = {0: 0, + 40: 400, + 60: 800, + 80: 1200, + 100: 2000} +NextTank = {20: 40, + 40: 60, + 60: 80, + 80: 100} RodRarityFactor = {0: 1.0 / (GlobalRarityDialBase * 1), 1: 1.0 / (GlobalRarityDialBase * 0.975), 2: 1.0 / (GlobalRarityDialBase * 0.95), 3: 1.0 / (GlobalRarityDialBase * 0.9), 4: 1.0 / (GlobalRarityDialBase * 0.85)} MaxRodId = 4 +MaxTank = 100 FishAudioFileDict = {-1: ('Clownfish.ogg', 1, 1.5, diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index f78ec3b3..29947616 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -15,7 +15,7 @@ from toontown.cogdominium import CogdoUtil from toontown.chat import ResistanceChat from toontown.coghq import CogDisguiseGlobals from toontown.estate import FlowerBasket, FlowerCollection, GardenGlobals -from toontown.fishing import FishCollection, FishTank +from toontown.fishing import FishCollection, FishTank, FishGlobals from toontown.golf import GolfGlobals from toontown.hood import ZoneUtil from toontown.parties import PartyGlobals @@ -4391,8 +4391,8 @@ def maxFishTank(maxFishTank): """ Modify the target's max fish tank value. """ - if not 20 <= maxFishTank <= 99: - return 'Max fish tank value must be in xrange (20-99).' + if not 20 <= maxFishTank <= FishGlobals.MaxTank: + return 'Max fish tank value must be in xrange (20-%s).' % FishGlobals.MaxTank target = spellbook.getTarget() target.b_setMaxFishTank(maxFishTank) return "Set %s's max fish tank value to %d!" % (target.getName(), maxFishTank) diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 0334e6cc..8e495eea 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3922,11 +3922,16 @@ FishPageTrophyTab = 'Trophies' FishPickerTotalValue = 'Bucket: %s / %s\nValue: %d Jellybeans' UnknownFish = '???' FishingRod = '%s Rod' +FishTank = '%s Fishing Bucket' FishingRodNameDict = {0: 'Twig', 1: 'Bamboo', 2: 'Hardwood', 3: 'Steel', 4: 'Gold'} +FishTankNameDict = {40: 'Medium', + 60: 'Big', + 80: 'Large', + 100: 'Ultra'} FishTrophyNameDict = {0: 'Guppy', 1: 'Minnow', 2: 'Fish', @@ -4782,6 +4787,7 @@ ChatTypeName = 'SpeedChat Phrase' EmoteTypeName = 'Acting Lessons' BeanTypeName = 'Jellybeans' PoleTypeName = 'Fishing Pole' +TankTypeName = 'Fishing Bucket' WindowViewTypeName = 'Window View' PetTrickTypeName = 'Doodle Training' GardenTypeName = 'Garden Supplies' @@ -4789,26 +4795,6 @@ RentalTypeName = 'Rental Item' GardenStarterTypeName = 'Gardening Kit' NametagTypeName = 'Name tag' AccessoryTypeName = 'Accessory' -CatalogItemTypeNames = {0: 'INVALID_ITEM', - 1: FurnitureTypeName, - 2: ChatTypeName, - 3: ClothingTypeName, - 4: EmoteTypeName, - 5: 'WALLPAPER', - 6: 'Window View', - 7: 'FLOORING', - 8: 'MOULDING', - 9: 'WAINSCOTING', - 10: PoleTypeName, - 11: PetTrickTypeName, - 12: BeanTypeName, - 13: GardenTypeName, - 14: RentalTypeName, - 15: GardenStarterTypeName, - 16: NametagTypeName, - 17: 'TOON_STATUE', - 18: 'ANIMATED FURNITURE', - 19: AccessoryTypeName} HatStylesDescriptions = {'hbb1': 'Green Baseball Cap', 'kmh1': 'Mouskateer', 'hbb2': 'Blue Baseball Cap', @@ -5494,6 +5480,8 @@ CatalogAcceptBackpack = 'You are now wearing your new backpack. The backpack yo CatalogAcceptShoes = 'You are now wearing your new shoes. The shoes you were wearing before have been moved to your trunk.' CatalogAcceptPole = "You're now ready to go catch some bigger fish with your new pole!" CatalogAcceptPoleUnneeded = 'You already have a better pole than this one!' +CatalogAcceptTank = "You're now ready to catch more fish!" +CatalogAcceptTankUnneeded = 'You already have a bigger tank than this one!' CatalogAcceptChat = 'You now have a new SpeedChat!' CatalogAcceptEmote = 'You now have a new Emotion!' CatalogAcceptBeans = 'You received some jelly beans!'