本文整理汇总了Python中pirates.inventory.ItemGlobals.getLinkedSkills方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getLinkedSkills方法的具体用法?Python ItemGlobals.getLinkedSkills怎么用?Python ItemGlobals.getLinkedSkills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getLinkedSkills方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeBoostDisplay
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getLinkedSkills [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: update
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getLinkedSkills [as 别名]
def update(self, repId = None, fromUser = 0):
inv = localAvatar.getInventory()
if not inv:
self.notify.warning('SkillPage unable to find inventory')
return None
if self.tabBar == None:
return None
if self.demo:
return None
if fromUser:
self.lastUserSelectedTab = repId
if repId == None:
if localAvatar.getGameState() == 'Fishing':
if self.lastUserSelectedTab:
repId = self.lastUserSelectedTab
else:
repId = InventoryType.CannonRep
elif localAvatar.cannon:
repId = InventoryType.CannonRep
elif localAvatar.gameFSM.state == 'ShipPilot':
repId = InventoryType.SailingRep
elif localAvatar.currentWeaponId and localAvatar.isWeaponDrawn:
repId = WeaponGlobals.getRepId(localAvatar.currentWeaponId)
elif localAvatar.currentWeaponId and not (localAvatar.isWeaponDrawn) and self.lastUserSelectedTab:
repId = self.lastUserSelectedTab
else:
repId = InventoryType.CannonRep
self.setRep(repId)
self.tabBar.selectTab(str(repId))
self.repMeter.setCategory(repId)
self.repMeter.update(inv.getReputation(repId))
unSpentId = self.getUnspent()
amt = inv.getStackQuantity(unSpentId)
if unSpentId in self.localMods:
amt = self.localMods[unSpentId]
self.unspent['text'] = PLocalizer.SkillPageUnspentPoints % amt
if amt > 0:
self.unspent['text_fg'] = (0.80000000000000004, 1, 0.80000000000000004, 1)
else:
self.unspent['text_fg'] = (1, 1, 1, 1)
comboSkills = RadialMenu.ComboSkills(repId, 1)
totalComboSkills = RadialMenu.ComboSkills(repId, 0)
activeSkills = RadialMenu.ActiveSkills(repId, 1)
totalActiveSkills = RadialMenu.ActiveSkills(repId, 0)
passiveSkills = RadialMenu.PassiveSkills(repId, 1)
totalPassiveSkills = RadialMenu.PassiveSkills(repId, 0)
self.linkedSkillIds = { }
linkedSkills = ItemGlobals.getLinkedSkills(localAvatar.currentWeaponId)
if linkedSkills:
for skillId in linkedSkills:
realSkillId = WeaponGlobals.getLinkedSkillId(skillId)
self.linkedSkillIds[realSkillId] = skillId
for excludedSkillId in self.EXCLUDED_SKILLS:
for skillId in activeSkills:
if excludedSkillId == skillId:
activeSkills.remove(skillId)
totalActiveSkills.remove(skillId)
continue
for spot in self.skillFrames.keys():
if spot not in totalComboSkills:
self.skillFrames[spot].hide()
continue
count = 0
for skill in totalComboSkills:
skillPts = inv.getStackQuantity(skill)
if skill in self.localMods:
skillPts = self.localMods[skill]
if not skill in comboSkills:
pass
showIcon = skillPts > 0
freeLock = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
if not WeaponGlobals.canFreeUse(skill):
freeLock = True
if self.linkedSkillIds.has_key(skill):
if self.skillFrames.has_key(skill):
self.skillFrames[skill].hide()
skill = self.linkedSkillIds[skill]
self.createFrame(skill, skillPts, amt, freeLock, showIcon)
x = 0.20000000000000001 + 0.17499999999999999 * count
y = 1.1100000000000001
self.skillFrames[skill].setPos(x, 0, y)
if showIcon and skillPts > 1:
self.makeBoostDisplay(skill, skillPts - 1)
#.........这里部分代码省略.........
示例3: showDetails
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getLinkedSkills [as 别名]
#.........这里部分代码省略.........
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
runningSize += saHeight
labels.append(specialAttackNameLabel)
labels.append(specialAttackRankLabel)
labels.append(specialAttackTypeLabel)
labels.append(specialAttackDescriptionLabel)
attributes = ItemGlobals.getAttributes(itemId)
for i in range(0, len(attributes)):
attributeIcon = self.SkillIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))
if not attributeIcon:
attributeIcon = self.BuffIcons.find('**/%s' % ItemGlobals.getAttributeIcon(attributes[i][0]))
attributeNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = attributeIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.getItemAttributeName(attributes[i][0]), 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))
attributeRankLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.ItemRank % attributes[i][1], 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))
if attributeNameLabel.getHeight() > 0.074999999999999997:
attributeNameSpace = 0.080000000000000002
else:
attributeNameSpace = PiratesGuiGlobals.TextScaleLarge
attributeDescriptionLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.getItemAttributeDescription(attributes[i][0]), 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 - attributeNameSpace), text_pos = (0.0, -textScale))
aHeight = attributeNameLabel.getHeight() + attributeDescriptionLabel.getHeight()
runningVertPosition -= aHeight + splitHeight
runningSize += aHeight + splitHeight
labels.append(attributeNameLabel)
labels.append(attributeRankLabel)
labels.append(attributeDescriptionLabel)
skillBoosts = ItemGlobals.getSkillBoosts(itemId)
for i in range(0, len(skillBoosts)):
(skillId, skillBoost) = skillBoosts[i]
linkedSkills = ItemGlobals.getLinkedSkills(itemId)
if linkedSkills:
for id in linkedSkills:
if skillId == WeaponGlobals.getLinkedSkillId(id):
skillId = id
boostIcon = self.SkillIcons.find('**/%s' % WeaponGlobals.getSkillIcon(skillId))
boostNameLabel = DirectLabel(parent = self, relief = None, image = border, image_scale = 0.050000000000000003, geom = boostIcon, geom_scale = 0.050000000000000003, image_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), geom_pos = (-0.070000000000000007, 0.0, -0.029999999999999999), text = PLocalizer.ItemBoost % PLocalizer.getInventoryTypeName(skillId), text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.90000000000000002 / titleScale), text_align = TextNode.ALeft, pos = (-halfWidth + 0.12 + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
boostRankLabel = DirectLabel(parent = self, relief = None, text = '+%s' % str(skillBoost), 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))
bHeight = boostNameLabel.getHeight()
runningVertPosition -= bHeight + splitHeight
runningSize += bHeight + splitHeight
labels.append(boostNameLabel)
labels.append(boostRankLabel)
description = PLocalizer.getItemFlavorText(itemId)
if description != '':
descriptionLabel = DirectLabel(parent = self, relief = None, text = description, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.94999999999999996 / textScale), text_align = TextNode.ALeft, pos = (-halfWidth + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
dHeight = descriptionLabel.getHeight() + 0.02
runningVertPosition -= dHeight
runningSize += dHeight
labels.append(descriptionLabel)
weaponLevel = 0
weaponRepId = WeaponGlobals.getRepId(itemId)
weaponRep = inv.getReputation(weaponRepId)
weaponReq = ItemGlobals.getWeaponRequirement(itemId)
weaponText = None
trainingToken = EconomyGlobals.getItemTrainingReq(itemId)
trainingAmt = inv.getItemQuantity(trainingToken)
if weaponReq:
示例4: updateSkillTray
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getLinkedSkills [as 别名]
def updateSkillTray(self, rep, weaponMode, callback = None, hideFirst = True):
if rep == InventoryType.MeleeRep:
return None
if not callback:
callback = localAvatar.guiMgr.combatTray.triggerSkillTraySkill
if taskMgr.hasTaskNamed('updateSkillTray'):
taskMgr.remove('updateSkillTray')
if self.skillTrayState and hideFirst:
self.hideSkillTray()
taskMgr.doMethodLater(0.75, self.updateSkillTray, 'updateSkillTray', extraArgs = [
rep,
weaponMode,
callback])
return None
text = PLocalizer.InventoryTypeNames.get(rep, 'Unknown')
for i in range(self.numberOfItems):
self.tray[i + 1].destroy()
self.tray = { }
if self.repMeter:
self.repMeter.destroy()
self.rep = rep
self.weaponMode = weaponMode
self.callback = callback
linkedSkillIds = { }
linkedSkills = ItemGlobals.getLinkedSkills(localAvatar.currentWeaponId)
for skillId in linkedSkills:
realSkillId = WeaponGlobals.getLinkedSkillId(skillId)
linkedSkillIds[realSkillId] = skillId
skillMap = []
self.origMap = getAllSkills(self.rep, 2, wantWeaponSkill = 1)
for i in range(len(self.origMap)):
skillMap.append(self.origMap[i][0])
self.traySkillMap = skillMap
self.numberOfItems = len(self.traySkillMap)
self.skillTray.setX(0)
if self.rep != InventoryType.DefenseCannonRep:
self.repMeter = ReputationMeter(self.rep, width = 0.69999999999999996)
self.repMeter.setScale(1.1499999999999999, 1.1499999999999999, 1.1499999999999999)
self.repMeter.reparentTo(self.skillTray)
self.repMeter.setCategory(self.rep)
inv = base.localAvatar.getInventory()
if inv is None:
return None
if self.repMeter:
self.repMeter.update(inv.getReputation(self.rep))
x = 0.0
offset = 0.0
for i in range(self.numberOfItems):
if self.origMap[i][1] == False:
locked = False
if locked:
image = (self.SkillIcons.find('**/base'), self.SkillIcons.find('**/base_down'), self.SkillIcons.find('**/base_over'))
else:
image = self.SkillIcons.find('**/base')
button = DirectButton(parent = self.skillTray, relief = None, state = DGG.DISABLED, image = image, image_pos = (0.0, 0.0, 0.059999999999999998), image_scale = 0.12, image_color = (0.20000000000000001, 0.20000000000000001, 0.20000000000000001, 0.55000000000000004), sortOrder = 100, pos = (x, 0, -0.0))
button.setTransparency(1)
button.showQuantity = False
button.greyOut = -1
button.showRing = False
button.skillStatus = False
if locked:
lock = DirectFrame(parent = button, relief = None, image = self.lockArt, image_scale = 0.14000000000000001, image_pos = (0.050000000000000003, 0, 0.035000000000000003))
button['state'] = DGG.NORMAL
button['command'] = base.localAvatar.guiMgr.showNonPayer
button['extraArgs'] = [
'Restricted_Radial_Menu',
5]
self.tray[i + 1] = button
x = x + 0.14999999999999999
if i < self.numberOfItems - 1:
offset = offset + 0.01
self.skillTray.setX(self.skillTray.getX() - 0.074999999999999997)
i < self.numberOfItems - 1
if self.origMap[i][1] == True:
skillId = self.traySkillMap[i]
if linkedSkillIds.has_key(skillId):
skillId = linkedSkillIds[skillId]
name = PLocalizer.InventoryTypeNames[skillId]
hotkey = str(i + 1)
totalRechargeTime = base.cr.battleMgr.getModifiedRechargeTime(localAvatar, skillId)
timeSpentRecharging = localAvatar.skillDiary.getTimeSpentRecharging(skillId)
if not timeSpentRecharging:
timeSpentRecharging = 0
if weaponMode not in (WeaponGlobals.CANNON, WeaponGlobals.FIREARM, WeaponGlobals.GRENADE, WeaponGlobals.STAFF, WeaponGlobals.DEFENSE_CANNON) and skillId in WeaponGlobals.SpecialSkills or WeaponGlobals.getSkillReputationCategoryId(skillId) not in (InventoryType.PistolRep, InventoryType.WandRep, InventoryType.CannonRep, InventoryType.GrenadeRep, InventoryType.DefenseCannonRep):
showRing = True
#.........这里部分代码省略.........
示例5: createHelpFrame
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getLinkedSkills [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
#.........这里部分代码省略.........