back_recharge
lvxinran 2020-10-31 04:45:44 +08:00
parent 1ee9ca08fa
commit 74ccf05238
4 changed files with 35 additions and 4 deletions

View File

@ -4,6 +4,7 @@ Monster = {}
function Monster:New()
local o = {
data=RoleData.New(),
buffFilter=BattleList.New(),
Event = BattleEvent:New()
}
setmetatable(o, self)
@ -20,11 +21,41 @@ function Monster:Init(data)
self.uid= data.id
self.roleData = data
self.data:Init(self, data.property)
self.buffFilter:Clear() --buff屏蔽列表
self.Event:ClearEvent()
self.skillGroup = MSkillManager.CreateMSkillGroup(self, data.skill)
end
function Monster:AddBuff(buff)
-- buff的miss率
local missF = 0
-- 检测被动对miss概率的影响
local cl = {}
local function _CallBack(v, ct)
if v then
table.insert(cl, {v, ct})
end
end
BattleLogic.Event:DispatchEvent(BattleEventName.RoleAddBuffMiss, _CallBack, self, buff)
missF = BattleUtil.CountChangeList(missF, cl)
-- 如果概率为0 或者没有miss
if missF == 0 or not BattleUtil.RandomAction(missF, function() BattleLogic.BuffMgr:PutBuff(buff) end) then
for i=1, self.buffFilter.size do
if self.buffFilter.buffer[i](buff) then
BattleLogic.BuffMgr:PutBuff(buff)
return
end
end
BattleLogic.BuffMgr:AddBuff(self, buff)
end
end
function Monster:GetRoleData(property)
local tarPro = self.data:GetData(property)
return tarPro

View File

@ -23,7 +23,7 @@ function MSkill:Init(owner, group, index, skillData)
self.curRoundCount = 0
self.maxRoundCount = self.skillData.maxRoundCount
LogError("最大释放次数"..self.maxCastCount.."最大回合次数"..self.maxRoundCount)
--LogError("最大释放次数"..self.maxCastCount.."最大回合次数"..self.maxRoundCount)
-- 将技能加入触发检测
MTrigger.AddSkill(self.skillData.triggerId, self.skillData.triggerCondition, self)

View File

@ -14,8 +14,8 @@ function MSkillGroup:Init(monster, groupData)
self.skillGroupData = groupData
-- 创建技能
self.skillList = {}
for index, data in ipairs(self.skillGroupData) do
self.skillList[index] = MSkillManager.CreateMSkill(monster, self, index, data[1])
for index, data in ipairs(self.skillGroupData[1]) do
self.skillList[index] = MSkillManager.CreateMSkill(monster, self, index, data)
end
end

View File

@ -17,7 +17,7 @@ end
--
function this.AddMonsterSkill(skill)
LogPink("灵兽技能加入"..skill.id)
--LogPink("灵兽技能加入"..skill.id)
if skill.type == BattleSkillType.Monster then
table.insert(this.MonsterSkillList, skill)
end