初始玩家体力
This commit is contained in:
parent
48d84dc0bc
commit
90a1daf23a
@ -241,6 +241,10 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
this.curPower = this.NexPower
|
this.curPower = this.NexPower
|
||||||
case "ready":
|
case "ready":
|
||||||
if len(this.szSession) == 1 { // AI对战的话直接开始游戏
|
if len(this.szSession) == 1 { // AI对战的话直接开始游戏
|
||||||
|
this.NexPower = this.player1.Uid
|
||||||
|
this.curPower = this.player1.Uid
|
||||||
|
this.player1.Ps = MaxPs
|
||||||
|
this.player2.Ps = MaxPs
|
||||||
if err := this.module.SendMsgToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{
|
if err := this.module.SendMsgToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{
|
||||||
User1: this.player1,
|
User1: this.player1,
|
||||||
User2: this.player2,
|
User2: this.player2,
|
||||||
@ -251,8 +255,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
}, this.szSession...); err != nil {
|
}, this.szSession...); err != nil {
|
||||||
this.Errorln(err)
|
this.Errorln(err)
|
||||||
}
|
}
|
||||||
this.NexPower = this.player1.Uid
|
|
||||||
this.curPower = this.player1.Uid
|
|
||||||
this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut)
|
this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user