Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-18 20:09:53 +08:00
commit 6ad53ac174
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 BattleManager = class("BattleManager", BaseModule)
local BattleConst = GConst.BattleConst 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" local BATTLE_CONTROLLER_BASE = "app/module/battle/controller/battle_controller"

View File

@ -262,6 +262,7 @@ function BattleController:enterNextWave()
self.battleUI:refreshWave(self.waveIndex) self.battleUI:refreshWave(self.waveIndex)
end end
if self.waveIndex == 1 then -- 第一波 if self.waveIndex == 1 then -- 第一波
self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss()
self:generateBoard() self:generateBoard()
return return
end end
@ -274,6 +275,7 @@ function BattleController:enterNextWave()
else else
self:enterRoundBegin() self:enterRoundBegin()
end end
self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss()
end end
function BattleController:enterRoundBegin() function BattleController:enterRoundBegin()
@ -853,15 +855,17 @@ end
function BattleController:generateSkill(callback) function BattleController:generateSkill(callback)
local map = {} local map = {}
local excludeMap = {}
for _, skillEntity in pairs(self.battleData:getSkillEntities()) do for _, skillEntity in pairs(self.battleData:getSkillEntities()) do
if skillEntity:getEnergyEnough() then 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 if list[1] then
map[skillEntity:getPosition()] = map[skillEntity:getPosition()] =
{ {
skillId = skillEntity:getSkillId(), skillId = skillEntity:getSkillId(),
posId = list[1] posId = list[1]
} }
excludeMap[list[1]] = true
end end
end end
end end
@ -914,7 +918,7 @@ function BattleController:generateGridType(gridType)
end end
end end
function BattleController:getSkillElementList(elementType, count, useAlternate) function BattleController:getSkillElementList(elementType, count, useAlternate, excludeMap)
local result = {} local result = {}
local gridEntities = self.battleData:getGridEnties() local gridEntities = self.battleData:getGridEnties()
if not gridEntities then if not gridEntities then
@ -929,7 +933,7 @@ function BattleController:getSkillElementList(elementType, count, useAlternate)
for column = 1, BattleConst.COLUMN_COUNT do for column = 1, BattleConst.COLUMN_COUNT do
local posId = ModuleManager.BattleManager:getPosId(row, column) local posId = ModuleManager.BattleManager:getPosId(row, column)
local entity = gridEntities[posId] 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 if entity:getElementType() == elementType then
table.insert(sameElementList, posId) table.insert(sameElementList, posId)
else else

View File

@ -36,7 +36,7 @@ function GridCell:refresh(gridEntity, curElement)
if self.lastSkillId ~= skillId then if self.lastSkillId ~= skillId then
self.lastSkillId = skillId self.lastSkillId = skillId
local cfg = ModuleManager.BattleManager.SKILL_HERO_CFG[skillId] local cfg = ModuleManager.BattleManager.SKILL_CFG[skillId]
if cfg then if cfg then
skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, tostring(cfg.battle_icon)) skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, tostring(cfg.battle_icon))
end end

View File

@ -3,7 +3,7 @@ local BattleSkillEntity = require "app/userdata/battle/skill/battle_skill_entity
local BattleData = class("BattleData", BaseData) local BattleData = class("BattleData", BaseData)
local SKILL_HERO_CFG = ConfigManager:getConfig("skill") local SKILL_CFG = ConfigManager:getConfig("skill")
local BattleConst = GConst.BattleConst local BattleConst = GConst.BattleConst
local BATTLE_GRID_ENTITY = require "app/userdata/battle/battle_grid_entity" 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" local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_board_skill_entity"
@ -34,7 +34,7 @@ function BattleData:initRogueSkills()
local heroEntity = DataManager.HeroData:getHeroById(heroId) local heroEntity = DataManager.HeroData:getHeroById(heroId)
if heroEntity then if heroEntity then
local skillId = heroEntity:getActiveSkill() 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) self.skillMap[cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId)
for _, id in ipairs(heroEntity:getActiveTogueSkills()) do for _, id in ipairs(heroEntity:getActiveTogueSkills()) do
if not skillmap[id] then if not skillmap[id] then
@ -234,7 +234,7 @@ function BattleData:getSkillEntityBySkillId(skillId)
if not self.skillMap or not skillId then if not self.skillMap or not skillId then
return return
end end
local cfg = SKILL_HERO_CFG[skillId] local cfg = SKILL_CFG[skillId]
if not cfg then if not cfg then
return return
end end
@ -414,6 +414,7 @@ function BattleData:addMonster(monsterId, newTeam)
activeSkills = monsterInfo.skill, activeSkills = monsterInfo.skill,
normalSkillCount = monsterInfo.hurt_num, normalSkillCount = monsterInfo.hurt_num,
assistingSkill = nil, assistingSkill = nil,
isBoss = monsterInfo.is_boss,
attr = { attr = {
hp = hp, hp = hp,
max_hp = hp, max_hp = hp,

View File

@ -205,7 +205,7 @@ function BattleGridEntity:getNeedChangePos()
return false return false
end 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 if cfg and cfg.method == BattleConst.SKILL_METHOD_TYPE.ON_FINAL then
return true return true
end end

View File

@ -28,6 +28,10 @@ function BattleUnitEntity:initSkill()
end end
end end
function BattleUnitEntity:getIsBoss()
return self.unitData.isBoss
end
function BattleUnitEntity:addSkill(skillId) function BattleUnitEntity:addSkill(skillId)
local skillInfo = ConfigManager:getConfig("skill")[skillId] local skillInfo = ConfigManager:getConfig("skill")[skillId]
if skillInfo == nil then if skillInfo == nil then