[战斗]白骨精法宝添加普攻不触发任何特性
parent
e9c4cab292
commit
4bc92b8b21
|
|
@ -311,6 +311,7 @@ function BuffManager:PassUpdate()
|
|||
and buff.caster.position == curPos
|
||||
and buff.roundDuration > 0 -- 不是无限存在的buff
|
||||
and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理
|
||||
and buff.type~=BuffName.NoDead
|
||||
then
|
||||
-- 当前轮释放的buff不结算
|
||||
if buff.startRound ~= BattleLogic.GetCurRound() then
|
||||
|
|
@ -325,6 +326,32 @@ function BuffManager:PassUpdate()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BuffManager:PassUpdateNoDead()
|
||||
local curCamp, curPos = BattleLogic.GetCurTurn()
|
||||
for i=1, self.buffDic.size do
|
||||
local buffList = self.buffDic.vList[i]
|
||||
if buffList.size > 0 then
|
||||
for index = 1, buffList.size do
|
||||
local buff = buffList.buffer[index]
|
||||
if not buff.disperse -- 没过期
|
||||
and buff.caster.camp == curCamp -- 释放者是当前轮到的人
|
||||
and buff.caster.position == curPos
|
||||
and buff.roundDuration > 0 -- 不是无限存在的buff
|
||||
and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理
|
||||
then
|
||||
-- 当前轮释放的buff不结算
|
||||
buff.roundPass = buff.roundPass + 1
|
||||
if buff.roundPass >= buff.roundDuration then
|
||||
buff.disperse = true
|
||||
end
|
||||
buff.target.Event:DispatchEvent(BattleEventName.BuffRoundChange, buff)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--计算灵兽buff更新
|
||||
function BuffManager:PassMonsterUpdate()
|
||||
local curCamp, curPos = BattleLogic.GetCurTurn()
|
||||
|
|
|
|||
|
|
@ -3638,7 +3638,12 @@ local passivityList = {
|
|||
local finalDamage = BattleUtil.CountValue(damage, f1, ct)
|
||||
local curHp = role:GetRoleData(RoleDataName.Hp)
|
||||
--如果敌方忽略分摊就只减伤
|
||||
if atkRole.ignoreShara then
|
||||
local ignoreShara=atkRole.ignoreShara
|
||||
--特殊处理 白骨精附加的普攻不会忽略分摊
|
||||
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
|
||||
ignoreShara=false
|
||||
end
|
||||
if ignoreShara then
|
||||
local dd = damage - finalDamage
|
||||
damagingFunc(floor(BattleUtil.ErrorCorrection(dd)))
|
||||
return
|
||||
|
|
@ -3955,8 +3960,13 @@ local passivityList = {
|
|||
local f1 = args[1]
|
||||
|
||||
local onFinalDamage = function(damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType)
|
||||
local ignoreShara=atkRole.ignoreShara
|
||||
--特殊处理 白骨精附加的普攻不会忽略分摊
|
||||
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
|
||||
ignoreShara=false
|
||||
end
|
||||
--如果敌人免疫分摊
|
||||
if atkRole and atkRole.ignoreShara then
|
||||
if atkRole and 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
|
||||
|
|
@ -4911,6 +4921,7 @@ local passivityList = {
|
|||
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
|
||||
|
|
@ -5935,9 +5946,15 @@ local passivityList = {
|
|||
|
||||
--造成伤害暴击后,将伤害的[a]%转化为自身生命治疗自己
|
||||
--a[float]
|
||||
[289] = function(role, args)
|
||||
[289] = function(role, args,id,judge)
|
||||
local f1 = args[1]
|
||||
local OnDamage = function(defRole, damage, bCrit, finalDmg)
|
||||
|
||||
local OnDamage = function(defRole, damage, bCrit, finalDmg,damageType,skill)
|
||||
|
||||
--白骨精追加普攻不处罚特性
|
||||
if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then
|
||||
return
|
||||
end
|
||||
BattleUtil.CalTreat(role, role, floor(f1 * damage))
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleCrit, OnDamage)
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ function BattleLogic.CheckBattleLogic()
|
|||
-- 自己阵营中的位置 + 自己阵营的ID * 6 = 自己在PosList中的位置
|
||||
local role = RoleManager.GetRole(CurCamp, p) --PosList[p + (CurCamp * 6)]
|
||||
--角色如果被放逐不能行动 by:wangzhenxing 2020/12/23 11:35
|
||||
if role and not role:IsRealDead() then
|
||||
if role and not role:IsRealDead() then
|
||||
SkillRole = role
|
||||
break
|
||||
end
|
||||
|
|
@ -285,6 +285,7 @@ function BattleLogic.CheckBattleLogic()
|
|||
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
||||
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
||||
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
||||
BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭
|
||||
end
|
||||
-- 如果找不到下一个人,直接交换阵营
|
||||
if not SkillRole then
|
||||
|
|
@ -310,6 +311,7 @@ function BattleLogic.CheckBattleLogic()
|
|||
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
||||
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
||||
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
||||
BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭
|
||||
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动
|
||||
BattleLogic.TurnRoundNextFrame()
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ end
|
|||
-- 计算护盾
|
||||
function Shield:CountShield(damage, atkRole,skill)
|
||||
self.atk = atkRole
|
||||
local isImmuneAllReduceShield=false
|
||||
local finalDamage = 0
|
||||
if self.shieldType == ShieldTypeName.NormalReduce then
|
||||
|
||||
|
|
@ -64,7 +65,12 @@ function Shield:CountShield(damage, atkRole,skill)
|
|||
end
|
||||
elseif self.shieldType == ShieldTypeName.AllReduce then
|
||||
--攻击者免疫无敌盾
|
||||
if atkRole.isImmuneAllReduceShield and skill then
|
||||
isImmuneAllReduceShield=atkRole.isImmuneAllReduceShield
|
||||
--特殊处理 白骨精附加的普攻不会必定暴击
|
||||
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
|
||||
isImmuneAllReduceShield=false
|
||||
end
|
||||
if isImmuneAllReduceShield and skill then
|
||||
finalDamage=damage
|
||||
else
|
||||
finalDamage = 0
|
||||
|
|
@ -78,7 +84,7 @@ function Shield:CountShield(damage, atkRole,skill)
|
|||
|
||||
--
|
||||
-- self.caster.Event:DispatchEvent(BattleEventName.ShildTrigger, self)
|
||||
self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self,atkRole)
|
||||
self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self,isImmuneAllReduceShield)
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.ShildTrigger, self)
|
||||
|
||||
return finalDamage
|
||||
|
|
|
|||
|
|
@ -594,9 +594,14 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
|
|||
-- 是否暴击: 暴击率 = 自身暴击率 - 对方抗暴率
|
||||
local bCrit = false
|
||||
local critRandom = Random.Range01()
|
||||
--特殊处理 白骨精附加的普攻不会必定暴击
|
||||
local mustCrit=atkRole.mustCrit
|
||||
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
|
||||
atkRole.mustCrit=false
|
||||
end
|
||||
local critCondition = clamp(atkRole:GetRoleData(RoleDataName.Crit) - defRole:GetRoleData(RoleDataName.Tenacity), 0, 1)
|
||||
bCrit = critRandom <= critCondition
|
||||
bCrit =atkRole.mustCrit or bCrit or defRole.isFlagCrit == true -- 必定暴击
|
||||
bCrit =mustCrit or bCrit or defRole.isFlagCrit == true -- 必定暴击
|
||||
|
||||
-- 计算暴伤害系数
|
||||
local critDamageFactor = 1
|
||||
|
|
@ -727,16 +732,18 @@ end
|
|||
|
||||
|
||||
-- 检测命中
|
||||
function BattleUtil.CheckIsHit(atkRole, defRole)
|
||||
function BattleUtil.CheckIsHit(atkRole, defRole,skill)
|
||||
-- 是否命中: 命中 = 自身命中率 - 对方闪避率
|
||||
local isHit = false
|
||||
if atkRole.mustHit then
|
||||
return true
|
||||
local mustHit = atkRole.mustHit
|
||||
--特殊处理 白骨精附加的普攻不会必定暴击
|
||||
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
|
||||
mustHit=false
|
||||
end
|
||||
local hitRandom = Random.Range01()
|
||||
local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1)
|
||||
isHit = hitRandom <= hitCondition
|
||||
return isHit
|
||||
return mustHit or isHit
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -344,9 +344,9 @@ end
|
|||
|
||||
|
||||
-- 盾效果触发
|
||||
function EnemyView:OnShieldTrigger(shield,atkRole)
|
||||
function EnemyView:OnShieldTrigger(shield,isImmuneAllReduceShield)
|
||||
if shield.shieldType == ShieldTypeName.AllReduce then
|
||||
if atkRole and not atkRole.isImmuneAllReduceShield then
|
||||
if atkRole and not isImmuneAllReduceShield then
|
||||
self.Floater:ImageBuffFloating("z_zhandou_wudizi")
|
||||
end
|
||||
else
|
||||
|
|
|
|||
|
|
@ -388,9 +388,9 @@ end
|
|||
|
||||
|
||||
-- 盾效果触发
|
||||
function PlayerView:OnShieldTrigger(shield,atkRole)
|
||||
function PlayerView:OnShieldTrigger(shield,isImmuneAllReduceShield)
|
||||
if shield.shieldType == ShieldTypeName.AllReduce then
|
||||
if atkRole and not atkRole.isImmuneAllReduceShield then
|
||||
if atkRole and not isImmuneAllReduceShield then
|
||||
self.Floater:ImageBuffFloating("z_zhandou_wudizi")
|
||||
end
|
||||
else
|
||||
|
|
|
|||
|
|
@ -440,9 +440,9 @@ end
|
|||
|
||||
|
||||
-- 盾效果触发
|
||||
function RoleView:OnShieldTrigger(shield,atkRole)
|
||||
function RoleView:OnShieldTrigger(shield,isImmuneAllReduceShield)
|
||||
if shield.shieldType == ShieldTypeName.AllReduce then
|
||||
if atkRole and not atkRole.isImmuneAllReduceShield then
|
||||
if atkRole and not isImmuneAllReduceShield then
|
||||
self.Floater:ImageBuffFloating("z_zhandou_wudizi")
|
||||
end
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue