[战斗]==========被动26, 327 107, 331 修改提交

dev_chengFeng
wangzhenxing 2021-06-23 16:28:57 +08:00
parent d943d3044b
commit 5e8bab74af
4 changed files with 115 additions and 43 deletions

View File

@ -528,28 +528,40 @@ local passivityList = {
role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffCaster,nil,nil,role)
end,
--造成的伤害暴击后,[a]施加攻击*[c]的[d]持续伤害,持续[e]秒。
--造成的伤害暴击后,[a]%概率恢复[b]点怒气,阵营限制[c](c不填不做限制)
--a[float],c[float],d[伤害类型],e[int]
[26] = function(role, args,id,judge)
local f1 = args[1]
local f2 = args[2]
local dt = args[3]
local f3 = args[4]
local triggerUid = {}
local p1 = args[1]
local v1 = args[2]
local ele = args[3]
--被爆击的人数
local num=0
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
end
BattleUtil.RandomAction(f1, function ()
defRole:AddBuff(Buff.Create(role, BuffName.DOT, f3, 1, 0, dt, f2))
triggerUid[defRole.uid] = defRole.uid
BattleLogic.WaitForTrigger(f3+1, function ()
triggerUid[defRole.uid] = nil
end)
role.Event:AddEvent(BattleEventName.RoleCrit, OnRoleCrit,nil,nil,role)
end
-- 技能后后
local onSkillCastEnd = function(skill)
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
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,
--造成的伤害暴击后,[a]的概率回复自身[b]*[c]的血量
@ -1919,11 +1931,12 @@ local passivityList = {
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
end,
-- 释放技能后自身回[a]点怒气,回怒概率[b]%(不填为100%)
-- a[int],b[float]
-- 释放技能后自身回[a]点怒气,回怒概率[b]%(不填为100%),阵营限制为[c](不填不限制阵营)
-- a[int],b[float],c[int 阵营id]
[107] = function(role, args,id,judge)
local i1 = args[1]
local p1 = args[2]
local ele= args[3]
if not p1 then
p1=1
end
@ -1932,6 +1945,9 @@ local passivityList = {
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if ele and role.element~=ele then
return
end
if skill.type == BattleSkillType.Special then
BattleUtil.RandomAction(p1, function ()
BattleUtil.CalRage(role, role, i1, CountTypeName.Add)
@ -7436,12 +7452,13 @@ local passivityList = {
return
end
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
return
end
list=BattleUtil.SortByRage(list,0)
list[1]:CastSkill()
-- list[1]:CastSkill()
BattleLogic.InsertSkillRole(list[1])
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
@ -7515,6 +7532,25 @@ local passivityList = {
end
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleRealDead,nil,nil,role)
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

View File

@ -27,6 +27,7 @@ local allEnemyDamage=0
--关卡星级记录
local levelStarRecord
local hardStageId =0
local insertSkillRole=nil
--是否开启战斗日志
BattleLogic.IsOpenBattleRecord = false
--逻辑帧频
@ -53,6 +54,7 @@ function BattleLogic.Init(data, _userData, maxRound)
fightData = data
userData = _userData
hardStageId=data.nodeId
insertSkillRole=nil
BattleLogic.CurOrder = 0
BattleLogic.TotalOrder = #data.enemyData
BattleLogic.Clear()
@ -195,6 +197,8 @@ function BattleLogic.GetCurTurn()
return CurCamp, CurSkillPos[CurCamp]
end
-- 设置是否是debug
function BattleLogic.SetIsDebug(isDebug)
_IsDebug = isDebug
@ -267,7 +271,9 @@ function BattleLogic.TurnRound(debugTurn)
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
BattleLogic.WaitForTrigger(0.2,function()
-- 切换阵营
CurCamp = (CurCamp + 1) % 2
if not insertSkillRole then
CurCamp = (CurCamp + 1) % 2
end
BattleLogic.CheckBattleLogic()
end)
end)
@ -284,29 +290,51 @@ function BattleLogic.CheckBattleLogic()
"Camp Change",
"camp", CurCamp
)
-- 当前阵营下一释放技能的位置
local cpos = CurSkillPos[CurCamp] + 1
-- 找到下一个释放技能的人
local SkillRole
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不灭
local lastPos
--如果有插入行动的英雄,就先让插入的英雄行动
if insertSkillRole then
SkillRole =insertSkillRole
insertSkillRole=nil
--记录下正常执行行动的英雄的位置,插入英雄行动完,再按照正常顺序执行
lastPos=CurSkillPos[CurCamp]
CurSkillPos[CurCamp]=SkillRole.position
-- 如果当前位置不能释放技能也需要走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不灭
CurSkillPos[CurCamp]=lastPos
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
BattleLogManager.Log( "No Skill Position" )
@ -363,6 +391,9 @@ function BattleLogic.WaitForTrigger(delayTime, action)
tbActionList:Add(item)
end
function BattleLogic.InsertSkillRole(role)
insertSkillRole=role
end
function BattleLogic.CurFrame()
return curFrame

View File

@ -168,6 +168,7 @@ BattleEventName = {
RoleExileEnd = indexAdd(),--角色放逐结束
RoleAddBuffFail = indexAdd(),--角色添加buff失败
RecordRageChange = indexAdd(), -- 怒气改变时
ActionOperateAngerAfter =indexAdd(),--角色行动操作怒气后
}
BattleMaxFrame = 1000000

View File

@ -335,6 +335,7 @@ function RoleLogic:SkillCast(skill, func)
-- 角色不可用直接结束技能释放
if not skill or not self:IsAvailable() then
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
_CastDone()
return
end
@ -355,6 +356,7 @@ function RoleLogic:SkillCast(skill, func)
self.Rage = self.Rage + grow
end
-- 释放完成
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
_CastDone()
end
-- 释放普技
@ -366,6 +368,7 @@ function RoleLogic:SkillCast(skill, func)
if skill.isRage then
if self.Rage < self.SuperSkillRage then
-- 怒气值不足不能释放技能
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
_CastDone()
return
end
@ -385,12 +388,13 @@ function RoleLogic:SkillCast(skill, func)
self.Rage = self.Rage - costRage
end)
end
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
-- 释放绝技
skill:Cast(_CastDone)
-- 没有符合条件的技能直接进入下一个技能检测
else
self.Event:DispatchEvent(BattleEventName.ActionOperateAngerAfter,self)
_CastDone()
end
@ -483,7 +487,7 @@ function RoleLogic:CastSkill(func)
end
--如果当前怒气不足以释放绝技
if self.Rage<self.SuperSkillRage then
BattleLogic.Event:DispatchEvent(BattleEventName.RoleCastSkillBefore,self)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleCastSkillBefore,self)
end
-- 没有沉默
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then