當前位置: 首頁>>代碼示例>>Python>>正文


Python Quests類代碼示例

本文整理匯總了Python中Quests的典型用法代碼示例。如果您正苦於以下問題:Python Quests類的具體用法?Python Quests怎麽用?Python Quests使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Quests類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setRewardIndex

 def setRewardIndex(self, tier, rewardIds, rewardHistory):
     self.reset()
     for tierNum in range(tier):
         for rewardId in Quests.getRewardsInTier(tierNum):
             reward = Quests.getReward(rewardId)
             reward.countReward(self)
             self.notify.debug('Assigning reward %d' % rewardId)
         
     
     print 'rewardHistory: ', rewardHistory
     for rewardId in rewardHistory:
         if rewardId in Quests.getRewardsInTier(tier):
             if rewardIds.count(rewardId) != 0:
                 print 'before: ', rewardIds
                 rewardIds.remove(rewardId)
                 self.notify.debug('Ignoring reward %d' % rewardId)
                 print 'after: ', rewardIds
             else:
                 reward = Quests.getReward(rewardId)
                 reward.countReward(self)
                 self.notify.debug('Assigning reward %d' % rewardId)
         
     
     self.notify.debug('Remaining rewardIds %s' % rewardIds)
     self.maxHp = min(ToontownGlobals.MaxHpLimit, self.maxHp)
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:25,代碼來源:QuestRewardCounter.py

示例2: showChoicePoster

    def showChoicePoster(self, questId, fromNpcId, toNpcId, rewardId, callback):
        self.update((questId,
         fromNpcId,
         toNpcId,
         rewardId,
         0))
        quest = Quests.getQuest(questId)
        self.rewardText.show()
        self.rewardText.setZ(-0.205)
        self.questProgress.hide()
        if not hasattr(self, 'chooseButton'):
            guiButton = loader.loadModel('phase_3/models/gui/quit_button')
            self.chooseButton = DirectButton(parent=self.questFrame, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(0.7, 1, 1), text=TTLocalizer.QuestPageChoose, text_scale=0.06, text_pos=(0, -0.02), pos=(0.285, 0, 0.245), scale=0.65)
            guiButton.removeNode()
        npcZone = NPCToons.getNPCZone(toNpcId)
        hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
        if not base.cr.isPaid() and (questId == 401 or hasattr(quest, 'getLocation') and quest.getLocation() == 1000 or hoodId == 1000):

            def showTeaserPanel():
                TeaserPanel(pageName='getGags')

            self.chooseButton['command'] = showTeaserPanel
        else:
            self.chooseButton['command'] = callback
            self.chooseButton['extraArgs'] = [questId]
        self.unbind(DGG.WITHIN)
        self.unbind(DGG.WITHOUT)
        if not quest.getType() == Quests.TrackChoiceQuest:
            self.questInfo.setZ(-0.0625)
        return
開發者ID:vincent15k,項目名稱:Toontown-House,代碼行數:30,代碼來源:QuestPoster.py

示例3: updatePage

 def updatePage(self):
     newQuests = toonbase.localToon.quests
     carryLimit = toonbase.localToon.getQuestCarryLimit()
     for i in range(ToontownGlobals.MaxQuestCarryLimit):
         if i < carryLimit:
             self.questFrames[i].show()
         else:
             self.questFrames[i].hide()
     
     for (index, questDesc) in self.quests.items():
         if questDesc is not None and list(questDesc) not in newQuests:
             self.clearQuestFrame(index)
         
     
     for questDesc in newQuests:
         newQuestDesc = tuple(questDesc)
         if newQuestDesc not in self.quests.values():
             index = self.getLowestUnusedIndex()
             self.fillQuestFrame(newQuestDesc, index)
         
     
     for i in self.quests.keys():
         questDesc = self.quests[i]
         if questDesc:
             questId = questDesc[0]
             if Quests.getQuestClass(questId) == Quests.FriendQuest:
                 self.questFrames[i].update(questDesc)
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:27,代碼來源:QuestPage.py

示例4: setFromAvatar

    def setFromAvatar(self, av):
        rewardIds = []
        for q in av.quests:
            questId, fromNpcId, toNpcId, rewardId, toonProgress = q
            if rewardId == Quests.NA:
                rewardId = Quests.getFinalRewardId(questId, fAll=1)
            rewardIds.append(rewardId)

        self.notify.debug('Ignoring rewards: %s' % rewardIds)
        self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
        fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % fishHp)
        self.maxHp += fishHp
        flowerHp = int(len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % flowerHp)
        self.maxHp += flowerHp
        HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.SellbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.LawbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.CashbotHQ))
        levels = av.getCogLevels()
        cogTypes = av.getCogTypes()
        suitHp = 0
        for dept in HQdepts:
            suitHp += levels[dept]

        self.notify.debug('Adding %s hp for cog suits' % suitHp)
        self.maxHp += suitHp
        kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
        self.maxHp += kartingHp
        golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for golf trophies' % golfHp)
        self.maxHp += golfHp
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leak,代碼行數:31,代碼來源:QuestRewardCounter.py

示例5: assignReward

 def assignReward(self, rewardId, rewardIds):
     if rewardIds.count(rewardId) != 0:
         rewardIds.remove(rewardId)
         self.notify.debug('Ignoring reward %d' % rewardId)
     else:
         reward = Quests.getReward(rewardId)
         reward.countReward(self)
         self.notify.debug('Assigning reward %d' % rewardId)
開發者ID:Keithybub,項目名稱:ToonTownReviveOld,代碼行數:8,代碼來源:QuestRewardCounter.py

示例6: giveReward

    def giveReward(self, toon, rewardId):
        """
        This is called when a toon completes a whole toontask.

        This grabs the reward from Quests via rewardId and issues the reward
        to the toon.
        """
        reward = Quests.getReward(rewardId)
        if reward:
            reward.sendRewardAI(toon)
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leaked-Source,代碼行數:10,代碼來源:QuestManagerAI.py

示例7: setFromAvatar

 def setFromAvatar(self, av):
     rewardIds = []
     for q in av.quests:
         (questId, fromNpcId, toNpcId, rewardId, toonProgress) = q
         if rewardId == Quests.NA:
             rewardId = Quests.getFinalRewardId(questId, fAll = 1)
         
         rewardIds.append(rewardId)
     
     self.notify.debug('Ignoring rewards: %s' % rewardIds)
     self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:11,代碼來源:QuestRewardCounter.py

示例8: npcGiveQuest

 def npcGiveQuest(self, npc, toon, questId, rewardId, toNpcId, storeReward=False):
     """
     This is called when an NPC wants to assign a quest to the toon.
     """
     rewardId = Quests.transformReward(rewardId, toon)
     # If non-zero, this indicates this is the first quest in the whole ToonTask.
     # This means we want to store the reward in the toons setRewardHistory.
     finalReward = rewardId if storeReward else 0
     progress = 0
     toon.addQuest((questId, npc.getDoId(), toNpcId, rewardId, progress), finalReward)
     # Tell the NPC that we assigned this quest to the given toon.
     npc.assignQuest(toon.getDoId(), questId, rewardId, toNpcId)
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leaked-Source,代碼行數:12,代碼來源:QuestManagerAI.py

示例9: _QTQuestNode__questsChanged

    def _QTQuestNode__questsChanged(self):
        
        try:
            lt = toonbase.localToon
        except:
            return None

        self.phraseList = []
        self.encodedMsgList = []
        
        def addMsg(msg, packet):
            for phrase in self.phraseList:
                if msg == phrase[0]:
                    return None
                
            
            self.phraseList.append([
                msg,
                QTQuestSend,
                QTNode.QT_TEXT_NODE])
            self.encodedMsgList.append(packet)

        for quest in lt.quests:
            (questId, fromNpcId, toNpcId, rewardId, toonProgress) = quest
            q = Quests.getQuest(questId)
            if q is None:
                continue
            
            msgs = q.getQTStrings(toNpcId, toonProgress)
            if type(msgs) != type([]):
                msgs = [
                    msgs]
            
            for i in xrange(len(msgs)):
                addMsg(msgs[i], [
                    questId,
                    toNpcId,
                    toonProgress,
                    i])
            
        
        needToontask = 1
        
        try:
            needToontask = len(lt.quests) != lt.questCarryLimit
        except:
            pass

        if needToontask:
            addMsg(Localizer.QTQuestNodeNeedATask, [])
        
        self.createMenu()
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:52,代碼來源:QTQuestNode.py

