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


Python CogDisguiseGlobals.dept2deptIndex方法代码示例

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


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

示例1: __init__

# 需要导入模块: from toontown.coghq import CogDisguiseGlobals [as 别名]
# 或者: from toontown.coghq.CogDisguiseGlobals import dept2deptIndex [as 别名]
    def __init__(self, cogMenu, dept):
        NodePath.__init__(self, 'CogMenuBar-%s' % dept)

        self.dept = dept
        self.deptIndex = CogDisguiseGlobals.dept2deptIndex(self.dept)

        icons = loader.loadModel('phase_3/models/gui/cog_icons')
        self.icon = icons.find(ICON_NODES[self.deptIndex]).copyTo(self)
        self.icon.setColor(ICON_COLORS[self.deptIndex])
        self.icon.setScale(0.07)
        self.icon.setX(-0.25)
        icons.removeNode()

        self.progressBar = DirectWaitBar(parent=self, relief=DirectGuiGlobals.SUNKEN,
                                         frameSize=(-1, 1, -0.15, 0.15),
                                         borderWidth=(0.02, 0.02),
                                         scale=0.20,
                                         frameColor=(DisguisePage.DeptColors[self.deptIndex][0] * 0.7,
                                                     DisguisePage.DeptColors[self.deptIndex][1] * 0.7,
                                                     DisguisePage.DeptColors[self.deptIndex][2] * 0.7,
                                                     1),
                                         barColor=(DisguisePage.DeptColors[self.deptIndex][0],
                                                   DisguisePage.DeptColors[self.deptIndex][1],
                                                   DisguisePage.DeptColors[self.deptIndex][2],
                                                   1),
                                         text='0/0 ' + TTLocalizer.RewardPanelMeritBarLabels[self.deptIndex],
                                         text_scale=TTLocalizer.RPmeritBarLabels, text_fg=(0, 0, 0, 1),
                                         text_align=TextNode.ALeft, text_pos=(-0.96, -0.05))

        self.reparentTo(cogMenu)
开发者ID:NostalgicTTR,项目名称:Toontown-Infinite-2016-Leak,代码行数:32,代码来源:CogMenuBar.py

示例2: __talkAboutPromotion

# 需要导入模块: from toontown.coghq import CogDisguiseGlobals [as 别名]
# 或者: from toontown.coghq.CogDisguiseGlobals import dept2deptIndex [as 别名]
 def __talkAboutPromotion(self, speech):
     if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
         newCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
         if newCogSuitLevel == ToontownGlobals.MaxCogSuitLevel:
             speech += TTLocalizer.ResistanceToonLastPromotion % (ToontownGlobals.MaxCogSuitLevel + 1)
         if newCogSuitLevel in ToontownGlobals.CogSuitHPLevels:
             speech += TTLocalizer.ResistanceToonHPBoost
     else:
         speech += TTLocalizer.ResistanceToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
     return speech
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:12,代码来源:DistributedCashbotBoss.py

示例3: announceGenerate

