From d9bf3ee52b23364349e35be35abfa8cccbcd2daf Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 11 May 2023 11:22:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=B1=E5=93=8D=E6=A3=8B?= =?UTF-8?q?=E7=9B=98=E7=9A=84=E6=8A=80=E8=83=BD=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/component/battle_unit_comp.lua | 5 +-- .../battle/controller/battle_controller.lua | 2 +- .../skill/battle_board_skill_handle.lua | 31 ++++++++++++++++--- .../skill/battle_board_skill_entity.lua | 4 +++ .../battle/skill/battle_skill_entity.lua | 8 +++-- 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 360d5a1a..069a25eb 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1,6 +1,7 @@ local BattleConst = require "app/module/battle/battle_const" local BattleHelper = require "app/module/battle/helper/battle_helper" local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle" +local BATTLE_BOARD_SKILL_HANDLE = require "app/module/battle/skill/battle_board_skill_handle" local BattlePassive = require "app/module/battle/helper/battle_passive" local BattleUnitComp = class("BattleUnitComp", LuaComponent) @@ -1118,8 +1119,8 @@ end function BattleUnitComp:onSkillTakeEffect(skill) skill:endUse() - if skill:getIsEliminateType() then - self.battleController:generateGridType(skill:getEliminateSkillParameter(), self.baseObject:getTransform().position) + if skill:isAttackOverActive() then + BATTLE_BOARD_SKILL_HANDLE.activeAttackOverSkill(self, skill, self.battleController) end local effectList = skill:getEffectList() if effectList == nil then diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 89bba5a9..1882ec08 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -1582,7 +1582,7 @@ function BattleController:findSkillInfluenceGrids() if skillId then local skillEntity = self.battleData:getSkillEntityBySkillId(skillId) if skillEntity then - BATTLE_BOARD_SKILL_HANDLE.activeBoardSkill(info.posId, skillEntity, self.battleData:getGridEnties(), sequenceEntities) + BATTLE_BOARD_SKILL_HANDLE.activeBoardSkill(info.posId, skillEntity, self.battleData:getGridEnties(), sequenceEntities, self) end end end diff --git a/lua/app/module/battle/skill/battle_board_skill_handle.lua b/lua/app/module/battle/skill/battle_board_skill_handle.lua index 429b586e..24d59942 100644 --- a/lua/app/module/battle/skill/battle_board_skill_handle.lua +++ b/lua/app/module/battle/skill/battle_board_skill_handle.lua @@ -5,7 +5,7 @@ local BattleBoardSkillHandle = {} local SKILL_TYPE = BattleConst.SKILL_TYPE local SKILL_METHOD_TYPE = BattleConst.SKILL_METHOD_TYPE -local function _takeElimination(posId, skillEntity, gridEntities, sequenceEntities) +local function _takeElimination(posId, skillEntity, gridEntities, sequenceEntities, battleController) local boardrange = skillEntity:getBoardRange() if boardrange then local cludePosIdsMap = {} @@ -27,7 +27,7 @@ local function _takeElimination(posId, skillEntity, gridEntities, sequenceEntiti end end -local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntities) +local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntities, battleController) local boardrange = skillEntity:getBoardRange() if boardrange then local cludePosIdsMap = {} @@ -46,7 +46,13 @@ local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntit end end -local function _takeEliminationGridAndElement(posId, skillEntity, gridEntities, sequenceEntities) +local function _taleReleaseGridType(atkUnitComp, skillEntity, battleController) + if skillEntity:getEliminateSkillParameter() then + battleController:generateGridType(skillEntity:getEliminateSkillParameter(), atkUnitComp:getBaseObject():getTransform().position) + end +end + +local function _takeEliminationGridAndElement(posId, skillEntity, gridEntities, sequenceEntities, battleController) local boardrange = skillEntity:getBoardRange() if boardrange then local cludePosIdsMap = {} @@ -74,14 +80,29 @@ BattleBoardSkillHandle._activeBoardSkill = { [SKILL_TYPE.ELIMINATION_GRID_AND_ELEMENT] = _takeEliminationGridAndElement, } -function BattleBoardSkillHandle.activeBoardSkill(posId, skillEntity, gridEntities, sequenceEntities) +BattleBoardSkillHandle._activeAttackOverSkill = { + [SKILL_TYPE.RELEASE_GRID_TYPE] = _taleReleaseGridType, +} + +function BattleBoardSkillHandle.activeBoardSkill(posId, skillEntity, gridEntities, sequenceEntities, battleController) if not skillEntity then return end local func = BattleBoardSkillHandle._activeBoardSkill[skillEntity:getSkillType()] if func then - func(posId, skillEntity, gridEntities, sequenceEntities) + func(posId, skillEntity, gridEntities, sequenceEntities, battleController) + end +end + +function BattleBoardSkillHandle.activeAttackOverSkill(atkUnitComp, skillEntity, battleController) + if not skillEntity then + return + end + + local func = BattleBoardSkillHandle._activeAttackOverSkill[skillEntity:getEliminateSkillType()] + if func then + func(atkUnitComp, skillEntity, battleController) end end diff --git a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua index 915e858f..fb828706 100644 --- a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua @@ -74,6 +74,10 @@ function BattleBoardSkillEntity:getSkillType() return self.config.skill_type end +function BattleBoardSkillEntity:isAttackOverActive() + return GConst.BattleConst.ATTACK_OVER_ACTIVE_SKILL_TYPE[self:getSkillType()] +end + function BattleBoardSkillEntity:getSkillTypeParameter() if not self.config then return diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index c305830c..05aa89cc 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -130,8 +130,12 @@ function BattleSkillEntity:getIsActiveType() end -- 消除类技能 -function BattleSkillEntity:getIsEliminateType() - return self.skillInfo.skill_type == 3 +function BattleSkillEntity:getEliminateSkillType() + return self.skillInfo.skill_type +end + +function BattleSkillEntity:isAttackOverActive() + return GConst.BattleConst.ATTACK_OVER_ACTIVE_SKILL_TYPE[self:getEliminateSkillType()] end -- 消除类技能参数