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


Python WeaponGlobals.getSubtypeParryBonus方法代码示例

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


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

示例1: createHelpFrame

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSubtypeParryBonus [as 别名]

#.........这里部分代码省略.........
                                upgradeInfo += ' ' + PLocalizer.And
                            upgradeInfo += ' ' + entry[1]


                    upgradeInfo += '!'

            elif len(upgradeInfo) >= 4:
                upgradeInfo = skillInfo[3]
            else:
                upgradeInfo = PLocalizer.ClickToLearn
        elif not self.showIcon:
            unlockLevel = RepChart.getSkillUnlockLevel(self.skillId)
            if unlockLevel > 0:
                upgradeInfo = PLocalizer.UnlocksAtLevel % unlockLevel


        if self.skillId in SkillComboReq and SkillComboReq[self.skillId] and inv.getStackQuantity(self.skillId - 1) < 2:
            color = 'red'
            if rank == 0:
                color = 'red'
                upgradeInfo = ''

            description += '\n' + color + SkillComboReq[self.skillId] + '.'

        skillDesc = skillTitle + '\n' + skillType + '\n\n' + description + '\ngreen' + upgradeInfo
        stats = []
        if manaCost:
            stats.append(abs(manaCost))

        if damage and loDamage:
            stats.append(abs(loDamage))
            stats.append(abs(damage))
        elif damage:
            stats.append(abs(damage))

        if mpDamage:
            stats.append(abs(mpLoDamage))
            stats.append(abs(mpDamage))

        if buff == WeaponGlobals.C_CURSE:
            stats.append(WeaponGlobals.CURSED_DAM_AMP * 100)

        if buff == WeaponGlobals.C_WEAKEN:
            stats.append(WeaponGlobals.WEAKEN_PENALTY * 100)

        if effect > 0:
            stats.append(effect)

        if skillInfo[4]:
            if bonus == 0 and upgradeAmt > 0:
                if not self.skillId == InventoryType.SailBroadsideLeft and self.skillId == InventoryType.SailBroadsideRight:
                    pass
                if not (self.skillId == InventoryType.CannonShoot):
                    bonus = upgradeAmt

            if upgradeAmt < 1.0 and upgradeAmt > 0:
                bonus *= 100

            if self.skillId == InventoryType.SailTreasureSense:
                bonus /= 2.0
            elif self.skillId == InventoryType.CutlassParry:
                bonus += WeaponGlobals.getSubtypeParryBonus(localAvatar.currentWeaponId)

            if bonus:
                stats.append(abs(bonus))


        if self.skillId == InventoryType.DollAttune:
            stats.append(rank)

        if self.skillRank:
            rankText = DirectFrame(parent = self, relief = None, text = PLocalizer.makeHeadingString(PLocalizer.Rank + ' %s' % (self.skillRank + skillBoost), 2), text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleSmall, text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 15, text_shadow = (0, 0, 0, 1), pos = (0.45000000000000001, 0, 0), textMayChange = 1, sortOrder = 92, state = DGG.DISABLED)

        stats = [stat + 0.01 for stat in stats]

        try:
            pass
        except TypeError:
            self.notify.error('Error formatting skillDesc(%s): %s' % (self.skillId, stats))

        helpText = DirectFrame(parent = self, relief = None, text = skillDesc % stats, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleSmall, text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 17, textMayChange = 1, state = DGG.DISABLED, sortOrder = 91)
        height = -(helpText.getHeight() + 0.01)
        if self.lock:
            height = height - 0.040000000000000001

        width = 0.55000000000000004
        self.helpFrame = BorderFrame(parent = self, state = DGG.DISABLED, frameSize = (-0.040000000000000001, width, height, 0.050000000000000003), pos = (0, 0, -0.12), sortOrder = 90)
        self.helpFrame.setBin('gui-popup', 0)
        helpText.reparentTo(self.helpFrame)
        if self.skillRank:
            rankText.reparentTo(self.helpFrame)

        if self.lock:
            self.lockedFrame = DirectFrame(parent = self.helpFrame, relief = None, pos = (0.087999999999999995, 0, height + 0.029999999999999999), image = SkillButton.SubLock, image_scale = 0.13, image_pos = (-0.055, 0, 0.012999999999999999), text = PLocalizer.VR_AuthAccess, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG13)
            self.notify.debug('locked!')

        pos = self.helpFrame.getPos(aspect2d)
        x = min(pos[0], base.a2dRight - width)
        z = max(pos[2], base.a2dBottom - height)
        self.helpFrame.setPos(aspect2d, x, 0, z)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:104,代码来源:SkillButton.py


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