[战斗]白骨精技能,被动,魂印效果提交
parent
f0f423bbd4
commit
064e00c029
|
@ -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,
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)<b:GetRoleData(RoleDataName.Hp)
|
||||
else
|
||||
return r1 > r2
|
||||
end
|
||||
else
|
||||
if r1==r2 then
|
||||
return a:GetRoleData(RoleDataName.Hp)<b:GetRoleData(RoleDataName.Hp)
|
||||
else
|
||||
return r1 < r2
|
||||
end
|
||||
end
|
||||
end)
|
||||
return arr
|
||||
end
|
||||
--按怒气排序
|
||||
function BattleUtil.SortByRage(arr, sort)
|
||||
BattleUtil.Sort(arr, function(a, b)
|
||||
|
@ -250,12 +272,15 @@ function BattleUtil.ChooseTarget(role, chooseId)
|
|||
else
|
||||
arr = RoleManager.GetArrAggroList(role, arr)
|
||||
end
|
||||
-- body
|
||||
-- elseif chooseWeight == 9 then -- 展位距离
|
||||
-- BattleUtil.Sort(arr, function(a, b)
|
||||
-- local r1 = math.abs(role.position - a.position) * 10 + a.position
|
||||
-- local r2 = math.abs(role.position - b.position) * 10 + b.position
|
||||
-- if sort == 1 then return r1 > 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
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue