本文整理汇总了Python中toontown.quest.Quests.avatarHasTrolleyQuest方法的典型用法代码示例。如果您正苦于以下问题:Python Quests.avatarHasTrolleyQuest方法的具体用法?Python Quests.avatarHasTrolleyQuest怎么用?Python Quests.avatarHasTrolleyQuest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.quest.Quests
的用法示例。
在下文中一共展示了Quests.avatarHasTrolleyQuest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: isNewbie
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def isNewbie(self, avId):
# Does avId have the "ride the Trolley" quest?
toon = self.air.doId2do.get(avId)
if not toon:
return False
return Quests.avatarHasTrolleyQuest(toon)
示例2: trolleyLeft
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def trolleyLeft(self):
numPlayers = self.countFullSeats()
if numPlayers > 0:
newbieIds = []
for avId in self.seats:
if avId:
toon = self.air.doId2do.get(avId)
if toon:
if Quests.avatarHasTrolleyQuest(toon):
if not Quests.avatarHasCompletedTrolleyQuest(toon):
newbieIds.append(avId)
playerArray = []
for i in self.seats:
if i not in [None, 0]:
playerArray.append(i)
mgDict = MinigameCreatorAI.createMinigame(
self.air, playerArray, self.zoneId, newbieIds=newbieIds)
minigameZone = mgDict['minigameZone']
minigameId = mgDict['minigameId']
for seatIndex in xrange(len(self.seats)):
avId = self.seats[seatIndex]
if avId:
self.sendUpdateToAvatarId(avId, 'setMinigameZone', [minigameZone, minigameId])
self.clearFullNow(seatIndex)
else:
self.notify.warning('The trolley left, but was empty.')
self.enter()
示例3: enter
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def enter(self):
doneStatus = {}
questHistory = base.localAvatar.getQuestHistory()
imgScale = 0.5
if questHistory != [] and questHistory != [1000] and questHistory != [101, 110]:
doneStatus['mode'] = 'complete'
messenger.send(self.doneEvent, [doneStatus])
elif len(base.localAvatar.quests) > 1 or len(base.localAvatar.quests) == 0:
doneStatus['mode'] = 'complete'
messenger.send(self.doneEvent, [doneStatus])
elif base.localAvatar.quests[0][0] != Quests.TROLLEY_QUEST_ID:
doneStatus['mode'] = 'complete'
messenger.send(self.doneEvent, [doneStatus])
else:
base.localAvatar.b_setAnimState('neutral', 1)
doneStatus['mode'] = 'incomplete'
self.doneStatus = doneStatus
imageModel = loader.loadModel('phase_4/models/gui/tfa_images')
if Quests.avatarHasTrolleyQuest(base.localAvatar):
if base.localAvatar.quests[0][4] != 0:
imgNodePath = imageModel.find('**/hq-dialog-image')
imgPos = (0, 0, -0.02)
msg = TTLocalizer.NPCForceAcknowledgeMessage2
else:
imgNodePath = imageModel.find('**/trolley-dialog-image')
imgPos = (0, 0, 0.04)
msg = TTLocalizer.NPCForceAcknowledgeMessage
self.dialog = TTDialog.TTDialog(text=msg, command=self.handleOk, style=TTDialog.Acknowledge)
imgLabel = DirectLabel.DirectLabel(parent=self.dialog, relief=None, pos=imgPos, scale=TTLocalizer.NPCFimgLabel, image=imgNodePath, image_scale=imgScale)
return
示例4: trolleyLeft
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def trolleyLeft(self):
numPlayers = self.countFullSeats()
if numPlayers > 0:
newbieIds = []
for avId in self.seats:
if avId:
toon = self.air.doId2do.get(avId)
if toon:
if Quests.avatarHasTrolleyQuest(toon):
if not Quests.avatarHasCompletedTrolleyQuest(toon):
newbieIds.append(avId)
playerArray = []
for i in self.seats:
if i not in [None, 0]:
playerArray.append(i)
startingVotes = None
metagameRound = -1
trolleyGoesToMetagame = simbase.config.GetBool('trolley-goes-to-metagame', 0)
trolleyHoliday = bboard.get(TrolleyHolidayMgrAI.TrolleyHolidayMgrAI.PostName)
trolleyWeekend = bboard.get(TrolleyWeekendMgrAI.TrolleyWeekendMgrAI.PostName)
if trolleyGoesToMetagame or trolleyHoliday or trolleyWeekend:
metagameRound = 0
if simbase.config.GetBool('metagame-min-2-players', 1) and len(playerArray) == 1:
metagameRound = -1
mgDict = MinigameCreatorAI.createMinigame(self.air, playerArray, self.zoneId, newbieIds=newbieIds, startingVotes=startingVotes, metagameRound=metagameRound)
minigameZone = mgDict['minigameZone']
minigameId = mgDict['minigameId']
for seatIndex in range(len(self.seats)):
avId = self.seats[seatIndex]
if avId:
self.sendUpdateToAvatarId(avId, 'setMinigameZone', [minigameZone, minigameId])
self.clearFullNow(seatIndex)
else:
self.notify.warning('The trolley left, but was empty.')
self.enter()
return
示例5: trolleyLeft
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def trolleyLeft(self):
numPlayers = self.countFullSeats()
if numPlayers > 0:
newbieIds = []
for avId in self.seats:
if avId:
toon = self.air.doId2do.get(avId)
if toon:
if Quests.avatarHasTrolleyQuest(toon):
if not Quests.avatarHasCompletedTrolleyQuest(toon):
newbieIds.append(avId)
playerArray = []
for i in self.seats:
if i not in [None, 0]:
playerArray.append(i)
startingVotes = None
metagameRound = -1
trolleyGoesToMetagame = simbase.config.GetBool('want-travel-game', 0)
trolleyHoliday = simbase.air.holidayManager.isHolidayRunning(TROLLEY_HOLIDAY) or\
simbase.air.holidayManager.isHolidayRunning(SILLY_SATURDAY_TROLLEY)
trolleyWeekend = simbase.air.holidayManager.isHolidayRunning(TROLLEY_WEEKEND)
if trolleyGoesToMetagame and (trolleyHoliday or trolleyWeekend):
metagameRound = 0
if len(playerArray) == 1:
metagameRound = -1
mgDict = MinigameCreatorAI.createMinigame(
self.air, playerArray, self.zoneId, newbieIds=newbieIds,
startingVotes=startingVotes, metagameRound=metagameRound)
minigameZone = mgDict['minigameZone']
minigameId = mgDict['minigameId']
for seatIndex in xrange(len(self.seats)):
avId = self.seats[seatIndex]
if avId:
self.sendUpdateToAvatarId(avId, 'setMinigameZone', [minigameZone, minigameId])
self.clearFullNow(seatIndex)
else:
self.notify.warning('The trolley left, but was empty.')
self.enter()
示例6: enterTeleportIn
# 需要导入模块: from toontown.quest import Quests [as 别名]
# 或者: from toontown.quest.Quests import avatarHasTrolleyQuest [as 别名]
def enterTeleportIn(self, requestStatus):
imgScale = 0.25
if self.dialog:
x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
elif base.localAvatar.hp < 1:
requestStatus['nextState'] = 'popup'
x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
self.accept('deathAck', self.__handleDeathAck, extraArgs=[requestStatus])
self.deathAckBox = DeathForceAcknowledge.DeathForceAcknowledge(doneEvent='deathAck')
elif base.localAvatar.hp > 0 and (Quests.avatarHasTrolleyQuest(base.localAvatar) or Quests.avatarHasFirstCogQuest(base.localAvatar) or Quests.avatarHasFriendQuest(base.localAvatar) or Quests.avatarHasPhoneQuest(base.localAvatar) and Quests.avatarHasCompletedPhoneQuest(base.localAvatar)) and self.loader.hood.id == ToontownGlobals.ToontownCentral:
requestStatus['nextState'] = 'popup'
imageModel = loader.loadModel('phase_4/models/gui/tfa_images')
if base.localAvatar.quests[0][0] == Quests.TROLLEY_QUEST_ID:
if not Quests.avatarHasCompletedTrolleyQuest(base.localAvatar):
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralInitialDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage3
imgNodePath = imageModel.find('**/trolley-dialog-image')
imgPos = (0, 0, 0.04)
imgScale = 0.5
else:
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage4
imgNodePath = imageModel.find('**/hq-dialog-image')
imgPos = (0, 0, -0.02)
imgScale = 0.5
elif base.localAvatar.quests[0][0] == Quests.FIRST_COG_QUEST_ID:
if not Quests.avatarHasCompletedFirstCogQuest(base.localAvatar):
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralTunnelDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage5
imgNodePath = imageModel.find('**/tunnelSignA')
imgPos = (0, 0, 0.04)
imgScale = 0.5
else:
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage6
imgNodePath = imageModel.find('**/hq-dialog-image')
imgPos = (0, 0, 0.05)
imgScale = 0.5
elif base.localAvatar.quests[0][0] == Quests.FRIEND_QUEST_ID:
if not Quests.avatarHasCompletedFriendQuest(base.localAvatar):
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralInitialDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage7
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
imgNodePath = gui.find('**/FriendsBox_Closed')
imgPos = (0, 0, 0.04)
imgScale = 1.0
gui.removeNode()
else:
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage8
imgNodePath = imageModel.find('**/hq-dialog-image')
imgPos = (0, 0, 0.05)
imgScale = 0.5
elif base.localAvatar.quests[0][0] == Quests.PHONE_QUEST_ID:
if Quests.avatarHasCompletedPhoneQuest(base.localAvatar):
x, y, z, h, p, r = base.cr.hoodMgr.getDropPoint(base.cr.hoodMgr.ToontownCentralHQDropPoints)
msg = TTLocalizer.NPCForceAcknowledgeMessage9
imgNodePath = imageModel.find('**/hq-dialog-image')
imgPos = (0, 0, 0.05)
imgScale = 0.5
self.dialog = TTDialog.TTDialog(text=msg, command=self.__cleanupDialog, style=TTDialog.Acknowledge)
imgLabel = DirectLabel.DirectLabel(parent=self.dialog, relief=None, pos=imgPos, scale=TTLocalizer.PimgLabel, image=imgNodePath, image_scale=imgScale)
imageModel.removeNode()
else:
requestStatus['nextState'] = 'walk'
x, y, z, h, p, r = base.cr.hoodMgr.getPlaygroundCenterFromId(self.loader.hood.id)
base.localAvatar.detachNode()
base.localAvatar.setPosHpr(render, x, y, z, h, p, r)
Place.Place.enterTeleportIn(self, requestStatus)
return