Beispiel #1
0
    def createZone(self):
        SZHoodAI.createZone(self)
        self.resistanceEmoteManager = DistributedResistanceEmoteMgrAI.DistributedResistanceEmoteMgrAI(
            self.air)
        self.resistanceEmoteManager.generateWithRequired(9720)

        self.spawnObjects()

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(9720)

            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(9720)

        if HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(9619)

            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(9619)
    def createZone(self):
        SZHoodAI.createZone(self)
        self.butterflies = []
        self.spawnObjects()

        self.flower = DistributedDGFlowerAI(self.air)
        self.flower.generateWithRequired(self.HOOD)
        self.createButterflies()

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(5626)

            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(5626)

        elif HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(5620)

            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(5620)
    def createZone(self):
        SZHoodAI.createZone(self)
        self.spawnObjects()
        self.butterflies = []
        self.createButterflies()

        if self.air.config.GetBool('want-doomsday', False):
            self.spawnElection()

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(2659)

            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(2659)

        if HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(2649)

            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(2649)
    def createZone(self):
        SZHoodAI.createZone(self)

        self.spawnObjects()

        self.boat = DistributedBoatAI(self.air)
        self.boat.generateWithRequired(self.safezone)

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(1707)

            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(1707)

        elif HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(1834)

            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(1834)
 def isbingo(self, task):
     # The next tick will occur in exactly an hour.
     task.delayTime = 3600
     if HolidayGlobals.IsBingo() == True:
         self.shouldStop = False
     else:
         self.shouldStop = True
     return task.again
    def createZone(self):
        SZHoodAI.createZone(self)

        self.spawnObjects()

        self.PolarPlaceEffectManager = DistributedPolarPlaceEffectMgrAI.DistributedPolarPlaceEffectMgrAI(
            self.air)
        self.PolarPlaceEffectManager.generateWithRequired(3821)

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(3828)

        elif HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(3707)
    def collectTimedEvents(self):
        if (
            self.filter == ToontownGlobals.CalendarFilterShowAll
            or self.filter == ToontownGlobals.CalendarFilterShowOnlyParties
        ):
            for party in localAvatar.partiesInvitedTo:
                if party.startTime.date() == self.myDate.date():
                    self.addPartyToScrollList(party)

            for party in localAvatar.hostedParties:
                if party.startTime.date() == self.myDate.date():
                    self.addPartyToScrollList(party)

        if (
            self.filter == ToontownGlobals.CalendarFilterShowAll
            or self.filter == ToontownGlobals.CalendarFilterShowOnlyHolidays
        ):
            for id, holiday in HolidayGlobals.Holidays.iteritems():
                title, description = TTLocalizer.HolidayNamesInCalendar[id]

                if "weekDay" in holiday:
                    if self.myDate.weekday() == holiday["weekDay"]:
                        self.addTitleAndDescToScrollList(title, description)
                elif "startMonth" in holiday or "startDay" in holiday:
                    startDate = HolidayGlobals.getStartDate(holiday, self.myDate)
                    endDate = HolidayGlobals.getEndDate(holiday, self.myDate)

                    if self.isDateMatch(self.myDate, startDate):
                        if self.isDateMatch(startDate, endDate):
                            description = "%s. %s" % (title, description)
                        else:
                            description = "%s. %s %s %s" % (
                                title,
                                description,
                                TTLocalizer.CalendarEndsAt,
                                endDate.strftime("%b %d"),
                            )

                        self.addTitleAndDescToScrollList(title, description)
                    elif self.isDateMatch(self.myDate, endDate):
                        title = "%s %s" % (TTLocalizer.CalendarEndOf, title)
                        description = "%s. %s %s" % (title, TTLocalizer.CalendarStartedOn, startDate.strftime("%b %d"))

                        self.addTitleAndDescToScrollList(title, description)
    def createZone(self):
        SZHoodAI.createZone(self)
        self.spawnObjects()

        if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(4614)

            self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(
                self.air)
            self.WinterCarolingTargetManager.generateWithRequired(4614)

        if HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(4835)

            self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(
                self.air)
            self.TrickOrTreatTargetManager.generateWithRequired(4835)
Beispiel #9
0
    def __announceIfHoliday(self, avatar):
        try:
            holidayList = HolidayGlobals.WhatHolidayIsItAI()
            Holiday1 = holidayList[0]
            Holiday2 = holidayList[1]
            self.sendUpdateToAvatarId(avatar.getDoId(), 'setHolidays',
                                      [Holiday1])
            self.sendUpdateToAvatarId(avatar.getDoId(), 'setHolidays',
                                      [Holiday2])
        except:
            holidayList = HolidayGlobals.WhatHolidayIsItAI()
            Holiday1 = holidayList[0]
            self.sendUpdateToAvatarId(avatar.getDoId(), 'setHolidays',
                                      [Holiday1])

        time.sleep(5)
        if self.air.suitInvasionManager.getInvading():
            self.sendUpdateToAvatarId(avatar.getDoId(), 'setInvasionStatus', [
                ToontownGlobals.SuitInvasionBulletin,
                self.air.suitInvasionManager.suitName,
                self.air.suitInvasionManager.numSuits,
                self.air.suitInvasionManager.specialSuit
            ])
    def __init__(self, cr):
        DistributedObject.DistributedObject.__init__(self, cr)
        self.population = 0
        self.invading = 0
        forcedHolidayDecorations = config.GetString(
            'force-holiday-decorations', '')
        self.decorationHolidayIds = []
        self.yearlyCalendarHolidays = []

        if forcedHolidayDecorations != '':
            forcedHolidayDecorations = forcedHolidayDecorations.split(',')
            for HID in forcedHolidayDecorations:
                try:
                    self.decorationHolidayIds.append(
                        decorationHolidays[int(HID)])
                except:
                    print 'holidayId value error: "%s"... skipping' % HID

        self.holidayDecorator = None
        self.holidayIdList = []
        base.cr.newsManager = self
        if hasattr(base, 'localAvatar') and base.localAvatar is not None:
            base.localAvatar.inventory.setInvasionCreditMultiplier(1)
        if hasattr(base, 'localAvatar') and base.localAvatar is not None:
            base.localAvatar.chatMgr.chatInputSpeedChat.addSellbotFieldOfficeMenu(
            )
            if HolidayGlobals.WhatHolidayIsIt() == 'Winter':
                self.startChristmas()
                print "starting christmas"
            if HolidayGlobals.WhatHolidayIsIt() == 'Halloween':
                self.startHalloween()
            if HolidayGlobals.WhatHolidayIsIt() == 'April Toons':
                self.startApril()
        self.weeklyCalendarHolidays = []
        self.yearlyCalendarHolidays = []
        return
    def enter(self):
        self.node.postFlatten()
        AnimatedProp.AnimatedProp.enter(self)
        doAnimLoop = True
        try:
            if type(self).__name__ == 'instance':
                if self.__class__.__name__ == 'GenericAnimatedProp':
                    if HolidayGlobals.IsProp() == True:
                        doAnimLoop = True
                    else:
                        doAnimLoop = False
        except:
            pass

        if doAnimLoop:
            self.node.loop('anim')
Beispiel #12
0
    def InvTick(self, task):
        task.delayTime = 1800
        invMgr = simbase.air.suitInvasionManager
        if invMgr.getInvading():
            print "Invasion in-progress on AI, cannot spawn a different invasion!"
        else:
            try:
                listI = HolidayGlobals.IsItInvasion()
                var1 = str(listI[0])
                var2 = int(listI[1])
                var3 = int(listI[2])
                print var1 + ' ' + var2 + ' ' + var3
                suit = '%s' % var1
                invMgr.startInvasion(suit, var2, var3)
            except:
                pass
                print "Warning: there was an issue spawning an invasion (issue)"

        return task.again
	def __init__(self, toon, invStr = None, ShowSuperGags = 1):
		InventoryBase.InventoryBase.__init__(self, toon, invStr)
		XpMultiplier = HolidayGlobals.WhatIsXp()
		DirectFrame.__init__(self, relief=None)
		self.initialiseoptions(InventoryNew)
		self.battleCreditLevel = None
		self.detailCredit = None
		self.__battleCreditMultiplier = XpMultiplier
		self.__invasionCreditMultiplier = XpMultiplier
		self.__respectInvasions = 1
		self._interactivePropTrackBonus = -1
		self.tutorialFlag = 0
		self.gagTutMode = 0
		self.showSuperGags = ShowSuperGags
		self.clickSuperGags = 1
		self.propAndOrganicBonusStack = config.GetBool('prop-and-organic-bonus-stack', 0)
		self.propBonusIval = Parallel()
		self.activateMode = 'book'
		self.load()
		self.hide()
		return
	def fireworksTick(self, task):
		# The next tick will occur in exactly an hour.
		task.delayTime = 3600
		#showName = config.GetString('hourly-fireworks-type', 'july4')

		#if showName == 'july4':
		 #   showType = ToontownGlobals.JULY4_FIREWORKS
		show = HolidayGlobals.IsItFireworks()
		if show == 'Nyear':
				showType = ToontownGlobals.NEWYEARS_FIREWORKS
		elif show == 'Summer':
			showType = PartyGlobals.FireworkShows.Summer
		elif show == 'Release':
			showType = ToontownGlobals.VICTORY_RELEASE_FIREWORKS
		elif show == 'None':
			return
	#	elif showName == 'random':
	#		shows = [
	#			ToontownGlobals.JULY4_FIREWORKS,
	#			ToontownGlobals.NEWYEARS_FIREWORKS,
	#			PartyGlobals.FireworkShows.Summer,
	#			ToontownGlobals.VICTORY_RELEASE_FIREWORKS]
	#		showType = random.choice(shows)


		numShows = len(FireworkShows.shows.get(showType, []))
		showIndex = random.randint(0, numShows - 1)
		for hood in self.air.hoods:
			if hood.HOOD == ToontownGlobals.GolfZone:
				continue
			fireworksShow = DistributedFireworkShowAI(self.air)
			fireworksShow.generateWithRequired(hood.HOOD)
			fireworksShow.b_startShow(
				showType, showIndex, globalClockDelta.getRealNetworkTime())
			self.notify.info(
				'Oh! A fireworks show has started in this District - next one in exactly 1 hours time!')
		return task.again