本文整理汇总了Python中toontown.quest.Quests.getOptionalRewardsInTier方法的典型用法代码示例。如果您正苦于以下问题:Python Quests.getOptionalRewardsInTier方法的具体用法?Python Quests.getOptionalRewardsInTier怎么用?Python Quests.getOptionalRewardsInTier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.quest.Quests
的用法示例。
在下文中一共展示了Quests.getOptionalRewardsInTier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: avatarQuestChoice
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import getOptionalRewardsInTier [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