This commit is contained in:
xiekaidong 2023-05-16 20:39:21 +08:00
parent e23a631a7d
commit 91cd324e44
8 changed files with 524 additions and 241 deletions

View File

@ -155,12 +155,40 @@ local grid_type = {
}, },
["break_count"]=1, ["break_count"]=1,
["break_stay_element"]=1, ["break_stay_element"]=1,
["can_fall"]=1,
["cant_link"]=1, ["cant_link"]=1,
["element_invalid"]=1,
["effect"]=2, ["effect"]=2,
["effect_trigger"]=1 ["effect_trigger"]=1
},
[14]={
["icon"]="jelly",
["next_type"]=0,
["break_condition"]={
1,
3
},
["break_count"]=1,
["cant_link"]=1,
["element_invalid"]=1,
["effect"]=3,
["effect_trigger"]=2
},
[15]={
["icon"]="jelly",
["next_type"]=0,
["break_condition"]={
1,
3
},
["break_count"]=3,
["cant_link"]=1,
["element_invalid"]=1,
["effect"]=4,
["effect_trigger"]=2
} }
} }
local config = { local config = {
data=grid_type,count=14 data=grid_type,count=16
} }
return config return config

View File

@ -3,17 +3,16 @@ local hero = {
["position"]=1, ["position"]=1,
["qlt"]=2, ["qlt"]=2,
["hurt_skill"]={ ["hurt_skill"]={
1200110,
1200111, 1200111,
1200112, 1200112,
1200113, 1200113
1200114
}, },
["base_skill"]=1200120, ["base_skill"]=1200120,
["support_skill"]=1200110, ["rouge_skill"]=1200101,
["rouge_skill"]=200500, ["rouge_skill_1"]=1200102,
["rouge_skill_1"]=200501, ["rouge_skill_2"]=1200103,
["rouge_skill_2"]=200502, ["rouge_skill_3"]=1200104,
["rouge_skill_3"]=200503,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
2000000, 2000000,
@ -52,23 +51,184 @@ local hero = {
["model_id"]="p0005", ["model_id"]="p0005",
["icon"]="5", ["icon"]="5",
["item_id"]=12001, ["item_id"]=12001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
},
[13001]={
["position"]=1,
["qlt"]=3,
["hurt_skill"]={
1300110,
1300111,
1300112,
1300113
},
["base_skill"]=1300120,
["rouge_skill"]=1200101,
["rouge_skill_1"]=1200102,
["rouge_skill_2"]=1200103,
["rouge_skill_3"]=1200104,
["begin_lv"]=3,
["hp"]={
2000000,
2400000,
2800000,
3220000,
3660000,
4120000,
4620000,
5160000,
5760000,
6420000,
7140000,
7940000,
8840000,
9840000,
10980000
},
["atk"]={
1000000,
1200000,
1400000,
1610000,
1830000,
2060000,
2310000,
2580000,
2880000,
3210000,
3570000,
3970000,
4420000,
4920000,
5490000
},
["model_id"]="p0014",
["icon"]="5",
["item_id"]=13001,
["unlock_chapter"]=1
},
[13002]={
["position"]=1,
["qlt"]=3,
["hurt_skill"]={
1300210,
1300211,
1300212,
1300213
},
["base_skill"]=1300220,
["rouge_skill"]=1200101,
["rouge_skill_1"]=1200102,
["rouge_skill_2"]=1200103,
["rouge_skill_3"]=1200104,
["begin_lv"]=3,
["hp"]={
2000000,
2400000,
2800000,
3220000,
3660000,
4120000,
4620000,
5160000,
5760000,
6420000,
7140000,
7940000,
8840000,
9840000,
10980000
},
["atk"]={
1000000,
1200000,
1400000,
1610000,
1830000,
2060000,
2310000,
2580000,
2880000,
3210000,
3570000,
3970000,
4420000,
4920000,
5490000
},
["model_id"]="p0009",
["icon"]="5",
["item_id"]=13002,
["unlock_chapter"]=1
},
[24001]={
["position"]=1,
["qlt"]=4,
["hurt_skill"]={
2400110,
2400111,
2400112,
2400113
},
["base_skill"]=2400120,
["rouge_skill"]=1200101,
["rouge_skill_1"]=1200102,
["rouge_skill_2"]=1200103,
["rouge_skill_3"]=1200104,
["begin_lv"]=5,
["hp"]={
2000000,
2400000,
2800000,
3220000,
3660000,
4120000,
4620000,
5160000,
5760000,
6420000,
7140000,
7940000,
8840000,
9840000,
10980000
},
["atk"]={
1000000,
1200000,
1400000,
1610000,
1830000,
2060000,
2310000,
2580000,
2880000,
3210000,
3570000,
3970000,
4420000,
4920000,
5490000
},
["model_id"]="p0011",
["icon"]="5",
["item_id"]=24001,
["unlock_chapter"]=1
}, },
[22001]={ [22001]={
["position"]=2, ["position"]=2,
["qlt"]=2, ["qlt"]=2,
["hurt_skill"]={ ["hurt_skill"]={
2200110,
2200111, 2200111,
2200112, 2200112,
2200113, 2200113
2200114
}, },
["base_skill"]=2200120, ["base_skill"]=2200120,
["support_skill"]=2200110, ["rouge_skill"]=2200101,
["rouge_skill"]=200200, ["rouge_skill_1"]=2200102,
["rouge_skill_1"]=200201, ["rouge_skill_2"]=2200103,
["rouge_skill_2"]=200202, ["rouge_skill_3"]=2200104,
["rouge_skill_3"]=200203,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
2000000, 2000000,
@ -107,78 +267,130 @@ local hero = {
["model_id"]="p0002", ["model_id"]="p0002",
["icon"]="2", ["icon"]="2",
["item_id"]=22001, ["item_id"]=22001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[23001]={ [23001]={
["position"]=2, ["position"]=2,
["qlt"]=3, ["qlt"]=3,
["hurt_skill"]={ ["hurt_skill"]={
2300110,
2300111, 2300111,
2300112, 2300112,
2300113, 2300113
2300114
}, },
["base_skill"]=2300120, ["base_skill"]=2300120,
["support_skill"]=2300110, ["rouge_skill"]=2200101,
["rouge_skill"]=200700, ["rouge_skill_1"]=2200102,
["rouge_skill_1"]=200701, ["rouge_skill_2"]=2200103,
["rouge_skill_2"]=200702, ["rouge_skill_3"]=2200104,
["rouge_skill_3"]=200703,
["begin_lv"]=3, ["begin_lv"]=3,
["hp"]={ ["hp"]={
3000000, 2000000,
3520000, 2400000,
4040000, 2800000,
4580000, 3220000,
3660000,
4120000,
4620000,
5160000, 5160000,
5760000, 5760000,
6420000, 6420000,
7120000, 7140000,
7900000, 7940000,
8760000, 8840000,
9700000, 9840000,
10740000, 10980000
11920000,
13220000,
14700000
}, },
["atk"]={ ["atk"]={
1500000, 1000000,
1760000, 1200000,
2020000, 1400000,
2290000, 1610000,
1830000,
2060000,
2310000,
2580000, 2580000,
2880000, 2880000,
3210000, 3210000,
3560000, 3570000,
3950000, 3970000,
4380000, 4420000,
4850000, 4920000,
5370000, 5490000
5960000, },
6610000, ["model_id"]="p0010",
7350000 ["icon"]="5",
["item_id"]=23001,
["unlock_chapter"]=1
},
[24001]={
["position"]=2,
["qlt"]=4,
["hurt_skill"]={
2400110,
2400111,
2400112,
2400113
},
["base_skill"]=2400120,
["rouge_skill"]=2400101,
["rouge_skill_1"]=2400102,
["rouge_skill_2"]=2400103,
["rouge_skill_3"]=2400104,
["begin_lv"]=5,
["hp"]={
2000000,
2400000,
2800000,
3220000,
3660000,
4120000,
4620000,
5160000,
5760000,
6420000,
7140000,
7940000,
8840000,
9840000,
10980000
},
["atk"]={
1000000,
1200000,
1400000,
1610000,
1830000,
2060000,
2310000,
2580000,
2880000,
3210000,
3570000,
3970000,
4420000,
4920000,
5490000
}, },
["model_id"]="p0007", ["model_id"]="p0007",
["icon"]="7", ["icon"]="7",
["item_id"]=23001, ["item_id"]=24001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[32001]={ [32001]={
["position"]=3, ["position"]=3,
["qlt"]=2, ["qlt"]=2,
["hurt_skill"]={ ["hurt_skill"]={
3200110,
3200111, 3200111,
3200112, 3200112,
3200113, 3200113
3200114
}, },
["base_skill"]=3200120, ["base_skill"]=3200120,
["support_skill"]=3200110, ["rouge_skill"]=3200101,
["rouge_skill"]=200100, ["rouge_skill_1"]=3200102,
["rouge_skill_1"]=200101, ["rouge_skill_2"]=3200103,
["rouge_skill_2"]=200102, ["rouge_skill_3"]=3200104,
["rouge_skill_3"]=200103,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
2000000, 2000000,
@ -217,78 +429,76 @@ local hero = {
["model_id"]="p0001", ["model_id"]="p0001",
["icon"]="1", ["icon"]="1",
["item_id"]=32001, ["item_id"]=32001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[33001]={ [33001]={
["position"]=3, ["position"]=3,
["qlt"]=3, ["qlt"]=3,
["hurt_skill"]={ ["hurt_skill"]={
3300110,
3300111, 3300111,
3300112, 3300112,
3300113, 3300113
3300114
}, },
["base_skill"]=3300120, ["base_skill"]=3300120,
["support_skill"]=3300110, ["rouge_skill"]=3300101,
["rouge_skill"]=200600, ["rouge_skill_1"]=3300102,
["rouge_skill_1"]=200601, ["rouge_skill_2"]=3300103,
["rouge_skill_2"]=200602, ["rouge_skill_3"]=3300104,
["rouge_skill_3"]=200603,
["begin_lv"]=3, ["begin_lv"]=3,
["hp"]={ ["hp"]={
3000000, 2000000,
3520000, 2400000,
4040000, 2800000,
4580000, 3220000,
3660000,
4120000,
4620000,
5160000, 5160000,
5760000, 5760000,
6420000, 6420000,
7120000, 7140000,
7900000, 7940000,
8760000, 8840000,
9700000, 9840000,
10740000, 10980000
11920000,
13220000,
14700000
}, },
["atk"]={ ["atk"]={
1500000, 1000000,
1760000, 1200000,
2020000, 1400000,
2290000, 1610000,
1830000,
2060000,
2310000,
2580000, 2580000,
2880000, 2880000,
3210000, 3210000,
3560000, 3570000,
3950000, 3970000,
4380000, 4420000,
4850000, 4920000,
5370000, 5490000
5960000,
6610000,
7350000
}, },
["model_id"]="p0006", ["model_id"]="p0006",
["icon"]="6", ["icon"]="6",
["item_id"]=33001, ["item_id"]=33001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[42001]={ [42001]={
["position"]=4, ["position"]=4,
["qlt"]=2, ["qlt"]=2,
["hurt_skill"]={ ["hurt_skill"]={
4200110,
4200111, 4200111,
4200112, 4200112,
4200113, 4200113
4200114
}, },
["base_skill"]=4200120, ["base_skill"]=4200120,
["support_skill"]=4200110, ["rouge_skill"]=4200101,
["rouge_skill"]=200300, ["rouge_skill_1"]=4200102,
["rouge_skill_1"]=200301, ["rouge_skill_2"]=4200103,
["rouge_skill_2"]=200302, ["rouge_skill_3"]=4200104,
["rouge_skill_3"]=200303,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
2000000, 2000000,
@ -327,78 +537,76 @@ local hero = {
["model_id"]="p0003", ["model_id"]="p0003",
["icon"]="3", ["icon"]="3",
["item_id"]=42001, ["item_id"]=42001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[43001]={ [44001]={
["position"]=4, ["position"]=4,
["qlt"]=3, ["qlt"]=4,
["hurt_skill"]={ ["hurt_skill"]={
4300111, 4400110,
4300112, 4400111,
4300113, 4400112,
4300114 4400113
}, },
["base_skill"]=4300120, ["base_skill"]=4400120,
["support_skill"]=4300110, ["rouge_skill"]=4400101,
["rouge_skill"]=200800, ["rouge_skill_1"]=4400102,
["rouge_skill_1"]=200801, ["rouge_skill_2"]=4400103,
["rouge_skill_2"]=200802, ["rouge_skill_3"]=4400104,
["rouge_skill_3"]=200803, ["begin_lv"]=5,
["begin_lv"]=3,
["hp"]={ ["hp"]={
3000000, 2000000,
3520000, 2400000,
4040000, 2800000,
4580000, 3220000,
3660000,
4120000,
4620000,
5160000, 5160000,
5760000, 5760000,
6420000, 6420000,
7120000, 7140000,
7900000, 7940000,
8760000, 8840000,
9700000, 9840000,
10740000, 10980000
11920000,
13220000,
14700000
}, },
["atk"]={ ["atk"]={
1500000, 1000000,
1760000, 1200000,
2020000, 1400000,
2290000, 1610000,
1830000,
2060000,
2310000,
2580000, 2580000,
2880000, 2880000,
3210000, 3210000,
3560000, 3570000,
3950000, 3970000,
4380000, 4420000,
4850000, 4920000,
5370000, 5490000
5960000,
6610000,
7350000
}, },
["model_id"]="p0008", ["model_id"]="p0008",
["icon"]="8", ["icon"]="8",
["item_id"]=43001, ["item_id"]=44001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
}, },
[52001]={ [52001]={
["position"]=5, ["position"]=5,
["qlt"]=2, ["qlt"]=2,
["hurt_skill"]={ ["hurt_skill"]={
5200110,
5200111, 5200111,
5200112, 5200112,
5200113, 5200113
5200114
}, },
["base_skill"]=5200120, ["base_skill"]=5200120,
["support_skill"]=5200110, ["rouge_skill"]=5200101,
["rouge_skill"]=200400, ["rouge_skill_1"]=5200102,
["rouge_skill_1"]=200401, ["rouge_skill_2"]=5200103,
["rouge_skill_2"]=200402, ["rouge_skill_3"]=5200104,
["rouge_skill_3"]=200403,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
2000000, 2000000,
@ -437,10 +645,10 @@ local hero = {
["model_id"]="p0004", ["model_id"]="p0004",
["icon"]="4", ["icon"]="4",
["item_id"]=52001, ["item_id"]=52001,
["unlock_chapter"]=0 ["unlock_chapter"]=1
} }
} }
local config = { local config = {
data=hero,count=8 data=hero,count=12
} }
return config return config

View File

@ -376,6 +376,7 @@ BattleConst.GRID_BREAK_CONDITION = {
BattleConst.GRID_EFFECT_TYPE = { BattleConst.GRID_EFFECT_TYPE = {
DIRECTION_ELIMINATION = 1, DIRECTION_ELIMINATION = 1,
CROSS_SPREAD = 2, CROSS_SPREAD = 2,
SELECT_COMMON_SKILL = 3,
} }
BattleConst.GRID_EFFECT_TRIGGER_TYPE = { BattleConst.GRID_EFFECT_TRIGGER_TYPE = {

View File

@ -160,7 +160,7 @@ function BattleController:onLinkChange()
end end
end end
local aniSequence, influenceElementType, lineCount, elementTypeMap, linkElementType = self:calculateCurElimination() local aniSequence, influenceElementType, lineCount, elementTypeMap, linkElementType = self:calculateCurElimination(true)
self.battleUI:refreshSkill(elementTypeMap, count > 0) self.battleUI:refreshSkill(elementTypeMap, count > 0)
if mainElementType then if mainElementType then
@ -477,40 +477,29 @@ function BattleController:enterElimination(needDelay)
self.showSelectSkillSid = nil self.showSelectSkillSid = nil
end end
if self.battleData:useAddlvCount() then if self:tryShowSelectSkillComp(needDelay) then
local skillList = self:getRandomSkillList() return
if needDelay then end
self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function()
self.battleUI:showSelectSkillComp(skillList)
self.showSelectSkillSid = nil
end, 0.3)
else
self.battleUI:showSelectSkillComp(skillList)
end
local totalTime = Time:getServerTime() - self.battleStartTime self.battleUI:hideAllBoardSfxs()
BIReport:postShowFightSkillSelect(self.battleType, skillList, self.chapterId, totalTime, self.waveIndex)
else
self.battleUI:hideAllBoardSfxs()
-- 检查棋盘 -- 检查棋盘
local find, pathList = self:findAttention() local find, pathList = self:findAttention()
if not find then -- 如果没找到,就要打乱棋盘 if not find then -- 如果没找到,就要打乱棋盘
self:shuffleBoard(function() self:shuffleBoard(function()
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
end)
else
self.attentionList = pathList
-- ModuleManager.BattleManager:performWithDelayGlobal(function()
-- for _, posId in ipairs(pathList) do
-- local entity = self.battleData:getGridEntity(posId)
-- if entity and entity:getCell() then
-- entity:getCell():showAni()
-- end
-- end
-- end, 2)
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
end end)
else
self.attentionList = pathList
-- ModuleManager.BattleManager:performWithDelayGlobal(function()
-- for _, posId in ipairs(pathList) do
-- local entity = self.battleData:getGridEntity(posId)
-- if entity and entity:getCell() then
-- entity:getCell():showAni()
-- end
-- end
-- end, 2)
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ELIMINATION
end end
end end
@ -894,7 +883,7 @@ function BattleController:onLinkOver()
self.eliminateTotalCount = self.eliminateTotalCount + 1 self.eliminateTotalCount = self.eliminateTotalCount + 1
end end
function BattleController:calculateCurElimination() function BattleController:calculateCurElimination(onlyCheck)
local sequence = self.battleData:getGridSequence() local sequence = self.battleData:getGridSequence()
local skillId = self.battleData:getSequenceHadSkill() local skillId = self.battleData:getSequenceHadSkill()
local skillEntity local skillEntity
@ -913,14 +902,14 @@ function BattleController:calculateCurElimination()
local aniSequence = {} local aniSequence = {}
for idx, info in ipairs(sequence) do for idx, info in ipairs(sequence) do
local posId = info.posId local posId = info.posId
self:dealGridBreak(posId, GRID_BREAK_CONDITION.LINE, time, breakedMap, sequenceMap, aniSequence, boomGridIds) self:dealGridBreak(posId, GRID_BREAK_CONDITION.LINE, time, breakedMap, sequenceMap, aniSequence, boomGridIds, onlyCheck)
time = time + BattleConst.ELIMINATION_INTERVAL time = time + BattleConst.ELIMINATION_INTERVAL
end end
local randomPosList, influenceElementTypeMap local randomPosList, influenceElementTypeMap
for i, info in ipairs(aniSequence) do for i, info in ipairs(aniSequence) do
if info.isSkill then if info.isSkill then
randomPosList, influenceElementTypeMap = self:dealSkillElement(info.timeIdx + skillTime, breakedMap, sequenceMap, aniSequence, boomGridIds) randomPosList, influenceElementTypeMap = self:dealSkillElement(info.timeIdx + skillTime, breakedMap, sequenceMap, aniSequence, boomGridIds, onlyCheck)
local aniUnit = aniSequence[i] local aniUnit = aniSequence[i]
aniUnit.rangeList = skillEntity:getBoardRange() aniUnit.rangeList = skillEntity:getBoardRange()
aniUnit.randomPosList = randomPosList aniUnit.randomPosList = randomPosList
@ -953,7 +942,7 @@ function BattleController:calculateCurElimination()
return aniSequence, influenceElementTypeMap, lineCount, elementTypeMap, linkElementType, effectGridMap return aniSequence, influenceElementTypeMap, lineCount, elementTypeMap, linkElementType, effectGridMap
end end
function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequenceMap, aniSequence, gridMap) function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck)
self:setGridBreakCondition(gridMap, posId, condition) self:setGridBreakCondition(gridMap, posId, condition)
if breakedMap[posId] or (sequenceMap[posId] and condition ~= GRID_BREAK_CONDITION.LINE) then if breakedMap[posId] or (sequenceMap[posId] and condition ~= GRID_BREAK_CONDITION.LINE) then
return return
@ -992,18 +981,18 @@ function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequ
if condition == GRID_BREAK_CONDITION.LINE then if condition == GRID_BREAK_CONDITION.LINE then
local outline = BattleConst.UP_DOWN_LEFT_RIGHT[posId] local outline = BattleConst.UP_DOWN_LEFT_RIGHT[posId]
for _, id in ipairs(outline) do for _, id in ipairs(outline) do
self:dealGridBreak(id, GRID_BREAK_CONDITION.AROUND, time, breakedMap, sequenceMap, aniSequence, gridMap) self:dealGridBreak(id, GRID_BREAK_CONDITION.AROUND, time, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck)
end end
end end
if entity:getEffectType() then if entity:getEffectType() then
local list = BATTLE_GRID_EFFECT_HANDLE.gridEffectOn(posId, gridEntities, BattleConst.GRID_EFFECT_TRIGGER_TYPE.ON_GRID_BREAK, self) local list = BATTLE_GRID_EFFECT_HANDLE.gridEffectOn(posId, gridEntities, BattleConst.GRID_EFFECT_TRIGGER_TYPE.ON_GRID_BREAK, self, onlyCheck)
if list then if list then
aniUnit.aniPosList = {} aniUnit.aniPosList = {}
aniUnit.overCallback = aniUnit.callback aniUnit.overCallback = aniUnit.callback
aniUnit.callback = nil aniUnit.callback = nil
for index, id in ipairs(list) do for index, id in ipairs(list) do
if id ~= posId then if id ~= posId then
self:dealGridBreak(id, GRID_BREAK_CONDITION.SKILL, time + BattleConst.GRID_BREAK_EFFECT_INTERVAL * index, breakedMap, sequenceMap, aniSequence, gridMap) self:dealGridBreak(id, GRID_BREAK_CONDITION.SKILL, time + BattleConst.GRID_BREAK_EFFECT_INTERVAL * index, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck)
table.insert(aniUnit.aniPosList, id) table.insert(aniUnit.aniPosList, id)
end end
end end
@ -1014,7 +1003,7 @@ function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequ
return isIdle return isIdle
end end
function BattleController:dealSkillElement(time, breakedMap, sequenceMap, aniSequence, boomGridIds) function BattleController:dealSkillElement(time, breakedMap, sequenceMap, aniSequence, boomGridIds, onlyCheck)
local randomPosList local randomPosList
local influenceElementTypeMap = {} local influenceElementTypeMap = {}
for posId, info in pairs(self.battleData:getSkillInfluenceGrids()) do for posId, info in pairs(self.battleData:getSkillInfluenceGrids()) do
@ -1029,7 +1018,7 @@ function BattleController:dealSkillElement(time, breakedMap, sequenceMap, aniSeq
end end
influenceElementTypeMap[entity:getElementType()] = (influenceElementTypeMap[entity:getElementType()] or 0) + 1 influenceElementTypeMap[entity:getElementType()] = (influenceElementTypeMap[entity:getElementType()] or 0) + 1
end end
self:dealGridBreak(posId, GRID_BREAK_CONDITION.SKILL, time, breakedMap, sequenceMap, aniSequence, boomGridIds) self:dealGridBreak(posId, GRID_BREAK_CONDITION.SKILL, time, breakedMap, sequenceMap, aniSequence, boomGridIds, onlyCheck)
end end
end end
@ -1064,6 +1053,34 @@ function BattleController:setGridBreakCondition(gridMap, posId, condition)
return true, false return true, false
end end
function BattleController:tryShowSelectSkillComp(needDelay)
local onlyCommonSkill
if self.battleData:useCommonSelectSkillCount() then
onlyCommonSkill = true
elseif self.battleData:useAddlvCount() then
onlyCommonSkill = false
end
if onlyCommonSkill == nil then
return false
end
local skillList = self:getRandomSkillList(nil, onlyCommonSkill)
if needDelay then
self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function()
self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill)
self.showSelectSkillSid = nil
end, 0.3)
else
self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill)
end
local totalTime = Time:getServerTime() - self.battleStartTime
BIReport:postShowFightSkillSelect(self.battleType, skillList, self.chapterId, totalTime, self.waveIndex)
return true
end
function BattleController:fillBoard(isRoundBeginCheck) function BattleController:fillBoard(isRoundBeginCheck)
local pathMap = {} local pathMap = {}
local columnCount = {} local columnCount = {}
@ -1696,7 +1713,7 @@ function BattleController:findSkillInfluenceGrids()
end end
end end
function BattleController:getRandomSkillList(getCount) function BattleController:getRandomSkillList(getCount, onlyCommonSkill)
local fixedList = self:getFixedRogueSkill() local fixedList = self:getFixedRogueSkill()
if fixedList[1] then if fixedList[1] then
return table.remove(fixedList, 1) return table.remove(fixedList, 1)
@ -1711,43 +1728,15 @@ function BattleController:getRandomSkillList(getCount)
local count = 0 local count = 0
local newSkillPool = {} local newSkillPool = {}
local skillWeight = {} local skillWeight = {}
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
if not self.battleData:isUnlockedSkillElementType(elementType) then
local skillEntity = self.battleData:getSkillEntityByElement(elementType)
if skillEntity then
local skillId = skillEntity:getUnlockId()
if skillId and not map[skillId] then
local skillCfg = cfg[skillId]
table.insert(newSkillPool, skillId)
table.insert(skillWeight, skillCfg.weight)
count = count + 1
map[skillId] = true
end
end
end
end
if count >= 3 then -- 如果未解锁的技能大于等于3则直接返回三个解锁技能 if not onlyCommonSkill then
for i = 1, 3 do for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
local index = GFunc.getRandomIndex(skillWeight) if not self.battleData:isUnlockedSkillElementType(elementType) then
local skillId = table.remove(newSkillPool, index) local skillEntity = self.battleData:getSkillEntityByElement(elementType)
table.remove(skillWeight, index) if skillEntity then
count = count - 1 local skillId = skillEntity:getUnlockId()
table.insert(result, skillId) if skillId and not map[skillId] then
if count <= 0 then local skillCfg = cfg[skillId]
break
end
end
return table.shuffle(result)
end
for elementType, list in pairs(skillPool) do
if self.battleData:isUnlockedSkillElementType(elementType) then
for _, skillId in ipairs(list) do
local skillCfg = cfg[skillId]
if skillCfg and (not skillCfg.limit_times or self.battleData:getSkillCount(skillId) < skillCfg.limit_times) then
if not map[skillId] then
table.insert(newSkillPool, skillId) table.insert(newSkillPool, skillId)
table.insert(skillWeight, skillCfg.weight) table.insert(skillWeight, skillCfg.weight)
count = count + 1 count = count + 1
@ -1756,15 +1745,43 @@ function BattleController:getRandomSkillList(getCount)
end end
end end
end end
end
if count > 0 then if count >= 3 then -- 如果未解锁的技能大于等于3则直接返回三个解锁技能
local index = GFunc.getRandomIndex(skillWeight) for i = 1, 3 do
local skillId = table.remove(newSkillPool, index) local index = GFunc.getRandomIndex(skillWeight)
table.remove(skillWeight, index) local skillId = table.remove(newSkillPool, index)
count = count - 1 table.remove(skillWeight, index)
table.insert(result, skillId) count = count - 1
getCount = getCount - 1 table.insert(result, skillId)
end
return table.shuffle(result)
end
for elementType, list in pairs(skillPool) do
if self.battleData:isUnlockedSkillElementType(elementType) then
for _, skillId in ipairs(list) do
local skillCfg = cfg[skillId]
if skillCfg and (not skillCfg.limit_times or self.battleData:getSkillCount(skillId) < skillCfg.limit_times) then
if not map[skillId] then
table.insert(newSkillPool, skillId)
table.insert(skillWeight, skillCfg.weight)
count = count + 1
map[skillId] = true
end
end
end
end
end
if count > 0 then
local index = GFunc.getRandomIndex(skillWeight)
local skillId = table.remove(newSkillPool, index)
table.remove(skillWeight, index)
count = count - 1
table.insert(result, skillId)
getCount = getCount - 1
end
end end
for skillId, info in pairs(cfg) do for skillId, info in pairs(cfg) do

View File

@ -5,7 +5,7 @@ local BattleGridEffectHandle = {}
local GRID_EFFECT_TYPE = BattleConst.GRID_EFFECT_TYPE local GRID_EFFECT_TYPE = BattleConst.GRID_EFFECT_TYPE
local GRID_BREAK_CONDITION = BattleConst.GRID_BREAK_CONDITION local GRID_BREAK_CONDITION = BattleConst.GRID_BREAK_CONDITION
local function _directionElinination(entity, gridEntities, battleController) local function _directionElinination(entity, gridEntities, battleController, onlyCheck)
local effectParams = entity:getEffectParams() local effectParams = entity:getEffectParams()
if not effectParams then if not effectParams then
return return
@ -15,7 +15,11 @@ local function _directionElinination(entity, gridEntities, battleController)
return list return list
end end
local function _crossSpread(entity, gridEntities, battleController) local function _crossSpread(entity, gridEntities, battleController, onlyCheck)
if onlyCheck then
return
end
local tempList = BattleConst.UP_DOWN_LEFT_RIGHT[entity:getPosId()] local tempList = BattleConst.UP_DOWN_LEFT_RIGHT[entity:getPosId()]
if not tempList then if not tempList then
return return
@ -32,12 +36,20 @@ local function _crossSpread(entity, gridEntities, battleController)
return list return list
end end
local function _selectCommonSkill(entity, gridEntities, battleController, onlyCheck)
if onlyCheck then
return
end
battleController.battleData:addCommonSelectSkillCount()
end
BattleGridEffectHandle._gridEffectOn = { BattleGridEffectHandle._gridEffectOn = {
[GRID_EFFECT_TYPE.DIRECTION_ELIMINATION] = _directionElinination, [GRID_EFFECT_TYPE.DIRECTION_ELIMINATION] = _directionElinination,
[GRID_EFFECT_TYPE.CROSS_SPREAD] = _crossSpread, [GRID_EFFECT_TYPE.CROSS_SPREAD] = _crossSpread,
[GRID_EFFECT_TYPE.SELECT_COMMON_SKILL] = _selectCommonSkill,
} }
function BattleGridEffectHandle.gridEffectOn(posId, gridEntities, triggerType, battleController) function BattleGridEffectHandle.gridEffectOn(posId, gridEntities, triggerType, battleController, onlyCheck)
local entity = gridEntities[posId] local entity = gridEntities[posId]
local effectType = entity:getEffectType() local effectType = entity:getEffectType()
if not effectType then if not effectType then
@ -49,7 +61,7 @@ function BattleGridEffectHandle.gridEffectOn(posId, gridEntities, triggerType, b
local func = BattleGridEffectHandle._gridEffectOn[effectType] local func = BattleGridEffectHandle._gridEffectOn[effectType]
if func then if func then
return func(entity, gridEntities, battleController) return func(entity, gridEntities, battleController, onlyCheck)
end end
end end

View File

@ -9,8 +9,9 @@ local SKILL_ICON_POS = {
{x =-240, y= -165} {x =-240, y= -165}
} }
function BattleSkillSelectComp:refresh(skillList) function BattleSkillSelectComp:refresh(skillList, onlyCommonSkill)
self.skillList = skillList self.skillList = skillList
self.onlyCommonSkill = onlyCommonSkill
self:_playPop() self:_playPop()
self:_display() self:_display()
self:_addListeners() self:_addListeners()
@ -40,7 +41,7 @@ function BattleSkillSelectComp:_addListeners()
end end
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function() SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function()
self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList() self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.onlyCommonSkill)
self:refreshRogueSkill() self:refreshRogueSkill()
end) end)
end) end)

View File

@ -1861,11 +1861,11 @@ function BattleUI:initSelectSkillNode()
end end
end end
function BattleUI:showSelectSkillComp(skillList) function BattleUI:showSelectSkillComp(skillList, isCommon)
if not self.selectSkillComp then if not self.selectSkillComp then
return return
end end
self.selectSkillComp:refresh(skillList) self.selectSkillComp:refresh(skillList, isCommon)
end end
function BattleUI:hideAllBoardSfxs() function BattleUI:hideAllBoardSfxs()

View File

@ -22,6 +22,7 @@ function BattleData:init()
self.curBattleExp = 0 self.curBattleExp = 0
self.needBattleExp = self:getLvNeedExp() self.needBattleExp = self:getLvNeedExp()
self.addLvCount = 0 self.addLvCount = 0
self.commonSelectSkillCount = 0
self.timeScale = BattleConst.TIME_SCALE.LEVEL_1 self.timeScale = BattleConst.TIME_SCALE.LEVEL_1
self.lockElementMap = {} self.lockElementMap = {}
self.data.timeSpeed = 1 self.data.timeSpeed = 1
@ -518,6 +519,21 @@ function BattleData:useAddlvCount()
return true return true
end end
function BattleData:addCommonSelectSkillCount(count)
self.commonSelectSkillCount = self.commonSelectSkillCount + (count or 1)
Logger.logHighlight("self.commonSelectSkillCount " .. self.commonSelectSkillCount)
end
function BattleData:useCommonSelectSkillCount()
Logger.logHighlight("useCommonSelectSkillCount " .. self.commonSelectSkillCount)
if self.commonSelectSkillCount <= 0 then
self.commonSelectSkillCount = 0
return false
end
self.commonSelectSkillCount = self.commonSelectSkillCount - 1
return true
end
function BattleData:initTeam(side) function BattleData:initTeam(side)
local data = nil local data = nil
if side == BattleConst.SIDE_ATK then if side == BattleConst.SIDE_ATK then