miduo_server/luafight/Modules/Battle/Logic/Monster/MonsterSkill/MSkillManager.lua

55 lines
1.7 KiB
Lua
Raw Normal View History

2020-10-29 16:36:10 +08:00
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
2023-04-07 16:43:05 +08:00
this.isInit=false
2020-10-29 16:36:10 +08:00
function this.Init()
2023-04-07 16:43:05 +08:00
this.isInit=true
2020-10-29 16:36:10 +08:00
this.MSkillGroupList = {} -- 技能组列表
this.MSkillList = {} -- 技能列表
MTrigger.Init()
end
-- 创建一个技能组
2021-10-22 16:59:08 +08:00
function this.CreateMSkillGroup(monster, groupIndex, skillGroupData)
local position = monster:GetCamp() * 6 + monster:GetPosition()
2020-10-29 16:36:10 +08:00
if not this.MSkillGroupList then
this.MSkillGroupList = {}
end
2021-10-22 16:59:08 +08:00
if not this.MSkillGroupList[position] then
this.MSkillGroupList[position] = MSkillGroup:New()
2020-10-29 16:36:10 +08:00
end
2021-10-22 16:59:08 +08:00
this.MSkillGroupList[position]:Init(monster, groupIndex, skillGroupData)
return this.MSkillGroupList[position]
2020-10-29 16:36:10 +08:00
end
-- 创建一个技能
2022-03-22 17:20:23 +08:00
function this.CreateMSkill(monster, group, index, skilldata,groupIndex)
2020-10-29 16:36:10 +08:00
local owner = group:GetOwner()
2021-10-22 16:59:08 +08:00
local groupIndex = group.groupIndex
local position = owner:GetCamp() * 6 + owner:GetPosition()
2020-10-29 16:36:10 +08:00
if not this.MSkillList then
this.MSkillList = {}
end
2021-10-22 16:59:08 +08:00
if not this.MSkillList[position] then
this.MSkillList[position] = {}
2020-10-29 16:36:10 +08:00
end
2021-10-22 16:59:08 +08:00
if not this.MSkillList[position][groupIndex] then
this.MSkillList[position][groupIndex] = {}
2020-10-29 16:36:10 +08:00
end
2021-10-22 16:59:08 +08:00
if not this.MSkillList[position][groupIndex][index] then
this.MSkillList[position][groupIndex][index] = MSkill:New()
end
2022-03-22 17:20:23 +08:00
this.MSkillList[position][groupIndex][index]:Init(monster, group, index, skilldata,groupIndex)
2021-10-22 16:59:08 +08:00
return this.MSkillList[position][groupIndex][index]
2020-10-29 16:36:10 +08:00
end
2023-04-07 16:43:05 +08:00
function this.Clear()
this.isInit=false
end
2020-10-29 16:36:10 +08:00
return MSkillManager