本文整理匯總了Python中Quests.getQuest方法的典型用法代碼示例。如果您正苦於以下問題:Python Quests.getQuest方法的具體用法?Python Quests.getQuest怎麽用?Python Quests.getQuest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Quests
的用法示例。
在下文中一共展示了Quests.getQuest方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: showChoicePoster
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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
示例2: _QTQuestNode__questsChanged
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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()
示例3: showChoicePoster
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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)
示例4: decodeQTQuestMsg
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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]
示例5: update
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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 Quests.isQuestJustForFun(questId, rewardId):
if fComplete:
self.funQuest.hide()
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(lambda x: str(x).title(), 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
#.........這裏部分代碼省略.........
示例6: __toonQuestsList2Quests
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
def __toonQuestsList2Quests(self, quests):
return [Quests.getQuest(x[0]) for x in quests]
示例7: update
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
def update(self, questDesc):
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
quest = Quests.getQuest(questId)
self.teleportButton['command'] = self.teleportToShop
self.teleportButton['extraArgs'] = [toNpcId]
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()
if self.laffMeter:
self.laffMeter.destroy()
fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE
if Quests.isQuestJustForFun(questId, rewardId):
if fComplete:
self.funQuest.hide()
self.teleportButton.show()
else:
self.teleportButton.hide()
if toNpcId == Quests.ToonHQ:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = TTLocalizer.QuestPosterHQOfficer
toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
elif toNpcId == Quests.ToonTailor:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = TTLocalizer.QuestPosterTailor
toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
else:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
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 isinstance(quest, Quests.TexturedQuest) and quest.hasFrame():
self.teleportButton.hide()
frame = quest.getFrame()
frameBgColor = frame[1]
lIconGeom = frame[0]
lIconGeomScale = 0.13
if not fComplete:
infoText = quest.getLocationName()
if infoText == '':
infoText = TTLocalizer.QuestPosterAnywhere
elif quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
frameBgColor = 'red'
if fComplete:
self.teleportButton.show()
self.teleportButton.setPos(0.175, 0, -0.125)
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')
#.........這裏部分代碼省略.........
示例8: update
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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:
#.........這裏部分代碼省略.........
示例9: update
# 需要導入模塊: import Quests [as 別名]
# 或者: from Quests import getQuest [as 別名]
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:
#.........這裏部分代碼省略.........