示例10: showChoicePoster

 def showChoicePoster(self, questId, fromNpcId, toNpcId, rewardId, callback):
     self.update((questId, fromNpcId, toNpcId, rewardId, 0))
     quest = Quests.getQuest(questId)
     self.rewardText.show()
     self.rewardText.setZ(-0.20499999999999999)
     self.questProgress.hide()
     if not hasattr(self, 'chooseButton'):
         guiButton = loader.loadModelOnce('phase_3/models/gui/quit_button')
         self.chooseButton = DirectButton(parent = self.questFrame, relief = None, image = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale = (0.69999999999999996, 1, 1), text = Localizer.QuestPageChoose, text_scale = 0.059999999999999998, text_pos = (0, -0.02), pos = (0.27000000000000002, 0, 0.23999999999999999), scale = 0.65000000000000002)
         guiButton.removeNode()
     
     self.chooseButton['command'] = callback
     self.chooseButton['extraArgs'] = [
         questId]
     self.unbind(WITHIN)
     self.unbind(WITHOUT)
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:16,代碼來源:QuestPoster.py

示例11: decodeQTQuestMsg

def decodeQTQuestMsg(msg):
    if len(msg) == 0:
        return Localizer.QTQuestNodeNeedATask
    
    if len(msg) != 4:
        return None
    
    (questId, toNpcId, toonProgress, index) = msg
    quest = Quests.getQuest(questId)
    if not quest:
        return None
    
    msgs = quest.getQTStrings(toNpcId, toonProgress)
    if type(msgs) != type([]):
        msgs = [
            msgs]
    
    if index >= len(msgs):
        return None
    
    return msgs[index]
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:21,代碼來源:QTQuestNode.py

示例12: __toonQuestsList2Quests

 def __toonQuestsList2Quests(self, quests):
     return [Quests.getQuest(x[0]) for x in quests]
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leaked-Source,代碼行數:2,代碼來源:QuestManagerAI.py

