修改影响棋盘的技能的逻辑

This commit is contained in:
xiekaidong 2023-05-11 11:22:46 +08:00
parent f89e3f1256
commit d9bf3ee52b
5 changed files with 40 additions and 10 deletions

View File

@ -1,6 +1,7 @@
local BattleConst = require "app/module/battle/battle_const" local BattleConst = require "app/module/battle/battle_const"
local BattleHelper = require "app/module/battle/helper/battle_helper" local BattleHelper = require "app/module/battle/helper/battle_helper"
local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle" 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 BattlePassive = require "app/module/battle/helper/battle_passive"
local BattleUnitComp = class("BattleUnitComp", LuaComponent) local BattleUnitComp = class("BattleUnitComp", LuaComponent)
@ -1118,8 +1119,8 @@ end
function BattleUnitComp:onSkillTakeEffect(skill) function BattleUnitComp:onSkillTakeEffect(skill)
skill:endUse() skill:endUse()
if skill:getIsEliminateType() then if skill:isAttackOverActive() then
self.battleController:generateGridType(skill:getEliminateSkillParameter(), self.baseObject:getTransform().position) BATTLE_BOARD_SKILL_HANDLE.activeAttackOverSkill(self, skill, self.battleController)
end end
local effectList = skill:getEffectList() local effectList = skill:getEffectList()
if effectList == nil then if effectList == nil then

View File

@ -1582,7 +1582,7 @@ function BattleController:findSkillInfluenceGrids()
if skillId then if skillId then
local skillEntity = self.battleData:getSkillEntityBySkillId(skillId) local skillEntity = self.battleData:getSkillEntityBySkillId(skillId)
if skillEntity then 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 end
end end

View File

@ -5,7 +5,7 @@ local BattleBoardSkillHandle = {}
local SKILL_TYPE = BattleConst.SKILL_TYPE local SKILL_TYPE = BattleConst.SKILL_TYPE
local SKILL_METHOD_TYPE = BattleConst.SKILL_METHOD_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() local boardrange = skillEntity:getBoardRange()
if boardrange then if boardrange then
local cludePosIdsMap = {} local cludePosIdsMap = {}
@ -27,7 +27,7 @@ local function _takeElimination(posId, skillEntity, gridEntities, sequenceEntiti
end end
end end
local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntities) local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntities, battleController)
local boardrange = skillEntity:getBoardRange() local boardrange = skillEntity:getBoardRange()
if boardrange then if boardrange then
local cludePosIdsMap = {} local cludePosIdsMap = {}
@ -46,7 +46,13 @@ local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntit
end end
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() local boardrange = skillEntity:getBoardRange()
if boardrange then if boardrange then
local cludePosIdsMap = {} local cludePosIdsMap = {}
@ -74,14 +80,29 @@ BattleBoardSkillHandle._activeBoardSkill = {
[SKILL_TYPE.ELIMINATION_GRID_AND_ELEMENT] = _takeEliminationGridAndElement, [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 if not skillEntity then
return return
end end
local func = BattleBoardSkillHandle._activeBoardSkill[skillEntity:getSkillType()] local func = BattleBoardSkillHandle._activeBoardSkill[skillEntity:getSkillType()]
if func then 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
end end

View File

@ -74,6 +74,10 @@ function BattleBoardSkillEntity:getSkillType()
return self.config.skill_type return self.config.skill_type
end end
function BattleBoardSkillEntity:isAttackOverActive()
return GConst.BattleConst.ATTACK_OVER_ACTIVE_SKILL_TYPE[self:getSkillType()]
end
function BattleBoardSkillEntity:getSkillTypeParameter() function BattleBoardSkillEntity:getSkillTypeParameter()
if not self.config then if not self.config then
return return

View File

@ -130,8 +130,12 @@ function BattleSkillEntity:getIsActiveType()
end end
-- 消除类技能 -- 消除类技能
function BattleSkillEntity:getIsEliminateType() function BattleSkillEntity:getEliminateSkillType()
return self.skillInfo.skill_type == 3 return self.skillInfo.skill_type
end
function BattleSkillEntity:isAttackOverActive()
return GConst.BattleConst.ATTACK_OVER_ACTIVE_SKILL_TYPE[self:getEliminateSkillType()]
end end
-- 消除类技能参数 -- 消除类技能参数