From 3052b092175044ea1ae7fad6008cd9e092cb3033 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 10 Jan 2024 18:51:34 +0800 Subject: [PATCH] =?UTF-8?q?AI=E4=BC=9A=E6=94=BE=E6=8A=80=E8=83=BD=E4=BA=86?= =?UTF-8?q?=20(=E7=A8=8D=E5=BE=AE=E6=99=BA=E8=83=BD=E4=B8=80=E7=82=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/room.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index f0f42e734..5acb0cccf 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -772,7 +772,25 @@ func (this *Room) AutoOperator(uid string) { this.module.Errorf("cant found user:%s", uid) return } + conf, err := this.module.configure.GetGameConsumeHero(p.Cardid) + if err != nil { + return + } + // 交换元素 + if this.player1.Energy >= conf.Skillload { + var color int32 + if this.curPower == this.player1.Userinfo.Uid { + color = 1 + } else { + color = 2 + } + this.UserSkillUp(color, 0) + if this.RoomType == 2 && this.curPower == p.Userinfo.Uid { + this.AutoOperator(this.curPower) + } + return + } szMap, oid1, oid2, bAddPs = this.chessboard.AiSwapGirde() p.Ps-- if bAddPs {