[战斗]======效果133修改,治疗接口添加容错
parent
6e92bbd082
commit
52937f3a67
|
@ -2552,6 +2552,9 @@ local effectList = {
|
||||||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||||||
local hp=floor(damage*f2)
|
local hp=floor(damage*f2)
|
||||||
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
||||||
|
if arr==nil or #arr==0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
BattleUtil.SortByHpFactor(arr,sort)
|
BattleUtil.SortByHpFactor(arr,sort)
|
||||||
BattleUtil.CalTreatNoCrit(caster, arr[1],hp,1,skill)
|
BattleUtil.CalTreatNoCrit(caster, arr[1],hp,1,skill)
|
||||||
|
|
||||||
|
|
|
@ -448,6 +448,7 @@ function BattleUtil.ChooseTarget(role, chooseId)
|
||||||
--LogError(aaa.position)
|
--LogError(aaa.position)
|
||||||
end
|
end
|
||||||
aaa.isRealDead=false
|
aaa.isRealDead=false
|
||||||
|
arr={}
|
||||||
table.insert(arr,aaa)
|
table.insert(arr,aaa)
|
||||||
-- return aaa
|
-- return aaa
|
||||||
end
|
end
|
||||||
|
@ -1073,6 +1074,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor,skill)
|
function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor,skill)
|
||||||
|
if targetRole==nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 灵兽无效
|
-- 灵兽无效
|
||||||
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
|
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
|
||||||
return
|
return
|
||||||
|
@ -1106,6 +1110,9 @@ end
|
||||||
|
|
||||||
--没有暴击得治疗
|
--没有暴击得治疗
|
||||||
function BattleUtil.CalTreatNoCrit(castRole, targetRole, value, baseFactor,skill)
|
function BattleUtil.CalTreatNoCrit(castRole, targetRole, value, baseFactor,skill)
|
||||||
|
if targetRole==nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 灵兽无效
|
-- 灵兽无效
|
||||||
if targetRole==nil then
|
if targetRole==nil then
|
||||||
return
|
return
|
||||||
|
@ -1135,6 +1142,9 @@ end
|
||||||
|
|
||||||
|
|
||||||
function BattleUtil.FinalTreat(castRole, targetRole, value, baseFactor,skill)
|
function BattleUtil.FinalTreat(castRole, targetRole, value, baseFactor,skill)
|
||||||
|
if targetRole==nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 灵兽无效
|
-- 灵兽无效
|
||||||
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
|
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
|
||||||
return
|
return
|
||||||
|
@ -1180,10 +1190,16 @@ end
|
||||||
|
|
||||||
|
|
||||||
function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor,skill)
|
function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor,skill)
|
||||||
|
if targetRole==nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 灵兽无效
|
-- 灵兽无效
|
||||||
if targetRole.type == BattleUnitType.Monster then
|
if targetRole.type == BattleUnitType.Monster then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if addDamageFactor==nil then
|
||||||
|
addDamageFactor=1
|
||||||
|
end
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.DisposeRoleCtrl_noheal, castRole,targetRole)
|
BattleLogic.Event:DispatchEvent(BattleEventName.DisposeRoleCtrl_noheal, castRole,targetRole)
|
||||||
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
|
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
|
||||||
--禁疗并且没有死亡的单位显示血量+0 不走后面代码,防止触发后面的被动 by:王振兴 2021/1/27
|
--禁疗并且没有死亡的单位显示血量+0 不走后面代码,防止触发后面的被动 by:王振兴 2021/1/27
|
||||||
|
@ -1193,6 +1209,7 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
baseFactor = baseFactor or 1
|
baseFactor = baseFactor or 1
|
||||||
|
critDamageFactor = critDamageFactor or 1
|
||||||
local maxHp = targetRole:GetRoleData(RoleDataName.MaxHp)
|
local maxHp = targetRole:GetRoleData(RoleDataName.MaxHp)
|
||||||
local hp = targetRole:GetRoleData(RoleDataName.Hp)
|
local hp = targetRole:GetRoleData(RoleDataName.Hp)
|
||||||
|
|
||||||
|
@ -1204,9 +1221,11 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
|
||||||
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreatedFactor, treatFactorFunc, castRole)
|
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreatedFactor, treatFactorFunc, castRole)
|
||||||
|
|
||||||
local factor = castRole.isTeam and 1 or castRole:GetRoleData(RoleDataName.TreatFacter) --释放者为team则不计算治疗加成属性
|
local factor = castRole.isTeam and 1 or castRole:GetRoleData(RoleDataName.TreatFacter) --释放者为team则不计算治疗加成属性
|
||||||
|
if factor==0 then
|
||||||
|
factor=1
|
||||||
|
end
|
||||||
local factor2 = targetRole:GetRoleData(RoleDataName.CureFacter)
|
local factor2 = targetRole:GetRoleData(RoleDataName.CureFacter)
|
||||||
local baseTreat = BattleUtil.FP_Mul(value, baseFactor, factor, factor2,critDamageFactor,addDamageFactor)
|
local baseTreat = BattleUtil.FP_Mul(value, baseFactor, factor, factor2,critDamageFactor,addDamageFactor)
|
||||||
|
|
||||||
--加入被动效果
|
--加入被动效果
|
||||||
local cl = {}
|
local cl = {}
|
||||||
local function treatingFunc(v, ct)
|
local function treatingFunc(v, ct)
|
||||||
|
@ -1219,7 +1238,6 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
|
||||||
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreated, treatingFunc, castRole)
|
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreated, treatingFunc, castRole)
|
||||||
baseTreat = BattleUtil.CountChangeList(baseTreat, cl)
|
baseTreat = BattleUtil.CountChangeList(baseTreat, cl)
|
||||||
|
|
||||||
|
|
||||||
-- 取整
|
-- 取整
|
||||||
local baseTreat = floor(baseTreat + 0.5)
|
local baseTreat = floor(baseTreat + 0.5)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue