104 lines
1.9 KiB
Go
104 lines
1.9 KiB
Go
package clawdoll
|
|
|
|
import (
|
|
rule "mongo.games.com/game/gamerule/clawdoll"
|
|
"mongo.games.com/game/gamesrv/base"
|
|
"mongo.games.com/goserver/core/logger"
|
|
)
|
|
|
|
type PlayerEx struct {
|
|
*base.Player //玩家信息
|
|
|
|
clawDollState int32 // 抓娃娃状态
|
|
dollCardsCnt int32 // 娃娃卡数量
|
|
|
|
gainCoin int64 // 本局赢的金币
|
|
taxCoin int64 // 本局税收
|
|
odds int32
|
|
}
|
|
|
|
func (this *PlayerEx) Clear(baseScore int32) {
|
|
this.UnmarkFlag(base.PlayerState_WaitNext)
|
|
this.UnmarkFlag(base.PlayerState_GameBreak)
|
|
this.MarkFlag(base.PlayerState_Ready)
|
|
|
|
this.gainCoin = 0
|
|
this.taxCoin = 0
|
|
this.odds = 0
|
|
}
|
|
|
|
func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
|
if !this.IsGameing() {
|
|
logger.Logger.Trace("(this *PlayerEx) CanOp return false ", this.SnId)
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
// 能否投币
|
|
func (this *PlayerEx) CanPayCoin() bool {
|
|
return true
|
|
}
|
|
|
|
// 能否移动
|
|
func (this *PlayerEx) CanMove() bool {
|
|
|
|
return true
|
|
}
|
|
|
|
// 能否下抓
|
|
func (this *PlayerEx) CanGrab() bool {
|
|
|
|
return true
|
|
}
|
|
|
|
// 游戏新一局 设置数据
|
|
func (this *PlayerEx) ReStartGame() {
|
|
this.ReDataStartGame()
|
|
|
|
this.UnmarkFlag(base.PlayerState_WaitNext)
|
|
this.UnmarkFlag(base.PlayerState_GameBreak)
|
|
this.MarkFlag(base.PlayerState_Ready)
|
|
|
|
this.gainCoin = 0
|
|
this.taxCoin = 0
|
|
this.odds = 0
|
|
this.clawDollState = rule.ClawDollPlayerStateWait
|
|
}
|
|
|
|
// 初始化
|
|
func (this *PlayerEx) InitData(baseScore int32) {
|
|
|
|
}
|
|
|
|
// 重置数据
|
|
func (this *PlayerEx) ResetData() {
|
|
|
|
}
|
|
|
|
// 游戏新一局 设置数据
|
|
func (this *PlayerEx) ReDataStartGame() {
|
|
|
|
}
|
|
|
|
func (this *PlayerEx) CanPlayerOpInState(sceneState int) bool {
|
|
|
|
return false
|
|
}
|
|
|
|
// 能否退出游戏
|
|
func (this *PlayerEx) CanLeaveScene(sceneState int) bool {
|
|
|
|
return true
|
|
}
|
|
|
|
// 获取状态
|
|
func (this *PlayerEx) GetClawState() int32 {
|
|
return this.clawDollState
|
|
}
|
|
|
|
// 设置状态
|
|
func (this *PlayerEx) SetClawState(state int32) {
|
|
this.clawDollState = state
|
|
}
|