当前位置: 首页>>代码示例>>Python>>正文


Python toonbase.ToontownBattleGlobals类代码示例

本文整理汇总了Python中toontown.toonbase.ToontownBattleGlobals的典型用法代码示例。如果您正苦于以下问题:Python ToontownBattleGlobals类的具体用法?Python ToontownBattleGlobals怎么用?Python ToontownBattleGlobals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ToontownBattleGlobals类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: makeBattle

    def makeBattle(self, bossCogPosHpr, battlePosHpr, roundCallback, finishCallback, battleNumber, battleSide):
        if battleNumber == 1:
            battle = DistributedBattleWaitersAI.DistributedBattleWaitersAI(self.air, self, roundCallback, finishCallback, battleSide)
        else:
            battle = DistributedBattleDinersAI.DistributedBattleDinersAI(self.air, self, roundCallback, finishCallback, battleSide)
        self.setBattlePos(battle, bossCogPosHpr, battlePosHpr)
        battle.suitsKilled = self.suitsKilled
        battle.battleCalc.toonSkillPtsGained = self.toonSkillPtsGained
        battle.toonExp = self.toonExp
        battle.toonOrigQuests = self.toonOrigQuests
        battle.toonItems = self.toonItems
        battle.toonOrigMerits = self.toonOrigMerits
        battle.toonMerits = self.toonMerits
        battle.toonParts = self.toonParts
        battle.helpfulToons = self.helpfulToons
        mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(battleNumber)
        battle.battleCalc.setSkillCreditMultiplier(mult)
        activeSuits = self.activeSuitsA
        if battleSide:
            activeSuits = self.activeSuitsB
        for suit in activeSuits:
            battle.addSuit(suit)

        battle.generateWithRequired(self.zoneId)
        return battle
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:25,代码来源:DistributedBossbotBossAI.py

示例2: enterBattle

 def enterBattle(self, event):
     mult = ToontownBattleGlobals.getCreditMultiplier(self.currentFloor)
     self.townBattle.enter(
         event, self.fsm.getStateNamed('battle'),
         bldg=1, creditMultiplier=mult)
     base.localAvatar.b_setAnimState('off', 1)
     base.localAvatar.cantLeaveGame = 1
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:7,代码来源:SuitInterior.py

示例3: setInvasionStatus

 def setInvasionStatus(self, msgType, cogType, numRemaining, skeleton):
     self.notify.info('setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, skeleton: %s' % (msgType,
      cogType,
      numRemaining,
      skeleton))
     cogName = SuitBattleGlobals.SuitAttributes[cogType]['name']
     cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname']
     if skeleton:
         cogName = TTLocalizer.Skeleton
         cogNameP = TTLocalizer.SkeletonP
     if msgType == ToontownGlobals.SuitInvasionBegin:
         msg1 = TTLocalizer.SuitInvasionBegin1
         msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP
         self.invading = 1
     elif msgType == ToontownGlobals.SuitInvasionUpdate:
         msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining
         msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP
         self.invading = 1
     elif msgType == ToontownGlobals.SuitInvasionEnd:
         msg1 = TTLocalizer.SuitInvasionEnd1 % cogName
         msg2 = TTLocalizer.SuitInvasionEnd2
         self.invading = 0
     elif msgType == ToontownGlobals.SuitInvasionBulletin:
         msg1 = TTLocalizer.SuitInvasionBulletin1
         msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP
         self.invading = 1
     else:
         self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType)
         return
     if self.invading:
         mult = ToontownBattleGlobals.getInvasionMultiplier()
     else:
         mult = 1
     base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
     Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start()
开发者ID:Teku16,项目名称:MikeyTheRepository,代码行数:35,代码来源:NewsManager.py

示例4: enterBattleOne

 def enterBattleOne(self):
     self.cleanupIntervals()
     mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(1)
     localAvatar.inventory.setBattleCreditMultiplier(mult)
     self.toonsToBattlePosition(self.toonsA, self.battleANode)
     self.toonsToBattlePosition(self.toonsB, self.battleBNode)
     self.releaseToons()
     base.playMusic(self.battleOneMusic, looping=1, volume=0.9)
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:8,代码来源:DistributedBossCog.py

示例5: enterElevator

 def enterElevator(self, ts = 0):
     self.currentFloor += 1
     self.cr.playGame.getPlace().currentFloor = self.currentFloor
     self.setElevatorLights(self.elevatorModelIn)
     self.setElevatorLights(self.elevatorModelOut)
     self.__playElevator(ts, self.elevatorName, self.__handleElevatorDone)
     mult = ToontownBattleGlobals.getCreditMultiplier(self.currentFloor)
     base.localAvatar.inventory.setBattleCreditMultiplier(mult)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:8,代码来源:DistributedSuitInterior.py

