From 5bf499430cecd8edd28905d94d8da103080becdc Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 8 Nov 2023 11:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BE=99=E5=B1=9E=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dragon/model_dragon.go | 1 + modules/dragon/module.go | 2 ++ modules/entertainment/room.go | 36 ++++++++++++++++++++----------- modules/entertainment/xxlPlat.go | 33 ---------------------------- modules/entertainment/xxl_test.go | 2 +- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/modules/dragon/model_dragon.go b/modules/dragon/model_dragon.go index f21eb490e..defb82a84 100644 --- a/modules/dragon/model_dragon.go +++ b/modules/dragon/model_dragon.go @@ -115,6 +115,7 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str dragon.Property["sprint"] = c.Sprint dragon.Property["acceleration"] = c.Acceleration dragon.Property["deceleration"] = c.Deceleration + dragon.Property["energyrecover"] = c.Energyrecover dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime } diff --git a/modules/dragon/module.go b/modules/dragon/module.go index 517b5af14..b1b07698b 100644 --- a/modules/dragon/module.go +++ b/modules/dragon/module.go @@ -94,6 +94,7 @@ func (this *Dragon) CreateRobotDragon(dragonid string, lv int32) (dragon *pb.DBD dragon.Property["sprint"] = c.Sprint dragon.Property["acceleration"] = c.Acceleration dragon.Property["deceleration"] = c.Deceleration + dragon.Property["energyrecover"] = c.Energyrecover // dragon.Property["itemsprint"] = c.Itemsprint dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime @@ -186,6 +187,7 @@ func (this *Dragon) GMModifyDragonLv(uid string, cid string, lv int32) (dragon * dragon.Property["sprint"] = c.Sprint dragon.Property["acceleration"] = c.Acceleration dragon.Property["deceleration"] = c.Deceleration + dragon.Property["energyrecover"] = c.Energyrecover dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime update["property"] = dragon.Property diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index b51dcd623..d392c236a 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -146,6 +146,17 @@ func (this *Room) AiOperator() { this.player2.Energy += v.CurEnergy v.CurEnergy = this.player2.Energy } + for _, v := range szMap { // + fmt.Printf("================\n") + var v1 int + for index := Width - 1; index >= 0; index-- { + for j := 0; j < Height; j++ { + v1 = index + j*7 + fmt.Printf("%d:%d ", v.Data[v1].Oid, v.Data[v1].Cid) + } + fmt.Printf("\n") + } + } // 广播消息 if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{ Mpadata: szMap, @@ -381,18 +392,17 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr this.round++ } - // for _, v := range szMap { // - // fmt.Printf("================\n") - // var v1 int - // for index := Width - 1; index >= 0; index-- { - // for j := 0; j < Height; j++ { - // v1 = index + j*7 - // fmt.Printf("%d ", v.Data[v1].Cid) - - // } - // fmt.Printf("\n") - // } - // } + for _, v := range szMap { // + fmt.Printf("================\n") + var v1 int + for index := Width - 1; index >= 0; index-- { + for j := 0; j < Height; j++ { + v1 = index + j*7 + fmt.Printf("%d:%d ", v.Data[v1].Oid, v.Data[v1].Cid) + } + fmt.Printf("\n") + } + } // 广播消息 if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{ Mpadata: szMap, @@ -582,7 +592,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) { res = append(res, conf.Rewards...) for _, v := range res { if v.A == "attr" && v.T == "consumeexp" { - if winner == this.player1 { + if winner.Userinfo.Uid == this.player1.Userinfo.Uid { this.player1.Score += v.N } else { this.player2.Score += v.N diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 052e493e4..885b060aa 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -738,39 +738,6 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32, return } -func (this *MapData) SetMap() { - sz2 := []int32{ - 3, 1, 2, 2, 1, 3, 1, - 5, 1, 2, 3, 1, 2, 2, - 2, 42, 3, 4, 3, 1, 6, - 1, 3, 3, 4, 2, 3, 6, - 1, 5, 6, 5, 6, 1, 4, - 6, 6, 3, 6, 3, 48, 3, - 3, 3, 1, 3, 5, 2, 5, - } - var pos int - for index := Width - 1; index >= 0; index-- { - for j := 0; j < Height; j++ { - Color := sz2[pos] - Cid := sz2[pos] - if sz2[pos] > 6 { - conf, err := this.module.configure.GetGameBlockByKey(sz2[pos]) - if err == nil { - Color = conf.Color - Cid = conf.Key - this.Plat[index+j*Height].Special = conf.Type - } - } - this.Plat[index+j*Height].Color = Color - this.Plat[index+j*Height].Cid = Cid - pos++ - } - } - this.CheckAndRefreshPlat() - // this.SetIndelibilityPlat() - -} - // 校验当前地图 有没有能消除的 func (this *MapData) CheckAndRefreshPlat() (bEliminate bool) { bEliminate = false diff --git a/modules/entertainment/xxl_test.go b/modules/entertainment/xxl_test.go index 2b32ad14a..c56e789d8 100644 --- a/modules/entertainment/xxl_test.go +++ b/modules/entertainment/xxl_test.go @@ -91,7 +91,7 @@ func Test_Main(t *testing.T) { m.InitMap(nil, 1) //m.SkillUp(24, 1, 3, 7, true) - m.SetMap() + b := m.GetFireBoom(1, 7) fmt.Printf("xxxx %d\n", b) var vids int