示例13: requestInteract

    def requestInteract(self, toonId, npc):
        toon = self.air.doId2do.get(toonId)
        if not toon:
            # TODO: Flag suspicious. They shouldn't have got this far.
            return

        # Check if the toon has any quests to turn in.
        for index, quest in enumerate(self.__toonQuestsList2Quests(toon.quests)):
            questId, fromNpcId, toNpcId, rewardId, toonProgress = toon.quests[index]
            isComplete = quest.getCompletionStatus(toon, toon.quests[index], npc)
            if isComplete != Quests.COMPLETE:
                # This quest isn't complete, skip.
                continue
            # If we're in the Toontorial, move to the next step.
            if toonId in self.air.tutorialManager.avId2fsm.keys():
                self.air.tutorialManager.avId2fsm[toonId].demand('Tunnel')
            # Take away gags if it's a DeliverGagQuest.
            if isinstance(quest, Quests.DeliverGagQuest):
                track, level = quest.getGagType()
                toon.inventory.setItem(track, level, toon.inventory.numItem(track, level) - quest.getNumGags())
                toon.b_setInventory(toon.inventory.makeNetString())
            # Check if the ToonTask has more quests to complete.
            nextQuest = Quests.getNextQuest(questId, npc, toon)
            if nextQuest == (Quests.NA, Quests.NA):
                # No more quests in the current ToonTask!
                if isinstance(quest, Quests.TrackChoiceQuest):
                    # TrackTrainingRewards are a little different, as we now
                    # have to display the gag track selection menu.
                    npc.presentTrackChoice(toonId, questId, quest.getChoices())
                    return
                # This function is pretty weird... not sure why it's even here...
                # But I'll include it just in case... (TMS says: "idk about this
                # one, maybe a single quest can have different rewards?")
                rewardId = Quests.getAvatarRewardId(toon, questId)
                npc.completeQuest(toonId, questId, rewardId)
                self.completeQuest(toon, questId)
                self.giveReward(toon, rewardId)
                return
            else:
                # We have another quest to go, sigh.
                self.completeQuest(toon, questId)
                nextQuestId = nextQuest[0]
                nextRewardId = Quests.getFinalRewardId(questId, 1)
                nextToNpcId = nextQuest[1]
                self.npcGiveQuest(npc, toon, nextQuestId, nextRewardId, nextToNpcId)
                return

        # We had no quests to hand in, maybe they want to take out a new ToonTask?
        if len(self.__toonQuestsList2Quests(toon.quests)) >= toon.getQuestCarryLimit():
            # Nope, they already have the maximum amount of concurring quests they
            # can carry. Reject them.
            self.notify.debug("Rejecting toonId %d because their quest inventory is full." % toonId)
            npc.rejectAvatar(toonId)
            return

        # Are we in the Toontorial?
        if toonId in self.air.tutorialManager.avId2fsm.keys():
            # Are we speaking to Tom?
            if toon.getRewardHistory()[0] == 0:
                self.npcGiveQuest(npc, toon, 101, Quests.findFinalRewardId(101)[0], Quests.getQuestToNpcId(101), storeReward=True) # FIXME please, i have no idea if this is correct
                self.air.tutorialManager.avId2fsm[toonId].demand('Battle')
                return

        # Are they eligible for a tier upgrade?
        tier = toon.getRewardHistory()[0]
        if Quests.avatarHasAllRequiredRewards(toon, tier):
            # They have all the rewards needed for the next tier.
            if not Quests.avatarWorkingOnRequiredRewards(toon):
                # Check to make sure they are not on the LOOPING_FINAL_TIER
                if tier != Quests.LOOPING_FINAL_TIER:
                    tier += 1

                # Set the tier
                toon.b_setRewardHistory(tier, [])
            else:
                # They're eligible for a tier upgrade, but haven't finished all
                # of their required ToonTasks yet.
                self.notify.debug("Rejecting toonId %d because they are still working on their current tier." % toonId)
                npc.rejectAvatarTierNotDone(toonId)
                return

        # Time to give them a list of "suitable" tasks!
        suitableQuests = Quests.chooseBestQuests(tier, npc, toon)
        if not suitableQuests:
            # Uh oh! There's no suitable quests for them at the moment... reject.
            self.notify.debug("Rejecting toonId %d because there are no quests available!" % toonId)
            npc.rejectAvatar(toonId)
            return

        # Tell the NPC to select some quests from the generated list.
        npc.presentQuestChoice(toonId, suitableQuests)
        return
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leaked-Source,代碼行數:92,代碼來源:QuestManagerAI.py