# 需要导入模块: from toontown.coghq import CogDisguiseGlobals [as 别名]
# 或者: from toontown.coghq.CogDisguiseGlobals import dept2deptIndex [as 别名]
 def announceGenerate(self):
     DistributedAvatar.DistributedAvatar.announceGenerate(self)
     self.prevCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
     nearBubble = CollisionSphere(0, 0, 0, 50)
     nearBubble.setTangible(0)
     nearBubbleNode = CollisionNode('NearBoss')
     nearBubbleNode.setCollideMask(ToontownGlobals.WallBitmask)
     nearBubbleNode.addSolid(nearBubble)
     self.attachNewNode(nearBubbleNode)
     self.accept('enterNearBoss', self.avatarNearEnter)
     self.accept('exitNearBoss', self.avatarNearExit)
     self.collNode.removeSolid(0)
     tube1 = CollisionTube(6.5, -7.5, 2, 6.5, 7.5, 2, 2.5)
     tube2 = CollisionTube(-6.5, -7.5, 2, -6.5, 7.5, 2, 2.5)
     roof = CollisionPolygon(Point3(-4.4, 7.1, 5.5), Point3(-4.4, -7.1, 5.5), Point3(4.4, -7.1, 5.5), Point3(4.4, 7.1, 5.5))
     side1 = CollisionPolygon(Point3(-4.4, -7.1, 5.5), Point3(-4.4, 7.1, 5.5), Point3(-4.4, 7.1, 0), Point3(-4.4, -7.1, 0))
     side2 = CollisionPolygon(Point3(4.4, 7.1, 5.5), Point3(4.4, -7.1, 5.5), Point3(4.4, -7.1, 0), Point3(4.4, 7.1, 0))
     front1 = CollisionPolygon(Point3(4.4, -7.1, 5.5), Point3(-4.4, -7.1, 5.5), Point3(-4.4, -7.1, 5.2), Point3(4.4, -7.1, 5.2))
     back1 = CollisionPolygon(Point3(-4.4, 7.1, 5.5), Point3(4.4, 7.1, 5.5), Point3(4.4, 7.1, 5.2), Point3(-4.4, 7.1, 5.2))
     self.collNode.addSolid(tube1)
     self.collNode.addSolid(tube2)
     self.collNode.addSolid(roof)
     self.collNode.addSolid(side1)
     self.collNode.addSolid(side2)
     self.collNode.addSolid(front1)
     self.collNode.addSolid(back1)
     self.collNodePath.reparentTo(self.axle)
     self.collNode.setCollideMask(ToontownGlobals.PieBitmask | ToontownGlobals.WallBitmask | ToontownGlobals.CameraBitmask)
     self.collNode.setName('BossZap')
     self.setTag('attackCode', str(ToontownGlobals.BossCogElectricFence))
     self.accept('enterBossZap', self.__touchedBoss)
     bubbleL = CollisionSphere(10, -5, 0, 10)
     bubbleL.setTangible(0)
     bubbleLNode = CollisionNode('BossZap')
     bubbleLNode.setCollideMask(ToontownGlobals.WallBitmask)
     bubbleLNode.addSolid(bubbleL)
     self.bubbleL = self.axle.attachNewNode(bubbleLNode)
     self.bubbleL.setTag('attackCode', str(ToontownGlobals.BossCogSwatLeft))
     self.bubbleL.stash()
     bubbleR = CollisionSphere(-10, -5, 0, 10)
     bubbleR.setTangible(0)
     bubbleRNode = CollisionNode('BossZap')
     bubbleRNode.setCollideMask(ToontownGlobals.WallBitmask)
     bubbleRNode.addSolid(bubbleR)
     self.bubbleR = self.axle.attachNewNode(bubbleRNode)
     self.bubbleR.setTag('attackCode', str(ToontownGlobals.BossCogSwatRight))
     self.bubbleR.stash()
     bubbleF = CollisionSphere(0, -25, 0, 12)
     bubbleF.setTangible(0)
     bubbleFNode = CollisionNode('BossZap')
     bubbleFNode.setCollideMask(ToontownGlobals.WallBitmask)
     bubbleFNode.addSolid(bubbleF)
     self.bubbleF = self.rotateNode.attachNewNode(bubbleFNode)
     self.bubbleF.setTag('attackCode', str(ToontownGlobals.BossCogFrontAttack))
     self.bubbleF.stash()
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:57,代码来源:DistributedBossCog.py

示例4: __talkAboutPromotion

# 需要导入模块: from toontown.coghq import CogDisguiseGlobals [as 别名]
# 或者: from toontown.coghq.CogDisguiseGlobals import dept2deptIndex [as 别名]
 def __talkAboutPromotion(self, speech):
     if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
         deptIndex = CogDisguiseGlobals.dept2deptIndex(self.style.dept)
         cogLevels = base.localAvatar.getCogLevels()
         newCogSuitLevel = cogLevels[deptIndex]
         cogTypes = base.localAvatar.getCogTypes()
         maxCogSuitLevel = (SuitDNA.levelsPerSuit-1) + cogTypes[deptIndex]
         if self.prevCogSuitLevel != maxCogSuitLevel:
             speech += TTLocalizer.ResistanceToonLevelPromotion
         if newCogSuitLevel == maxCogSuitLevel:
             if newCogSuitLevel != ToontownGlobals.MaxCogSuitLevel:
                 suitIndex = (SuitDNA.suitsPerDept*deptIndex) + cogTypes[deptIndex]
                 cogTypeStr = SuitDNA.suitHeadTypes[suitIndex]
                 cogName = SuitBattleGlobals.SuitAttributes[cogTypeStr]['name']
                 speech += TTLocalizer.ResistanceToonSuitPromotion % cogName
     else:
         speech += TTLocalizer.ResistanceToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
     return speech
开发者ID:nate97,项目名称:src,代码行数:20,代码来源:DistributedCashbotBoss.py


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