当前位置: 首页>>代码示例>>Python>>正文


Python Quests.getQuest方法代码示例

本文整理汇总了Python中toontown.quest.Quests.getQuest方法的典型用法代码示例。如果您正苦于以下问题:Python Quests.getQuest方法的具体用法?Python Quests.getQuest怎么用?Python Quests.getQuest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.quest.Quests的用法示例。


在下文中一共展示了Quests.getQuest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initQuestFrame

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def initQuestFrame(self, toon, avQuests):
        self.endTrackFrame.hide()
        self.gagExpFrame.hide()
        self.newGagFrame.hide()
        self.promotionFrame.hide()
        self.questFrame.show()
        self.itemFrame.hide()
        self.cogPartFrame.hide()
        self.missedItemFrame.hide()
        for i in xrange(ToontownGlobals.MaxQuestCarryLimit):
            questLabel = self.questLabelList[i]
            questLabel['text_fg'] = (0, 0, 0, 1)
            questLabel.hide()

        for i in xrange(len(avQuests)):
            questDesc = avQuests[i]
            questId, npcId, toNpcId, rewardId, toonProgress = questDesc
            quest = Quests.getQuest(questId)
            if quest:
                questString = quest.getString()
                progressString = quest.getProgressString(toon, questDesc)
                rewardString = quest.getRewardString(progressString)
                rewardString = Quests.fillInQuestNames(rewardString, toNpcId=toNpcId)
                completed = quest.getCompletionStatus(toon, questDesc) == Quests.COMPLETE
                questLabel = self.questLabelList[i]
                questLabel.show()
                if base.localAvatar.tutorialAck:
                    questLabel['text'] = rewardString
                    if completed:
                        questLabel['text_fg'] = (0, 0.3, 0, 1)
                else:
                    questLabel['text'] = questString + ' :'
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:34,代码来源:RewardPanel.py

示例2: toonKilledCogs

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def toonKilledCogs(self, av, suits, zoneId, activeToons):
     if self.air.topToonsMgr:
         self.air.topToonsMgr.toonKilledCogs(av, suits)
         
     quests = av.getQuests()
     newQuests = []
     
     for i in xrange(0, len(quests), 5):
         quest = quests[i:i + 5]
         klass = Quests.getQuest(quest[0])
         
         if not klass:
             continue
                         
         if isinstance(klass, Quests.CogQuest):
             for suit in suits:
                 if klass.getCompletionStatus(av, quest) == Quests.COMPLETE:
                     break
                     
                 if klass.doesCogCount(av.doId, suit, zoneId, suit['activeToons']):
                     quest[4] += 1
         
         newQuests.append(quest)
         
     av.b_setQuests(newQuests)
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:27,代码来源:QuestManagerAI.py

示例3: toonKilledCogs

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def toonKilledCogs(self, av, suitsKilled, zoneId, activeToonList):
         # Get the avatar's current quests.
        avQuests = av.getQuests()
        questList = []

        # Make a list of the activeToonDoIds
        activeToonDoIds = [toon.doId for toon in activeToonList if not None]

        # Iterate through the avatar's current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex], av.doId)

            # Check if they are doing a cog quest
            if isinstance(questClass, Quests.CogQuest):

                # Check if the cog counts...
                for suit in suitsKilled:
                    if questClass.doesCogCount(av.doId, suit, zoneId, activeToonDoIds):

                        # Looks like the cog counts!
                        if questClass.getCompletionStatus(av, questDesc) != Quests.COMPLETE:
                            questDesc[QuestProgressIndex] += 1

            # Add the quest to the questList
            questList.append(questDesc)

        # Update the avatar's quests
        av.b_setQuests(questList)
开发者ID:MasterLoopyBM,项目名称:Toontown,代码行数:31,代码来源:QuestManagerAI.py

