Example #1
0
 def enterTeleportIn(self, requestStatus):
     imgScale = 0.25
     if self.dialog:
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
     elif base.localAvatar.hp < 1:
         requestStatus['nextState'] = 'popup'
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
         self.accept('deathAck', self.__handleDeathAck, extraArgs=[requestStatus])
         self.deathAckBox = DeathForceAcknowledge.DeathForceAcknowledge(doneEvent='deathAck')
     elif base.localAvatar.hp > 0 and (Quests.avatarHasTrolleyQuest(base.localAvatar) or Quests.avatarHasFirstCogQuest(base.localAvatar) or Quests.avatarHasFriendQuest(base.localAvatar) or Quests.avatarHasPhoneQuest(base.localAvatar) and Quests.avatarHasCompletedPhoneQuest(base.localAvatar)) and self.loader.hood.id == ToontownGlobals.ToontownCentral:
         requestStatus['nextState'] = 'popup'
         imageModel = loader.loadModel('phase_4/models/gui/tfa_images')
         if base.localAvatar.quests[0][0] == Quests.TROLLEY_QUEST_ID:
             if not Quests.avatarHasCompletedTrolleyQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage3
                 imgNodePath = imageModel.find('**/trolley-dialog-image')
                 imgPos = (0, 0, 0.04)
                 imgScale = 0.5
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage4
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, -0.02)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.FIRST_COG_QUEST_ID:
             if not Quests.avatarHasCompletedFirstCogQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralTunnelDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage5
                 imgNodePath = imageModel.find('**/tunnelSignA')
                 imgPos = (0, 0, 0.04)
                 imgScale = 0.5
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage6
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.FRIEND_QUEST_ID:
             if not Quests.avatarHasCompletedFriendQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage7
                 gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
                 imgNodePath = gui.find('**/FriendsBox_Closed')
                 imgPos = (0, 0, 0.04)
                 imgScale = 1.0
                 gui.removeNode()
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage8
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.PHONE_QUEST_ID:
             if Quests.avatarHasCompletedPhoneQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage9
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         self.dialog = TTDialog.TTDialog(text=msg, command=self.__cleanupDialog, style=TTDialog.Acknowledge)
         imgLabel = DirectLabel.DirectLabel(parent=self.dialog, relief=None, pos=imgPos, scale=TTLocalizer.PimgLabel, image=imgNodePath, image_scale=imgScale)
         imageModel.removeNode()
     else:
         requestStatus['nextState'] = 'walk'
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
     base.localAvatar.detachNode()
     base.localAvatar.setPosHpr(render, x, y, z, h, p, r)
     Place.Place.enterTeleportIn(self, requestStatus)
     return
 def enterTeleportIn(self, requestStatus):
     imgScale = 0.25
     if self.dialog:
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
             self.loader.hood.id)
     elif base.localAvatar.hp < 1:
         requestStatus['nextState'] = 'popup'
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
             self.loader.hood.id)
         self.accept('deathAck',
                     self.__handleDeathAck,
                     extraArgs=[requestStatus])
         self.deathAckBox = DeathForceAcknowledge.DeathForceAcknowledge(
             doneEvent='deathAck')
     elif base.localAvatar.hp > 0 and (
             Quests.avatarHasTrolleyQuest(base.localAvatar)
             or Quests.avatarHasFirstCogQuest(base.localAvatar)
             or Quests.avatarHasFriendQuest(base.localAvatar)
             or Quests.avatarHasPhoneQuest(base.localAvatar)
             and Quests.avatarHasCompletedPhoneQuest(base.localAvatar)
     ) and self.loader.hood.id == ToontownGlobals.ToontownCentral:
         requestStatus['nextState'] = 'popup'
         imageModel = loader.loadModel('phase_4/models/gui/tfa_images')
         if base.localAvatar.quests[0][0] == Quests.TROLLEY_QUEST_ID:
             if not Quests.avatarHasCompletedTrolleyQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage3
                 imgNodePath = imageModel.find('**/trolley-dialog-image')
                 imgPos = (0, 0, 0.04)
                 imgScale = 0.5
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage4
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, -0.02)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.FIRST_COG_QUEST_ID:
             if not Quests.avatarHasCompletedFirstCogQuest(
                     base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralTunnelDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage5
                 imgNodePath = imageModel.find('**/tunnelSignA')
                 imgPos = (0, 0, 0.04)
                 imgScale = 0.5
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage6
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.FRIEND_QUEST_ID:
             if not Quests.avatarHasCompletedFriendQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage7
                 gui = loader.loadModel(
                     'phase_3.5/models/gui/friendslist_gui')
                 imgNodePath = gui.find('**/FriendsBox_Closed')
                 imgPos = (0, 0, 0.04)
                 imgScale = 1.0
                 gui.removeNode()
             else:
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage8
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         elif base.localAvatar.quests[0][0] == Quests.PHONE_QUEST_ID:
             if Quests.avatarHasCompletedPhoneQuest(base.localAvatar):
                 x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                     base.cr.hoodMgr.ToontownCentralHQDropPoints)
                 msg = TTLocalizer.NPCForceAcknowledgeMessage9
                 imgNodePath = imageModel.find('**/hq-dialog-image')
                 imgPos = (0, 0, 0.05)
                 imgScale = 0.5
         self.dialog = TTDialog.TTDialog(text=msg,
                                         command=self.__cleanupDialog,
                                         style=TTDialog.Acknowledge)
         imgLabel = DirectLabel.DirectLabel(parent=self.dialog,
                                            relief=None,
                                            pos=imgPos,
                                            scale=TTLocalizer.PimgLabel,
                                            image=imgNodePath,
                                            image_scale=imgScale)
         imageModel.removeNode()
     else:
         requestStatus['nextState'] = 'walk'
         x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
             self.loader.hood.id)
     base.localAvatar.detachNode()
     base.localAvatar.setPosHpr(render, x, y, z, h, p, r)
     Place.Place.enterTeleportIn(self, requestStatus)
     return
