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


Python WeaponGlobals.getSkillEffectFlag方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 def __init__(self, cr, ammoSkillId, event, buffs = []):
     self.trailEffect = None
     self.buffs = buffs
     self.glowA = None
     self.glowB = None
     self.glowATrack = None
     self.glowBTrack = None
     self.rotateIval = None
     ProjectileAmmo.__init__(self, cr, ammoSkillId, event, True)
     self.effectFlag = WeaponGlobals.getSkillEffectFlag(ammoSkillId)
     self.effectIval = None
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:13,代码来源:CannonballProjectile.py

示例2: cellRightClick

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 def cellRightClick(self, cell, mouseAction = MOUSE_CLICK, task = None):
     if mouseAction == MOUSE_PRESS and cell.inventoryItem:
         if self.manager.localDrinkingPotion:
             localAvatar.guiMgr.createWarning(PLocalizer.NoDoubleDrinkingItemsWarning, PiratesGuiGlobals.TextFG6)
             return None
         
         if self.manager.testCanUse(cell.inventoryItem.itemTuple):
             itemId = cell.inventoryItem.itemTuple.getType()
             skillId = WeaponGlobals.getSkillIdForAmmoSkillId(itemId)
             if WeaponGlobals.getSkillEffectFlag(skillId):
                 cell.inventoryItem.hasDrunk = localAvatar.guiMgr.combatTray.trySkill(InventoryType.UsePotion, skillId, 0)
             else:
                 cell.inventoryItem.hasDrunk = localAvatar.guiMgr.combatTray.trySkill(InventoryType.UseItem, skillId, 0)
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:15,代码来源:InventoryUIConsumableContainerLocatable.py

示例3: cellUsed

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 def cellUsed(self, cell):
     if self.manager.heldFromCell:
         self.heldItemOldCell = self.manager.heldFromCell
         if self.manager.testCanUse(self.heldItemOldCell.inventoryItem.itemTuple):
             itemId = self.heldItemOldCell.inventoryItem.itemTuple.getType()
             skillId = WeaponGlobals.getSkillIdForAmmoSkillId(itemId)
             if WeaponGlobals.getSkillEffectFlag(skillId):
                 drunk = localAvatar.guiMgr.combatTray.trySkill(InventoryType.UsePotion, skillId, 0)
             else:
                 drunk = localAvatar.guiMgr.combatTray.trySkill(InventoryType.UseItem, skillId, 0)
             if self.waitTime == None and drunk:
                 if WeaponGlobals.getSkillEffectFlag(skillId):
                     self.waitTime = base.cr.battleMgr.getModifiedRechargeTime(localAvatar, InventoryType.UsePotion, skillId)
                 else:
                     self.waitTime = base.cr.battleMgr.getModifiedRechargeTime(localAvatar, InventoryType.UseItem, skillId)
                 if self.waitTime:
                     self.drinkCell['text'] = PLocalizer.WaitPotion % int(self.waitTime)
                     taskMgr.doMethodLater(1.0, self.handlePotionRecharge, 'WaitDrinkPotion')
                 
             
         
     else:
         localAvatar.guiMgr.createWarning(PLocalizer.HowToDrinkPotion, PiratesGuiGlobals.TextFG6)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:25,代码来源:InventoryUIDrinker.py