示例4: __tasksChanged

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def __tasksChanged(self):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        phrases = []

        def addTerminal(terminal, self=self, phrases=phrases):
            displayText = terminal.getDisplayText()
            if displayText not in phrases:
                self.append(terminal)
                phrases.append(displayText)

        for task in lt.quests:
            taskId, fromNpcId, toNpcId, rewardId, toonProgress = task
            q = Quests.getQuest(taskId)
            if q is None:
                continue
            msgs = q.getSCStrings(toNpcId, toonProgress)
            if type(msgs) != type([]):
                msgs = [msgs]
            for i in xrange(len(msgs)):
                addTerminal(TTSCToontaskTerminal(msgs[i], taskId, toNpcId, toonProgress, i))

        needToontask = 1
        if hasattr(lt, "questCarryLimit"):
            needToontask = len(lt.quests) != lt.questCarryLimit
        if needToontask:
            addTerminal(SCStaticTextTerminal(1299))
        return
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:34,代码来源:TTSCToontaskMenu.py

示例5: recoverItems

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def recoverItems(self, toon, suitsKilled, taskZoneId):
     flattenedQuests = toon.getQuests()
     questList = [] #unflattened
     recoveredItems = []
     unrecoveredItems = []
     taskZoneId = ZoneUtil.getBranchZone(taskZoneId)
     for i in xrange(0, len(flattenedQuests), 5):
         questDesc = flattenedQuests[i : i + 5]
         questClass = Quests.getQuest(questDesc[0])
         if questClass.getCompletionStatus(toon, questDesc) == Quests.INCOMPLETE:
             if isinstance(questClass, Quests.CogQuest):
                 for suit in suitsKilled:
                     if questClass.doesCogCount(toon.doId, suit, taskZoneId, suit['activeToons']):
                         questDesc[4] += 1
             elif isinstance(questClass, Quests.RecoverItemQuest):
                 if questClass.getHolder() != Quests.AnyFish:
                     for suit in suitsKilled:
                         if questClass.doesCogCount(toon.doId, suit, taskZoneId, suit['activeToons']):
                             minchance = questClass.getPercentChance()
                             import random
                             chance = random.randint(minchance - 40, 100)
                             if chance <= minchance:
                                 questDesc[4] += 1
                                 recoveredItems.append(questClass.getItem())
                             else:
                                 unrecoveredItems.append(questClass.getItem())
         questList.append(questDesc)
     toon.b_setQuests(questList)
     return (recoveredItems, unrecoveredItems)
开发者ID:InvisbleMario,项目名称:Toontown-Community,代码行数:31,代码来源:QuestManagerAI.py

示例6: toonCaughtFishingItem

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def toonCaughtFishingItem(self, av):
        # Get the avatars current quests.
        avQuests = av.getQuests()
        fishingItem = -1
        questList = []

        # Iterate through their current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex])
            if fishingItem != -1:
                questList.append(questDesc)
                continue
            if isinstance(questClass, Quests.RecoverItemQuest):
                if not hasattr(questClass, 'getItem'):
                    questList.append(questDesc)
                    continue
                if questClass.getHolder() == Quests.AnyFish:
                    if not questClass.getCompletionStatus(av, questDesc) == Quests.COMPLETE:
                        baseChance = questClass.getPercentChance()
                        amountRemaining = questClass.getNumItems() - questDesc[QuestProgressIndex]
                        chance = Quests.calcRecoverChance(amountRemaining, baseChance)
                        if chance >= baseChance:
                            questDesc[QuestProgressIndex] += 1
                            fishingItem = questClass.getItem()
            questList.append(questDesc)

        av.b_setQuests(questList)
        return fishingItem
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:31,代码来源:QuestManagerAI.py

示例7: updateQuestInfo

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def updateQuestInfo(self):
        for marker in self.buildingMarkers:
            marker.destroy()

        self.buildingMarkers = []
        dnaData = base.cr.playGame.dnaData
        for questIndex in self.av.questPage.quests.keys():
            questDesc = self.av.questPage.quests.get(questIndex)
            if questDesc is None:
                continue
            mapIndex = questIndex + 1
            questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
            quest = Quests.getQuest(questId)
            fComplete = quest.getCompletionStatus(self.av, questDesc) == Quests.COMPLETE
            if not fComplete:
                if quest.getType() == Quests.RecoverItemQuest:
                    if quest.getHolder() == Quests.AnyFish:
                        self.putBuildingMarker(self.fishingSpotInfo, mapIndex=mapIndex)
                    continue
                elif quest.getType() != Quests.DeliverGagQuest and quest.getType() != Quests.DeliverItemQuest and quest.getType() != Quests.VisitQuest and quest.getType() != Quests.TrackChoiceQuest:
                    continue
            if toNpcId == Quests.ToonHQ:
                self.putBuildingMarker(self.hqPosInfo, mapIndex=mapIndex)
            else:
                npcZone = NPCToons.getNPCZone(toNpcId)
                hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
                branchId = ZoneUtil.getCanonicalBranchZone(npcZone)
                if self.hoodId == hoodId and self.zoneId == branchId:
                    for blockId, block in dnaData.getBlocks():
                        zone = block.zone
                        branchZone = zone - zone % 100
                        finalZone = branchZone + 500 + blockId
                        if npcZone == finalZone:
                            building = block.node
                            self.putBuildingMarker(Point3(building.getPos()), building.getHpr(), mapIndex=mapIndex)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:37,代码来源:QuestMap.py

示例8: toonKilledCogs

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def toonKilledCogs(self, av, suitsKilled, zoneId):
        # Get the avatar's current quests.
        messenger.send("topToonsManager-event", [av.doId, TopToonsGlobals.CAT_COGS, len(suitsKilled)])
        avQuests = av.getQuests()
        questList = []

        # Iterate through the avatar's current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex])

            # Check if they are doing a cog quest
            if isinstance(questClass, Quests.CogQuest):
                # Check if the cog counts...
                for suit in suitsKilled:
                    if questClass.doesCogCount(av.doId, suit, zoneId):
                        # Looks like the cog counts!
                        if questClass.getCompletionStatus(av, questDesc) != Quests.COMPLETE:
                            questDesc[QuestProgressIndex] += 1

            # Add the quest to the questList
            questList.append(questDesc)

        # Update the avatar's quests
        av.b_setQuests(questList)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:27,代码来源:QuestManagerAI.py

示例9: recoverItems

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def recoverItems(self, av, suitsKilled, taskZoneId):
        # Get the avatars current quests.
        avQuests = av.getQuests()
        questList = []
        recoveredItems = []
        unrecoveredItems = []
        taskZoneId = ZoneUtil.getBranchZone(taskZoneId)

        # Iterate through the avatars current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex])
            if questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:
                if isinstance(questClass, Quests.CogQuest):
                    for suit in suitsKilled:
                        if questClass.doesCogCount(av.doId, suit, taskZoneId, suit['activeToons']):
                            questDesc[QuestProgressIndex] += 1
                elif isinstance(questClass, Quests.RecoverItemQuest):
                    if questClass.getHolder() != Quests.AnyFish:
                        for suit in suitsKilled:
                            if questClass.doesCogCount(av.doId, suit, taskZoneId, suit['activeToons']):
                                baseChance = questClass.getPercentChance()
                                amountRemaining = questClass.getNumItems() - questDesc[QuestProgressIndex]
                                chance = Quests.calcRecoverChance(amountRemaining, baseChance)
                                if chance >= baseChance:
                                    questDesc[QuestProgressIndex] += 1
                                    recoveredItems.append(questClass.getItem())
                                else:
                                    unrecoveredItems.append(questClass.getItem())
            questList.append(questDesc)

        av.b_setQuests(questList)
        return (recoveredItems, unrecoveredItems)
开发者ID:Toontown-Electrified,项目名称:src-feature-the-experiment,代码行数:35,代码来源:QuestManagerAI.py

示例10: hasTailorClothingTicket

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def hasTailorClothingTicket(self, toon, npc):
     flattenedQuests = toon.getQuests()
     for i in xrange(0, len(flattenedQuests), 5):
         questDesc = flattenedQuests[i : i + 5]
         questClass = Quests.getQuest(questDesc[0])
         if isinstance(questClass, Quests.DeliverItemQuest):
             if questClass.getCompletionStatus(toon, questDesc, npc) == Quests.COMPLETE:
                 return 1
     return 0
开发者ID:InvisbleMario,项目名称:Toontown-Community,代码行数:11,代码来源:QuestManagerAI.py

示例11: removeClothingTicket

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def removeClothingTicket(self, toon, npc):
     flattenedQuests = toon.getQuests()
     questList = []
     for i in xrange(0, len(flattenedQuests), 5):
         questDesc = flattenedQuests[i : i + 5]
         questClass = Quests.getQuest(questDesc[0])
         if isinstance(questClass, Quests.DeliverItemQuest):
             if questClass.getCompletionStatus(toon, questDesc, npc) == Quests.COMPLETE:
                 toon.removeQuest(questDesc[0])
                 break
开发者ID:InvisbleMario,项目名称:Toontown-Community,代码行数:12,代码来源:QuestManagerAI.py

示例12: requestInteract

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def requestInteract(self, avId, npc):
     toon = self.air.doId2do.get(avId)
     if not toon:
         return
     toonQuestPocketSize = toon.getQuestCarryLimit()
     self.avatarProgressTier(toon)
     toonQuests = toon.getQuests()
     for i in xrange(0, len(toonQuests), 5):
         questDesc = toonQuests[i:i + 5]
         questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
         questClass = Quests.getQuest(questId)
         if questClass:
             completeStatus = questClass.getCompletionStatus(toon, questDesc, npc)
         else:
             continue
         if completeStatus == Quests.COMPLETE:
             print 'QuestManager: %s (AvId: %s) Completed QuestId: %s'%(toon.getName(), toon.doId, questId)
             toon.toonUp(toon.maxHp)
             if isinstance(questClass, Quests.TrackChoiceQuest):
                 npc.presentTrackChoice(avId, questId, questClass.getChoices())
                 break
             elif Quests.getNextQuest(questId, npc, toon)[0] != Quests.NA:
                 self.nextQuest(toon, npc, questId)
             else:
                 npc.completeQuest(avId, questId, rewardId)
                 self.completeQuest(toon, questId)
             if isinstance(npc, DistributedNPCSpecialQuestGiverAI):
                 if npc.tutorial and (npc.npcId == 20002):
                     messenger.send('intHqDoor0-{0}'.format(npc.zoneId), [FADoorCodes.WRONG_DOOR_HQ])
                     messenger.send('intHqDoor1-{0}'.format(npc.zoneId), [FADoorCodes.UNLOCKED])
                     streetZone = self.air.tutorialManager.currentAllocatedZones[avId][0]
                     messenger.send('extHqDoor0-{0}'.format(streetZone), [FADoorCodes.GO_TO_PLAYGROUND])
                     messenger.send('extHqDoor1-{0}'.format(streetZone), [FADoorCodes.GO_TO_PLAYGROUND])
                     messenger.send('extShopDoor-{0}'.format(streetZone), [FADoorCodes.GO_TO_PLAYGROUND])
             break
     else:
         if (len(toonQuests) == toonQuestPocketSize*5):
             npc.rejectAvatar(avId)
             return
         elif isinstance(npc, DistributedNPCSpecialQuestGiverAI):
             choices = self.avatarQuestChoice(toon, npc)
             quest = choices[0]
             self.avatarChoseQuest(avId, npc, quest[0], quest[1], 0)
             if npc.tutorial:
                 if npc.npcId == 20000:
                     messenger.send('intShopDoor-{0}'.format(npc.zoneId), [FADoorCodes.UNLOCKED])
             return
         else:
             choices = self.avatarQuestChoice(toon, npc)
             if choices != []:
                 npc.presentQuestChoice(avId, choices)
                 return
             else:
                 npc.rejectAvatar(avId)
                 return
