def enterAct0Tutorial(self):
        self.notify.debug('starting tutorial')
        QuestParser.init()
        if self.noJailLight:
            render.setLightOff()

        self.JackDoId = None
        self.DanDoId = None
        self.StumpyDoId = None
        self.IslandDoId = None

        def stumpyHere(stumpyId):
            self.StumpyDoId = stumpyId

        def stumpyBoatHere(stumpyBoatId):
            self.BoatStumpyDoId = stumpyBoatId
            self.pendingStumpyBoatRequest = base.cr.relatedObjectMgr.requestObjects(
                [self.BoatStumpyDoId], eachCallback=self.doStumpyBoatIntro)

        def navyBoatHere(navyBoatId):
            self.BoatNavyDoId = navyBoatId
            self.pendingNavyBoatRequest = base.cr.relatedObjectMgr.requestObjects(
                [self.BoatNavyDoId], eachCallback=self.setupNavyBoat)

        def islandHere(islandId):
            self.IslandDoId = islandId
            self.pendingIslandRequest = base.cr.relatedObjectMgr.requestObjects(
                [self.IslandDoId], eachCallback=self.handleIslandGenerate)

        self.cr.uidMgr.addUidCallback(TutorialGlobals.STUMPY_UID, stumpyHere)
        self.cr.uidMgr.addUidCallback(TutorialGlobals.STUMPY_BOAT_UID,
                                      stumpyBoatHere,
                                      onlyOnce=False)
        self.cr.uidMgr.addUidCallback(TutorialGlobals.ENEMY_BOAT_UID,
                                      navyBoatHere,
                                      onlyOnce=False)
        self.cr.uidMgr.addUidCallback(LocationIds.RAMBLESHACK_ISLAND,
                                      islandHere)
        self.accept('doneJackIntro', self.doneJackIntro)
        self.accept('fadeInExteriorDoor', self.handleGoOutside)
        self.accept('fadeInInteriorDoor', self.handleGoInside)
        self.acceptOnce('beginSeachest', self.beginSeachest)
        if localAvatar.style.getTutorial() > 0:
            self.ignore('doneJackIntro')
            localAvatar.openJailDoor()
            localAvatar.style.setName(localAvatar.getName())
            localAvatar.guiMgr.showTrays()
            base.transitions.fadeIn()

        self.sendUpdate('clientEnterAct0Tutorial')
    def enterAct0Tutorial(self):
        self.notify.debug('starting tutorial')
        QuestParser.init()
        if self.noJailLight:
            render.setLightOff()
        
        self.JackDoId = None
        self.DanDoId = None
        self.StumpyDoId = None
        self.IslandDoId = None
        
        def stumpyHere(stumpyId):
            self.StumpyDoId = stumpyId

        
        def stumpyBoatHere(stumpyBoatId):
            self.BoatStumpyDoId = stumpyBoatId
            self.pendingStumpyBoatRequest = base.cr.relatedObjectMgr.requestObjects([
                self.BoatStumpyDoId], eachCallback = self.doStumpyBoatIntro)

        
        def navyBoatHere(navyBoatId):
            self.BoatNavyDoId = navyBoatId
            self.pendingNavyBoatRequest = base.cr.relatedObjectMgr.requestObjects([
                self.BoatNavyDoId], eachCallback = self.setupNavyBoat)

        
        def islandHere(islandId):
            self.IslandDoId = islandId
            self.pendingIslandRequest = base.cr.relatedObjectMgr.requestObjects([
                self.IslandDoId], eachCallback = self.handleIslandGenerate)

        self.cr.uidMgr.addUidCallback(TutorialGlobals.STUMPY_UID, stumpyHere)
        self.cr.uidMgr.addUidCallback(TutorialGlobals.STUMPY_BOAT_UID, stumpyBoatHere, onlyOnce = False)
        self.cr.uidMgr.addUidCallback(TutorialGlobals.ENEMY_BOAT_UID, navyBoatHere, onlyOnce = False)
        self.cr.uidMgr.addUidCallback(LocationIds.RAMBLESHACK_ISLAND, islandHere)
        self.accept('doneJackIntro', self.doneJackIntro)
        self.accept('fadeInExteriorDoor', self.handleGoOutside)
        self.accept('fadeInInteriorDoor', self.handleGoInside)
        self.acceptOnce('beginSeachest', self.beginSeachest)
        if localAvatar.style.getTutorial() > 0:
            self.ignore('doneJackIntro')
            localAvatar.openJailDoor()
            localAvatar.style.setName(localAvatar.getName())
            localAvatar.guiMgr.showTrays()
            base.transitions.fadeIn()
        
        self.sendUpdate('clientEnterAct0Tutorial')
Exemplo n.º 3
0
 def playQuestString(self, questStr, timeout = False, quitButton = 1, useChatBubble = False, confirm = False, animSet = None):
     self.notify.debug('playQuestString %s, %s, %s, %s' % (timeout, quitButton, useChatBubble, confirm))
     if questStr.find('quest_') == 0:
         nmp = QuestParser.NPCMoviePlayer(questStr, localAvatar, self)
         nmp.play()
         self.npcMoviePlayer = nmp
     else:
         self.firstDialog = False
         self.dialogAnimSet = animSet
         if questStr:
             if timeout:
                 if useChatBubble:
                     self.setPageChat(localAvatar.doId, 0, questStr, 0, extraChatFlags = CFSpeech | CFTimeout, pageButton = False)
                 else:
                     base.localAvatar.guiMgr.subtitler.setPageChat(questStr, timeout = timeout)
                 return None
             else:
                 self.playingQuestString = True
                 if self.newOffer == False:
                     questStr += '\x07'
                 
                 base.localAvatar.guiMgr.subtitler.setPageChat(questStr, confirm = confirm)
                 self.dialogOpen = True
             self.playAnimation(0)
             if quitButton == 1 or confirm:
                 self.accept('doneChatPage', self._DistributedQuestGiver__handleDoneChatPage)
             
             if base.localAvatar.guiMgr.subtitler.getNumChatPages() == 1:
                 self._DistributedQuestGiver__handleNextChatPage(0, 0)
             else:
                 self.accept('nextChatPage', self._DistributedQuestGiver__handleNextChatPage)
Exemplo n.º 4
0
 def playDialogMovie(self, dialogId, doneCallback = None, oldLocalAvState = None):
     movieChoice = InteractGlobals.getNPCTutorial(dialogId)
     if movieChoice == None:
         movieChoice = dialogId
     
     globalClock.tick()
     self.currentDialogMovie = QuestParser.NPCMoviePlayer(movieChoice, localAvatar, self)
     self.currentDialogMovie.overrideOldAvState(oldLocalAvState)
     self.currentDialogMovie.play()
     self.acceptOnce('dialogFinish', self.stopDialogMovie, extraArgs = [
         doneCallback])