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


Python ItemGlobals.getPower方法代码示例

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


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

示例1: createHelpbox

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getPower [as 别名]

#.........这里部分代码省略.........
                        self.realItem.setHpr(0, 90, 0)
                    elif itemType == ItemGlobals.DOLL:
                        self.realItem.setPos(0.0, 1.8999999999999999, -0.10000000000000001)
                        self.realItem.setHpr(0, 90, 180)
                    elif itemType == ItemGlobals.DAGGER:
                        self.realItem.setPos(-1.0, 2.0, -0.29999999999999999)
                        self.realItem.setHpr(90, 170, -90)
                    elif itemType == ItemGlobals.GRENADE:
                        self.realItem.setPos(0.0, 3.5, -0.20000000000000001)
                        self.realItem.setHpr(0, 0, 0)
                    elif itemType == ItemGlobals.STAFF:
                        self.realItem.setPos(-0.40000000000000002, 3.0, -0.29999999999999999)
                        self.realItem.setHpr(-90, 15, -90)
                    elif itemSubtype == ItemGlobals.RAM:
                        self.realItem.setPos(-1.5, 1.5, -0.59999999999999998)
                        self.realItem.setHpr(70, 160, -90)
                    elif itemType == ItemGlobals.POTION:
                        self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
                        self.realItem.setHpr(45, 0, 0)
                    else:
                        self.realItem.setPos(0.0, 1.5, -0.059999999999999998)
                        self.realItem.setHpr(0, 90, 0)
                    self.realItem.reparentTo(self.portraitSceneGraph)


            iHeight = 0.17499999999999999
            self.createBuffer()
            self.itemCard.setZ(runningVertPosition - 0.059999999999999998)
            runningVertPosition -= iHeight
            runningSize += iHeight
            labels.append(self.itemCard)
            goldLabel = DirectLabel(parent = self, relief = None, image = coinImage, image_scale = 0.12, image_pos = Vec3(0.025000000000000001, 0, -0.02), text = str(int(ItemGlobals.getGoldCost(itemId) * ItemGlobals.GOLD_SALE_MULTIPLIER)), text_scale = subtitleScale, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (halfWidth - 0.050000000000000003, 0.0, runningVertPosition + 0.080000000000000002), text_pos = (0.0, -textScale))
            labels.append(goldLabel)
            infoText = PLocalizer.ItemAttackStrength % '%s%s' % (itemColor, ItemGlobals.getPower(itemId))
            if itemType == ItemGlobals.GUN:
                infoText += '     %s' % PLocalizer.ItemBarrels % '%s%s' % (itemColor, ItemGlobals.getBarrels(itemId))
                infoText += '     %s' % PLocalizer.ItemRangeStrength % '%s%s' % (itemColor, PLocalizer.getItemRangeName(WeaponGlobals.getRange(itemId)))

            if itemType != ItemGlobals.POTION:
                infoLabel = DirectLabel(parent = self, relief = None, text = infoText, text_scale = textScale, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
                iHeight = 0.080000000000000002
                runningVertPosition -= iHeight
                runningSize += iHeight
                labels.append(infoLabel)

            specialAttack = None
            if itemType != ItemGlobals.POTION:
                specialAttack = ItemGlobals.getSpecialAttack(itemId)

            if specialAttack:
                attackIcon = self.SkillIcons.find('**/%s' % WeaponGlobals.getSkillIcon(specialAttack))
                specialAttackNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.10000000000000001, geom = attackIcon, geom_scale = 0.10000000000000001, image_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), geom_pos = (-0.070000000000000007, 0.0, -0.050000000000000003), text = PLocalizer.getInventoryTypeName(specialAttack), text_scale = PiratesGuiGlobals.TextScaleLarge, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, text_fg = titleColor, text_font = PiratesGlobals.getInterfaceOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
                specialAttackRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % ItemGlobals.getSpecialAttackRank(itemId), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ARight, pos = (halfWidth - textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
                specialAttackType = WeaponGlobals.getSkillTrack(specialAttack)
                if specialAttackType == WeaponGlobals.BREAK_ATTACK_SKILL_INDEX:
                    specialAttackTypeText = PLocalizer.BreakAttackSkill
                elif specialAttackType == WeaponGlobals.DEFENSE_SKILL_INDEX:
                    specialAttackTypeText = PLocalizer.DefenseSkill
                else:
                    specialAttackTypeText = PLocalizer.WeaponSkill
                specialAttackTypeLabel = DirectLabel(parent = self, relief = None, text = specialAttackTypeText, text_scale = 0.033500000000000002, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - PiratesGuiGlobals.TextScaleLarge), text_pos = (0.0, -textScale))
                specialAttackInfo = PLocalizer.SkillDescriptions.get(specialAttack)
                specialAttackDescriptionText = specialAttackInfo[1]
                specialAttackDescriptionLabel = DirectLabel(parent = self, relief = None, text = specialAttackDescriptionText, text_scale = textScale, text_wordwrap = halfWidth * 2.7999999999999998 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition - specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() - 0.059999999999999998), text_pos = (0.0, -textScale))
                saHeight = specialAttackNameLabel.getHeight() + specialAttackTypeLabel.getHeight() + specialAttackDescriptionLabel.getHeight() - 0.040000000000000001
                runningVertPosition -= saHeight
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:70,代码来源:InventoryItemGui.py


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