• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python toonbase.ToontownBattleGlobals类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: velvetRoped

 def velvetRoped(self):
     return not base.cr.isPaid() and ToontownBattleGlobals.gagIsPaidOnly(self.gagTrack, self.gagLevel)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:2,代码来源:DistributedGagTree.py


示例17: setInvasionStatus

    def setInvasionStatus(self, msgType, suitType, remaining, flags):
        if suitType in SuitDNA.suitHeadTypes:
            suitName = SuitBattleGlobals.SuitAttributes[suitType]['name']
            suitNamePlural = SuitBattleGlobals.SuitAttributes[suitType]['pluralname']
        elif suitType in SuitDNA.suitDepts:
            suitName = SuitDNA.getDeptFullname(suitType)
            suitNamePlural = SuitDNA.getDeptFullnameP(suitType)

        messages = []

        if msgType == ToontownGlobals.SuitInvasionBegin:
            messages.append(TTLocalizer.SuitInvasionBegin1)
            messages.append(TTLocalizer.SuitInvasionBegin2 % suitNamePlural)
            self.invading = 1
        elif msgType == ToontownGlobals.SuitInvasionEnd:
            messages.append(TTLocalizer.SuitInvasionEnd1 % suitName)
            messages.append(TTLocalizer.SuitInvasionEnd2)
            self.invading = 0
        elif msgType == ToontownGlobals.SuitInvasionUpdate:
            messages.append(TTLocalizer.SuitInvasionUpdate1)
            messages.append(TTLocalizer.SuitInvasionUpdate2)
            self.invading = 1
        elif msgType == ToontownGlobals.SuitInvasionBulletin:
            messages.append(TTLocalizer.SuitInvasionBulletin1)
            messages.append(TTLocalizer.SuitInvasionBulletin2 % suitNamePlural)
            self.invading = 1
        elif msgType == ToontownGlobals.SkelecogInvasionBegin:
            messages.append(TTLocalizer.SkelecogInvasionBegin1)
            messages.append(TTLocalizer.SkelecogInvasionBegin2)
            messages.append(TTLocalizer.SkelecogInvasionBegin3)
            self.invading = 1
        elif msgType == ToontownGlobals.SkelecogInvasionEnd:
            messages.append(TTLocalizer.SkelecogInvasionEnd1)
            messages.append(TTLocalizer.SkelecogInvasionEnd2)
            self.invading = 0
        elif msgType == ToontownGlobals.SkelecogInvasionBulletin:
            messages.append(TTLocalizer.SkelecogInvasionBulletin1)
            messages.append(TTLocalizer.SkelecogInvasionBulletin2)
            messages.append(TTLocalizer.SkelecogInvasionBulletin3)
            self.invading = 1
        elif msgType == ToontownGlobals.WaiterInvasionBegin:
            messages.append(TTLocalizer.WaiterInvasionBegin1)
            messages.append(TTLocalizer.WaiterInvasionBegin2)
            self.invading = 1
        elif msgType == ToontownGlobals.WaiterInvasionEnd:
            messages.append(TTLocalizer.WaiterInvasionEnd1)
            messages.append(TTLocalizer.WaiterInvasionEnd2)
            self.invading = 0
        elif msgType == ToontownGlobals.WaiterInvasionBulletin:
            messages.append(TTLocalizer.WaiterInvasionBulletin1)
            messages.append(TTLocalizer.WaiterInvasionBulletin2)
            messages.append(TTLocalizer.WaiterInvasionBulletin3)
            self.invading = 1
        elif msgType == ToontownGlobals.V2InvasionBegin:
            messages.append(TTLocalizer.V2InvasionBegin1)
            messages.append(TTLocalizer.V2InvasionBegin2)
            messages.append(TTLocalizer.V2InvasionBegin3)
            self.invading = 1
        elif msgType == ToontownGlobals.V2InvasionEnd:
            messages.append(TTLocalizer.V2InvasionEnd1)
            messages.append(TTLocalizer.V2InvasionEnd2)
            self.invading = 0
        elif msgType == ToontownGlobals.V2InvasionBulletin:
            messages.append(TTLocalizer.V2InvasionBulletin1)
            messages.append(TTLocalizer.V2InvasionBulletin2)
            messages.append(TTLocalizer.V2InvasionBulletin3)
            self.invading = 1
        else:
            self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType)
            return

        multiplier = 1
        if self.invading:
            multiplier = ToontownBattleGlobals.getInvasionMultiplier()
        base.localAvatar.inventory.setInvasionCreditMultiplier(multiplier)

        track = Sequence(name='newsManagerWait', autoPause=1)
        for i, message in enumerate(messages):
            if i == 0:
                track.append(Wait(1))
            else:
                track.append(Wait(5))
            track.append(Func(base.localAvatar.setSystemMessage, 0, message))
        track.start()
开发者ID:v1tal,项目名称:Toontown-Pulse,代码行数:84,代码来源:NewsManager.py


示例18: enterTownBattle

 def enterTownBattle(self, event):
     mult = ToontownBattleGlobals.getStageCreditMultiplier(bboard.get(DistributedStage.DistributedStage.FloorNum))
     base.localAvatar.inventory.setBattleCreditMultiplier(mult)
     self.loader.townBattle.enter(event, self.fsm.getStateNamed("battle"), bldg=1, creditMultiplier=mult)
开发者ID:GangStarrG,项目名称:src,代码行数:4,代码来源:StageInterior.py


示例19: getBattleCreditMultiplier

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


示例20: getBattleCreditMultiplier

 def getBattleCreditMultiplier(self):
     return ToontownBattleGlobals.getCountryClubCreditMultiplier(self.countryClubId)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedCountryClubRoomAI.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python toonbase.ToontownGlobals类代码示例发布时间:2022-05-27
下一篇:
Python toonbase.TTLocalizer类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap