本文整理汇总了Python中pirates.battle.WeaponGlobals.canFreeUse方法的典型用法代码示例。如果您正苦于以下问题:Python WeaponGlobals.canFreeUse方法的具体用法?Python WeaponGlobals.canFreeUse怎么用?Python WeaponGlobals.canFreeUse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.battle.WeaponGlobals
的用法示例。
在下文中一共展示了WeaponGlobals.canFreeUse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pruneFreebooterSkills
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import canFreeUse [as 别名]
def pruneFreebooterSkills(skillTrack):
if getPaidStatus(base.localAvatar.getDoId()):
return skillTrack
else:
return filter(lambda skillId: WeaponGlobals.canFreeUse(skillId), skillTrack)
示例2: update
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import canFreeUse [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: getAllSkills
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import canFreeUse [as 别名]
def getAllSkills(repId, skilltrack, wantWeaponSkill = 0):
inv = base.localAvatar.getInventory()
if inv == None:
print 'WARNING - getAllSkills came up with no inventory for ', repId
return []
minlvl = 2
choices = []
if repId == InventoryType.CutlassRep:
skillId = InventoryType.begin_WeaponSkillCutlass
while skillId < InventoryType.end_WeaponSkillCutlass:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.MeleeRep:
skillId = InventoryType.begin_WeaponSkillMelee
while skillId < InventoryType.end_WeaponSkillMelee:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.DaggerRep:
skillId = InventoryType.begin_WeaponSkillDagger
while skillId < InventoryType.end_WeaponSkillDagger:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.GrenadeRep:
skillId = InventoryType.begin_WeaponSkillGrenade
while skillId < InventoryType.end_WeaponSkillGrenade:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.DollRep:
skillId = InventoryType.begin_WeaponSkillDoll
while skillId < InventoryType.end_WeaponSkillDoll:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.WandRep:
skillId = InventoryType.begin_WeaponSkillWand
while skillId < InventoryType.end_WeaponSkillWand:
if WeaponGlobals.getSkillTrack(skillId) == skilltrack:
locked = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
locked = not WeaponGlobals.canFreeUse(skillId)
if inv.getStackQuantity(skillId) >= minlvl:
skill = (skillId, True, locked)
else:
skill = (skillId, False, locked)
choices.append(skill)
skillId += 1
elif repId == InventoryType.KettleRep:
skillId = InventoryType.begin_WeaponSkillKettle
#.........这里部分代码省略.........