diff --git a/toontown/ai/DistributedBlackCatMgrAI.py b/toontown/ai/DistributedBlackCatMgrAI.py index 0a28ef90..b8080bd0 100755 --- a/toontown/ai/DistributedBlackCatMgrAI.py +++ b/toontown/ai/DistributedBlackCatMgrAI.py @@ -7,7 +7,7 @@ class DistributedBlackCatMgrAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedBlackCatMgrAI") def requestBlackCatTransformation(self): - if not self.air.holidayManager.isHolidayRunning(ToontownGlobals.BLACK_CAT_DAY): + if not self.air.newsManager.isHolidayRunning(ToontownGlobals.BLACK_CAT_DAY): return avId = self.air.getAvatarIdFromSender() diff --git a/toontown/ai/HolidayManagerAI.py b/toontown/ai/HolidayManagerAI.py deleted file mode 100755 index ea75b529..00000000 --- a/toontown/ai/HolidayManagerAI.py +++ /dev/null @@ -1,42 +0,0 @@ -from toontown.toonbase import ToontownGlobals -from datetime import datetime - -class HolidayManagerAI: - - def __init__(self, air): - self.air = air - self.currentHolidays = [] - self.xpMultiplier = 1 - self.setup() - - def setup(self): - holidays = config.GetString('active-holidays','') - - if holidays != '': - for holiday in holidays.split(","): - holiday = int(holiday) - self.currentHolidays.append(holiday) - - date = datetime.now() - - if date.month == 10 and date.day == 31: - # Halloween: Black Cat Day - self.currentHolidays.append(ToontownGlobals.BLACK_CAT_DAY) - - if date.weekday() == 6: - # Saturday: Fish Bingo - self.currentHolidays.append(ToontownGlobals.SILLY_SATURDAY_BINGO) - - simbase.air.newsManager.setHolidayIdList([self.currentHolidays]) - - def isHolidayRunning(self, holidayId): - return holidayId in self.currentHolidays - - def isMoreXpHolidayRunning(self): - if ToontownGlobals.MORE_XP_HOLIDAY in self.currentHolidays: - self.xpMultiplier = 2 - return True - return False - - def getXpMultiplier(self): - return self.xpMultiplier diff --git a/toontown/ai/NewsManagerAI.py b/toontown/ai/NewsManagerAI.py index 4e3ee4ba..9753e89f 100755 --- a/toontown/ai/NewsManagerAI.py +++ b/toontown/ai/NewsManagerAI.py @@ -13,6 +13,9 @@ class NewsManagerAI(DistributedObjectAI): if self.air.suitInvasionManager.getInvading(): self.air.suitInvasionManager.notifyInvasionBulletin(avatar.getDoId()) + def isHolidayRunning(self, holidayId): + return False + def setPopulation(self, todo0): pass diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 1ca52f57..fa725c48 100755 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -10,8 +10,7 @@ from otp.friends.FriendManagerAI import FriendManagerAI from toontown.ai import CogPageManagerAI from toontown.ai import CogSuitManagerAI from toontown.ai import PromotionManagerAI -from toontown.ai.FishManagerAI import FishManagerAI -from toontown.ai.HolidayManagerAI import HolidayManagerAI +from toontown.ai.FishManagerAI import FishManagerAI from toontown.ai.NewsManagerAI import NewsManagerAI from toontown.ai.QuestManagerAI import QuestManagerAI from toontown.ai.DistributedBlackCatMgrAI import DistributedBlackCatMgrAI @@ -119,7 +118,6 @@ class ToontownAIRepository(ToontownInternalRepository): self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI() self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self) self.cogPageManager = CogPageManagerAI.CogPageManagerAI() - self.holidayManager = HolidayManagerAI(self) self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self) self.codeRedemptionMgr.generateWithRequired(2) self.accountDateMgr = AccountDateAI(self) diff --git a/toontown/battle/DistributedBattleBaseAI.py b/toontown/battle/DistributedBattleBaseAI.py index 73fd1c11..7c4c47c3 100755 --- a/toontown/battle/DistributedBattleBaseAI.py +++ b/toontown/battle/DistributedBattleBaseAI.py @@ -50,7 +50,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas if self.air.suitInvasionManager.getInvading(): mult = getInvasionMultiplier() self.battleCalc.setSkillCreditMultiplier(mult) - if self.air.holidayManager.isMoreXpHolidayRunning(): + if self.air.newsManager.isHolidayRunning(ToontownGlobals.MORE_XP_HOLIDAY): mult = getMoreXpHolidayMultiplier() self.battleCalc.setSkillCreditMultiplier(mult) self.fsm = None diff --git a/toontown/fishing/FishGlobals.py b/toontown/fishing/FishGlobals.py index d1776a46..f5cba8ed 100755 --- a/toontown/fishing/FishGlobals.py +++ b/toontown/fishing/FishGlobals.py @@ -718,7 +718,7 @@ def getValue(genus, species, weight): holidayIds = base.cr.newsManager.getHolidayIdList() if ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY in holidayIds or ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH in holidayIds: finalValue *= JellybeanFishingHolidayScoreMultiplier - elif ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY in simbase.air.holidayManager.currentHolidays or ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH in simbase.air.holidayManager.currentHolidays: + elif simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY) or simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_FISHING_HOLIDAY_MONTH): finalValue *= JellybeanFishingHolidayScoreMultiplier return finalValue diff --git a/toontown/minigame/DistributedMinigameAI.py b/toontown/minigame/DistributedMinigameAI.py index 5f451b1a..66fd6648 100755 --- a/toontown/minigame/DistributedMinigameAI.py +++ b/toontown/minigame/DistributedMinigameAI.py @@ -299,7 +299,7 @@ class DistributedMinigameAI(DistributedObjectAI.DistributedObjectAI): score = int(self.scoreDict[avId] + 0.5) else: score = 0 - if ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY in simbase.air.holidayManager.currentHolidays or ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY_MONTH in simbase.air.holidayManager.currentHolidays: + if simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY) or simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY_MONTH): score *= MinigameGlobals.JellybeanTrolleyHolidayScoreMultiplier logEvent = False if score > 255: diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 818115ba..db223383 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -1586,12 +1586,11 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.sendUpdate('setCheesyEffect', [effect, hoodId, expireTime]) def setCheesyEffect(self, effect, hoodId, expireTime): - # We don't yet have a working holidayManager, and we want to keep snowman heads. - if simbase.air.holidayManager and ToontownGlobals.WINTER_CAROLING not in simbase.air.holidayManager.currentHolidays and ToontownGlobals.WACKY_WINTER_CAROLING not in simbase.air.holidayManager.currentHolidays and effect == ToontownGlobals.CESnowMan: + if (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.WINTER_CAROLING)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.WACKY_WINTER_CAROLING)) and effect == ToontownGlobals.CESnowMan: self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime) self.b_setScavengerHunt([]) return - if simbase.air.holidayManager and ToontownGlobals.HALLOWEEN_PROPS not in simbase.air.holidayManager.currentHolidays and ToontownGlobals.HALLOWEEN_COSTUMES not in simbase.air.holidayManager.currentHolidays and not simbase.air.wantHalloween and effect == ToontownGlobals.CEPumpkin: + elif (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_PROPS)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_COSTUMES)) and (not simbase.air.wantHalloween) and effect == ToontownGlobals.CEPumpkin: self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime) self.b_setScavengerHunt([]) return