def __init__(self, cr):
     DistributedBattleZone.__init__(self, cr)
     self.fsm = ClassicFSM.ClassicFSM('TutorialFSM', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('newPlayerEmerge', self.enterPlayerEmerge,
                     self.exitPlayerEmerge, ['off', 'introSpeech']),
         State.State('introSpeech', self.enterGuideIntroSpeech,
                     self.exitGuideIntroSpeech,
                     ['off', 'introSpeech2Training']),
         State.State('introSpeech2Training', self.enterIntroSpeech2Training,
                     self.exitIntroSpeech2Training, ['off', 'training1']),
         State.State('training1', self.enterTrainingPT1,
                     self.exitTrainingPT1, ['off', 'training2info']),
         State.State('training2info', self.enterTraining2Info,
                     self.exitTraining2Info, ['off', 'training2']),
         State.State('training2', self.enterTrainingPT2,
                     self.exitTrainingPT2, ['off', 'training3info']),
         State.State('training3info', self.enterTraining3Info,
                     self.exitTraining3Info, ['off', 'training3']),
         State.State('training3', self.enterTrainingPT3,
                     self.exitTrainingPT3, ['off', 'trainingDone']),
         State.State('trainingDone', self.enterTrainingDone,
                     self.exitTrainingDone, ['off', 'leaveTutorial']),
         State.State('leaveTutorial', self.enterLeaveTutorial,
                     self.exitLeaveTutorial, ['off'])
     ], 'off', 'off')
     self.fsm.enterInitialState()
     self.dnaStore = DNAStorage()
     self.streetGeom = None
     self.guide = None
     self.playerCamPos = None
     self.playerCamHpr = None
     self.olc = None
 def disable(self):
     self.fsm.requestFinalState()
     del self.fsm
     if self.guide:
         self.guide.disable()
         self.guide.delete()
         self.guide = None
     if self.streetGeom:
         self.streetGeom.removeNode()
         self.streetGeom = None
     if self.olc:
         self.olc.cleanup()
         self.olc = None
     self.dnaStore.reset_nodes()
     self.dnaStore.reset_hood_nodes()
     self.dnaStore.reset_place_nodes()
     self.dnaStore.reset_hood()
     self.dnaStore.reset_fonts()
     self.dnaStore.reset_DNA_vis_groups()
     self.dnaStore.reset_materials()
     self.dnaStore.reset_block_numbers()
     self.dnaStore.reset_block_zones()
     self.dnaStore.reset_suit_points()
     self.dnaStore = None
     base.localAvatar.inTutorial = False
     DistributedBattleZone.disable(self)
 def generate(self):
     DistributedBattleZone.generate(self)
     from src.coginvasion.szboss import AmbientGeneric, FuncWater, Ropes, InfoBgm, EnvLightGlow, EnvParticleSystem, PointSpotlight
     base.bspLoader.linkEntityToClass("func_water", FuncWater.FuncWater)
     base.bspLoader.linkEntityToClass("rope_begin", Ropes.RopeBegin)
     base.bspLoader.linkEntityToClass("rope_keyframe", Ropes.RopeKeyframe)
     base.bspLoader.linkEntityToClass("info_bgm", InfoBgm.InfoBgm)
     base.bspLoader.linkEntityToClass("env_lightglow",
                                      EnvLightGlow.EnvLightGlow)
     base.bspLoader.linkEntityToClass("env_particlesystem",
                                      EnvParticleSystem.EnvParticleSystem)
     base.bspLoader.linkEntityToClass("point_spotlight",
                                      PointSpotlight.PointSpotlight)
    def disable(self):
        base.cleanupBSPLevel()

        self.fsm.requestFinalState()
        del self.fsm
        if self.floorNameText:
            self.floorNameText.destroy()
            self.floorNameText = None
        self.currentFloor = None
        self.elevators = None
        self.dept = None
        self.deptClass = None
        self.openSfx = None
        self.closeSfx = None
        self.rideElevatorMusic = None
        self.bottomFloorsMusic = None
        self.intermissionMusic = None
        self.bldgDoId = None
        self.exteriorZoneId = None
        base.stopMusic()
        DistributedBattleZone.disable(self)
    def __init__(self, cr):
        DistributedBattleZone.__init__(self, cr)
        self.currentFloor = None
        self.numFloors = None
        self.dept = None
        self.deptClass = None
        self.exteriorZoneId = None
        self.bldgDoId = None
        # Use the same text from eagle summit
        self.floorNameText = DistributedMinigame.getAlertText(
            (0.75, 0.75, 0.75, 1.0), 0.15)
        self.elevators = [None, None]
        self.elevatorResponses = 0
        self.tauntSuitId = 0
        self.openSfx = base.loadSfx('phase_5/audio/sfx/elevator_door_open.ogg')
        self.closeSfx = base.loadSfx(
            'phase_5/audio/sfx/elevator_door_close.ogg')

        self.rideElevatorMusic = 'tt_elevator'
        self.bottomFloorsMusic = [
            'encntr_suit_winning', 'encntr_general_bg_indoor'
        ]
        self.topFloorMusic = ['encntr_suit_winning_indoor', 'BossBot_CEO_v2']
        self.intermissionMusic = 'encntr_toon_winning_indoor'
        self.winMusic = 'encntr_toon_winning'

        self.fsm = ClassicFSM.ClassicFSM('DistributedCogOfficeBattle', [
            State.State('off', self.enterOff, self.exitOff),
            State.State('floorIntermission', self.enterFloorIntermission,
                        self.exitFloorIntermission),
            State.State('bldgComplete', self.enterBldgComplete,
                        self.exitBldgComplete),
            State.State('battle', self.enterBattle, self.exitBattle),
            State.State('rideElevator', self.enterRideElevator,
                        self.exitRideElevator),
            State.State('faceOff', self.enterFaceOff, self.exitFaceOff),
            State.State('victory', self.enterVictory, self.exitVictory)
        ], 'off', 'off')
        self.fsm.enterInitialState()
    def announceGenerate(self):
        DistributedBattleZone.announceGenerate(self)
        base.transitions.fadeScreen(0.0)
        self.guide = Toon(base.cr)
        self.guide.autoClearChat = False
        self.guide.parseDNAStrand(NPCGlobals.NPCToonDict[self.GUIDE_NPCID][2])
        self.guide.setName(NPCGlobals.NPCToonDict[self.GUIDE_NPCID][1])
        self.guide.generateToon()
        self.guide.nametag.setNametagColor(
            NametagGlobals.NametagColors[NametagGlobals.CCNPC])
        self.guide.nametag.setActive(0)
        self.guide.nametag.updateAll()
        self.guide.nametag.getNametag3d().setClickEvent('tutGuide-click')
        self.guide.nametag.getNametag2d().setClickEvent('tutGuide-click')
        self.guide.reparentTo(render)
        base.localAvatar.reparentTo(render)
        loader.loadDNAFile(self.dnaStore,
                           'phase_3.5/dna/storage_tutorial.pdna')
        node = loader.loadDNAFile(self.dnaStore,
                                  'phase_3.5/dna/tutorial_street.pdna')
        if node.getNumParents() == 1:
            self.streetGeom = NodePath(node.getParent(0))
            self.streetGeom.reparentTo(hidden)
        else:
            self.streetGeom = hidden.attachNewNode(node)
        self.streetGeom.flattenMedium()
        gsg = base.win.getGsg()
        if gsg:
            self.streetGeom.prepareScene(gsg)
        self.streetGeom.reparentTo(render)
        self.streetGeom.setPos(20.5, -20, 0)
        self.streetGeom.setH(90)

        self.olc = ZoneUtil.getOutdoorLightingConfig(ZoneUtil.ToontownCentral)
        self.olc.setupAndApply()

        base.playMusic('TC_SZ')
        self.fsm.request('newPlayerEmerge')
        base.localAvatar.inTutorial = True
    def setMap(self, map):
        self.currentRoom = map

        DistributedBattleZone.setMap(self, map)
    def generate(self):
        DistributedBattleZone.generate(self)

        import Entities
        base.bspLoader.linkEntityToClass("cogoffice_faceoff_point",
                                         Entities.FaceOffPoint)
 def rewardSequenceComplete(self, timestamp):
     DistributedBattleZone.rewardSequenceComplete(self, timestamp)
     base.taskMgr.doMethodLater(0.1, self.victoryTask,
                                self.uniqueName('victoryTask'))
    def setMap(self, mapFile):
        self.stopPlayer()
        base.transitions.fadeScreen(1.0)

        DistributedBattleZone.setMap(self, mapFile)
 def __init__(self, cr):
     DistributedBattleZone.__init__(self, cr)
     self.skyNP = None
     self.skyEffect = None
示例#12
0
 def d_loadedMap(self):
     DistributedBattleZone.d_loadedMap(self)
示例#13
0
    def __init__(self, cr):
        DistributedBattleZone.__init__(self, cr)
        self.jukebox = Jukebox()
        self.waveNum = 0

        self.waveStats = OrderedDict()
 def rewardSequenceComplete(self, timestamp):
     DistributedBattleZone.rewardSequenceComplete(self, timestamp)
     self.fsm.request('trainingDone')