开发者ID:InvisbleMario,项目名称:Toontown-Community,代码行数:57,代码来源:QuestManagerAI.py

示例13: toonPlayedMinigame

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
 def toonPlayedMinigame(self, toon, toons):
     print 'QuestManager: %s (AvId: %s) played on the trolley.'%(toon.getName(), toon.doId)
     flattenedQuests = toon.getQuests()
     questList = [] #unflattened
     for i in xrange(0, len(flattenedQuests), 5):
         questDesc = flattenedQuests[i : i + 5]
         questClass = Quests.getQuest(questDesc[0])
         if isinstance(questClass, Quests.TrolleyQuest):
             questDesc[4] = 1
         questList.append(questDesc)
     toon.b_setQuests(questList)
开发者ID:InvisbleMario,项目名称:Toontown-Community,代码行数:13,代码来源:QuestManagerAI.py

示例14: removeClothingTicket

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def removeClothingTicket(self, av, npc):
        # Get the avatars current quests.
        avQuests = av.getQuests()

        # Iterate through their current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex])
            if isinstance(questClass, Quests.DeliverItemQuest):
                if questClass.getCompletionStatus(av, questDesc, npc) == Quests.COMPLETE:
                    av.removeQuest(questDesc[QuestIdIndex])
                    break
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:14,代码来源:QuestManagerAI.py

示例15: recoverItems

# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getQuest [as 别名]
    def recoverItems(self, av, suitsKilled, taskZoneId):
        # Get the avatars current quests.
        avQuests = av.getQuests()
        questList = []
        recoveredItems = []
        unrecoveredItems = []
        taskZoneId = ZoneUtil.getBranchZone(taskZoneId)

        # Iterate through the avatars current quests.
        for i in xrange(0, len(avQuests), 5):
            questDesc = avQuests[i : i + 5]
            questClass = Quests.getQuest(questDesc[QuestIdIndex])

            # Check if the Quest isnt already complete
            if questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:

                # Check if we are dealing with a RecoverItemQuest
                if isinstance(questClass, Quests.RecoverItemQuest):

                    # Iterate through all the Cogs that were killed in the battle
                    for suit in suitsKilled:

                        # Because the RecoveItemQuest class doesn't have a
                        # function to see if a Cog counts. We need to manually
                        # check if the Cog is valid for the Quest
                        if (questClass.getHolder() == Quests.Any) or \
                            (questClass.getHolderType() == 'type' and \
                            questClass.getHolder() == suit['type']) or \
                            (questClass.getHolderType() == 'track' and \
                            questClass.getHolder() == suit['track']) or \
                            (questClass.getHolderType() == 'level' and \
                            questClass.getHolder() <= suit['level']):

                            # It looks like the Cog was valid. Lets see if they
                            # found what they were looking for.
                            baseChance = questClass.getPercentChance()
                            amountRemaining = questClass.getNumItems() - questDesc[QuestProgressIndex]
                            chance = Quests.calcRecoverChance(amountRemaining, baseChance)

                            # They found it! Give them their reward!
                            if chance >= baseChance:
                                questDesc[QuestProgressIndex] += 1
                                recoveredItems.append(questClass.getItem())

                            # Better luck next time :(
                            else:
                                unrecoveredItems.append(questClass.getItem())

            questList.append(questDesc)

        av.b_setQuests(questList)

        return (recoveredItems, unrecoveredItems)
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:55,代码来源:QuestManagerAI.py


注:本文中的toontown.quest.Quests.getQuest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。