2022-04-01 20:51:01 +08:00
|
|
|
---@class Skill : Object
|
|
|
|
---@field name string
|
|
|
|
---@field frequency Frequency
|
|
|
|
---@field visible boolean
|
2023-01-29 18:11:41 +08:00
|
|
|
---@field mute boolean
|
|
|
|
---@field anim_type string
|
2022-09-14 13:01:10 +08:00
|
|
|
---@field related_skills Skill[]
|
2022-03-31 13:29:23 +08:00
|
|
|
local Skill = class("Skill")
|
|
|
|
|
2022-04-01 20:51:01 +08:00
|
|
|
---@alias Frequency integer
|
2022-03-25 12:28:07 +08:00
|
|
|
|
2022-04-01 20:51:01 +08:00
|
|
|
Skill.Frequent = 1
|
|
|
|
Skill.NotFrequent = 2
|
|
|
|
Skill.Compulsory = 3
|
|
|
|
Skill.Limited = 4
|
|
|
|
Skill.Wake = 5
|
2022-03-25 12:28:07 +08:00
|
|
|
|
2022-04-01 20:51:01 +08:00
|
|
|
function Skill:initialize(name, frequency)
|
2022-04-30 15:27:56 +08:00
|
|
|
-- TODO: visible, lord, etc
|
|
|
|
self.name = name
|
|
|
|
self.frequency = frequency
|
|
|
|
self.visible = true
|
2023-01-29 18:11:41 +08:00
|
|
|
self.mute = false
|
|
|
|
self.anim_type = ""
|
2022-09-14 13:01:10 +08:00
|
|
|
self.related_skills = {}
|
2023-01-29 18:11:41 +08:00
|
|
|
|
|
|
|
if string.sub(name, 1, 1) == "#" then
|
|
|
|
self.visible = false
|
|
|
|
end
|
2022-09-14 13:01:10 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
---@param skill Skill
|
|
|
|
function Skill:addRelatedSkill(skill)
|
|
|
|
table.insert(self.related_skills, skill)
|
2022-03-25 12:28:07 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return Skill
|