[战斗]=============被动新增305 ,被动303,262修改,战斗逻辑修改:如果有技能在释放,不检测轮转

dev_chengFeng
wangzhenxing 2021-01-28 20:08:43 +09:00
parent 7e582e0d57
commit 664d78d24d
3 changed files with 84 additions and 33 deletions

View File

@ -5396,7 +5396,9 @@ local passivityList = {
releaseNum=releaseNum+1
--如果能被限制次数整除 and 小于最大叠加次数
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
end
end
@ -6122,13 +6124,14 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
end,
--如果被持续治疗的神将是[a]系神将,持续治疗效果[b]改变[c]回合,并添加免疫[d]的效果
--a[int,角色职业] b[int,改变类型] c[int] d[int,控制类型]
--如果被持续治疗的神将是[a]系神将,持续治疗效果[b]改变[c]回合,并添加免疫[d]的效果,并且移除[e]效果(e 不填不会移除)
--a[int,角色职业] b[int,改变类型] c[int] d[int,控制类型] e[int 控制类型]
[294]=function(role,args,id,judge)
local ele=args[1]
local ct=args[2]
local round=args[3]
local immune=args[4]
local immune2 = args[5]
local onSkillCastEnd = function(skill)
if not skill then
return
@ -6146,7 +6149,12 @@ local passivityList = {
local curBuff=Buff.Create(role, BuffName.Immune,buff.roundDuration,4,immune)
role1:AddBuff(curBuff)
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)
@ -6352,7 +6360,7 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore)
end,
-- 敌方死亡[a]人自身[b]就[c]改变[d]%
-- 敌方死亡[a]人自身[b]就[c]改变[d]%,--第一回合检测敌方空位加属性
-- a[int] b[int 属性id] c[int 改变类型] d[float]
[303] = function(role,args)
local i1 = args[1]
@ -6360,18 +6368,39 @@ local passivityList = {
local ct = args[3]
local v1 = args[4]
local deadNum = 0
local lastHaveNum = 0
local haveNum = 0 --场上拥有的敌方数量
-- 释放技能后
local OnDead = function(deadRole,killRole,skill)
if deadRole.camp == (role.camp + 1)%2 then
local OnDead = function(deadRole)
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
if deadNum >= i1 then
deadNum = 0
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,ct)
role:AddBuff(buff)
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,
-- 战斗第[a]回合,改变[b] 自身属性[c] [d]%,持续[e]回合
@ -6390,6 +6419,17 @@ local passivityList = {
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

View File

@ -248,7 +248,6 @@ function BattleLogic.TurnRound(debugTurn)
end)
end)
else
-- 检测一次灵兽技能
SkillManager.CheckMonsterSkill(function()
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
@ -300,7 +299,6 @@ function BattleLogic.CheckBattleLogic()
BattleLogic.TurnRoundNextFrame()
return
end
--
BattleLogManager.Log(
"Position Change",
@ -328,7 +326,7 @@ function BattleLogic.CheckBattleLogic()
if not SkillRole:IsAvailable() -- 角色不能释放技能
or (SkillRole:IsDead() -- 将死状态
and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead) --将死但没有不死buff
and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能
and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能
then
SkillManager.CheckTurnRound()
return
@ -415,9 +413,11 @@ function BattleLogic.Update()
return
end
-- 检测技能释放
-- 检测轮转
BattleLogic.CheckTurnRound()
-- 没有技能释放时再检测轮转
if SkillManager.IsSkillEmpty() then
-- 检测轮转
BattleLogic.CheckTurnRound()
end
-- 技能
SkillManager.Update()
--如果有英雄有可以复活的技能,先执行技能逻辑,最后判断死亡人数 by:王振兴

View File

@ -66,7 +66,7 @@ function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage)
skill:Init(caster, effectData, type, targets, isAdd, isRage)
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
table.insert(this.DeadSkillList, 1, skill)
else
else
table.insert(this.SkillList, 1, skill)
end
return skill
@ -86,6 +86,24 @@ function this.HaveMySkill(role)
return false
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)
@ -93,28 +111,19 @@ function this.SetTurnRoundFunc(func)
end
function this.CheckTurnRound()
-- 如果正在释放技能
if this.IsSkilling then
-- if this.IsSkilling then
-- LogError("正在释放技能")
-- return
-- end
-- 如果技能列表部位为空
if not this.IsSkillEmpty() then
return
end
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
return
end
-- 检测一次灵兽技能
-- this.CheckMonsterSkill(this.MonsterCheckFunc)
--
if this.DeadSkillList and #this.DeadSkillList > 0 then
return
end
if this.SkillList and #this.SkillList > 0 then
return
end
-- 没有技能释放的时候才轮转
if this.TurnRoundFunc then
BattleLogic.WaitForTrigger(0.3, function()
-- 清除数量限制
this.CurSkillCount = 0
--
this.TurnRoundFunc()
this.TurnRoundFunc = nil
end)
@ -123,7 +132,7 @@ end
-- 检测是否需要等待灵兽技能
function this.CheckMonsterSkill(func)
this.MonsterCheckFunc = func
this.MonsterCheckFunc = func
-- 判断是否可以向下执行
if not this.IsSkilling and (not this.MonsterSkillList or #this.MonsterSkillList == 0) then
--
@ -174,6 +183,7 @@ function this.Update()
this.CheckMonsterSkill(this.CheckTurnRound)
end
end
return
end
@ -195,6 +205,7 @@ function this.Update()
this.IsSkilling = false
this.CheckTurnRound()
end
return
end