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

42 lines
1.3 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
function this.Init()
this.MSkillGroupList = {} -- 技能组列表
this.MSkillList = {} -- 技能列表
MTrigger.Init()
end
-- 创建一个技能组
function this.CreateMSkillGroup(monster, skillGroupData)
local index = monster:GetCamp() * 6 + monster:GetPosition()
if not this.MSkillGroupList then
this.MSkillGroupList = {}
end
if not this.MSkillGroupList[index] then
this.MSkillGroupList[index] = MSkillGroup:New()
end
this.MSkillGroupList[index]:Init(monster, skillGroupData)
end
-- 创建一个技能
function this.CreateMSkill(monster, group, index, skilldata)
local owner = group:GetOwner()
local m_index = owner:GetCamp() * 6 + owner:GetPosition()
if not this.MSkillList then
this.MSkillList = {}
end
if not this.MSkillList[m_index] then
this.MSkillList[m_index] = {}
end
if not this.MSkillList[m_index][index] then
this.MSkillList[m_index][index] = MSkill:New()
end
this.MSkillList[m_index][index]:Init(monster, group, index, skilldata)
end
return MSkillManager