示例6: enterBattle

 def enterBattle(self, event):
     mult = 1
     if self.bossCog:
         mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(self.bossCog.battleNumber)
     self.townBattle.enter(event, self.fsm.getStateNamed('battle'), bldg=1, creditMultiplier=mult)
     base.localAvatar.b_setAnimState('off', 1)
     base.localAvatar.setTeleportAvailable(0)
     base.localAvatar.cantLeaveGame = 1
开发者ID:nate97,项目名称:src,代码行数:8,代码来源:CogHQBossBattle.py

示例7: startInvasion

 def startInvasion(self, suitName, skel, waiter, startTime, duration):            
     self.startTime = globalClockDelta.networkToLocalTime(startTime, bits = 32)
     
     self.notify.info("New invasion! Duration: %s" % duration)
     
     self._name, msgs = self.formatInvasionMessage(suitName, skel, waiter, self.__formatBegin)
     self.displayMsgs(msgs)
     
     mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1)
     base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:10,代码来源:DistributedSuitInvasionManager.py

示例8: enterElevator

 def enterElevator(self, ts = 0):
     if not self._CogdoGameRepeat:
         self.currentFloor += 1
     self.cr.playGame.getPlace().currentFloor = self.currentFloor
     self.setElevatorLights(self.elevatorModelIn)
     self.setElevatorLights(self.elevatorModelOut)
     if not self.isBossFloor(self.currentFloor):
         self.elevatorModelOut.detachNode()
         messenger.send('sellbotFieldOfficeChanged', [True])
     else:
         self._movie = CogdoElevatorMovie()
         self._movie.load()
         self._movie.play()
     self.__playElevator(ts, self.elevatorName, self.__handleElevatorDone)
     mult = ToontownBattleGlobals.getCreditMultiplier(self.currentFloor)
     base.localAvatar.inventory.setBattleCreditMultiplier(mult)
开发者ID:Keithybub,项目名称:ToonTownReviveOld,代码行数:16,代码来源:DistributedCogdoInterior.py

示例9: setCurrentInvasion

 def setCurrentInvasion(self, suitName, skel, waiter, startTime, duration):
     if duration == 0:
         self.notify.info('duration 0')
         return
         
     self.startTime = globalClockDelta.networkToLocalTime(startTime, bits = 32)
     elapsed = globalClock.getRealTime() - self.startTime
     remaining = duration - elapsed
     
     self.notify.info("Invasion in progress! Remaining time: %s" % remaining)
     
     mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1)
     base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
     
     if not self.__announced:
         self._name, msgs = self.formatInvasionMessage(suitName, skel, False, self.__formatProgress)
         self.displayMsgs(msgs)
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:17,代码来源:DistributedSuitInvasionManager.py

示例10: setInvasionStatus

 def setInvasionStatus(self, msgType, cogType, numRemaining, specialSuit):
     self.notify.info('setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, specialSuit: %s' % (msgType,
      cogType,
      numRemaining,
      specialSuit))
     # Determine if we are spawning a special type of suit. 1 is Skelecog, 2 is v2.0.
     # If they are a Skelecog or v2.0 cog, we need to change the Cog name.
     if specialSuit == 1:
         cogName = TTLocalizer.Skeleton
         cogNameP = TTLocalizer.SkeletonP
     elif specialSuit == 2:
         cogName = TTLocalizer.SkeleReviveCogName % {'cog_name':SuitBattleGlobals.SuitAttributes[cogType]['name']}
         cogNameP = TTLocalizer.SkeleReviveCogName % {'cog_name':SuitBattleGlobals.SuitAttributes[cogType]['pluralname']}
     else:
         cogName = SuitBattleGlobals.SuitAttributes[cogType]['name']
         cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname']
     # Figure out the message type to send
     if msgType == ToontownGlobals.SuitInvasionBegin:
         msg1 = TTLocalizer.SuitInvasionBegin1
         msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP
         self.invading = 1
     elif msgType == ToontownGlobals.SuitInvasionUpdate:
         msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining
         msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP
         self.invading = 1
     elif msgType == ToontownGlobals.SuitInvasionEnd:
         msg1 = TTLocalizer.SuitInvasionEnd1 % cogName
         msg2 = TTLocalizer.SuitInvasionEnd2
         self.invading = 0
     elif msgType == ToontownGlobals.SuitInvasionBulletin:
         msg1 = TTLocalizer.SuitInvasionBulletin1
         msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP
         self.invading = 1
     else:
         self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType)
         return
     if self.invading:
         mult = ToontownBattleGlobals.getInvasionMultiplier()
     else:
         mult = 1
     base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
     Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start()
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:42,代码来源:NewsManager.py

示例11: getToonUberStatus

def getToonUberStatus(toons, numToons):
    fieldList = []
    uberIndex = ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1
    for toonId in toons:
        toonList = []
        toon = simbase.air.doId2do.get(toonId)
        if toon == None:
            fieldList.append(-1)
        else:
            for trackIndex in range(ToontownBattleGlobals.MAX_TRACK_INDEX + 1):
                toonList.append(toon.inventory.numItem(trackIndex, uberIndex))

            fieldList.append(ToontownBattleGlobals.encodeUber(toonList))

    lenDif = numToons - len(toons)
    if lenDif > 0:
        for index in range(lenDif):
            fieldList.append(-1)

    return fieldList