示例14: update

 def update(self, questDesc):
     questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
     quest = Quests.getQuest(questId)
     if quest == None:
         self.notify.warning("Tried to display poster for unknown quest %s" % questId)
         return
     if rewardId == Quests.NA:
         finalReward = Quests.getFinalRewardId(questId, fAll=1)
         transformedReward = Quests.transformReward(finalReward, base.localAvatar)
         reward = Quests.getReward(transformedReward)
     else:
         reward = Quests.getReward(rewardId)
     if reward and questId not in Quests.NoRewardTierZeroQuests:
         rewardString = reward.getPosterString()
     else:
         rewardString = ""
     self.rewardText["text"] = rewardString
     self.fitLabel(self.rewardText)
     if Quests.isQuestJustForFun(questId, rewardId):
         self.funQuest.show()
     else:
         self.funQuest.hide()
     if self._deleteCallback:
         self.showDeleteButton(questDesc)
     else:
         self.hideDeleteButton()
     fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE
     if toNpcId == Quests.ToonHQ:
         toNpcName = TTLocalizer.QuestPosterHQOfficer
         toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
         toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
         toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
     elif toNpcId == Quests.ToonTailor:
         toNpcName = TTLocalizer.QuestPosterTailor
         toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
         toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
         toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
     else:
         toNpcName = NPCToons.getNPCName(toNpcId)
         toNpcZone = NPCToons.getNPCZone(toNpcId)
         toNpcHoodId = ZoneUtil.getCanonicalHoodId(toNpcZone)
         toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId)
         toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
         toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)
         toNpcStreetName = ZoneUtil.getStreetName(toNpcBranchId)
     lPos = Vec3(0, 0, 0.13)
     lIconGeom = None
     lIconGeomScale = 1
     rIconGeom = None
     rIconGeomScale = 1
     infoText = ""
     infoZ = TTLocalizer.QPinfoZ
     auxText = None
     auxTextPos = Vec3(0, 0, 0.12)
     headlineString = quest.getHeadlineString()
     objectiveStrings = quest.getObjectiveStrings()
     captions = map(string.capwords, quest.getObjectiveStrings())
     imageColor = Vec4(*self.colors["white"])
     if quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
         frameBgColor = "red"
         if quest.getType() == Quests.DeliverGagQuest:
             invModel = loader.loadModel("phase_3.5/models/gui/inventory_icons")
             track, item = quest.getGagType()
             lIconGeom = invModel.find("**/" + AvPropsNew[track][item])
             invModel.removeNode()
         else:
             bookModel = loader.loadModel("phase_3.5/models/gui/stickerbook_gui")
             lIconGeom = bookModel.find("**/package")
             lIconGeomScale = 0.12
             bookModel.removeNode()
         if not fComplete:
             captions.append(toNpcName)
             auxText = TTLocalizer.QuestPosterAuxTo
             auxTextPos.setZ(0.12)
             lPos.setX(-0.18)
             infoText = TTLocalizer.QuestPageDestination % (toNpcBuildingName, toNpcStreetName, toNpcLocationName)
             rIconGeom = self.createNpcToonHead(toNpcId)
             rIconGeomScale = IMAGE_SCALE_SMALL
     elif quest.getType() == Quests.RecoverItemQuest:
         frameBgColor = "green"
         bookModel = loader.loadModel("phase_3.5/models/gui/stickerbook_gui")
         lIconGeom = bookModel.find("**/package")
         lIconGeomScale = 0.12
         bookModel.removeNode()
         if not fComplete:
             rIconGeomScale = IMAGE_SCALE_SMALL
             holder = quest.getHolder()
             holderType = quest.getHolderType()
             if holder == Quests.Any:
                 cogIcons = loader.loadModel("phase_3/models/gui/cog_icons")
                 rIconGeom = cogIcons.find("**/cog")
                 cogIcons.removeNode()
                 lPos.setX(-0.18)
                 auxText = TTLocalizer.QuestPosterAuxFrom
             elif holder == Quests.AnyFish:
                 headlineString = TTLocalizer.QuestPosterFishing
                 auxText = TTLocalizer.QuestPosterAuxFor
                 auxTextPos.setX(-0.18)
                 captions = captions[:1]
             else:
#.........這裏部分代碼省略.........
開發者ID:Toonerz,項目名稱:Toontown-World-Online-Leaked-Source,代碼行數:101,代碼來源:QuestPoster.py

