【战斗】===========神兵战斗提交
parent
ab3484709d
commit
b3071916c1
|
@ -24,6 +24,7 @@ local BuffRegister = {
|
||||||
[BuffName.Suppress] = "Suppress",
|
[BuffName.Suppress] = "Suppress",
|
||||||
[BuffName.BuDongSign] = "BuDongSign",
|
[BuffName.BuDongSign] = "BuDongSign",
|
||||||
[BuffName.FalseNoDead] = "FalseNoDead",
|
[BuffName.FalseNoDead] = "FalseNoDead",
|
||||||
|
[BuffName.SuckBlood] = "SuckBlood",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3033,6 +3033,61 @@ local effectList = {
|
||||||
BattleUtil.FinalDamage(skill, caster, target,val, nil, 0, nil, true)
|
BattleUtil.FinalDamage(skill, caster, target,val, nil, 0, nil, true)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
|
-- 造成[a]*[b]%的间接伤害
|
||||||
|
-- a[属性],b[float]
|
||||||
|
[156] = function(caster, target, args, interval, skill)
|
||||||
|
local pro = args[1]
|
||||||
|
local f1 = args[2]
|
||||||
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
|
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local damage = floor(BattleUtil.ErrorCorrection(f1 * caster:GetRoleData(BattlePropList[pro])))
|
||||||
|
BattleUtil.FinalDamage(nil, caster, target, damage, nil, 0, nil, true)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
-- 造成[a]*[b]%的伤害,吸取所有有仇视效果的[c]%生命上限*效果层数的伤害,如果神兵对应英雄回满血,多回的血造成伤害
|
||||||
|
-- a[属性],b[float],c[float]
|
||||||
|
[157] = function(caster, target, args, interval, skill)
|
||||||
|
local pro = args[1]
|
||||||
|
local f1 = args[2]
|
||||||
|
local v1 = args[3]
|
||||||
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
|
if skill.ownHero==nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local damage = floor(BattleUtil.ErrorCorrection(f1 * caster:GetRoleData(BattlePropList[pro])))
|
||||||
|
local arr=RoleManager.Query(function(v) return v.camp~=caster.camp end)
|
||||||
|
local allAddHp=0
|
||||||
|
local addDamage=0
|
||||||
|
addDamage=damage
|
||||||
|
if arr then
|
||||||
|
for i = 1, #arr do
|
||||||
|
--BattleLogic.BuffMgr:HasBuff(arr[i], BuffName.BreakArmor, function (buff) return buff.signType == 5 end)
|
||||||
|
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==arr[i] and buff.type==BuffName.BreakArmor and buff.signType==5 end)
|
||||||
|
local len=BattleUtil.LengthOfTable(list)
|
||||||
|
if len>0 then
|
||||||
|
local addhp=floor(arr[i]:GetRoleData(RoleDataName.MaxHp)*v1)*len
|
||||||
|
allAddHp=allAddHp+ addhp
|
||||||
|
--LogError("吸取的血量==="..addhp.." 层树=="..len)
|
||||||
|
BattleUtil.FinalDamage(nil,caster,arr[i],addhp)
|
||||||
|
BattleLogic.BuffMgr:ClearBuff(arr[i], function(buff)
|
||||||
|
return buff.type == BuffName.BreakArmor and buff.signType==5
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local hp=skill.ownHero:GetRoleData(RoleDataName.MaxHp)-skill.ownHero:GetRoleData(RoleDataName.Hp)
|
||||||
|
--LogError("damage=="..addDamage.." alladdhp=="..allAddHp.." hp=="..hp)
|
||||||
|
if hp>0 then
|
||||||
|
BattleUtil.FinalTreat(caster,skill.ownHero,hp)
|
||||||
|
end
|
||||||
|
if allAddHp>hp then
|
||||||
|
addDamage=addDamage+allAddHp-hp
|
||||||
|
end
|
||||||
|
end
|
||||||
|
BattleUtil.FinalDamage(nil, caster, target,addDamage, nil, 0, nil, true)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12188,5 +12188,33 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.RoleHit, OnDead,nil,nil,role)
|
role.Event:AddEvent(BattleEventName.RoleHit, OnDead,nil,nil,role)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
--受到直接伤害,[a]%概率给目标上[b]类型[c]效果,持续[d]回合,
|
||||||
|
--a[float],b[int],c[int],d[int]
|
||||||
|
[462] = function(role, args)
|
||||||
|
local pro = args[1]
|
||||||
|
local t1 = args[2]
|
||||||
|
local t2 = args[3]
|
||||||
|
local r1 = args[4]
|
||||||
|
local trigger=nil
|
||||||
|
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill)
|
||||||
|
|
||||||
|
if skill then
|
||||||
|
BattleUtil.RandomAction(pro,function()
|
||||||
|
local isBoss=BattleUtil.CheckIsBoss(atkRole)
|
||||||
|
if isBoss then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
atkRole:AddBuff(Buff.Create(role,t1,r1,t2,1,2))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
trigger=RoleManager.GetRoleByCampAndPos(role.camp,role.position)
|
||||||
|
if trigger then
|
||||||
|
trigger.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit,nil,nil,role)
|
||||||
|
end
|
||||||
|
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
return passivityList
|
return passivityList
|
|
@ -2,7 +2,7 @@ BreakArmor = Buff:New()
|
||||||
|
|
||||||
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
||||||
function BreakArmor:SetData(...)
|
function BreakArmor:SetData(...)
|
||||||
self.signType, --1 破军 2.迷魂 3. 4.主角状态
|
self.signType, --1 破军 2.迷魂 3. 4.主角状态 5.仇视
|
||||||
self.signValue1,
|
self.signValue1,
|
||||||
self.signValue2=...
|
self.signValue2=...
|
||||||
-- 刷新排序等级
|
-- 刷新排序等级
|
||||||
|
|
|
@ -9,17 +9,15 @@ function FalseNoDead:SetData(...)
|
||||||
-- 刷新排序等级
|
-- 刷新排序等级
|
||||||
self.sort = 4
|
self.sort = 4
|
||||||
self.triggerTime=0
|
self.triggerTime=0
|
||||||
LogError("self.pro==="..self.pro.." self.time=="..self.time)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 伤害降低
|
-- 伤害降低
|
||||||
function FalseNoDead:onPassiveDamaging(func,attacker, damage, skill)
|
function FalseNoDead:onPassiveDamaging(func,attacker, damage, skill)
|
||||||
if self.triggerTime>=self.time then
|
if self.triggerTime>=self.time then
|
||||||
LogError("22222222222222222")
|
--LogError("22222222222222222")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
LogError("damage=================="..damage)
|
BattleUtil.RandomAction(self.pro,function()
|
||||||
BattleUtil.RandomAction(1,function()
|
|
||||||
local hp=self.target:GetRoleData(RoleDataName.Hp)
|
local hp=self.target:GetRoleData(RoleDataName.Hp)
|
||||||
if damage >= hp then
|
if damage >= hp then
|
||||||
if func then
|
if func then
|
||||||
|
|
|
@ -2,35 +2,21 @@ SuckBlood = Buff:New()
|
||||||
|
|
||||||
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
||||||
function SuckBlood:SetData(...)
|
function SuckBlood:SetData(...)
|
||||||
self.pro,
|
self.pro=...
|
||||||
self.time=...
|
|
||||||
--self.changePro = ... -- buff期间的增伤系数
|
|
||||||
self.cover = true --控制效果可被覆盖
|
self.cover = true --控制效果可被覆盖
|
||||||
-- 刷新排序等级
|
-- 刷新排序等级
|
||||||
self.sort = 4
|
self.sort = 4
|
||||||
self.triggerTime=0
|
self.triggerTime=0
|
||||||
LogError("self.pro==="..self.pro.." self.time=="..self.time)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 伤害降低
|
-- 伤害降低
|
||||||
function SuckBlood:onPassiveDamaging(func,attacker, damage, skill)
|
function SuckBlood:onPassiveDamaging(target, damage, bCrit, finalDmg,damageType,skill)
|
||||||
|
BattleUtil.FinalTreat(self.target, self.target, math.floor(BattleUtil.ErrorCorrection(damage * self.pro)))
|
||||||
LogError("damage=================="..damage)
|
|
||||||
BattleUtil.RandomAction(1,function()
|
|
||||||
local hp=self.target:GetRoleData(RoleDataName.Hp)
|
|
||||||
if damage >= hp then
|
|
||||||
if func then
|
|
||||||
func(hp-1)
|
|
||||||
end
|
|
||||||
self.triggerTime=self.triggerTime+1
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--初始化后调用一次
|
--初始化后调用一次
|
||||||
function SuckBlood:OnStart()
|
function SuckBlood:OnStart()
|
||||||
--
|
self.target.Event:AddEvent(BattleEventName.RoleHit, self.onPassiveDamaging, self)
|
||||||
self.target.Event:AddEvent(BattleEventName.CheckFalseNoDead, self.onPassiveDamaging, self)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd
|
--间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd
|
||||||
|
@ -40,8 +26,7 @@ end
|
||||||
|
|
||||||
--效果结束时调用一次
|
--效果结束时调用一次
|
||||||
function SuckBlood:OnEnd()
|
function SuckBlood:OnEnd()
|
||||||
self.target.Event:RemoveEvent(BattleEventName.CheckFalseNoDead, self.onPassiveDamaging, self)
|
self.target.Event:RemoveEvent(BattleEventName.RoleHit, self.onPassiveDamaging, self)
|
||||||
self.triggerTime=0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--只有当cover字段为true时触发,返回true则被新效果覆盖
|
--只有当cover字段为true时触发,返回true则被新效果覆盖
|
||||||
|
|
|
@ -144,7 +144,6 @@ local _TriggerConfig = {
|
||||||
},
|
},
|
||||||
[BattleEventName.BattleStart] = {
|
[BattleEventName.BattleStart] = {
|
||||||
[5] = function(skill, ...)--5:战前
|
[5] = function(skill, ...)--5:战前
|
||||||
LogError("神兵开展前检测----------------")
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -195,27 +194,24 @@ local _TriggerConfig = {
|
||||||
if skill.ownHero==nil then
|
if skill.ownHero==nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
LogError("castSkill.owner=="..castSkill.owner.uid.." skill.ownHero=="..skill.ownHero.uid)
|
--LogError("castSkill.owner=="..castSkill.owner.uid.." skill.ownHero=="..skill.ownHero.uid)
|
||||||
return castSkill.owner == skill.ownHero and not castSkill.isAdd and (castSkill.type==BattleSkillType.Normal or castSkill.type==BattleSkillType.Special)
|
return castSkill.owner == skill.ownHero and not castSkill.isAdd and (castSkill.type==BattleSkillType.Normal or castSkill.type==BattleSkillType.Special)
|
||||||
end,
|
end,
|
||||||
[17] =function(skill,...) --17:神兵所属者释放普攻
|
[17] =function(skill,...) --17:神兵所属者释放普攻
|
||||||
local args = {...}
|
local args = {...}
|
||||||
local castSkill = args[1]
|
local castSkill = args[1]
|
||||||
if skill.ownHero==nil then
|
if skill.ownHero==nil then
|
||||||
LogError("///////////////")
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
LogError("============================17")
|
--LogError("============================17")
|
||||||
return castSkill.owner == skill.ownHero and castSkill.type==BattleSkillType.Normal
|
return castSkill.owner == skill.ownHero and castSkill.type==BattleSkillType.Normal
|
||||||
end,
|
end,
|
||||||
[19] =function(skill,...) --16:神兵所属者释放技能(不包含追加技能)
|
[19] =function(skill,...) --19:神兵所属者释放技能(不包含追加技能)
|
||||||
local args = {...}
|
local args = {...}
|
||||||
local castSkill = args[1]
|
local castSkill = args[1]
|
||||||
if skill.ownHero==nil then
|
if skill.ownHero==nil then
|
||||||
LogError("111111111111111")
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
LogError("2222222222")
|
|
||||||
return castSkill.owner == skill.ownHero and not castSkill.isAdd and (castSkill.type==BattleSkillType.Special or castSkill.type==BattleSkillType.Extra )
|
return castSkill.owner == skill.ownHero and not castSkill.isAdd and (castSkill.type==BattleSkillType.Special or castSkill.type==BattleSkillType.Extra )
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
@ -248,7 +248,7 @@ function this.GetWeaponFormationTeamAddPro(heroFormationNum)
|
||||||
-- local heroFormationNum = #formationHeros
|
-- local heroFormationNum = #formationHeros
|
||||||
for key, value in pairs(allPro) do
|
for key, value in pairs(allPro) do
|
||||||
--LogError("key====="..key.." value=="..value/heroFormationNum)
|
--LogError("key====="..key.." value=="..value/heroFormationNum)
|
||||||
allPro[key] = math.floor(value/heroFormationNum)
|
allPro[key] = math.floor(value)
|
||||||
end
|
end
|
||||||
return allPro
|
return allPro
|
||||||
end
|
end
|
||||||
|
|
|
@ -224,7 +224,7 @@ Func_Prop_Filter = {
|
||||||
local allPro = {}
|
local allPro = {}
|
||||||
for key, value in pairs(funcData) do
|
for key, value in pairs(funcData) do
|
||||||
if value > 0 then
|
if value > 0 then
|
||||||
allPro[key] = math.floor(value/heroFormationNum)
|
allPro[key] = math.floor(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return allPro
|
return allPro
|
||||||
|
|
Loading…
Reference in New Issue