三消 将随机6个宝石染成当前盘面上颜色最多的宝石
This commit is contained in:
parent
37934459bc
commit
866dc7ef3b
@ -731,6 +731,15 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32,
|
|||||||
}
|
}
|
||||||
case 3: // 将随机6个宝石染成当前盘面上颜色最多的宝石
|
case 3: // 将随机6个宝石染成当前盘面上颜色最多的宝石
|
||||||
this.SkillChangeColor(value)
|
this.SkillChangeColor(value)
|
||||||
|
bDrop = false
|
||||||
|
szMap = append(szMap, &pb.MapData{
|
||||||
|
Data: this.GetPalatData(),
|
||||||
|
CurSocre: skillScore,
|
||||||
|
CurEnergy: skillEnergy,
|
||||||
|
})
|
||||||
|
if list, _ := this.CheckMap(color, false); len(list) > 0 {
|
||||||
|
szMap = append(szMap, list...)
|
||||||
|
}
|
||||||
case 4:
|
case 4:
|
||||||
x := int(pos / Width)
|
x := int(pos / Width)
|
||||||
y := int(pos % Height)
|
y := int(pos % Height)
|
||||||
@ -1488,9 +1497,15 @@ func (this *MapData) SkillChangeColor(count int32) {
|
|||||||
elemCount[v.Color] += 1
|
elemCount[v.Color] += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
for k := range elemCount {
|
for _, v := range elemCount {
|
||||||
if color < k {
|
if color < v {
|
||||||
|
color = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for k, v := range elemCount {
|
||||||
|
if color == v {
|
||||||
color = k
|
color = k
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i := 0; i < int(count); i++ {
|
for i := 0; i < int(count); i++ {
|
||||||
@ -1498,7 +1513,12 @@ func (this *MapData) SkillChangeColor(count int32) {
|
|||||||
if this.Plat[targetId].Color == color {
|
if this.Plat[targetId].Color == color {
|
||||||
i--
|
i--
|
||||||
} else {
|
} else {
|
||||||
this.Plat[targetId].Color = color // 变更颜色
|
if this.Plat[targetId].Special == 0 {
|
||||||
|
this.Plat[targetId].Color = color // 变更颜色
|
||||||
|
this.Plat[targetId].Cid = color // 变更颜色
|
||||||
|
this.oid++
|
||||||
|
this.Plat[targetId].Oid = this.oid // 变唯一id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -21,7 +21,7 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq
|
|||||||
err error
|
err error
|
||||||
update map[string]interface{}
|
update map[string]interface{}
|
||||||
)
|
)
|
||||||
update = make(map[string]interface{}, 0)
|
|
||||||
list, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
list, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -33,20 +33,22 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !utils.IsToday(list.Rtime) {
|
if !utils.IsToday(list.Rtime) {
|
||||||
|
update = make(map[string]interface{}, 0)
|
||||||
list.Rtime = configure.Now().Unix()
|
list.Rtime = configure.Now().Unix()
|
||||||
list.Battlecount = 0
|
list.Battlecount = 0
|
||||||
update["battlecount"] = list.Battlecount
|
update["battlecount"] = list.Battlecount
|
||||||
update["rtime"] = list.Rtime
|
update["rtime"] = list.Rtime
|
||||||
}
|
if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil {
|
Code: pb.ErrorCode_DBError,
|
||||||
errdata = &pb.ErrorData{
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
Code: pb.ErrorCode_DBError,
|
Message: err.Error(),
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
}
|
||||||
Message: err.Error(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{})
|
session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{
|
||||||
|
Data: list,
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := pagoda.Data[conf.Floors]; !ok {
|
if _, ok := pagoda.Data[conf.Floors]; !ok {
|
||||||
if pagoda.Maxfloor != conf.Floors+1 {
|
if pagoda.Maxfloor+1 != conf.Floors {
|
||||||
errdata = &pb.ErrorData{ // 挑战关卡数据不匹配
|
errdata = &pb.ErrorData{ // 挑战关卡数据不匹配
|
||||||
Code: pb.ErrorCode_PagodaLevlErr,
|
Code: pb.ErrorCode_PagodaLevlErr,
|
||||||
Title: pb.ErrorCode_PagodaLevlErr.ToString(),
|
Title: pb.ErrorCode_PagodaLevlErr.ToString(),
|
||||||
|
Loading…
Reference in New Issue
Block a user