Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
0f546d1be5
@ -86,8 +86,8 @@ func (this *MapData) SwapGirde(oldId, newId int32) (bSwap bool) {
|
||||
func (this *MapData) SetMap() {
|
||||
sz2 := []int32{
|
||||
5, 1, 2, 5, 1, 5, 2,
|
||||
3, 1, 5, 4, 2, 4, 4,
|
||||
4, 4, 2, 1, 6, 4, 1,
|
||||
5, 1, 5, 4, 2, 4, 4,
|
||||
4, 5, 5, 1, 6, 4, 1,
|
||||
6, 3, 1, 4, 3, 6, 3,
|
||||
6, 1, 3, 5, 1, 6, 1,
|
||||
5, 6, 5, 5, 1, 3, 1,
|
||||
@ -133,7 +133,7 @@ func (this *MapData) Check5X(color int32) (bEliminate bool, score int32, count i
|
||||
}
|
||||
this.oid++
|
||||
// 生成一个新的类型元素
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FiveType); err != nil {
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FiveType); err == nil {
|
||||
this.Plat[k+2] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
@ -161,7 +161,7 @@ func (this *MapData) Check5X(color int32) (bEliminate bool, score int32, count i
|
||||
}
|
||||
this.oid++
|
||||
// 生成一个新的类型元素
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FiveType); err != nil {
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FiveType); err == nil {
|
||||
this.Plat[k+2*Width] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
@ -256,20 +256,17 @@ func (this *MapData) Check4X(color int32) (bEliminate bool, score int32, count i
|
||||
}
|
||||
this.oid++
|
||||
// 生成一个新的类型元素
|
||||
if this.module != nil {
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FourUType); err != nil { // 上下类型
|
||||
this.Plat[newElem] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
Cid: conf.Key,
|
||||
Score: conf.Score,
|
||||
Special: conf.Type,
|
||||
}
|
||||
if k1 == color {
|
||||
count++
|
||||
}
|
||||
} else {
|
||||
xiaochu = append(xiaochu, newElem)
|
||||
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FourUType); err == nil { // 上下类型
|
||||
this.Plat[newElem] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
Cid: conf.Key,
|
||||
Score: conf.Score,
|
||||
Special: conf.Type,
|
||||
}
|
||||
if k1 == color {
|
||||
count++
|
||||
}
|
||||
} else {
|
||||
xiaochu = append(xiaochu, newElem)
|
||||
@ -305,21 +302,18 @@ func (this *MapData) Check4X(color int32) (bEliminate bool, score int32, count i
|
||||
}
|
||||
|
||||
this.oid++
|
||||
if this.module != nil {
|
||||
// 生成一个新的类型元素
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FourLType); err != nil { // 左右类型
|
||||
this.Plat[newElem] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
Cid: conf.Key,
|
||||
Score: conf.Score,
|
||||
Special: conf.Type,
|
||||
}
|
||||
if k1 == color {
|
||||
count++
|
||||
}
|
||||
} else {
|
||||
xiaochu = append(xiaochu, k+Width)
|
||||
|
||||
// 生成一个新的类型元素
|
||||
if conf, err := this.module.configure.GetGameBlock(k1, FourLType); err == nil { // 左右类型
|
||||
this.Plat[newElem] = &pb.GirdeData{
|
||||
Oid: this.oid,
|
||||
Color: k1,
|
||||
Cid: conf.Key,
|
||||
Score: conf.Score,
|
||||
Special: conf.Type,
|
||||
}
|
||||
if k1 == color {
|
||||
count++
|
||||
}
|
||||
} else {
|
||||
xiaochu = append(xiaochu, k+Width)
|
||||
@ -468,10 +462,12 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, co
|
||||
|
||||
score += curScore // 总分
|
||||
this.DropGirde()
|
||||
szMap = append(szMap, &pb.MapData{
|
||||
Data: this.Plat,
|
||||
CurSocre: curScore,
|
||||
})
|
||||
if curScore > 0 {
|
||||
szMap = append(szMap, &pb.MapData{
|
||||
Data: this.Plat,
|
||||
CurSocre: curScore,
|
||||
})
|
||||
}
|
||||
// 检查掉落
|
||||
this.operElem = []int32{} // 初始化操作元素
|
||||
if curScore == 0 {
|
||||
@ -523,8 +519,9 @@ func (this *MapData) AiSwapGirde() (bSwap bool, szMap []*pb.MapData, oid1 int32,
|
||||
if s, m, _ := this.CheckMap(2); s == 0 {
|
||||
this.SwapGirde(int32(pos+1), int32(pos))
|
||||
this.operElem = []int32{}
|
||||
oid1 = 0
|
||||
oid2 = 0
|
||||
} else {
|
||||
|
||||
szMap = append(szMap, m...)
|
||||
bSwap = true
|
||||
break
|
||||
@ -538,6 +535,8 @@ func (this *MapData) AiSwapGirde() (bSwap bool, szMap []*pb.MapData, oid1 int32,
|
||||
if s, m, _ := this.CheckMap(2); s == 0 {
|
||||
this.SwapGirde(int32(pos+Width), int32(pos))
|
||||
this.operElem = []int32{}
|
||||
oid1 = 0
|
||||
oid2 = 0
|
||||
} else {
|
||||
szMap = append(szMap, m...)
|
||||
bSwap = true
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user