[战斗]=============被动新增305 ,被动303,262修改,战斗逻辑修改:如果有技能在释放,不检测轮转
parent
7e582e0d57
commit
664d78d24d
|
@ -5396,7 +5396,9 @@ local passivityList = {
|
||||||
releaseNum=releaseNum+1
|
releaseNum=releaseNum+1
|
||||||
--如果能被限制次数整除 and 小于最大叠加次数
|
--如果能被限制次数整除 and 小于最大叠加次数
|
||||||
if releaseNum>0 and releaseNum%num==0 and (addNum<time or time==0 )then
|
if releaseNum>0 and releaseNum%num==0 and (addNum<time or time==0 )then
|
||||||
role.data:AddValue(BattlePropList[pro],val)
|
--role.data:AddValue(BattlePropList[pro],val)
|
||||||
|
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], val,CountTypeName.Add)
|
||||||
|
role:AddBuff(buff)
|
||||||
addNum=addNum+1
|
addNum=addNum+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6122,13 +6124,14 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
|
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
|
||||||
end,
|
end,
|
||||||
--如果被持续治疗的神将是[a]系神将,持续治疗效果[b]改变[c]回合,并添加免疫[d]的效果
|
--如果被持续治疗的神将是[a]系神将,持续治疗效果[b]改变[c]回合,并添加免疫[d]的效果,并且移除[e]效果(e 不填不会移除)
|
||||||
--a[int,角色职业] b[int,改变类型] c[int] d[int,控制类型]
|
--a[int,角色职业] b[int,改变类型] c[int] d[int,控制类型] e[int 控制类型]
|
||||||
[294]=function(role,args,id,judge)
|
[294]=function(role,args,id,judge)
|
||||||
local ele=args[1]
|
local ele=args[1]
|
||||||
local ct=args[2]
|
local ct=args[2]
|
||||||
local round=args[3]
|
local round=args[3]
|
||||||
local immune=args[4]
|
local immune=args[4]
|
||||||
|
local immune2 = args[5]
|
||||||
local onSkillCastEnd = function(skill)
|
local onSkillCastEnd = function(skill)
|
||||||
if not skill then
|
if not skill then
|
||||||
return
|
return
|
||||||
|
@ -6147,6 +6150,11 @@ local passivityList = {
|
||||||
role1:AddBuff(curBuff)
|
role1:AddBuff(curBuff)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
if immune2 then
|
||||||
|
BattleLogic.BuffMgr:ClearBuff(role1, function(buff)
|
||||||
|
return buff.type == BuffName.Control and buff.ctrlType == immune2
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
@ -6352,7 +6360,7 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
|
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
|
||||||
end,
|
end,
|
||||||
-- 敌方死亡[a]人自身[b]就[c]改变[d]%
|
-- 敌方死亡[a]人自身[b]就[c]改变[d]%,--第一回合检测敌方空位加属性
|
||||||
-- a[int] b[int 属性id] c[int 改变类型] d[float]
|
-- a[int] b[int 属性id] c[int 改变类型] d[float]
|
||||||
[303] = function(role,args)
|
[303] = function(role,args)
|
||||||
local i1 = args[1]
|
local i1 = args[1]
|
||||||
|
@ -6360,18 +6368,39 @@ local passivityList = {
|
||||||
local ct = args[3]
|
local ct = args[3]
|
||||||
local v1 = args[4]
|
local v1 = args[4]
|
||||||
local deadNum = 0
|
local deadNum = 0
|
||||||
|
local lastHaveNum = 0
|
||||||
|
local haveNum = 0 --场上拥有的敌方数量
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local OnDead = function(deadRole,killRole,skill)
|
local OnDead = function(deadRole)
|
||||||
if deadRole.camp == (role.camp + 1)%2 then
|
if deadRole.camp ~= role.camp then
|
||||||
|
--延时两帧执行,死亡被复活不会触发,复活延时了一帧所以这里要延时两帧
|
||||||
|
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime*2, function ()
|
||||||
|
haveNum=#RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
||||||
|
if lastHaveNum==haveNum then
|
||||||
|
return
|
||||||
|
end
|
||||||
deadNum = deadNum + 1
|
deadNum = deadNum + 1
|
||||||
if deadNum >= i1 then
|
if deadNum >= i1 then
|
||||||
deadNum = 0
|
deadNum = 0
|
||||||
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,ct)
|
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,ct)
|
||||||
role:AddBuff(buff)
|
role:AddBuff(buff)
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead, OnDead)
|
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, OnDead)
|
||||||
|
--第一回合检测敌方空位
|
||||||
|
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound)
|
||||||
|
-- 第i1回合开始
|
||||||
|
if curRound == 1 then
|
||||||
|
haveNum=#RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
||||||
|
lastHaveNum=haveNum
|
||||||
|
local num =6 - haveNum
|
||||||
|
if num>0 then
|
||||||
|
role:AddBuff(Buff.Create(role, BuffName.PropertyChange,0, BattlePropList[p1],v1*num, ct))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- 战斗第[a]回合,改变[b] 自身属性[c] [d]%,持续[e]回合
|
-- 战斗第[a]回合,改变[b] 自身属性[c] [d]%,持续[e]回合
|
||||||
|
@ -6390,6 +6419,17 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
|
-- 敌方单位被击杀自身释放[a]技能,释放的技能类型为[b]。
|
||||||
|
-- a[int] b[int]
|
||||||
|
[305] = function(role, args,id,judge)
|
||||||
|
local f1 = args[1]
|
||||||
|
local f2=args[2]
|
||||||
|
local onRoleHit = function(deadRole)
|
||||||
|
if deadRole.camp~=role.camp then
|
||||||
|
role:InsertExtraSkill(f1,f2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleHit)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
return passivityList
|
return passivityList
|
|
@ -248,7 +248,6 @@ function BattleLogic.TurnRound(debugTurn)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
|
||||||
-- 检测一次灵兽技能
|
-- 检测一次灵兽技能
|
||||||
SkillManager.CheckMonsterSkill(function()
|
SkillManager.CheckMonsterSkill(function()
|
||||||
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
|
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
|
||||||
|
@ -300,7 +299,6 @@ function BattleLogic.CheckBattleLogic()
|
||||||
BattleLogic.TurnRoundNextFrame()
|
BattleLogic.TurnRoundNextFrame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
BattleLogManager.Log(
|
BattleLogManager.Log(
|
||||||
"Position Change",
|
"Position Change",
|
||||||
|
@ -415,9 +413,11 @@ function BattleLogic.Update()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 检测技能释放
|
-- 没有技能释放时再检测轮转
|
||||||
|
if SkillManager.IsSkillEmpty() then
|
||||||
-- 检测轮转
|
-- 检测轮转
|
||||||
BattleLogic.CheckTurnRound()
|
BattleLogic.CheckTurnRound()
|
||||||
|
end
|
||||||
-- 技能
|
-- 技能
|
||||||
SkillManager.Update()
|
SkillManager.Update()
|
||||||
--如果有英雄有可以复活的技能,先执行技能逻辑,最后判断死亡人数 by:王振兴
|
--如果有英雄有可以复活的技能,先执行技能逻辑,最后判断死亡人数 by:王振兴
|
||||||
|
|
|
@ -86,6 +86,24 @@ function this.HaveMySkill(role)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 判断是否有即将释放的技能
|
||||||
|
function this.IsSkillEmpty()
|
||||||
|
if this.IsSkilling then
|
||||||
|
-- LogError("正在释放技能")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if this.DeadSkillList and #this.DeadSkillList > 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if this.SkillList and #this.SkillList > 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 设置用于轮转的方法
|
-- 设置用于轮转的方法
|
||||||
function this.SetTurnRoundFunc(func)
|
function this.SetTurnRoundFunc(func)
|
||||||
|
@ -93,20 +111,12 @@ function this.SetTurnRoundFunc(func)
|
||||||
end
|
end
|
||||||
function this.CheckTurnRound()
|
function this.CheckTurnRound()
|
||||||
-- 如果正在释放技能
|
-- 如果正在释放技能
|
||||||
if this.IsSkilling then
|
-- if this.IsSkilling then
|
||||||
return
|
-- LogError("正在释放技能")
|
||||||
end
|
-- return
|
||||||
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
|
-- end
|
||||||
return
|
-- 如果技能列表部位为空
|
||||||
end
|
if not this.IsSkillEmpty() then
|
||||||
-- 检测一次灵兽技能
|
|
||||||
-- this.CheckMonsterSkill(this.MonsterCheckFunc)
|
|
||||||
|
|
||||||
--
|
|
||||||
if this.DeadSkillList and #this.DeadSkillList > 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if this.SkillList and #this.SkillList > 0 then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- 没有技能释放的时候才轮转
|
-- 没有技能释放的时候才轮转
|
||||||
|
@ -114,7 +124,6 @@ function this.CheckTurnRound()
|
||||||
BattleLogic.WaitForTrigger(0.3, function()
|
BattleLogic.WaitForTrigger(0.3, function()
|
||||||
-- 清除数量限制
|
-- 清除数量限制
|
||||||
this.CurSkillCount = 0
|
this.CurSkillCount = 0
|
||||||
--
|
|
||||||
this.TurnRoundFunc()
|
this.TurnRoundFunc()
|
||||||
this.TurnRoundFunc = nil
|
this.TurnRoundFunc = nil
|
||||||
end)
|
end)
|
||||||
|
@ -174,6 +183,7 @@ function this.Update()
|
||||||
this.CheckMonsterSkill(this.CheckTurnRound)
|
this.CheckMonsterSkill(this.CheckTurnRound)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -195,6 +205,7 @@ function this.Update()
|
||||||
this.IsSkilling = false
|
this.IsSkilling = false
|
||||||
this.CheckTurnRound()
|
this.CheckTurnRound()
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue