From 064e00c0291e26dab6f6c24239c302da95196127 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 22 Dec 2020 11:59:26 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=E7=99=BD=E9=AA=A8=E7=B2=BE?= =?UTF-8?q?=E6=8A=80=E8=83=BD=EF=BC=8C=E8=A2=AB=E5=8A=A8=EF=BC=8C=E9=AD=82?= =?UTF-8?q?=E5=8D=B0=E6=95=88=E6=9E=9C=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Effect.lua | 42 +++- .../Modules/Battle/Logic/Base/Passivity.lua | 186 +++++++++++++++++- .../Modules/Battle/Logic/Buff/Control.lua | 17 +- .../~Lua/Modules/Battle/Logic/Buff/Shield.lua | 15 +- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 67 ++++++- .../Modules/Battle/Logic/Role/RoleLogic.lua | 69 ++++--- .../Modules/Battle/View/Unit/EnemyView.lua | 6 +- .../Modules/Battle/View/Unit/PlayerView.lua | 6 +- .../Modules/Battle/View/Unit/RoleView.lua | 6 +- 9 files changed, 352 insertions(+), 62 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua index 1eb8691348..354416f80e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua @@ -2287,7 +2287,47 @@ local effectList = { end) end, - + --造成[a]%的[b]伤害,目标每减少[c]个伤害提升[d]%,并有[e]%概率附加[f]控制状态,持续[g]回合;魂印添加控制概率[h]%, 减员添加控制概率[i]%,伤害添加[j]% + --a[float],b[伤害类型],c[int],d[float] + [120] = function(caster, target, args, interval, skill) + local f1 = args[1] + local dt = args[2] + local i1 = args[3] + local f2 = args[4] + local p1 = args[5] + local ctrl =args[6] + local r1 = args[7] + --魂印增加 + local v1 = args[8] + local v2 = args[9] + local v3 = args[10] + -- 改变值 = 技能最大目标数 - 当前目标数 + local maxNum = skill:GetMaxTargetNum() + local curNum = #skill:GetDirectTargets() + local lessNum = max(maxNum - curNum, 0) + local level = math.floor(lessNum/i1) + local pro1=p1+v1+level*v2 + f1=f1+level*f2+level*v3 + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target) + BattleLogic.WaitForTrigger(interval, function () + BattleUtil.CalDamage(skill, caster, target, dt, f1) + --伤害命中才会给目标上buff + if skill and skill:CheckTargetIsHit(target) then + BattleUtil.RandomControl(pro1,ctrl, caster, target,r1) + end + caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) + end) + end, + + --直接斩杀[a]%生命 + [121] = function(caster, target, args, interval, skill) + local pro = args[1] + local isBoss=BattleUtil.CheckIsBoss(target) + if isBoss then + return + end + BattleUtil.SeckillHP(skill,caster,target,pro) + end, } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 9b6306ef54..800c7fdd3e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -2912,14 +2912,29 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd) end, - -- 直接伤害击杀目标回复自身[a]点怒气 - -- a[int] - [153] = function(role, args) + -- 直接伤害击杀目标回复自身[a]点怒气 回复[b]属性[c]的血量 (b,c不填就不会回复血量) + -- a[int] b[int,属性id] c[flaot] + [153] = function(role, args,id,judge) local i1 = args[1] - - local onHit = function(target, damage, bCrit, finalDmg) + local p1 = args[2] + local v1 = args[3] + local onHit = function(target, damage, bCrit, finalDmg,damageType, skill,isDirect) + --不是真实伤害 + if not skill and not isDirect then + return + end + + --白骨精追加普攻不触发特性 + if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then role:AddRage(i1, CountTypeName.Add) + -- 回血 + if p1 and v1 then + local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[p1])*v1)) + BattleUtil.ApplyTreat(role, role, dd) + end end end role.Event:AddEvent(BattleEventName.RoleHit, onHit) @@ -3622,6 +3637,12 @@ local passivityList = { -- 伤害降低 local finalDamage = BattleUtil.CountValue(damage, f1, ct) local curHp = role:GetRoleData(RoleDataName.Hp) + --如果敌方忽略分摊就只减伤 + if atkRole.ignoreShara then + local dd = damage - finalDamage + damagingFunc(floor(BattleUtil.ErrorCorrection(dd))) + return + end -- 不是致死伤害 if finalDamage < curHp then -- 找到除自身外的血量最高的两人 @@ -3934,6 +3955,10 @@ local passivityList = { local f1 = args[1] local onFinalDamage = function(damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType) + --如果敌人免疫分摊 + if atkRole and atkRole.ignoreShara then + return + end if not role:IsDead() and skill and role.position ~= defRole.position and defRole.camp == role.camp and defRole.element == role.element then local ff = 1 -- 分摊比 -- 检测被动对分摊比的影响 @@ -4872,16 +4897,24 @@ local passivityList = { -- 直接伤害每次击杀目标增加[a]%的[b]可叠加持续至战斗结束[c]改变 重写103效果 每次释放技能只触发一次 -- a[float]b[属性]c[改变类型] - [246] = function(role, args,id) + [246] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local ct = args[3] -- 释放技能后 - local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - --如果是技能并且这个被动已经被触发过 return + local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill,isDirect) + --不是真实伤害 + if not skill and not isDirect then + return + end + --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end + --白骨精追加普攻不处罚特性 + if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then + return + end if defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) -- buff.cover = true @@ -5837,6 +5870,117 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.RoleBeHit,onRoleBeHit) end, + + --技能追加的普攻额外造成目标[a][b]%的伤害。技能每成功[c]1个目标,额外造成[d]%生命上限的伤害 + --a[int 属性id] b[float] c[控制状态] d[flaot] + [285]=function(role,args) + local f1 = args[1] + local dt = args[2] + local ctrl = args[3] + local v1 = args[4] + --混乱敌方的数量 + local num=0 + -- 直接伤害后 + local onPassiveDamaging = function(func, defRole, damage,skill) + --如果是boss 并且额外伤害是根据最大生命则返回 + local isBoss=BattleUtil.CheckIsBoss(defRole) + if isBoss and f1==12 then + return + end + if skill and skill.type == BattleSkillType.Normal and skill.isAdd and skill.owner==role then + dt=BattleUtil.CountValue(dt,v1*num,1) + local val = -floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1]))) + if func then + func(val) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) + --记录技能混乱敌人的数量 + local OnRoleHit = function(skill) + if skill and skill.owner==role and skill.type==BattleSkillType.Special then + local list=skill:GetDirectTargetsNoMiss() + if not list then + num=0 + return + end + for key, value in pairs(list) do + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.Control, function(buff) return buff.ctrlType == ctrl and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end) + if isHave then + num=num+1 + end + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit) + end, + + --必定暴击 + --a[int 默认填1] + [286]=function(role,args) + role.mustCrit = true + end, + + --必定命中 + --a[int 默认填1] + [287]=function(role,args) + role.mustHit=true + end, + + --忽略敌方无敌盾 + --a[int 默认填1] + [288]=function(role,args) + role.isImmuneAllReduceShield = true + end, + + --造成伤害暴击后,将伤害的[a]%转化为自身生命治疗自己 + --a[float] + [289] = function(role, args) + local f1 = args[1] + local OnDamage = function(defRole, damage, bCrit, finalDmg) + BattleUtil.CalTreat(role, role, floor(f1 * finalDmg)) + end + role.Event:AddEvent(BattleEventName.RoleCrit, OnDamage) + end, + + --本次技能中如果有[a]目标,额外回复[b]点怒气 回复[c] [d]血量(c,d不填则不回复血量) + -- a[控制状态]b[int] c[int,属性id] d[flaot] + [290]=function(role,args) + local dot=args[1] + local i1 = args[2] + local p1 = args[3] + local v1 = args[4] + local OnRoleHit = function(skill) + + if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then + local list=skill:GetDirectTargetsNoMiss() + if not list then + return + end + local num=0 + for key, value in pairs(list) do + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.Control, function(buff) return buff.ctrlType == dot and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end) + if isHave then + num=num+1 + end + end + if num>0 then + role:AddRage(i1*num, CountTypeName.Add) + if p1 and v1 then + local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[p1])*v1*num)) + BattleUtil.ApplyTreat(role, role, dd) + end + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit) + end, + + --忽略敌方分摊伤害 + --a[int 默认填1] + [291]=function(role,args) + role.ignoreShara=true + end, -- 直接伤害击杀目标释放对[a][b]%[c]技能伤害 神女庇佑魂印效果 播放佩戴者的技能动作和特效 -- a[int 目标选择系数] b[flaot] c[int 伤害类型] [292] = function(role, args,id,judge) @@ -5863,6 +6007,32 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit) end, + --魂印[a]改变控制概率[b]% ,减员[c]改变控制概率[d]%,减员[e]改变伤害[f]%(只作用于主动技能效果120) + --a[改变类型]b[float] c[改变类型] d[int] e[改变类型] f[flaot] + [293]=function(role, args,id,judge) + local ct = args[1] + local f1 = args[2] + local ct2 = args[3] + local f2 = args[4] + local ct3 = args[5] + local f3 = args[6] + local onSkillEffectBefore = function(skill, e, func) + if skill.type == BattleSkillType.Special then + if e.type == 120 then -- 当前只对技能效果103生效 + local factor = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[8], f1, ct)) + e.args[8] = factor + if ct2 and f2 then + e.args[9] = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[9], f2, ct2)) + end + if ct3 and f3 then + e.args[10] = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[10], f3, ct3)) + end + if func then func(e) end + end + end + end + role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore) + end, } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua index 99014e5cff..f8081adf12 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua @@ -6,12 +6,11 @@ function Control:SetData(...) self.ctrlType = ... self.cover = true --控制效果可被覆盖 -- 刷新排序等级 - self.sort = 4 + self.sort = 4 end --初始化后调用一次 -function Control:OnStart() - +function Control:OnStart() if self.ctrlType == 1 then --眩晕 self.target.ctrl_dizzy = true elseif self.ctrlType == 2 then --沉默 @@ -23,12 +22,16 @@ function Control:OnStart() self.target.ctrl_noheal = true elseif self.ctrlType == 5 then --致盲 self.target.ctrl_blind = true - elseif self.ctrlType == 7 then --麻痹 self.target.ctrl_palsy = true + elseif self.ctrlType == 8 then --混乱 + self.target.ctrl_chaos = true end + end + + --间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd function Control:OnTrigger() @@ -37,7 +40,6 @@ end --效果结束时调用一次 function Control:OnEnd() - if self.ctrlType == 1 then --眩晕 self.target.ctrl_dizzy = false elseif self.ctrlType == 2 then --沉默 @@ -48,10 +50,11 @@ function Control:OnEnd() elseif self.ctrlType == 4 then --禁疗 self.target.ctrl_noheal = false elseif self.ctrlType == 5 then --致盲 - self.target.ctrl_blind = false - + self.target.ctrl_blind = false elseif self.ctrlType == 7 then --麻痹 self.target.ctrl_palsy = false + elseif self.ctrlType==8 then --混乱 + self.target.ctrl_chaos = false end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua index eb6f17e96a..d8d6a261da 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua @@ -63,17 +63,22 @@ function Shield:CountShield(damage, atkRole,skill) finalDamage=damage end elseif self.shieldType == ShieldTypeName.AllReduce then - finalDamage = 0 - --TODO 计算吸血 - if self.shieldValue ~= 0 then + --攻击者免疫无敌盾 + if atkRole.isImmuneAllReduceShield and skill then + finalDamage=damage + else + finalDamage = 0 + end + --TODO 计算吸血 + if self.shieldValue ~= 0 then local treatValue = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue)) BattleUtil.ApplyTreat(self.target, self.target, treatValue) end end -- - -- self.caster.Event:DispatchEvent(BattleEventName.ShildTrigger, self) - self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self) + -- self.caster.Event:DispatchEvent(BattleEventName.ShildTrigger, self) + self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self,atkRole) BattleLogic.Event:DispatchEvent(BattleEventName.ShildTrigger, self) return finalDamage diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 8dfebb7362..f9aa664cac 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -78,7 +78,7 @@ function BattleUtil.SortByProp(arr, prop, sort) end) return arr end --- 按血量排序 +-- 按百分比血量排序 function BattleUtil.SortByHpFactor(arr, sort) BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.Hp) / a:GetRoleData(RoleDataName.MaxHp) @@ -87,6 +87,28 @@ function BattleUtil.SortByHpFactor(arr, sort) end) return arr end + +-- 按百分比血量排序 +function BattleUtil.SortByHpFactorAndHp(arr, sort) + BattleUtil.Sort(arr, function(a, b) + local r1 = a:GetRoleData(RoleDataName.Hp) / a:GetRoleData(RoleDataName.MaxHp) + local r2 = b:GetRoleData(RoleDataName.Hp) / b:GetRoleData(RoleDataName.MaxHp) + if sort == 1 then + if r1==r2 then + return a:GetRoleData(RoleDataName.Hp) r2 + end + else + if r1==r2 then + return a:GetRoleData(RoleDataName.Hp) r2 else return r1 < r2 end -- end) + elseif chooseWeight == 9 then --血量百分比->血量 + BattleUtil.SortByHpFactorAndHp(arr,sort) end local finalArr = {} if num == 0 then @@ -362,6 +387,36 @@ function BattleUtil.Seckill(skill, atkRole, defRole) end end +-- 秒杀定额血量 +function BattleUtil.SeckillHP(skill, atkRole, defRole,pro) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end + local damage = floor(BattleUtil.FP_Mul(defRole:GetRoleData(RoleDataName.MaxHp),pro)) + local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) + if finalDmg >= 0 then + if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then + defRole:SetDead() + defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) + atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole) + BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole) + + atkRole.Event:DispatchEvent(BattleEventName.Seckill, defRole) + defRole.Event:DispatchEvent(BattleEventName.BeSeckill, atkRole) + BattleLogic.Event:DispatchEvent(BattleEventName.Seckill, atkRole, defRole) + end + atkRole.Event:DispatchEvent(BattleEventName.RoleDamage, defRole, damage, false, finalDmg, 0, false, skill) + defRole.Event:DispatchEvent(BattleEventName.RoleBeDamaged, atkRole, damage, false, finalDmg, 0, false, skill) + BattleLogic.Event:DispatchEvent(BattleEventName.RoleDamage, atkRole, defRole, damage, false, finalDmg, 0, false, skill) + BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeDamaged, defRole, atkRole, damage, false, finalDmg, 0, false, skill) + if skill then + atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, nil, finalDmg, nil, skill) + defRole.Event:DispatchEvent(BattleEventName.RoleBeHit, atkRole, damage, nil, finalDmg, nil, skill) + end + end +end + -- 计算真实伤害 function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect) -- 灵兽无效 @@ -467,13 +522,13 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy defRole.Event:DispatchEvent(BattleEventName.RoleBeCrit, atkRole, damage, bCrit, finalDmg, damageType, skill) end if skill then - atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, bCrit, finalDmg, damageType, skill) + atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, bCrit, finalDmg, damageType, skill,isDirect) defRole.Event:DispatchEvent(BattleEventName.RoleBeHit, atkRole, damage, bCrit, finalDmg, damageType, skill,isDirect) end --如果不是技能带的伤害,并且是直接伤害就,,,,, --用于处理不触发特性并且是直接伤害的伤害 isDirect 暂时先为bool值,后期可根据需求做修改扩展 by:王振兴 2020/10/12 16:18 if isDirect and not skill then - atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, bCrit, finalDmg, damageType, skill) + atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, bCrit, finalDmg, damageType, skill,isDirect) defRole.Event:DispatchEvent(BattleEventName.RoleBeHit, atkRole, damage, bCrit, finalDmg, damageType, skill,isDirect) end end @@ -492,6 +547,7 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy return finalDmg end + --执行完整的命中,伤害,暴击计算,返回命中,暴击 --skill造成伤害的技能 atkRole攻击者 defRole受击者 damageType伤害类型 baseFactor伤害系数 ignoreDef无视防御参数 dotType是持续伤害类型 function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, ignoreDef, dotType) @@ -540,7 +596,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i local critRandom = Random.Range01() local critCondition = clamp(atkRole:GetRoleData(RoleDataName.Crit) - defRole:GetRoleData(RoleDataName.Tenacity), 0, 1) bCrit = critRandom <= critCondition - bCrit = bCrit or defRole.isFlagCrit == true -- 必定暴击 + bCrit =atkRole.mustCrit or bCrit or defRole.isFlagCrit == true -- 必定暴击 -- 计算暴伤害系数 local critDamageFactor = 1 @@ -674,6 +730,9 @@ end function BattleUtil.CheckIsHit(atkRole, defRole) -- 是否命中: 命中 = 自身命中率 - 对方闪避率 local isHit = false + if atkRole.mustHit then + return true + end local hitRandom = Random.Range01() local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) isHit = hitRandom <= hitCondition diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 6906ebff57..dfed50feba 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -39,7 +39,7 @@ function RoleLogic:Init(uid, data, position) self.exCalDmgList:Clear() --额外计算伤害列表 self.buffFilter:Clear() --buff屏蔽列表 self.proTranList:Clear() --属性转换列表 - self.isHaveNoDead = false -- 是否有不灭 + self.isHaveNoDead = false --是否有不灭 self.Event:ClearEvent() self.skill = data.skill @@ -59,6 +59,35 @@ function RoleLogic:Init(uid, data, position) -- self.isImmuneReduceRage=false --是否免疫减怒 self.passiveList = {} + + -- 初始怒气值放在被动之后计算,使被动对初始怒气的影响生效 + self.Rage = self.Rage + self:GetRoleData(RoleDataName.InitRage)-- 当前怒气值 + + -- + self.aiOrder = data.ai + self.aiIndex = 1 + self.aiTempCount = 0 + + self.IsDebug = false + self.enemyType = EnemyType.normal + self.lockTarget = nil --嘲讽 + self.ctrl_dizzy = false --眩晕 不能释放所有技能 + self.ctrl_slient = false --沉默 只能1技能 + self.ctrl_palsy = false --麻痹 只能2技能 + self.ctrl_noheal = false --禁疗 + self.ctrl_blind = false --致盲 + self.ctrl_chaos = false --混乱 + self.deadFilter = true -- 控制死亡,置为false则角色暂时无法死亡 + + self.reliveFilter = true -- 控制复活的标志位,置为false角色将不再享受复活效果 + self.reliveHPF = 1 + + self.IsCanAddSkill = true -- 是否可以追加技能 + self.mustHit=false --必定命中 + self.mustCrit=false --必定暴击 + self.isImmuneAllReduceShield = false --免疫敌方无敌盾(敌方无敌盾对自己无效) + self.ignoreShara = false --忽略敌方分摊 + self.type = BattleUnitType.Role if data.passivity and #data.passivity > 0 then for i = 1, #data.passivity do local v = data.passivity[i] @@ -76,32 +105,6 @@ function RoleLogic:Init(uid, data, position) end end end - - -- 初始怒气值放在被动之后计算,使被动对初始怒气的影响生效 - self.Rage = self.Rage + self:GetRoleData(RoleDataName.InitRage)-- 当前怒气值 - - -- - self.aiOrder = data.ai - self.aiIndex = 1 - self.aiTempCount = 0 - - self.IsDebug = false - self.enemyType = EnemyType.normal - self.lockTarget = nil --嘲讽 - self.ctrl_dizzy = false --眩晕 不能释放所有技能 - self.ctrl_slient = false --沉默 只能1技能 - self.ctrl_palsy = false --麻痹 只能2技能 - self.ctrl_noheal = false --禁疗 - self.ctrl_blind = false --致盲 - - self.deadFilter = true -- 控制死亡,置为false则角色暂时无法死亡 - - self.reliveFilter = true -- 控制复活的标志位,置为false角色将不再享受复活效果 - self.reliveHPF = 1 - - self.IsCanAddSkill = true -- 是否可以追加技能 - - self.type = BattleUnitType.Role end -- 添加一个被动技能 @@ -297,7 +300,7 @@ function RoleLogic:SkillCast(skill, func) end -- 没有麻痹,释放普通攻击 - if skill.type == BattleSkillType.Normal and not self.ctrl_palsy then + if (skill.type == BattleSkillType.Normal or skill.type ==BattleSkillType.ChaosNormal) and not self.ctrl_palsy then local function _CheckRage() -- 后成长怒气 @@ -360,10 +363,14 @@ end -- isAdd 是否是追加技能 -- isRage 是否正常操作怒气值 function RoleLogic:AddSkill(type, isRage, isAdd, targets) - if not self.IsCanAddSkill and isAdd then return end - + if not self.IsCanAddSkill and isAdd then return end local effectData = type == BattleSkillType.Normal and self.skill or self.superSkill - + --角色被混乱后 + if self.ctrl_chaos and isRage then + type=BattleSkillType.ChaosNormal + --混乱普攻使用普攻特效 + effectData={self.skill[1],self.skill[2],self.skill[3],self.skill[4],{100001,{1,1,1}}} + end SkillManager.AddSkill(self, effectData, type, targets, isAdd, isRage) -- BattleLogManager.Log( diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 01c93269e3..ed7fcf221f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -344,9 +344,11 @@ end -- 盾效果触发 -function EnemyView:OnShieldTrigger(shield) +function EnemyView:OnShieldTrigger(shield,atkRole) if shield.shieldType == ShieldTypeName.AllReduce then - self.Floater:ImageBuffFloating("z_zhandou_wudizi") + if atkRole and not atkRole.isImmuneAllReduceShield then + self.Floater:ImageBuffFloating("z_zhandou_wudizi") + end else self.Floater:TextBuffFloating(TextFloatingColor.Blue, Language[10275]) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 8846da3d5d..0ef0e5e36a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -388,9 +388,11 @@ end -- 盾效果触发 -function PlayerView:OnShieldTrigger(shield) +function PlayerView:OnShieldTrigger(shield,atkRole) if shield.shieldType == ShieldTypeName.AllReduce then - self.Floater:ImageBuffFloating("z_zhandou_wudizi") + if atkRole and not atkRole.isImmuneAllReduceShield then + self.Floater:ImageBuffFloating("z_zhandou_wudizi") + end else self.Floater:TextBuffFloating(TextFloatingColor.Blue, Language[10275]) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua index 580911f33c..757c123771 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua @@ -440,9 +440,11 @@ end -- 盾效果触发 -function RoleView:OnShieldTrigger(shield) +function RoleView:OnShieldTrigger(shield,atkRole) if shield.shieldType == ShieldTypeName.AllReduce then - self.Floater:ImageBuffFloating("z_zhandou_wudizi") + if atkRole and not atkRole.isImmuneAllReduceShield then + self.Floater:ImageBuffFloating("z_zhandou_wudizi") + end else self.Floater:TextBuffFloating(TextFloatingColor.Blue, Language[10275]) end