【战斗】=======362修改 填加388-391被动

dev_chengFeng
wangzhenxing 2021-11-18 16:02:16 +08:00
parent ad0e844852
commit e705049135
4 changed files with 131 additions and 20 deletions

View File

@ -9635,7 +9635,97 @@ local passivityList = {
end
BattleLogic.Event:AddEvent(BattleEventName.RecordRageChange, onRageChange,nil,nil,role)
end,
--暴击时[a]%概率使爆伤改变[b][c]%
--a[float],b[int],c[float]
[389]=function(role,args,id,judge)
local pro=args[1]
local ct = args[2]
local v1 = args[3]
local addCritDamageFa=function(func)
BattleUtil.RandomAction(pro,function()
if func then
func(v1,ct)
end
end)
end
role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role)
end,
--释放技能时[a]%概率 改变[b]无视目标的[c]buff免疫
--a[float],b[int],c[int]
[390]=function(role,args,id,judge)
local pro=args[1]
local ct = args[2]
local v1 = args[3]
local addCritDamageFa=function(func,buff)
if buff and buff.type~=v1 then
return
end
if func then
func(pro,ct)
end
end
local OnSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill then
role.Event:AddEvent(BattleEventName.PassiveChangeIgnoreImmuneValue,addCritDamageFa,nil,nil,role)
end
end
local OnSkillCastEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill then
role.Event:RemoveEvent(BattleEventName.PassiveChangeIgnoreImmuneValue,addCritDamageFa,nil,nil,role)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast,nil,nil,role)
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role)
end,
--释放技能时[a]%概率 清除目标一个减异效果
--a[float]
[391]=function(role,args,id,judge)
local pro=args[1]
local onRoleTreat=function(targetRole, treat, baseTreat,skill)
if not skill then
return
end
BattleUtil.RandomAction(pro, function()
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.caster.camp~=targetRole.camp and buff.target==targetRole end)
local len=BattleUtil.LengthOfTable(list)
if list and len>0 then
local index=Random.RangeInt(1,len)
BattleLogic.BuffMgr:ClearBuff(targetRole, function (buff)
return buff==list[index]
end)
end
end)
end
local OnSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill then
role.Event:AddEvent(BattleEventName.RoleTreat,onRoleTreat,nil,nil,role)
end
end
local OnSkillCastEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill then
role.Event:RemoveEvent(BattleEventName.RoleTreat,onRoleTreat,nil,nil,role)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast,nil,nil,role)
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role)
end,
}
return passivityList

View File

@ -184,6 +184,7 @@ BattleEventName = {
RoleAddCtrlBuff = indexAdd(),--角色添加控制类buff
CastRageBrfore = indexAdd(),--扣除怒气之前
PassiveAddCritDamageFactor = indexAdd(), --被动增加爆伤系数
PassiveChangeIgnoreImmuneValue = indexAdd(),--被动修改无视
}
BattleMaxFrame = 1000000

View File

@ -979,12 +979,22 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole)
BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole)
critDamageReduceFactor = max(BattleUtil.CountChangeList(critDamageReduceFactor, cl), 0)
-- 计算额外暴击伤害
critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageBonus) - defRole:GetRoleData(RoleDataName.CritDamageReduce) - critDamageReduceFactor
local critDamageAddFactor=0
--加入被动效果 触发暴击被动
local critFunc = function(critEx) critDamageFactor = critEx end
atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc,skill)
local cl2 = {}
local onCritDamageAddFactor = function(v, ct)
if v then
table.insert(cl2, {v, ct})
end
end
atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole)
critDamageAddFactor = max(BattleUtil.CountChangeList(critDamageAddFactor, cl2), 0)
-- 计算额外暴击伤害
critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageBonus) - defRole:GetRoleData(RoleDataName.CritDamageReduce)+critDamageAddFactor - critDamageReduceFactor
--加入被动效果 触发暴击被动 废弃不用
-- local critFunc = function(critEx) critDamageFactor = critEx end
-- atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc,skill)
end
-- 计算克制伤害系数
@ -1066,8 +1076,8 @@ function BattleUtil.FinalTreat(castRole, targetRole, value, baseFactor,skill)
targetRole.data:AddValue(RoleDataName.Hp, treat)
end
castRole.Event:DispatchEvent(BattleEventName.RoleTreat, targetRole, treat, baseTreat)
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
castRole.Event:DispatchEvent(BattleEventName.RoleTreat, targetRole, treat, baseTreat,skill)
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat,skill)
--添加发送到battleLogic的治疗消息用于计算总的战斗伤害值
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
-- 战斗记录用
@ -1131,8 +1141,8 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
if treat > 0 then
targetRole.data:AddValue(RoleDataName.Hp, treat)
end
castRole.Event:DispatchEvent(BattleEventName.RoleTreat, targetRole, treat, baseTreat)
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
castRole.Event:DispatchEvent(BattleEventName.RoleTreat, targetRole, treat, baseTreat,skill)
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat,skill)
--添加发送到battleLogic的治疗消息用于计算总的战斗伤害值
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
-- 战斗记录用

View File

@ -346,17 +346,27 @@ function RoleLogic:AddBuff(buff)
"missF", missF)
-- 如果概率为0 或者没有miss
if missF == 0 or not BattleUtil.RandomAction(missF, function() BattleLogic.BuffMgr:PutBuff(buff) end) then
for i=1, self.buffFilter.size do
if self.buffFilter.buffer[i](buff,self) then
BattleLogManager.Log(
"Buff Filter",
"camp", buff.caster.camp,
"position", buff.caster.position,
"id", buff.id,
"type", buff.type)
BattleLogic.BuffMgr:PutBuff(buff)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleAddBuffFail,buff,self)
return
--概率忽略免疫
local ignoreProb=0
local changeIgnore=function(v1,ct)
ignoreProb=BattleUtil.CountValue(ignoreProb,v1,ct)
end
buff.caster.Event:DispatchEvent(BattleEventName.PassiveChangeIgnoreImmuneValue,changeIgnore,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
BattleLogManager.Log(
"Buff Filter",
"camp", buff.caster.camp,
"position", buff.caster.position,
"id", buff.id,
"type", buff.type)
BattleLogic.BuffMgr:PutBuff(buff)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleAddBuffFail,buff,self)
return
end
end
end
BattleLogic.BuffMgr:AddBuff(self, buff)