本文整理汇总了Python中pirates.economy.EconomyGlobals.getItemMinLevel方法的典型用法代码示例。如果您正苦于以下问题:Python EconomyGlobals.getItemMinLevel方法的具体用法?Python EconomyGlobals.getItemMinLevel怎么用?Python EconomyGlobals.getItemMinLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.economy.EconomyGlobals
的用法示例。
在下文中一共展示了EconomyGlobals.getItemMinLevel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadData
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemMinLevel [as 别名]
def loadData(self):
itemId = self.data[0]
(item, quantity) = self.data
self.quantity = quantity
itemType = EconomyGlobals.getItemType(itemId)
if itemType <= ItemType.WAND:
itemTypeName = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(itemId))
else:
itemTypeName = PLocalizer.InventoryItemClassNames.get(itemType)
if itemType <= ItemType.WAND or itemType == ItemType.POTION:
name = PLocalizer.getItemName(itemId)
self.price = ItemGlobals.getGoldCost(itemId)
else:
name = PLocalizer.InventoryTypeNames.get(item)
self.price = EconomyGlobals.getItemCost(item)
if self.sell:
self.price /= 2
if self.buy:
if itemType > ItemType.WAND and itemType != ItemType.POTION:
self.quantity = EconomyGlobals.getItemQuantity(itemId)
self.price *= self.quantity
self.price = int(self.price)
self.name = PLocalizer.makeHeadingString(name, 2)
self.itemType = itemTypeName
if itemType != ItemType.FISHING_LURE:
if itemType != ItemType.POTION:
self.minLvl = ItemGlobals.getWeaponRequirement(itemId)
else:
self.minLvl = 0
else:
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])
示例2: createGui
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemMinLevel [as 别名]
def createGui(self):
(item, quantity) = self.data
name = PLocalizer.InventoryTypeNames[item]
self.price = EconomyGlobals.getItemCost(item)
repId = InventoryType.SailingRep
itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
self.itemType = itemTypeName
if self.sell:
self.price /= 2
card = loader.loadModel("models/textureCards/shipCatalog")
renderName = self.shipImageDict.get(item, "Catalog_War_Brig")
myTexCard = card.find("**/%s*" % renderName)
myTex = myTexCard.findAllTextures()[0]
card.removeNode()
del card
self.minLvl = EconomyGlobals.getItemMinLevel(item)
self.miscText = None
self.picture = DirectFrame(
parent=self,
relief=None,
state=DGG.DISABLED,
image=myTex,
image_scale=(0.070000000000000007, 1.0, 0.059999999999999998),
)
self.picture.setPos(0.10000000000000001, 0, 0.080000000000000002)
self.picture.setTransparency(1)
self.nameTag = DirectLabel(
parent=self,
state=DGG.DISABLED,
relief=None,
text=name,
text_scale=PiratesGuiGlobals.TextScaleMed * PLocalizer.getHeadingScale(2),
text_align=TextNode.ALeft,
text_fg=PiratesGuiGlobals.TextFG1,
text_shadow=PiratesGuiGlobals.TextShadow,
textMayChange=0,
)
self.nameTag.setPos(0.20000000000000001, 0, 0.10000000000000001)
self.costText = DirectLabel(
parent=self,
relief=None,
state=DGG.DISABLED,
geom=self.coinImage,
geom_scale=0.12,
geom_pos=Vec3(-0.01, 0, 0.01),
text=str(self.price),
text_scale=PiratesGuiGlobals.TextScaleSmall,
text_align=TextNode.ARight,
text_fg=PiratesGuiGlobals.TextFG2,
text_shadow=PiratesGuiGlobals.TextShadow,
text_wordwrap=11,
text_pos=(-0.029999999999999999, 0, 0),
text_font=PiratesGlobals.getInterfaceFont(),
)
self.costText.setPos(0.47999999999999998, 0, 0.040000000000000001)
示例3: loadData
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemMinLevel [as 别名]
def loadData(self):
itemId = self.data[0]
if UberDogGlobals.InventoryId.isStackable(itemId):
(item, quantity) = self.data
name = PLocalizer.InventoryTypeNames.get(item)
self.quantity = 1
itemType = None
itemTypeName = None
self.price = 5
else:
(category, doId) = self.data
name = PLocalizer.InventoryCategoryNames.get(category)
self.quantity = 1
itemTypeName = 'Object'
self.price = 5
if self.buy:
self.price *= self.quantity
self.price = int(self.price)
self.name = PLocalizer.makeHeadingString(name, 2)
self.itemType = itemTypeName
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])
示例4: createGui
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemMinLevel [as 别名]
def createGui(self):
(item, quantity) = self.data
name = PLocalizer.InventoryTypeNames[item]
self.price = EconomyGlobals.getItemCost(item)
repId = InventoryType.SailingRep
itemTypeName = PLocalizer.InventoryTypeNames.get(repId)
self.itemType = itemTypeName
if self.sell:
self.price /= 2
card = loader.loadModel('models/textureCards/shipRenders')
if item in [
ItemId.INTERCEPTOR_L1,
ItemId.INTERCEPTOR_L2,
ItemId.INTERCEPTOR_L3]:
myTexCard = card.find('**/Interceptor_Render*')
elif item in [
ItemId.MERCHANT_L1,
ItemId.MERCHANT_L2,
ItemId.MERCHANT_L3]:
myTexCard = card.find('**/Merchant_Render*')
elif item in [
ItemId.WARSHIP_L1,
ItemId.WARSHIP_L2,
ItemId.WARSHIP_L3]:
myTexCard = card.find('**/Warship_Render*')
else:
myTexCard = card.find('**/Warship_Render*')
myTex = myTexCard.findAllTextures()[0]
card.removeNode()
del card
self.minLvl = EconomyGlobals.getItemMinLevel(item)
self.miscText = None
self.picture = DirectFrame(parent = self, relief = None, state = DGG.DISABLED, image = myTex, image_scale = 0.059999999999999998, pos = (0.085000000000000006, 0, 0.074999999999999997))
self.picture.setTransparency(1)
self.nameTag = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = name, text_scale = PiratesGuiGlobals.TextScaleMed * PLocalizer.getHeadingScale(2), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.16, 0, 0.105), textMayChange = 0)
self.costText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, geom = self.coinImage, geom_scale = 0.12, geom_pos = Vec3(-0.01, 0, 0.01), text = str(self.price), text_scale = PiratesGuiGlobals.TextScaleSmall, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, text_pos = (-0.029999999999999999, 0, 0), pos = (self.width - 0.035000000000000003, 0, 0.105), text_font = PiratesGlobals.getInterfaceFont())
示例5: loadData
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getItemMinLevel [as 别名]
def loadData(self):
itemId = self.data[0]
name = PLocalizer.LocationNames[itemId]
self.price = EconomyGlobals.StowawayCost[itemId]
self.name = PLocalizer.makeHeadingString(name, 2)
self.minLvl = EconomyGlobals.getItemMinLevel(self.data[0])