取消连线

This commit is contained in:
xiekaidong 2023-07-04 18:05:17 +08:00
parent 12ba5a0430
commit 47d5b00318
14 changed files with 1287 additions and 742 deletions

View File

@ -34,6 +34,7 @@ local LOCAL_DATA_KEY = {
NEW_AVATAR_AND_FRAME = "NEW_AVATAR_AND_FRAME",
SHOP_DISCOUNT_RED_POINT_TIME = "SHOP_DISCOUNT_RED_POINT_TIME",
ARENA_BOUNTY_POP_TIME = "ARENA_BOUNTY_POP_TIME",
LINK_TOUCH_CANCEL_COUNT = "LINK_TOUCH_CANCEL_COUNT",
}
LocalData.KEYS = LOCAL_DATA_KEY
@ -402,4 +403,12 @@ function LocalData:getArenaBountyPopTime()
return self:getInt(LOCAL_DATA_KEY.ARENA_BOUNTY_POP_TIME, 0)
end
function LocalData:setLinkTouchCancelCount(count)
self:setInt(LOCAL_DATA_KEY.LINK_TOUCH_CANCEL_COUNT, count)
end
function LocalData:getLinkTouchCancelCount()
return self:getInt(LOCAL_DATA_KEY.LINK_TOUCH_CANCEL_COUNT, 0)
end
return LocalData

View File

@ -518,8 +518,8 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=500,
["num_for_nothing"]="Uwhc"
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
},
{
["type"]=1,
@ -543,32 +543,32 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
["num"]=8000,
["num_for_nothing"]="XghcAw=="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=100,
["num_for_nothing"]="Vwhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=50,
["num_for_nothing"]="Uwg="
["num"]=40,
["num_for_nothing"]="Ugg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
["num"]=6,
["num_for_nothing"]="UA=="
}
},
["time_type"]=1,
@ -586,32 +586,32 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
["num"]=8000,
["num_for_nothing"]="XghcAw=="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=100,
["num_for_nothing"]="Vwhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=50,
["num_for_nothing"]="Uwg="
["num"]=40,
["num_for_nothing"]="Ugg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
["num"]=6,
["num_for_nothing"]="UA=="
}
},
["time_type"]=1,
@ -629,32 +629,32 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
["num"]=8000,
["num_for_nothing"]="XghcAw=="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=100,
["num_for_nothing"]="Vwhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=50,
["num_for_nothing"]="Uwg="
["num"]=40,
["num_for_nothing"]="Ugg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
["num"]=6,
["num_for_nothing"]="UA=="
}
},
["time_type"]=1,
@ -672,32 +672,32 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
["num"]=8000,
["num_for_nothing"]="XghcAw=="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=100,
["num_for_nothing"]="Vwhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=50,
["num_for_nothing"]="Uwg="
["num"]=40,
["num_for_nothing"]="Ugg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
["num"]=6,
["num_for_nothing"]="UA=="
}
},
["time_type"]=1,

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ local arena_robot = {
[1]={
["name"]="Gresham",
["score"]=917,
["level"]=15,
["level"]=12,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
@ -31,7 +31,7 @@ local arena_robot = {
[2]={
["name"]="Gilroy",
["score"]=929,
["level"]=15,
["level"]=13,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
@ -59,8 +59,8 @@ local arena_robot = {
},
[3]={
["name"]="Landry",
["score"]=946,
["level"]=17,
["score"]=941,
["level"]=13,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
@ -88,8 +88,8 @@ local arena_robot = {
},
[4]={
["name"]="Eva",
["score"]=957,
["level"]=18,
["score"]=953,
["level"]=12,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
@ -106,8 +106,8 @@ local arena_robot = {
5
},
{
42001,
5
43001,
3
},
{
52001,
@ -118,7 +118,7 @@ local arena_robot = {
[5]={
["name"]="Prosperous",
["score"]=959,
["level"]=15,
["level"]=12,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
@ -135,8 +135,8 @@ local arena_robot = {
5
},
{
42001,
5
43001,
3
},
{
52001,
@ -147,7 +147,7 @@ local arena_robot = {
[6]={
["name"]="Fleming",
["score"]=964,
["level"]=14,
["level"]=11,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
@ -161,11 +161,11 @@ local arena_robot = {
},
{
33001,
5
3
},
{
43001,
5
4
},
{
52001,
@ -175,8 +175,8 @@ local arena_robot = {
},
[7]={
["name"]="Lola",
["score"]=964,
["level"]=14,
["score"]=969,
["level"]=11,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
@ -186,15 +186,15 @@ local arena_robot = {
},
{
22001,
5
6
},
{
33001,
5
3
},
{
43001,
5
4
},
{
52001,
@ -204,22 +204,22 @@ local arena_robot = {
},
[8]={
["name"]="Frances",
["score"]=967,
["level"]=16,
["score"]=978,
["level"]=12,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
6
},
{
22001,
5
6
},
{
33001,
5
3
},
{
43001,
@ -233,22 +233,22 @@ local arena_robot = {
},
[9]={
["name"]="Keith",
["score"]=971,
["level"]=17,
["score"]=987,
["level"]=10,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
6
},
{
22001,
5
6
},
{
33001,
5
4
},
{
43001,
@ -262,19 +262,48 @@ local arena_robot = {
},
[10]={
["name"]="Winston",
["score"]=988,
["level"]=17,
["score"]=996,
["level"]=14,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
13001,
3
},
{
22001,
6
},
{
33001,
4
},
{
43001,
5
},
{
52001,
6
}
}
},
[11]={
["name"]="Halsey",
["score"]=1006,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
3
},
{
22001,
6
},
{
33001,
5
@ -285,49 +314,20 @@ local arena_robot = {
},
{
52001,
5
}
}
},
[11]={
["name"]="Halsey",
["score"]=1007,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[12]={
["name"]="Stuart",
["score"]=1027,
["level"]=19,
["score"]=1018,
["level"]=17,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
4
},
{
22001,
@ -335,14 +335,14 @@ local arena_robot = {
},
{
33001,
6
5
},
{
43001,
6
5
},
{
53002,
52001,
6
}
}
@ -355,8 +355,8 @@ local arena_robot = {
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
4
},
{
22001,
@ -364,28 +364,28 @@ local arena_robot = {
},
{
33001,
6
5
},
{
43001,
6
5
},
{
53002,
52001,
6
}
}
},
[14]={
["name"]="Hilda",
["score"]=1033,
["level"]=16,
["score"]=1036,
["level"]=13,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
5
},
{
22001,
@ -393,28 +393,28 @@ local arena_robot = {
},
{
33001,
6
5
},
{
43001,
6
},
{
53002,
52001,
6
}
}
},
[15]={
["name"]="Idelle",
["score"]=1037,
["level"]=19,
["score"]=1046,
["level"]=16,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
5
},
{
22001,
@ -422,7 +422,7 @@ local arena_robot = {
},
{
33001,
6
5
},
{
43001,
@ -430,20 +430,20 @@ local arena_robot = {
},
{
53002,
6
4
}
}
},
[16]={
["name"]="Sibley",
["score"]=1082,
["level"]=19,
["score"]=1055,
["level"]=14,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
5
},
{
22001,
@ -459,24 +459,24 @@ local arena_robot = {
},
{
53002,
6
4
}
}
},
[17]={
["name"]="Wolf",
["score"]=1083,
["level"]=17,
["score"]=1065,
["level"]=14,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
13001,
5
},
{
22001,
6
7
},
{
33001,
@ -488,24 +488,24 @@ local arena_robot = {
},
{
53002,
6
4
}
}
},
[18]={
["name"]="Renata",
["score"]=1092,
["level"]=18,
["score"]=1073,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
13001,
6
},
{
22001,
6
7
},
{
33001,
@ -517,24 +517,24 @@ local arena_robot = {
},
{
53002,
6
4
}
}
},
[19]={
["name"]="Lane",
["score"]=1094,
["level"]=15,
["score"]=1084,
["level"]=13,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
13001,
6
},
{
22001,
6
7
},
{
33001,
@ -546,24 +546,24 @@ local arena_robot = {
},
{
53002,
6
5
}
}
},
[20]={
["name"]="Fabian",
["score"]=1098,
["level"]=19,
["score"]=1095,
["level"]=16,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
13001,
6
},
{
22001,
6
23002,
4
},
{
33001,
@ -575,28 +575,115 @@ local arena_robot = {
},
{
53002,
6
5
}
}
},
[21]={
["name"]="Peace",
["score"]=1101,
["score"]=1104,
["level"]=17,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
13001,
6
},
{
23001,
7
23002,
4
},
{
33002,
7
33001,
6
},
{
43001,
6
},
{
53002,
5
}
}
},
[22]={
["name"]="Tanya",
["score"]=1110,
["level"]=18,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
6
},
{
23002,
4
},
{
33001,
6
},
{
43001,
6
},
{
53002,
5
}
}
},
[23]={
["name"]="Trix",
["score"]=1118,
["level"]=16,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
6
},
{
23002,
5
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[24]={
["name"]="Eugene",
["score"]=1129,
["level"]=19,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
6
},
{
23002,
5
},
{
33001,
6
},
{
43001,
@ -604,101 +691,14 @@ local arena_robot = {
},
{
53002,
7
}
}
},
[22]={
["name"]="Tanya",
["score"]=1106,
["level"]=19,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23001,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[23]={
["name"]="Trix",
["score"]=1110,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23002,
7
},
{
33001,
7
},
{
43001,
7
},
{
53001,
7
}
}
},
[24]={
["name"]="Eugene",
["score"]=1115,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23001,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
6
}
}
},
[25]={
["name"]="Loralie",
["score"]=1125,
["level"]=16,
["score"]=1140,
["level"]=17,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
@ -708,10 +708,39 @@ local arena_robot = {
},
{
23002,
5
},
{
33001,
6
},
{
43001,
7
},
{
33002,
53002,
6
}
}
},
[26]={
["name"]="Henrietta",
["score"]=1150,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23002,
5
},
{
33001,
7
},
{
@ -719,44 +748,15 @@ local arena_robot = {
7
},
{
53001,
7
}
}
},
[26]={
["name"]="Henrietta",
["score"]=1137,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43001,
7
},
{
53001,
7
53002,
6
}
}
},
[27]={
["name"]="Willette",
["score"]=1156,
["level"]=15,
["score"]=1159,
["level"]=17,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
@ -766,10 +766,10 @@ local arena_robot = {
},
{
23002,
7
6
},
{
33002,
33001,
7
},
{
@ -777,28 +777,28 @@ local arena_robot = {
7
},
{
53001,
7
53002,
6
}
}
},
[28]={
["name"]="Orlena",
["score"]=1161,
["level"]=16,
["score"]=1167,
["level"]=17,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
13001,
7
},
{
23001,
7
23002,
6
},
{
33002,
33001,
7
},
{
@ -813,13 +813,42 @@ local arena_robot = {
},
[29]={
["name"]="Irving",
["score"]=1170,
["level"]=14,
["score"]=1178,
["level"]=18,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
13001,
7
},
{
23002,
6
},
{
33001,
7
},
{
43002,
7
},
{
53002,
7
}
}
},
[30]={
["name"]="Phyllis",
["score"]=1190,
["level"]=19,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
@ -835,36 +864,7 @@ local arena_robot = {
7
},
{
53001,
7
}
}
},
[30]={
["name"]="Phyllis",
["score"]=1181,
["level"]=17,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43001,
7
},
{
53001,
53002,
7
}
}

View File

@ -321,6 +321,7 @@ local LocalizationGlobalConst =
ARENA_BATTLE_DESC_9 = "ARENA_BATTLE_DESC_9",
ARENA_BATTLE_DESC_10 = "ARENA_BATTLE_DESC_10",
ARENA_BATTLE_DESC_11 = "ARENA_BATTLE_DESC_11",
BATTLE_DESC_13 = "BATTLE_DESC_13",
}
return LocalizationGlobalConst

View File

@ -2823,7 +2823,7 @@ local skill = {
["effect"]={
{
["type"]="shield_rebound_200",
["num"]=1000,
["num"]=1500,
["ratio"]=10000,
["round"]=2
}
@ -2831,7 +2831,7 @@ local skill = {
["pvp_effect"]={
{
["type"]="shield_rebound_200",
["num"]=333,
["num"]=750,
["ratio"]=10000,
["round"]=2
}
@ -2859,7 +2859,7 @@ local skill = {
["effect"]={
{
["type"]="shield_rebound_400",
["num"]=1000,
["num"]=1500,
["ratio"]=10000,
["round"]=2
}
@ -2867,7 +2867,7 @@ local skill = {
["pvp_effect"]={
{
["type"]="shield_rebound_400",
["num"]=333,
["num"]=750,
["ratio"]=10000,
["round"]=2
}
@ -4675,7 +4675,7 @@ local skill = {
["effect"]={
{
["type"]="shield_ice",
["num"]=3000,
["num"]=1500,
["ratio"]=10000,
["round"]=2
}
@ -4683,7 +4683,7 @@ local skill = {
["pvp_effect"]={
{
["type"]="shield_ice",
["num"]=1000,
["num"]=750,
["ratio"]=10000,
["round"]=2
}
@ -4701,7 +4701,7 @@ local skill = {
["effect"]={
{
["type"]="shield_ice_rebound_400",
["num"]=3000,
["num"]=1500,
["ratio"]=10000,
["round"]=2
}
@ -4709,7 +4709,7 @@ local skill = {
["pvp_effect"]={
{
["type"]="shield_ice_rebound_400",
["num"]=1000,
["num"]=750,
["ratio"]=10000,
["round"]=2
}

View File

@ -321,6 +321,7 @@ local localization_global =
["ARENA_BATTLE_DESC_9"] = "上一页",
["ARENA_BATTLE_DESC_10"] = "下一页",
["ARENA_BATTLE_DESC_11"] = "退出将判定为战败,是否退出?",
["BATTLE_DESC_13"] = "滑动至此处可取消连线",
}
return localization_global

View File

@ -824,6 +824,7 @@ function BattleBaseController:enterNextWave()
end
function BattleBaseController:enterRoundBegin()
self:hideTouchCancel()
self:resetSideActionCount()
self:setCurActionSide(SIDE_ATK)
self.needWaitingBoardOver = nil
@ -1062,7 +1063,16 @@ function BattleBaseController:onTouchEvent(eventType, posId, isVirtual)
BattleBoardTouchHelper:onTouchEvent(eventType, posId, isVirtual)
end
function BattleBaseController:showTouchCancel()
self.battleUI:showTouchCancel()
end
function BattleBaseController:hideTouchCancel()
self.battleUI:hideTouchCancel()
end
function BattleBaseController:clearGridSequence()
self:hideTouchCancel()
local sequence = self.battleData:getGridSequence()
local count = #sequence
if count <= 0 then
@ -2729,6 +2739,7 @@ function BattleBaseController:_tick(dt, originDt)
self:checkDelayEffectText(dt)
self:checkSkillSlowDown(dt)
self:tick(dt)
BattleBoardTouchHelper:tick(dt)
end
function BattleBaseController:battleEnd()

View File

@ -2,6 +2,8 @@ local BattleBoardTouchHelper = class("BattleBoardTouchHelper")
local BattleConst = GConst.BattleConst
local ELIMINATION_TOUCH_EVENT = GConst.ELIMINATION_TOUCH_EVENT
local CLEAR_SEQUENCE_TIME = 1
function BattleBoardTouchHelper:init(battleController)
self.battleController = battleController
self.battleUI = battleController.battleUI
@ -19,6 +21,7 @@ function BattleBoardTouchHelper:onTouchEvent(eventType, posId, isVirtual)
if eventType == ELIMINATION_TOUCH_EVENT.DOWN then
self:onLinkStart(entity, posId, isVirtual)
self.battleController:showTouchCancel()
elseif eventType == ELIMINATION_TOUCH_EVENT.ENTER then
if self.battleData:getIsVirtual() and not isVirtual then
return
@ -29,6 +32,7 @@ function BattleBoardTouchHelper:onTouchEvent(eventType, posId, isVirtual)
else -- 取消和抬起
self:onLinkCancelOrUp(entity, posId, isVirtual)
self.battleController:hideTouchCancel()
end
end
@ -68,6 +72,8 @@ function BattleBoardTouchHelper:onLinkStart(entity, posId, isVirtual)
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_SKILL)
end
end
self.clearSequenceTime = 0
end
function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
@ -78,32 +84,22 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual)
if not lastPosId then
return
end
local outLineMap = BattleConst.GRID_OUT_LINE_POS_ID[lastPosId]
if not outLineMap or not outLineMap[posId] then
return
end
if self.battleData:alreadyInsertSequence(posId) then
if self.battleData:alreadyInsertSequence(posId) and sequenceCount > 1 then
local info = sequence[#sequence - 1]
local beforePosId = info and info.posId
if beforePosId == posId then -- 进入的是倒数第二个,则移除倒数第一个
local snapshot = self.battleData:removeGridSequence(lastPosId)
if snapshot then -- 如果有快照,则恢复一次
for posId, info in pairs(snapshot) do
self.battleData:setInfoBySnapshop(posId, info)
self:clearSequenceByPosId(beforePosId)
else -- 如果不是倒数第二个,则记录时间
self.clearSequencePosId = posId
self.clearSequenceTime = CLEAR_SEQUENCE_TIME
end
return
end
self.clearSequenceTime = 0
local lastEntity = self.battleData:getGridEntity(beforePosId)
local lastSkillEntity = self.battleController:getSkillEntityBySkillId(lastEntity:getSkillId())
local maskElementType = lastEntity:getElementType(lastSkillEntity)
local _, skillPosId = self.battleData:getSequenceHadSkill()
self.battleUI:showBoardMask(maskElementType, skillPosId)
self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange()
end
local outLineMap = BattleConst.GRID_OUT_LINE_POS_ID[lastPosId]
if not outLineMap or not outLineMap[posId] then
return
end
@ -202,4 +198,53 @@ function BattleBoardTouchHelper:onLinkCancelOrUp(entity, posId, isVirtual)
end
end
function BattleBoardTouchHelper:tick(dt)
if self.clearSequenceTime and self.clearSequenceTime > 0 then
self.clearSequenceTime = self.clearSequenceTime - dt
if self.clearSequenceTime <= 0 then
self.clearSequenceTime = 0
if self.clearSequencePosId and self.clearSequencePosId > 0 then
self:clearSequenceByPosId(self.clearSequencePosId)
end
end
end
end
function BattleBoardTouchHelper:clearSequenceByPosId(posId)
if not posId then
return
end
local sequence = self.battleData:getGridSequence()
local targetIndex = 0
for index, info in ipairs(sequence) do
if info.posId == posId then
targetIndex = index
break
end
end
targetIndex = targetIndex + 1
if targetIndex <= 1 then -- 没找到
return
end
local snapshot = self.battleData:removeGridSequenceByIndex(targetIndex)
if not snapshot then
return
end
for posId, info in pairs(snapshot) do
self.battleData:setInfoBySnapshop(posId, info)
end
local gridEntity = self.battleData:getGridEntity(posId)
local skillEntity = self.battleController:getSkillEntityBySkillId(gridEntity:getSkillId())
local maskElementType = gridEntity:getElementType(skillEntity)
local _, skillPosId = self.battleData:getSequenceHadSkill()
self.battleUI:showBoardMask(maskElementType, skillPosId)
self.battleController:findSkillInfluenceGrids()
self.battleController:onLinkChange()
end
return BattleBoardTouchHelper

View File

@ -101,6 +101,8 @@ local ProtoMsgType = {
[2731283225] = "MailExtractRsp",
[2849800229] = "MailReadReq",
[2849802062] = "MailReadRsp",
[2909093054] = "AIHelpUnreadReq",
[2909094887] = "AIHelpUnreadRsp",
[3003864530] = "ActTriggerGiftNtf",
[3013273736] = "PVPRankHeroesReq",
[3013275569] = "PVPRankHeroesRsp",
@ -266,6 +268,8 @@ local ProtoMsgType = {
MailExtractRsp = 2731283225,
MailReadReq = 2849800229,
MailReadRsp = 2849802062,
AIHelpUnreadReq = 2909093054,
AIHelpUnreadRsp = 2909094887,
ActTriggerGiftNtf = 3003864530,
PVPRankHeroesReq = 3013273736,
PVPRankHeroesRsp = 3013275569,
@ -431,6 +435,8 @@ local ProtoMsgType = {
MailExtractRsp = "MailExtractRsp",
MailReadReq = "MailReadReq",
MailReadRsp = "MailReadRsp",
AIHelpUnreadReq = "AIHelpUnreadReq",
AIHelpUnreadRsp = "AIHelpUnreadRsp",
ActTriggerGiftNtf = "ActTriggerGiftNtf",
PVPRankHeroesReq = "PVPRankHeroesReq",
PVPRankHeroesRsp = "PVPRankHeroesRsp",

View File

@ -207,6 +207,15 @@ end
function BattleBaseUI:moveBattlefield(time)
end
function BattleBaseUI:initTouchCancel()
end
function BattleBaseUI:showTouchCancel()
end
function BattleBaseUI:hideTouchCancel()
end
--------------------------------end按需重写的方法--------------------------------
function BattleBaseUI:getBGMId()
@ -266,6 +275,7 @@ function BattleBaseUI:_display()
self:initCommonSkillDescTips()
self:initBossEnterAni()
self:initCounterAttack()
self:initTouchCancel()
end
function BattleBaseUI:_addListeners()

View File

@ -3,6 +3,7 @@ local BattleUI = class("BattleUI", BattleBaseUI)
local GRID_CELL = "app/ui/battle/cell/grid_cell"
local SELECT_SKILL_CELL = "app/ui/battle/cell/select_skill_cell"
local BATTLE_SELECT_SKILL_COMP = "app/ui/battle/battle_skill_select_comp"
local ELIMINATION_TOUCH_EVENT = GConst.ELIMINATION_TOUCH_EVENT
local DEFAULT_X = 10000
local BOARD_POS_UP = BF.Vector2(0, 47)
@ -244,6 +245,42 @@ function BattleUI:showTutorialFinger(posIdList)
self.showTutorialFingerSeq:SetLoops(-1)
end
function BattleUI:initTouchCancel()
local uiMap = self.root:genAllChildren()
local touchCancelNode = uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node"]
touchCancelNode:setVisible(false)
touchCancelNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_ELIMINATION_TOUCH_EVENT):AddTouchEventListener(function(eventType)
if eventType == ELIMINATION_TOUCH_EVENT.ENTER then -- 取消链接
self.battleController:clearGridSequence()
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_CANCEL)
DataManager.ChapterData:addLinkTouchCancelCount()
end
end)
local allImg = uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node.all_img"]
allImg:setVisible(false)
uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node.all_img.tips_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_13))
end
function BattleUI:showTouchCancel()
local uiMap = self.root:genAllChildren()
local touchCancelNode = uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node"]
touchCancelNode:setVisible(true)
-- 判断是否显示提示框
local allImg = uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node.all_img"]
if DataManager.ChapterData:getNeedShowTouchCancelTips() then
allImg:setVisible(true)
else
allImg:setVisible(false)
end
end
function BattleUI:hideTouchCancel()
local uiMap = self.root:genAllChildren()
local touchCancelNode = uiMap["battle_ui.bg_2.board_node.board_center_node.touch_cancel_node"]
touchCancelNode:setVisible(false)
end
--------------------------------end按需重写的方法--------------------------------
function BattleUI:getPrefabPath()

View File

@ -261,6 +261,22 @@ function BattleBaseData:removeGridSequence(posId)
return snapshot
end
function BattleBaseData:removeGridSequenceByIndex(index)
local count = #self.gridSequence
if count < index then
return
end
local snapshot
for i = count, index, -1 do
local info = table.remove(self.gridSequence, i)
self.gridSequenceMap[info.posId] = false
snapshot = info.snapshot
end
return snapshot
end
function BattleBaseData:getFirstSequenceSnapshot()
if not self.gridSequence[1] then
return

View File

@ -393,4 +393,29 @@ function ChapterData:getChapterMysteryBoxGotCount(chapterId)
return #self.data.chapterInfo[chapterId].mystery_box_idx
end
function ChapterData:getNeedShowTouchCancelTips()
if not self.linkTouchCancelCount then
self.linkTouchCancelCount = LocalData:getLinkTouchCancelCount()
self.linkTouchCancelHideCount = GFunc.getConstIntValue("canle_link_hide")
end
if self.linkTouchCancelCount >= self.linkTouchCancelHideCount then
return false
end
if not self.showTouchCancelChapter then
self.showTouchCancelChapter = GFunc.getConstIntValue("cancle_link_show")
end
return self:getChapterPassed(self.showTouchCancelChapter)
end
function ChapterData:addLinkTouchCancelCount()
self:getNeedShowTouchCancelTips()
local newCount = self.linkTouchCancelHideCount + 1
if self.linkTouchCancelCount < self.linkTouchCancelHideCount and newCount >= self.linkTouchCancelHideCount then
LocalData:setLinkTouchCancelCount(newCount)
end
self.linkTouchCancelCount = newCount
end
return ChapterData