示例4: createHelpbox

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
    def createHelpbox(self, args = None):
        if self.helpBox:
            return None

        baseRank = max(self.skillRank, 1)
        lvlDamageMod = WeaponGlobals.getLevelDamageModifier(localAvatar.getLevel())
        buff = WeaponGlobals.getSkillEffectFlag(self.skillId)
        dur = WeaponGlobals.getAttackDuration(self.skillId)
        effect = dur + dur * (baseRank - 1) / 4
        dodge = WeaponGlobals.getAttackDodge(self.skillId) * baseRank
        accuracy = 0
        damageMod = 0
        reduceDamMod = 0
        rechargeMod = 0
        shipTurningMod = 0
        shipSpeedMod = 0
        rangeMod = 0
        treasureSenseMod = 0
        manaCost = WeaponGlobals.getMojoCost(self.skillId)
        damage = 0
        loDamage = 0
        mpDamage = 0
        chargeMod = 0
        if self.skillId == InventoryType.SailBroadsideLeft or self.skillId == InventoryType.SailBroadsideRight:
            damageMod = WeaponGlobals.getAttackTargetHP(self.skillId) * (baseRank - 1) * 100
        elif self.skillId == InventoryType.CannonShoot:
            rechargeMod = WeaponGlobals.CANNON_SHOOT_RATE_REDUCTION * (baseRank - 1) * 100
        elif WeaponGlobals.getSkillTrack(self.skillId) == WeaponGlobals.TONIC_SKILL_INDEX:
            damage = WeaponGlobals.getAttackSelfHP(self.skillId)
        elif WeaponGlobals.getSkillTrack(self.skillId) != WeaponGlobals.PASSIVE_SKILL_INDEX:
            damage = int(WeaponGlobals.getAttackTargetHP(self.skillId) * (1.0 + WeaponGlobals.LEVELUP_DAMAGE_MULTIPLIER * (baseRank - 1))) * lvlDamageMod
            loDamage = damage / 2
            mpDamage = int(WeaponGlobals.getAttackTargetMojo(self.skillId) * (1.0 + WeaponGlobals.LEVELUP_DAMAGE_MULTIPLIER * (baseRank - 1))) * lvlDamageMod
            mpLoDamage = mpDamage / 2
        else:
            accuracy = WeaponGlobals.getAttackAccuracy(self.skillId) * baseRank
            damageMod = WeaponGlobals.getAttackTargetHP(self.skillId) * baseRank * 100
            reduceDamMod = WeaponGlobals.getAttackSelfHP(self.skillId) * baseRank
            if reduceDamMod < 1:
                reduceDamMod *= 100

            if effect < 1:
                effect *= 100

            rechargeMod = WeaponGlobals.getAttackRechargeTime(self.skillId) * baseRank * 100
            shipTurningMod = WeaponGlobals.getShipTurnRate(self.skillId) * baseRank * 100
            shipSpeedMod = WeaponGlobals.getShipMaxSpeed(self.skillId) * baseRank * 100
            treasureSenseMod = (WeaponGlobals.TREASURE_SENSE_BONUS / 2) * baseRank
            rangeMod = WeaponGlobals.getAttackRange(self.skillId) * baseRank
            manaCost *= baseRank
            chargeMod = WeaponGlobals.getAttackMaxCharge(self.skillId) * baseRank * 100
        if self.skillId == InventoryType.StaffSpiritLore:
            import pdb as pdb
            pdb.set_trace()

        skillInfo = PLocalizer.SkillDescriptions.get(self.skillId)
        skillTitle = PLocalizer.InventoryTypeNames.get(self.skillId)
        skillType = 'slant' + skillInfo[0] + '\n\n'
        description = skillInfo[1]
        if damage < 0:
            description += ' ' + PLocalizer.DealsDamage
        elif damage > 0:
            if loDamage:
                description += ' ' + PLocalizer.HealsDamageRange
            else:
                description += ' ' + PLocalizer.HealsDamage

        if mpDamage < 0:
            description += ' ' + PLocalizer.DealsMpDamage

        effectId = WeaponGlobals.getSkillEffectFlag(self.skillId)
        if effectId:
            description += ' ' + SkillEffectDescriptions.get(effectId)[0]

        if (self.skillId == InventoryType.SailBroadsideLeft or self.skillId == InventoryType.SailBroadsideRight) and damageMod > 0:
            description += ' ' + PLocalizer.BroadsideDesc

        if self.skillId == InventoryType.CannonShoot and rechargeMod:
            description += ' ' + PLocalizer.CannonShootDesc

        if self.skillId == InventoryType.DollAttune:
            description += ' ' + PLocalizer.MultiAttuneDesc

        if WeaponGlobals.getSkillInterrupt(self.skillId):
            description += ' ' + PLocalizer.InterruptDesc

        if WeaponGlobals.getSkillUnattune(self.skillId):
            description += ' ' + PLocalizer.UnattuneDesc

        upgradeInfo = ''
        if self.showUpgrade and self.skillRank < 5:
            if self.skillRank > 0:
                upgradeInfo = skillInfo[2]
                if upgradeInfo == '':
                    if damage < 0:
                        upgradeInfo += PLocalizer.UpgradesDamage
                    elif damage > 0:
                        upgradeInfo += PLocalizer.UpgradesHealing

                    if mpDamage < 0:
#.........这里部分代码省略.........
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:SkillpageGuiButton.py

示例5: playOuch

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 def playOuch(self, skillId, ammoSkillId, targetEffects, attacker, pos, itemEffects = [], multihit = 0, targetBonus = 0, skillResult = 0):
     (targetHp, targetPower, targetEffect, targetMojo, targetSwiftness) = targetEffects
     if self.gameFSM.state in ('Injured',):
         return None
     
     if not targetBonus:
         if ammoSkillId:
             effectId = WeaponGlobals.getHitEffect(ammoSkillId)
             skillEffectId = WeaponGlobals.getSkillEffectFlag(ammoSkillId)
         else:
             effectId = WeaponGlobals.getHitEffect(skillId)
             skillEffectId = WeaponGlobals.getSkillEffectFlag(skillId)
     
     if attacker:
         self.addCombo(attacker.getDoId(), attacker.currentWeaponId, skillId, -targetHp, skillResult)
     
     if WeaponGlobals.C_KNOCKDOWN not in self.getSkillEffects() or skillEffectId == WeaponGlobals.C_KNOCKDOWN:
         self.cleanupOuchIval()
     
     if not targetBonus and not (self.NoPain) and not (self.noIntervals) and targetEffects[0] < 0:
         if self.gameFSM.state not in ('Ensnared', 'Knockdown', 'Stunned', 'Rooted', 'NPCInteract', 'ShipBoarding', 'Injured', 'Dying', 'Death') or WeaponGlobals.C_KNOCKDOWN in self.getSkillEffects() or self.gameFSM.state not in ('ShipBoarding', 'Injured', 'Dying', 'Death'):
             if WeaponGlobals.C_KNOCKDOWN not in self.getSkillEffects() or skillEffectId == WeaponGlobals.C_KNOCKDOWN:
                 ouchSfx = None
                 if self.currentWeapon:
                     if not self.avatarType.isA(AvatarTypes.Creature) and skillEffectId == WeaponGlobals.C_KNOCKDOWN and not ItemGlobals.getWeaponAttributes(self.currentWeaponId, ItemGlobals.SURE_FOOTED):
                         if self.isLocal():
                             actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0), Func(messenger.send, 'skillFinished'))
                         else:
                             actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0))
                     elif not self.avatarType.isA(AvatarTypes.Creature) and effectId == WeaponGlobals.VFX_BLIND:
                         actorIval = self.actorInterval('sand_in_eyes_holdweapon_noswing', playRate = random.uniform(0.69999999999999996, 1.5))
                     else:
                         actorIval = self.actorInterval(self.currentWeapon.painAnim, playRate = random.uniform(0.69999999999999996, 1.5))
                         if WeaponGlobals.getIsStaffAttackSkill(skillId):
                             skillInfo = WeaponGlobals.getSkillAnimInfo(skillId)
                             getOuchSfxFunc = skillInfo[WeaponGlobals.OUCH_SFX_INDEX]
                             if getOuchSfxFunc:
                                 ouchSfx = getOuchSfxFunc()
                             
                         else:
                             ouchSfx = self.getSfx('pain')
                 elif not self.avatarType.isA(AvatarTypes.Creature) and skillEffectId == WeaponGlobals.C_KNOCKDOWN:
                     actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0))
                 elif not self.avatarType.isA(AvatarTypes.Creature) and effectId == WeaponGlobals.VFX_BLIND:
                     actorIval = self.actorInterval('sand_in_eyes', playRate = random.uniform(0.69999999999999996, 1.5))
                 else:
                     actorIval = self.actorInterval('idle_hit', playRate = random.uniform(0.69999999999999996, 1.5))
                 if ouchSfx:
                     self.ouchAnim = Sequence(Func(base.playSfx, ouchSfx, node = self, cutoff = 75), actorIval)
                 else:
                     self.ouchAnim = actorIval
                 self.ouchAnim.start()
             
         skillEffectId == WeaponGlobals.C_KNOCKDOWN
     
     if self.combatEffect:
         self.combatEffect.destroy()
         self.combatEffect = None
     
     self.combatEffect = CombatEffect.CombatEffect(effectId, multihit, attacker, skillResult)
     self.combatEffect.reparentTo(self)
     self.combatEffect.setPos(self, pos[0], pos[1], pos[2])
     if not WeaponGlobals.getIsDollAttackSkill(skillId) and not WeaponGlobals.getIsStaffAttackSkill(skillId):
         if not WeaponGlobals.isSelfUseSkill(skillId):
             if attacker and not attacker.isEmpty():
                 self.combatEffect.lookAt(attacker)
             
             self.combatEffect.setH(self.combatEffect, 180)
         
     
     skillEffects = self.getSkillEffects()
     if WeaponGlobals.C_MELEE_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_COMBAT:
             self.pulseGhostGuardEffect(attacker, Vec4(0, 0, 0, 1), wantBlending = False)
         
     elif WeaponGlobals.C_MISSILE_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_MISSILE:
             self.pulseGhostGuardEffect(attacker, Vec4(1, 1, 1, 1), wantBlending = True)
         
     elif WeaponGlobals.C_MAGIC_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_MAGIC:
             self.pulseGhostGuardEffect(attacker, Vec4(0.5, 0.29999999999999999, 1, 1), wantBlending = True)
         
     
     self.combatEffect.play()
     if WeaponGlobals.getIsDollAttackSkill(skillId):
         self.voodooSmokeEffect2 = AttuneSmoke.getEffect()
         if self.voodooSmokeEffect2:
             self.voodooSmokeEffect2.reparentTo(self)
             self.voodooSmokeEffect2.setPos(0, 0, 0.20000000000000001)
             self.voodooSmokeEffect2.play()
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:93,代码来源:DistributedTargetableObject.py

