本文整理汇总了Python中toontown.quest.Quests.getNextQuest方法的典型用法代码示例。如果您正苦于以下问题:Python Quests.getNextQuest方法的具体用法?Python Quests.getNextQuest怎么用?Python Quests.getNextQuest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.quest.Quests
的用法示例。
在下文中一共展示了Quests.getNextQuest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requestInteract
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getNextQuest [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
示例2: nextQuest
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getNextQuest [as 别名]
def nextQuest(self, toon, npc, questId):
nextQuestId = Quests.getNextQuest(questId, npc, toon)
toonQuests = toon.getQuests() #Flattened Quests.
questList = [] #Unflattened Quests.
for i in xrange(0, len(toonQuests), 5):
questDesc = toonQuests[i:i + 5]
if questDesc[0] == questId:
questDesc[0] = nextQuestId[0]
questDesc[2] = nextQuestId[1]
questDesc[4] = 0
questList.append(questDesc)
npc.incompleteQuest(toon.doId, nextQuestId[0], Quests.QUEST, nextQuestId[1])
toon.b_setQuests(questList)
示例3: requestInteract
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getNextQuest [as 别名]
def requestInteract(self, avId, npc):
av = self.air.doId2do.get(avId)
if not av:
self.notify.warning("Got requestInteract with unknown avId: %s" % avId)
return
# check if the avatar wants to turn in a quest
quests = av.getQuests()
for i in xrange(0, len(quests), 5):
quest = quests[i:i + 5]
klass = Quests.getQuest(quest[0])
if not klass:
self.notify.debug('Quest %s has no class.' % quest[0])
continue
if klass.getCompletionStatus(av, quest, npc) == Quests.COMPLETE:
# complete quest, the avatar is turning it in
self.notify.debug("Toon %s completed quest %s" % (av.doId, quest[0]))
# fill the laff
av.toonUp(av.maxHp)
if isinstance(klass, Quests.TrackChoiceQuest):
npc.presentTrackChoice(avId, quest[0], klass.getChoices())
return 1
nextQuest = Quests.getNextQuest(quest[0], npc, av)
if nextQuest[0] != Quests.NA:
self.__goToNextQuest(av, npc, quest[0], nextQuest)
else:
npc.completeQuest(avId, quest[0], quest[-2])
self.__questCompleted(av, quest[0])
return 1
if self.__considerProgressTier(av):
npc.rejectAvatarTierNotDone(avId)
return 0
# give choices if the av doesn't have enough quests already
if len(quests) / 5 < av.getQuestCarryLimit():
choices = Quests.chooseBestQuests(av.getRewardTier(), npc, av)
if choices:
npc.presentQuestChoice(avId, choices)
return 1
return 0
示例4: nextQuest
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getNextQuest [as 别名]
def nextQuest(self, av, npc, questId):
# Get the next QuestId and toNpcId.
nextQuestId, toNpcId = Quests.getNextQuest(questId, npc, av)
# Get the avatars current quests.
avQuests = av.getQuests()
questList = []
# Iterate through their current quests.
for i in xrange(0, len(avQuests), 5):
questDesc = avQuests[i:i + 5]
if questDesc[QuestIdIndex] == questId:
questDesc[QuestIdIndex] = nextQuestId
questDesc[QuestToNpcIdIndex] = toNpcId
questDesc[QuestProgressIndex] = 0
questList.append(questDesc)
# Show the quest movie and set their quests.
npc.incompleteQuest(av.doId, nextQuestId, Quests.QUEST, toNpcId)
av.b_setQuests(questList)
示例5: requestInteract
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getNextQuest [as 别名]
def requestInteract(self, avId, npc):
# Get the avatar.
av = self.air.doId2do.get(avId)
if not av:
return
avQuestPocketSize = av.getQuestCarryLimit()
avQuests = av.getQuests()
needTrackTask = False
fakeTier = 0
avTrackProgress = av.getTrackProgress()
if avTrackProgress[0] == -1:
avQuestTier = av.getRewardTier()
if avQuestTier < Quests.DG_TIER and avQuestTier > Quests.DD_TIER:
fakeTier = Quests.DD_TIER
needTrackTask = True
elif avQuestTier < Quests.BR_TIER and avQuestTier > Quests.MM_TIER:
fakeTier = Quests.MM_TIER
needTrackTask = True
elif avQuestTier < Quests.DL_TIER and avQuestTier > Quests.BR_TIER:
fakeTier = Quests.BR_TIER
needTrackTask = True
# Iterate through their quests.
for i in xrange(0, len(avQuests), 5):
questDesc = avQuests[i:i + 5]
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
questClass = Quests.getQuest(questId)
if questClass:
completeStatus = questClass.getCompletionStatus(av, questDesc, npc)
else:
continue
# If the quest is a DeliverGagQuest, add the gags.
if isinstance(questClass, Quests.DeliverGagQuest):
# Check if it's the required NPC.
if npc.npcId == toNpcId:
# Add progress.
questList = []
progress = questClass.removeGags(av)
for i in xrange(0, len(avQuests), 5):
questDesc = avQuests[i:i + 5]
if questDesc[QuestIdIndex] == questId:
questDesc[QuestProgressIndex] += progress
if questDesc[QuestProgressIndex] >= questClass.getNumGags():
completeStatus = Quests.COMPLETE
questList.append(questDesc)
av.b_setQuests(questList)
if completeStatus != Quests.COMPLETE:
continue
# If they've completed a quest.
if completeStatus == Quests.COMPLETE:
# ToonUp the toon to max health.
av.toonUp(av.maxHp)
# If it's a TrackChoiceQuest then present their track choices.
if isinstance(questClass, Quests.TrackChoiceQuest):
npc.presentTrackChoice(avId, questId, questClass.getChoices(av))
break
# If there is another part to this quest then give them that.
if Quests.getNextQuest(questId, npc, av)[0] != Quests.NA:
self.nextQuest(av, npc, questId)
if avId in self.air.tutorialManager.avId2fsm:
self.air.tutorialManager.avId2fsm[avId].demand('Tunnel')
break
else:
# The toon has completed this quest. Give them a reward!
npc.completeQuest(avId, questId, rewardId)
self.completeQuest(av, questId)
break
else:
# They haven't completed any quests so we have to give them choices.
# If they've got a full pouch then reject them.
if (len(avQuests) == avQuestPocketSize*5):
npc.rejectAvatar(avId)
return
elif isinstance(npc, DistributedNPCSpecialQuestGiverAI):
# Don't display choices. Force a choice.
self.tutorialQuestChoice(avId, npc)
return
else:
#Present quest choices.
if needTrackTask:
choices = self.npcGiveTrackChoice(av, fakeTier)
else:
choices = self.avatarQuestChoice(av, npc)
if choices != []:
npc.presentQuestChoice(avId, choices)
else:
npc.rejectAvatar(avId)