修改影响棋盘的技能的逻辑
This commit is contained in:
parent
f89e3f1256
commit
d9bf3ee52b
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
-- 消除类技能参数
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user