示例6: callback

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 def callback(self, skillId):
     if WeaponGlobals.getSkillEffectFlag(skillId):
         localAvatar.guiMgr.combatTray.trySkill(InventoryType.UsePotion, skillId, 0)
     else:
         localAvatar.guiMgr.combatTray.trySkill(InventoryType.UseItem, skillId, 0)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:7,代码来源:RadialMenu.py

示例7: safeSubstitute

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
         'pot': 0,
         'dur': 0,
         'unit': 0 }),
     'disabled': True,
     'potionID': C_CRAB_TRANSFORM,
     'ingredients': [
         {
             'color': 1,
             'level': 6 }],
     'level': 20,
     'free': False,
     'discovered': False },
 {
     'name': PLocalizer.InventoryTypeNames[InventoryType.CannonDamageLvl1],
     'desc': safeSubstitute(PLocalizer.PotionDescs[InventoryType.CannonDamageLvl1], {
         'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.CannonDamageLvl1)) * 100),
         'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.CannonDamageLvl1))),
         'unit': 'seconds' }),
     'potionID': C_CANNON_DAMAGE_LVL1,
     'ingredients': [
         {
             'color': 0,
             'level': 3 },
         {
             'color': 1,
             'level': 3 },
         {
             'color': 2,
             'level': 3 }],
     'level': 2,
     'free': True,
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:33,代码来源:PotionRecipeData.py

示例8: showDetails

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
    def showDetails(self, cell, detailsPos, detailsHeight, event = None):
        self.notify.debug('Item showDetails')
        if self.manager.heldItem and self.manager.locked and cell.isEmpty() and self.isEmpty() or not (self.itemTuple):
            self.notify.debug(' early exit')
            return None

        itemId = self.getId()
        self.helpFrame = DirectFrame(parent = self.manager, relief = None, state = DGG.DISABLED, sortOrder = 1)
        self.helpFrame.setBin('gui-popup', -5)
        detailGui = loader.loadModel('models/gui/gui_card_detail')
        topGui = loader.loadModel('models/gui/toplevel_gui')
        coinImage = topGui.find('**/treasure_w_coin*')
        self.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
        self.BuffIcons = loader.loadModel('models/textureCards/buff_icons')
        border = self.SkillIcons.find('**/base')
        halfWidth = 0.29999999999999999
        halfHeight = 0.20000000000000001
        basePosX = cell.getX(aspect2d)
        basePosZ = cell.getZ(aspect2d)
        cellSizeX = 0.0
        cellSizeZ = 0.0
        if cell:
            cellSizeX = cell.cellSizeX
            cellSizeZ = cell.cellSizeZ

        textScale = PiratesGuiGlobals.TextScaleMed
        titleScale = PiratesGuiGlobals.TextScaleTitleSmall
        if len(self.getName()) >= 30:
            titleNameScale = PiratesGuiGlobals.TextScaleLarge
        else:
            titleNameScale = PiratesGuiGlobals.TextScaleExtraLarge
        subtitleScale = PiratesGuiGlobals.TextScaleMed
        iconScalar = 1.5
        borderScaler = 0.25
        splitHeight = 0.01
        vMargin = 0.029999999999999999
        runningVertPosition = 0.29999999999999999
        runningSize = 0.0
        labels = []
        titleColor = PiratesGuiGlobals.TextFG6
        rarity = ItemGlobals.getRarity(itemId)
        rarityText = PLocalizer.getItemRarityName(rarity)
        subtypeText = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(itemId))
        if rarity == ItemGlobals.CRUDE:
            titleColor = PiratesGuiGlobals.TextFG24
        elif rarity == ItemGlobals.COMMON:
            titleColor = PiratesGuiGlobals.TextFG13
        elif rarity == ItemGlobals.RARE:
            titleColor = PiratesGuiGlobals.TextFG4
        elif rarity == ItemGlobals.FAMED:
            titleColor = PiratesGuiGlobals.TextFG5

        titleLabel = DirectLabel(parent = self, relief = None, text = self.getName(), text_scale = titleNameScale, text_fg = titleColor, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
        self.bg.setColor(titleColor)
        tHeight = 0.070000000000000007
        titleLabel.setZ(runningVertPosition)
        runningVertPosition -= tHeight
        runningSize += tHeight
        labels.append(titleLabel)
        subtitleLabel = DirectLabel(parent = self, relief = None, text = 'slant%s %s' % (rarityText, subtypeText), text_scale = subtitleScale, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
        subtHeight = 0.050000000000000003
        subtitleLabel.setZ(subtHeight * 0.5 + runningVertPosition)
        runningVertPosition -= subtHeight
        runningSize += subtHeight
        labels.append(subtitleLabel)
        itemType = ItemGlobals.getType(itemId)
        itemSubtype = ItemGlobals.getSubtype(itemId)
        model = ItemGlobals.getModel(itemId)
        skillIcons = loader.loadModel('models/textureCards/skillIcons')
        if itemSubtype == ItemGlobals.POTION_BUFF:
            self.iconLabel = DirectLabel(parent = self.portraitSceneGraph, relief = None, image = skillIcons.find('**/%s' % ItemGlobals.getIcon(itemId)), pos = (0.0, 2.5, 0.0))
        elif model:
            self.realItem = loader.loadModel('models/inventory/' + model, okMissing = True)
            if not self.realItem:
                self.realItem = loader.loadModel('models/handheld/' + model)

            if self.realItem:
                posHpr = ItemGlobals.getModelPosHpr(model)
                if posHpr:
                    self.realItem.setPos(posHpr[0], posHpr[1], posHpr[2])
                    self.realItem.setHpr(posHpr[3], posHpr[4], posHpr[5])
                else:
                    self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
                    self.realItem.setHpr(45, 0, 0)
                self.realItem.reparentTo(self.portraitSceneGraph)


        iHeight = 0.17999999999999999
        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)
        if ItemGlobals.getSubtype(itemId) == 30:
            duration = PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
            if duration >= 3600:
                duration = duration / 3600
                if duration == 1:
#.........这里部分代码省略.........
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:InventoryUIConsumableItem.py

示例9: createHelpFrame

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
    def createHelpFrame(self, args = None):
        if self.helpFrame:
            return None

        inv = localAvatar.getInventory()
        if not inv:
            return None

        baseRank = max(self.skillRank, 1)
        lvlDamageMod = WeaponGlobals.getLevelDamageModifier(localAvatar.getLevel())
        buff = WeaponGlobals.getSkillEffectFlag(self.skillId)
        dur = WeaponGlobals.getAttackDuration(self.skillId)
        effect = dur + dur * (baseRank - 1) / 4.0
        bonus = localAvatar.getSkillRankBonus(self.skillId)
        upgradeAmt = WeaponGlobals.getAttackUpgrade(self.skillId)
        rank = localAvatar.getSkillRank(self.skillId)
        skillBoost = 0
        if self.skillId in ItemGlobals.getLinkedSkills(localAvatar.currentWeaponId):
            linkedSkillId = WeaponGlobals.getLinkedSkillId(self.skillId)
            skillBoost = ItemGlobals.getWeaponBoosts(localAvatar.currentWeaponId, linkedSkillId)
            skillBoost += ItemGlobals.getWeaponBoosts(localAvatar.getCurrentCharm(), linkedSkillId)
        else:
            skillBoost = ItemGlobals.getWeaponBoosts(localAvatar.currentWeaponId, self.skillId)
            skillBoost += ItemGlobals.getWeaponBoosts(localAvatar.getCurrentCharm(), self.skillId)
        manaCost = 0
        if WeaponGlobals.getSkillTrack(self.skillId) != WeaponGlobals.PASSIVE_SKILL_INDEX:
            manaCost = WeaponGlobals.getMojoCost(self.skillId)
            if manaCost < 0:
                amt = localAvatar.getSkillRankBonus(InventoryType.StaffConservation)
                manaCost = min(manaCost - manaCost * amt, 1.0)


        damage = 0
        loDamage = 0
        mpDamage = 0
        mpLoDamage = 0
        if WeaponGlobals.getSkillTrack(self.skillId) == WeaponGlobals.TONIC_SKILL_INDEX:
            damage = WeaponGlobals.getAttackSelfHP(self.skillId)
        elif WeaponGlobals.getSkillTrack(self.skillId) != WeaponGlobals.PASSIVE_SKILL_INDEX:
            mod = (1.0 + bonus) * lvlDamageMod
            damage = int(WeaponGlobals.getAttackTargetHP(self.skillId) * mod)
            loDamage = damage / 2
            mpDamage = int(WeaponGlobals.getAttackTargetMojo(self.skillId) * mod)
            mpLoDamage = mpDamage / 2


        try:
            skillInfo = PLocalizer.SkillDescriptions.get(self.skillId)
            skillTitle = PLocalizer.makeHeadingString(PLocalizer.InventoryTypeNames.get(self.skillId), 2)
            skillType = PLocalizer.makeHeadingString(skillInfo[0], 1)
        except:
            self.notify.error('Error getting skill info for skillId %s' % self.skillId)

        description = skillInfo[1]
        if damage < 0:
            description += ' ' + PLocalizer.DealsDamage
        elif damage > 0:
            if loDamage:
                loDamage = 0
                description += ' ' + PLocalizer.HealsDamageRange
            else:
                description += ' ' + PLocalizer.HealsDamage

        if mpDamage < 0:
            description += ' ' + PLocalizer.DealsMpDamage

        effectId = WeaponGlobals.getSkillEffectFlag(self.skillId)
        if effectId:
            description += ' ' + SkillEffectDescriptions.get(effectId)[0]

        if bonus:
            if self.skillId == InventoryType.SailBroadsideLeft or self.skillId == InventoryType.SailBroadsideRight:
                description += ' ' + PLocalizer.BroadsideDesc

            if self.skillId == InventoryType.CannonShoot:
                description += ' ' + PLocalizer.CannonShootDesc

            if self.skillId == InventoryType.DollAttune:
                description += ' ' + PLocalizer.MultiAttuneDesc


        if WeaponGlobals.getSkillInterrupt(self.skillId):
            description += ' ' + PLocalizer.InterruptDesc

        if WeaponGlobals.getSkillUnattune(self.skillId):
            description += ' ' + PLocalizer.UnattuneDesc

        upgradeInfo = ''
        if self.showUpgrade and rank < 5:
            if rank > 0:
                upgradeInfo = skillInfo[2]
                if upgradeInfo == '':
                    if damage < 0:
                        upgradeInfo += PLocalizer.UpgradesDamage
                    elif damage > 0:
                        upgradeInfo += PLocalizer.UpgradesHealing

                    if mpDamage < 0:
                        upgradeInfo += ' ' + PLocalizer.UpgradesMpDamage

#.........这里部分代码省略.........
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:SkillButton.py

示例10: __init__

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
    def __init__(self, skillId, callback, quantity = 0, skillRank = 0, showQuantity = False, showHelp = False, showRing = False, hotkey = None, name = '', showIcon = True, showLock = False, rechargeSkillId = False, isWeaponSkill = False, assocAmmo = []):
        DirectFrame.__init__(self, parent = NodePath(), relief = None)
        self.initialiseoptions(SkillButton)
        gui = loader.loadModel('models/gui/toplevel_gui')
        if not SkillButton.SkillIcons:
            print 'not SkillButton.SkillIcons:'
            SkillButton.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
            SkillButton.Image = (SkillButton.SkillIcons.find('**/base'), SkillButton.SkillIcons.find('**/base_down'), SkillButton.SkillIcons.find('**/base_over'))
            SkillButton.SkillRechargedSound = loadSfx(SoundGlobals.SFX_SKILL_RECHARGED)
            SkillButton.SubLock = gui.find('**/pir_t_gui_gen_key_subscriber')
            SkillButton.SpecialIcons = []
            for entry in SPECIAL_SKILL_ICONS:
                if not entry:
                    SkillButton.SpecialIcons.append(None)
                    continue
                specialImage = (SkillButton.SkillIcons.find('**/%s' % entry),)
                SkillButton.SpecialIcons.append(specialImage)


        model = loader.loadModel('models/effects/particleMaps')
        toggleIcon = model.find('**/particleGlow')
        toggleIcon.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd))
        self.toggleFrame = DirectFrame(relief = None, state = DGG.DISABLED, parent = self, image = toggleIcon, image_scale = 0.34999999999999998, image_pos = (0.0, 0.0, -0.01))
        self.toggleFrame.hide()
        self.glowRing = None
        self.glowRing2 = None
        self.assocAmmo = assocAmmo
        self.skillId = skillId
        self.quantity = quantity
        self.showQuantity = showQuantity
        self.skillRank = skillRank
        self.skillRing = None
        self.callback = callback
        self.showUpgrade = False
        self.showHelp = showHelp
        self.showRing = showRing
        self.showIcon = showIcon
        self.showLock = showLock
        self.isWeaponSkill = isWeaponSkill
        self.lock = None
        self.name = name
        self.helpFrame = None
        self.quantityLabel = None
        self.skillButton = None
        self.hotkeyLabel = None
        self.hotkey = hotkey
        self.greyOut = 0
        self.tonicId = 0
        self.skillRingIval = None
        self.impulseIval = None
        self.quickImpulseIval = None
        self.isBreakAttackSkill = WeaponGlobals.getSkillTrack(self.skillId) == WeaponGlobals.BREAK_ATTACK_SKILL_INDEX
        self.isDefenseSkill = WeaponGlobals.getSkillTrack(self.skillId) == WeaponGlobals.DEFENSE_SKILL_INDEX
        self.rechargeFilled = 0
        self.defenseAuraEffect = None
        if self.isWeaponSkill:
            self.weaponBackground = DirectLabel(parent = self, state = DGG.DISABLED, image = SkillButton.SkillIcons.find('**/box_base'), image_scale = (0.22, 0, 0.22), image_pos = (0.0, 0.0, 0.0))
            self.weaponBackground.flattenLight()
            self.weaponBackground.setColor(0.20000000000000001, 0.20000000000000001, 0.20000000000000001, 0.20000000000000001)
            self.weaponBackground.setTransparency(1)

        if showRing:
            if self.isBreakAttackSkill:
                color = Vec4(1, 0, 0, 1)
            elif self.isDefenseSkill:
                color = Vec4(0, 1, 1, 1)
            else:
                color = Vec4(1, 0.80000000000000004, 0.5, 1)
            self.skillRing = SkillRing(color, Vec4(0, 0, 0, 1.0))
            gs = self.skillRing.meterFaceHalf2.node().getGeomState(0)
            self.skillRing.meterFaceHalf2.node().setGeomState(0, gs.removeAttrib(ColorAttrib.getClassType()))
            self.skillRing.reparentTo(self, 0)
            self.skillRing.setPos(0, 0, 0)

        self.updateSkillId(skillId)
        if showQuantity:
            self.updateQuantity(quantity)

        if hotkey:
            self.createHotkey(hotkey)

        if showLock:
            self.createLock()

        self.skillButton.bind(DGG.ENTER, self.showDetails)
        self.skillButton.bind(DGG.EXIT, self.hideDetails)
        if self.skillId >= InventoryType.begin_Consumables and self.skillId <= InventoryType.end_Consumables and not WeaponGlobals.getSkillEffectFlag(skillId):
            self.totalRechargeTime = base.cr.battleMgr.getModifiedRechargeTime(localAvatar, InventoryType.UseItem)
            self.tonicId = InventoryType.UseItem
        else:
            self.totalRechargeTime = base.cr.battleMgr.getModifiedRechargeTime(localAvatar, self.skillId)
        if showRing:
            if not self.isBreakAttackSkill:
                self.createSkillRingIval()

            if self.tonicId:
                timeSpentRecharging = localAvatar.skillDiary.getTimeSpentRecharging(InventoryType.UseItem)
            else:
                timeSpentRecharging = localAvatar.skillDiary.getTimeSpentRecharging(self.skillId)
            if self.isBreakAttackSkill and timeSpentRecharging < self.totalRechargeTime:
