切大波次

This commit is contained in:
xiekaidong 2023-04-18 19:52:15 +08:00
parent 74a20b6bbe
commit 0de7ceb3b3
8 changed files with 18 additions and 381 deletions

View File

@ -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

View File

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 816191ff02ba0434098383a2d0d5fd4c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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