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


Python ToontownBattleGlobals.getInvasionMultiplier方法代码示例

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


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

示例1: setInvasionStatus

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
 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,代码行数:37,代码来源:NewsManager.py

示例2: startInvasion

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
 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,代码行数:12,代码来源:DistributedSuitInvasionManager.py

示例3: setCurrentInvasion

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
 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,代码行数:19,代码来源:DistributedSuitInvasionManager.py

示例4: setInvasionStatus

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
 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,代码行数:44,代码来源:NewsManager.py

示例5: setInvasionStatus

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
    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,代码行数:86,代码来源:NewsManager.py

示例6: setInvasionStatus

# 需要导入模块: from toontown.toonbase import ToontownBattleGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier [as 别名]
    def setInvasionStatus(self, msgType, suitType, remaining, flags):
        if msgType not in ToontownGlobals.SuitInvasions:
            return

        if suitType in SuitDNA.suitHeadTypes:
            attributes = SuitBattleGlobals.SuitAttributes[suitType]
            suitNames = {'singular': attributes['name'], 'plural': attributes['pluralname']}
        elif suitType in SuitDNA.suitDepts:
            suitNames = {'singular': SuitDNA.getDeptFullname(suitType), 'plural': SuitDNA.getDeptFullnameP(suitType)}
        else:
            return

        track = Sequence()
        base.localAvatar.inventory.setInvasionCreditMultiplier(1 if msgType in ToontownGlobals.EndingInvasions else ToontownBattleGlobals.getInvasionMultiplier())

        for i, message in enumerate(ToontownGlobals.SuitInvasions[msgType]):
            track.append(Wait(5 if i else 1))
            track.append(Func(base.localAvatar.setSystemMessage, 0, (TTLocalizer.SuitInvasionPrefix + message) % suitNames))

        track.start()
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:22,代码来源:NewsManager.py


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