Equipment

Equipment

new Equipment(data, savedDataopt)

角色装备对象

Source:
Parameters:
Name Type Attributes Description
data EquipmentFile

装备文件数据

savedData Object <optional>

装备存档数据

Members

attributes :Object

装备属性映射表

Source:
Type:

clip :Array.<number>

装备图标矩形裁剪区域

Source:
Type:

data :Object

装备文件数据

Source:
Type:

events :Object

装备事件映射表

Source:
Type:

icon :string

装备图标文件ID

Source:
Type:
  • string

id :string

装备文件ID

Source:
Type:
  • string

latest :Equipment|undefined

最新创建装备

Source:
Type:

order :number

装备在库存中的位置 如果不在库存中为-1

Source:
Type:
  • number

parent :Inventory|EquipmentManager|null

父级对象

Source:
Type:

script :Script

装备脚本管理器

Source:
Type:

slot :string

装备槽

Source:
Type:
  • string

Methods

callEvent(type) → {EventHandler|undefined}

调用装备事件

Source:
Parameters:
Name Type Description
type string

装备事件类型

Returns:
Type:
EventHandler | undefined

emit(type, actoropt)

调用装备事件和脚本

Source:
Parameters:
Name Type Attributes Description
type string

装备事件类型

actor Actor <optional>

事件触发角色

equip(slot, actoropt)

穿上角色装备(共享库存的代价:需要传递事件触发角色)

Source:
Parameters:
Name Type Attributes Description
slot string

装备槽

actor Actor <optional>

事件触发角色

remove()

移除角色装备

Source:

saveData()

保存装备数据

Source: