This commit is contained in:
meixiongfeng 2023-10-24 10:23:44 +08:00
parent 9e94db9d7a
commit 8ea3174625

View File

@ -86,8 +86,8 @@ func (this *MapData) SwapGirde(oldId, newId int32) (bSwap bool) {
func (this *MapData) SetMap() { func (this *MapData) SetMap() {
sz2 := []int32{ sz2 := []int32{
5, 1, 2, 5, 1, 5, 2, 5, 1, 2, 5, 1, 5, 2,
3, 1, 5, 4, 2, 4, 4, 5, 1, 5, 4, 2, 4, 4,
4, 4, 2, 1, 6, 4, 1, 4, 5, 5, 1, 6, 4, 1,
6, 3, 1, 4, 3, 6, 3, 6, 3, 1, 4, 3, 6, 3,
6, 1, 3, 5, 1, 6, 1, 6, 1, 3, 5, 1, 6, 1,
5, 6, 5, 5, 1, 3, 1, 5, 6, 5, 5, 1, 3, 1,
@ -468,10 +468,12 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, co
score += curScore // 总分 score += curScore // 总分
this.DropGirde() this.DropGirde()
szMap = append(szMap, &pb.MapData{ if curScore > 0 {
Data: this.Plat, szMap = append(szMap, &pb.MapData{
CurSocre: curScore, Data: this.Plat,
}) CurSocre: curScore,
})
}
// 检查掉落 // 检查掉落
this.operElem = []int32{} // 初始化操作元素 this.operElem = []int32{} // 初始化操作元素
if curScore == 0 { if curScore == 0 {
@ -523,8 +525,9 @@ func (this *MapData) AiSwapGirde() (bSwap bool, szMap []*pb.MapData, oid1 int32,
if s, m, _ := this.CheckMap(2); s == 0 { if s, m, _ := this.CheckMap(2); s == 0 {
this.SwapGirde(int32(pos+1), int32(pos)) this.SwapGirde(int32(pos+1), int32(pos))
this.operElem = []int32{} this.operElem = []int32{}
oid1 = 0
oid2 = 0
} else { } else {
szMap = append(szMap, m...) szMap = append(szMap, m...)
bSwap = true bSwap = true
break break
@ -538,6 +541,8 @@ func (this *MapData) AiSwapGirde() (bSwap bool, szMap []*pb.MapData, oid1 int32,
if s, m, _ := this.CheckMap(2); s == 0 { if s, m, _ := this.CheckMap(2); s == 0 {
this.SwapGirde(int32(pos+Width), int32(pos)) this.SwapGirde(int32(pos+Width), int32(pos))
this.operElem = []int32{} this.operElem = []int32{}
oid1 = 0
oid2 = 0
} else { } else {
szMap = append(szMap, m...) szMap = append(szMap, m...)
bSwap = true bSwap = true