Revert "【战斗】v1.0.5"

This reverts commit 0548b16015.
dev_chengFeng
gaoxin 2020-11-20 15:07:27 +08:00
parent 2331c8d013
commit 941cb86845
8 changed files with 31 additions and 50 deletions

View File

@ -1776,6 +1776,7 @@ 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)
@ -2532,6 +2533,7 @@ 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
@ -2555,6 +2557,7 @@ 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

View File

@ -202,6 +202,7 @@ 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
@ -295,14 +296,28 @@ function BattleLogic.CheckBattleLogic()
"position", CurSkillPos[CurCamp] "position", CurSkillPos[CurCamp]
) )
-- 行动
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
-- buff计算 -- buff计算
BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量 BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血) BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
-- 设置行动完成回调
SkillManager.SetTurnRoundFunc(function() -- 如果角色无法释放技能
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) -- 开始行动
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动
-- BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量
-- BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血)
-- 释放技能后,递归交换阵营
SkillRole:CastSkill(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轮数
@ -310,19 +325,6 @@ 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)
@ -358,9 +360,12 @@ 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

View File

@ -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 Treat", "Final Damage",
"acamp", castRole.camp, "acamp", castRole.camp,
"apos", castRole.position, "apos", castRole.position,
"tcamp", targetRole.camp, "tcamp", targetRole.camp,

View File

@ -8,6 +8,7 @@ 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

View File

@ -9,6 +9,7 @@ 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
-- 创建技能 -- 创建技能

View File

@ -148,6 +148,7 @@ 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

View File

@ -422,10 +422,7 @@ 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
-- 释放大技能 -- 释放大技能

View File

@ -10,29 +10,13 @@ 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
@ -42,10 +26,6 @@ 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 -- 死亡技能加入单独的对列
@ -57,10 +37,6 @@ 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 -- 死亡技能加入单独的对列
@ -111,9 +87,6 @@ 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)