[战斗]======被动355-363 提交

dev_chengFeng
wangzhenxing 2021-10-28 09:48:01 +08:00
parent 429366fa93
commit 74dea991bc
4 changed files with 261 additions and 2 deletions

View File

@ -8468,10 +8468,14 @@ local passivityList = {
local v1 = args[4]
local round = args[5]
local isTrigger=false
local onSkillCast = function(skill)
if not skill then
return
end
if isTrigger then
return
end
local r=BattleLogic.GetCurRound()
if r%2~=type then
return
@ -8486,10 +8490,210 @@ local passivityList = {
for _, r in pairs(list) do
r:AddBuff(Buff.Create(role, BuffName.PropertyChange, round, BattlePropList[pro],v1, ct))
end
isTrigger=true
end
end
role.Event:AddEvent(BattleEventName.SkillCastBefore,onSkillCast,nil,nil,role)
local function onRoundChange()
isTrigger=false
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role)
end,
-- 修改技能效果[a]的参数,第[b]个参数改变为[c],第[d]个参数改变为[e]
-- a[int 技能的id],b[int],c[float/int],d[int],e[int/float]
[356] = function(role, args,id,judge)
local type = args[1]
local i1 = args[2]
local v1 = args[3]
local i2 = args[4]
local v2 = args[5]
local onSkillEffectBefore = function(skill, e, func)
if skill.type == BattleSkillType.Special then
if skill.id == type then
if e.args[i1] then
e.args[i1] = v1
end
if e.args[i2] then
e.args[i2] = v2
end
if func then func(e) end
end
end
end
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore,nil,nil,role)
end,
--为目标添加[a]类型[b]效果成功,[c]改变目标[d]点怒气
--a[int],b[int],c[int 改变类型]d[int]
[357] = function(role,args,id,judge)
local type = args[1]
local type2 = args[2]
local ct = args[3]
local v1 = args[4]
local OnBuffBeAdd=function(buff)
if buff.type~=type then
return
end
if type==BuffName.DOT then
if buff.damageType~=type2 then
return
end
end
BattleUtil.CalRage(role,buff.target,v1,ct)
end
role.Event:AddEvent(BattleEventName.BuffCaster,OnBuffBeAdd,nil,nil,role)
end,
-- 攻击[a]类型[b]效果目标时,暴击伤害改变[c][d]%,攻击类型[e]
-- a[持续伤害状态],b[float],c[改变类型],d[float],e[int 0:所有 1普攻 2技能]
[358] = function(role, args,id,judge)
local type1 = args[1]
local type2 = args[2]
local ct = args[3]
local v1 = args[4]
local skillType = args[5]
local onPassiveDamaging = function(damagingFunc, defRole, damage,skill,dotType,bCrit)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if not bCrit then
return
end
if BattleLogic.BuffMgr:HasBuff(defRole, type1, function(buff) return buff.damageType == type2 end,role,type2) then
if damagingFunc then
local dd = BattleUtil.CountValue(damage,v1, ct) - damage
damagingFunc(-floor(BattleUtil.ErrorCorrection(dd)))
end
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role)
end,
--释放技能消耗怒气超过[a]点,对目标额外造成目标[b]属性[c]%*(本次技能消耗怒气数-a)的间接伤害。
--a[float]
[359] = function(role, args,id,judge)
local num = args[1]
local pro = args[2]
local v1 = args[3]
local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
if not skill then
return
end
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special then
return
end
if skill.costRage<=num then
return
end
--如果是boss 并且额外伤害是根据最大生命则返回
local isBoss=BattleUtil.CheckIsBoss(defRole)
if isBoss then
return
end
local ar1 = floor(BattleUtil.FP_Mul(defRole:GetRoleData(BattlePropList[pro]),v1,skill.costRage-num))
BattleUtil.FinalDamageCountShield(nil, role, defRole, ar1)
end
role.Event:AddEvent(BattleEventName.RoleDamage, OnRoleCrit,nil,nil,role)
end,
-- 己方[a]阵营神将(除[b]职业神将外)释放技能(除追击技能),有[c]%概率追加一次普攻
-- a[int 阵营id],b[int job id],c[float]
[360] = function(role, args,id,judge)
local camp = args[1]
local job = args[2]
local v1 = args[3]
-- 释放技能后
local onSkillEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if role.element~=camp then
return
end
if role.job==job then
return
end
if skill.type == BattleSkillType.Special then
BattleUtil.RandomAction(v1, function ()
role:AddSkill(BattleSkillType.Normal, false, true, nil)
end)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role)
end,
-- 释放技能后[a]%概率再次释放技能,伤害为初始技能伤害[b]%,释放次数每增加1,概率是之前的[c]%
-- a[float],b[float],c[float]
[361] = function(role, args,id,judge)
local p1 = args[1]
local p2 = args[2]
local p3 = args[3]
local pro=p1
local triggerTime=0
local onSkillEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special then
return
end
pro=p1*(p3^triggerTime)
local isRand=BattleUtil.RandomAction(pro,function()
triggerTime=triggerTime+1
role:AddSkill(BattleSkillType.Special, false, false, nil)
end)
--连击中断,概率和次数回调
if not isRand then
pro=p1
triggerTime=0
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role)
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
if triggerTime==0 then
return
end
local dd = BattleUtil.CountValue(damage,p2, CountTypeName.SubPencent) - damage
damagingFunc(-floor(dd))
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging,nil,nil,role)
end,
--处于[a]类型[b]效果的目标,获得御甲时得效果改变[c][d]%,[e](e 1:自身释放)
--a[int buff类型],b[int 具体类型],c[int 改变类型],d[float],e[int]
[362]=function(role, args,id,judge)
local type1 = args[1]
local type2 = args[2]
local ct = args[3]
local v1 = args[4]
local type3 = args[5]
local onPassiveBlood=function(func,trigger,caster,value)
if not func then
return
end
-- if type3==1 then
-- return
-- end
if BattleLogic.BuffMgr:HasBuff(trigger, type1, function(buff) return buff.damageType == type2 and buff.caster==role end,role,type2) then
if func then
local dd = BattleUtil.CountValue(value,v1, ct) - value
func(floor(BattleUtil.ErrorCorrection(dd)))
end
end
end
BattleLogic.Event:AddEvent(BattleEventName.BloodValuePassiveChange,onPassiveBlood,nil,nil,role)
end,
--改变被动效果数据 被动id[a] 第[b]个参数值变成[c]; 第[d]个参数值变成[e](参数可变,但必须简直对应)
[363]=function(role, args,id,judge)
--用于被动初始化时替换被动数值
end,
}
return passivityList

View File

@ -5,11 +5,19 @@ function Blood:SetData(...)
-- 刷新排序等级
self.bloodValue=...
local passiveChange=function(addValue)
self.bloodValue=self.bloodValue+addValue
end
BattleLogic.Event:DispatchEvent(BattleEventName.BloodValuePassiveChange,passiveChange,self.target,self.caster,self.bloodValue)
self.sort = 4
end
function Blood:AddValue(value)
local passiveChange=function(addValue)
value=value+addValue
end
BattleLogic.Event:DispatchEvent(BattleEventName.BloodValuePassiveChange,passiveChange,self.target,self.caster,value)
self.bloodValue=self.bloodValue+value
self.target.Event:DispatchEvent(BattleEventName.BloodValueChange,self.bloodValue/self.target:GetRoleData(RoleDataName.MaxHp),1,value)
end

View File

@ -175,8 +175,10 @@ BattleEventName = {
ActionOperateAngerAfter =indexAdd(),--角色行动操作怒气后
HitRoleInBurn = indexAdd(), --击中在燃烧状态得敌人
ActionOperateAngerBefore =indexAdd(),--角色行动操作怒气前
BloodValueChange = indexAdd(), --御甲发发生改变
BloodValueChange = indexAdd(), --御甲发发生改变
CheckLiZhanZhiQu = indexAdd(),--检测历战之躯
SkillCastCostRageEnd = indexAdd(), --技能释放最后扣除怒气
BloodValuePassiveChange = indexAdd(),--被动修改御甲值
}
BattleMaxFrame = 1000000

View File

@ -90,7 +90,22 @@ function RoleLogic:Init(uid, data, position)
self.curMainTarget=nil --当前主目标
self.passiveList = {}
if data.passivity and #data.passivity > 0 then
table.sort(data.passivity,function(a,b)return a[1] < b[1] end)
--排序363类型的排在前面
table.sort(data.passivity,function(a,b)
if a[3]==b[3] then
return a[1] < b[1]
else
if a[3]==363 then
return true
end
if b[3]==363 then
return false
end
end
return a[1] < b[1]
end)
local coverPass={}
for i = 1, #data.passivity do
local v = data.passivity[i]
local passivityId=v[1]
@ -100,6 +115,29 @@ function RoleLogic:Init(uid, data, position)
for j = 4, #v do
args[j-3] = v[j]
end
--如果时363类型得被动就存起来
if id==363 then
coverPass[args[1]]=args
else
--如果有363修改的被动就修改
if coverPass[passivityId] then
local coverArgs=coverPass[passivityId]
local len=floor((#coverArgs-1)/2)
for i = 1, len do
local id=0
if #coverArgs>i+1 then
id=coverArgs[i+1]
end
local value=0
if #coverArgs>=i+2 then
value=coverArgs[i+2]
end
if id~=0 and value~=0 and #args>=id and args[id] then
args[id]=value
end
end
end
end
if BattleUtil.Passivity[id] then
BattleUtil.Passivity[id](self, args,passivityId,judge)
BattleLogManager.Log(
@ -340,6 +378,9 @@ function RoleLogic:IsAvailable(skill)
return false
end
end
if self.isExile then
return false
end
--角色没有真正死亡 在 被眩晕/沉默的 情况下 任然能释放死亡技能
if (self.ctrl_dizzy or self.ctrl_slient) and self:IsDead() and skill and skill.type==BattleSkillType.DeadSkill then
return true
@ -419,11 +460,15 @@ function RoleLogic:SkillCast(skill, func)
local costRate = 1 - noRageRate
costRate = costRate > 1 and 1 or costRate
costRate = costRate < 0 and 0 or costRate
skill.costRage=0
BattleUtil.RandomAction(costRate, function()
self.Rage = self.Rage - costRage
self.Event:DispatchEvent(BattleEventName.SkillCastCostRageEnd,costRage)
skill.costRage=costRage
end)
end
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
-- 释放绝技
skill:Cast(_CastDone)