当前位置: 首页>>代码示例>>Python>>正文


Python entity.ItemData类代码示例

本文整理汇总了Python中cuwo.entity.ItemData的典型用法代码示例。如果您正苦于以下问题:Python ItemData类的具体用法?Python ItemData怎么用?Python ItemData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ItemData类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PickupAction

class PickupAction(Loader):
    def read(self, reader):
        self.entity_id = reader.read_uint64()
        self.item = ItemData()
        self.item.read(reader)

    def write(self, writer):
        writer.write_uint64(self.entity_id)
        self.item.write(writer)
开发者ID:xEnt22,项目名称:cuwo,代码行数:9,代码来源:packet.py

示例2: PickupAction

class PickupAction(Loader):
    def read(self, reader):
        self.entity_id = reader.read_uint64() # player who picked up
        self.item_data = ItemData()
        self.item_data.read(reader)

    def write(self, writer):
        writer.write_uint64(self.entity_id)
        self.item_data.write(writer)
开发者ID:IFraserAu,项目名称:cuwo,代码行数:9,代码来源:packet.py

示例3: read

 def read(self, reader):
     self.item_data = ItemData()
     self.item_data.read(reader)
     self.pos = reader.read_qvec3()
     self.rotation = reader.read_float() # angle something
     self.scale = reader.read_float()
     self.something3 = reader.read_uint8()
     reader.skip(3)
     self.drop_time = reader.read_uint32() # drop time
     self.something5 = reader.read_uint32() # 320
     self.something6 = reader.read_int32() # 324
开发者ID:IFraserAu,项目名称:cuwo,代码行数:11,代码来源:packet.py

示例4: read

 def read(self, reader):
     self.item_data = ItemData()
     self.item_data.read(reader)
     self.chunk_x = reader.read_int32()
     self.chunk_y = reader.read_int32()
     # index of item in ChunkItems
     self.item_index = reader.read_int32()
     self.something4 = reader.read_uint32()
     self.interact_type = reader.read_uint8()
     self.something6 = reader.read_uint8()
     self.something7 = reader.read_uint16()
开发者ID:Endimmion,项目名称:cuwo,代码行数:11,代码来源:packet.py

示例5: read

 def read(self, reader):
     self.equipment = ItemData()
     self.equipment.read(reader)
     self.chunk_x = reader.read_int32()
     self.chunk_y = reader.read_int32()
     self.something3 = reader.read_int32()
     #
     self.something4 = reader.read_uint32()
     self.interact_type = reader.read_uint8()
     self.something6 = reader.read_uint8()
     self.something7 = reader.read_uint16()
开发者ID:xEnt22,项目名称:cuwo,代码行数:11,代码来源:packet.py

示例6: InteractPacket

class InteractPacket(Packet):
    def read(self, reader):
        self.item_data = ItemData()
        self.item_data.read(reader)
        self.chunk_x = reader.read_int32()
        self.chunk_y = reader.read_int32()
        # index of item in ChunkItems
        self.item_index = reader.read_int32()
        self.something4 = reader.read_uint32()
        self.interact_type = reader.read_uint8()
        self.something6 = reader.read_uint8()
        self.something7 = reader.read_uint16()

    def write(self, writer):
        self.item_data.write(writer)
        writer.write_int32(self.chunk_x)
        writer.write_int32(self.chunk_y)
        writer.write_int32(self.item_index)
        writer.write_uint32(self.something4)
        writer.write_uint8(self.interact_type)
        writer.write_uint8(self.something6)
        writer.write_uint16(self.something7)
开发者ID:Endimmion,项目名称:cuwo,代码行数:22,代码来源:packet.py

示例7: ChunkItemData

class ChunkItemData(Loader):
    def read(self, reader):
        self.item_data = ItemData()
        self.item_data.read(reader)
        self.pos = reader.read_qvec3()
        self.rotation = reader.read_float() # angle something
        self.scale = reader.read_float()
        self.something3 = reader.read_uint8()
        reader.skip(3)
        self.drop_time = reader.read_uint32() # drop time
        self.something5 = reader.read_uint32() # 320
        self.something6 = reader.read_int32() # 324

    def write(self, writer):
        self.item_data.write(writer)
        writer.write_qvec3(self.pos)
        writer.write_float(self.rotation)
        writer.write_float(self.scale)
        writer.write_uint8(self.something3)
        writer.pad(3)
        writer.write_uint32(self.drop_time)
        writer.write_uint32(self.something5)
        writer.write_int32(self.something6)
开发者ID:IFraserAu,项目名称:cuwo,代码行数:23,代码来源:packet.py

示例8: InteractPacket

class InteractPacket(Packet):
    def read(self, reader):
        self.equipment = ItemData()
        self.equipment.read(reader)
        self.chunk_x = reader.read_int32()
        self.chunk_y = reader.read_int32()
        self.something3 = reader.read_int32()
        #
        self.something4 = reader.read_uint32()
        self.interact_type = reader.read_uint8()
        self.something6 = reader.read_uint8()
        self.something7 = reader.read_uint16()
        # print vars(self)

    def write(self, writer):
        self.equipment.write(writer)
        writer.write_int32(self.chunk_x)
        writer.write_int32(self.chunk_y)
        writer.write_int32(self.something3)
        writer.write_uint32(self.something4)
        writer.write_uint8(self.interact_type)
        writer.write_uint8(self.something6)
        writer.write_uint16(self.something7)
开发者ID:xEnt22,项目名称:cuwo,代码行数:23,代码来源:packet.py

示例9: EntitySubAction

class EntitySubAction(Loader):
    def read(self, reader):
        self.item_data = ItemData()
        self.item_data.read(reader)
        self.vec = reader.read_qvec3()
        self.something = reader.read_float() # angle something
        self.something2 = reader.read_float()
        self.something3 = reader.read_uint8()
        reader.skip(3)
        self.something4 = reader.read_uint32() # 316
        self.something5 = reader.read_uint32() # 320
        self.something6 = reader.read_int32() # 324
        # print vars(self)

    def write(self, writer):
        self.item_data.write(writer)
        writer.write_qvec3(self.vec)
        writer.write_float(self.something)
        writer.write_float(self.something2)
        writer.write_uint8(self.something3)
        writer.pad(3)
        writer.write_uint32(self.something4)
        writer.write_uint32(self.something5)
        writer.write_int32(self.something6)
开发者ID:xEnt22,项目名称:cuwo,代码行数:24,代码来源:packet.py

示例10: create_item_data

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
开发者ID:PrinzJuliano,项目名称:cuwo-scripts,代码行数:21,代码来源:loot.py

示例11: __get_loot_item

 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
开发者ID:saber00,项目名称:CuBoltScripts,代码行数:43,代码来源:loot.py


注:本文中的cuwo.entity.ItemData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。