本文整理汇总了Python中toontown.quest.Quests.chooseBestQuests方法的典型用法代码示例。如果您正苦于以下问题:Python Quests.chooseBestQuests方法的具体用法?Python Quests.chooseBestQuests怎么用?Python Quests.chooseBestQuests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.quest.Quests
的用法示例。
在下文中一共展示了Quests.chooseBestQuests方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requestInteract
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import chooseBestQuests [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
示例2: avatarQuestChoice
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import chooseBestQuests [as 别名]
def avatarQuestChoice(self, toon, npc):
tasks = Quests.chooseBestQuests(toon.getRewardTier(), npc, toon)
#Does the avatar already have any of these rewardIds?
#[QuestId, RewardId, toNPCID]
toonQuests = toon.getQuests() #Flattened Quests.
rewardList = [] #Unflattened Quests.
for i in xrange(0, len(toonQuests), 5):
questDesc = toonQuests[i:i + 5]
rewardList.append(questDesc[3])
for task in tasks:
if task[1] in rewardList:
tier = toon.getRewardHistory()[0]
rewards = Quests.getOptionalRewardsInTier(tier)
if rewards:
rewardId = random.choice(Quests.getOptionalRewardsInTier(tier))
task[1] = rewardId
return tasks
示例3: avatarQuestChoice
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import chooseBestQuests [as 别名]
def avatarQuestChoice(self, av, npc):
# Get the best quests for an avatar/npc.
return Quests.chooseBestQuests(av.getRewardTier(), npc, av)