parent
899903104f
commit
0548b16015
|
@ -1776,7 +1776,6 @@ local passivityList = {
|
||||||
for i = 1, i1 do
|
for i = 1, i1 do
|
||||||
role:AddSkill(BattleSkillType.Normal, false, true, nil)
|
role:AddSkill(BattleSkillType.Normal, false, true, nil)
|
||||||
end
|
end
|
||||||
LogError("aaaaaaaaaaaaaaaaaa")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
|
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
|
||||||
|
@ -2533,7 +2532,6 @@ local passivityList = {
|
||||||
local list = skill:GetDirectTargetsNoMiss()
|
local list = skill:GetDirectTargetsNoMiss()
|
||||||
if list then
|
if list then
|
||||||
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1))
|
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1))
|
||||||
LogBattle(role:GetRoleData(pro).." ".. f1.." " .. tv)
|
|
||||||
for _, r in ipairs(list) do
|
for _, r in ipairs(list) do
|
||||||
local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv)
|
local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv)
|
||||||
auraBuff.interval = 1
|
auraBuff.interval = 1
|
||||||
|
@ -2557,7 +2555,6 @@ local passivityList = {
|
||||||
local list = skill:GetDirectTargetsNoMiss()
|
local list = skill:GetDirectTargetsNoMiss()
|
||||||
if list then
|
if list then
|
||||||
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1))
|
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1))
|
||||||
LogBattle(role:GetRoleData(pro).." ".. f1.." " .. tv)
|
|
||||||
for _, r in ipairs(list) do
|
for _, r in ipairs(list) do
|
||||||
local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv)
|
local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv)
|
||||||
auraBuff.interval = 1
|
auraBuff.interval = 1
|
||||||
|
|
|
@ -202,7 +202,6 @@ end
|
||||||
-- debugTurn 用于判断是否是debug轮转的参数
|
-- debugTurn 用于判断是否是debug轮转的参数
|
||||||
function BattleLogic.TurnRound(debugTurn)
|
function BattleLogic.TurnRound(debugTurn)
|
||||||
if BattleLogic.GetIsDebug() and not debugTurn then
|
if BattleLogic.GetIsDebug() and not debugTurn then
|
||||||
LogBattle("-------------")
|
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.DebugStop)
|
BattleLogic.Event:DispatchEvent(BattleEventName.DebugStop)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -296,28 +295,14 @@ function BattleLogic.CheckBattleLogic()
|
||||||
"position", CurSkillPos[CurCamp]
|
"position", CurSkillPos[CurCamp]
|
||||||
)
|
)
|
||||||
|
|
||||||
-- buff计算
|
|
||||||
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
|
||||||
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
|
||||||
|
|
||||||
-- 如果角色无法释放技能
|
|
||||||
if not SkillRole:IsAvailable() -- 角色不能释放技能
|
|
||||||
or (SkillRole:IsDead() and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead)) --将死但没有不死buff
|
|
||||||
then
|
|
||||||
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
|
||||||
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
|
||||||
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
|
||||||
BattleLogic.TurnRoundNextFrame() -- 下一个
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 行动
|
-- 行动
|
||||||
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
|
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
|
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
|
||||||
-- BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
-- buff计算
|
||||||
-- BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
|
||||||
-- 释放技能后,递归交换阵营
|
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
|
||||||
SkillRole:CastSkill(function()
|
-- 设置行动完成回调
|
||||||
|
SkillManager.SetTurnRoundFunc(function()
|
||||||
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
|
||||||
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
|
||||||
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
|
||||||
|
@ -325,6 +310,19 @@ function BattleLogic.CheckBattleLogic()
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动
|
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动
|
||||||
BattleLogic.TurnRoundNextFrame()
|
BattleLogic.TurnRoundNextFrame()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- 如果角色无法释放技能
|
||||||
|
if not SkillRole:IsAvailable() -- 角色不能释放技能
|
||||||
|
or (SkillRole:IsDead() -- 将死状态
|
||||||
|
and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead) --将死但没有不死buff
|
||||||
|
and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能
|
||||||
|
then
|
||||||
|
SkillManager.CheckTurnRound()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 释放技能后,递归交换阵营
|
||||||
|
SkillRole:CastSkill()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleLogic.WaitForTrigger(delayTime, action)
|
function BattleLogic.WaitForTrigger(delayTime, action)
|
||||||
|
@ -354,12 +352,9 @@ function BattleLogic.Update()
|
||||||
end
|
end
|
||||||
if CurRound > MaxRound then
|
if CurRound > MaxRound then
|
||||||
if BattleLogic.Type==9 or BattleLogic.Type== 0 then
|
if BattleLogic.Type==9 or BattleLogic.Type== 0 then
|
||||||
LogBattle("我方总输出"..allHeroDamage.."敌方总输出:"..allEnemyDamage)
|
|
||||||
if allHeroDamage>allEnemyDamage then
|
if allHeroDamage>allEnemyDamage then
|
||||||
LogBattle("争霸赛我方胜")
|
|
||||||
BattleLogic.BattleEnd(1)
|
BattleLogic.BattleEnd(1)
|
||||||
else
|
else
|
||||||
LogBattle("争霸赛敌方胜")
|
|
||||||
BattleLogic.BattleEnd(0)
|
BattleLogic.BattleEnd(0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -637,7 +637,7 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
|
||||||
--添加发送到battleLogic的治疗消息,用于计算总的战斗伤害值
|
--添加发送到battleLogic的治疗消息,用于计算总的战斗伤害值
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
|
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, treat, baseTreat)
|
||||||
BattleLogManager.Log(
|
BattleLogManager.Log(
|
||||||
"Final Damage",
|
"Final Treat",
|
||||||
"acamp", castRole.camp,
|
"acamp", castRole.camp,
|
||||||
"apos", castRole.position,
|
"apos", castRole.position,
|
||||||
"tcamp", targetRole.camp,
|
"tcamp", targetRole.camp,
|
||||||
|
|
|
@ -8,7 +8,6 @@ function MSkill:New()
|
||||||
end
|
end
|
||||||
|
|
||||||
function MSkill:Init(owner, group, index, skillData)
|
function MSkill:Init(owner, group, index, skillData)
|
||||||
LogBattle("MSkill Init")
|
|
||||||
self.owner = owner
|
self.owner = owner
|
||||||
self.group = group
|
self.group = group
|
||||||
self.groupIndex = index
|
self.groupIndex = index
|
||||||
|
|
|
@ -9,7 +9,6 @@ end
|
||||||
|
|
||||||
-- 初始化数据
|
-- 初始化数据
|
||||||
function MSkillGroup:Init(monster, groupData)
|
function MSkillGroup:Init(monster, groupData)
|
||||||
LogBattle("MSkillGroup Init")
|
|
||||||
self.owner = monster
|
self.owner = monster
|
||||||
self.skillGroupData = groupData
|
self.skillGroupData = groupData
|
||||||
-- 创建技能
|
-- 创建技能
|
||||||
|
|
|
@ -148,7 +148,6 @@ end
|
||||||
|
|
||||||
-- 技能加入检测
|
-- 技能加入检测
|
||||||
function MTrigger.AddSkill(triggerId, condition, skill)
|
function MTrigger.AddSkill(triggerId, condition, skill)
|
||||||
LogBattle("AddSkill "..triggerId)
|
|
||||||
if not this.TriggerList then
|
if not this.TriggerList then
|
||||||
this.TriggerList = {}
|
this.TriggerList = {}
|
||||||
end
|
end
|
||||||
|
|
|
@ -422,7 +422,10 @@ end
|
||||||
-- 正常触发技能
|
-- 正常触发技能
|
||||||
function RoleLogic:CastSkill(func)
|
function RoleLogic:CastSkill(func)
|
||||||
-- 设置轮转方法
|
-- 设置轮转方法
|
||||||
SkillManager.SetTurnRoundFunc(func)
|
-- SkillManager.SetTurnRoundFunc(func)
|
||||||
|
if not self:IsAvailable() then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 没有沉默
|
-- 没有沉默
|
||||||
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then
|
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then
|
||||||
-- 释放大技能
|
-- 释放大技能
|
||||||
|
|
|
@ -10,13 +10,29 @@ this.DeadSkillList = {} -- 人物死亡后技能队列,死亡技能优先级
|
||||||
this.MonsterSkillList = {}
|
this.MonsterSkillList = {}
|
||||||
this.SkillList = {}
|
this.SkillList = {}
|
||||||
this.IsSkilling = false
|
this.IsSkilling = false
|
||||||
|
this.MaxSkillCount = 20 -- 单个回合内最多释放20次技能
|
||||||
-- 初始化
|
-- 初始化
|
||||||
function this.Init()
|
function this.Init()
|
||||||
this.Clear()
|
this.Clear()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.CheckMaxCount()
|
||||||
|
if not this.CurSkillCount then
|
||||||
|
this.CurSkillCount = 0
|
||||||
|
end
|
||||||
|
if this.CurSkillCount < this.MaxSkillCount then
|
||||||
|
this.CurSkillCount = this.CurSkillCount + 1
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
function this.AddMonsterSkill(skill)
|
function this.AddMonsterSkill(skill)
|
||||||
|
-- 如果超出最大限制则不再追加技能
|
||||||
|
if not this.CheckMaxCount() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if skill.type == BattleSkillType.Monster then
|
if skill.type == BattleSkillType.Monster then
|
||||||
table.insert(this.MonsterSkillList, skill)
|
table.insert(this.MonsterSkillList, skill)
|
||||||
end
|
end
|
||||||
|
@ -26,6 +42,10 @@ end
|
||||||
|
|
||||||
-- 向技能列表中追加技能
|
-- 向技能列表中追加技能
|
||||||
function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
|
function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
|
||||||
|
-- 如果超出最大限制则不再追加技能
|
||||||
|
if not this.CheckMaxCount() then
|
||||||
|
return
|
||||||
|
end
|
||||||
local skill = skillPool:Get()
|
local skill = skillPool:Get()
|
||||||
skill:Init(caster, effectData, type, targets, isAdd, isRage)
|
skill:Init(caster, effectData, type, targets, isAdd, isRage)
|
||||||
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
|
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
|
||||||
|
@ -37,6 +57,10 @@ function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
|
||||||
end
|
end
|
||||||
-- 插入技能到技能列表首位
|
-- 插入技能到技能列表首位
|
||||||
function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage)
|
function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage)
|
||||||
|
-- 如果超出最大限制则不再追加技能
|
||||||
|
if not this.CheckMaxCount() then
|
||||||
|
return
|
||||||
|
end
|
||||||
local skill = skillPool:Get()
|
local skill = skillPool:Get()
|
||||||
skill:Init(caster, effectData, type, targets, isAdd, isRage)
|
skill:Init(caster, effectData, type, targets, isAdd, isRage)
|
||||||
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
|
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
|
||||||
|
@ -87,6 +111,9 @@ function this.CheckTurnRound()
|
||||||
-- 没有技能释放的时候才轮转
|
-- 没有技能释放的时候才轮转
|
||||||
if this.TurnRoundFunc then
|
if this.TurnRoundFunc then
|
||||||
BattleLogic.WaitForTrigger(0.3, function()
|
BattleLogic.WaitForTrigger(0.3, function()
|
||||||
|
-- 清除数量限制
|
||||||
|
this.CurSkillCount = 0
|
||||||
|
--
|
||||||
this.TurnRoundFunc()
|
this.TurnRoundFunc()
|
||||||
this.TurnRoundFunc = nil
|
this.TurnRoundFunc = nil
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue