2015-03-03 16:10:12 -06:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
2015-04-07 09:55:39 -05:00
|
|
|
from datetime import datetime
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
class HolidayManagerAI:
|
|
|
|
|
|
|
|
def __init__(self, air):
|
|
|
|
self.air = air
|
|
|
|
self.currentHolidays = []
|
|
|
|
self.xpMultiplier = 1
|
|
|
|
self.setup()
|
|
|
|
|
|
|
|
def setup(self):
|
|
|
|
holidays = config.GetString('active-holidays','')
|
2015-04-07 09:55:39 -05:00
|
|
|
|
2015-03-03 16:10:12 -06:00
|
|
|
if holidays != '':
|
|
|
|
for holiday in holidays.split(","):
|
|
|
|
holiday = int(holiday)
|
|
|
|
self.currentHolidays.append(holiday)
|
2015-04-07 09:55:39 -05:00
|
|
|
|
|
|
|
date = datetime.now()
|
|
|
|
|
|
|
|
if date.month == 10 and date.day == 31:
|
|
|
|
# Halloween: Black Cat Day
|
|
|
|
self.currentHolidays.append(ToontownGlobals.BLACK_CAT_DAY)
|
|
|
|
|
2015-04-18 18:01:14 -05:00
|
|
|
if date.weekday() == 6:
|
|
|
|
# Saturday: Fish Bingo
|
|
|
|
self.currentHolidays.append(ToontownGlobals.SILLY_SATURDAY_BINGO)
|
|
|
|
|
2015-04-07 09:55:39 -05:00
|
|
|
simbase.air.newsManager.setHolidayIdList([self.currentHolidays])
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
def isHolidayRunning(self, holidayId):
|
2015-04-04 03:20:42 -05:00
|
|
|
return holidayId in self.currentHolidays
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
def isMoreXpHolidayRunning(self):
|
|
|
|
if ToontownGlobals.MORE_XP_HOLIDAY in self.currentHolidays:
|
|
|
|
self.xpMultiplier = 2
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
def getXpMultiplier(self):
|
|
|
|
return self.xpMultiplier
|