From 0de7ceb3b38399cd84215fd3e13b49492ff48fe9 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 18 Apr 2023 19:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E5=A4=A7=E6=B3=A2=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/skill_hero.lua | 362 ------------------ lua/app/config/skill_hero.lua.meta | 10 - lua/app/module/battle/battle_manager.lua | 2 +- .../battle/controller/battle_controller.lua | 10 +- lua/app/ui/battle/cell/grid_cell.lua | 2 +- lua/app/userdata/battle/battle_data.lua | 7 +- .../userdata/battle/battle_grid_entity.lua | 2 +- .../battle/team/battle_unit_entity.lua | 4 + 8 files changed, 18 insertions(+), 381 deletions(-) delete mode 100644 lua/app/config/skill_hero.lua delete mode 100644 lua/app/config/skill_hero.lua.meta diff --git a/lua/app/config/skill_hero.lua b/lua/app/config/skill_hero.lua deleted file mode 100644 index 9b95c3b2..00000000 --- a/lua/app/config/skill_hero.lua +++ /dev/null @@ -1,362 +0,0 @@ -local skill_hero = { - [1]={ - ["method"]=2, - ["skill_type"]=0, - ["effect"]={ - { - ["type"]="hurt_red", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [2]={ - ["effect"]={ - { - ["type"]="hurt_yellow", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [3]={ - ["effect"]={ - { - ["type"]="hurt_green", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [4]={ - ["effect"]={ - { - ["type"]="hurt_blue", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [5]={ - ["effect"]={ - { - ["type"]="hurt_purple", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [10]={ - ["energy"]=10, - ["position"]=3, - ["method"]=2, - ["skill_type"]=1, - ["boardrange"]={ - { - ["type"]=1, - ["range"]=1 - }, - { - ["type"]=2, - ["range"]=1 - } - }, - ["icon"]=10, - ["battle_icon"]=1 - }, - [20]={ - ["energy"]=10, - ["position"]=2, - ["method"]=2, - ["skill_type"]=0, - ["icon"]=20, - ["battle_icon"]=2, - ["effect"]={ - { - ["type"]="hurt", - ["num"]=20000, - ["ratio"]=10000, - ["round"]=0 - } - }, - ["obj"]=2 - }, - [21]={ - ["energy"]=10, - ["position"]=2, - ["method"]=1, - ["skill_type"]=2, - ["skill_type_parameter"]=2, - ["boardrange"]={ - { - ["type"]=1, - ["range"]=1 - }, - { - ["type"]=2, - ["range"]=1 - }, - { - ["type"]=3, - ["range"]=1 - }, - { - ["type"]=4, - ["range"]=1 - } - }, - ["icon"]=20, - ["battle_icon"]=2, - ["effect"]={ - { - ["type"]="hurt", - ["num"]=20000, - ["ratio"]=10000, - ["round"]=0 - } - } - }, - [30]={ - ["energy"]=10, - ["position"]=4, - ["method"]=2, - ["skill_type"]=1, - ["boardrange"]={ - { - ["type"]=0, - ["range"]=2 - } - }, - ["icon"]=30, - ["battle_icon"]=3 - }, - [40]={ - ["energy"]=10, - ["position"]=5, - ["method"]=2, - ["skill_type"]=0, - ["icon"]=40, - ["battle_icon"]=4, - ["effect"]={ - { - ["type"]="shield", - ["num"]=1000, - ["ratio"]=10000, - ["round"]=1 - } - }, - ["obj"]=1 - }, - [50]={ - ["energy"]=10, - ["position"]=1, - ["method"]=2, - ["skill_type"]=1, - ["boardrange"]={ - { - ["type"]=3, - ["range"]=2 - }, - { - ["type"]=4, - ["range"]=2 - } - }, - ["icon"]=50, - ["battle_icon"]=5 - }, - [60]={ - ["energy"]=10, - ["position"]=3, - ["method"]=2, - ["skill_type"]=0, - ["icon"]=60, - ["battle_icon"]=6, - ["effect"]={ - { - ["type"]="heal", - ["num"]=2000, - ["ratio"]=10000, - ["round"]=1 - } - }, - ["obj"]=1 - }, - [70]={ - ["energy"]=10, - ["position"]=2, - ["method"]=2, - ["skill_type"]=0, - ["icon"]=70, - ["battle_icon"]=7, - ["effect"]={ - { - ["type"]="atkp_add_connect", - ["num"]=5000, - ["ratio"]=10000, - ["round"]=1 - } - }, - ["obj"]=1 - }, - [71]={ - ["energy"]=10, - ["position"]=2, - ["method"]=1, - ["skill_type"]=2, - ["skill_type_parameter"]=2, - ["boardrange"]={ - { - ["type"]=1, - ["range"]=1 - }, - { - ["type"]=2, - ["range"]=1 - }, - { - ["type"]=3, - ["range"]=1 - }, - { - ["type"]=4, - ["range"]=1 - } - }, - ["icon"]=70, - ["battle_icon"]=7, - ["effect"]={ - { - ["type"]="atkp_add_connect", - ["num"]=5000, - ["ratio"]=10000, - ["round"]=1 - } - }, - ["obj"]=1 - }, - [72]={ - ["energy"]=10, - ["position"]=2, - ["method"]=1, - ["skill_type"]=2, - ["skill_type_parameter"]=2, - ["boardrange"]={ - { - ["type"]=1, - ["range"]=1 - }, - { - ["type"]=2, - ["range"]=1 - }, - { - ["type"]=3, - ["range"]=1 - }, - { - ["type"]=4, - ["range"]=1 - }, - { - ["type"]=5, - ["range"]=1 - }, - { - ["type"]=6, - ["range"]=1 - }, - { - ["type"]=7, - ["range"]=1 - }, - { - ["type"]=8, - ["range"]=1 - } - }, - ["icon"]=70, - ["battle_icon"]=7 - }, - [80]={ - ["energy"]=10, - ["position"]=4, - ["method"]=2, - ["skill_type"]=0, - ["icon"]=80, - ["battle_icon"]=8, - ["effect"]={ - { - ["type"]="hurt", - ["num"]=15000, - ["ratio"]=10000, - ["round"]=0 - }, - { - ["type"]="spd_dec", - ["num"]=1, - ["ratio"]=10000, - ["round"]=1 - } - } - }, - [81]={ - ["energy"]=10, - ["position"]=4, - ["method"]=2, - ["skill_type"]=1, - ["boardrange"]={ - { - ["type"]=1, - ["range"]=1 - }, - { - ["type"]=2, - ["range"]=1 - }, - { - ["type"]=3, - ["range"]=1 - }, - { - ["type"]=4, - ["range"]=1 - } - }, - ["icon"]=80, - ["battle_icon"]=8, - ["effect"]={ - { - ["type"]="hurt", - ["num"]=15000, - ["ratio"]=10000, - ["round"]=0 - }, - { - ["type"]="spd_dec", - ["num"]=1, - ["ratio"]=10000, - ["round"]=1 - } - } - }, - [100001]={ - ["effect"]={ - { - ["type"]="hurt", - ["num"]=10000, - ["ratio"]=10000, - ["round"]=0 - } - } - } -} -local config = { -data=skill_hero,count=18 -} -return config \ No newline at end of file diff --git a/lua/app/config/skill_hero.lua.meta b/lua/app/config/skill_hero.lua.meta deleted file mode 100644 index 5accc24e..00000000 --- a/lua/app/config/skill_hero.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 816191ff02ba0434098383a2d0d5fd4c -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua index 03f0507f..1a2a4ef8 100644 --- a/lua/app/module/battle/battle_manager.lua +++ b/lua/app/module/battle/battle_manager.lua @@ -2,7 +2,7 @@ local BattleManager = class("BattleManager", BaseModule) local BattleConst = GConst.BattleConst -BattleManager.SKILL_HERO_CFG = ConfigManager:getConfig("skill") +BattleManager.SKILL_CFG = ConfigManager:getConfig("skill") local BATTLE_CONTROLLER_BASE = "app/module/battle/controller/battle_controller" diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 3a199fff..1347f0c0 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -258,6 +258,7 @@ function BattleController:enterNextWave() self.battleUI:refreshWave(self.waveIndex) end if self.waveIndex == 1 then -- 第一波 + self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() self:generateBoard() return end @@ -269,6 +270,7 @@ function BattleController:enterNextWave() else self:enterRoundBegin() end + self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() end function BattleController:enterRoundBegin() @@ -848,15 +850,17 @@ end function BattleController:generateSkill(callback) local map = {} + local excludeMap = {} for _, skillEntity in pairs(self.battleData:getSkillEntities()) do if skillEntity:getEnergyEnough() then - local list = self:getSkillElementList(skillEntity:getPosition(), 1, true) + local list = self:getSkillElementList(skillEntity:getPosition(), 1, true, excludeMap) if list[1] then map[skillEntity:getPosition()] = { skillId = skillEntity:getSkillId(), posId = list[1] } + excludeMap[list[1]] = true end end end @@ -909,7 +913,7 @@ function BattleController:generateGridType(gridType) end end -function BattleController:getSkillElementList(elementType, count, useAlternate) +function BattleController:getSkillElementList(elementType, count, useAlternate, excludeMap) local result = {} local gridEntities = self.battleData:getGridEnties() if not gridEntities then @@ -924,7 +928,7 @@ function BattleController:getSkillElementList(elementType, count, useAlternate) for column = 1, BattleConst.COLUMN_COUNT do local posId = ModuleManager.BattleManager:getPosId(row, column) local entity = gridEntities[posId] - if entity and entity:canChangeInfo() then + if entity and entity:canChangeInfo() and not excludeMap[posId] then if entity:getElementType() == elementType then table.insert(sameElementList, posId) else diff --git a/lua/app/ui/battle/cell/grid_cell.lua b/lua/app/ui/battle/cell/grid_cell.lua index 73b5d9b2..7d21073f 100644 --- a/lua/app/ui/battle/cell/grid_cell.lua +++ b/lua/app/ui/battle/cell/grid_cell.lua @@ -36,7 +36,7 @@ function GridCell:refresh(gridEntity, curElement) if self.lastSkillId ~= skillId then self.lastSkillId = skillId - local cfg = ModuleManager.BattleManager.SKILL_HERO_CFG[skillId] + local cfg = ModuleManager.BattleManager.SKILL_CFG[skillId] if cfg then skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, tostring(cfg.battle_icon)) end diff --git a/lua/app/userdata/battle/battle_data.lua b/lua/app/userdata/battle/battle_data.lua index 221b8f34..ea413fb1 100644 --- a/lua/app/userdata/battle/battle_data.lua +++ b/lua/app/userdata/battle/battle_data.lua @@ -2,7 +2,7 @@ local BattleTeamEntity = require "app/userdata/battle/team/battle_team_entity" local BattleData = class("BattleData", BaseData) -local SKILL_HERO_CFG = ConfigManager:getConfig("skill") +local SKILL_CFG = ConfigManager:getConfig("skill") local BattleConst = GConst.BattleConst local BATTLE_GRID_ENTITY = require "app/userdata/battle/battle_grid_entity" local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_board_skill_entity" @@ -32,7 +32,7 @@ function BattleData:initRogueSkills() local heroEntity = DataManager.HeroData:getHeroById(heroId) if heroEntity then local skillId = heroEntity:getActiveSkill() - local cfg = SKILL_HERO_CFG[skillId] + local cfg = SKILL_CFG[skillId] self.skillMap[cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId) for _, id in ipairs(heroEntity:getActiveTogueSkills()) do if not skillmap[id] then @@ -232,7 +232,7 @@ function BattleData:getSkillEntityBySkillId(skillId) if not self.skillMap or not skillId then return end - local cfg = SKILL_HERO_CFG[skillId] + local cfg = SKILL_CFG[skillId] if not cfg then return end @@ -412,6 +412,7 @@ function BattleData:addMonster(monsterId, newTeam) activeSkills = monsterInfo.skill, normalSkillCount = monsterInfo.hurt_num, assistingSkill = nil, + isBoss = monsterInfo.is_boss, attr = { hp = hp, max_hp = hp, diff --git a/lua/app/userdata/battle/battle_grid_entity.lua b/lua/app/userdata/battle/battle_grid_entity.lua index 0cf95b1e..e406628f 100644 --- a/lua/app/userdata/battle/battle_grid_entity.lua +++ b/lua/app/userdata/battle/battle_grid_entity.lua @@ -205,7 +205,7 @@ function BattleGridEntity:getNeedChangePos() return false end - local cfg = ModuleManager.BattleManager.SKILL_HERO_CFG[self:getSkillId()] + local cfg = ModuleManager.BattleManager.SKILL_CFG[self:getSkillId()] if cfg and cfg.method == BattleConst.SKILL_METHOD_TYPE.ON_FINAL then return true end diff --git a/lua/app/userdata/battle/team/battle_unit_entity.lua b/lua/app/userdata/battle/team/battle_unit_entity.lua index 2c9ef5b7..8da76cee 100644 --- a/lua/app/userdata/battle/team/battle_unit_entity.lua +++ b/lua/app/userdata/battle/team/battle_unit_entity.lua @@ -28,6 +28,10 @@ function BattleUnitEntity:initSkill() end end +function BattleUnitEntity:getIsBoss() + return self.unitData.isBoss +end + function BattleUnitEntity:addAttr(name, num, isPercent) return self.team:addAttr(name, num, isPercent) end