From 43f978e9b4ac8e4e29ae6783e1d892137329ee0d Mon Sep 17 00:00:00 2001 From: lvxinran Date: Tue, 16 Jul 2019 10:59:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/Base/Effect.lua | 2 +- luafight/Modules/Battle/Logic/BattleLogic.lua | 31 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index e39ceb091..0ba1d0fc5 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -19,7 +19,7 @@ local propertyList = { RoleDataName.CritDamageFactor, RoleDataName.TreatFacter, RoleDataName.MaxHp, - RoleDataName.MaxHp, + RoleDataName.Hp, RoleDataName.CureFacter, RoleDataName.Tenacity, } diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index 1603c3697..61e726815 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -48,6 +48,11 @@ BattleLogic.TotalOrder = 0 BattleLogic.CurOrder = 0 local maxFrame --战斗最大用时,超时判负 + +local teamSkillCD = 40 * BattleLogic.GameFrameRate --异妖cd +local lastPlayerTeamSkillFrame +local lastEnemyTeamSkillFrame + local actionPool = BattleObjectPool.New(function () return { 0, 0 } end) @@ -92,6 +97,9 @@ function BattleLogic.Init(maxTime, data, optionData) playerSkillUsable = true enemySkillUsable = true + lastPlayerTeamSkillFrame = 0 + lastEnemyTeamSkillFrame = 0 + isAuto = true BattleLogic.Event:ClearEvent() @@ -164,8 +172,8 @@ function BattleLogic.GetMP(camp) return camp == 0 and playerMP or enemyMP end -function BattleLogic.GetAuto() - return isAuto +function BattleLogic.CanManualTeamSkill() + return not isAuto and playerMP == 100 and (lastPlayerTeamSkillFrame == 0 or curFrame - lastPlayerTeamSkillFrame >= teamSkillCD) end function BattleLogic.GenerateBuffId() @@ -307,16 +315,7 @@ function BattleLogic.ExecuteOption(option) playerTeamSkillIndex = 1 end playerMP = 0 - end - elseif opType == 4 then --释放teamSkill - local teamSkill = playerTeamSkillList[playerTeamSkillIndex] - if teamSkill then - teamSkill:Cast() - playerTeamSkillIndex = playerTeamSkillIndex + 1 - if playerTeamSkillIndex > #playerTeamSkillList then - playerTeamSkillIndex = 1 - end - playerMP = 0 + lastPlayerTeamSkillFrame = curFrame end elseif opType == 5 then --设置teamSkill自动手动 isAuto = opArg == 1 @@ -417,7 +416,8 @@ function BattleLogic.Update() end end - if playerMP == 100 and playerSkillUsable and isAuto then + if playerMP == 100 and playerSkillUsable and isAuto and + (lastPlayerTeamSkillFrame == 0 or curFrame - lastPlayerTeamSkillFrame >= teamSkillCD) then local teamSkill = playerTeamSkillList[playerTeamSkillIndex] if teamSkill then teamSkill:Cast() @@ -426,9 +426,11 @@ function BattleLogic.Update() playerTeamSkillIndex = 1 end playerMP = 0 + lastPlayerTeamSkillFrame = curFrame end end - if enemyMP == 100 and enemySkillUsable then + if enemyMP == 100 and enemySkillUsable and + (lastEnemyTeamSkillFrame == 0 or curFrame - lastEnemyTeamSkillFrame >= teamSkillCD) then local teamSkill = enemyTeamSkillList[enemyTeamSkillIndex] if teamSkill then teamSkill:Cast() @@ -437,6 +439,7 @@ function BattleLogic.Update() enemyTeamSkillIndex = 1 end enemyMP = 0 + lastEnemyTeamSkillFrame = curFrame end end