diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index fe176fb727..591f9e3652 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -17,6 +17,7 @@ local BuffRegister = { [BuffName.Brand] = "Brand", [BuffName.Blood] = "Blood", [BuffName.BanBlood] = "BanBlood", + [BuffName.SigilSign] = "SigilSign", } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua index 6d40295a12..9366b07c0a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua @@ -2731,6 +2731,62 @@ local effectList = { end) end) end, + -- [a]%概率造成[b],每回合造成[c]%自身[d]的伤害,持续[e]回合;[f]%概率使目标灼烧2层,[g]%概率3层 + -- a[float]b[持续伤害状态].c[float],d[属性]e[int],f[float],g[float] + [141] = function(caster, target, args, interval, skill) + local f1 = args[1] + local dot = args[2] + local f2 = args[3] + local pro = args[4] + local i1 = args[5] + local p1 = args[6] + local p2 = args[7] + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target) + BattleLogic.WaitForTrigger(interval, function () + local floor=0 + local rand=Random.Range01() + if rand<=p2 then + floor=3 + end + if floor==0 and rand<=p1 then + floor=2 + end + if floor==0 and rand<=f2 then + floor=1 + end + + local damage = BattleUtil.ErrorCorrection(f2 * caster:GetRoleData(BattlePropList[pro])) + if floor~=0 then + for i = 1, floor do + -- local buff = Buff.Create(caster, BuffName.DOT, i1, 1, dot, floor(damage)) + -- buff.skill=skill + -- buff.isRealDamage = true + -- target:AddBuff(buff) + BattleUtil.RandomDot(1, dot, caster, target, i1, 1, damage,skill) + end + end + + end) + end, + --概率[a]添加[b]类型[c]效果,持续[d]回合,参数1[e],参数2[f] + --a[float],b[int],c[int],d[int],e[int/float],f[int/float] + [142] = function(caster, target, args, interval, skill) + local pro=args[1] + local t1=args[2] + local t2=args[3] + local r1=args[4] + local v1=args[5] + local v2=args[6] + BattleLogic.WaitForTrigger(interval, function () + if t1==BuffName.SigilSign then + BattleUtil.RandomAction(pro,function() + local buff=Buff.Create(target, t1, r1) + target:AddBuff(buff) + end) + end + end) + + end, } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index debf41a8f1..82dc90b6ea 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -2444,13 +2444,16 @@ local passivityList = { -- [129] = {}, - -- 死亡后持续战斗两回合期间受伤不致死,[a]回合后自动死亡。期间技能伤害降低[b]%无法触发追击效果且死后无法被复活。受到伤害[c]改变 - -- a[int]b[float]c[改变类型] + -- 死亡后持续战斗两回合期间受伤不致死,[a]回合后自动死亡。期间技能伤害降低[b]%无法触发追击效果且死后无法被复活。受到伤害[c]改变,[d]%概率不会直接死亡,回复[e]%生命 + -- a[int],b[float],c[改变类型],d[float],e[float] [130] = function(role, args) local i1 = args[1] local f1 = args[2] local ct = args[3] + local p1 = args[4] + local p2 = args[5] role.isHaveNoDead = true + local isTrigger=false -- 角色死亡时 local onRoleDead = function(atkRole) -- -- 暂时不能死 @@ -2480,9 +2483,12 @@ local passivityList = { -- end -- end -- role.Event:AddEvent(BattleEventName.RoleTurnEnd, onRoleTurnEnd) - - local buff = Buff.Create(role, BuffName.NoDead, i1, f1, ct, false) + if isTrigger then + return + end + local buff = Buff.Create(role, BuffName.NoDead, i1, f1, ct, false,p1,p2) BattleLogic.BuffMgr:AddBuff(role, buff) + isTrigger=true end role.Event:AddEvent(BattleEventName.RoleDead, onRoleDead,nil,nil,role) end, @@ -4150,7 +4156,7 @@ local passivityList = { table.insert(ctrls,ctr3) end local immune = function(buff) - return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType)) + return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType)),role end local curBuff=nil BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound) @@ -5085,14 +5091,21 @@ local passivityList = { BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, _OnRoundChange,nil,nil,role) end, - -- 我方每有一个[a]武将,自身[d]改变[b]的[c],可叠加(第一回合开始时生效) - -- a[元素],b[float],c[属性],d[改变类型] + -- 我方每有一个[a]武将,自身[b]%的[c]属性[d]改变,[e]%的[f]属性[g]改变 范围类型[h] 可叠加(第一回合开始时生效) + -- a[元素],b[float],c[属性],d[改变类型],e[float],f[int],g[int 改变类型],h[int 0/不填 自身 1:全体] [235] = function(role, args) local ele = args[1] local f1 = args[2] local pro = args[3] local ct = args[4] + local f2 = args[5] + local pro2 = args[6] + local ct2 = args[7] + local type = args[8] + if not args[8] then + type=0 + end local function _OnRoundChange(curRound) if curRound == 1 then local list = RoleManager.Query(function(r) @@ -5100,7 +5113,27 @@ local passivityList = { end) -- local num = #list - BattleUtil.AddProp(role, pro, f1*num, ct) + if type==0 then + --BattleUtil.AddProp(role, pro, f1*num, ct) + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1*num, ct) + role:AddBuff(buff) + if f2 and pro2 and ct2 then + local buff2 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro2], f2*num, ct2) + role:AddBuff(buff2) + end + else + local list2 = RoleManager.Query(function(r) + return r.camp == role.camp + end) + for i = 1, #list2 do + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1*num, ct) + list2[i]:AddBuff(buff) + if f2 and pro2 and ct2 then + local buff2 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro2], f2*num, ct2) + list2[i]:AddBuff(buff2) + end + end + end end end BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, _OnRoundChange,nil,nil,role) @@ -5626,11 +5659,14 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role) end, - --技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害 - -- a[float] + --技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害,并降低其[b]点怒气 + -- a[float],b[int] [257]=function(role,args,id,judge) local f1 = args[1] - local dt = args[2] + local num = args[2] + if not args[2] then + num=0 + end local point=nil -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) @@ -5643,10 +5679,14 @@ local passivityList = { list = BattleUtil.SortByHpFactor(list,0) -- if not list[1]:IsDead() then if list then - if not point then - point=list[1] - end - BattleUtil.FinalDamage(nil,role,point,dmg) + if not point then + point=list[1] + end + BattleUtil.FinalDamage(nil,role,point,dmg) + if num>0 then + BattleUtil.CalRage(role,point,num,CountTypeName.Sub) + end + end -- end @@ -5996,7 +6036,7 @@ local passivityList = { local sta3=args[3] local skiller=nil local immune = function(buff) - return buff.type == BuffName.DOT and (buff.damageType==sta2 or buff.damageType==sta3) + return buff.type == BuffName.DOT and (buff.damageType==sta2 or buff.damageType==sta3),role end local curBuff=nil @@ -6142,7 +6182,7 @@ local passivityList = { local sta3=args[3] local skiller=nil local immune = function(buff) - return buff.type == BuffName.Control + return buff.type == BuffName.Control,role end local curBuff=nil local immuneState=false @@ -7138,7 +7178,7 @@ local passivityList = { table.insert(ctrls,ctr3) end local immune = function(buff) - return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType)) + return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType)),role end -- 释放技能后 local onSkillEnd = function(skill) @@ -9450,15 +9490,28 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveDamaging, passiveDmg,nil,nil,role) end, - -- 技能治疗的目标[a]属性[b]改变[c]%,持续[d]回合 - -- a[int],b[改变类型],c[float],d[int] + -- 技能治疗的目标[a]属性[b]改变[c]%,持续[d]回合 buff类型[e] + -- a[int],b[改变类型],c[float],d[int],e[int 0/不填:可叠加;1:不叠加 ] [384] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] local v1 = args[3] local round = args[4] + local type = args[5] + if args[5]==nil then + type=0 + end + local addBuff=nil local onPassiveTreatingFactor = function(func, target) - target:AddBuff(Buff.Create(role, BuffName.PropertyChange, round, BattlePropList[f1], v1,ct)) + + if type==1 and BattleLogic.BuffMgr:HasBuff(target,BuffName.PropertyChange,function(buff) return addBuff~=nil and buff==addBuff end) then + addBuff.roundDuration=round + addBuff.roundPass=0 + else + addBuff=Buff.Create(role, BuffName.PropertyChange, round, BattlePropList[f1], v1,ct) + target:AddBuff(addBuff) + end + end local function onSkillCast(skill) @@ -9739,6 +9792,357 @@ local passivityList = { --role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast,nil,nil,role) role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role) end, + -- 受到[a]类型[b]状态敌人攻击时受到伤害[c]改变 状态层数*[d]%, 伤害类型为[e] + -- a[int],b[int],c[int 改变类型],d[float],e[int](e 不填/0不区别是否为直接伤害) + [392] = function(role, args) + local t1 = args[1] + local t2 = args[2] + local ct = args[3] + local f1 = args[4] + local type = args[5] + if not type then + type=0 + end + local onPassiveBeDamaging = function(func, caster, damage,skill) + if type==1 and not skill then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==caster and buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>0 then + + local dmgDeduction = floor(BattleUtil.ErrorCorrection(BattleUtil.CountValue(damage, f1*len, ct)-damage)) + if func then func(dmgDeduction) end + end + end + role.Event:AddEvent(BattleEventName.PassiveBeDamaging, onPassiveBeDamaging,nil,nil,role) + end, + --改变[a]目标身上[b]类型[c]状态buff层数*[d]%的暴击伤害 + --a[int],b[int],c[ind],d[float] + [393]=function(role,args,id,judge) + local ct=args[1] + local t1=args[2] + local t2 = args[3] + local v1 = args[4] + local addCritDamageFa=function(func,atkRole,defRole) + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==defRole and buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>0 then + if func then + func(v1*len,ct) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role) + end, + --技能追加的普攻额外造成目标[a]属性*[b]类型[c]状态的层数*[d]的伤害 + --a[int 属性id] b[int],c[int],d[float] + [394]=function(role,args,id,judge) + local f1 = args[1] + local t1 = args[2] + local t2 = args[3] + local v1 = args[4] + -- 直接伤害后 + local onPassiveDamaging = function(func, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill and skill.type == BattleSkillType.Normal and skill.isAdd and skill.owner==role then + --如果是boss 并且额外伤害是根据最大生命则返回 + if (f1==12 or f1==13) and BattleUtil.CheckIsBoss(defRole) then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==defRole and buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len==0 then + return + end + if (f1==12 or f1==13) then + local val = floor(BattleUtil.FP_Mul(len*v1, defRole:GetRoleData(BattlePropList[f1]))) + BattleUtil.FinalDamageCountShield(nil,role,defRole,val) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role) + end, + --自身添加的免疫buff,免疫一次[a]类型buff,自身回复[b]点怒气,每回合最多触发[c]次 + --a[int buff类型],b[int],c[int] + [395]=function(role,args,id,judge) + local type=args[1] + local num=args[2] + local time=args[3] + local triggerNum=0 + local onBuffImmune=function(buff,target,immCaster) + if immCaster~=role then + return + end + if buff.type~=type then + return + end + if triggerNum==time then + return + end + BattleUtil.CalRage(role,role,num,CountTypeName.Add) + triggerNum=triggerNum+1 + end + BattleLogic.Event:AddEvent(BattleEventName.ImmuneDebuffSuccess,onBuffImmune,nil,nil,role) + + local onRoundChange=function() + triggerNum=0 + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role) + end, + --直接伤害击杀目标自身增加[a]点怒气,并偷取目标[b]%的[c]属性在下次攻击种释放 + -- a[int],b[float],c[int] + [396] = function(role, args,id,judge) + local i1 = args[1] + local p1 = args[2] + local pro= args[3] + local isKill=false + local addAttack=0 + local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + + if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then + isKill=true + addAttack=addAttack+floor(defRole:GetRoleData(BattlePropList[pro])*p1) + end + end + + local onSkillCast=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + addAttack=0 + role.Event:AddEvent(BattleEventName.RoleHit, OnRoleHit,nil,nil,role) + end + role.Event:AddEvent(BattleEventName.SkillCast,onSkillCast,nil,nil,role) + + local onSkillCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if isKill then + BattleUtil.CalRage(role, role, i1, CountTypeName.Add) + role.addAttack=addAttack + isKill=false + else + addAttack=0 + role.addAttack=0 + end + + role.Event:RemoveEvent(BattleEventName.RoleHit, OnRoleHit,nil,nil,role) + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role) + end, + --[a]类型[b]效果命中后,[c]改变目标[d]属性[e]%,持续[f]回合,如果目标为[g]阵营,[h]改变目标[i]属性[j]% 持续[k]回合(不可叠加) + --a[int],b[int],c[int 改变类型],d[int],e[float],f[int],g[int],h[int 改变类型],i[int],j[float],k[int] + [397] = function(role, args) + local t1 = args[1] + local t2 = args[2] + local ct = args[3] + local f1 = args[4] + local v1 = args[5] + local r1 = args[6] + local ele = args[7] + local ct2 = args[8] + local f2 = args[9] + local v2 = args[10] + local r2 = args[11] + local buff1 = nil + local buff2 = nil + local OnBuffCaster = function(buff) + + if buff.type==t1 and buff.shieldType==t2 then + if buff.shieldValue==0 then + local isHave1=BattleLogic.BuffMgr:HasBuff(buff.target,BuffName.PropertyChange,function(buff) return buff1~=nil and buff==buff1 end) + if isHave1 then + buff1.roundDuration=r1 + buff1.roundPass=0 + else + buff1=Buff.Create(role, BuffName.PropertyChange, r1, BattlePropList[f1], v1, ct) + buff.target:AddBuff(buff1) + end + + + --未完待续 + if buff.target.element==ele then + local isHave2=BattleLogic.BuffMgr:HasBuff(buff.target,BuffName.PropertyChange,function(buff) return buff2~=nil and buff==buff2 end) + if isHave2 then + buff2.roundDuration=r1 + buff2.roundPass=0 + else + buff2=Buff.Create(role, BuffName.PropertyChange, r2, BattlePropList[f2], v2, ct2) + buff.target:AddBuff(buff2) + end + end + end + end + + end + role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffCaster,nil,nil,role) + end, + --回合结束时,敌方处于[a]类型[b]状态的目标会扣除[c]属性[d]%的生命 + --a[int],b[int],c[int],d[float] + [398]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local pro=args[3] + local v1 =args[4] + local onRoundChange=function(round) + if round==0 then + return + end + local list = RoleManager.Query(function(v) return role.camp ~= v.camp end) + for _, r in pairs(list) do + if BattleLogic.BuffMgr:HasBuff(r, t1,nil) then + if pro==12 and not BattleUtil.CheckIsBoss(r) then + local damage= floor(r:GetRoleData(BattlePropList[pro])*v1) + BattleUtil.FinalDamageCountShield(false,role,r,damage) + end + end + end + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd, onRoundChange,nil,nil,role) + end, + -- 概率[a]给技能目标添加[b]类型[c]效果的buff,持续[d]回合 + -- a[float],b[int],c[int],d[int] + [399] = function(role, args,id,judge) + local pro = args[1] + local t1 = args[2] + local t2 = args[3] + local round=args[4] + -- 释放技能后 + local onRoleHit = function(defRole,damge,bcrit,finalDamage,damagetype,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + + if skill and skill.type==BattleSkillType.Special then + BattleUtil.RandomAction(pro,function() + local buff = Buff.Create(role,t1,round) + defRole:AddBuff(buff) + end) + end + end + role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role) + end, + --处于[a]类型[b]状态的目标,怒气大于等于[c]点每次受到[d]阵营技能攻击,额外降低[e]点怒气,怒气小于[f]点,受到[g]阵营攻击暴击率改变[h][i]% + --a[int],b[int],c[int],d[int],e[int],f[int],g[int],h[int],i[float] + [400]=function(role, args,id,judge) + local t1=args[1] + local t2=args[2] + local n1=args[3] + local ele1=args[4] + local n2=args[5] + local n3=args[6] + local ele2=args[7] + local ct=args[8] + local v1=args[9] + + + local onRoleHit = function(atkRole, defRole, damage, bCrit, finalDmg, damageType, dotType, skill) + if not skill then + return + end + if atkRole.camp~=role.camp or defRole.camp==role.camp then + return + end + if atkRole.element~=ele1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local ishave=BattleLogic.BuffMgr:HasBuff(defRole,t1,function(buff) + if t1==BuffName.SigilSign then + return true + end + end) + if ishave then + if defRole.Rage>=n1 then + BattleUtil.CalRage(role,defRole,n2,CountTypeName.Sub) + end + end + + end + BattleLogic.Event:AddEvent(BattleEventName.RoleDamage, onRoleHit,nil,nil,role) + + local addCrit=function(critFunc,atkRole,defRole,skill) + if not skill then + return + end + if atkRole.camp~=role.camp or defRole.camp==role.camp then + return + end + if atkRole.element~=ele2 then + return + end + local ishave=BattleLogic.BuffMgr:HasBuff(defRole,t1,function(buff) + if t1==BuffName.SigilSign then + return true + end + end) + if ishave then + if defRole.Rage0 then + -- local buff = Buff.Create(caster, BuffName.DOT, i1, 1, dot, floor(damage)) + -- buff.skill=skill + -- buff.isRealDamage = true + local newBuff={} + newBuff=buff + newBuff.skill=nil + newBuff.caster=role + for i = 1, add do + + buffTarget:AddBuff(newBuff) + end + end + --end) + + end + + role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffStart,nil,nil,role) + end } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua index dc3e282da6..dd6e0e4de6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua @@ -1,23 +1,7 @@ -- 免疫效果 Immune = Buff:New() -local immune0 = function(buff) - return buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT -end -local immune1 = function(buff) - return buff.type == BuffName.Control -end -local immune2 = function(buff) - return buff.type == BuffName.DOT -end -local immune3 = function(buff) - return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce -end ---免疫控制不免疫禁疗 -local immune5 = function(buff) - return buff.type == BuffName.Control and buff.ctrlType and buff.ctrlType~=4 -end @@ -30,10 +14,31 @@ function Immune:SetData(type,func) -- 刷新排序等级 self.sort = 4 end +local immune0 = nil +local immune1 = nil + +local immune2 = nil +local immune3 = nil +--免疫控制不免疫禁疗 +local immune5 = nil --初始化后调用一次 function Immune:OnStart() - + immune0=function(buff) + return buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT,self.caster + end + immune1=function(buff) + return buff.type == BuffName.Control,self.caster + end + immune2 = function(buff) + return buff.type == BuffName.DOT,self.caster + end + immune3 = function(buff) + return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce,self.caster + end + immune5 =function(buff) + return buff.type == BuffName.Control and buff.ctrlType and buff.ctrlType~=4,self.caster + end if self.immuneType == 0 then --免疫负面状态(控制状态、减益状态和持续伤害状态) self.target.buffFilter:Add(immune0) elseif self.immuneType == 1 then --免疫控制状态 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/NoDead.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/NoDead.lua index d30137f614..e316b8ea97 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/NoDead.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/NoDead.lua @@ -4,7 +4,9 @@ NoDead = Buff:New() function NoDead:SetData(...) self.damageFactor, self.factorCT, - self.isCanRelive = ... -- buff期间的增伤系数 + self.isCanRelive, + self.pro, + self.v1 = ... -- buff期间的增伤系数 self.cover = true --控制效果可被覆盖 -- 刷新排序等级 self.sort = 4 @@ -62,7 +64,19 @@ function NoDead:OnEnd() self.target.Event:RemoveEvent(BattleEventName.RoleBeHit,self.OnRoleBeHit,self) end --self.target.Event - self.target:SetDeadFilter(true) + local isRand=BattleUtil.RandomAction(self.pro,function() + RoleManager.RemoveDeadRole(self.target) + self.target.isDead=false + self.target.isRealDamage=false + local addHp= math.floor(self.target:GetRoleData(RoleDataName.MaxHp)*self.v1) + self.target.data:AddValue(RoleDataName.Hp,addHp) + self.target:SetIsCanAddSkill(true) + self.target:SetDeadFilter(true) + end) + if not isRand then + self.target:SetDeadFilter(true) + end + -- self.target:SetIsCanAddSkill(false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua new file mode 100644 index 0000000000..c105777bd2 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua @@ -0,0 +1,33 @@ +SigilSign = Buff:New() + +--初始化Buff,通过传入一些自定义参数控制成长相关的数值 +function SigilSign:SetData(...) + + -- 刷新排序等级 + self.sort = 4 +end + + +--初始化后调用一次 +function SigilSign:OnStart() + + +end + +--间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd +function SigilSign:OnTrigger() + return true +end + +--效果结束时调用一次 +function SigilSign:OnEnd() + + +end + +--只有当cover字段为true时触发,返回true则被新效果覆盖 +function SigilSign:OnCover(newBuff) + return true +end + +return SigilSign \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua.meta b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua.meta new file mode 100644 index 0000000000..59c0e202ce --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/SigilSign.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 846cb2db9b2ee114ca0a56adccb06c18 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua index 13efedf760..548177fd97 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -189,6 +189,7 @@ BattleEventName = { CastRageBrfore = indexAdd(),--扣除怒气之前 PassiveAddCritDamageFactor = indexAdd(), --被动增加爆伤系数 PassiveChangeIgnoreImmuneValue = indexAdd(),--被动修改无视 + ImmuneDebuffSuccess = indexAdd(),--免疫debuff成功 } BattleMaxFrame = 1000000 @@ -269,6 +270,7 @@ BuffName = { Brand = 12, Blood = 13, BanBlood = 14, + SigilSign = 15, } DotType = { diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 911fb7de0d..abdb54f628 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -963,7 +963,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i defence = defRole:GetRoleData(RoleDataName.MagicDefence) end -- 攻击力 - local attack = atkRole:GetRoleData(RoleDataName.Attack) + local attack = atkRole:GetRoleData(RoleDataName.Attack)+atkRole.addAttack -- 无视防御系数 ignoreDef = 1 - (ignoreDef or 0) -- 基础伤害 = 攻击力 - 防御力 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 18c62a9b1f..69eb3c241b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -89,6 +89,7 @@ function RoleLogic:Init(uid, data, position) self.isImmuneAllReduceShield = false --免疫敌方无敌盾(敌方无敌盾对自己无效) self.ignoreShara = false --忽略敌方分摊 self.type = BattleUnitType.Role + self.addAttack=0 --添加的攻击 self.isNormalAttackAddRage=true --普攻是否回复怒气 self.curMainTarget=nil --当前主目标 self.passiveList = {} @@ -358,7 +359,8 @@ function RoleLogic:AddBuff(buff) local isIgnor=BattleUtil.RandomAction(ignoreProb,function()end) if not isIgnor then for i=1, self.buffFilter.size do - if self.buffFilter.buffer[i](buff,self) then + local isImm,immCaster=self.buffFilter.buffer[i](buff,self) + if isImm then BattleLogManager.Log( "Buff Filter", "camp", buff.caster.camp, @@ -366,6 +368,7 @@ function RoleLogic:AddBuff(buff) "id", buff.id, "type", buff.type) BattleLogic.BuffMgr:PutBuff(buff) + BattleLogic.Event:DispatchEvent(BattleEventName.ImmuneDebuffSuccess,buff,self,immCaster) BattleLogic.Event:DispatchEvent(BattleEventName.RoleAddBuffFail,buff,self) return end @@ -633,7 +636,7 @@ function RoleLogic:SetDeadFilter(filter) self.deadFilter = filter end -- 要死了 -function RoleLogic:SetDead(damage) +function RoleLogic:SetDead(damage) self.isDead = true self.killDamage=damage RoleManager.AddDeadRole(self) @@ -686,6 +689,7 @@ function RoleLogic:SetRelive(hpf, caster) if self:IsCanRelive() then self.reliveHPF = hpf or 1 self.reliveCaster = caster + self.addAttack = 0 RoleManager.AddReliveRole(self) -- local maxHp = self.data:GetData(RoleDataName.MaxHp) -- local reHp = floor(self.reliveHPF * maxHp) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua index 22c19b6194..0e6442b73a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua @@ -83,6 +83,13 @@ end function this.AddDeadRole(role) _DeadRoleList[role.position + role.camp * 6] = role end + +function this.RemoveDeadRole(role) + if _DeadRoleList[role.position + role.camp * 6] then + _DeadRoleList[role.position + role.camp * 6]=nil + end +end + -- 检测是有人将死 function this.CheckDead() local isDeadFrame = false diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua index b25e49cf69..ab4e0f2e9a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua @@ -12,6 +12,7 @@ local BuffTypeToConfigType = { [BuffName.Exile] = 9, [BuffName.Blood] = 10, [BuffName.BanBlood] = 11, + [BuffName.SigilSign] = 13, } local function _GetPropChangeBuffCType(pName) for cType, pn in ipairs(BattlePropList) do @@ -52,6 +53,8 @@ local function _GetBuffEffectConfig(buff) cType = 1 elseif bType==BuffName.BanBlood then cType = 1 + elseif bType==BuffName.SigilSign then + cType = 1 end local type = BuffTypeToConfigType[bType]