def dismissNow(self): if not self.trial: UserFunnel.logSubmit(0, 'NON_PAYER_CONTINUE_' + str(self.questIdReporting)) UserFunnel.logSubmit(2, 'NON_PAYER_CONTINUE_' + str(self.questIdReporting)) base.cr.centralLogger.writeClientEvent('NON_PAYER_CONTINUE_' + str(self.questIdReporting)) self.hide()
def handleEnterGameArea(self, collEntry=None): if localAvatar.style.getTutorial() == PiratesGlobals.TUT_GOT_SEACHEST: inventory = localAvatar.getInventory() if self.uniqueId == TutorialGlobals.RAMBLESHACK_ISLE_UID and len( inventory.getWeapons()) < 1: popupDialogText = ['showBlacksmith', 'closeShowBlacksmith'] else: popupDialogText = None if popupDialogText: if base.localAvatar.showQuest: base.localAvatar.resetQuestShow() self.popupDialog = NewTutorialPanel.NewTutorialPanel( popupDialogText) self.popupDialog.activate() def closeTutorialWindow(): messenger.send(self.popupDialog.closeMessage) self.popupDialog.setYesCommand(closeTutorialWindow) self.acceptOnce('closeTutorialWindow', closeTutorialWindow) taskMgr.doMethodLater(1, self.showEnterMessage, 'showEnterMessage') UserFunnel.logSubmit(0, 'ENTERING_' + str(self.funnelDisplayName)) UserFunnel.logSubmit(1, 'ENTERING_' + str(self.funnelDisplayName)) displayName = PLocalizer.LocationNames.get(self.uniqueId) base.setLocationCode(displayName) self.storeLocationTime(self.funnelDisplayName, time.time()) self.builder.initEffects()
def handleBackToMain(self, object): base.setOverrideShipVisibility(False) messenger.send('stopTutorial') localAvatar.show() UserFunnel.logSubmit(1, 'STARTGAME_DOCK') UserFunnel.logSubmit(0, 'STARTGAME_DOCK') base.cr.centralLogger.writeClientEvent('STARTGAME_DOCK')
def continuePlayingNow(self): UserFunnel.logSubmit(0, 'CONTINUE-PLAYING_' + str(self.questIdReporting)) UserFunnel.logSubmit(2, 'CONTINUE-PLAYING_' + str(self.questIdReporting)) base.cr.centralLogger.writeClientEvent('CONTINUE-PLAYING_' + str(self.questIdReporting)) self.hide()
def upgradeNow(self): UserFunnel.logSubmit(0, 'NON_PAYER_UPGRADE_' + str(self.questIdReporting)) UserFunnel.logSubmit(2, 'NON_PAYER_UPGRADE_' + str(self.questIdReporting)) base.cr.centralLogger.writeClientEvent('NON_PAYER_UPGRADE_' + str(self.questIdReporting)) base.popupBrowser(launcher.getValue('GAME_INGAME_MOREINFO'))
def cannonDoneShooting(self): if not self.loggingCannonDone: UserFunnel.logSubmit(1, 'ACCESS_CANNON') UserFunnel.logSubmit(0, 'ACCESS_CANNON') base.cr.centralLogger.writeClientEvent('ACCESS_CANNON') self.loggingCannonDone = True self.sendUpdate('targetPracticeDone') self.request('Act2TargetSunk')
def removeDanAndNell(self): UserFunnel.logSubmit(1, 'CUTSCENE_TWO_END') UserFunnel.logSubmit(0, 'CUTSCENE_TWO_END') base.cr.centralLogger.writeClientEvent('CUTSCENE_TWO_END') self.notify.debug('removeDanAndNell') localAvatar.setTutorial(PiratesGlobals.TUT_GOT_SEACHEST) localAvatar.gameFSM.lockFSM = False localAvatar.b_setGameState('LandRoam') localAvatar.guiMgr.chestTray.show()
def handleExitGameArea(self, collEntry = None): UserFunnel.logSubmit(0, 'EXITING_' + str(self.funnelDisplayName)) UserFunnel.logSubmit(1, 'EXITING_' + str(self.funnelDisplayName)) self.stopCustomEffects() self.previousDisplayName = None displayName = str(self.funnelDisplayName) timeSpent = int(time.time()) - int(self.readLocationTime()) if int(self.timeCheck) + 1 == int(timeSpent) and int(self.timeCheck) - 1 == int(timeSpent) or int(self.timeCheck) == int(timeSpent): pass 1 base.cr.centralLogger.writeClientEvent('EXITING_AREA|%s|%d' % (displayName, timeSpent)) self.timeCheck = timeSpent
def cannonDoneShooting(self): if base.cr.gameFSM.getCurrentState().getName() != 'playGame': return None if not self.loggingCannonDone: UserFunnel.logSubmit(1, 'ACCESS_CANNON') UserFunnel.logSubmit(0, 'ACCESS_CANNON') base.cr.centralLogger.writeClientEvent('ACCESS_CANNON') self.loggingCannonDone = True self.sendUpdate('targetPracticeDone') self.request('Act2TargetSunk')
def startShipMovement(self): if self.island is not None: self.island.stopCustomEffects() self._phantomCannon.stop() localAvatar.guiMgr.setIgnoreAllKeys(True) localAvatar.guiMgr.setIgnoreMainMenuHotKey(True) localAvatar.guiMgr.chestTray.hide() self.sendUpdate('startSailingStumpy') UserFunnel.logSubmit(1, 'CUTSCENE_THREE_END') UserFunnel.logSubmit(0, 'CUTSCENE_THREE_END') base.cr.centralLogger.writeClientEvent('CUTSCENE_THREE_END')
def handleWalkedOutToIsland(self): if not self._leftJail: self._leftJail = 1 base.cr.centralLogger.writeClientEvent('LEAVING_JAIL') UserFunnel.logSubmit(0, 'LEAVING_JAIL') UserFunnel.logSubmit(1, 'LEAVING_JAIL') self._stopTutorialInteriorEffects() self.island.setZoneLevel(0) localAvatar.bindAnim(['sword_draw', 'sword_idle', 'cutlass_combo', 'cutlass_sweep']) self._targetNps = self.island.findAllMatches('**/TorchFire') self._phantomCannon = PhantomCannon(self.cr, self.island, CannonDistance, 50, self._targetNps, self.island) self._phantomCannon.start()
def leaveTutorial(self): if base.downloadWatcher and hasattr(base.downloadWatcher, 'background'): base.downloadWatcher.background() base.cr.tutorial = 0 base.cr.tutorialObject = None base.setOverrideShipVisibility(False) localAvatar.clearTeleportFlag(PiratesGlobals.TFInTutorial) localAvatar.b_setLocation(self.cr.distributedDistrict.doId, PiratesGlobals.QuietZone) self.sendUpdate('tutorialComplete') UserFunnel.logSubmit(1, 'STARTGAME_DOCK') UserFunnel.logSubmit(0, 'STARTGAME_DOCK') base.cr.centralLogger.writeClientEvent('STARTGAME_DOCK')
def leaveTutorial(self): if base.downloadWatcher and hasattr(base.downloadWatcher, 'background'): base.downloadWatcher.background() base.cr.tutorial = 0 base.cr.tutorialObject = None base.setOverrideShipVisibility(False) localAvatar.clearTeleportFlag(PiratesGlobals.TFInTutorial) localAvatar.b_setLocation(self.cr.distributedDistrict.doId, PiratesGlobals.QuietZone) self.sendUpdate('tutorialComplete') UserFunnel.logSubmit(1, 'STARTGAME_DOCK') UserFunnel.logSubmit(0, 'STARTGAME_DOCK') base.cr.centralLogger.writeClientEvent('STARTGAME_DOCK') return
def enterAct1MakeAPirate(self): base.disableMouse() localAvatar.gameFSM.request('MakeAPirate') localAvatar.gameFSM.lockFSM = True localAvatar.guiMgr.hideTrays() self.avHpr = VBase3(180, 0, 0) ga = localAvatar.getParentObj() ga.builder.turnOffLights() self.jail = ga.find('**/*navy_jail_interior*') self.map.enter() self.accept('makeAPirateComplete', self.handleMakeAPirate) UserFunnel.logSubmit(1, 'CREATE_PIRATE_LOADS') UserFunnel.logSubmit(0, 'CREATE_PIRATE_LOADS') base.cr.centralLogger.writeClientEvent('CREATE_PIRATE_LOADS')
def handleWalkedOutToIsland(self): if not self._leftJail: self._leftJail = 1 base.cr.centralLogger.writeClientEvent('LEAVING_JAIL') UserFunnel.logSubmit(0, 'LEAVING_JAIL') UserFunnel.logSubmit(1, 'LEAVING_JAIL') self._stopTutorialInteriorEffects() self.island.setZoneLevel(0) localAvatar.bindAnim([ 'sword_draw', 'sword_idle', 'cutlass_combo', 'cutlass_sweep']) self._targetNps = self.island.findAllMatches('**/TorchFire') self._phantomCannon = PhantomCannon(self.cr, self.island, CannonDistance, 50, self._targetNps, self.island) self._phantomCannon.start()
def enterAct1MakeAPirate(self): #base.loadingScreen.beginStep('MakeAPirate', 5, 15) #base.loadingScreen.showTarget(jail = True) #base.loadingScreen.show() #base.loadingScreen.tick() #localAvatar.gameFSM.request('MakeAPirate') #localAvatar.gameFSM.lockFSM = True #localAvatar.guiMgr.hideTrays() self.avHpr = VBase3(180, 0, 0) #ga = localAvatar.getParentObj() #ga.builder.turnOffLights() #self.jail = ga.find('**/*navy_jail_interior*') self.map.enter() self.accept('makeAPirateComplete', self.handleMakeAPirate) UserFunnel.logSubmit(1, 'CREATE_PIRATE_LOADS') UserFunnel.logSubmit(0, 'CREATE_PIRATE_LOADS') base.cr.centralLogger.writeClientEvent('CREATE_PIRATE_LOADS')
def doneStumpyIntro(self, task=None): self.notify.debug('Done Introducing Stumpy McGee') localAvatar.gameFSM.lockFSM = False localAvatar.b_setGameState('LandRoam') localAvatar.gameFSM.lockFSM = True self.sendUpdate('boardedTutorialShip') self.acceptOnce('showCannonExitPanel', self.showCannonExitPanel) self.accept('targetPracticeDone', self.targetPracticeDone) UserFunnel.logSubmit(1, 'CUTSCENE_THREE_START') UserFunnel.logSubmit(0, 'CUTSCENE_THREE_START') base.cr.centralLogger.writeClientEvent('CUTSCENE_THREE_START') if self.BoatStumpyDoId: stumpyBoat = base.cr.doId2do[self.BoatStumpyDoId] stumpyBoat.ignoreFloors() self.ignore(stumpyBoat.uniqueName('localAvBoardedShip')) navyBoat = base.cr.doId2do[self.BoatNavyDoId] navyBoat.show() navyBoat.hideName()
def doneStumpyIntro(self, task = None): self.notify.debug('Done Introducing Stumpy McGee') localAvatar.gameFSM.lockFSM = False localAvatar.b_setGameState('LandRoam') localAvatar.gameFSM.lockFSM = True self.sendUpdate('boardedTutorialShip') self.acceptOnce('showCannonExitPanel', self.showCannonExitPanel) self.accept('targetPracticeDone', self.targetPracticeDone) UserFunnel.logSubmit(1, 'CUTSCENE_THREE_START') UserFunnel.logSubmit(0, 'CUTSCENE_THREE_START') base.cr.centralLogger.writeClientEvent('CUTSCENE_THREE_START') if self.BoatStumpyDoId: stumpyBoat = base.cr.doId2do[self.BoatStumpyDoId] stumpyBoat.ignoreFloors() self.ignore(stumpyBoat.uniqueName('localAvBoardedShip')) navyBoat = base.cr.doId2do[self.BoatNavyDoId] navyBoat.show() navyBoat.hideName()
def handleEnterGameArea(self, collEntry = None): inventory = localAvatar.getInventory() if localAvatar.style.getTutorial() == PiratesGlobals.TUT_GOT_SEACHEST and self.uniqueId == LocationIds.RAMBLESHACK_ISLAND and len(inventory.getWeapons()) < 1 and base.localAvatar.showQuest: base.localAvatar.resetQuestShow() popupDialogText = [ 'showBlacksmith', 'closeShowBlacksmith'] self.popupDialog = NewTutorialPanel(popupDialogText) def closeTutorialWindow(): messenger.send(self.popupDialog.closeMessage) self.popupDialog.setYesCommand(closeTutorialWindow) self.acceptOnce('closeTutorialWindow', closeTutorialWindow) self.popupDialog.activate() taskMgr.doMethodLater(1, self.showEnterMessage, 'showEnterMessage') UserFunnel.logSubmit(0, 'ENTERING_' + str(self.funnelDisplayName)) UserFunnel.logSubmit(1, 'ENTERING_' + str(self.funnelDisplayName)) self.storeLocationTime(self.funnelDisplayName, time.time()) displayName = PLocalizer.LocationNames.get(self.uniqueId) base.setLocationCode(displayName) self.builder.initEffects()
def doNellIntro(self, object): self.notify.debug('doNellIntro') self.NPCNell = object if localAvatar.style.getTutorial() > 1: if not self.debugTutorial: self.NPCNell.stash() self.NPCNell.setInteractOptions(allowInteract=False) return None dnaDict = NPCList.NPC_LIST[TutorialGlobals.NELL_UID] customDNA = HumanDNA.HumanDNA() customDNA.loadFromNPCDict(dnaDict) self.NPCNell.setDNA(customDNA) self.NPCNell.generateHuman('f', base.cr.humanHigh) self.NPCNell.hideName() self.NPCNell.setPurgeInteractGui(1) self.NPCNell.loop('tut_1_1_5_a_idle_dan') self.NPCNell.setInteractOptions(allowInteract=False) self.accept('playNellAnimationDan_a', self.playNellAnimationDan_a) UserFunnel.logSubmit(1, 'CUTSCENE_TWO_START') UserFunnel.logSubmit(0, 'CUTSCENE_TWO_START') base.cr.centralLogger.writeClientEvent('CUTSCENE_TWO_START')
def doNellIntro(self, object): self.notify.debug('doNellIntro') self.NPCNell = object if localAvatar.style.getTutorial() > 1: if not self.debugTutorial: self.NPCNell.stash() self.NPCNell.setInteractOptions(allowInteract = False) return None dnaDict = NPCList.NPC_LIST[TutorialGlobals.NELL_UID] customDNA = HumanDNA.HumanDNA() customDNA.loadFromNPCDict(dnaDict) self.NPCNell.setDNA(customDNA) self.NPCNell.generateHuman('f', base.cr.humanHigh) self.NPCNell.hideName() self.NPCNell.setPurgeInteractGui(1) self.NPCNell.loop('tut_1_1_5_a_idle_dan') self.NPCNell.setInteractOptions(allowInteract = False) self.accept('playNellAnimationDan_a', self.playNellAnimationDan_a) UserFunnel.logSubmit(1, 'CUTSCENE_TWO_START') UserFunnel.logSubmit(0, 'CUTSCENE_TWO_START') base.cr.centralLogger.writeClientEvent('CUTSCENE_TWO_START')
def JRDestroyShip(self): self.notify.debug('JR Destroying Ship') self.request('Act4BackToMain') UserFunnel.logSubmit(1, 'CUTSCENE_FOUR_END') UserFunnel.logSubmit(0, 'CUTSCENE_FOUR_END') base.cr.centralLogger.writeClientEvent('CUTSCENE_FOUR_END')
def enterAct3IntroduceJR(self): self.notify.debug('Here comes Jolly Roger') self.accept('JRAttackShip', self.JRAttackShip) UserFunnel.logSubmit(1, 'CUTSCENE_FOUR_START') UserFunnel.logSubmit(0, 'CUTSCENE_FOUR_START') base.cr.centralLogger.writeClientEvent('CUTSCENE_FOUR_START')
def enterEscapeFromLA(self): UserFunnel.logSubmit(1, 'CUTSCENE_ONE_END') UserFunnel.logSubmit(0, 'CUTSCENE_ONE_END') base.cr.centralLogger.writeClientEvent('CUTSCENE_ONE_END') self.acceptOnce('startTutorialCannons', Functor(self._startTutorialInteriorEffects, False))
def moreInfo(self): UserFunnel.logSubmit(0, 'MOREINFO_' + str(self.questIdReporting)) UserFunnel.logSubmit(2, 'MOREINFO_' + str(self.questIdReporting)) base.cr.centralLogger.writeClientEvent('MOREINFO_' + str(self.questIdReporting)) base.popupBrowser(launcher.getValue('GAME_INGAME_MOREINFO'))
def dismissNow(self): UserFunnel.logSubmit(0, 'DISMISS_' + str(self.questIdReporting)) UserFunnel.logSubmit(2, 'DISMISS_' + str(self.questIdReporting)) base.cr.centralLogger.writeClientEvent('DISMISS_' + str(self.questIdReporting)) self.hide()
from pirates.audio.SoundGlobals import loadSfx rolloverSound = loadSfx(SoundGlobals.SFX_GUI_ROLLOVER_01) rolloverSound.setVolume(0.5) DirectGuiGlobals.setDefaultRolloverSound(rolloverSound) clickSound = loadSfx(SoundGlobals.SFX_GUI_CLICK_01) DirectGuiGlobals.setDefaultClickSound(clickSound) clearColor = Vec4(0.0, 0.0, 0.0, 1.0) base.win.setClearColor(clearColor) from pirates.shader.Hdr import * hdr = Hdr() from pirates.seapatch.Reflection import Reflection Reflection.initialize(render) serverVersion = base.config.GetString('server-version', 'no_version_set') print 'serverVersion:', serverVersion from pirates.distributed import PiratesClientRepository cr = PiratesClientRepository.PiratesClientRepository(serverVersion, launcher) base.initNametagGlobals() base.startShow(cr) from otp.distributed import OtpDoGlobals from pirates.piratesbase import UserFunnel UserFunnel.logSubmit(1, 'CLIENT_OPENS') UserFunnel.logSubmit(0, 'CLIENT_OPENS') if base.config.GetBool('want-portal-cull', 0): base.cam.node().setCullCenter(base.camera) base.graphicsEngine.setPortalCull(1) if base.options: base.options.options_to_config() base.options.setRuntimeOptions() run()
DirectGuiGlobals.setDefaultRolloverSound(rolloverSound) clickSound = loadSfx(SoundGlobals.SFX_GUI_CLICK_01) DirectGuiGlobals.setDefaultClickSound(clickSound) clearColor = Vec4(0.0, 0.0, 0.0, 1.0) base.win.setClearColor(clearColor) from pirates.shader.Hdr import * hdr = Hdr() from pirates.seapatch.Reflection import Reflection Reflection.initialize(render) serverVersion = base.config.GetString('server-version', 'no_version_set') print 'serverVersion: ', serverVersion from pirates.distributed import PiratesClientRepository cr = PiratesClientRepository.PiratesClientRepository(serverVersion, launcher) base.initNametagGlobals() base.startShow(cr) from otp.distributed import OtpDoGlobals from pirates.piratesbase import UserFunnel UserFunnel.logSubmit(1, 'CLIENT_OPENS') UserFunnel.logSubmit(0, 'CLIENT_OPENS') if base.config.GetBool('want-portal-cull', 0): base.cam.node().setCullCenter(base.camera) base.graphicsEngine.setPortalCull(1) if base.options: base.options.options_to_config() base.options.setRuntimeOptions() if launcher.isDummy() and not Thread.isTrueThreads(): run() elif __name__ == '__main__': run()