diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index 1fbece71..84cb0a38 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -1525,7 +1525,7 @@ struct multipleStartHoliday { dclass NewsManager : DistributedObject { startHoliday(uint8) broadcast; endHoliday(uint8) broadcast; - startHolidays(uint8[]); + setActiveHolidays(uint8[]); }; dclass PurchaseManager : DistributedObject { diff --git a/toontown/ai/HalloweenHolidayDecorator.py b/toontown/ai/HalloweenHolidayDecorator.py index bdd1800f..ce5cbbde 100755 --- a/toontown/ai/HalloweenHolidayDecorator.py +++ b/toontown/ai/HalloweenHolidayDecorator.py @@ -80,8 +80,7 @@ class HalloweenHolidayDecorator(HolidayDecorator.HolidayDecorator): for light in place.loader.hood.halloweenLights: light.setColorScaleOff(0) - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if ToontownGlobals.HALLOWEEN_COSTUMES not in holidayIds and ToontownGlobals.SPOOKY_COSTUMES not in holidayIds: + if not base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN): return if (self.__checkHoodValidity() or self.__checkStreetValidity()) and hasattr(base.cr.playGame, 'hood') and base.cr.playGame.hood and hasattr(base.cr.playGame.hood, 'sky') and base.cr.playGame.hood.sky: preShow = Sequence(Parallel(LerpColorScaleInterval(base.cr.playGame.hood.sky, 1.5, Vec4(1, 1, 1, 0.25)), LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 2.5, Vec4(0.55, 0.55, 0.65, 1)), Func(__lightDecorationOn__)), Func(self.__startSpookySky)) @@ -97,8 +96,7 @@ class HalloweenHolidayDecorator(HolidayDecorator.HolidayDecorator): distributedEstate = base.cr.doFind('DistributedEstate') if distributedEstate: distributedEstate.unloadWitch() - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if len(holidayIds) > 0: + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN): self.decorate() return storageFile = base.cr.playGame.hood.storageDNAFile diff --git a/toontown/ai/HolidayDecorator.py b/toontown/ai/HolidayDecorator.py index 6f9df79e..a90a95e2 100755 --- a/toontown/ai/HolidayDecorator.py +++ b/toontown/ai/HolidayDecorator.py @@ -1,4 +1,3 @@ -from toontown.toonbase import ToontownGlobals from direct.interval.IntervalGlobal import Parallel, Sequence, Func, Wait from pandac.PandaModules import Vec4, TransformState, NodePath, TransparencyAttrib @@ -21,10 +20,6 @@ class HolidayDecorator: self.swapIval.start() def undecorate(self): - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if len(holidayIds) > 0: - self.decorate() - return storageFile = base.cr.playGame.hood.storageDNAFile if storageFile: loadDNAFile(self.dnaStore, storageFile, CSDefault) @@ -34,10 +29,11 @@ class HolidayDecorator: def updateHoodDNAStore(self): hood = base.cr.playGame.hood - holidayIds = base.cr.newsManager.getDecorationHolidayId() - for holiday in holidayIds: - for storageFile in hood.holidayStorageDNADict.get(holiday, []): - loadDNAFile(self.dnaStore, storageFile, CSDefault) + + for key, value in self.holidayStorageDNADict.iteritems(): + if base.cr.newsManager.isHolidayRunning(key): + for storageFile in value: + loadDNAFile(self.dnaStore, storageFile, CSDefault) def getSwapVisibleIval(self, wait = 5.0, tFadeOut = 3.0, tFadeIn = 3.0): loader = base.cr.playGame.hood.loader @@ -65,4 +61,4 @@ class HolidayDecorator: s = Sequence(Wait(wait), np.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut'), Func(np.detachNode), Func(np.clearTransparency), newNP.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0), blendType='easeInOut'), Func(newNP.clearTransparency), Func(newNP.clearColorScale)) p.append(s) - return p + return p \ No newline at end of file diff --git a/toontown/ai/HolidayGlobals.py b/toontown/ai/HolidayGlobals.py index 40d447d0..72fb45b8 100644 --- a/toontown/ai/HolidayGlobals.py +++ b/toontown/ai/HolidayGlobals.py @@ -62,11 +62,11 @@ Holidays = { 'effectMessage': TTLocalizer.GreenToonEffectMsg, 'effectDelay': 10 }, - ToontownGlobals.WINTER_CAROLING: { - 'startMonth': 12, + ToontownGlobals.CHRISTMAS: { + """'startMonth': 12, 'startDay': 14, 'endMonth': 1, - 'endDay': 4, + 'endDay': 4,""" 'startMessage': TTLocalizer.WinterCarolingStart, 'ongoingMessage': TTLocalizer.WinterCarolingStart, 'endMessage': TTLocalizer.WinterCarolingEnd, @@ -74,7 +74,7 @@ Holidays = { 'effectDelay': 15, 'scavengerHunt': WINTER_CAROLING }, - ToontownGlobals.TRICK_OR_TREAT: { + ToontownGlobals.HALLOWEEN: { 'startMonth': 10, 'startDay': 13, 'endMonth': 10, diff --git a/toontown/ai/NewsManager.py b/toontown/ai/NewsManager.py index 897d55cd..8f796e01 100755 --- a/toontown/ai/NewsManager.py +++ b/toontown/ai/NewsManager.py @@ -8,6 +8,7 @@ class NewsManager(DistributedObject): def __init__(self, cr): DistributedObject.__init__(self, cr) + print 'NewsMgr - GEN!' self.invading = False self.activeHolidays = [] base.localAvatar.inventory.setInvasionCreditMultiplier(1) @@ -20,12 +21,10 @@ class NewsManager(DistributedObject): def isHolidayRunning(self, id): return id in self.activeHolidays - def startHolidays(self, ids): + def setActiveHolidays(self, ids): + print 'set active holidays %s' % ids for id in ids: self.startHoliday(id, True) - - def getDecorationHolidayId(self): - return [] def broadcastHoliday(self, holiday, type): if type in holiday: @@ -62,9 +61,9 @@ class NewsManager(DistributedObject): base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu() elif id == ToontownGlobals.IDES_OF_MARCH: base.localAvatar.chatMgr.chatInputSpeedChat.addIdesOfMarchMenu() - elif id == ToontownGlobals.TRICK_OR_TREAT: + elif id == ToontownGlobals.HALLOWEEN: base.localAvatar.chatMgr.chatInputSpeedChat.addHalloweenMenu() - elif id == ToontownGlobals.WINTER_CAROLING: + elif id == ToontownGlobals.CHRISTMAS: base.localAvatar.chatMgr.chatInputSpeedChat.addWinterMenu() def endSpecialHoliday(self, id): @@ -78,7 +77,7 @@ class NewsManager(DistributedObject): base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu() elif id == ToontownGlobals.IDES_OF_MARCH: base.localAvatar.chatMgr.chatInputSpeedChat.removeIdesOfMarchMenu() - elif id == ToontownGlobals.TRICK_OR_TREAT: + elif id == ToontownGlobals.HALLOWEEN: base.localAvatar.chatMgr.chatInputSpeedChat.removeHalloweenMenu() - elif id == ToontownGlobals.WINTER_CAROLING: + elif id == ToontownGlobals.CHRISTMAS: base.localAvatar.chatMgr.chatInputSpeedChat.removeWinterMenu() \ No newline at end of file diff --git a/toontown/ai/NewsManagerAI.py b/toontown/ai/NewsManagerAI.py index ec6bc480..450c5388 100755 --- a/toontown/ai/NewsManagerAI.py +++ b/toontown/ai/NewsManagerAI.py @@ -19,11 +19,12 @@ class NewsManagerAI(DistributedObjectAI): def delete(self): DistributedObjectAI.delete(self) taskMgr.remove(self.checkTask) - + def __handleAvatarEntered(self, av): - avId = av.getDoId() - - self.sendUpdateToAvatarId(avId, 'startHolidays', [self.activeHolidays]) + self.sendUpdateToAvatarId(av.getDoId(), 'setActiveHolidays', [self.activeHolidays]) + + def getActiveHolidays(self): + return self.activeHolidays def __checkHolidays(self, task=None): date = datetime.now() diff --git a/toontown/estate/DistributedEstate.py b/toontown/estate/DistributedEstate.py index b291320e..0c9fb082 100755 --- a/toontown/estate/DistributedEstate.py +++ b/toontown/estate/DistributedEstate.py @@ -69,13 +69,10 @@ class DistributedEstate(DistributedObject.DistributedObject): self.defaultSignModel = loader.loadModel('phase_13/models/parties/eventSign') self.activityIconsModel = loader.loadModel('phase_4/models/parties/eventSignIcons') self.lt = base.localAvatar - newsManager = base.cr.newsManager - if newsManager: - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds: - self.loadWitch() - else: - self.loadAirplane() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN): + self.loadWitch() + else: + self.loadAirplane() self.loadFlowerSellBox() self.loadFishSellBox() self.oldClear = base.win.getClearColor() diff --git a/toontown/estate/Estate.py b/toontown/estate/Estate.py index f0db502d..b0de096d 100755 --- a/toontown/estate/Estate.py +++ b/toontown/estate/Estate.py @@ -99,21 +99,14 @@ class Estate(Place.Place): def enter(self, requestStatus): hoodId = requestStatus['hoodId'] zoneId = requestStatus['zoneId'] - newsManager = base.cr.newsManager if config.GetBool('want-estate-telemetry-limiter', 1): limiter = TLGatherAllAvs('Estate', RotationLimitToH) else: limiter = TLNull() self._telemLimiter = limiter - if newsManager: - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds) and self.loader.hood.spookySkyFile: - lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky)) - lightsOff.start() - else: - self.loader.hood.startSky() - lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) - lightsOn.start() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile: + lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky)) + lightsOff.start() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) diff --git a/toontown/fishing/FishGlobals.py b/toontown/fishing/FishGlobals.py index f5cba8ed..867020b4 100755 --- a/toontown/fishing/FishGlobals.py +++ b/toontown/fishing/FishGlobals.py @@ -713,16 +713,10 @@ def getValue(genus, species, weight): value = OVERALL_VALUE_SCALE * (rarityValue + weightValue) finalValue = int(ceil(value)) base = getBase() - if hasattr(base, 'cr') and base.cr: - if hasattr(base.cr, 'newsManager') and base.cr.newsManager: - holidayIds = base.cr.newsManager.getHolidayIdList() - if ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY in holidayIds or ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH in holidayIds: - finalValue *= JellybeanFishingHolidayScoreMultiplier - elif simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY) or simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH): + if simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY) or simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH): finalValue *= JellybeanFishingHolidayScoreMultiplier return finalValue - __totalNumFish = 0 __emptyRodDict = {} for rodIndex in __rodDict: diff --git a/toontown/hood/BRHood.py b/toontown/hood/BRHood.py index 242ee7cb..343d750e 100755 --- a/toontown/hood/BRHood.py +++ b/toontown/hood/BRHood.py @@ -3,7 +3,6 @@ from toontown.town.BRTownLoader import BRTownLoader from toontown.toonbase import ToontownGlobals from toontown.hood.ToonHood import ToonHood - class BRHood(ToonHood): notify = directNotify.newCategory('BRHood') @@ -16,7 +15,5 @@ class BRHood(ToonHood): TITLE_COLOR = (0.3, 0.6, 1.0, 1.0) HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_8/dna/winter_storage_BR.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_8/dna/winter_storage_BR.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_8/dna/halloween_props_storage_BR.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_8/dna/halloween_props_storage_BR.pdna']} + ToontownGlobals.CHRISTMAS: ['phase_8/dna/winter_storage_BR.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_8/dna/halloween_props_storage_BR.pdna']} \ No newline at end of file diff --git a/toontown/hood/BRHoodAI.py b/toontown/hood/BRHoodAI.py index 2515f9c4..f219eaf7 100755 --- a/toontown/hood/BRHoodAI.py +++ b/toontown/hood/BRHoodAI.py @@ -23,10 +23,10 @@ class BRHoodAI(HoodAI.HoodAI): self.PolarPlaceEffectManager = DistributedPolarPlaceEffectMgrAI.DistributedPolarPlaceEffectMgrAI(self.air) self.PolarPlaceEffectManager.generateWithRequired(3821) - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(3707) # Snowplace Like Home, Sleet Street - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(3828) # Snowman's Land, Polar Place def createTrolley(self): diff --git a/toontown/hood/DDHood.py b/toontown/hood/DDHood.py index 7e2a8602..bb9b569a 100755 --- a/toontown/hood/DDHood.py +++ b/toontown/hood/DDHood.py @@ -15,16 +15,12 @@ class DDHood(ToonHood): SPOOKY_SKY_FILE = 'phase_3.5/models/props/BR_sky' TITLE_COLOR = (0.8, 0.6, 0.5, 1.0) underwaterColor = Vec4(0.0, 0.0, 0.6, 1.0) - HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_6/dna/winter_storage_DD.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_6/dna/winter_storage_DD.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_6/dna/halloween_props_storage_DD.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_6/dna/halloween_props_storage_DD.pdna']} - def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): - ToonHood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId) + HOLIDAY_DNA = { + ToontownGlobals.CHRISTMAS: ['phase_6/dna/winter_storage_DD.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_6/dna/halloween_props_storage_DD.pdna']} def load(self): ToonHood.load(self) - self.fog = Fog('DDFog') + self.fog = Fog('DDFog') \ No newline at end of file diff --git a/toontown/hood/DDHoodAI.py b/toontown/hood/DDHoodAI.py index d96dfa2a..11901617 100755 --- a/toontown/hood/DDHoodAI.py +++ b/toontown/hood/DDHoodAI.py @@ -22,10 +22,10 @@ class DDHoodAI(HoodAI.HoodAI): self.createTrolley() self.createBoat() - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(1834) # Rudderly Ridiculous, Lighthouse Lane - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(1707) # Gifts with a Porpoise, Seaweed Street def createTrolley(self): diff --git a/toontown/hood/DGHood.py b/toontown/hood/DGHood.py index 3ca0974b..ce2fc224 100755 --- a/toontown/hood/DGHood.py +++ b/toontown/hood/DGHood.py @@ -3,7 +3,6 @@ from toontown.town.DGTownLoader import DGTownLoader from toontown.toonbase import ToontownGlobals from toontown.hood.ToonHood import ToonHood - class DGHood(ToonHood): notify = directNotify.newCategory('DGHood') @@ -16,7 +15,5 @@ class DGHood(ToonHood): TITLE_COLOR = (0.8, 0.6, 1.0, 1.0) HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DG.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DG.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_8/dna/halloween_props_storage_DG.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_8/dna/halloween_props_storage_DG.pdna']} + ToontownGlobals.CHRISTMAS: ['phase_8/dna/winter_storage_DG.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_8/dna/halloween_props_storage_DG.pdna']} diff --git a/toontown/hood/DGHoodAI.py b/toontown/hood/DGHoodAI.py index 3dacceae..cf3bad65 100755 --- a/toontown/hood/DGHoodAI.py +++ b/toontown/hood/DGHoodAI.py @@ -30,10 +30,10 @@ class DGHoodAI(HoodAI.HoodAI): self.greenToonMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.IDES_OF_MARCH, 15) self.greenToonMgr.generateWithRequired(5819) - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(5620) # Rake It Inn, Elm Street - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(5626) # Pine Needle Crafts, Elm Street def shutdown(self): diff --git a/toontown/hood/DLHood.py b/toontown/hood/DLHood.py index 286dad4e..87dc4867 100755 --- a/toontown/hood/DLHood.py +++ b/toontown/hood/DLHood.py @@ -3,7 +3,6 @@ from toontown.town.DLTownLoader import DLTownLoader from toontown.toonbase import ToontownGlobals from toontown.hood.ToonHood import ToonHood - class DLHood(ToonHood): notify = directNotify.newCategory('DLHood') @@ -15,7 +14,5 @@ class DLHood(ToonHood): TITLE_COLOR = (1.0, 0.9, 0.5, 1.0) HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DL.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DL.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_8/dna/halloween_props_storage_DL.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_8/dna/halloween_props_storage_DL.pdna']} + ToontownGlobals.CHRISTMAS: ['phase_8/dna/winter_storage_DL.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_8/dna/halloween_props_storage_DL.pdna']} diff --git a/toontown/hood/DLHoodAI.py b/toontown/hood/DLHoodAI.py index 857ef9f3..3ce55554 100755 --- a/toontown/hood/DLHoodAI.py +++ b/toontown/hood/DLHoodAI.py @@ -23,10 +23,10 @@ class DLHoodAI(HoodAI.HoodAI): self.resistanceEmoteManager = DistributedResistanceEmoteMgrAI.DistributedResistanceEmoteMgrAI(self.air) self.resistanceEmoteManager.generateWithRequired(9720) - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(9619) # Relax to the Max, Lullaby Lane - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(9722) # Dream On Talent Agency, Pajama Place self.createPillow() diff --git a/toontown/hood/EstateHood.py b/toontown/hood/EstateHood.py index 0690e397..dc9fa7de 100755 --- a/toontown/hood/EstateHood.py +++ b/toontown/hood/EstateHood.py @@ -30,10 +30,8 @@ class EstateHood(Hood): self.storageDNAFile = 'phase_5.5/dna/storage_estate.pdna' self.holidayStorageDNADict = { - WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna'], - WACKY_WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna'], - HALLOWEEN_PROPS: ['phase_5.5/dna/halloween_props_storage_estate.pdna'], - SPOOKY_PROPS: ['phase_5.5/dna/halloween_props_storage_estate.pdna']} + CHRISTMAS: ['phase_5.5/dna/winter_storage_estate.pdna'], + HALLOWEEN: ['phase_5.5/dna/halloween_props_storage_estate.pdna']} self.skyFile = 'phase_3.5/models/props/TT_sky' self.spookySkyFile = 'phase_3.5/models/props/BR_sky' diff --git a/toontown/hood/GSHood.py b/toontown/hood/GSHood.py index 83cfd0fe..f30ab959 100755 --- a/toontown/hood/GSHood.py +++ b/toontown/hood/GSHood.py @@ -22,4 +22,4 @@ class GSHood(ToonHood): base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar) base.localAvatar.chatMgr.chatInputSpeedChat.removeKartRacingMenu() - ToonHood.exit(self) + ToonHood.exit(self) \ No newline at end of file diff --git a/toontown/hood/Hood.py b/toontown/hood/Hood.py index 86f10c51..75e21e06 100755 --- a/toontown/hood/Hood.py +++ b/toontown/hood/Hood.py @@ -76,28 +76,24 @@ class Hood(StateData.StateData): def load(self): files = [] + if self.storageDNAFile: files.append(self.storageDNAFile) - newsManager = base.cr.newsManager - if newsManager: - holidayIds = base.cr.newsManager.getDecorationHolidayId() - for holiday in holidayIds: - for storageFile in self.holidayStorageDNADict.get(holiday, []): + + for key, value in self.holidayStorageDNADict.iteritems(): + if base.cr.newsManager.isHolidayRunning(key): + for storageFile in value: files.append(storageFile) - if ToontownGlobals.HALLOWEEN_COSTUMES not in holidayIds and ToontownGlobals.SPOOKY_COSTUMES not in holidayIds or not self.spookySkyFile: - self.sky = loader.loadModel(self.skyFile) - self.sky.setTag('sky', 'Regular') - self.sky.setScale(1.0) - self.sky.setFogOff() - else: - self.sky = loader.loadModel(self.spookySkyFile) - self.sky.setTag('sky', 'Halloween') - if not newsManager: + if not base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) or not self.spookySkyFile: self.sky = loader.loadModel(self.skyFile) self.sky.setTag('sky', 'Regular') self.sky.setScale(1.0) self.sky.setFogOff() + else: + self.sky = loader.loadModel(self.spookySkyFile) + self.sky.setTag('sky', 'Halloween') + dnaBulk = DNABulkLoader(self.dnaStore, tuple(files)) dnaBulk.loadDNAFiles() diff --git a/toontown/hood/MMHood.py b/toontown/hood/MMHood.py index fe77c620..311f81e3 100755 --- a/toontown/hood/MMHood.py +++ b/toontown/hood/MMHood.py @@ -16,7 +16,5 @@ class MMHood(ToonHood): TITLE_COLOR = (1.0, 0.5, 0.5, 1.0) HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_6/dna/winter_storage_MM.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_6/dna/winter_storage_MM.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_6/dna/halloween_props_storage_MM.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_6/dna/halloween_props_storage_MM.pdna']} + ToontownGlobals.CHRISTMAS: ['phase_6/dna/winter_storage_MM.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_6/dna/halloween_props_storage_MM.pdna']} \ No newline at end of file diff --git a/toontown/hood/MMHoodAI.py b/toontown/hood/MMHoodAI.py index 052b5dc3..6595d45f 100755 --- a/toontown/hood/MMHoodAI.py +++ b/toontown/hood/MMHoodAI.py @@ -24,10 +24,10 @@ class MMHoodAI(HoodAI.HoodAI): self.piano = DistributedMMPianoAI.DistributedMMPianoAI(self.air) self.piano.generateWithRequired(self.zoneId) - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(4835) # Ursatz for Really Kool Katz, Tenor Terrace - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(4614) # Shave and a Haircut for a Song, Alto Avenue def createTrolley(self): diff --git a/toontown/hood/PartyHood.py b/toontown/hood/PartyHood.py index 796e23a7..37c051fc 100755 --- a/toontown/hood/PartyHood.py +++ b/toontown/hood/PartyHood.py @@ -27,8 +27,7 @@ class PartyHood(Hood.Hood): self.safeZoneLoaderClass = PartyLoader.PartyLoader self.partyActivityDoneEvent = 'partyActivityDone' self.storageDNAFile = 'phase_13/dna/storage_party_sz.pdna' - self.holidayStorageDNADict = {WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna'], - WACKY_WINTER_DECORATIONS: ['phase_5.5/dna/winter_storage_estate.pdna']} + self.holidayStorageDNADict = {CHRISTMAS: ['phase_5.5/dna/winter_storage_estate.pdna']} self.skyFile = 'phase_3.5/models/props/TT_sky' self.popupInfo = None return diff --git a/toontown/hood/SellbotHQAI.py b/toontown/hood/SellbotHQAI.py index 093282a2..576c3451 100755 --- a/toontown/hood/SellbotHQAI.py +++ b/toontown/hood/SellbotHQAI.py @@ -56,9 +56,7 @@ class SellbotHQAI(CogHQAI.CogHQAI): self.factoryElevators.append(factoryElevator) def createFactoryBoardingParty(self): - factoryIdList = [] - for factoryElevator in self.factoryElevators: - factoryIdList.append(factoryElevator.doId) + factoryIdList = [elevator.doId for elevator in self.factoryElevators] self.factoryBoardingParty = DistributedBoardingPartyAI(self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired(ToontownGlobals.SellbotFactoryExt) diff --git a/toontown/hood/TTHood.py b/toontown/hood/TTHood.py index ccf9ee29..b43760d1 100755 --- a/toontown/hood/TTHood.py +++ b/toontown/hood/TTHood.py @@ -1,11 +1,9 @@ +from otp.ai.MagicWordGlobal import * from toontown.safezone.TTSafeZoneLoader import TTSafeZoneLoader from toontown.town.TTTownLoader import TTTownLoader from toontown.toonbase import ToontownGlobals from toontown.hood.ToonHood import ToonHood -from otp.ai.MagicWordGlobal import * - - class TTHood(ToonHood): notify = directNotify.newCategory('TTHood') @@ -18,11 +16,8 @@ class TTHood(ToonHood): TITLE_COLOR = (1.0, 0.5, 0.4, 1.0) HOLIDAY_DNA = { - ToontownGlobals.WINTER_DECORATIONS: ['phase_4/dna/winter_storage_TT.pdna', 'phase_4/dna/winter_storage_TT_sz.pdna'], - ToontownGlobals.WACKY_WINTER_DECORATIONS: ['phase_4/dna/winter_storage_TT.pdna', 'phase_4/dna/winter_storage_TT_sz.pdna'], - ToontownGlobals.HALLOWEEN_PROPS: ['phase_4/dna/halloween_props_storage_TT.pdna', 'phase_4/dna/halloween_props_storage_TT_sz.pdna'], - ToontownGlobals.SPOOKY_PROPS: ['phase_4/dna/halloween_props_storage_TT.pdna', 'phase_4/dna/halloween_props_storage_TT_sz.pdna']} - + ToontownGlobals.CHRISTMAS: ['phase_4/dna/winter_storage_TT.pdna', 'phase_4/dna/winter_storage_TT_sz.pdna'], + ToontownGlobals.HALLOWEEN: ['phase_4/dna/halloween_props_storage_TT.pdna', 'phase_4/dna/halloween_props_storage_TT_sz.pdna']} @magicWord(category=CATEGORY_CREATIVE) def spooky(): @@ -42,4 +37,4 @@ def spooky(): fadeOut.start() spookySfx = base.loadSfx('phase_4/audio/sfx/spooky.ogg') spookySfx.play() - return 'Activating the spooky effect...' + return 'Activating the spooky effect...' \ No newline at end of file diff --git a/toontown/hood/TTHoodAI.py b/toontown/hood/TTHoodAI.py index 91748a11..5a4347f2 100755 --- a/toontown/hood/TTHoodAI.py +++ b/toontown/hood/TTHoodAI.py @@ -30,10 +30,10 @@ class TTHoodAI(HoodAI.HoodAI): (ToontownGlobals.ToontownCentral, TTLocalizer.NPCToonNames[2021], ('dss', 'ls', 's', 'm', 13, 41, 13, 13, 1, 6, 1, 6, 0, 18, 0), 'm', 1, NPCToons.NPC_GLOVE), ToontownGlobals.ToontownCentral, posIndex=0) - self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12) + self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12) self.trickOrTreatMgr.generateWithRequired(2649) # All Fun and Games Shop, Silly Street - self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14) + self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14) self.winterCarolingMgr.generateWithRequired(2659) # Joy Buzzers to the World, Silly Street def shutdown(self): diff --git a/toontown/parties/PartyEditor.py b/toontown/parties/PartyEditor.py index 5a26add3..f42d24ea 100755 --- a/toontown/parties/PartyEditor.py +++ b/toontown/parties/PartyEditor.py @@ -46,10 +46,9 @@ class PartyEditor(DirectObject, FSM): self.partyPlanner.gui.find('**/activitiesButtonDown_down'), self.partyPlanner.gui.find('**/activitiesButtonDown_rollover'), self.partyPlanner.gui.find('**/activitiesButtonDown_inactive')), incButton_relief=None, incButton_pos=(-0.05, 0.0, -0.94), itemFrame_pos=(pos[0], pos[1], pos[2] + 0.04), itemFrame_relief=None, numItemsVisible=1, items=[]) - holidayIds = base.cr.newsManager.getHolidayIdList() - isWinter = ToontownGlobals.WINTER_DECORATIONS in holidayIds or ToontownGlobals.WACKY_WINTER_DECORATIONS in holidayIds - isVictory = ToontownGlobals.VICTORY_PARTY_HOLIDAY in holidayIds - isValentine = ToontownGlobals.VALENTINES_DAY in holidayIds + isWinter = base.cr.newsManager.isHolidayRunning(ToontownGlobals.CHRISTMAS) + isVictory = base.cr.newsManager.isHolidayRunning(ToontownGlobals.VICTORY_PARTY_HOLIDAY) + isValentine = base.cr.newsManager.isHolidayRunning(ToontownGlobals.VALENTINES_DAY) for activityId in PartyGlobals.PartyEditorActivityOrder: if not isVictory and activityId in PartyGlobals.VictoryPartyActivityIds or not isWinter and activityId in PartyGlobals.WinterPartyActivityIds or not isValentine and activityId in PartyGlobals.ValentinePartyActivityIds: pass diff --git a/toontown/parties/PartyPlanner.py b/toontown/parties/PartyPlanner.py index 1524463a..379eb542 100755 --- a/toontown/parties/PartyPlanner.py +++ b/toontown/parties/PartyPlanner.py @@ -156,13 +156,12 @@ class PartyPlanner(DirectFrame, FSM): self.prevButton['state'] = DirectGuiGlobals.NORMAL self.nextButton.hide() defaultInviteTheme = PartyGlobals.InviteTheme.GenericMale - if hasattr(base.cr, 'newsManager') and base.cr.newsManager: - if ToontownGlobals.VICTORY_PARTY_HOLIDAY in base.cr.newsManager.getHolidayIdList(): - defaultInviteTheme = PartyGlobals.InviteTheme.VictoryParty - elif ToontownGlobals.KARTING_TICKETS_HOLIDAY in base.cr.newsManager.getHolidayIdList() or ToontownGlobals.GRAND_PRIX in base.cr.newsManager.getHolidayIdList(): - defaultInviteTheme = PartyGlobals.InviteTheme.Racing - elif ToontownGlobals.VALENTINES_DAY in base.cr.newsManager.getHolidayIdList(): - defaultInviteTheme = PartyGlobals.InviteTheme.Valentoons + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.VICTORY_PARTY_HOLIDAY): + defaultInviteTheme = PartyGlobals.InviteTheme.VictoryParty + elif base.cr.newsManager.isHolidayRunning(ToontownGlobals.KARTING_TICKETS_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.GRAND_PRIX): + defaultInviteTheme = PartyGlobals.InviteTheme.Racing + elif base.cr.newsManager.isHolidayRunning(ToontownGlobals.VALENTINES_DAY): + defaultInviteTheme = PartyGlobals.InviteTheme.Valentoons if self.partyInfo is not None: del self.partyInfo activityList = self.partyEditor.partyEditorGrid.getActivitiesOnGrid() @@ -593,14 +592,12 @@ class PartyPlanner(DirectFrame, FSM): def __handleHolidays(self): self.inviteThemes = range(len(PartyGlobals.InviteTheme)) - if hasattr(base.cr, 'newsManager') and base.cr.newsManager: - holidayIds = base.cr.newsManager.getHolidayIdList() - if ToontownGlobals.VALENTINES_DAY not in holidayIds: - self.inviteThemes.remove(PartyGlobals.InviteTheme.Valentoons) - if ToontownGlobals.VICTORY_PARTY_HOLIDAY not in holidayIds: - self.inviteThemes.remove(PartyGlobals.InviteTheme.VictoryParty) - if ToontownGlobals.WINTER_DECORATIONS not in holidayIds and ToontownGlobals.WACKY_WINTER_DECORATIONS not in holidayIds: - self.inviteThemes.remove(PartyGlobals.InviteTheme.Winter) + if not base.cr.newsManager.isHolidayRunning(ToontownGlobals.VALENTINES_DAY): + self.inviteThemes.remove(PartyGlobals.InviteTheme.Valentoons) + if not base.cr.newsManager.isHolidayRunning(ToontownGlobals.VICTORY_PARTY_HOLIDAY): + self.inviteThemes.remove(PartyGlobals.InviteTheme.VictoryParty) + if not base.cr.newsManager.isHolidayRunning(ToontownGlobals.CHRISTMAS): + self.inviteThemes.remove(PartyGlobals.InviteTheme.Winter) def _createFarewellPage(self): page = DirectFrame(self.frame) diff --git a/toontown/racing/RaceEndPanels.py b/toontown/racing/RaceEndPanels.py index ad8088b7..8b9cbd31 100755 --- a/toontown/racing/RaceEndPanels.py +++ b/toontown/racing/RaceEndPanels.py @@ -293,7 +293,7 @@ class RaceWinningsPanel(DirectFrame): else: self.circuitTotalLabel.stash() self.raceTotalLabel.unstash() - if ToontownGlobals.KARTING_TICKETS_HOLIDAY not in base.cr.newsManager.getHolidayIdList() or self.race.raceType != RaceGlobals.Practice: + if (not base.cr.newsManager.isHolidayRunning(ToontownGlobals.KARTING_TICKETS_HOLIDAY)) or self.race.raceType != RaceGlobals.Practice: self.doubleTicketsLabel.stash() if ticBonus: ticketSeq.append(Sequence(Func(self.ticketFrame.hide), Func(self.bonusFrame.show), Func(self.trophyFrame.hide), Func(self.bonusComponents[0].configure, text=wrapStr(TTLocalizer.KartRace_RecordString % (TTLocalizer.KartRecordStrings[bonusType], TTLocalizer.KartRace_TrackNames[track], str(ticBonus)))), Wait(3))) diff --git a/toontown/safezone/Playground.py b/toontown/safezone/Playground.py index a6046e21..df998594 100755 --- a/toontown/safezone/Playground.py +++ b/toontown/safezone/Playground.py @@ -166,6 +166,7 @@ class Playground(Place.Place): self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) + for i in self.loader.nodeList: self.loader.enterAnimatedProps(i) @@ -178,47 +179,28 @@ class Playground(Place.Place): self.loader.hood.eventLights += geom.findAllMatches('**/prop_snow_tree*') self.loader.hood.eventLights += geom.findAllMatches('**/prop_tree*') self.loader.hood.eventLights += geom.findAllMatches('**/*christmas*') + for light in self.loader.hood.eventLights: light.setColorScaleOff(0) - newsManager = base.cr.newsManager - if newsManager: - holidayIds = base.cr.newsManager.getDecorationHolidayId() - #Halloween Event - if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds) and self.loader.hood.spookySkyFile: - lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky), Func(__lightDecorationOn__)) - lightsOff.start() - else: - self.loader.hood.startSky() - lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) - lightsOn.start() - #Christmas Event - if (ToontownGlobals.WINTER_DECORATIONS in holidayIds or ToontownGlobals.WACKY_WINTER_DECORATIONS in holidayIds) and self.loader.hood.snowySkyFile: - lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.7, 0.7, 0.8, 1)), Func(self.loader.hood.startSnowySky), Func(__lightDecorationOn__)) - lightsOff.start() - self.snowEvent = BattleParticles.loadParticleFile('snowdisk.ptf') - self.snowEvent.setPos(0, 30, 10) - #2 and 3 are only for the blizzard event and should be removed - self.snowEvent2 = BattleParticles.loadParticleFile('snowdisk.ptf') - self.snowEvent2.setPos(0, 10, 10) - self.snowEvent3 = BattleParticles.loadParticleFile('snowdisk.ptf') - self.snowEvent3.setPos(0, 20, 5) - self.snowEventRender = base.cr.playGame.hood.loader.geom.attachNewNode('snowRender') - self.snowEventRender.setDepthWrite(2) - self.snowEventRender.setBin('fixed', 1) - self.snowEventFade = None - self.snowEvent.start(camera, self.snowEventRender) - #2 and 3 are only for the blizzard event and should be removed - self.snowEvent2.start(camera, self.snowEventRender) - self.snowEvent3.start(camera, self.snowEventRender) - else: - self.loader.hood.startSky() - lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) - lightsOn.start() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile: + lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky), Func(__lightDecorationOn__)) + lightsOff.start() + elif base.cr.newsManager.isHolidayRunning(ToontownGlobals.CHRISTMAS) and self.loader.hood.snowySkyFile: + lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.7, 0.7, 0.8, 1)), Func(self.loader.hood.startSnowySky), Func(__lightDecorationOn__)) + lightsOff.start() + self.snowEvent = BattleParticles.loadParticleFile('snowdisk.ptf') + self.snowEvent.setPos(0, 30, 10) + self.snowEventRender = base.cr.playGame.hood.loader.geom.attachNewNode('snowRender') + self.snowEventRender.setDepthWrite(2) + self.snowEventRender.setBin('fixed', 1) + self.snowEventFade = None + self.snowEvent.start(camera, self.snowEventRender) else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() + NametagGlobals.setWant2dNametags(True) self.zoneId = requestStatus['zoneId'] self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList) @@ -242,7 +224,6 @@ class Playground(Place.Place): for light in self.loader.hood.eventLights: light.reparentTo(hidden) - newsManager = base.cr.newsManager NametagGlobals.setWant2dNametags(False) for i in self.loader.nodeList: self.loader.exitAnimatedProps(i) diff --git a/toontown/suit/DistributedSellbotBoss.py b/toontown/suit/DistributedSellbotBoss.py index a920181c..503caffb 100755 --- a/toontown/suit/DistributedSellbotBoss.py +++ b/toontown/suit/DistributedSellbotBoss.py @@ -66,7 +66,7 @@ class DistributedSellbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): self.strafeInterval = None self.onscreenMessage = None self.toonMopathInterval = [] - self.nerfed = ToontownGlobals.SELLBOT_NERF_HOLIDAY in base.cr.newsManager.getHolidayIdList() + self.nerfed = base.cr.newsManager.isHolidayRunning(ToontownGlobals.SELLBOT_NERF_HOLIDAY) self.localToonPromoted = True self.resetMaxDamage() diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 5993393f..fa6f4637 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -251,16 +251,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute self.setGMIcon(access) def setDNA(self, dna): - if base.cr.newsManager: - if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SPOOKY_BLACK_CAT): - black = 26 - heads = ['cls', - 'css', - 'csl', - 'cll'] - dna.setTemporary(random.choice(heads), black, black, black) - else: - dna.restoreTemporary(self.style) oldHat = self.getHat() oldGlasses = self.getGlasses() oldBackpack = self.getBackpack() diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 74ce8240..b89d5b99 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -1586,14 +1586,15 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.sendUpdate('setCheesyEffect', [effect, hoodId, expireTime]) def setCheesyEffect(self, effect, hoodId, expireTime): - if (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.WINTER_CAROLING)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.WACKY_WINTER_CAROLING)) and effect == ToontownGlobals.CESnowMan: + if (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.CHRISTMAS)) and effect == ToontownGlobals.CESnowMan: self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime) self.b_setScavengerHunt([]) return - elif (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_PROPS)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_COSTUMES)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.TRICK_OR_TREAT)) and effect == ToontownGlobals.CEPumpkin: + elif (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN)) and effect == ToontownGlobals.CEPumpkin: self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime) self.b_setScavengerHunt([]) return + self.savedCheesyEffect = effect self.savedCheesyHoodId = hoodId self.savedCheesyExpireTime = expireTime @@ -1605,7 +1606,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo taskMgr.doMethodLater(duration, self.__undoCheesyEffect, taskName) else: self.__undoCheesyEffect(None) - return def getCheesyEffect(self): return (self.savedCheesyEffect, self.savedCheesyHoodId, self.savedCheesyExpireTime) diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 62854071..51d58a6f 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -8225,13 +8225,12 @@ DayNamesAbbrev = ('MON', 'SUN') HolidayNamesInCalendar = {1: ('Summer Fireworks', 'Celebrate Summer with a fireworks show every hour in each playground!'), 2: ('New Year Fireworks', 'Happy New Year! Enjoy a fireworks show every hour in each playground!'), - 3: ('Bloodsucker Invasion', 'Help defend Toontown from the Bloodsucker invasion!'), + 3: ('Halloween', 'Happy Halloween! Trick or treat throughout Toontown to get a nifty Halloween pumpkin head reward!'), 4: ('Winter Holiday', 'Celebrate the Winter Holiday with Toontastic decorations, party and Cattlelog items, and more!'), 5: ('Skelecog Invasion', 'Stop the Skelecogs from invading Toontown!'), 6: ('Mr. Hollywood Invasion', 'Stop the Mr. Hollywood Cogs from invading Toontown!'), 8: ('Toon Species Election', 'Vote on the new Toon species! Will it be Goat? Will it be Pig?'), 9: ('Black Cat Day', 'Create a Toontastic Black Cat Toon - today only!'), - 13: ('Trick or Treat', 'Happy Halloween! Trick or treat throughout Toontown to get a nifty Halloween pumpkin head reward!'), 16: ('Grand Prix', 'Grand Prix Monday at Goofy Speedway! To win, collect the most points in three consecutive races!'), 17: ('Fish Bingo', 'Fish Bingo Wednesday! Everyone at the pond works together to complete the card before time runs out.'), 18: ('Silly Saturdays', 'Saturdays are silly with Fish Bingo and Grand Prix throughout the day!'), @@ -8260,7 +8259,6 @@ HolidayNamesInCalendar = {1: ('Summer Fireworks', 'Celebrate Summer with a firew 54: ('Bean Counter Invasion', 'Stop the Bean Counter Cogs from invading Toontown!'), 55: ('Double Talker Invasion', 'Stop the Double Talker Cogs from invading Toontown!'), 56: ('Downsizer Invasion', 'Stop the Downsizer Cogs from invading Toontown!'), - 57: ('Caroling', 'Sing for your Snowman Head! See the Blog for details!'), 59: ("ValenToon's Day", "Celebrate ValenToon's Day from Feb 09 to Feb 16!"), 72: ('Yes Men Invasion', 'Stop the Yes Men Cogs from invading Toontown!'), 73: ('Tightwad Invasion', 'Stop the Tightwad Cogs from invading Toontown!'), diff --git a/toontown/toonbase/ToontownGlobals.py b/toontown/toonbase/ToontownGlobals.py index 81b2eefd..ce774f19 100755 --- a/toontown/toonbase/ToontownGlobals.py +++ b/toontown/toonbase/ToontownGlobals.py @@ -828,14 +828,13 @@ NO_HOLIDAY = 0 JULY4_FIREWORKS = 1 NEWYEARS_FIREWORKS = 2 HALLOWEEN = 3 -WINTER_DECORATIONS = 4 +CHRISTMAS = 4 SKELECOG_INVASION = 5 MR_HOLLYWOOD_INVASION = 6 BLACK_CAT_DAY = 9 RESISTANCE_EVENT = 10 KART_RECORD_DAILY_RESET = 11 KART_RECORD_WEEKLY_RESET = 12 -TRICK_OR_TREAT = 13 CIRCUIT_RACING = 14 POLAR_PLACE_EVENT = 15 GRAND_PRIX = 16 @@ -844,8 +843,6 @@ SILLY_SATURDAY = 18 BOSSCOG_INVASION = 23 MARCH_INVASION = 24 MORE_XP_HOLIDAY = 25 -HALLOWEEN_PROPS = 26 -HALLOWEEN_COSTUMES = 27 DECEMBER_INVASION = 28 APRIL_TOONS_WEEK = 29 OCTOBER31_FIREWORKS = 31 @@ -875,7 +872,6 @@ COLD_CALLER_INVASION = 53 BEAN_COUNTER_INVASION = 54 DOUBLE_TALKER_INVASION = 55 DOWNSIZER_INVASION = 56 -WINTER_CAROLING = 57 HYDRANT_ZERO_HOLIDAY = 58 VALENTINES_DAY = 59 SILLYMETER_HOLIDAY = 60 @@ -930,12 +926,6 @@ JELLYBEAN_TROLLEY_HOLIDAY_MONTH = 113 JELLYBEAN_FISHING_HOLIDAY_MONTH = 114 JELLYBEAN_PARTIES_HOLIDAY_MONTH = 115 SILLYMETER_EXT_HOLIDAY = 116 -SPOOKY_BLACK_CAT = 117 -SPOOKY_TRICK_OR_TREAT = 118 -SPOOKY_PROPS = 119 -SPOOKY_COSTUMES = 120 -WACKY_WINTER_DECORATIONS = 121 -WACKY_WINTER_CAROLING = 122 LAUGHING_MAN = 123 TOT_REWARD_JELLYBEAN_AMOUNT = 100 TOT_REWARD_END_OFFSET_AMOUNT = 0 diff --git a/toontown/town/Street.py b/toontown/town/Street.py index c389a865..d0e25560 100755 --- a/toontown/town/Street.py +++ b/toontown/town/Street.py @@ -115,16 +115,9 @@ class Street(BattlePlace.BattlePlace): for light in self.halloweenLights: light.setColorScaleOff(1) - newsManager = base.cr.newsManager - if newsManager: - holidayIds = base.cr.newsManager.getDecorationHolidayId() - if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds) and self.loader.hood.spookySkyFile: - lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky)) - lightsOff.start() - else: - self.loader.hood.startSky() - lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) - lightsOn.start() + if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile: + lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky)) + lightsOff.start() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) @@ -146,7 +139,6 @@ class Street(BattlePlace.BattlePlace): for light in self.halloweenLights: light.reparentTo(hidden) - newsManager = base.cr.newsManager NametagGlobals.setWant2dNametags(False) self.loader.hood.stopSky() self.loader.music.stop()