Example #3
0
    def enterTeleportIn(self, requestStatus):
        assert (self.notify.debug("enterTeleportIn()"))
        imgScale = 0.25

        # see if someone else is already showing a dialog
        if self.dialog:
            x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
                self.loader.hood.id)

        # See if we're sad
        elif (base.localAvatar.hp < 1):
            requestStatus['nextState'] = 'popup'
            x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
                self.loader.hood.id)
            self.accept("deathAck",
                        self.__handleDeathAck,
                        extraArgs=[requestStatus])
            self.deathAckBox = DeathForceAcknowledge.DeathForceAcknowledge(
                doneEvent="deathAck")

        # Check to see if the toon has a tier zero quest
        elif ((base.localAvatar.hp > 0)
              and ((Quests.avatarHasTrolleyQuest(base.localAvatar)) or
                   (Quests.avatarHasFirstCogQuest(base.localAvatar)) or
                   (Quests.avatarHasFriendQuest(base.localAvatar)) or
                   ((Quests.avatarHasPhoneQuest(base.localAvatar)) and
                    (Quests.avatarHasCompletedPhoneQuest(base.localAvatar))))
              and (self.loader.hood.id == ToontownGlobals.ToontownCentral)):
            requestStatus['nextState'] = 'popup'
            imageModel = loader.loadModel("phase_4/models/gui/tfa_images")
            # trolley quest
            if (base.localAvatar.quests[0][0] == Quests.TROLLEY_QUEST_ID):
                if not Quests.avatarHasCompletedTrolleyQuest(base.localAvatar):
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage3
                    imgNodePath = imageModel.find("**/trolley-dialog-image")
                    imgPos = (0, 0, 0.04)
                    imgScale = 0.5
                else:
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralHQDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage4
                    imgNodePath = imageModel.find("**/hq-dialog-image")
                    imgPos = (0, 0, -0.02)
                    imgScale = 0.5
            # first cog quest
            elif (base.localAvatar.quests[0][0] == Quests.FIRST_COG_QUEST_ID):
                if not Quests.avatarHasCompletedFirstCogQuest(
                        base.localAvatar):
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralTunnelDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage5
                    imgNodePath = imageModel.find("**/tunnelSignA")
                    imgPos = (0, 0, 0.04)
                    imgScale = 0.5
                else:
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralHQDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage6
                    imgNodePath = imageModel.find("**/hq-dialog-image")
                    imgPos = (0, 0, 0.05)
                    imgScale = 0.5
            # make a friend quest
            elif (base.localAvatar.quests[0][0] == Quests.FRIEND_QUEST_ID):
                if not Quests.avatarHasCompletedFriendQuest(base.localAvatar):
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralInitialDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage7
                    gui = loader.loadModel(
                        "phase_3.5/models/gui/friendslist_gui")
                    imgNodePath = gui.find("**/FriendsBox_Closed")
                    imgPos = (0, 0, 0.04)
                    imgScale = 1.0
                    gui.removeNode()
                else:
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralHQDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage8
                    imgNodePath = imageModel.find("**/hq-dialog-image")
                    imgPos = (0, 0, 0.05)
                    imgScale = 0.5
            # phone quest
            elif (base.localAvatar.quests[0][0] == Quests.PHONE_QUEST_ID):
                if Quests.avatarHasCompletedPhoneQuest(base.localAvatar):
                    x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(
                        base.cr.hoodMgr.ToontownCentralHQDropPoints)
                    msg = TTLocalizer.NPCForceAcknowledgeMessage9
                    imgNodePath = imageModel.find("**/hq-dialog-image")
                    imgPos = (0, 0, 0.05)
                    imgScale = 0.5

            self.dialog = TTDialog.TTDialog(text=msg,
                                            command=self.__cleanupDialog,
                                            style=TTDialog.Acknowledge)
            imgLabel = DirectLabel.DirectLabel(parent=self.dialog,
                                               relief=None,
                                               pos=imgPos,
                                               scale=TTLocalizer.PimgLabel,
                                               image=imgNodePath,
                                               image_scale=imgScale)
            imageModel.removeNode()
        else:
            # ...this toon has completed their trolley quest.
            # Choose a random location within the safezone to drop you.
            # We do this even if we plan to be teleporting to a toon,
            # because the gotoToon option may fail if the toon has moved
            # on.
            requestStatus['nextState'] = 'walk'
            x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(
                self.loader.hood.id)

        # toon may not be parented to hidden at this point, if say the boat or piano
        # on-floor event has detected an intersection (which seems to occur when Toon
        # who lost a connection in battle re-enters in melodyland).  In that case,
        # it would be parented to the moving platform, and for that case the coords below
        # are wrong, so before doing a setPos, reparent to hidden.
        base.localAvatar.detachNode()
        base.localAvatar.setPosHpr(render, x, y, z, h, p, r)

        Place.Place.enterTeleportIn(self, requestStatus)