55 lines
1.7 KiB
Lua
55 lines
1.7 KiB
Lua
require("Modules.Battle.Logic.Monster.MonsterSkill.MTrigger")
|
|
require("Modules.Battle.Logic.Monster.MonsterSkill.MSkill")
|
|
require("Modules.Battle.Logic.Monster.MonsterSkill.MSkillGroup")
|
|
|
|
MSkillManager = {}
|
|
local this = MSkillManager
|
|
|
|
this.isInit=false
|
|
function this.Init()
|
|
this.isInit=true
|
|
this.MSkillGroupList = {} -- 技能组列表
|
|
this.MSkillList = {} -- 技能列表
|
|
MTrigger.Init()
|
|
end
|
|
|
|
-- 创建一个技能组
|
|
function this.CreateMSkillGroup(monster, groupIndex, skillGroupData)
|
|
local position = monster:GetCamp() * 6 + monster:GetPosition()
|
|
if not this.MSkillGroupList then
|
|
this.MSkillGroupList = {}
|
|
end
|
|
if not this.MSkillGroupList[position] then
|
|
this.MSkillGroupList[position] = MSkillGroup:New()
|
|
end
|
|
this.MSkillGroupList[position]:Init(monster, groupIndex, skillGroupData)
|
|
return this.MSkillGroupList[position]
|
|
end
|
|
|
|
-- 创建一个技能
|
|
function this.CreateMSkill(monster, group, index, skilldata,groupIndex)
|
|
local owner = group:GetOwner()
|
|
local groupIndex = group.groupIndex
|
|
local position = owner:GetCamp() * 6 + owner:GetPosition()
|
|
if not this.MSkillList then
|
|
this.MSkillList = {}
|
|
end
|
|
if not this.MSkillList[position] then
|
|
this.MSkillList[position] = {}
|
|
end
|
|
if not this.MSkillList[position][groupIndex] then
|
|
this.MSkillList[position][groupIndex] = {}
|
|
end
|
|
if not this.MSkillList[position][groupIndex][index] then
|
|
this.MSkillList[position][groupIndex][index] = MSkill:New()
|
|
end
|
|
this.MSkillList[position][groupIndex][index]:Init(monster, group, index, skilldata,groupIndex)
|
|
|
|
return this.MSkillList[position][groupIndex][index]
|
|
end
|
|
function this.Clear()
|
|
this.isInit=false
|
|
end
|
|
|
|
|
|
return MSkillManager |