merge
This commit is contained in:
commit
d0db7b388f
@ -10,6 +10,13 @@ local card = {
|
|||||||
["hp_6"]=150,
|
["hp_6"]=150,
|
||||||
["hp_7"]=160,
|
["hp_7"]=160,
|
||||||
["hp_8"]=170,
|
["hp_8"]=170,
|
||||||
|
["hp_9"]=180,
|
||||||
|
["hp_10"]=190,
|
||||||
|
["hp_11"]=200,
|
||||||
|
["hp_12"]=210,
|
||||||
|
["hp_13"]=220,
|
||||||
|
["hp_14"]=230,
|
||||||
|
["hp_15"]=240,
|
||||||
["atk_1"]=100,
|
["atk_1"]=100,
|
||||||
["atk_2"]=110,
|
["atk_2"]=110,
|
||||||
["atk_3"]=120,
|
["atk_3"]=120,
|
||||||
@ -17,7 +24,14 @@ local card = {
|
|||||||
["atk_5"]=140,
|
["atk_5"]=140,
|
||||||
["atk_6"]=150,
|
["atk_6"]=150,
|
||||||
["atk_7"]=160,
|
["atk_7"]=160,
|
||||||
["atk_8"]=170
|
["atk_8"]=170,
|
||||||
|
["atk_9"]=180,
|
||||||
|
["atk_10"]=190,
|
||||||
|
["atk_11"]=200,
|
||||||
|
["atk_12"]=210,
|
||||||
|
["atk_13"]=220,
|
||||||
|
["atk_14"]=230,
|
||||||
|
["atk_15"]=240
|
||||||
},
|
},
|
||||||
[2]={
|
[2]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
@ -30,6 +44,13 @@ local card = {
|
|||||||
["hp_6"]=150,
|
["hp_6"]=150,
|
||||||
["hp_7"]=160,
|
["hp_7"]=160,
|
||||||
["hp_8"]=170,
|
["hp_8"]=170,
|
||||||
|
["hp_9"]=180,
|
||||||
|
["hp_10"]=190,
|
||||||
|
["hp_11"]=200,
|
||||||
|
["hp_12"]=210,
|
||||||
|
["hp_13"]=220,
|
||||||
|
["hp_14"]=230,
|
||||||
|
["hp_15"]=240,
|
||||||
["atk_1"]=100,
|
["atk_1"]=100,
|
||||||
["atk_2"]=110,
|
["atk_2"]=110,
|
||||||
["atk_3"]=120,
|
["atk_3"]=120,
|
||||||
@ -37,7 +58,14 @@ local card = {
|
|||||||
["atk_5"]=140,
|
["atk_5"]=140,
|
||||||
["atk_6"]=150,
|
["atk_6"]=150,
|
||||||
["atk_7"]=160,
|
["atk_7"]=160,
|
||||||
["atk_8"]=170
|
["atk_8"]=170,
|
||||||
|
["atk_9"]=180,
|
||||||
|
["atk_10"]=190,
|
||||||
|
["atk_11"]=200,
|
||||||
|
["atk_12"]=210,
|
||||||
|
["atk_13"]=220,
|
||||||
|
["atk_14"]=230,
|
||||||
|
["atk_15"]=240
|
||||||
},
|
},
|
||||||
[3]={
|
[3]={
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
@ -50,6 +78,13 @@ local card = {
|
|||||||
["hp_6"]=150,
|
["hp_6"]=150,
|
||||||
["hp_7"]=160,
|
["hp_7"]=160,
|
||||||
["hp_8"]=170,
|
["hp_8"]=170,
|
||||||
|
["hp_9"]=180,
|
||||||
|
["hp_10"]=190,
|
||||||
|
["hp_11"]=200,
|
||||||
|
["hp_12"]=210,
|
||||||
|
["hp_13"]=220,
|
||||||
|
["hp_14"]=230,
|
||||||
|
["hp_15"]=240,
|
||||||
["atk_1"]=100,
|
["atk_1"]=100,
|
||||||
["atk_2"]=110,
|
["atk_2"]=110,
|
||||||
["atk_3"]=120,
|
["atk_3"]=120,
|
||||||
@ -57,7 +92,14 @@ local card = {
|
|||||||
["atk_5"]=140,
|
["atk_5"]=140,
|
||||||
["atk_6"]=150,
|
["atk_6"]=150,
|
||||||
["atk_7"]=160,
|
["atk_7"]=160,
|
||||||
["atk_8"]=170
|
["atk_8"]=170,
|
||||||
|
["atk_9"]=180,
|
||||||
|
["atk_10"]=190,
|
||||||
|
["atk_11"]=200,
|
||||||
|
["atk_12"]=210,
|
||||||
|
["atk_13"]=220,
|
||||||
|
["atk_14"]=230,
|
||||||
|
["atk_15"]=240
|
||||||
},
|
},
|
||||||
[4]={
|
[4]={
|
||||||
["position"]=5,
|
["position"]=5,
|
||||||
@ -70,6 +112,13 @@ local card = {
|
|||||||
["hp_6"]=150,
|
["hp_6"]=150,
|
||||||
["hp_7"]=160,
|
["hp_7"]=160,
|
||||||
["hp_8"]=170,
|
["hp_8"]=170,
|
||||||
|
["hp_9"]=180,
|
||||||
|
["hp_10"]=190,
|
||||||
|
["hp_11"]=200,
|
||||||
|
["hp_12"]=210,
|
||||||
|
["hp_13"]=220,
|
||||||
|
["hp_14"]=230,
|
||||||
|
["hp_15"]=240,
|
||||||
["atk_1"]=100,
|
["atk_1"]=100,
|
||||||
["atk_2"]=110,
|
["atk_2"]=110,
|
||||||
["atk_3"]=120,
|
["atk_3"]=120,
|
||||||
@ -77,7 +126,14 @@ local card = {
|
|||||||
["atk_5"]=140,
|
["atk_5"]=140,
|
||||||
["atk_6"]=150,
|
["atk_6"]=150,
|
||||||
["atk_7"]=160,
|
["atk_7"]=160,
|
||||||
["atk_8"]=170
|
["atk_8"]=170,
|
||||||
|
["atk_9"]=180,
|
||||||
|
["atk_10"]=190,
|
||||||
|
["atk_11"]=200,
|
||||||
|
["atk_12"]=210,
|
||||||
|
["atk_13"]=220,
|
||||||
|
["atk_14"]=230,
|
||||||
|
["atk_15"]=240
|
||||||
},
|
},
|
||||||
[5]={
|
[5]={
|
||||||
["position"]=1,
|
["position"]=1,
|
||||||
@ -90,6 +146,13 @@ local card = {
|
|||||||
["hp_6"]=150,
|
["hp_6"]=150,
|
||||||
["hp_7"]=160,
|
["hp_7"]=160,
|
||||||
["hp_8"]=170,
|
["hp_8"]=170,
|
||||||
|
["hp_9"]=180,
|
||||||
|
["hp_10"]=190,
|
||||||
|
["hp_11"]=200,
|
||||||
|
["hp_12"]=210,
|
||||||
|
["hp_13"]=220,
|
||||||
|
["hp_14"]=230,
|
||||||
|
["hp_15"]=240,
|
||||||
["atk_1"]=100,
|
["atk_1"]=100,
|
||||||
["atk_2"]=110,
|
["atk_2"]=110,
|
||||||
["atk_3"]=120,
|
["atk_3"]=120,
|
||||||
@ -97,7 +160,14 @@ local card = {
|
|||||||
["atk_5"]=140,
|
["atk_5"]=140,
|
||||||
["atk_6"]=150,
|
["atk_6"]=150,
|
||||||
["atk_7"]=160,
|
["atk_7"]=160,
|
||||||
["atk_8"]=170
|
["atk_8"]=170,
|
||||||
|
["atk_9"]=180,
|
||||||
|
["atk_10"]=190,
|
||||||
|
["atk_11"]=200,
|
||||||
|
["atk_12"]=210,
|
||||||
|
["atk_13"]=220,
|
||||||
|
["atk_14"]=230,
|
||||||
|
["atk_15"]=240
|
||||||
},
|
},
|
||||||
[6]={
|
[6]={
|
||||||
["position"]=3,
|
["position"]=3,
|
||||||
@ -110,6 +180,13 @@ local card = {
|
|||||||
["hp_6"]=225,
|
["hp_6"]=225,
|
||||||
["hp_7"]=240,
|
["hp_7"]=240,
|
||||||
["hp_8"]=255,
|
["hp_8"]=255,
|
||||||
|
["hp_9"]=270,
|
||||||
|
["hp_10"]=285,
|
||||||
|
["hp_11"]=300,
|
||||||
|
["hp_12"]=315,
|
||||||
|
["hp_13"]=330,
|
||||||
|
["hp_14"]=345,
|
||||||
|
["hp_15"]=360,
|
||||||
["atk_1"]=150,
|
["atk_1"]=150,
|
||||||
["atk_2"]=165,
|
["atk_2"]=165,
|
||||||
["atk_3"]=180,
|
["atk_3"]=180,
|
||||||
@ -117,7 +194,14 @@ local card = {
|
|||||||
["atk_5"]=210,
|
["atk_5"]=210,
|
||||||
["atk_6"]=225,
|
["atk_6"]=225,
|
||||||
["atk_7"]=240,
|
["atk_7"]=240,
|
||||||
["atk_8"]=255
|
["atk_8"]=255,
|
||||||
|
["atk_9"]=270,
|
||||||
|
["atk_10"]=285,
|
||||||
|
["atk_11"]=300,
|
||||||
|
["atk_12"]=315,
|
||||||
|
["atk_13"]=330,
|
||||||
|
["atk_14"]=345,
|
||||||
|
["atk_15"]=360
|
||||||
},
|
},
|
||||||
[7]={
|
[7]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
@ -130,6 +214,13 @@ local card = {
|
|||||||
["hp_6"]=225,
|
["hp_6"]=225,
|
||||||
["hp_7"]=240,
|
["hp_7"]=240,
|
||||||
["hp_8"]=255,
|
["hp_8"]=255,
|
||||||
|
["hp_9"]=270,
|
||||||
|
["hp_10"]=285,
|
||||||
|
["hp_11"]=300,
|
||||||
|
["hp_12"]=315,
|
||||||
|
["hp_13"]=330,
|
||||||
|
["hp_14"]=345,
|
||||||
|
["hp_15"]=360,
|
||||||
["atk_1"]=150,
|
["atk_1"]=150,
|
||||||
["atk_2"]=165,
|
["atk_2"]=165,
|
||||||
["atk_3"]=180,
|
["atk_3"]=180,
|
||||||
@ -137,7 +228,14 @@ local card = {
|
|||||||
["atk_5"]=210,
|
["atk_5"]=210,
|
||||||
["atk_6"]=225,
|
["atk_6"]=225,
|
||||||
["atk_7"]=240,
|
["atk_7"]=240,
|
||||||
["atk_8"]=255
|
["atk_8"]=255,
|
||||||
|
["atk_9"]=270,
|
||||||
|
["atk_10"]=285,
|
||||||
|
["atk_11"]=300,
|
||||||
|
["atk_12"]=315,
|
||||||
|
["atk_13"]=330,
|
||||||
|
["atk_14"]=345,
|
||||||
|
["atk_15"]=360
|
||||||
},
|
},
|
||||||
[8]={
|
[8]={
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
@ -150,6 +248,13 @@ local card = {
|
|||||||
["hp_6"]=225,
|
["hp_6"]=225,
|
||||||
["hp_7"]=240,
|
["hp_7"]=240,
|
||||||
["hp_8"]=255,
|
["hp_8"]=255,
|
||||||
|
["hp_9"]=270,
|
||||||
|
["hp_10"]=285,
|
||||||
|
["hp_11"]=300,
|
||||||
|
["hp_12"]=315,
|
||||||
|
["hp_13"]=330,
|
||||||
|
["hp_14"]=345,
|
||||||
|
["hp_15"]=360,
|
||||||
["atk_1"]=150,
|
["atk_1"]=150,
|
||||||
["atk_2"]=165,
|
["atk_2"]=165,
|
||||||
["atk_3"]=180,
|
["atk_3"]=180,
|
||||||
@ -157,7 +262,14 @@ local card = {
|
|||||||
["atk_5"]=210,
|
["atk_5"]=210,
|
||||||
["atk_6"]=225,
|
["atk_6"]=225,
|
||||||
["atk_7"]=240,
|
["atk_7"]=240,
|
||||||
["atk_8"]=255
|
["atk_8"]=255,
|
||||||
|
["atk_9"]=270,
|
||||||
|
["atk_10"]=285,
|
||||||
|
["atk_11"]=300,
|
||||||
|
["atk_12"]=315,
|
||||||
|
["atk_13"]=330,
|
||||||
|
["atk_14"]=345,
|
||||||
|
["atk_15"]=360
|
||||||
},
|
},
|
||||||
[9]={
|
[9]={
|
||||||
["position"]=5,
|
["position"]=5,
|
||||||
@ -170,6 +282,13 @@ local card = {
|
|||||||
["hp_6"]=225,
|
["hp_6"]=225,
|
||||||
["hp_7"]=240,
|
["hp_7"]=240,
|
||||||
["hp_8"]=255,
|
["hp_8"]=255,
|
||||||
|
["hp_9"]=270,
|
||||||
|
["hp_10"]=285,
|
||||||
|
["hp_11"]=300,
|
||||||
|
["hp_12"]=315,
|
||||||
|
["hp_13"]=330,
|
||||||
|
["hp_14"]=345,
|
||||||
|
["hp_15"]=360,
|
||||||
["atk_1"]=150,
|
["atk_1"]=150,
|
||||||
["atk_2"]=165,
|
["atk_2"]=165,
|
||||||
["atk_3"]=180,
|
["atk_3"]=180,
|
||||||
@ -177,7 +296,14 @@ local card = {
|
|||||||
["atk_5"]=210,
|
["atk_5"]=210,
|
||||||
["atk_6"]=225,
|
["atk_6"]=225,
|
||||||
["atk_7"]=240,
|
["atk_7"]=240,
|
||||||
["atk_8"]=255
|
["atk_8"]=255,
|
||||||
|
["atk_9"]=270,
|
||||||
|
["atk_10"]=285,
|
||||||
|
["atk_11"]=300,
|
||||||
|
["atk_12"]=315,
|
||||||
|
["atk_13"]=330,
|
||||||
|
["atk_14"]=345,
|
||||||
|
["atk_15"]=360
|
||||||
},
|
},
|
||||||
[10]={
|
[10]={
|
||||||
["position"]=1,
|
["position"]=1,
|
||||||
@ -190,6 +316,13 @@ local card = {
|
|||||||
["hp_6"]=225,
|
["hp_6"]=225,
|
||||||
["hp_7"]=240,
|
["hp_7"]=240,
|
||||||
["hp_8"]=255,
|
["hp_8"]=255,
|
||||||
|
["hp_9"]=270,
|
||||||
|
["hp_10"]=285,
|
||||||
|
["hp_11"]=300,
|
||||||
|
["hp_12"]=315,
|
||||||
|
["hp_13"]=330,
|
||||||
|
["hp_14"]=345,
|
||||||
|
["hp_15"]=360,
|
||||||
["atk_1"]=150,
|
["atk_1"]=150,
|
||||||
["atk_2"]=165,
|
["atk_2"]=165,
|
||||||
["atk_3"]=180,
|
["atk_3"]=180,
|
||||||
@ -197,7 +330,14 @@ local card = {
|
|||||||
["atk_5"]=210,
|
["atk_5"]=210,
|
||||||
["atk_6"]=225,
|
["atk_6"]=225,
|
||||||
["atk_7"]=240,
|
["atk_7"]=240,
|
||||||
["atk_8"]=255
|
["atk_8"]=255,
|
||||||
|
["atk_9"]=270,
|
||||||
|
["atk_10"]=285,
|
||||||
|
["atk_11"]=300,
|
||||||
|
["atk_12"]=315,
|
||||||
|
["atk_13"]=330,
|
||||||
|
["atk_14"]=345,
|
||||||
|
["atk_15"]=360
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local config = {
|
local config = {
|
||||||
|
|||||||
@ -137,6 +137,10 @@ local card_level = {
|
|||||||
2500,
|
2500,
|
||||||
10000
|
10000
|
||||||
},
|
},
|
||||||
|
["cost_3"]={
|
||||||
|
1500,
|
||||||
|
10000
|
||||||
|
},
|
||||||
["cost_4"]={
|
["cost_4"]={
|
||||||
320,
|
320,
|
||||||
10000
|
10000
|
||||||
@ -147,6 +151,10 @@ local card_level = {
|
|||||||
3000,
|
3000,
|
||||||
10000
|
10000
|
||||||
},
|
},
|
||||||
|
["cost_3"]={
|
||||||
|
2000,
|
||||||
|
10000
|
||||||
|
},
|
||||||
["cost_4"]={
|
["cost_4"]={
|
||||||
640,
|
640,
|
||||||
10000
|
10000
|
||||||
@ -157,6 +165,10 @@ local card_level = {
|
|||||||
4000,
|
4000,
|
||||||
10000
|
10000
|
||||||
},
|
},
|
||||||
|
["cost_3"]={
|
||||||
|
3000,
|
||||||
|
10000
|
||||||
|
},
|
||||||
["cost_4"]={
|
["cost_4"]={
|
||||||
1000,
|
1000,
|
||||||
10000
|
10000
|
||||||
@ -167,6 +179,10 @@ local card_level = {
|
|||||||
5000,
|
5000,
|
||||||
10000
|
10000
|
||||||
},
|
},
|
||||||
|
["cost_3"]={
|
||||||
|
4000,
|
||||||
|
10000
|
||||||
|
},
|
||||||
["cost_4"]={
|
["cost_4"]={
|
||||||
1500,
|
1500,
|
||||||
10000
|
10000
|
||||||
|
|||||||
9
lua/app/config/const.lua
Normal file
9
lua/app/config/const.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
local const = {
|
||||||
|
["element_combo"]={
|
||||||
|
["value"]=2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local config = {
|
||||||
|
data=const,count=1
|
||||||
|
}
|
||||||
|
return config
|
||||||
10
lua/app/config/const.lua.meta
Normal file
10
lua/app/config/const.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6d8697f998fe2b04798c1c18a2b6eb68
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
7
lua/app/config/skill_box.lua
Normal file
7
lua/app/config/skill_box.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
local skill_box = {
|
||||||
|
|
||||||
|
}
|
||||||
|
local config = {
|
||||||
|
data=skill_box,count=0
|
||||||
|
}
|
||||||
|
return config
|
||||||
10
lua/app/config/skill_box.lua.meta
Normal file
10
lua/app/config/skill_box.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b0e5e92c84e063f43b56758577128e37
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
69
lua/app/config/skill_card.lua
Normal file
69
lua/app/config/skill_card.lua
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
local skill_card = {
|
||||||
|
[10]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[11]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[20]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[21]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[22]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[30]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[40]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[41]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[50]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[51]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[60]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[61]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[70]={
|
||||||
|
["method"]=1
|
||||||
|
},
|
||||||
|
[71]={
|
||||||
|
["method"]=1
|
||||||
|
},
|
||||||
|
[80]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[81]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[90]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[91]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[100]={
|
||||||
|
["method"]=2
|
||||||
|
},
|
||||||
|
[101]={
|
||||||
|
|
||||||
|
},
|
||||||
|
[102]={
|
||||||
|
["method"]=2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local config = {
|
||||||
|
data=skill_card,count=21
|
||||||
|
}
|
||||||
|
return config
|
||||||
10
lua/app/config/skill_card.lua.meta
Normal file
10
lua/app/config/skill_card.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: af9637d329b3bfa4cb0824f4e5a51bae
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
7
lua/app/config/skill_rogue.lua
Normal file
7
lua/app/config/skill_rogue.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
local skill_rogue = {
|
||||||
|
|
||||||
|
}
|
||||||
|
local config = {
|
||||||
|
data=skill_rogue,count=0
|
||||||
|
}
|
||||||
|
return config
|
||||||
10
lua/app/config/skill_rogue.lua.meta
Normal file
10
lua/app/config/skill_rogue.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 058cd600efafbe74c8af712668807a8d
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
835
lua/app/config/stage.lua
Normal file
835
lua/app/config/stage.lua
Normal file
@ -0,0 +1,835 @@
|
|||||||
|
local stage = {
|
||||||
|
[1]={
|
||||||
|
["board"]={
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["control_element"]={
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[2]={
|
||||||
|
["board"]={
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["control_element"]={
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
1,
|
||||||
|
4,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[3]={
|
||||||
|
["board"]={
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["control_element"]={
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[4]={
|
||||||
|
["board"]={
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["control_element"]={
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local config = {
|
||||||
|
data=stage,count=4
|
||||||
|
}
|
||||||
|
return config
|
||||||
10
lua/app/config/stage.lua.meta
Normal file
10
lua/app/config/stage.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c74f4c0846956944c8e8c94b47d5ee1a
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -9,9 +9,13 @@ local struct = {
|
|||||||
["parameter2"]="id:int",
|
["parameter2"]="id:int",
|
||||||
["parameter3"]="num:int",
|
["parameter3"]="num:int",
|
||||||
["parameter4"]="weight:int"
|
["parameter4"]="weight:int"
|
||||||
|
},
|
||||||
|
["boardrange"]={
|
||||||
|
["parameter1"]="type:int",
|
||||||
|
["parameter2"]="range:int"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local config = {
|
local config = {
|
||||||
data=struct,count=2
|
data=struct,count=3
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
@ -2,10 +2,21 @@ local BattleConst = {}
|
|||||||
|
|
||||||
BattleConst.ROW_COUNT = 7
|
BattleConst.ROW_COUNT = 7
|
||||||
BattleConst.COLUMN_COUNT = 7
|
BattleConst.COLUMN_COUNT = 7
|
||||||
|
BattleConst.HALF_ROW_COUNT = 4 -- 计算偏移 math.ceil(ROW_COUNT / 2)
|
||||||
|
BattleConst.HALF_COLUMN_COUNT = 4 -- 计算偏移 math.ceil(COLUMN_COUNT / 2)
|
||||||
BattleConst.ELIMINATION_MIN_COUNT = 2
|
BattleConst.ELIMINATION_MIN_COUNT = 2
|
||||||
BattleConst.GRID_STEP_H = 97
|
BattleConst.GRID_STEP_H = 97
|
||||||
BattleConst.ROW_STEP = 10
|
BattleConst.ROW_STEP = 10
|
||||||
|
BattleConst.ONE_STEP_TIME = 0.2
|
||||||
|
BattleConst.ELEMENT_TYPE_COUNT = 5
|
||||||
|
BattleConst.ELEMENT_WIGHT = 100
|
||||||
|
BattleConst.MAX_ELEMENT_WIGHT = 500
|
||||||
|
|
||||||
|
BattleConst.BATTLE_TYPE = {
|
||||||
|
STAGE = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
---- 格子类型
|
||||||
BattleConst.GRID_TYPE = {
|
BattleConst.GRID_TYPE = {
|
||||||
EMPTY = 0,
|
EMPTY = 0,
|
||||||
OBSTACLE = 1,
|
OBSTACLE = 1,
|
||||||
@ -15,6 +26,28 @@ BattleConst.GRID_TYPE = {
|
|||||||
ICE = 5,
|
ICE = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---- 周围格子消除一次后会变成什么格子
|
||||||
|
BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT = {
|
||||||
|
[BattleConst.GRID_TYPE.SNOW_BOX] = {BattleConst.GRID_TYPE.EMPTY},
|
||||||
|
[BattleConst.GRID_TYPE.SOLID_SNOW] = {BattleConst.GRID_TYPE.SNOW_BOX},
|
||||||
|
[BattleConst.GRID_TYPE.ICE] = {BattleConst.GRID_TYPE.EMPTY},
|
||||||
|
}
|
||||||
|
|
||||||
|
---- 不可下落的格子类型
|
||||||
|
BattleConst.CANT_FALL_GRID_TYPE = {
|
||||||
|
[BattleConst.GRID_TYPE.VINES] = true,
|
||||||
|
[BattleConst.GRID_TYPE.ICE] = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
---- 不可链接的格子类型
|
||||||
|
BattleConst.CANT_LINK_GRID_TYPE = {
|
||||||
|
[BattleConst.GRID_TYPE.OBSTACLE] = true,
|
||||||
|
[BattleConst.GRID_TYPE.SNOW_BOX] = true,
|
||||||
|
[BattleConst.GRID_TYPE.SOLID_SNOW] = true,
|
||||||
|
[BattleConst.GRID_TYPE.ICE] = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
---- 元素类型
|
||||||
BattleConst.ELEMENT_TYPE = {
|
BattleConst.ELEMENT_TYPE = {
|
||||||
RED = 1,
|
RED = 1,
|
||||||
YELLOW = 2,
|
YELLOW = 2,
|
||||||
@ -36,55 +69,55 @@ BattleConst.RC_2_POS_ID = {}
|
|||||||
|
|
||||||
---- 格子位置
|
---- 格子位置
|
||||||
BattleConst.GRID_POS = {
|
BattleConst.GRID_POS = {
|
||||||
[11] = {x = 0, y = 0},
|
[11] = {x = -291, y = 291},
|
||||||
[12] = {x = 97, y = 0},
|
[12] = {x = -194, y = 291},
|
||||||
[13] = {x = 194, y = 0},
|
[13] = {x = -97, y = 291},
|
||||||
[14] = {x = 291, y = 0},
|
[14] = {x = 0, y = 291},
|
||||||
[15] = {x = 388, y = 0},
|
[15] = {x = 97, y = 291},
|
||||||
[16] = {x = 485, y = 0},
|
[16] = {x = 194, y = 291},
|
||||||
[17] = {x = 582, y = 0},
|
[17] = {x = 291, y = 291},
|
||||||
[21] = {x = 0, y = -97},
|
[21] = {x = -291, y = 194},
|
||||||
[22] = {x = 97, y = -97},
|
[22] = {x = -194, y = 194},
|
||||||
[23] = {x = 194, y = -97},
|
[23] = {x = -97, y = 194},
|
||||||
[24] = {x = 291, y = -97},
|
[24] = {x = 0, y = 194},
|
||||||
[25] = {x = 388, y = -97},
|
[25] = {x = 97, y = 194},
|
||||||
[26] = {x = 485, y = -97},
|
[26] = {x = 194, y = 194},
|
||||||
[27] = {x = 582, y = -97},
|
[27] = {x = 291, y = 194},
|
||||||
[31] = {x = 0, y = -194},
|
[31] = {x = -291, y = 97},
|
||||||
[32] = {x = 97, y = -194},
|
[32] = {x = -194, y = 97},
|
||||||
[33] = {x = 194, y = -194},
|
[33] = {x = -97, y = 97},
|
||||||
[34] = {x = 291, y = -194},
|
[34] = {x = 0, y = 97},
|
||||||
[35] = {x = 388, y = -194},
|
[35] = {x = 97, y = 97},
|
||||||
[36] = {x = 485, y = -194},
|
[36] = {x = 194, y = 97},
|
||||||
[37] = {x = 582, y = -194},
|
[37] = {x = 291, y = 97},
|
||||||
[41] = {x = 0, y = -291},
|
[41] = {x = -291, y = 0},
|
||||||
[42] = {x = 97, y = -291},
|
[42] = {x = -194, y = 0},
|
||||||
[43] = {x = 194, y = -291},
|
[43] = {x = -97, y = 0},
|
||||||
[44] = {x = 291, y = -291},
|
[44] = {x = 0, y = 0},
|
||||||
[45] = {x = 388, y = -291},
|
[45] = {x = 97, y = 0},
|
||||||
[46] = {x = 485, y = -291},
|
[46] = {x = 194, y = 0},
|
||||||
[47] = {x = 582, y = -291},
|
[47] = {x = 291, y = 0},
|
||||||
[51] = {x = 0, y = -388},
|
[51] = {x = -291, y = -97},
|
||||||
[52] = {x = 97, y = -388},
|
[52] = {x = -194, y = -97},
|
||||||
[53] = {x = 194, y = -388},
|
[53] = {x = -97, y = -97},
|
||||||
[54] = {x = 291, y = -388},
|
[54] = {x = 0, y = -97},
|
||||||
[55] = {x = 388, y = -388},
|
[55] = {x = 97, y = -97},
|
||||||
[56] = {x = 485, y = -388},
|
[56] = {x = 194, y = -97},
|
||||||
[57] = {x = 582, y = -388},
|
[57] = {x = 291, y = -97},
|
||||||
[61] = {x = 0, y = -485},
|
[61] = {x = -291, y = -194},
|
||||||
[62] = {x = 97, y = -485},
|
[62] = {x = -194, y = -194},
|
||||||
[63] = {x = 194, y = -485},
|
[63] = {x = -97, y = -194},
|
||||||
[64] = {x = 291, y = -485},
|
[64] = {x = 0, y = -194},
|
||||||
[65] = {x = 388, y = -485},
|
[65] = {x = 97, y = -194},
|
||||||
[66] = {x = 485, y = -485},
|
[66] = {x = 194, y = -194},
|
||||||
[67] = {x = 582, y = -485},
|
[67] = {x = 291, y = -194},
|
||||||
[71] = {x = 0, y = -582},
|
[71] = {x = -291, y = -291},
|
||||||
[72] = {x = 97, y = -582},
|
[72] = {x = -194, y = -291},
|
||||||
[73] = {x = 194, y = -582},
|
[73] = {x = -97, y = -291},
|
||||||
[74] = {x = 291, y = -582},
|
[74] = {x = 0, y = -291},
|
||||||
[75] = {x = 388, y = -582},
|
[75] = {x = 97, y = -291},
|
||||||
[76] = {x = 485, y = -582},
|
[76] = {x = 194, y = -291},
|
||||||
[77] = {x = 582, y = -582},
|
[77] = {x = 291, y = -291},
|
||||||
}
|
}
|
||||||
|
|
||||||
---- 每个格子外围一格距离的格子
|
---- 每个格子外围一格距离的格子
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
|
|
||||||
local BattleManager = class("BattleManager", BaseModule)
|
local BattleManager = class("BattleManager", BaseModule)
|
||||||
local BattleConst = GConst.BattleConst
|
local BattleConst = GConst.BattleConst
|
||||||
|
|
||||||
local BATTLE_CONTROLLER_BASE = "app/module/battle/controller/battle_controller"
|
local BATTLE_CONTROLLER_BASE = "app/module/battle/controller/battle_controller"
|
||||||
local BATTLE_CONTROLLER = {}
|
|
||||||
|
local BATTLE_CONTROLLER = {
|
||||||
|
[BattleConst.BATTLE_TYPE.STAGE] = "app/module/battle/controller/battle_controller_stage"
|
||||||
|
}
|
||||||
|
|
||||||
function BattleManager:getPosInfo(posId)
|
function BattleManager:getPosInfo(posId)
|
||||||
local posInfo = GConst.BattleConst.GRID_POS[posId]
|
local posInfo = GConst.BattleConst.GRID_POS[posId]
|
||||||
@ -10,16 +14,11 @@ function BattleManager:getPosInfo(posId)
|
|||||||
local r = self:getPosRC(posId).r
|
local r = self:getPosRC(posId).r
|
||||||
local c = self:getPosRC(posId).c
|
local c = self:getPosRC(posId).c
|
||||||
|
|
||||||
local x, y
|
local offsetC = c - BattleConst.HALF_COLUMN_COUNT
|
||||||
x = (c - 1) * BattleConst.GRID_STEP_H
|
local offsetR = BattleConst.HALF_ROW_COUNT - r
|
||||||
if r > 0 then
|
local info = {x = offsetC * BattleConst.GRID_STEP_H, y = offsetR * BattleConst.GRID_STEP_H}
|
||||||
y = (r - 1) * BattleConst.GRID_STEP_H
|
|
||||||
else
|
|
||||||
y = r * BattleConst.GRID_STEP_H
|
|
||||||
end
|
|
||||||
y = - y
|
|
||||||
|
|
||||||
GConst.BattleConst.GRID_POS[posId] = {x = x, y = y}
|
GConst.BattleConst.GRID_POS[posId] = info
|
||||||
posInfo = GConst.BattleConst.GRID_POS[posId]
|
posInfo = GConst.BattleConst.GRID_POS[posId]
|
||||||
end
|
end
|
||||||
return posInfo
|
return posInfo
|
||||||
@ -28,7 +27,7 @@ end
|
|||||||
function BattleManager:getElementIcon(elementType)
|
function BattleManager:getElementIcon(elementType)
|
||||||
local icon = GConst.BattleConst.ELEMENT_ICON[elementType]
|
local icon = GConst.BattleConst.ELEMENT_ICON[elementType]
|
||||||
if not icon then
|
if not icon then
|
||||||
return GConst.ATLAS_PATH.COMMON, "common_algha"
|
return GConst.ATLAS_PATH.COMMON, "common_alpha"
|
||||||
end
|
end
|
||||||
return GConst.ATLAS_PATH.BATTLE, icon
|
return GConst.ATLAS_PATH.BATTLE, icon
|
||||||
end
|
end
|
||||||
@ -36,7 +35,7 @@ end
|
|||||||
function BattleManager:getGridTypeIcon(elementType)
|
function BattleManager:getGridTypeIcon(elementType)
|
||||||
local icon = GConst.BattleConst.ELEMENT_ICON[elementType]
|
local icon = GConst.BattleConst.ELEMENT_ICON[elementType]
|
||||||
if not icon then
|
if not icon then
|
||||||
return GConst.ATLAS_PATH.COMMON, "common_algha"
|
return GConst.ATLAS_PATH.COMMON, "common_alpha"
|
||||||
end
|
end
|
||||||
return GConst.ATLAS_PATH.BATTLE, icon
|
return GConst.ATLAS_PATH.BATTLE, icon
|
||||||
end
|
end
|
||||||
@ -48,9 +47,10 @@ function BattleManager:getPosId(row, column)
|
|||||||
if not BattleConst.RC_2_POS_ID[row][column] then
|
if not BattleConst.RC_2_POS_ID[row][column] then
|
||||||
local posId
|
local posId
|
||||||
local rowValue = row * BattleConst.ROW_STEP
|
local rowValue = row * BattleConst.ROW_STEP
|
||||||
if rowValue > 0 then
|
if rowValue >= 0 then
|
||||||
posId = rowValue + column
|
posId = rowValue + column
|
||||||
else
|
else
|
||||||
|
rowValue = rowValue + BattleConst.ROW_STEP
|
||||||
posId = rowValue - column
|
posId = rowValue - column
|
||||||
end
|
end
|
||||||
BattleConst.RC_2_POS_ID[row][column] = posId
|
BattleConst.RC_2_POS_ID[row][column] = posId
|
||||||
@ -58,13 +58,8 @@ function BattleManager:getPosId(row, column)
|
|||||||
return BattleConst.RC_2_POS_ID[row][column]
|
return BattleConst.RC_2_POS_ID[row][column]
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:getLastRowPosId(row, column)
|
function BattleManager:getFirstLineLastRowPosId(row, column)
|
||||||
return self:getPosId(row - 1, column)
|
return self:getPosId(1 - row, column)
|
||||||
end
|
|
||||||
|
|
||||||
function BattleManager:getLastRowPosIdByPosId(posId)
|
|
||||||
local rc = self:getPosRC(posId)
|
|
||||||
return self:getPosId(rc.r - 1, rc.c)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:getPosRC(posId)
|
function BattleManager:getPosRC(posId)
|
||||||
@ -82,16 +77,16 @@ function BattleManager:getPosRC(posId)
|
|||||||
return BattleConst.POS_ID_2_RC[posId]
|
return BattleConst.POS_ID_2_RC[posId]
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:playBattle(params, returnFunc)
|
function BattleManager:playBattle(params, battleType, returnFunc)
|
||||||
if self.battleController then -- 同一时间只能有一场战斗
|
if self.battleController then -- 同一时间只能有一场战斗
|
||||||
self:clear()
|
self:clear()
|
||||||
end
|
end
|
||||||
self.returnFunc = returnFunc
|
self.returnFunc = returnFunc
|
||||||
UIManager:stopCurrentBGM()
|
UIManager:stopCurrentBGM()
|
||||||
self:_play(params)
|
self:_play(params, battleType)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:_play(params)
|
function BattleManager:_play(params, battleType)
|
||||||
local controllerPath = BATTLE_CONTROLLER[battleType] or BATTLE_CONTROLLER_BASE
|
local controllerPath = BATTLE_CONTROLLER[battleType] or BATTLE_CONTROLLER_BASE
|
||||||
self.battleController = require(controllerPath):create()
|
self.battleController = require(controllerPath):create()
|
||||||
self.battleController:init(params)
|
self.battleController:init(params)
|
||||||
|
|||||||
@ -3,20 +3,37 @@ local BattleController = class("BattleController")
|
|||||||
local ELIMINATION_TOUCH_EVENT = GConst.ELIMINATION_TOUCH_EVENT
|
local ELIMINATION_TOUCH_EVENT = GConst.ELIMINATION_TOUCH_EVENT
|
||||||
local BattleConst = GConst.BattleConst
|
local BattleConst = GConst.BattleConst
|
||||||
|
|
||||||
|
-- *************各个子模块的战斗需要重写的方法 START*************
|
||||||
|
function BattleController:getInitBoard()
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleController:getFixedRandomGrid()
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
-- 战斗对应的ui
|
-- 战斗对应的ui
|
||||||
function BattleController:getBattleUIPath()
|
function BattleController:getBattleUIPath()
|
||||||
return "app/ui/battle/battle_ui"
|
return "app/ui/battle/battle_ui"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 战斗结束
|
||||||
|
function BattleController:controllBattleEnd()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 不同模块的战斗需要初始化的东西
|
||||||
|
function BattleController:initOther()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- *************各个子模块的战斗需要重写的方法 START*************
|
||||||
|
|
||||||
function BattleController:ctor()
|
function BattleController:ctor()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:init(params)
|
function BattleController:init(params)
|
||||||
params = params or {}
|
params = params or {}
|
||||||
self.initGridList = params.initGridList or {}
|
DataManager.BattleData:init(self:getInitBoard())
|
||||||
self.randomGridList = params.randomGridList or {}
|
|
||||||
DataManager.BattleData:init()
|
|
||||||
|
|
||||||
UIManager:closeAllUI()
|
UIManager:closeAllUI()
|
||||||
self.battleUI = UIManager:showUI(self:getBattleUIPath())
|
self.battleUI = UIManager:showUI(self:getBattleUIPath())
|
||||||
@ -75,196 +92,168 @@ function BattleController:onTouchEvent(eventType, posId)
|
|||||||
table.insert(cellList, entity:getCell())
|
table.insert(cellList, entity:getCell())
|
||||||
end
|
end
|
||||||
self.battleUI:eliminationAni(cellList, function()
|
self.battleUI:eliminationAni(cellList, function()
|
||||||
for _, posId in ipairs(sequence) do
|
self:onEliminationAniOver()
|
||||||
local entity = DataManager.BattleData:getGridEntity(posId)
|
|
||||||
entity:setIsIdle(true)
|
|
||||||
end
|
|
||||||
self:fillBoard()
|
|
||||||
DataManager.BattleData:clearGridSequence()
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleController:onEliminationAniOver()
|
||||||
|
local sequence = DataManager.BattleData:getGridSequence()
|
||||||
|
local count = #sequence
|
||||||
|
if count < BattleConst.ELIMINATION_MIN_COUNT then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local boomGridIds = {}
|
||||||
|
local eliminationPosIds = {}
|
||||||
|
for _, posId in ipairs(sequence) do
|
||||||
|
local outline = BattleConst.GRID_OUT_LINE_POS_ID[posId]
|
||||||
|
for aroundPosId, _ in pairs(outline) do
|
||||||
|
boomGridIds[aroundPosId] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
|
entity:setIsIdle(true)
|
||||||
|
eliminationPosIds[posId] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
for posId, status in pairs(boomGridIds) do
|
||||||
|
if not eliminationPosIds[posId] then
|
||||||
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
|
if entity then
|
||||||
|
entity:addAroundEliminationCount()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
DataManager.BattleData:clearGridSequence()
|
||||||
|
|
||||||
|
self:fillBoard()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleController:fillBoard()
|
function BattleController:fillBoard()
|
||||||
-- todo临时暴力求解
|
-- todo临时暴力求解
|
||||||
local pathMap = {}
|
local pathMap = {}
|
||||||
local columnCount = {}
|
local columnCount = {}
|
||||||
|
|
||||||
for c = 1, BattleConst.COLUMN_COUNT do
|
for c = 1, BattleConst.COLUMN_COUNT do
|
||||||
for r = BattleConst.ROW_COUNT, 1, -1 do
|
for r = BattleConst.ROW_COUNT, 1, -1 do
|
||||||
local posId = ModuleManager.BattleManager:getPosId(r, c)
|
local posId = ModuleManager.BattleManager:getPosId(r, c)
|
||||||
local entity = DataManager.BattleData:getGridEntity(posId)
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
if entity:getIsIdle() then
|
if entity:getIsIdle() then
|
||||||
local pathList = {}
|
self:fillThisPos(posId, columnCount)
|
||||||
local targetPosId = self:verticalFall(posId, pathList, columnCount)
|
|
||||||
if targetPosId then
|
|
||||||
Logger.logHighlight(targetPosId)
|
|
||||||
|
|
||||||
local targetEntity = DataManager.BattleData:getGridEntity(targetPosId)
|
|
||||||
local pathInfoList = {}
|
|
||||||
local count = #pathList
|
|
||||||
for i = count, 1, -1 do
|
|
||||||
table.insert(pathInfoList, pathList[i])
|
|
||||||
end
|
|
||||||
pathMap[targetPosId] = {entity = targetEntity, pathInfoList = pathInfoList}
|
|
||||||
DataManager.BattleData:exchangeGridEntities(posId, targetPosId)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- for c = 1, BattleConst.COLUMN_COUNT do
|
for c = 1, BattleConst.COLUMN_COUNT do
|
||||||
-- for r = BattleConst.ROW_COUNT, 1, -1 do
|
for r = BattleConst.ROW_COUNT, 1, -1 do
|
||||||
-- local posId = ModuleManager.BattleManager:getPosId(r, c)
|
local posId = ModuleManager.BattleManager:getPosId(r, c)
|
||||||
-- local entity = DataManager.BattleData:getGridEntity(posId)
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
-- if entity:getIsIdle() then
|
if #entity:getPath() > 0 then
|
||||||
|
pathMap[posId] = entity:getPath()
|
||||||
-- end
|
entity:clearPath()
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.battleUI:fallGrid(pathMap)
|
self.battleUI:fallGrid(pathMap)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:verticalFall(startPostId, pathList, columnCount)
|
---- 从一个点直接遍历所有相关的路径
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(startPostId)
|
function BattleController:fillThisPos(posId, columnCount)
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
local newStartPosId = ModuleManager.BattleManager:getLastRowPosIdByPosId(startPostId)
|
if not entity or not entity:getIsIdle() then
|
||||||
local entity = DataManager.BattleData:getGridEntity(newStartPosId)
|
|
||||||
if not entity then
|
|
||||||
local rc = ModuleManager.BattleManager:getPosRC(startPostId)
|
|
||||||
local r = rc.r
|
|
||||||
local c = rc.c
|
|
||||||
if not columnCount[c] then
|
|
||||||
columnCount[c] = 0
|
|
||||||
end
|
|
||||||
columnCount[c] = columnCount[c] + 1
|
|
||||||
for i = 1, columnCount[c] do
|
|
||||||
newStartPosId = ModuleManager.BattleManager:getLastRowPosId(r, c)
|
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
|
||||||
end
|
|
||||||
return startPostId
|
|
||||||
end
|
|
||||||
|
|
||||||
if entity:isCantFallType() then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not entity:getIsIdle() then
|
local list = BattleConst.UP_LINE_FILL_LIST[posId]
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
|
||||||
return newStartPosId
|
|
||||||
else
|
|
||||||
return self:verticalFall(newStartPosId, pathList, columnCount)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function BattleController:findHorizontalFallPath(startPostId, pathList, columnCount)
|
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(startPostId)
|
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
|
||||||
|
|
||||||
local list = BattleConst.UP_LINE_FILL_LIST[startPostId]
|
|
||||||
if not list[1] then -- 第一排
|
if not list[1] then -- 第一排
|
||||||
local rc = ModuleManager.BattleManager:getPosRC(startPostId)
|
local rc = ModuleManager.BattleManager:getPosRC(posId)
|
||||||
local r = rc.r
|
|
||||||
local c = rc.c
|
local c = rc.c
|
||||||
if not columnCount[c] then
|
if not columnCount[c] then
|
||||||
columnCount[c] = 0
|
columnCount[c] = 0
|
||||||
end
|
end
|
||||||
columnCount[c] = columnCount[c] + 1
|
columnCount[c] = columnCount[c] + 1
|
||||||
local newStartPosId
|
|
||||||
for i = 1, columnCount[c] do
|
local fallPosId = posId
|
||||||
newStartPosId = ModuleManager.BattleManager:getLastRowPosId(r, c)
|
local fallEntity = DataManager.BattleData:getGridEntity(fallPosId)
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
if not fallEntity then -- 异常情况,理论上不可能不存在
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
return
|
||||||
end
|
end
|
||||||
return startPostId
|
|
||||||
|
local newStartPosId
|
||||||
|
for i = columnCount[c], 1, -1 do
|
||||||
|
newStartPosId = ModuleManager.BattleManager:getFirstLineLastRowPosId(i, c)
|
||||||
|
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
||||||
|
fallEntity:addPath({x = curPos.x, y = curPos.y})
|
||||||
|
end
|
||||||
|
|
||||||
|
local curPos = ModuleManager.BattleManager:getPosInfo(posId)
|
||||||
|
fallEntity:addPath({x = curPos.x, y = curPos.y})
|
||||||
|
|
||||||
|
DataManager.BattleData:exchangeGridEntities(posId, fallPosId)
|
||||||
|
DataManager.BattleData:setGridInfo(posId, self:getRandomGridInfo())
|
||||||
else
|
else
|
||||||
for index, posId in ipairs(list) do
|
for index, fallPosId in ipairs(list) do
|
||||||
local entity = DataManager.BattleData:getGridEntity(posId)
|
local fallEntity = DataManager.BattleData:getGridEntity(fallPosId)
|
||||||
if not entity then -- 异常情况,理论上不可能不存在
|
if not fallEntity then -- 异常情况,理论上不可能不存在
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if entity then
|
if fallEntity then
|
||||||
if not entity:isCantFallType() and not entity:isIdle() then
|
if not fallEntity:isCantFallType() then
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(posId)
|
if fallEntity:getIsIdle() then
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
self:fillThisPos(fallPosId, columnCount)
|
||||||
return posId
|
end
|
||||||
|
fallEntity = DataManager.BattleData:getGridEntity(fallPosId)
|
||||||
|
if not fallEntity:getIsIdle() then
|
||||||
|
if not fallEntity:getPath()[1] then
|
||||||
|
local curPos = ModuleManager.BattleManager:getPosInfo(fallPosId)
|
||||||
|
fallEntity:addPath({x = curPos.x, y = curPos.y})
|
||||||
|
end
|
||||||
|
|
||||||
|
local curPos = ModuleManager.BattleManager:getPosInfo(posId)
|
||||||
|
fallEntity:addPath({x = curPos.x, y = curPos.y})
|
||||||
|
|
||||||
|
DataManager.BattleData:exchangeGridEntities(posId, fallPosId)
|
||||||
|
self:fillThisPos(fallPosId, columnCount)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:findVerticalFallAllPath(startPostId, pathMap, columnCount)
|
function BattleController:getRandomGridInfo()
|
||||||
while startPostId ~= nil do
|
if not self.fixedRandomList then
|
||||||
startPostId = self:findVerticalFallPath(startPostId, pathMap, columnCount)
|
self.fixedRandomList = {}
|
||||||
|
for _, elementType in ipairs(self:getFixedRandomGrid()) do
|
||||||
|
table.insert(self.fixedRandomList, elementType)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function BattleController:findVerticalFallPath(startPostId, pathList, columnCount)
|
local gridType = 0
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(startPostId)
|
local elementType
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
if self.fixedRandomList[1] then
|
||||||
local newStartPosId = ModuleManager.BattleManager:getLastRowPosIdByPosId(startPostId)
|
elementType = table.remove(self.fixedRandomList, 1)
|
||||||
local entity = DataManager.BattleData:getGridEntity(newStartPosId)
|
|
||||||
if not entity then
|
|
||||||
local rc = ModuleManager.BattleManager:getPosRC(startPostId)
|
|
||||||
local r = rc.r
|
|
||||||
local c = rc.c
|
|
||||||
if not columnCount[c] then
|
|
||||||
columnCount[c] = 0
|
|
||||||
end
|
|
||||||
columnCount[c] = columnCount[c] + 1
|
|
||||||
local newStartPosId
|
|
||||||
for i = 1, columnCount[c] do
|
|
||||||
newStartPosId = ModuleManager.BattleManager:getLastRowPosId(r, c)
|
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
|
||||||
end
|
|
||||||
return startPostId
|
|
||||||
else
|
else
|
||||||
if not entity:isCantFallType() and not entity:isIdle() then
|
local map = DataManager.BattleData:getElementTypeMap()
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
local indexs = {}
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
local typeList = {}
|
||||||
return newStartPosId
|
for typeName, typeNum in pairs(BattleConst.ELEMENT_TYPE) do
|
||||||
end
|
local weight = ((map[typeNum] or 0) + 1) * BattleConst.ELEMENT_WIGHT
|
||||||
end
|
if weight > BattleConst.MAX_ELEMENT_WIGHT then
|
||||||
end
|
weight = BattleConst.MAX_ELEMENT_WIGHT
|
||||||
|
|
||||||
function BattleController:findVerticalFallPath(startPostId, pathMap, columnCount)
|
|
||||||
local newStartPosId = ModuleManager.BattleManager:getLastRowPosIdByPosId(startPostId)
|
|
||||||
local entity = DataManager.BattleData:getGridEntity(newStartPosId)
|
|
||||||
if not entity then
|
|
||||||
local rc = ModuleManager.BattleManager:getPosRC(startPostId)
|
|
||||||
local r = rc.r
|
|
||||||
local c = rc.c
|
|
||||||
if not columnCount[c] then
|
|
||||||
columnCount[c] = 0
|
|
||||||
end
|
|
||||||
columnCount[c] = columnCount[c] + 1
|
|
||||||
local newStartPosId
|
|
||||||
for i = 1, columnCount[c] do
|
|
||||||
newStartPosId = ModuleManager.BattleManager:getLastRowPosId(r, c)
|
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
|
||||||
if not pathMap[startPostId] then
|
|
||||||
pathMap[startPostId] = {}
|
|
||||||
end
|
end
|
||||||
table.insert(pathMap[startPostId], {x = curPos.x, y = curPos.y})
|
table.insert(indexs, weight)
|
||||||
|
table.insert(typeList, typeNum)
|
||||||
end
|
end
|
||||||
return startPostId
|
|
||||||
end
|
|
||||||
|
|
||||||
if entity:isCantFallType() then
|
local index = GFunc.getRandomIndex(indexs)
|
||||||
return
|
elementType = typeList[index]
|
||||||
end
|
end
|
||||||
|
return {gridType = gridType, elementType = elementType}
|
||||||
if entity:isIdle() then
|
|
||||||
-- return self:findVerticalFallPath(startPostId, pathMap, columnCount)
|
|
||||||
end
|
|
||||||
|
|
||||||
local curPos = ModuleManager.BattleManager:getPosInfo(newStartPosId)
|
|
||||||
table.insert(pathList, {x = curPos.x, y = curPos.y})
|
|
||||||
return newStartPosId
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleController
|
return BattleController
|
||||||
15
lua/app/module/battle/controller/battle_controller_stage.lua
Normal file
15
lua/app/module/battle/controller/battle_controller_stage.lua
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||||
|
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
||||||
|
|
||||||
|
function BattleControllerStage:getInitBoard()
|
||||||
|
local config = ConfigManager:getConfig("stage")[1]
|
||||||
|
return config.board
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerStage:getFixedRandomGrid()
|
||||||
|
local config = ConfigManager:getConfig("stage")[1]
|
||||||
|
return config.control_element
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return BattleControllerStage
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c95a0ad0ae5e4a74dac2537712340fa8
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -18,7 +18,10 @@ function BattleUI:_display()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:_addListeners()
|
function BattleUI:_addListeners()
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
uiMap["battle_ui.close_btn"]:addClickListener(function()
|
||||||
|
self:initGridCell()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:initGridCell()
|
function BattleUI:initGridCell()
|
||||||
@ -55,11 +58,16 @@ function BattleUI:onInitGridCellOver()
|
|||||||
for posId, cell in pairs(self.gridCells) do
|
for posId, cell in pairs(self.gridCells) do
|
||||||
local entity = DataManager.BattleData:getGridEntity(posId)
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
if entity then
|
if entity then
|
||||||
cell:refresh(entity, function(eventType)
|
cell:refresh(entity)
|
||||||
|
cell:addTouchListener(function(eventType)
|
||||||
if self.battleController then
|
if self.battleController then
|
||||||
self.battleController:onTouchEvent(eventType, entity:getPosId())
|
self.battleController:onTouchEvent(eventType, entity:getPosId())
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
cell:unBindAll()
|
||||||
|
cell:bind(entity, "isDirty", function()
|
||||||
|
cell:refresh(entity)
|
||||||
|
end)
|
||||||
local pos = entity:getPos()
|
local pos = entity:getPos()
|
||||||
cell:getBaseObject():setAnchoredPosition(pos.x, pos.y)
|
cell:getBaseObject():setAnchoredPosition(pos.x, pos.y)
|
||||||
entity:setCell(cell)
|
entity:setCell(cell)
|
||||||
@ -78,11 +86,7 @@ function BattleUI:showBoardMask(elementType)
|
|||||||
local entities = DataManager.BattleData:getGridEnties()
|
local entities = DataManager.BattleData:getGridEnties()
|
||||||
for posId, entity in pairs(entities) do
|
for posId, entity in pairs(entities) do
|
||||||
if entity and entity:getCell() then
|
if entity and entity:getCell() then
|
||||||
entity:getCell():refresh(entity, function(eventType)
|
entity:getCell():refresh(entity, elementType)
|
||||||
if self.battleController then
|
|
||||||
self.battleController:onTouchEvent(eventType, entity:getPosId())
|
|
||||||
end
|
|
||||||
end, elementType)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -109,9 +113,8 @@ function BattleUI:eliminationAni(cellList, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:fallGrid(listInfo)
|
function BattleUI:fallGrid(listInfo)
|
||||||
for _, info in pairs(listInfo) do
|
for posId, info in pairs(listInfo) do
|
||||||
local entity = info.entity
|
local entity = DataManager.BattleData:getGridEntity(posId)
|
||||||
local pathInfoList = info.pathInfoList
|
|
||||||
local cell = entity:getCell()
|
local cell = entity:getCell()
|
||||||
local posId = entity:getPosId()
|
local posId = entity:getPosId()
|
||||||
if cell then
|
if cell then
|
||||||
@ -123,14 +126,9 @@ function BattleUI:fallGrid(listInfo)
|
|||||||
end
|
end
|
||||||
local baseObject = cell:getBaseObject()
|
local baseObject = cell:getBaseObject()
|
||||||
cell.fallSeq = baseObject:createBindTweenSequence()
|
cell.fallSeq = baseObject:createBindTweenSequence()
|
||||||
-- cell.fallSeq:Append(baseObject:getTransform():DOLocalPath(pathInfoList, 2))
|
baseObject:setAnchoredPosition(info[1].x, info[1].y)
|
||||||
for index, pos in ipairs(pathInfoList) do
|
local count = #info
|
||||||
if index == 1 then -- 初始位置,直接0秒直接设置
|
cell.fallSeq:Append(baseObject:getTransform():DOLocalPath(info, GConst.BattleConst.ONE_STEP_TIME * count))
|
||||||
cell.fallSeq:Append(baseObject:getTransform():DOAnchorPos(pos, 0)) -- 暂时使用这种 等待改进dopath
|
|
||||||
else
|
|
||||||
cell.fallSeq:Append(baseObject:getTransform():DOAnchorPos(pos, 1)) -- 暂时使用这种 等待改进dopath
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
local GridCell = class("GridCell", BaseCell)
|
local GridCell = class("GridCell", BaseCell)
|
||||||
|
|
||||||
function GridCell:refresh(gridEntity, func, curElement)
|
function GridCell:refresh(gridEntity, curElement)
|
||||||
local atlas, icon = ModuleManager.BattleManager:getElementIcon(gridEntity:getElementType())
|
local atlas, icon = ModuleManager.BattleManager:getElementIcon(gridEntity:getElementType())
|
||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
if self.lastIcon ~= icon then
|
if self.lastIcon ~= icon then
|
||||||
@ -8,9 +8,16 @@ function GridCell:refresh(gridEntity, func, curElement)
|
|||||||
uiMap["grid_cell.touch_node.ani_node.middle_bg"]:setSprite(atlas, icon)
|
uiMap["grid_cell.touch_node.ani_node.middle_bg"]:setSprite(atlas, icon)
|
||||||
end
|
end
|
||||||
|
|
||||||
uiMap["grid_cell.touch_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_ELIMINATION_TOUCH_EVENT):AddTouchEventListener(func)
|
|
||||||
uiMap["grid_cell.touch_node.ani_node.mask"]:setVisible(curElement and curElement ~= gridEntity:getElementType())
|
uiMap["grid_cell.touch_node.ani_node.mask"]:setVisible(curElement and curElement ~= gridEntity:getElementType())
|
||||||
uiMap["grid_cell.touch_node.ani_node.obstacle"]:setVisible(gridEntity:isCantFallType())
|
uiMap["grid_cell.touch_node.ani_node.obstacle"]:setVisible(gridEntity:isCantFallType())
|
||||||
|
|
||||||
|
--- 测试代码
|
||||||
|
uiMap["grid_cell.touch_node.ani_node.count"]:setText(gridEntity:getAroundEliminationCount())
|
||||||
|
end
|
||||||
|
|
||||||
|
function GridCell:addTouchListener(func)
|
||||||
|
local uiMap = self:getUIMap()
|
||||||
|
uiMap["grid_cell.touch_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_ELIMINATION_TOUCH_EVENT):AddTouchEventListener(func)
|
||||||
end
|
end
|
||||||
|
|
||||||
return GridCell
|
return GridCell
|
||||||
@ -3,62 +3,10 @@ local BattleData = class("BattleData", BaseData)
|
|||||||
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 TEST_INIT = {
|
function BattleData:init(board)
|
||||||
{1, 2},
|
|
||||||
{1, 4},
|
|
||||||
{1, 1},
|
|
||||||
{0, 4},
|
|
||||||
{0, 3},
|
|
||||||
{0, 3},
|
|
||||||
{0, 3},
|
|
||||||
{1, 4},
|
|
||||||
{1, 3},
|
|
||||||
{0, 3},
|
|
||||||
{0, 1},
|
|
||||||
{0, 4},
|
|
||||||
{0, 2},
|
|
||||||
{0, 1},
|
|
||||||
{1, 1},
|
|
||||||
{1, 4},
|
|
||||||
{1, 2},
|
|
||||||
{1, 3},
|
|
||||||
{0, 4},
|
|
||||||
{0, 4},
|
|
||||||
{1, 4},
|
|
||||||
{0, 4},
|
|
||||||
{0, 2},
|
|
||||||
{1, 4},
|
|
||||||
{0, 4},
|
|
||||||
{1, 1},
|
|
||||||
{0, 3},
|
|
||||||
{1, 2},
|
|
||||||
{0, 1},
|
|
||||||
{0, 1},
|
|
||||||
{0, 4},
|
|
||||||
{1, 4},
|
|
||||||
{0, 3},
|
|
||||||
{0, 4},
|
|
||||||
{1, 3},
|
|
||||||
{1, 1},
|
|
||||||
{0, 4},
|
|
||||||
{1, 3},
|
|
||||||
{0, 3},
|
|
||||||
{1, 2},
|
|
||||||
{1, 1},
|
|
||||||
{0, 4},
|
|
||||||
{1, 2},
|
|
||||||
{0, 4},
|
|
||||||
{0, 3},
|
|
||||||
{1, 3},
|
|
||||||
{1, 4},
|
|
||||||
{0, 4},
|
|
||||||
{0, 4},
|
|
||||||
}
|
|
||||||
|
|
||||||
function BattleData:init(data)
|
|
||||||
self:clear()
|
self:clear()
|
||||||
|
|
||||||
for i, info in ipairs(TEST_INIT) do
|
for i, info in ipairs(board) do
|
||||||
local r = 1
|
local r = 1
|
||||||
local c = 1
|
local c = 1
|
||||||
local zheng = i // BattleConst.ROW_COUNT
|
local zheng = i // BattleConst.ROW_COUNT
|
||||||
@ -78,6 +26,9 @@ function BattleData:init(data)
|
|||||||
elementType = info[2]
|
elementType = info[2]
|
||||||
}
|
}
|
||||||
self.gridEntities[data.posId] = BATTLE_GRID_ENTITY:create(data)
|
self.gridEntities[data.posId] = BATTLE_GRID_ENTITY:create(data)
|
||||||
|
if self.gridEntities[data.posId]:canLink() then
|
||||||
|
self.elementTypeMap[data.elementType] = (self.elementTypeMap[data.elementType] or 0) + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -85,6 +36,11 @@ function BattleData:clear()
|
|||||||
self:clearGridSequence()
|
self:clearGridSequence()
|
||||||
|
|
||||||
self.gridEntities = {}
|
self.gridEntities = {}
|
||||||
|
self.elementTypeMap = {} -- 同元素得格子数量
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleData:getElementTypeMap()
|
||||||
|
return self.elementTypeMap
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleData:getGridSequence()
|
function BattleData:getGridSequence()
|
||||||
@ -131,10 +87,39 @@ function BattleData:getGridEntity(posId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleData:exchangeGridEntities(posId1, posId2)
|
function BattleData:exchangeGridEntities(posId1, posId2)
|
||||||
self.gridEntities[posId2]:setIsIdle(false)
|
local e1 = self.gridEntities[posId1]
|
||||||
self.gridEntities[posId1]:setPosId(posId2)
|
local e2 = self.gridEntities[posId2]
|
||||||
self.gridEntities[posId2]:setPosId(posId1)
|
e1:setPosId(posId2)
|
||||||
self.gridEntities[posId1], self.gridEntities[posId2] = self.gridEntities[posId2], self.gridEntities[posId1]
|
e2:setPosId(posId1)
|
||||||
|
e2:setIsIdle(false)
|
||||||
|
self.gridEntities[posId1] = e2
|
||||||
|
self.gridEntities[posId2] = e1
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleData:setGridInfo(posId, gridInfo)
|
||||||
|
local entity = self.gridEntities[posId]
|
||||||
|
if not entity then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if entity:canLink() then
|
||||||
|
local elementType = entity:getElementType()
|
||||||
|
self.elementTypeMap[elementType] = (self.elementTypeMap[elementType] or 0) - 1
|
||||||
|
if self.elementTypeMap[elementType] < 0 then
|
||||||
|
self.elementTypeMap[elementType] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if gridInfo.gridType then
|
||||||
|
entity:setGridType(gridInfo.gridType)
|
||||||
|
end
|
||||||
|
|
||||||
|
if gridInfo.elementType then
|
||||||
|
entity:setElementType(gridInfo.elementType)
|
||||||
|
if entity:canLink() then
|
||||||
|
self.elementTypeMap[gridInfo.elementType] = (self.elementTypeMap[gridInfo.elementType] or 0) + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleData
|
return BattleData
|
||||||
@ -1,11 +1,17 @@
|
|||||||
local BattleGridEntity = class("BattleGridEntity", BaseData)
|
local BattleGridEntity = class("BattleGridEntity", BaseData)
|
||||||
|
local BattleConst = GConst.BattleConst
|
||||||
|
|
||||||
function BattleGridEntity:ctor(data)
|
function BattleGridEntity:ctor(data)
|
||||||
self.posId = data.posId or 0
|
self.posId = data.posId or 0
|
||||||
self.gridType = data.gridType or GConst.BattleConst.GRID_TYPE.EMPTY
|
self.gridType = data.gridType or BattleConst.GRID_TYPE.EMPTY
|
||||||
self.elementType = data.elementType or GConst.BattleConst.ELEMENT_TYPE.RED
|
self.elementType = data.elementType or BattleConst.ELEMENT_TYPE.RED
|
||||||
self.eliminationCount = data.eliminationCount or 0 -- 周围消除次数
|
self.aroundEliminationCount = data.aroundEliminationCount or 0 -- 周围消除次数
|
||||||
self.isIdle = false
|
self.isIdle = false
|
||||||
|
self.data.isDirty = false
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:setDirty()
|
||||||
|
self.data.isDirty = not self.data.isDirty
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getPosId()
|
function BattleGridEntity:getPosId()
|
||||||
@ -25,11 +31,22 @@ function BattleGridEntity:getElementType()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:isCantFallType()
|
function BattleGridEntity:isCantFallType()
|
||||||
return self.elementType == GConst.BattleConst.GRID_TYPE.OBSTACLE
|
return BattleConst.CANT_FALL_GRID_TYPE[self.gridType] or false
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getEliminationCount()
|
function BattleGridEntity:getAroundEliminationCount()
|
||||||
return self.eliminationCount
|
return self.aroundEliminationCount
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:addAroundEliminationCount(count)
|
||||||
|
count = count or 1
|
||||||
|
self.aroundEliminationCount = self.aroundEliminationCount + count
|
||||||
|
local gridTypeList = BattleConst.AROUND_ELIMINATION_TO_EMPTY_TYPE_COUNT[self.gridType]
|
||||||
|
if gridTypeList and gridTypeList[self.aroundEliminationCount] then
|
||||||
|
self:setGridType(gridTypeList[self.aroundEliminationCount])
|
||||||
|
self.aroundEliminationCount = self.aroundEliminationCount - 1
|
||||||
|
end
|
||||||
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:getPos()
|
function BattleGridEntity:getPos()
|
||||||
@ -50,15 +67,40 @@ end
|
|||||||
|
|
||||||
function BattleGridEntity:setIsIdle(isIdle)
|
function BattleGridEntity:setIsIdle(isIdle)
|
||||||
self.isIdle = isIdle == true
|
self.isIdle = isIdle == true
|
||||||
|
if self.isIdle then
|
||||||
|
self.aroundEliminationCount = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleGridEntity:canLink()
|
function BattleGridEntity:canLink()
|
||||||
if self:isCantFallType() then
|
return not BattleConst.CANT_LINK_GRID_TYPE[self.gridType]
|
||||||
return false
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- 其他类型的一些判定
|
function BattleGridEntity:addPath(singlePath)
|
||||||
return true
|
self:getPath()
|
||||||
|
table.insert(self.pathList, singlePath)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:getPath()
|
||||||
|
if not self.pathList then
|
||||||
|
self.pathList = {}
|
||||||
|
end
|
||||||
|
return self.pathList
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:clearPath()
|
||||||
|
self.pathList = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:setGridType(gridType)
|
||||||
|
self.gridType = gridType
|
||||||
|
self.aroundEliminationCount = 0
|
||||||
|
self:setDirty()
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleGridEntity:setElementType(elementType)
|
||||||
|
self.elementType = elementType
|
||||||
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleGridEntity
|
return BattleGridEntity
|
||||||
Loading…
x
Reference in New Issue
Block a user