开发者ID:OldToontown,项目名称:OldToontown,代码行数:20,代码来源:BattleExperienceAI.py

示例12: enterBattleTwo

	def enterBattleTwo(self):
		self.cleanupIntervals()
		mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(2)
		localAvatar.inventory.setBattleCreditMultiplier(mult)
		self.reparentTo(render)
		self.setPosHpr(*ToontownGlobals.SellbotBossBattleTwoPosHpr)
		self.clearChat()
		self.cagedToon.clearChat()
		self.rampA.request('retract')
		self.rampB.request('retract')
		self.rampC.request('retract')
		self.releaseToons()
		self.toonsToBattlePosition(self.toonsA, self.battleANode)
		self.toonsToBattlePosition(self.toonsB, self.battleBNode)
		if self.battleA is None or self.battleB is None:
			cageIndex = 3
		else:
			cageIndex = 2
		self.setCageIndex(cageIndex)
		base.playMusic(self.battleTwoMusic, looping=1, volume=0.9)
		return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:21,代码来源:DistributedSellbotBoss.py

示例13: getBattleCreditMultiplier

 def getBattleCreditMultiplier(self):
     return ToontownBattleGlobals.getMintCreditMultiplier(self.mintId)
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:2,代码来源:DistributedMintRoomAI.py

示例14: getBattleCreditMultiplier

 def getBattleCreditMultiplier(self):
     return ToontownBattleGlobals.getFactoryCreditMultiplier(self.factoryId)
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:2,代码来源:DistributedFactoryAI.py

示例15: getExpTrack

    def getExpTrack(self, toon, origExp, earnedExp, deathList, origQuestsList, itemList, missedItemList, origMeritList, meritList, partList, toonList, uberEntry, helpfulToonsList, noSkip = False):
        track = Sequence(Func(self.initGagFrame, toon, origExp, origMeritList, noSkip=noSkip), Wait(1.0))
        endTracks = [0,
         0,
         0,
         0,
         0,
         0,
         0]
        trackEnded = 0
        for trackIndex in xrange(len(earnedExp)):
            if earnedExp[trackIndex] > 0 or origExp[trackIndex] >= ToontownBattleGlobals.MaxSkill:
                track += self.getTrackIntervalList(toon, trackIndex, origExp[trackIndex], earnedExp[trackIndex], ToontownBattleGlobals.getUberFlagSafe(uberEntry, trackIndex))
                maxExp = ToontownBattleGlobals.MaxSkill - ToontownBattleGlobals.UberSkill
                if origExp[trackIndex] < maxExp and earnedExp[trackIndex] + origExp[trackIndex] >= maxExp:
                    endTracks[trackIndex] = 1
                    trackEnded = 1

        for dept in xrange(len(SuitDNA.suitDepts)):
            if meritList[dept]:
                track += self.getMeritIntervalList(toon, dept, origMeritList[dept], meritList[dept])

        track.append(Wait(0.75))
        itemInterval = self.getItemIntervalList(toon, itemList)
        if itemInterval:
            track.append(Func(self.initItemFrame, toon))
            track.append(Wait(0.25))
            track += itemInterval
            track.append(Wait(0.5))
        missedItemInterval = self.getMissedItemIntervalList(toon, missedItemList)
        if missedItemInterval:
            track.append(Func(self.initMissedItemFrame, toon))
            track.append(Wait(0.25))
            track += missedItemInterval
            track.append(Wait(0.5))
        self.notify.debug('partList = %s' % partList)
        newPart = 0
        for part in partList:
            if part != 0:
                newPart = 1
                break

        if newPart:
            partList = self.getCogPartIntervalList(toon, partList)
            if partList:
                track.append(Func(self.initCogPartFrame, toon))
                track.append(Wait(0.25))
                track += partList
                track.append(Wait(0.5))
        questList = self.getQuestIntervalList(toon, deathList, toonList, origQuestsList, itemList, helpfulToonsList)
        if questList:
            avQuests = []
            for i in xrange(0, len(origQuestsList), 5):
                avQuests.append(origQuestsList[i:i + 5])

            track.append(Func(self.initQuestFrame, toon, copy.deepcopy(avQuests)))
            track.append(Wait(0.25))
            track += questList
            track.append(Wait(0.5))
        track.append(Wait(0.25))
        if trackEnded:
            track.append(Func(self.vanishFrames))
            track.append(Fanfare.makeFanfare(0, toon)[0])
            for i in xrange(len(endTracks)):
                if endTracks[i] is 1:
                    track += self.getEndTrackIntervalList(toon, toonList, i)

            track.append(Func(self.cleanupEndTrack))
        return track
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:69,代码来源:RewardPanel.py


注:本文中的toontown.toonbase.ToontownBattleGlobals类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。