【战斗】===========神兵战斗提交

dev_chengFeng
wangzhenxing 2023-04-06 17:21:35 +08:00
parent ab3484709d
commit b3071916c1
9 changed files with 97 additions and 34 deletions

View File

@ -24,6 +24,7 @@ local BuffRegister = {
[BuffName.Suppress] = "Suppress",
[BuffName.BuDongSign] = "BuDongSign",
[BuffName.FalseNoDead] = "FalseNoDead",
[BuffName.SuckBlood] = "SuckBlood",
}

View File

@ -3033,6 +3033,61 @@ local effectList = {
BattleUtil.FinalDamage(skill, caster, target,val, nil, 0, nil, true)
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,
}

View File

@ -12188,5 +12188,33 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleHit, OnDead,nil,nil,role)
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

View File

@ -2,7 +2,7 @@ BreakArmor = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function BreakArmor:SetData(...)
self.signType, --1 破军 2.迷魂 3. 4.主角状态
self.signType, --1 破军 2.迷魂 3. 4.主角状态 5.仇视
self.signValue1,
self.signValue2=...
-- 刷新排序等级

View File

@ -9,17 +9,15 @@ function FalseNoDead:SetData(...)
-- 刷新排序等级
self.sort = 4
self.triggerTime=0
LogError("self.pro==="..self.pro.." self.time=="..self.time)
end
-- 伤害降低
function FalseNoDead:onPassiveDamaging(func,attacker, damage, skill)
if self.triggerTime>=self.time then
LogError("22222222222222222")
--LogError("22222222222222222")
return
end
LogError("damage=================="..damage)
BattleUtil.RandomAction(1,function()
BattleUtil.RandomAction(self.pro,function()
local hp=self.target:GetRoleData(RoleDataName.Hp)
if damage >= hp then
if func then

View File

@ -2,35 +2,21 @@ SuckBlood = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function SuckBlood:SetData(...)
self.pro,
self.time=...
--self.changePro = ... -- buff期间的增伤系数
self.pro=...
self.cover = true --控制效果可被覆盖
-- 刷新排序等级
self.sort = 4
self.triggerTime=0
LogError("self.pro==="..self.pro.." self.time=="..self.time)
end
-- 伤害降低
function SuckBlood:onPassiveDamaging(func,attacker, damage, skill)
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)
function SuckBlood:onPassiveDamaging(target, damage, bCrit, finalDmg,damageType,skill)
BattleUtil.FinalTreat(self.target, self.target, math.floor(BattleUtil.ErrorCorrection(damage * self.pro)))
end
--初始化后调用一次
function SuckBlood:OnStart()
--
self.target.Event:AddEvent(BattleEventName.CheckFalseNoDead, self.onPassiveDamaging, self)
self.target.Event:AddEvent(BattleEventName.RoleHit, self.onPassiveDamaging, self)
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
@ -40,8 +26,7 @@ end
--效果结束时调用一次
function SuckBlood:OnEnd()
self.target.Event:RemoveEvent(BattleEventName.CheckFalseNoDead, self.onPassiveDamaging, self)
self.triggerTime=0
self.target.Event:RemoveEvent(BattleEventName.RoleHit, self.onPassiveDamaging, self)
end
--只有当cover字段为true时触发返回true则被新效果覆盖

View File

@ -144,7 +144,6 @@ local _TriggerConfig = {
},
[BattleEventName.BattleStart] = {
[5] = function(skill, ...)--5战前
LogError("神兵开展前检测----------------")
return true
end
},
@ -195,27 +194,24 @@ local _TriggerConfig = {
if skill.ownHero==nil then
return
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)
end,
[17] =function(skill,...) --17:神兵所属者释放普攻
local args = {...}
local castSkill = args[1]
if skill.ownHero==nil then
LogError("///////////////")
return
end
LogError("============================17")
--LogError("============================17")
return castSkill.owner == skill.ownHero and castSkill.type==BattleSkillType.Normal
end,
[19] =function(skill,...) --16:神兵所属者释放技能(不包含追加技能)
[19] =function(skill,...) --19:神兵所属者释放技能(不包含追加技能)
local args = {...}
local castSkill = args[1]
if skill.ownHero==nil then
LogError("111111111111111")
return
end
LogError("2222222222")
return castSkill.owner == skill.ownHero and not castSkill.isAdd and (castSkill.type==BattleSkillType.Special or castSkill.type==BattleSkillType.Extra )
end,
},

View File

@ -248,7 +248,7 @@ function this.GetWeaponFormationTeamAddPro(heroFormationNum)
-- local heroFormationNum = #formationHeros
for key, value in pairs(allPro) do
--LogError("key====="..key.." value=="..value/heroFormationNum)
allPro[key] = math.floor(value/heroFormationNum)
allPro[key] = math.floor(value)
end
return allPro
end

View File

@ -224,7 +224,7 @@ Func_Prop_Filter = {
local allPro = {}
for key, value in pairs(funcData) do
if value > 0 then
allPro[key] = math.floor(value/heroFormationNum)
allPro[key] = math.floor(value)
end
end
return allPro