本文整理汇总了Python中pirates.inventory.ItemGlobals.getWeaponBoosts方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getWeaponBoosts方法的具体用法?Python ItemGlobals.getWeaponBoosts怎么用?Python ItemGlobals.getWeaponBoosts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getWeaponBoosts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeBoostDisplay
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getWeaponBoosts [as 别名]
def makeBoostDisplay(self, skillId, points):
if skillId == InventoryType.SailPowerRecharge:
return None
if skillId not in self.skillFrames:
return None
if skillId not in self.boostDisplays:
self.backFrames[skillId] = DirectLabel(parent = self.skillFrames[skillId], pos = (0.040000000000000001, 0, -0.040000000000000001), frameColor = (0.20999999999999999, 0.125, 0.035000000000000003, 1), frameSize = (-0.023, 0.023, -0.023, 0.023))
self.boostDisplays[skillId] = DirectLabel(parent = self.skillFrames[skillId], text = '', text_scale = PiratesGuiGlobals.TextScaleMed, text_pos = (0.0, -0.01), text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.040000000000000001, 0, -0.040000000000000001), frameColor = (0, 0, 0, 1), frameSize = (-0.02, 0.02, -0.02, 0.02))
self.backFrames[skillId].setBin('gui-fixed', 1)
self.boostDisplays[skillId].setBin('gui-fixed', 1)
itemBoost = 0
if localAvatar.currentWeaponId:
if skillId in ItemGlobals.getLinkedSkills(localAvatar.currentWeaponId):
linkedSkillId = WeaponGlobals.getLinkedSkillId(skillId)
itemBoost = ItemGlobals.getWeaponBoosts(localAvatar.currentWeaponId, linkedSkillId)
itemBoost += ItemGlobals.getWeaponBoosts(localAvatar.getCurrentCharm(), linkedSkillId)
else:
itemBoost = ItemGlobals.getWeaponBoosts(localAvatar.currentWeaponId, skillId)
itemBoost += ItemGlobals.getWeaponBoosts(localAvatar.getCurrentCharm(), skillId)
elif localAvatar.getCurrentCharm():
itemBoost += ItemGlobals.getWeaponBoosts(localAvatar.getCurrentCharm(), skillId)
shipBoost = 0
if localAvatar.ship:
shipBoost = localAvatar.ship.getSkillBoost(skillId)
if itemBoost or shipBoost:
self.boostDisplays[skillId]['text'] = str(points + itemBoost + shipBoost)
self.boostDisplays[skillId]['text_fg'] = PiratesGuiGlobals.TextFG11
return None
self.boostDisplays[skillId]['text'] = str(points)
if points == 5:
self.boostDisplays[skillId]['text_fg'] = PiratesGuiGlobals.TextFG18
else:
self.boostDisplays[skillId]['text_fg'] = PiratesGuiGlobals.TextFG2
示例2: createHelpFrame
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getWeaponBoosts [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
#.........这里部分代码省略.........