Skill

Skill

new Skill(data, savedDataopt)

角色技能对象

Source:
Parameters:
Name Type Attributes Description
data SkillFile

技能文件数据

savedData Object <optional>

技能存档数据

Members

attributes :Object

技能属性映射表

Source:
Type:

clip :Array.<number>

技能图标矩形裁剪区域

Source:
Type:

cooldown :number

技能当前冷却时间

Source:
Type:
  • number

data :Object

技能文件数据

Source:
Type:

duration :number

技能持续冷却时间

Source:
Type:
  • number

events :Object

技能事件映射表

Source:
Type:

icon :string

技能图标文件ID

Source:
Type:
  • string

id :string

技能文件ID

Source:
Type:
  • string

latest :Skill|undefined

最新创建技能

Source:
Type:

parent :SkillManager|null

技能管理器

Source:
Type:

progress

读取技能冷却进度

Source:

script :Script

技能脚本管理器

Source:
Type:

Methods

callEvent(type) → {EventHandler|undefined}

调用技能事件

Source:
Parameters:
Name Type Description
type string

技能事件类型

Returns:
Type:
EventHandler | undefined

cast()

施放角色技能

Source:

decreaseCooldown(cooldown)

减少技能的冷却时间

Source:
Parameters:
Name Type Description
cooldown number

冷却时间(毫秒)

emit(type) → {EventHandler|undefined}

调用技能事件和脚本

Source:
Parameters:
Name Type Description
type string

技能事件类型

Returns:
Type:
EventHandler | undefined

increaseCooldown(cooldown)

增加技能的冷却时间

Source:
Parameters:
Name Type Description
cooldown number

冷却时间(毫秒)

remove()

移除角色技能

Source:

saveData()

保存技能数据

Source:

setCooldown(cooldown)

设置技能的冷却时间

Source:
Parameters:
Name Type Description
cooldown number

冷却时间(毫秒)