本文整理汇总了Python中pirates.inventory.ItemGlobals.getItemRepId方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getItemRepId方法的具体用法?Python ItemGlobals.getItemRepId怎么用?Python ItemGlobals.getItemRepId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getItemRepId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getItemRequirements
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getItemRepId [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
示例2: createGui
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getItemRepId [as 别名]
def createGui(self):
itemId = self.data[0]
(item, quantity) = self.data
name = ItemGlobals.getName(item)
itemType = ItemGlobals.getType(item)
itemTypeName = name
repCategory = ItemGlobals.getItemRepId(itemId)
if quantity:
repValue = localAvatar.getInventory().getReputation(repCategory)
self.repMeter = ReputationMeter(repCategory, width = 0.66000000000000003)
self.repMeter.setPos(0.62, 0, 0.041000000000000002)
self.repMeter.update(repValue)
self.repMeter.reparentTo(self)
self.repMeter.flattenLight()
hotkeyLabel = ''
hotkeys = ()
desc = PLocalizer.WeaponDescriptions.get(itemId)
helpText = PLocalizer.InventoryTypeNames[repCategory]
self.weaponButton = CombatTray.WeaponButton(hotkeys = hotkeys, hotkeyLabel = hotkeyLabel, helpOpaque = True, helpText = helpText, parent = self, showQuant = 0, pos = (0.10000000000000001, 0, -0.02), scale = 1.1000000000000001)
self.weaponButton.ignoreHotkeys()
self.weaponButton.setWeaponId(itemId)
self.weaponButton['extraArgs'] = [
itemId]
self.weaponButton.helpDelay = 0
self.weaponButton.helpPos = (0.12, 0, -0.040000000000000001)
self.desc = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.WeaponAlreadyUnlocked, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, -0.0050000000000000001), text_font = PiratesGlobals.getInterfaceFont())
else:
self.repMeter = None
name = PLocalizer.makeHeadingString(PLocalizer.InventoryTypeNames[repCategory], 2)
self.categoryLabel = DirectLabel(parent = self, relief = None, text = name, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ALeft, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, 0.059999999999999998), textMayChange = 0)
self.weaponButton = CombatTray.WeaponButton(parent = self, state = DGG.DISABLED, showQuant = 0, scale = 1.1000000000000001)
self.weaponButton.setPos(0.10000000000000001, 0, -0.02)
self.weaponButton.setWeaponId(itemId)
self.weaponButton.helpDelay = 0
self.weaponButton.helpPos = (0.12, 0, -0.040000000000000001)
unlockDesc = PLocalizer.WeaponUnlockText[repCategory]
self.desc = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = unlockDesc, text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.28999999999999998, 0, 0.025000000000000001), text_font = PiratesGlobals.getInterfaceFont())
self.setColorScale(0.40000000000000002, 0.40000000000000002, 0.40000000000000002, 1, 1)