[战斗]========技能149 被动429 430 431修改提交

dev_chengFeng
wangzhenxing 2022-03-18 15:47:16 +08:00
parent d0b2ff1cd8
commit 9e010245fe
7 changed files with 71 additions and 10 deletions

View File

@ -2890,7 +2890,7 @@ local effectList = {
target:SetRelive(pro, caster)
end,
--造成[a]%的[b]伤害,造成伤害的[c]%用于医疗生命值最低的队友。(攻击目标为多人治疗不重复)
--a[float],b[伤害类型],c[float] ,d[int]
--a[float],b[伤害类型],c[float]
[148] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
@ -2901,8 +2901,6 @@ local effectList = {
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
BattleUtil.SortByHpFactor(arr, 1)
-- 检测技能伤害治疗加成
-- 治疗血量最低队友实际伤害的f2%
--之前是finaldag 改成 damage
for i = 1, #arr do
if not BattleUtil.ChecklistIsContainValue(skill.targets,arr[i]) then
@ -2920,6 +2918,41 @@ local effectList = {
end)
end,
--造成[a]%的[b]伤害,造成技能总伤害的[c]%用于医疗生命值最低的队友(治疗队友数为集中敌人数)。
--a[float],b[伤害类型],c[float] ,d[int]
[149] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
local f2 = args[3]
local num = args[4]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,curSkill)
if curSkill then
curSkill.skillDamage=curSkill.skillDamage+damage
end
end
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
BattleUtil.CalDamage(skill, caster, target, dt, f1)
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
local OnSkillEnd
OnSkillEnd=function(skill)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
BattleUtil.SortByHpFactor(arr, 1)
for i = 1, #arr do
if not BattleUtil.ChecklistIsContainValue(skill.targets,arr[i]) then
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
BattleUtil.ApplyTreat(caster, arr[i], floor(skill.skillDamage*f2))
table.insert(skill.targets,arr[i])
break
end
end
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
end
caster.Event:AddEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
end)
end,
}

View File

@ -11053,6 +11053,10 @@ local passivityList = {
if skill and not skill.isTriggerJudge and judge==1 then
return
end
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
local list = skill:GetDirectTargets()
if list then
for i = 1, #list do
@ -11078,6 +11082,10 @@ local passivityList = {
if not skill then
return
end
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
if skill and not skill.isTriggerJudge and judge==1 then
return
end
@ -11105,6 +11113,10 @@ local passivityList = {
if skill and not skill.isTriggerJudge and judge==1 then
return
end
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
if type and type==1 and skill.type~=BattleSkillType.Special then
return
end
@ -11204,9 +11216,14 @@ local passivityList = {
local ct = args[3]
local v1 = args[4]
local r1 = args[5]
local buff2=nil
local onHit = function(target, damage, bCrit, finalDmg)
BattleUtil.RandomAction(p1,function()
target:AddBuff(Buff.Create(role, BuffName.PropertyChange,r1, BattlePropList[pro], v1, ct))
buff2=Buff.Create(role, BuffName.PropertyChange,r1, BattlePropList[pro], v1, ct)
local aaa=BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function (buff) return buff.propertyName==buff2.propertyName and buff.Value==buff2.Value and buff.changeType==buff2.changeType end)
if not aaa then
target:AddBuff(buff2)
end
end)
end
local onSkillCast = function(skill)

View File

@ -31,8 +31,9 @@ function Monster:Init(data)
self.Event:ClearEvent()
self.exileTargets={}--已经被放逐过的目标
-- self.skillGroup = MSkillManager.CreateMSkillGroup(self, data.skill)
-- self.skillList=data.skill
self.skillNum=#data.skill
self.skillGroupList = {}
for i = 1, #data.skill do
-- LogError("---------------------"..data.skill[i].skillData.effect[1])

View File

@ -7,7 +7,7 @@ function MSkill:New()
return o
end
function MSkill:Init(owner, group, index, skillData)
function MSkill:Init(owner, group, index, skillData,playerSkillIndex)
self.owner = owner
self.group = group
self.groupIndex = index
@ -16,7 +16,15 @@ function MSkill:Init(owner, group, index, skillData)
self.isAdd = false
self.isRage = false
self.type = BattleSkillType.Monster
--后端传过来的数据最后一个是主角技能
if owner.position==100 then
if playerSkillIndex==self.owner.skillNum then
self.isPlayerSkill=true
else
self.isPlayerSkill=false
end
end
self.curCastCount = 0
self.maxCastCount = self.skillData.maxCount
-- LogError("monster skill id=="..skillData.effect[1])

View File

@ -22,7 +22,7 @@ function MSkillGroup:Init(monster, groupIndex, groupData)
-- end
for i = 1, #self.skillGroupData do
self.skillList[i] = MSkillManager.CreateMSkill(monster, self, i, self.skillGroupData[i])
self.skillList[i] = MSkillManager.CreateMSkill(monster, self, i, self.skillGroupData[i],groupIndex)
end
end

View File

@ -25,7 +25,7 @@ function this.CreateMSkillGroup(monster, groupIndex, skillGroupData)
end
-- 创建一个技能
function this.CreateMSkill(monster, group, index, skilldata)
function this.CreateMSkill(monster, group, index, skilldata,groupIndex)
local owner = group:GetOwner()
local groupIndex = group.groupIndex
local position = owner:GetCamp() * 6 + owner:GetPosition()
@ -41,7 +41,7 @@ function this.CreateMSkill(monster, group, index, skilldata)
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)
this.MSkillList[position][groupIndex][index]:Init(monster, group, index, skilldata,groupIndex)
return this.MSkillList[position][groupIndex][index]
end

View File

@ -25,6 +25,7 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage,isTriggerJudg
self.isRage = isRage
self.isNotLoop= false
self.targets={}
self.skillDamage=0
if isTriggerJudge~=nil then
self.isTriggerJudge=isTriggerJudge
else
@ -150,6 +151,7 @@ function Skill:EndSkill()
-- 结束回调
self.isTriggePassivity=false
self.triggerPassivityId={}
self.skillDamage=0
if self.castDoneFunc then self.castDoneFunc() end
self.targets={}
end)