本文整理汇总了Python中pirates.battle.WeaponGlobals.getMojoCost方法的典型用法代码示例。如果您正苦于以下问题:Python WeaponGlobals.getMojoCost方法的具体用法?Python WeaponGlobals.getMojoCost怎么用?Python WeaponGlobals.getMojoCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.battle.WeaponGlobals
的用法示例。
在下文中一共展示了WeaponGlobals.getMojoCost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createHelpbox
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getMojoCost [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:
#.........这里部分代码省略.........
示例2: radialMenuHeartBeat
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getMojoCost [as 别名]
def radialMenuHeartBeat(self, task):
if base.mouseWatcherNode.hasMouse():
mouseData = base.win.getPointer(0)
curX = mouseData.getX()
curY = mouseData.getY()
else:
curX = 0
curY = 0
hLItem = RingMatch(self.numberOfItems, curX - self.mouseBasePosX, curY - self.mouseBasePosY)
if hLItem != self.hiLiteItem:
if hLItem < 1:
self.radialHelp.hide()
else:
self.radialHelp['text'] = PLocalizer.InventoryTypeNames[self.radialSkillMap[hLItem - 1]]
basePos = self.radial[hLItem].getPos()
self.radialHelp.setPos(basePos[0] + 0.059999999999999998, basePos[1], basePos[2] - 0.040000000000000001)
self.radialHelp.show()
if self.hiLiteItem != -1:
self.rframe[self.hiLiteItem].rollover(False)
self.hiLiteItem = hLItem
if self.hiLiteItem > 0:
self.rframe[self.hiLiteItem].rollover(True)
count = 0
for skillId in self.radialSkillMap:
greyOut = 0
count += 1
if self.weaponMode in (WeaponGlobals.FIREARM, WeaponGlobals.THROWING, WeaponGlobals.CANNON, WeaponGlobals.GRENADE):
inv = localAvatar.getInventory()
maxQuant = WeaponGlobals.getSkillMaxQuantity(skillId)
if maxQuant == WeaponGlobals.INF_QUANT and WeaponGlobals.canUseInfiniteAmmo(localAvatar.currentWeaponId, skillId) or WeaponGlobals.canUseInfiniteAmmo(localAvatar.getCurrentCharm(), skillId):
greyOut = 0
else:
ammoInvId = WeaponGlobals.getSkillAmmoInventoryId(skillId)
ammoAmt = inv.getStackQuantity(ammoInvId)
if ammoAmt <= 0:
greyOut = 1
if localAvatar.mojo < -1 * WeaponGlobals.getMojoCost(skillId):
greyOut = 1
if skillId == InventoryType.SailBroadsideLeft or skillId == InventoryType.SailBroadsideRight:
if not localAvatar.ship.broadside:
greyOut = 1
range = localAvatar.cr.battleMgr.getModifiedRechargeTime(localAvatar, skillId)
value = localAvatar.skillDiary.getTimeSpentRecharging(skillId)
if not value:
value = range
elif value >= range:
if self.rstatus[count] == 3:
startScale = self.rframe[count].getScale()
startColor = Vec4(1, 1, 1, 1)
glowColor = Vec4(0.0, 0.75, 0.0, 1.0)
buttomFrame = self.rframe[count]
self.rframe[count].update(value, range)
if value < range:
greyOut = 3
if self.rep == InventoryType.DollRep:
haveFriendly = localAvatar.getFriendlyStickyTargets()
haveHostile = localAvatar.getHostileStickyTargets()
if haveFriendly and not haveHostile:
if not WeaponGlobals.isFriendlyFire(self.radialSkillMap[count - 1]):
greyOut = 1
elif not haveFriendly and haveHostile:
if WeaponGlobals.isFriendlyFire(self.radialSkillMap[count - 1]):
greyOut = 1
if self.rstatus[count] != greyOut:
self.rstatus[count] = greyOut
if greyOut == 2:
self.radial[count].setColorScale(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1.0)
elif greyOut == 1:
self.radial[count].setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
self.rframe[count].meterFaceHalf1.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
self.rframe[count].meterFaceHalf2.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
elif greyOut == 3:
self.radial[count].setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
else:
self.radial[count].setColorScale(1, 1, 1, 1)
self.radial[count].setAlphaScale(1)
self.rframe[count].meterFaceHalf1.setColorScale(1, 1, 1, 1.0)
self.rframe[count].meterFaceHalf2.setColorScale(1, 1, 1, 1.0)
greyOut == 2
return Task.cont
示例3: updateSkillTrayStates
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getMojoCost [as 别名]
def updateSkillTrayStates(self):
if not self.traySkillMap:
return None
if not hasattr(base, 'localAvatar'):
return None
inv = localAvatar.getInventory()
if not inv:
return None
self.numberOfItems = len(self.traySkillMap)
for i in range(self.numberOfItems):
skillId = self.traySkillMap[i]
greyOut = 0
if self.tray[i + 1].greyOut == -1:
continue
if self.tray[i + 1].showQuantity:
maxQuant = WeaponGlobals.getSkillMaxQuantity(skillId)
if maxQuant == WeaponGlobals.INF_QUANT and WeaponGlobals.canUseInfiniteAmmo(localAvatar.currentWeaponId, skillId) or WeaponGlobals.canUseInfiniteAmmo(localAvatar.getCurrentCharm(), skillId):
quantity = WeaponGlobals.INF_QUANT
else:
ammoInvId = WeaponGlobals.getSkillAmmoInventoryId(skillId)
quantity = inv.getStackQuantity(ammoInvId)
if quantity == 0:
greyOut = 1
if localAvatar.mojo < -1 * WeaponGlobals.getMojoCost(skillId):
greyOut = 1
if localAvatar.ship:
if (skillId == InventoryType.SailBroadsideLeft or skillId == InventoryType.SailBroadsideRight) and not (localAvatar.ship.broadside):
greyOut = 1
elif localAvatar.guiMgr.combatTray.skillDisabled(skillId):
greyOut = 1
rep = WeaponGlobals.getSkillReputationCategoryId(skillId)
if rep == InventoryType.DollRep:
haveFriendly = localAvatar.getFriendlyStickyTargets()
haveHostile = localAvatar.getHostileStickyTargets()
if haveFriendly and not haveHostile:
if not WeaponGlobals.isFriendlyFire(skillId):
greyOut = 1
elif not haveFriendly and haveHostile:
if WeaponGlobals.isFriendlyFire(skillId):
greyOut = 1
if self.tray[i + 1].greyOut != greyOut:
if hasattr(self.tray[i + 1], 'skillButton'):
self.tray[i + 1].greyOut = greyOut
if greyOut == 1:
self.tray[i + 1].setGeomColor(0.5, 0.5, 0.5, 1.0)
if self.tray[i + 1].showRing:
self.tray[i + 1].skillRing.meterFaceHalf1.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
self.tray[i + 1].skillRing.meterFaceHalf2.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1.0)
elif greyOut == 2:
self.tray[i + 1].setGeomColor(0.5, 0.5, 0.5, 1.0)
elif greyOut == 3:
self.tray[i + 1].setGeomColor(0.5, 0.5, 0.5, 1.0)
else:
self.tray[i + 1].setGeomColor(1, 1, 1, 1)
if self.tray[i + 1].showRing:
self.tray[i + 1].skillRing.meterFaceHalf1.clearColorScale()
self.tray[i + 1].skillRing.meterFaceHalf2.clearColorScale()
if self.isPowerRecharged:
self.continuePowerRechargeEffect()
continue
示例4: createHelpFrame
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getMojoCost [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
#.........这里部分代码省略.........