十三张调控记录
This commit is contained in:
parent
5d113056c8
commit
a13390909d
|
@ -24,6 +24,7 @@ type PlayerEx struct {
|
|||
odds int32
|
||||
totalScore int64
|
||||
defGroup *thirteen.Group
|
||||
playerPool int // 个人水池分
|
||||
}
|
||||
|
||||
func (this *PlayerEx) Clear() {
|
||||
|
@ -46,6 +47,7 @@ func (this *PlayerEx) Clear() {
|
|||
this.odds = 0
|
||||
this.totalScore = 0
|
||||
this.defGroup = nil
|
||||
this.playerPool = 0
|
||||
this.TestLog = this.TestLog[:0]
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ type PlayerData struct {
|
|||
allGroup map[int]*rule.Group
|
||||
TestLog []string
|
||||
RoleId int32
|
||||
PlayerPool int // 个人水池分
|
||||
}
|
||||
|
||||
type SceneEx struct {
|
||||
|
@ -81,6 +82,7 @@ type SceneEx struct {
|
|||
LeaveNum int // 离场扣分人数
|
||||
testPokers []int64 // 测试牌堆
|
||||
logid string
|
||||
ctrlType int // 1控赢 2控输 0不控
|
||||
}
|
||||
|
||||
func NewThirteenWaterSceneData(s *base.Scene) *SceneEx {
|
||||
|
@ -121,6 +123,7 @@ func (this *SceneEx) Clear() {
|
|||
this.nowMaxCardsIsIn = true
|
||||
this.PlayerBackup = make(map[int32]*PlayerData)
|
||||
this.LeaveNum = 0
|
||||
this.ctrlType = 0
|
||||
|
||||
for i := 0; i < this.GetPlayerNum(); i++ {
|
||||
if this.seats[i] != nil {
|
||||
|
@ -1310,6 +1313,7 @@ func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
|
|||
allGroup: p.allGroup,
|
||||
TestLog: testLog,
|
||||
RoleId: p.PlayerData.GetRoleId(),
|
||||
PlayerPool: p.playerPool,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1322,6 +1326,7 @@ func (this *SceneEx) SendHandCardOdds() {
|
|||
robotPlayers = append(robotPlayers, seat)
|
||||
} else {
|
||||
seat.odds = this.GetPlayerOdds(seat.Player, this.GameId, this.robotNum > 0)
|
||||
seat.playerPool = int(this.PlayerPoolOdds(seat.Player))
|
||||
if seat.odds > 0 {
|
||||
realPlayersGood = append(realPlayersGood, seat)
|
||||
G += seat.odds
|
||||
|
@ -1387,6 +1392,12 @@ func (this *SceneEx) SendHandCardOdds() {
|
|||
isGood := len(realPlayersGood) > 0 && int32(this.RandInt(1000)) < G
|
||||
isBad := len(realPlayersBad) > 0 && int32(this.RandInt(1000)) < B
|
||||
logger.Logger.Tracef("Thirteen SendHandCardOdds Good:%v G:%v Bad:%v B:%v", isGood, G, isBad, B)
|
||||
if isBad {
|
||||
this.ctrlType = 2
|
||||
}
|
||||
if isGood && !isBad {
|
||||
this.ctrlType = 1
|
||||
}
|
||||
if isGood || isBad {
|
||||
// 按从大到小排序
|
||||
this.cardsSort(cardsArr, cardsGroup)
|
||||
|
|
|
@ -1208,9 +1208,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||
//通知客户端结算结果
|
||||
var billed []*thirteen.Billed
|
||||
playerPool := map[int]int{}
|
||||
// 没离开,剩余玩家结算
|
||||
for _, playerEx := range sceneEx.players {
|
||||
if playerEx != nil && playerEx.IsGameing() {
|
||||
playerPool[int(playerEx.SnId)] = playerEx.playerPool
|
||||
if playerEx.gainCoin > 0 {
|
||||
//税前赢的钱 税收 下注额
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
|
@ -1235,6 +1237,7 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
// 提前离开的
|
||||
for _, playerEx := range sceneEx.PlayerBackup {
|
||||
if playerEx != nil && playerEx.isBilled {
|
||||
playerPool[int(playerEx.SnId)] = playerEx.PlayerPool
|
||||
billed = append(billed, &thirteen.Billed{
|
||||
Pos: proto.Int32(int32(playerEx.Pos)),
|
||||
Coin: proto.Int64(playerEx.Coin),
|
||||
|
@ -1390,7 +1393,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
thirteenWaterType.PlayerCount = len(person)
|
||||
info, err := model.MarshalGameNoteByFIGHT(&thirteenWaterType)
|
||||
if err == nil {
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{
|
||||
Trend20Lately: "",
|
||||
CtrlType: sceneEx.ctrlType,
|
||||
PlayerPool: playerPool,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue