本文整理汇总了Python中cuwo.entity.ItemData.level方法的典型用法代码示例。如果您正苦于以下问题:Python ItemData.level方法的具体用法?Python ItemData.level怎么用?Python ItemData.level使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cuwo.entity.ItemData
的用法示例。
在下文中一共展示了ItemData.level方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __get_loot_item
# 需要导入模块: from cuwo.entity import ItemData [as 别名]
# 或者: from cuwo.entity.ItemData import level [as 别名]
def __get_loot_item(self, player):
"""Gets a loot item for a specified player.
Keyword arguments:
player -- The player to get a loot item for.
Return value:
An ItemData instance describing the item.
"""
l = self.__loot
item = ItemData()
item.minus_modifier = 0
item.flags = 0
item.items = []
for _ in range(32):
item.items.append(ItemUpgrade())
item.upgrade_count = 0
if l >= LOOT_COMMON and l <= LOOT_LEGENDARY:
item.type = random.randint(ITEM_TYPE_WEAPON,
ITEM_TYPE_RING)
item.sub_type = self.__get_sub_type(item.type, player)
item.modifier = random.randint(1, 10)
item.rarity = l
item.material = self.__get_material(item.type,
item.sub_type, player)
item.level = player.entity.level
elif l >= LOOT_SPIRIT_FIRE and l <= LOOT_SPIRIT_WIND:
item.type = ITEM_TYPE_SPIRIT
item.sub_type = ITEM_SUB_TYPE_SPIRIT
item.modifier = 0
item.rarity = ITEM_RARITY_RARE
# 128: Fire, 129: Unholy, 130: Ice, 131: Wind
item.material = 123 + l
item.level = player.entity.level
else: # Mana Cube
item.type = 25
item.sub_type = 0
item.modifier = 0
item.rarity = 0
item.material = 0
item.level = 0
return item
示例2: create_item_data
# 需要导入模块: from cuwo.entity import ItemData [as 别名]
# 或者: from cuwo.entity.ItemData import level [as 别名]
def create_item_data():
item_data = ItemData()
item_data.type = 0
item_data.sub_type = 0
item_data.modifier = 0
item_data.minus_modifier = 0
item_data.rarity = 0
item_data.material = 0
item_data.flags = 0
item_data.level = 0
item_data.items = []
for _ in range(32):
new_item = ItemUpgrade()
new_item.x = 0
new_item.y = 0
new_item.z = 0
new_item.material = 0
new_item.level = 0
item_data.items.append(new_item)
item_data.upgrade_count = 0
return item_data