示例15: update

 def update(self, questDesc):
     (questId, fromNpcId, toNpcId, rewardId, toonProgress) = questDesc
     quest = Quests.getQuest(questId)
     if rewardId == Quests.NA:
         finalReward = Quests.getFinalRewardId(questId, fAll = 1)
         transformedReward = Quests.transformReward(finalReward, toonbase.localToon)
         reward = Quests.getReward(transformedReward)
     else:
         reward = Quests.getReward(rewardId)
     if reward:
         rewardString = reward.getPosterString()
     else:
         rewardString = ''
     self.rewardText['text'] = rewardString
     self.fitLabel(self.rewardText)
     questEntry = Quests.QuestDict.get(questId)
     if questEntry:
         tier = questEntry[0]
         fOptional = Quests.isRewardOptional(tier, rewardId)
     else:
         fOptional = 0
     if fOptional:
         self.funQuest.show()
     else:
         self.funQuest.hide()
     fComplete = quest.getCompletionStatus(toonbase.localToon, questDesc) == Quests.COMPLETE
     fromNpcName = NPCToons.getNPCName(fromNpcId)
     npcZone = NPCToons.getNPCZone(fromNpcId)
     hoodId = ZoneUtil.getHoodId(npcZone)
     branchId = ZoneUtil.getBranchZone(npcZone)
     if fromNpcId == Quests.ToonHQ:
         locationName = Localizer.QuestPosterHQLocationName
         buildingName = Localizer.QuestPosterHQBuildingName
         streetName = Localizer.QuestPosterHQStreetName
     elif fromNpcId == Quests.ToonTailor:
         locationName = Localizer.QuestPosterTailorLocationName
         buildingName = Localizer.QuestPosterTailorBuildingName
         streetName = Localizer.QuestPosterTailorStreetName
     else:
         locationName = toonbase.tcr.hoodMgr.getFullnameFromId(hoodId)
         buildingName = NPCToons.getBuildingTitle(npcZone)
         streetName = ZoneUtil.getStreetName(branchId)
     if toNpcId == Quests.ToonHQ:
         toNpcName = Localizer.QuestPosterHQOfficer
         toNpcBuildingName = Localizer.QuestPosterHQBuildingName
         toNpcStreetName = Localizer.QuestPosterHQStreetName
         toNpcLocationName = Localizer.QuestPosterHQLocationName
     elif toNpcId == Quests.ToonTailor:
         toNpcName = Localizer.QuestPosterTailor
         toNpcBuildingName = Localizer.QuestPosterTailorBuildingName
         toNpcStreetName = Localizer.QuestPosterTailorStreetName
         toNpcLocationName = Localizer.QuestPosterTailorLocationName
     else:
         toNpcName = NPCToons.getNPCName(toNpcId)
         toNpcZone = NPCToons.getNPCZone(toNpcId)
         toNpcHoodId = ZoneUtil.getHoodId(toNpcZone)
         toNpcLocationName = toonbase.tcr.hoodMgr.getFullnameFromId(toNpcHoodId)
         toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
         toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)
         toNpcStreetName = ZoneUtil.getStreetName(toNpcBranchId)
     lPos = Vec3(0, 0, 0.13)
     lIconGeom = None
     lIconGeomScale = 1
     rIconGeom = None
     rIconGeomScale = 1
     infoText = ''
     infoZ = -0.0625
     auxText = None
     auxTextPos = Vec3(0, 0, 0.12)
     headlineString = quest.getHeadlineString()
     captions = map(string.capwords, quest.getObjectiveStrings())
     imageColor = Vec4(*self.colors['white'])
     if quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
         frameBgColor = 'red'
         if quest.getType() == Quests.DeliverGagQuest:
             invModel = loader.loadModelOnce('phase_3.5/models/gui/inventory_icons')
             (track, item) = quest.getGagType()
             lIconGeom = invModel.find('**/' + AvPropsNew[track][item])
             invModel.removeNode()
         else:
             bookModel = loader.loadModelOnce('phase_3.5/models/gui/stickerbook_gui')
             lIconGeom = bookModel.find('**/package')
             lIconGeomScale = 0.12
             bookModel.removeNode()
         if not fComplete:
             captions.append(toNpcName)
             auxText = Localizer.QuestPosterAuxTo
             auxTextPos.setZ(0.12)
             lPos.setX(-0.17999999999999999)
             infoText = Localizer.QuestPageDestination % (toNpcBuildingName, toNpcStreetName, toNpcLocationName)
             rIconGeom = self.createNpcToonHead(toNpcId)
             rIconGeomScale = IMAGE_SCALE_SMALL
         
     elif quest.getType() == Quests.RecoverItemQuest:
         frameBgColor = 'green'
         bookModel = loader.loadModelOnce('phase_3.5/models/gui/stickerbook_gui')
         lIconGeom = bookModel.find('**/package')
         lIconGeomScale = 0.12
         bookModel.removeNode()
         if not fComplete:
#.........這裏部分代碼省略.........
開發者ID:Toonerz,項目名稱:Toontown-2003,代碼行數:101,代碼來源:QuestPoster.py


注:本文中的Quests類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。