#.........这里部分代码省略.........
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:SkillButton.py

示例11: safeSubstitute

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillEffectFlag [as 别名]
 WeaponGlobals.C_PISTOL_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[11]['desc'],
 WeaponGlobals.C_PISTOL_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[15]['desc'],
 WeaponGlobals.C_PISTOL_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[19]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[12]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[16]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[11]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[13]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[17]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[20]['desc'],
 WeaponGlobals.C_HASTEN_LVL1: PotionRecipeData.PotionRecipeList[21]['desc'],
 WeaponGlobals.C_HASTEN_LVL2: PotionRecipeData.PotionRecipeList[22]['desc'],
 WeaponGlobals.C_HASTEN_LVL3: PotionRecipeData.PotionRecipeList[23]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL1: PotionRecipeData.PotionRecipeList[24]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL2: PotionRecipeData.PotionRecipeList[25]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL3: safeSubstitute(PLocalizer.PotionDescs[InventoryType.RepBonusLvl1], {
     'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvl1)) * 100),
     'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvl1))) / 3600,
     'unit': 'hour' }),
 WeaponGlobals.C_REP_BONUS_LVLCOMP: safeSubstitute(PLocalizer.PotionDescs[InventoryType.RepBonusLvlComp], {
     'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvlComp)) * 100),
     'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvlComp))) / 3600,
     'unit': 'hour' }),
 WeaponGlobals.C_GOLD_BONUS_LVL1: PotionRecipeData.PotionRecipeList[26]['desc'],
 WeaponGlobals.C_GOLD_BONUS_LVL2: PotionRecipeData.PotionRecipeList[27]['desc'],
 WeaponGlobals.C_INVISIBILITY_LVL1: PotionRecipeData.PotionRecipeList[28]['desc'],
 WeaponGlobals.C_INVISIBILITY_LVL2: PotionRecipeData.PotionRecipeList[29]['desc'],
 WeaponGlobals.C_REGEN_LVL1: PotionRecipeData.PotionRecipeList[35]['desc'],
 WeaponGlobals.C_REGEN_LVL2: PotionRecipeData.PotionRecipeList[36]['desc'],
 WeaponGlobals.C_REGEN_LVL3: PotionRecipeData.PotionRecipeList[37]['desc'],
 WeaponGlobals.C_REGEN_LVL4: PotionRecipeData.PotionRecipeList[38]['desc'],
 WeaponGlobals.C_BURP: PotionRecipeData.PotionRecipeList[0]['desc'],
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:33,代码来源:SkillButton.py


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