[战斗]==========被动26, 327 107, 331 修改提交
parent
d943d3044b
commit
5e8bab74af
|
|
@ -528,28 +528,40 @@ local passivityList = {
|
||||||
role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffCaster,nil,nil,role)
|
role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffCaster,nil,nil,role)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--造成的伤害暴击后,[a]施加攻击*[c]的[d]持续伤害,持续[e]秒。
|
--造成的伤害暴击后,[a]%概率恢复[b]点怒气,阵营限制[c](c不填不做限制)
|
||||||
--a[float],c[float],d[伤害类型],e[int]
|
--a[float],c[float],d[伤害类型],e[int]
|
||||||
[26] = function(role, args,id,judge)
|
[26] = function(role, args,id,judge)
|
||||||
local f1 = args[1]
|
local p1 = args[1]
|
||||||
local f2 = args[2]
|
local v1 = args[2]
|
||||||
local dt = args[3]
|
local ele = args[3]
|
||||||
local f3 = args[4]
|
--被爆击的人数
|
||||||
|
local num=0
|
||||||
local triggerUid = {}
|
|
||||||
local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||||
if triggerUid[defRole.uid] then --加入限定避免循环触发
|
if ele and ele~=role.element then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
num=num+1
|
||||||
|
end
|
||||||
|
|
||||||
|
local onSkillCast = function(skill)
|
||||||
|
if skill and not skill.isTriggerJudge and judge==1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
BattleUtil.RandomAction(f1, function ()
|
role.Event:AddEvent(BattleEventName.RoleCrit, OnRoleCrit,nil,nil,role)
|
||||||
defRole:AddBuff(Buff.Create(role, BuffName.DOT, f3, 1, 0, dt, f2))
|
end
|
||||||
triggerUid[defRole.uid] = defRole.uid
|
|
||||||
BattleLogic.WaitForTrigger(f3+1, function ()
|
-- 技能后后
|
||||||
triggerUid[defRole.uid] = nil
|
local onSkillCastEnd = function(skill)
|
||||||
end)
|
if skill and not skill.isTriggerJudge and judge==1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
role.Event:RemoveEvent(BattleEventName.RoleCrit, OnRoleCrit,nil,nil,role)
|
||||||
|
BattleUtil.RandomAction(p1*num,function()
|
||||||
|
BattleUtil.CalRage(role, role,v1, CountTypeName.Add)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.RoleCrit, OnRoleCrit,nil,nil,role)
|
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast,nil,nil,role)
|
||||||
|
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--造成的伤害暴击后,[a]的概率回复自身[b]*[c]的血量
|
--造成的伤害暴击后,[a]的概率回复自身[b]*[c]的血量
|
||||||
|
|
@ -1919,11 +1931,12 @@ local passivityList = {
|
||||||
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
|
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- 释放技能后自身回[a]点怒气,回怒概率[b]%(不填为100%)
|
-- 释放技能后自身回[a]点怒气,回怒概率[b]%(不填为100%),阵营限制为[c](不填不限制阵营)
|
||||||
-- a[int],b[float]
|
-- a[int],b[float],c[int 阵营id]
|
||||||
[107] = function(role, args,id,judge)
|
[107] = function(role, args,id,judge)
|
||||||
local i1 = args[1]
|
local i1 = args[1]
|
||||||
local p1 = args[2]
|
local p1 = args[2]
|
||||||
|
local ele= args[3]
|
||||||
if not p1 then
|
if not p1 then
|
||||||
p1=1
|
p1=1
|
||||||
end
|
end
|
||||||
|
|
@ -1932,6 +1945,9 @@ local passivityList = {
|
||||||
if skill and not skill.isTriggerJudge and judge==1 then
|
if skill and not skill.isTriggerJudge and judge==1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if ele and role.element~=ele then
|
||||||
|
return
|
||||||
|
end
|
||||||
if skill.type == BattleSkillType.Special then
|
if skill.type == BattleSkillType.Special then
|
||||||
BattleUtil.RandomAction(p1, function ()
|
BattleUtil.RandomAction(p1, function ()
|
||||||
BattleUtil.CalRage(role, role, i1, CountTypeName.Add)
|
BattleUtil.CalRage(role, role, i1, CountTypeName.Add)
|
||||||
|
|
@ -7436,12 +7452,13 @@ local passivityList = {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if skill and (skill.type== BattleSkillType.Special or skill.type==BattleSkillType.Extra ) then
|
if skill and (skill.type== BattleSkillType.Special or skill.type==BattleSkillType.Extra ) then
|
||||||
local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele end)
|
local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele and v~=role end)
|
||||||
if not list or #list ==0 then
|
if not list or #list ==0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
list=BattleUtil.SortByRage(list,0)
|
list=BattleUtil.SortByRage(list,0)
|
||||||
list[1]:CastSkill()
|
-- list[1]:CastSkill()
|
||||||
|
BattleLogic.InsertSkillRole(list[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
|
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
|
||||||
|
|
@ -7515,6 +7532,25 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleRealDead,nil,nil,role)
|
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleRealDead,nil,nil,role)
|
||||||
end,
|
end,
|
||||||
|
--行动后,每剩余1点怒气对[a]自己造成伤害[b][c]%的伤害
|
||||||
|
--a[int 1:自己],b[int],c[float]
|
||||||
|
[331]=function (role,args,id,judge)
|
||||||
|
local v1=args[1]
|
||||||
|
local v2=args[2]
|
||||||
|
local v3=args[3]
|
||||||
|
local onRoleRealDead = function(caster)
|
||||||
|
if caster~=role then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local target=nil
|
||||||
|
if v1==1 then
|
||||||
|
target=role
|
||||||
|
end
|
||||||
|
local damage=floor(BattleUtil.ErrorCorrection(target:GetRoleData(BattlePropList[v2]) * v3))*target.Rage
|
||||||
|
BattleUtil.FinalDamage(nil,role,target,damage)
|
||||||
|
end
|
||||||
|
BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, onRoleRealDead,nil,nil,role)
|
||||||
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
return passivityList
|
return passivityList
|
||||||
|
|
@ -27,6 +27,7 @@ local allEnemyDamage=0
|
||||||
--关卡星级记录
|
--关卡星级记录
|
||||||
local levelStarRecord
|
local levelStarRecord
|
||||||
local hardStageId =0
|
local hardStageId =0
|
||||||
|
local insertSkillRole=nil
|
||||||
--是否开启战斗日志
|
--是否开启战斗日志
|
||||||
BattleLogic.IsOpenBattleRecord = false
|
BattleLogic.IsOpenBattleRecord = false
|
||||||
--逻辑帧频
|
--逻辑帧频
|
||||||
|
|
@ -53,6 +54,7 @@ function BattleLogic.Init(data, _userData, maxRound)
|
||||||
fightData = data
|
fightData = data
|
||||||
userData = _userData
|
userData = _userData
|
||||||
hardStageId=data.nodeId
|
hardStageId=data.nodeId
|
||||||
|
insertSkillRole=nil
|
||||||
BattleLogic.CurOrder = 0
|
BattleLogic.CurOrder = 0
|
||||||
BattleLogic.TotalOrder = #data.enemyData
|
BattleLogic.TotalOrder = #data.enemyData
|
||||||
BattleLogic.Clear()
|
BattleLogic.Clear()
|
||||||
|
|
@ -195,6 +197,8 @@ function BattleLogic.GetCurTurn()
|
||||||
return CurCamp, CurSkillPos[CurCamp]
|
return CurCamp, CurSkillPos[CurCamp]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 设置是否是debug
|
-- 设置是否是debug
|
||||||
function BattleLogic.SetIsDebug(isDebug)
|
function BattleLogic.SetIsDebug(isDebug)
|
||||||
_IsDebug = isDebug
|
_IsDebug = isDebug
|
||||||
|
|
@ -267,7 +271,9 @@ function BattleLogic.TurnRound(debugTurn)
|
||||||
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
|
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
|
||||||
BattleLogic.WaitForTrigger(0.2,function()
|
BattleLogic.WaitForTrigger(0.2,function()
|
||||||
-- 切换阵营
|
-- 切换阵营
|
||||||
CurCamp = (CurCamp + 1) % 2
|
if not insertSkillRole then
|
||||||
|
CurCamp = (CurCamp + 1) % 2
|
||||||
|
end
|
||||||
BattleLogic.CheckBattleLogic()
|
BattleLogic.CheckBattleLogic()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -284,29 +290,51 @@ function BattleLogic.CheckBattleLogic()
|
||||||
"Camp Change",
|
"Camp Change",
|
||||||
"camp", CurCamp
|
"camp", CurCamp
|
||||||
)
|
)
|
||||||
-- 当前阵营下一释放技能的位置
|
|
||||||
local cpos = CurSkillPos[CurCamp] + 1
|
|
||||||
-- 找到下一个释放技能的人
|
-- 找到下一个释放技能的人
|
||||||
local SkillRole
|
local SkillRole
|
||||||
for p = cpos, 6 do
|
local lastPos
|
||||||
-- 保存当前位置
|
--如果有插入行动的英雄,就先让插入的英雄行动
|
||||||
CurSkillPos[CurCamp] = p
|
if insertSkillRole then
|
||||||
-- 自己阵营中的位置 + 自己阵营的ID * 6 = 自己在PosList中的位置
|
SkillRole =insertSkillRole
|
||||||
local role = RoleManager.GetRole(CurCamp, p) --PosList[p + (CurCamp * 6)]
|
insertSkillRole=nil
|
||||||
--角色如果被放逐不能行动 by:wangzhenxing 2020/12/23 11:35
|
--记录下正常执行行动的英雄的位置,插入英雄行动完,再按照正常顺序执行
|
||||||
if role and not role:IsRealDead() and not role.isExile then
|
lastPos=CurSkillPos[CurCamp]
|
||||||
SkillRole = role
|
CurSkillPos[CurCamp]=SkillRole.position
|
||||||
break
|
-- 如果当前位置不能释放技能也需要走buff轮转
|
||||||
end
|
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
||||||
|
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
||||||
-- 如果当前位置不能释放技能也需要走buff轮转
|
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
||||||
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
||||||
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
||||||
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭
|
||||||
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
CurSkillPos[CurCamp]=lastPos
|
||||||
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
|
||||||
BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭
|
|
||||||
end
|
end
|
||||||
|
if not SkillRole then
|
||||||
|
-- 当前阵营下一释放技能的位置
|
||||||
|
local cpos = CurSkillPos[CurCamp] + 1
|
||||||
|
for p = cpos, 6 do
|
||||||
|
-- 保存当前位置
|
||||||
|
CurSkillPos[CurCamp] = p
|
||||||
|
-- 自己阵营中的位置 + 自己阵营的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() and not role.isExile then
|
||||||
|
SkillRole = role
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 如果当前位置不能释放技能也需要走buff轮转
|
||||||
|
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
||||||
|
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
||||||
|
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
||||||
|
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
||||||
|
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
||||||
|
BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- 如果找不到下一个人,直接交换阵营
|
-- 如果找不到下一个人,直接交换阵营
|
||||||
if not SkillRole then
|
if not SkillRole then
|
||||||
BattleLogManager.Log( "No Skill Position" )
|
BattleLogManager.Log( "No Skill Position" )
|
||||||
|
|
@ -363,6 +391,9 @@ function BattleLogic.WaitForTrigger(delayTime, action)
|
||||||
tbActionList:Add(item)
|
tbActionList:Add(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleLogic.InsertSkillRole(role)
|
||||||
|
insertSkillRole=role
|
||||||
|
end
|
||||||
|
|
||||||
function BattleLogic.CurFrame()
|
function BattleLogic.CurFrame()
|
||||||
return curFrame
|
return curFrame
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@ BattleEventName = {
|
||||||
RoleExileEnd = indexAdd(),--角色放逐结束
|
RoleExileEnd = indexAdd(),--角色放逐结束
|
||||||
RoleAddBuffFail = indexAdd(),--角色添加buff失败
|
RoleAddBuffFail = indexAdd(),--角色添加buff失败
|
||||||
RecordRageChange = indexAdd(), -- 怒气改变时
|
RecordRageChange = indexAdd(), -- 怒气改变时
|
||||||
|
ActionOperateAngerAfter =indexAdd(),--角色行动操作怒气后
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleMaxFrame = 1000000
|
BattleMaxFrame = 1000000
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ function RoleLogic:SkillCast(skill, func)
|
||||||
|
|
||||||
-- 角色不可用直接结束技能释放
|
-- 角色不可用直接结束技能释放
|
||||||
if not skill or not self:IsAvailable() then
|
if not skill or not self:IsAvailable() then
|
||||||
|
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
|
||||||
_CastDone()
|
_CastDone()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -355,6 +356,7 @@ function RoleLogic:SkillCast(skill, func)
|
||||||
self.Rage = self.Rage + grow
|
self.Rage = self.Rage + grow
|
||||||
end
|
end
|
||||||
-- 释放完成
|
-- 释放完成
|
||||||
|
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
|
||||||
_CastDone()
|
_CastDone()
|
||||||
end
|
end
|
||||||
-- 释放普技
|
-- 释放普技
|
||||||
|
|
@ -366,6 +368,7 @@ function RoleLogic:SkillCast(skill, func)
|
||||||
if skill.isRage then
|
if skill.isRage then
|
||||||
if self.Rage < self.SuperSkillRage then
|
if self.Rage < self.SuperSkillRage then
|
||||||
-- 怒气值不足不能释放技能
|
-- 怒气值不足不能释放技能
|
||||||
|
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
|
||||||
_CastDone()
|
_CastDone()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -385,12 +388,13 @@ function RoleLogic:SkillCast(skill, func)
|
||||||
self.Rage = self.Rage - costRage
|
self.Rage = self.Rage - costRage
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
|
||||||
-- 释放绝技
|
-- 释放绝技
|
||||||
skill:Cast(_CastDone)
|
skill:Cast(_CastDone)
|
||||||
|
|
||||||
-- 没有符合条件的技能直接进入下一个技能检测
|
-- 没有符合条件的技能直接进入下一个技能检测
|
||||||
else
|
else
|
||||||
|
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
|
||||||
_CastDone()
|
_CastDone()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -483,7 +487,7 @@ function RoleLogic:CastSkill(func)
|
||||||
end
|
end
|
||||||
--如果当前怒气不足以释放绝技
|
--如果当前怒气不足以释放绝技
|
||||||
if self.Rage<self.SuperSkillRage then
|
if self.Rage<self.SuperSkillRage then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.RoleCastSkillBefore,self)
|
BattleLogic.Event:DispatchEvent(BattleEventName.RoleCastSkillBefore,self)
|
||||||
end
|
end
|
||||||
-- 没有沉默
|
-- 没有沉默
|
||||||
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then
|
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue