本文整理汇总了Python中toontown.toonbase.ToontownGlobals.cogHQZoneId2deptIndex方法的典型用法代码示例。如果您正苦于以下问题:Python ToontownGlobals.cogHQZoneId2deptIndex方法的具体用法?Python ToontownGlobals.cogHQZoneId2deptIndex怎么用?Python ToontownGlobals.cogHQZoneId2deptIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toonbase.ToontownGlobals
的用法示例。
在下文中一共展示了ToontownGlobals.cogHQZoneId2deptIndex方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setFromAvatar
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def setFromAvatar(self, av):
rewardIds = []
for q in av.quests:
questId, fromNpcId, toNpcId, rewardId, toonProgress = q
if rewardId == Quests.NA:
rewardId = Quests.getFinalRewardId(questId, fAll=1)
rewardIds.append(rewardId)
self.notify.debug('Ignoring rewards: %s' % rewardIds)
self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
self.notify.debug('Adding %s hp for fish collection' % fishHp)
self.maxHp += fishHp
flowerHp = int(len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
self.notify.debug('Adding %s hp for fish collection' % flowerHp)
self.maxHp += flowerHp
HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.SellbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.LawbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.CashbotHQ))
levels = av.getCogLevels()
cogTypes = av.getCogTypes()
suitHp = 0
for dept in HQdepts:
suitHp += levels[dept]
self.notify.debug('Adding %s hp for cog suits' % suitHp)
self.maxHp += suitHp
kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
self.maxHp += kartingHp
golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
self.notify.debug('Adding %s hp for golf trophies' % golfHp)
self.maxHp += golfHp
示例2: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0,
0,
0,
0]
amount = ToontownGlobals.StageNoticeRewards[self.level.stageId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.stageId)
extraMerits[index] = amount
for toon in toons:
mult = 1.0
meritArray = self.air.promotionMgr.recoverMerits(toon, [], self.getTaskZoneId(), mult, extraMerits=extraMerits)
if toon.doId in self.helpfulToons:
self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
else:
self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
for floorNum, cogsThisFloor in enumerate(self.suitsKilledPerFloor):
self.notify.info('merits for floor %s' % floorNum)
for toon in toons:
recovered, notRecovered = self.air.questManager.recoverItems(toon, cogsThisFloor, self.getTaskZoneId())
self.toonItems[toon.doId][0].extend(recovered)
self.toonItems[toon.doId][1].extend(notRecovered)
meritArray = self.air.promotionMgr.recoverMerits(toon, cogsThisFloor, self.getTaskZoneId(), getStageCreditMultiplier(floorNum))
self.notify.info('toon %s: %s' % (toon.doId, meritArray))
if toon.doId in self.helpfulToons:
self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
else:
self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
示例3: checkBoard
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def checkBoard(self, av):
dept = ToontownGlobals.cogHQZoneId2deptIndex(self.zone)
if av.hp < self.minLaff:
return REJECT_MINLAFF
if not av.readyForPromotion(dept):
return REJECT_PROMOTION
return 0
示例4: initToonState
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def initToonState(self):
self.setAnimState('neutral', 0.9, None, None)
self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId), rental=True)
if self.name in NPCToons.LaffRestockPositions:
pos = NPCToons.LaffRestockPositions[self.name]
self.setPos(*pos[0])
self.setH(pos[1])
示例5: __init__
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def __init__(self, air, bldg, mintId, antiShuffle=0, minLaff=0):
DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(
self, air, bldg, antiShuffle=antiShuffle, minLaff=minLaff
)
self.mintId = mintId
self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId)
self.type = ELEVATOR_MINT
self.countdownTime = ElevatorData[self.type]["countdown"]
示例6: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0,
0,
0,
0]
amount = ToontownGlobals.MintCogBuckRewards[self.level.mintId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.mintId)
extraMerits[index] = amount
'''for toon in toons:
示例7: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0, 0, 0, 0]
amount = ToontownGlobals.MintCogBuckRewards[self.level.mintId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.mintId)
extraMerits[index] = amount
for toon in toons:
recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId())
self.toonItems[toon.doId][0].extend(recovered)
self.toonItems[toon.doId][1].extend(notRecovered)
meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getMintCreditMultiplier(self.getTaskZoneId()), extraMerits=extraMerits)
if toon.doId in self.helpfulToons:
self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
else:
self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
示例8: requestExit
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def requestExit(self):
avatarID = self.air.getAvatarIdFromSender()
if self.avatarsWhoAreEntering.has_key(avatarID):
del self.avatarsWhoAreEntering[avatarID]
if not self.avatarsWhoAreExiting.has_key(avatarID):
dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
self.avatarsWhoAreExiting[avatarID] = 1
self.sendUpdate('avatarExit', [avatarID])
self.openDoor(self.exitDoorFSM)
if self.lockedDoor:
av = self.air.doId2do[avatarID]
if self.doorType == DoorTypes.EXT_COGHQ:
av.b_setCogIndex(-1)
else:
av.b_setCogIndex(dept)
示例9: requestEnter
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def requestEnter(self):
avId = self.air.getAvatarIdFromSender()
dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
av = self.air.doId2do.get(avId)
if av:
if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
parts = av.getCogParts()
if CogDisguiseGlobals.isSuitComplete(parts, dept):
allowed = 1
else:
allowed = 0
else:
allowed = 1
if not allowed:
self.sendReject(avId, self.isLockedDoor())
else:
print("********\nRequesting Lobby GUI...\n********")
self.sendUpdate('selectLobby', [avId])
示例10: requestEnter
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def requestEnter(self):
avatarID = self.air.getAvatarIdFromSender()
dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
av = self.air.doId2do.get(avatarID)
if av:
if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
parts = av.getCogParts()
if CogDisguiseGlobals.isSuitComplete(parts, dept):
allowed = 1
else:
allowed = 0
else:
allowed = 1
if not allowed:
self.sendReject(avatarID, self.isLockedDoor())
else:
self.enqueueAvatarIdEnter(avatarID)
self.sendUpdateToAvatarId(avatarID, 'setOtherZoneIdAndDoId', [self.destinationZone, self.otherDoor.getDoId()])
示例11: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0, 0, 0, 0]
amount = ToontownGlobals.StageNoticeRewards[self.level.stageId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.stageId)
extraMerits[index] = amount
for toon in toons:
recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId())
self.toonItems[toon.doId][0].extend(recovered)
self.toonItems[toon.doId][1].extend(notRecovered)
meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getStageCreditMultiplier(self.level.getFloorNum()), extraMerits=extraMerits)
if toon.doId in self.helpfulToons:
self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
else:
self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
if self.bossBattle:
self.toonParts[toon.doId] = self.air.cogSuitMgr.recoverPart(
toon, 'fullSuit', self.suitTrack,
self.getTaskZoneId(), toons)
self.notify.debug('toonParts = %s' % self.toonParts)
示例12: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0, 0, 0, 0]
amount = ToontownGlobals.CountryClubCogBuckRewards[self.level.countryClubId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.countryClubId)
extraMerits[index] = amount
示例13: handleToonsWon
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def handleToonsWon(self, toons):
extraMerits = [0, 0, 0, 0]
amount = ToontownGlobals.StageNoticeRewards[self.level.stageId]
index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.stageId)
extraMerits[index] = amount
示例14: __init__
# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import cogHQZoneId2deptIndex [as 别名]
def __init__(self, air, bldg, mintId):
DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg)
self.mintId = mintId
self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId)
self.type = ELEVATOR_MINT
self.countdownTime = ElevatorData[self.type]['countdown']