mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Holocaust HolidayManagerAI (newsmanager rewrite soon to come)
This commit is contained in:
parent
74429800e7
commit
7029f536c8
8 changed files with 10 additions and 52 deletions
|
@ -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()
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue