def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] Place.Place.enter(self) self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) how = requestStatus['how'] self.fsm.request(how, [requestStatus]) self._telemLimiter = TLGatherAllAvs('CogHQLobby', RotationLimitToH)
def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] self.fsm.enterInitialState() messenger.send('enterToonInterior') self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) volume = requestStatus.get('musicVolume', 0.7) base.playMusic(self.loader.activityMusic, looping=1, volume=volume) self._telemLimiter = TLGatherAllAvs('ToonInterior', RotationLimitToH) NametagGlobals.setWant2dNametags(True) self.fsm.request(requestStatus['how'], [requestStatus])
def enter(self, requestStatus, bossCog): self.zoneId = requestStatus['zoneId'] BattlePlace.BattlePlace.enter(self) self.fsm.enterInitialState() self.bossCog = bossCog if self.bossCog: self.bossCog.d_avatarEnter() self._telemLimiter = TLGatherAllAvs('CogHQBossBattle', RotationLimitToH) NametagGlobals.setMasterArrowsOn(1) base.localAvatar.inventory.setRespectInvasions(0) self.fsm.request(requestStatus['how'], [requestStatus])
def enter(self, requestStatus): self.fsm.enterInitialState() messenger.send('enterPlayground') self.accept('doorDoneEvent', self.handleDoorDoneEvent) 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) self._telemLimiter = TLGatherAllAvs('Playground', RotationLimitToH) def __lightDecorationOn__(): geom = base.cr.playGame.hood.loader.geom self.loader.hood.halloweenLights = geom.findAllMatches( '**/*light*') self.loader.hood.halloweenLights += geom.findAllMatches( '**/*lamp*') self.loader.hood.halloweenLights += geom.findAllMatches( '**/prop_snow_tree*') for light in self.loader.hood.halloweenLights: light.setColorScaleOff(0) 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), 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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() NametagGlobals.setMasterArrowsOn(1) self.zoneId = requestStatus['zoneId'] self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.loader.nodeList, self.zoneId) how = requestStatus['how'] if how == 'teleportIn': how = 'deathAck' self.fsm.request(how, [requestStatus])
def enter(self, requestStatus, visibilityFlag=1, arrowsOn=1): teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus, )) self._ttfToken = None self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) if visibilityFlag: self.visibilityOn() base.localAvatar.setGeom(self.loader.geom) base.localAvatar.setOnLevelGround(1) self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH) NametagGlobals.setWant2dNametags(arrowsOn) self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId']) def __lightDecorationOn__(): geom = base.cr.playGame.getPlace().loader.geom self.halloweenLights = geom.findAllMatches('**/*light*') self.halloweenLights += geom.findAllMatches('**/*lamp*') self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*') 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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) self.enterZone(requestStatus['zoneId']) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.loader.nodeList, self.zoneId) self.fsm.request(requestStatus['how'], [requestStatus]) self.replaceStreetSignTextures() return
def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] BattlePlace.BattlePlace.enter(self) self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) self.nodeList = [self.loader.geom] self._telemLimiter = TLGatherAllAvs('CogHQExterior', RotationLimitToH) self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) NametagGlobals.setMasterArrowsOn(1) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId) how = requestStatus['how'] self.fsm.request(how, [requestStatus])
def enter(self, requestStatus): hoodId = requestStatus['hoodId'] zoneId = requestStatus['zoneId'] if config.GetBool('want-party-telemetry-limiter', 1): limiter = TLGatherAllAvs('Party', RotationLimitToH) else: limiter = TLNull() self._telemLimiter = limiter self.loader.hood.startSky() for i in self.loader.nodeList: self.loader.enterAnimatedProps(i) self.loader.geom.reparentTo(render) self.fsm.request(requestStatus['how'], [requestStatus]) self.playMusic()
def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] # Load the CogHQ DNA file: dnaStore = DNAStorage() dnaFileName = self.genDNAFileName(self.zoneId) if not dnaFileName.endswith('13200.pdna'): loadDNAFileAI(dnaStore, dnaFileName) # Collect all of the vis group zone IDs: self.zoneVisDict = {} for i in range(dnaStore.getNumDNAVisGroupsAI()): groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) visZoneId = int( base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in range(visGroup.getNumVisibles()): visibles.append(int(visGroup.visibles[i])) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles # Next, we want interest in all vis groups due to this being a Cog HQ: base.cr.sendSetZoneMsg(self.zoneId, list(self.zoneVisDict.values())[0]) BattlePlace.BattlePlace.enter(self) self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) self.nodeList = [self.loader.geom] self.loader.hood.startSky() self._telemLimiter = TLGatherAllAvs('FactoryExterior', RotationLimitToH) self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) NametagGlobals.setWant2dNametags(True) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.nodeList, self.zoneId) how = requestStatus['how'] self.fsm.request(how, [requestStatus])
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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() self.loader.hood.sky.setFogOff() self.__setFaintFog() for i in self.loader.nodeList: self.loader.enterAnimatedProps(i) self.loader.geom.reparentTo(render) # The client April Toons Manager is currently broken, so we have to do this hacky thing instead. :( #if hasattr(base.cr, 'aprilToonsMgr'): #if self.isEventActive(AprilToonsGlobals.EventEstateGravity): #base.localAvatar.startAprilToonsControls() if base.config.GetBool('want-april-toons'): base.localAvatar.startAprilToonsControls() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) self.fsm.request(requestStatus['how'], [requestStatus])
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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() self.loader.hood.sky.setFogOff() self.__setFaintFog() for i in self.loader.nodeList: self.loader.enterAnimatedProps(i) self.loader.geom.reparentTo(render) if base.cr.newsManager: if base.cr.newsManager.isHolidayRunning( ToontownGlobals.APRIL_FOOLS_COSTUMES): base.localAvatar.startAprilToonsControls() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) base.playMusic(self.loader.music, looping=1, volume=0.8) self.fsm.request(requestStatus['how'], [requestStatus])
def enter(self, requestStatus): self.fsm.enterInitialState() base.transitions.fadeOut(t=0) base.localAvatar.inventory.setRespectInvasions(0) base.cr.forbidCheesyEffects(1) self._telemLimiter = TLGatherAllAvs('CountryClubInterior', RotationLimitToH) def commence(self=self): NametagGlobals.setMasterArrowsOn(1) self.fsm.request(requestStatus['how'], [requestStatus]) if self.isSecond: self.musicSeq.start() else: base.playMusic(self.music, looping=1, volume=0.8) base.transitions.irisIn() CountryClub = bboard.get( DistributedCountryClub.DistributedCountryClub.ReadyPost) self.loader.hood.spawnTitleText(CountryClub.countryClubId, CountryClub.floorNum) self.CountryClubReadyWatcher = BulletinBoardWatcher.BulletinBoardWatcher( 'CountryClubReady', DistributedCountryClub.DistributedCountryClub.ReadyPost, commence) self.CountryClubDefeated = 0 self.acceptOnce(DistributedCountryClub.DistributedCountryClub.WinEvent, self.handleCountryClubWinEvent) if __debug__ and 0: self.accept( 'f10', lambda: messenger.send(DistributedCountryClub. DistributedCountryClub.WinEvent)) self.confrontedBoss = 0 def handleConfrontedBoss(self=self): self.confrontedBoss = 1 self.acceptOnce('localToonConfrontedCountryClubBoss', handleConfrontedBoss)
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.10000000000000001, Vec4(0.55000000000000004, 0.55000000000000004, 0.65000000000000002, 1)), Func(self.loader.hood.startSpookySky)) lightsOff.start() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.10000000000000001, Vec4(1, 1, 1, 1)) lightsOn.start() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.10000000000000001, Vec4(1, 1, 1, 1)) lightsOn.start() self.loader.hood.sky.setFogOff() self._Estate__setFaintFog() for i in self.loader.nodeList: self.loader.enterAnimatedProps(i) self.loader.geom.reparentTo(render) if hasattr(base.cr, 'newsManager') and base.cr.newsManager: holidayIds = base.cr.newsManager.getHolidayIdList() if ToontownGlobals.APRIL_FOOLS_COSTUMES in holidayIds or ToontownGlobals.SILLYMETER_EXT_HOLIDAY in holidayIds: self.startAprilFoolsControls() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) self.fsm.request(requestStatus['how'], [ requestStatus])
def enter(self, requestStatus): self.zoneId = requestStatus['zoneId'] if self.zoneId != ToontownGlobals.LawbotOfficeExt and self.zoneId != ToontownGlobals.SellbotWestWing and self.zoneId not in ToontownGlobals.ShortWorkZones: dnaStore = DNAStorage() dnaFileName = self.genDNAFileName(self.zoneId) loadDNAFileAI(dnaStore, dnaFileName) self.zoneVisDict = {} for i in xrange(dnaStore.getNumDNAVisGroupsAI()): groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) visZoneId = int( base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): visibles.append(int(visGroup.visibles[i])) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0]) BattlePlace.BattlePlace.enter(self) self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) if self.loader.factGeom: self.loader.factGeom.reparentTo(render) self.nodeList = [self.loader.geom] self.loader.hood.startSky() self._telemLimiter = TLGatherAllAvs('FactoryExterior', RotationLimitToH) self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) NametagGlobals.setMasterArrowsOn(1) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.nodeList, self.zoneId) how = requestStatus['how'] self.fsm.request(how, [requestStatus])
def enter(self, requestStatus, visibilityFlag=1, arrowsOn=1): teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus, )) self._ttfToken = None self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) if visibilityFlag: self.visibilityOn() base.localAvatar.setGeom(self.loader.geom) base.localAvatar.setOnLevelGround(1) self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH) NametagGlobals.setMasterArrowsOn(arrowsOn) self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId']) def __lightDecorationOn__(): try: geom = base.cr.playGame.getPlace().loader.geom except: loaderId = ZoneUtil.getBranchLoaderName( 2000) # TEMP hack. This will port you to ttc if ^ fails whereId = ZoneUtil.getToonWhereName(200) how = 'teleportIn' print("This Should not happen.") requestStatus = [{ 'loader': loaderId, 'where': whereId, 'how': how, 'hoodId': 2000, 'zoneId': 2000, 'shardId': None, 'avId': -1 }] base.cr.playGame.getPlace().fsm.forceTransition( 'teleportOut', requestStatus) self.loader.hood.eventLights = geom.findAllMatches('**/*light*') self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*') 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(1) 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)) 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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) self.enterZone(requestStatus['zoneId']) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.loader.nodeList, self.zoneId) self.fsm.request(requestStatus['how'], [requestStatus])
def enter(self, requestStatus, visibilityFlag=1, arrowsOn=1): teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus, )) self._ttfToken = None self.fsm.enterInitialState() base.playMusic(self.loader.music, looping=1, volume=0.8) self.loader.geom.reparentTo(render) if visibilityFlag: self.visibilityOn() base.localAvatar.setGeom(self.loader.geom) base.localAvatar.setOnLevelGround(1) self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH) NametagGlobals.setMasterArrowsOn(arrowsOn) def __lightDecorationOn__(): geom = base.cr.playGame.getPlace().loader.geom self.loader.hood.eventLights = geom.findAllMatches('**/*light*') self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*') 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(1) newsManager = base.cr.newsManager if newsManager: holidayIds = base.cr.newsManager.getDecorationHolidayId() if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds or 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)) lightsOn.start() 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) 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) 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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() self.accept('doorDoneEvent', self.handleDoorDoneEvent) self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger) self.enterZone(requestStatus['zoneId']) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.loader.nodeList, self.zoneId) self.fsm.request(requestStatus['how'], [requestStatus]) self.replaceStreetSignTextures() return
def getTelemetryLimiter(self): return TLGatherAllAvs('Minigame', RotationLimitToH)
def enter(self, requestStatus): self.fsm.enterInitialState() messenger.send('enterPlayground') self.accept('doorDoneEvent', self.handleDoorDoneEvent) 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) self._telemLimiter = TLGatherAllAvs('Playground', RotationLimitToH) def __lightDecorationOn__(): geom = base.cr.playGame.hood.loader.geom self.loader.hood.eventLights = geom.findAllMatches('**/*light*') self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*') 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() 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() 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) 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) 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() else: self.loader.hood.startSky() lightsOn = LerpColorScaleInterval( base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1)) lightsOn.start() NametagGlobals.setMasterArrowsOn(1) self.zoneId = requestStatus['zoneId'] self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks( self, self.loader.nodeList, self.zoneId) how = requestStatus['how'] if how == 'teleportIn': how = 'deathAck' self.fsm.request(how, [requestStatus]) return
def enter(self, requestStatus): self.fsm.enterInitialState() self._telemLimiter = TLGatherAllAvs('SuitInterior', RotationLimitToH) self.zoneId = requestStatus['zoneId'] self.accept('DSIDoneEvent', self.handleDSIDoneEvent)
def enter(self, requestStatus): self.fsm.enterInitialState() messenger.send('enterPlayground') self.accept('doorDoneEvent', self.handleDoorDoneEvent) 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) self._telemLimiter = TLGatherAllAvs('Playground', RotationLimitToH) def __lightDecorationOn__(): geom = base.cr.playGame.hood.loader.geom self.loader.hood.eventLights = geom.findAllMatches('**/*light*') self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*') 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() 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, self.zoneId) how = requestStatus['how'] if how == 'teleportIn': how = 'deathAck' self.fsm.request(how, [requestStatus]) if base.config.GetBool('want-charity-screen', False): from toontown.events.CharityScreen import CharityScreen if self.zoneId in ([ ToontownGlobals.ToontownCentral, ToontownGlobals.DonaldsDock, ToontownGlobals.DaisyGardens, ToontownGlobals.MinniesMelodyland, ToontownGlobals.TheBrrrgh, ToontownGlobals.DonaldsDreamland ]): self.screen = CharityScreen(base.cr) self.screen.start(self.zoneId)
def getTelemetryLimiter(self): return TLGatherAllAvs('DivingGame', Functor(DivingGameRotationLimiter, 180, 180))