战斗专属log添加,删除部分无用打印,添加死亡技能检测队列保证死亡技能的优先级最高。

gaoxin 2020-09-25 12:22:12 +08:00
parent 49d55c763e
commit ac15a97977
8 changed files with 140 additions and 103 deletions

View File

@ -2122,7 +2122,7 @@ local effectList = {
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target) caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function () BattleLogic.WaitForTrigger(interval, function ()
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, ct)) caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, ct))
end end
end end

View File

@ -1479,11 +1479,11 @@ local passivityList = {
[78] = function(role, args) [78] = function(role, args)
local pro = args[1] local pro = args[1]
local f1 = args[2] local f1 = args[2]
LogError("开始治疗") LogBattle("开始治疗")
--这里加一个延时,防止执行时显示层还没有初始化,从而没有表现 --这里加一个延时,防止执行时显示层还没有初始化,从而没有表现
BattleLogic.WaitForTrigger(0.05, function() BattleLogic.WaitForTrigger(0.05, function()
local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro]))) local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro])))
BattleUtil.CalTreat(role, role, val) BattleUtil.CalTreat(role, role, val)
end) end)
end, end,
--战斗结束时,为自身回复[a]*[b]的血量。 --战斗结束时,为自身回复[a]*[b]的血量。
@ -1566,7 +1566,7 @@ local passivityList = {
-- buff.cover = true -- 可以叠加 -- buff.cover = true -- 可以叠加
-- buff.clear = false -- 不可驱散 -- buff.clear = false -- 不可驱散
-- role:AddBuff(buff) -- role:AddBuff(buff)
if skill and not skill.isAdd and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then if skill and not skill.isAdd and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
role:AddRage(i1, CountTypeName.Add) role:AddRage(i1, CountTypeName.Add)
end end
end end
@ -1785,7 +1785,7 @@ local passivityList = {
local ct = args[3] local ct = args[3]
-- 释放技能后 -- 释放技能后
local onRoleHit = function(defRole) local onRoleHit = function(defRole)
if defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then if defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct)
-- buff.cover = true -- buff.cover = true
role:AddBuff(buff) role:AddBuff(buff)
@ -1993,7 +1993,7 @@ local passivityList = {
local i1 = args[1] local i1 = args[1]
-- 释放技能后 -- 释放技能后
local onRoleHit = function(target) local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
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
@ -2039,7 +2039,7 @@ local passivityList = {
local f1 = args[1] local f1 = args[1]
-- 释放技能后 -- 释放技能后
local onRoleHit = function(target) local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1)) local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1))
BattleUtil.CalTreat(role, role, treat) BattleUtil.CalTreat(role, role, treat)
end end
@ -2228,7 +2228,7 @@ local passivityList = {
local f1 = args[1] local f1 = args[1]
-- 释放技能后 -- 释放技能后
local onRoleHit = function(target) local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add)
role:AddBuff(buff) role:AddBuff(buff)
end end
@ -2383,7 +2383,7 @@ local passivityList = {
-- 击杀数量累加 -- 击杀数量累加
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
if skill and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
killNum = killNum + 1 killNum = killNum + 1
end end
end end
@ -2522,7 +2522,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))
LogError(role:GetRoleData(pro).." ".. f1.." " .. tv) 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
@ -2546,7 +2546,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))
LogError(role:GetRoleData(pro).." ".. f1.." " .. tv) 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
@ -2765,7 +2765,7 @@ local passivityList = {
local dot = args[1] local dot = args[1]
local f1 = args[2] local f1 = args[2]
local function onHit(target) local function onHit(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local maxHp = role:GetRoleData(RoleDataName.MaxHp) local maxHp = role:GetRoleData(RoleDataName.MaxHp)
local value = floor(BattleUtil.ErrorCorrection(maxHp* f1)) local value = floor(BattleUtil.ErrorCorrection(maxHp* f1))
BattleUtil.ApplyTreat(role, role, value) BattleUtil.ApplyTreat(role, role, value)
@ -2903,7 +2903,7 @@ local passivityList = {
local i1 = args[1] local i1 = args[1]
local onHit = function(target, damage, bCrit, finalDmg) local onHit = function(target, damage, bCrit, finalDmg)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
role:AddRage(i1, CountTypeName.Add) role:AddRage(i1, CountTypeName.Add)
end end
end end
@ -3247,7 +3247,7 @@ local passivityList = {
local dt = args[2] local dt = args[2]
-- 直接伤害后 -- 直接伤害后
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and not skill.isAdd and target:IsDead() and BattleUtil.CheckIsNoDead(target) then if skill and not skill.isAdd and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
BattleUtil.SortByHpFactor(list, 1) BattleUtil.SortByHpFactor(list, 1)
local index = 0 local index = 0
@ -3519,7 +3519,7 @@ local passivityList = {
local f1 = args[1] local f1 = args[1]
local onRoleHit = function(target) local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local target = RoleManager.GetAliveAggro(role) local target = RoleManager.GetAliveAggro(role)
BattleUtil.CalDamage(nil, role, target, 1, f1) BattleUtil.CalDamage(nil, role, target, 1, f1)
end end
@ -3812,7 +3812,7 @@ local passivityList = {
[197] = function(role, args) [197] = function(role, args)
local f1 = args[1] local f1 = args[1]
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and skill.type == BattleSkillType.Special and target:IsDead() and BattleUtil.CheckIsNoDead(target) then if skill and skill.type == BattleSkillType.Special and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
BattleUtil.RandomAction(f1, function() BattleUtil.RandomAction(f1, function()
role:AddRage(target.Rage, CountTypeName.Add) role:AddRage(target.Rage, CountTypeName.Add)
end) end)
@ -3898,9 +3898,9 @@ local passivityList = {
local function onPassiveSeckill(func) local function onPassiveSeckill(func)
local isBoss=BattleUtil.CheckIsBoss(defRole) local isBoss=BattleUtil.CheckIsBoss(defRole)
if isBoss then if isBoss then
return return
end end
if func then func(f1, CountTypeName.Cover) end if func then func(f1, CountTypeName.Cover) end
end end
role.Event:AddEvent(BattleEventName.PassiveSeckill, onPassiveSeckill) role.Event:AddEvent(BattleEventName.PassiveSeckill, onPassiveSeckill)
@ -4752,9 +4752,7 @@ local passivityList = {
local onSkillEnd = function(skill) local onSkillEnd = function(skill)
if skill and skill.type == BattleSkillType.Special then if skill and skill.type == BattleSkillType.Special then
BattleUtil.RandomAction(f1, function() BattleUtil.RandomAction(f1, function()
BattleLogic.WaitForTrigger(0.1, function() role:InsertExtraSkill(f2,f3)
role:InsertExtraSkill(f2,f3)
end)
end) end)
end end
end end
@ -4766,14 +4764,11 @@ local passivityList = {
local f1 = args[1] local f1 = args[1]
local f2=args[2] local f2=args[2]
local onRoleHit = function(target) local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) and not role:IsDead() then if target:IsDead() and not BattleUtil.CheckIsNoDead(target) and not role:IsDead() then
-- local target = RoleManager.GetAliveAggro(role) -- local target = RoleManager.GetAliveAggro(role)
--BattleUtil.CalDamage(nil, role, target, 1, f1) --BattleUtil.CalDamage(nil, role, target, 1, f1)
--加一个延时操作,防止有的英雄有死亡后再释放一次技能的被动 by:王振兴 --加一个延时操作,防止有的英雄有死亡后再释放一次技能的被动 by:王振兴
BattleLogic.WaitForTrigger(1, function()
role:InsertExtraSkill(f1,f2) role:InsertExtraSkill(f1,f2)
end)
end end
end end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit) role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit)
@ -4783,7 +4778,6 @@ local passivityList = {
local f1 = args[1] local f1 = args[1]
role.data.enemyType=f1 role.data.enemyType=f1
BattleUtil.CheckIsBoss(role) BattleUtil.CheckIsBoss(role)
LogError("111111")
end, end,
} }
return passivityList return passivityList

View File

@ -1,6 +1,19 @@
BattleLogManager = {} BattleLogManager = {}
local this = BattleLogManager local this = BattleLogManager
local isLog = false and AppConst.platform == "EDITOR" local isEditor = AppConst and AppConst.Platform == "EDITOR"
local isDebug = false
function LogBattle(str)
if isDebug then
if isEditor then
LogGreen(str)
else
print(str)
end
end
end
local isLog = true or isEditor
local function pairsByKeys(t) local function pairsByKeys(t)
local a = {} local a = {}
@ -93,6 +106,8 @@ function this.Log(...)
log = log .. string.format("%s = %s, ", key, value) log = log .. string.format("%s = %s, ", key, value)
end end
table.insert(this.logList, log) table.insert(this.logList, log)
-- 打印一下
LogBattle(log)
end end
function this.WriteFile() function this.WriteFile()
@ -108,17 +123,17 @@ function this.WriteFile()
local platform local platform
-- linux -- linux
if not file then if not file then
file = io.open("../luafight/BattleRecord/log-"..(this.userId or time)..".txt", "a") file = io.open("../luafight/BattleRecord/log-"..(this.userId or time)..".txt", "w")
platform = "Linux" platform = "Linux"
end end
-- local window server -- local window server
if not file then if not file then
file = io.open("luafight/BattleRecord/log-"..(this.userId or time)..".txt", "a") file = io.open("luafight/BattleRecord/log-"..(this.userId or time)..".txt", "w")
platform = "Local Windows Server" platform = "Local Windows Server"
end end
-- local -- local
if not file then if not file then
file = io.open("BattleRecord/log-"..(this.userId or time)..".txt", "a") file = io.open("BattleRecord/log-"..(this.userId or time)..".txt", "w")
platform = "Local" platform = "Local"
end end

View File

@ -78,10 +78,10 @@ function BattleLogic.Init(data, _userData, maxRound)
--监听英雄受到治疗 --监听英雄受到治疗
BattleLogic.Event:AddEvent(BattleEventName.RoleBeTreated,function (castRole, realTreat, treat) BattleLogic.Event:AddEvent(BattleEventName.RoleBeTreated,function (castRole, realTreat, treat)
if castRole.camp==0 then if castRole.camp==0 then
LogError("我方 英雄治疗"..treat) LogBattle("我方 英雄治疗"..treat)
allHeroDamage=allHeroDamage+treat allHeroDamage=allHeroDamage+treat
else else
LogError("敌方 英雄治疗"..treat) LogBattle("敌方 英雄治疗"..treat)
allEnemyDamage=allEnemyDamage+treat allEnemyDamage=allEnemyDamage+treat
end end
end) end)
@ -89,12 +89,12 @@ end)
BattleLogic.Event:AddEvent(BattleEventName.RoleBeDamaged,function (defRole, atkRole, damage, bCrit, finalDmg, damageType, dotType) BattleLogic.Event:AddEvent(BattleEventName.RoleBeDamaged,function (defRole, atkRole, damage, bCrit, finalDmg, damageType, dotType)
--我方阵营总攻击 --我方阵营总攻击
if atkRole.camp==0 then if atkRole.camp==0 then
allHeroDamage=allHeroDamage+damage allHeroDamage=allHeroDamage+damage
LogError("我方 英雄攻击"..damage) LogBattle("我方 英雄攻击"..damage)
--敌方阵营 --敌方阵营
else else
allEnemyDamage=allEnemyDamage+damage allEnemyDamage=allEnemyDamage+damage
LogError("敌方 英雄攻击"..damage) LogBattle("敌方 英雄攻击"..damage)
end end
end) end)
@ -180,8 +180,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
LogGreen(Language[10227]) LogBattle("-------------")
LogBlue("-------------")
BattleLogic.Event:DispatchEvent(BattleEventName.DebugStop) BattleLogic.Event:DispatchEvent(BattleEventName.DebugStop)
return return
end end
@ -191,7 +190,6 @@ function BattleLogic.TurnRound(debugTurn)
CurCamp = BattleLogic.FirstCamp -- 判断先手阵营 CurCamp = BattleLogic.FirstCamp -- 判断先手阵营
CurSkillPos[0] = 0 CurSkillPos[0] = 0
CurSkillPos[1] = 0 CurSkillPos[1] = 0
LogGreen(Language[10228]..CurRound)
-- --
BattleLogManager.Log( BattleLogManager.Log(
"Round Change", "Round Change",
@ -209,8 +207,6 @@ function BattleLogic.TurnRound(debugTurn)
return return
end end
LogGreen(Language[10229]..CurCamp)
-- --
BattleLogManager.Log( BattleLogManager.Log(
"Camp Change", "Camp Change",
@ -239,13 +235,11 @@ function BattleLogic.TurnRound(debugTurn)
end end
-- 如果找不到下一个人,直接交换阵营 -- 如果找不到下一个人,直接交换阵营
if not SkillRole then if not SkillRole then
LogGreen(Language[10230])
BattleLogManager.Log( "No Skill Position" ) BattleLogManager.Log( "No Skill Position" )
BattleLogic.TurnRoundNextFrame() BattleLogic.TurnRoundNextFrame()
return return
end end
LogGreen(Language[10231]..CurSkillPos[CurCamp])
-- --
BattleLogManager.Log( BattleLogManager.Log(
"Position Change", "Position Change",
@ -311,12 +305,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
LogError("我方总输出"..allHeroDamage.."敌方总输出:"..allEnemyDamage) LogBattle("我方总输出"..allHeroDamage.."敌方总输出:"..allEnemyDamage)
if allHeroDamage>allEnemyDamage then if allHeroDamage>allEnemyDamage then
LogError("争霸赛我方胜") LogBattle("争霸赛我方胜")
BattleLogic.BattleEnd(1) BattleLogic.BattleEnd(1)
else else
LogError("争霸赛敌方胜") LogBattle("争霸赛敌方胜")
BattleLogic.BattleEnd(0) BattleLogic.BattleEnd(0)
end end
else else

View File

@ -284,16 +284,16 @@ function BattleUtil.PreCountShield(defRole, damage)
end end
--检测是否为boss --检测是否为boss
function BattleUtil.CheckIsBoss(role) function BattleUtil.CheckIsBoss(role)
if not role then if not role then
return return
end end
if role.data.enemyType==EnemyType.Boss then if role.data.enemyType==EnemyType.Boss then
--弹免疫 --弹免疫
role.Event:DispatchEvent(BattleEventName.ShowHintText,2,Language[12391]) role.Event:DispatchEvent(BattleEventName.ShowHintText,2, 12391)
return true return true
else else
return false return false
end end
end end
-- 秒杀 -- 秒杀
@ -364,9 +364,9 @@ end
--检测是否有是金翅大鹏有不灭效果 --检测是否有是金翅大鹏有不灭效果
function BattleUtil.CheckIsNoDead(target) function BattleUtil.CheckIsNoDead(target)
if target then if target then
return target:IsAssignHeroAndHeroStar(10086,10)==false and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false return target:IsAssignHeroAndHeroStar(10086,10) or BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)
end end
return false return false
end end
--检测列表是否包含值 --检测列表是否包含值
@ -385,15 +385,15 @@ end
-- 根据id获取额外技能 -- 根据id获取额外技能
function BattleUtil.GetExtraSkillbyId(id) function BattleUtil.GetExtraSkillbyId(id)
if id==1 then if id==1 then
return ExtraReleaseSkill.skill1 return ExtraReleaseSkill.skill1
elseif id==2 then elseif id==2 then
return ExtraReleaseSkill.skill2 return ExtraReleaseSkill.skill2
elseif id==3 then elseif id==3 then
return ExtraReleaseSkill.skill3 return ExtraReleaseSkill.skill3
elseif id==4 then elseif id==4 then
return ExtraReleaseSkill.skill4 return ExtraReleaseSkill.skill4
end end
end end
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType) function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)

View File

@ -73,8 +73,6 @@ function RoleLogic:Init(uid, data, position)
BattleUtil.Passivity[id](self, args) BattleUtil.Passivity[id](self, args)
-- 加入被动列表 -- 加入被动列表
table.insert(self.passiveList, {id, args}) table.insert(self.passiveList, {id, args})
else
LogRed(Language[10232]..id..Language[10233])
end end
end end
end end
@ -162,7 +160,7 @@ end
function RoleLogic:AddRage(value, type) function RoleLogic:AddRage(value, type)
-- 角色身上有无敌盾,不扣除怒气 by:wangzhenxing 2020/08/10 14:56 -- 角色身上有无敌盾,不扣除怒气 by:wangzhenxing 2020/08/10 14:56
if (type==3 or type==4) and BattleLogic.BuffMgr:HasBuff(self, BuffName.Shield, function (buff) return buff.shieldType and buff.shieldType == ShieldTypeName.AllReduce end) then if (type==3 or type==4) and BattleLogic.BuffMgr:HasBuff(self, BuffName.Shield, function (buff) return buff.shieldType and buff.shieldType == ShieldTypeName.AllReduce end) then
LogError("角色身上有无敌盾,不扣除怒气") LogBattle("角色身上有无敌盾,不扣除怒气")
return return
end end
@ -431,18 +429,14 @@ function RoleLogic:CastSkill(func)
-- 没有沉默 -- 没有沉默
if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then if not self.ctrl_slient and self.Rage >= self.SuperSkillRage then
-- 释放大技能 -- 释放大技能
LogBlue(Language[10234])
self:AddSkill(BattleSkillType.Special, true, false, nil) self:AddSkill(BattleSkillType.Special, true, false, nil)
return return
end end
-- 没有麻痹 释放普通技能 -- 没有麻痹 释放普通技能
if not self.ctrl_palsy then if not self.ctrl_palsy then
LogBlue(Language[10235])
self:AddSkill(BattleSkillType.Normal, true, false, nil) self:AddSkill(BattleSkillType.Normal, true, false, nil)
return return
end end
--
LogBlue(Language[10236])
end end
-- 强制释放技能,测试技能时使用 -- 强制释放技能,测试技能时使用
@ -460,10 +454,8 @@ function RoleLogic:ForceCastSkill(type, targets, func)
SkillManager.SetTurnRoundFunc(func) SkillManager.SetTurnRoundFunc(func)
-- 释放技能 -- 释放技能
if type == 1 and self.skill then if type == 1 and self.skill then
LogBlue(Language[10237])
self:AddSkill(BattleSkillType.Normal, true, false, nil) self:AddSkill(BattleSkillType.Normal, true, false, nil)
elseif type == 2 and self.superSkill then elseif type == 2 and self.superSkill then
LogBlue(Language[10238])
if self.Rage < self.SuperSkillRage then if self.Rage < self.SuperSkillRage then
self.Rage = self.SuperSkillRage self.Rage = self.SuperSkillRage
end end

View File

@ -6,6 +6,7 @@ local skillPool = BattleObjectPool.New(function ()
end) end)
-- --
this.DeadSkillList = {} -- 人物死亡后技能队列,死亡技能优先级最高
this.SkillList = {} this.SkillList = {}
this.IsSkilling = false this.IsSkilling = false
-- 初始化 -- 初始化
@ -17,18 +18,31 @@ end
function this.AddSkill(caster, effectData, type, targets, isAdd, isRage) function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
local skill = skillPool:Get() local skill = skillPool:Get()
skill:Init(caster, effectData, type, targets, isAdd, isRage) skill:Init(caster, effectData, type, targets, isAdd, isRage)
table.insert(this.SkillList, skill) if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
table.insert(this.DeadSkillList, skill)
else
table.insert(this.SkillList, skill)
end
return skill return skill
end end
-- 插入技能到技能列表首位 -- 插入技能到技能列表首位
function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage) function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage)
local skill = skillPool:Get() local skill = skillPool:Get()
skill:Init(caster, effectData, type, targets, isAdd, isRage) skill:Init(caster, effectData, type, targets, isAdd, isRage)
table.insert(this.SkillList, 1, skill) if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
table.insert(this.DeadSkillList, 1, skill)
else
table.insert(this.SkillList, 1, skill)
end
return skill return skill
end end
-- 获取是否拥有我的技能未释放 -- 获取是否拥有我的技能未释放
function this.HaveMySkill(role) function this.HaveMySkill(role)
for _, skill in ipairs(this.DeadSkillList) do
if skill.owner == role then
return true
end
end
for _, skill in ipairs(this.SkillList) do for _, skill in ipairs(this.SkillList) do
if skill.owner == role then if skill.owner == role then
return true return true
@ -47,6 +61,9 @@ function this.CheckTurnRound()
if this.IsSkilling then if this.IsSkilling then
return return
end end
if this.DeadSkillList and #this.DeadSkillList > 0 then
return
end
if this.SkillList and #this.SkillList > 0 then if this.SkillList and #this.SkillList > 0 then
return return
end end
@ -69,26 +86,51 @@ function this.Update()
if this.IsSkilling then if this.IsSkilling then
return return
end end
if not this.SkillList or #this.SkillList == 0 then
-- 判断是否有死亡技能
-- 跟佳琦对的是角色死后只有死亡后释放的技能才能释放(DeadSkill) by:王振兴 2020/09/02 18:53
if this.DeadSkillList and #this.DeadSkillList > 0 then
local skill = this.DeadSkillList[1]
table.remove(this.DeadSkillList, 1)
this.IsSkilling = true
if skill.owner:IsDead() then
skill.owner:SkillCast(skill, function()
skill:Dispose()
skillPool:Put(skill)
this.IsSkilling = false
-- 检测一下轮转
this.CheckTurnRound()
end)
else
this.IsSkilling = false
this.CheckTurnRound()
end
return return
end end
local skill = this.SkillList[1]
table.remove(this.SkillList, 1) -- 判断
this.IsSkilling = true if this.SkillList and #this.SkillList > 0 then
-- 检测技能释放 只有角色不是死亡状态或角色身上有不灭 或这释放的技能为死亡后才释放的技能
--跟佳琦对的是角色死后只有死亡后释放的技能才能释放(DeadSkill) by:王振兴 2020/09/02 18:53 local skill = this.SkillList[1]
if (not skill.owner:IsDead() or not BattleUtil.CheckIsNoDead(skill.owner)) or skill.type == BattleSkillType.DeadSkill then table.remove(this.SkillList, 1)
skill.owner:SkillCast(skill, function() this.IsSkilling = true
skill:Dispose() -- 检测技能释放 只有角色不是死亡状态或角色身上有不灭
skillPool:Put(skill) if (not skill.owner:IsDead() or BattleUtil.CheckIsNoDead(skill.owner)) then
skill.owner:SkillCast(skill, function()
skill:Dispose()
skillPool:Put(skill)
this.IsSkilling = false
-- 检测一下轮转
this.CheckTurnRound()
end)
else
this.IsSkilling = false this.IsSkilling = false
-- 检测一下轮转
this.CheckTurnRound() this.CheckTurnRound()
end) end
else
this.IsSkilling = false return
this.CheckTurnRound()
end end
end end

View File

@ -354,8 +354,8 @@ local TextFloatingColor = {
Green = 4, Green = 4,
} }
--单纯显示提示文字 --单纯显示提示文字
function RoleView:OnShowHintText(type,text) function RoleView:OnShowHintText(type,LanguageIndex)
self:TextBuffFloating(type,text) self:TextBuffFloating(type,Language[LanguageIndex])
end end