本文整理汇总了Python中pirates.piratesbase.Freebooter.getPaidStatus方法的典型用法代码示例。如果您正苦于以下问题:Python Freebooter.getPaidStatus方法的具体用法?Python Freebooter.getPaidStatus怎么用?Python Freebooter.getPaidStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.Freebooter
的用法示例。
在下文中一共展示了Freebooter.getPaidStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requestInteraction
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def requestInteraction(self, avId, interactType=0):
if self.buildingUid == LocationIds.KINGSHEAD_OUTER_DOOR and not Freebooter.getPaidStatus(localAvatar.getDoId()):
localAvatar.guiMgr.showNonPayer(quest="Restricted_Location", focus=0)
return None
print "requestinteraction", 0
if avId == localAvatar.doId:
self.fadeOut()
return None
if self.questNeeded:
questHistory = localAvatar.getQuestLadderHistory()
currentQuests = localAvatar.getQuests()
container = QuestLadderDB.getContainer(self.questNeeded)
canEnter = False
for quest in currentQuests:
if container.getQuestId() == quest.getQuestId() or container.hasQuest(quest.getQuestId()):
canEnter = True
continue
if not canEnter:
if self.buildingUid == LocationIds.UNDEAD_POKER_SHACK:
localAvatar.guiMgr.createWarning(PLocalizer.ClubheartsQuestWarning, PiratesGuiGlobals.TextFG6)
return None
print "requestinteraction", 2
DistributedInteractive.DistributedInteractive.requestInteraction(self, avId, interactType)
示例2: __init__
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def __init__(self, callback, skillId, skillRank):
if not AmmoPanelButton.SkillIcons:
AmmoPanelButton.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
AmmoPanelButton.Image = (AmmoPanelButton.SkillIcons.find('**/base'), AmmoPanelButton.SkillIcons.find('**/base_down'), AmmoPanelButton.SkillIcons.find('**/base_over'))
self.locked = True
self.purchaseable = True
self.cost = CannonDefenseGlobals.getDefenseCannonAmmoCost(skillId)
self.amount = CannonDefenseGlobals.getDefenseCannonAmmoAmount(skillId)
if self.amount == -1:
self.amount = PLocalizer.Unlimited
self.skillId = skillId
self.skillRank = skillRank
self.infoBox = None
self.flashIval = None
asset = RadialMenu.getSkillIconName(skillId, 0)
geom = AmmoPanelButton.SkillIcons.find('**/%s' % asset)
self.geom = geom
if self.locked:
asset = None
geom = None
DirectButton.__init__(self, relief = None, pos = (0, 0, 0), text = '?', text_scale = 0.10000000000000001, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.0050000000000000001, -0.035000000000000003), text_align = TextNode.ACenter, image = AmmoPanelButton.Image, image_scale = 0.12, geom = geom, geom_scale = 0.12, command = callback, textMayChange = 1, sortOrder = 70, extraArgs = [
skillId])
self.initialiseoptions(AmmoPanelButton)
gui = loader.loadModel('models/gui/toplevel_gui')
self.lockIcon = gui.find('**/pir_t_gui_gen_key_subscriber')
if not Freebooter.getPaidStatus(base.localAvatar.doId) and skillId > CannonDefenseGlobals.FREEBOOTER_LAST_AMMO_AVAILABLE:
self.lock = DirectFrame(parent = self, relief = None, image = self.lockIcon, image_scale = 0.14000000000000001, image_pos = (0.050000000000000003, 0, -0.025000000000000001), sortOrder = 99)
self.bind(DGG.ENTER, self.showDetails)
self.bind(DGG.EXIT, self.hideDetails)
示例3: checkLevel
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def checkLevel(self, repId, minLvl):
inv = localAvatar.getInventory()
if inv:
repAmt = inv.getAccumulator(repId)
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
(item, quantity) = self.data
if item != ItemId.INTERCEPTOR_L1 and item != ItemId.MERCHANT_L1:
if not self.miscText:
self.miscText = DirectLabel(parent = self, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, text_pos = (0.050000000000000003, 0, 0), pos = (0.16, 0, 0.025000000000000001))
self['image_color'] = Vec4(1, 0.5, 0.5, 1)
self.miscText['text_fg'] = PiratesGuiGlobals.TextFG8
self.miscText['text'] = PLocalizer.noFreebooterCap
subCard = loader.loadModel('models/gui/toplevel_gui')
appendMe = DirectFrame(parent = self, relief = None, pos = (self.width - 0.40500000000000003, 0, -0.014999999999999999), state = DGG.DISABLED, geom = subCard.find('**/pir_t_gui_gen_key_subscriber'), geom_scale = 0.12, geom_pos = (0.059999999999999998, 0, 0.059999999999999998))
subCard.removeNode()
elif minLvl > ReputationGlobals.getLevelFromTotalReputation(repId, repAmt)[0]:
if not self.miscText:
self.miscText = DirectLabel(parent = self, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.16, 0, 0.025000000000000001))
self['image_color'] = Vec4(1, 0.5, 0.25, 1)
self['state'] = DGG.DISABLED
self.miscText['text_fg'] = PiratesGuiGlobals.TextFG8
self.miscText['text'] = PLocalizer.LevelRequirement % minLvl
示例4: selectPrev
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def selectPrev(self):
if len(self.items) < 1:
return None
self.show()
if len(self.items) > 1:
keepTrying = True
else:
keepTrying = False
while keepTrying:
keepTrying = False
self.choice = self.choice - 1
if self.choice < 0 or self.choice > len(self.items) - 1:
self.choice = len(self.items) - 1
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
if self.items[self.choice]:
category = WeaponGlobals.getRepId(self.items[self.choice][0])
if not Freebooter.allowedFreebooterWeapon(category):
keepTrying = True
else:
keepTrying = True
self.items[self.choice]
self.cursor.setPos(self.ICON_WIDTH * self.choice + 0.080000000000000002, 0, 0.071999999999999995)
taskMgr.remove('BarSelectHideTask' + str(self.getParent()))
self.hideTask = taskMgr.doMethodLater(self.SelectionDelay, self.confirmSelection, 'BarSelectHideTask' + str(self.getParent()), extraArgs = [])
示例5: onAmmoClick
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def onAmmoClick(self, skillId):
button = self.buttons[skillId]
if button.isLocked():
if not Freebooter.getPaidStatus(base.localAvatar.doId) and skillId > CannonDefenseGlobals.FREEBOOTER_LAST_AMMO_AVAILABLE:
localAvatar.guiMgr.showNonPayer()
return None
if button.canPurchase(self._bankNotes):
if self.addAmmoSkill(skillId):
self._bankNotes -= button.cost
self.updateBankNoteText()
button.disablePurchase()
if self.sfxAmmoBought:
base.playSfx(self.sfxAmmoBought)
elif not self.hasSkill(skillId):
button.flash()
self.msgMgr.showNoAmmoSlot()
if self.sfxAmmoDeny:
base.playSfx(self.sfxAmmoDeny)
elif not self.hasSkill(skillId):
button.flash()
self.msgMgr.showNotEnoughBankNotes()
if self.sfxAmmoDeny:
base.playSfx(self.sfxAmmoDeny)
if self.hasSkill(skillId):
base.localAvatar.guiMgr.combatTray.skillTray.updateSkillTray(InventoryType.DefenseCannonRep, WeaponGlobals.DEFENSE_CANNON, hideFirst = False)
base.localAvatar.guiMgr.combatTray.triggerSkillTraySkill(skillId)
self.cannon.cgui.showCannonControls()
self.updateQuantities()
示例6: handleCommitPurchase
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def handleCommitPurchase(self):
if self.purchaseInventory == [] and self.sellInventory == []:
base.localAvatar.guiMgr.createWarning(PLocalizer.EmptyPurchaseWarning, PiratesGuiGlobals.TextFG6)
return None
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
if self.purchaseInventory[0][0] != ItemId.INTERCEPTOR_L1 and self.purchaseInventory[0][0] != ItemId.MERCHANT_L1:
base.localAvatar.guiMgr.showNonPayer('Purchase_Restriction', 3)
return None
inventory = base.localAvatar.getInventory()
if inventory:
if inventory.getGoldInPocket() < self.balance:
base.localAvatar.guiMgr.createWarning(PLocalizer.NotEnoughMoneyWarning, PiratesGuiGlobals.TextFG6)
return None
if self.balance < 0 and inventory.getGoldInPocket() + self.balance > InventoryGlobals.GOLD_CAP:
base.localAvatar.guiMgr.createWarning(PLocalizer.CannotHoldGoldWarning, PiratesGuiGlobals.TextFG6)
return None
if len(inventory.getShipDoIdList()) >= inventory.getCategoryLimit(InventoryCategory.SHIPS):
base.localAvatar.guiMgr.createWarning(PLocalizer.CannotHoldShipWarning, PiratesGuiGlobals.TextFG6)
return None
nameData = [
PLocalizer.PirateShipPrefix.keys(),
PLocalizer.PirateShipSuffix.keys()]
self.namePanel = NamePanelGui.NamePanelGui(PLocalizer.NamePanelTitle, nameData)
self.namePanel.setPos(0.20000000000000001, 0, 0)
self.lockStore()
self.acceptOnce('returnStore', self.unlockStore)
self.acceptOnce('nameChosen', self.handleCommitPurchasePart2)
示例7: enableStatsOV
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def enableStatsOV(self, shipOV):
self.snapShot = ShipSnapshot(self, shipOV, self['siegeTeam'], pos = self['snapShotPos'])
typeStr = ''
if self['siegeTeam']:
hp = shipOV.maxHp
sp = shipOV.maxSp
else:
hp = shipOV.Hp
sp = shipOV.Sp
if hp <= 0:
self.button['state'] = DGG.DISABLED
self.button['text'] = PLocalizer.DeployShip
stateStr = '\x01Ired\x01%s\x02' % PLocalizer.ShipSunk
self['shipColorScale'] = VBase4(1, 0.40000000000000002, 0.40000000000000002, 1)
self.button['image3_color'] = VBase4(*PiratesGuiGlobals.ButtonColor3[2])
self.button['geom3_color'] = VBase4(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 0.40000000000000002)
self.button['text3_color'] = VBase4(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 0.40000000000000002)
self.button['helpText'] = PLocalizer.ShipSunk
elif len(shipOV.crew) >= shipOV.maxCrew:
self.button['state'] = DGG.DISABLED
self.button['text'] = PLocalizer.BoardShip
self.button['helpText'] = PLocalizer.ShipFull
stateStr = '\x01red\x01%s\x02' % (PLocalizer.ShipFull,)
self['shipColorScale'] = VBase4(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1)
elif localAvatar.getActiveShipId() and shipOV.doId != localAvatar.getActiveShipId():
self.button['state'] = DGG.DISABLED
self.button['text'] = PLocalizer.DeployShip
self.button['helpText'] = PLocalizer.OtherShipOut
stateStr = '\x01Ired\x01%s\x02' % PLocalizer.OtherShipOut
self['shipColorScale'] = VBase4(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1)
elif shipOV.state in 'Off':
self.button['state'] = DGG.NORMAL
self.button['text'] = PLocalizer.DeployShip
stateStr = PLocalizer.ShipInBottle
self.button['helpText'] = PLocalizer.ShipInBottle
else:
self.button['state'] = DGG.NORMAL
self.button['text'] = PLocalizer.BoardShip
stateStr = PLocalizer.ShipAtSea
self.button['helpText'] = PLocalizer.ShipAtSea
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()) and shipOV.shipClass not in ShipGlobals.UNPAID_SHIPS:
self.button['command'] = base.localAvatar.guiMgr.showNonPayer
self.button['extraArgs'] = [
'Restricted_ShipFrame_Deploy',
3]
self.button['text'] = PLocalizer.Locked
subgui = loader.loadModel('models/gui/toplevel_gui')
if subgui:
self.button['geom'] = subgui.find('**/pir_t_gui_gen_key_subscriber')
self.button['geom_scale'] = 0.14999999999999999
self.button['geom_color'] = Vec4(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1.0)
subgui.removeNode()
if typeStr:
self.typeLabel['text'] = '\x01smallCaps\x01(%s)\x02' % typeStr
示例8: loadWeaponButtons
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def loadWeaponButtons(self):
for hotkey in self.hotkeys:
hotkey.destroy()
self.hotkeys = []
for icon in self.icons:
icon.destroy()
self.icons = []
for repMeter in self.repMeters:
repMeter.destroy()
self.repMeters = []
self['frameSize'] = (0, self.ICON_WIDTH * len(self.items) + 0.040000000000000001, 0, self.HEIGHT)
self.setX(-((self.ICON_WIDTH * len(self.items) + 0.040000000000000001) / 2.0))
topGui = loader.loadModel('models/gui/toplevel_gui')
kbButton = topGui.find('**/keyboard_button')
for i in range(len(self.items)):
if self.items[i]:
category = WeaponGlobals.getRepId(self.items[i][0])
icon = DirectFrame(parent = self, state = DGG.DISABLED, relief = None, frameSize = (0, 0.080000000000000002, 0, 0.080000000000000002), pos = (self.ICON_WIDTH * i + 0.080000000000000002, 0, 0.082000000000000003))
icon.setTransparency(1)
hotkeyText = 'F%s' % self.items[i][1]
hotkey = DirectFrame(parent = icon, state = DGG.DISABLED, relief = None, text = hotkeyText, text_align = TextNode.ACenter, text_scale = 0.044999999999999998, text_pos = (0, 0), text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, image = kbButton, image_scale = 0.059999999999999998, image_pos = (0, 0, 0.01), image_color = (0.5, 0.5, 0.34999999999999998, 1), pos = (0, 0, 0.080000000000000002))
self.hotkeys.append(hotkey)
category = WeaponGlobals.getRepId(self.items[i][0])
if Freebooter.getPaidStatus(base.localAvatar.getDoId()) or Freebooter.allowedFreebooterWeapon(category):
asset = ItemGlobals.getIcon(self.items[i][0])
if asset:
texCard = self.card.find('**/%s' % asset)
icon['geom'] = texCard
icon['geom_scale'] = 0.080000000000000002
icon.resetFrameSize()
self.icons.append(icon)
else:
texCard = topGui.find('**/pir_t_gui_gen_key_subscriber*')
icon['geom'] = texCard
icon['geom_scale'] = 0.20000000000000001
icon.resetFrameSize()
self.icons.append(icon)
repMeter = DirectWaitBar(parent = icon, relief = DGG.SUNKEN, state = DGG.DISABLED, borderWidth = (0.002, 0.002), range = 0, value = 0, frameColor = (0.23999999999999999, 0.23999999999999999, 0.20999999999999999, 1), barColor = (0.80000000000000004, 0.80000000000000004, 0.69999999999999996, 1), pos = (-0.050000000000000003, 0, -0.052499999999999998), hpr = (0, 0, 0), frameSize = (0.0050000000000000001, 0.095000000000000001, 0, 0.012500000000000001))
self.repMeters.append(repMeter)
inv = base.localAvatar.getInventory()
if inv:
repValue = inv.getReputation(category)
(level, leftoverValue) = ReputationGlobals.getLevelFromTotalReputation(category, repValue)
max = ReputationGlobals.getReputationNeededToLevel(category, level)
repMeter['range'] = max
repMeter['value'] = leftoverValue
示例9: checkFreebooter
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def checkFreebooter(self, itemId, avId):
if ItemGlobals.getRarity(itemId) == ItemGlobals.CRUDE:
return None
if not InventoryType.begin_WeaponCannonAmmo <= itemId or itemId <= InventoryType.end_WeaponCannonAmmo:
if (InventoryType.begin_WeaponPistolAmmo <= itemId or itemId <= InventoryType.end_WeaponGrenadeAmmo or InventoryType.begin_WeaponDaggerAmmo <= itemId) and itemId <= InventoryType.end_WeaponDaggerAmmo:
return None
if itemId in [
InventoryType.RegularLure]:
return None
if not Freebooter.getPaidStatus(avId):
self.highlightRed(PLocalizer.FreebooterDisallow)
示例10: __init__
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def __init__(self, skillId, slotId, callback, quantity = 0, skillRank = 0, showQuantity = False, showHelp = False, showRing = False, hotkey = None, name = '', showIcon = True, showLock = False, rechargeSkillId = False, assocAmmo = []):
if skillId in [
InventoryType.DefenseCannonRoundShot,
InventoryType.DefenseCannonEmpty]:
showQuantity = False
if not Freebooter.getPaidStatus(base.localAvatar.doId) and slotId >= CannonDefenseGlobals.FREEBOOTER_MAX_AMMO_SLOTS:
showLock = True
SkillButton.SkillButton.__init__(self, skillId, callback, quantity, skillRank, showQuantity, showHelp, showRing, hotkey, name, showIcon, showLock, rechargeSkillId, assocAmmo)
self.toggleFrame['image_scale'] = 0.55000000000000004
self.toolTipBox = None
self.slotId = slotId
self._initButtons()
self.updateSkillId(skillId)
示例11: addAmmoSkill
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def addAmmoSkill(self, skillId):
index = -1
for i in range(len(PiratesGlobals.CANNON_DEFENSE_SKILLS)):
if PiratesGlobals.CANNON_DEFENSE_SKILLS[i] == InventoryType.DefenseCannonEmpty:
index = i
break
continue
if (index < 0 or not Freebooter.getPaidStatus(base.localAvatar.doId)) and index >= CannonDefenseGlobals.FREEBOOTER_MAX_AMMO_SLOTS:
return False
PiratesGlobals.CANNON_DEFENSE_SKILLS.remove(InventoryType.DefenseCannonEmpty)
PiratesGlobals.CANNON_DEFENSE_SKILLS.insert(index, skillId)
self.ammoQuantities[skillId] = CannonDefenseGlobals.getDefenseCannonAmmoAmount(skillId)
return True
示例12: updateProfile
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def updateProfile(self):
imageName = self.ShipIconTable.get(self.purchaseInventory[0][0])
myTexCard = self.card.find('**/' + imageName + '*')
myTex = myTexCard.findAllTextures()[0]
self.purchaseTitle['text'] = PLocalizer.InventoryTypeNames[self.purchaseInventory[0][0]]
self.descText['text'] = (PLocalizer.ShipDescriptions[self.purchaseInventory[0][0]],)
self.shipImage['image'] = myTex
self.shipImage['image_scale'] = 0.25
self.updateStats()
self.shipStats.refreshBars(self.statData)
self.updateBalance()
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
if self.purchaseInventory[0][0] != ItemId.INTERCEPTOR_L1 and self.purchaseInventory[0][0] != ItemId.MERCHANT_L1:
self.lock.show()
else:
self.lock.hide()
示例13: addOwnShip
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def addOwnShip(self, shipId, callback):
shipOV = base.cr.getOwnerView(shipId)
if (not shipOV or self._siegeTeam) and localAvatar.getSiegeTeam() and localAvatar.getSiegeTeam() != self._siegeTeam:
return None
shipFrame = self.getFrame(shipId)
if not shipFrame:
mastInfo = ShipGlobals.getMastSetup(shipOV.shipClass)
shipFrame = ShipFrameDeploy(parent = None, shipId = shipId, shipName = shipOV.name, shipClass = shipOV.shipClass, mastInfo = mastInfo, shipType = ShipFrameDeploy.STOwn, siegeTeam = self._siegeTeam, command = callback, extraArgs = [
shipId])
shipFrame.enableStatsOV(shipOV)
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()) and shipOV.shipClass not in ShipGlobals.UNPAID_SHIPS:
shipFrame.nameLabel['text'] = PLocalizer.noFreebooterCap
shipFrame.nameLabel['text_fg'] = (1, 0.69999999999999996, 0.69999999999999996, 1)
self.addFrameOwn(shipFrame)
示例14: changeAmmo
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def changeAmmo(self, amt = 1):
if amt == 0:
return None
keepChanging = True
ammoSkillId = self.getAmmoSkillId()
while keepChanging:
ammoSkillId += amt
if ammoSkillId > InventoryType.CannonGrappleHook:
ammoSkillId = InventoryType.CannonRoundShot
if ammoSkillId < InventoryType.begin_WeaponSkillCannon + 1:
ammoSkillId = InventoryType.CannonGrappleHook
inv = base.localAvatar.getInventory()
if ammoSkillId > InventoryType.CannonBullet:
keepChanging = False
if inv and inv.getStackQuantity(ammoSkillId) >= 2:
keepChanging = False
if WeaponGlobals.isInfiniteAmmo(ammoSkillId) or WeaponGlobals.canUseInfiniteAmmo(localAvatar.getCurrentCharm(), ammoSkillId):
keepChanging = False
if not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
if not WeaponGlobals.canFreeUse(ammoSkillId):
keepChanging = True
WeaponGlobals.canFreeUse(ammoSkillId)
self.setAmmoSkillId(ammoSkillId)
del ammoSkillId
if WeaponGlobals.isInfiniteAmmo(self.getAmmoSkillId()) or WeaponGlobals.canUseInfiniteAmmo(localAvatar.getCurrentCharm(), self.getAmmoSkillId()):
self.cgui.setAmmoLeft(-1, -1)
elif inv:
ammoInvId = WeaponGlobals.getSkillAmmoInventoryId(self.getAmmoSkillId())
self.numShots = inv.getStackQuantity(ammoInvId)
maxShots = inv.getStackLimit(ammoInvId)
self.cgui.setAmmoLeft(self.numShots, maxShots)
self.cgui.setAmmoId(self.getAmmoSkillId())
self.updateCannonDressing()
self.hideCannonDressing()
self.setVolley(0)
示例15: getItemRequirements
# 需要导入模块: from pirates.piratesbase import Freebooter [as 别名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatus [as 别名]
def getItemRequirements(self, itemType, otherAdds = []):
if not itemType:
return None
results = { }
if game.process == 'client':
paidStatus = Freebooter.getPaidStatus(self.ownerId)
else:
paidStatus = Freebooter.getPaidStatusAI(self.ownerId)
rarity = ItemGlobals.getRarity(itemType)
if rarity != ItemConstants.CRUDE and not paidStatus:
results['paidStatus'] = (rarity != ItemConstants.CRUDE, False)
itemClass = ItemGlobals.getClass(itemType)
if itemClass == InventoryType.ItemTypeWeapon or itemClass == InventoryType.ItemTypeCharm:
itemRepId = ItemGlobals.getItemRepId(itemType)
itemRep = self.getReputation(itemRepId)
itemLevel = ReputationGlobals.getLevelFromTotalReputation(itemRepId, itemRep)[0]
weaponReq = ItemGlobals.getWeaponRequirement(itemType)
trainingToken = EconomyGlobals.getItemTrainingReq(itemType)
trainingAmt = self.getItemQuantity(trainingToken)
for currAdd in otherAdds:
otherAdd = InvItem(currAdd)
if otherAdd.getCat() == trainingToken and otherAdd.getCount() > 0:
trainingAmt += otherAdd.getCount()
continue
if not weaponReq == None:
pass
weaponLevelPass = itemLevel >= weaponReq
if not trainingToken == 0 and trainingToken == None:
pass
weaponTrainPass = trainingAmt > 0
if weaponLevelPass:
pass
results['itemLevel'] = (weaponReq, weaponTrainPass)
else:
results['itemLevel'] = (0, True)
return results