From 5f31432a2c7fa654f44b69f56c4638938004199f Mon Sep 17 00:00:00 2001 From: skeleton Date: Tue, 26 Nov 2024 20:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=8D=81=E4=B8=89=E5=BC=A0?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=97=B6=E9=97=B4=E5=92=8C=E6=AF=94=E7=89=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamerule/thirteen/constants.go | 6 ++--- gamesrv/thirteen/scenepolicy.go | 41 +++++++-------------------------- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/gamerule/thirteen/constants.go b/gamerule/thirteen/constants.go index 64d4508..5752436 100644 --- a/gamerule/thirteen/constants.go +++ b/gamerule/thirteen/constants.go @@ -53,9 +53,9 @@ const ( ) func GetTimeout(param []int64, index int) time.Duration { - if index >= 0 && index < len(param) { - return time.Duration(param[index]) * time.Second - } + //if index >= 0 && index < len(param) { + // return time.Duration(param[index]) * time.Second + //} switch index { case TimeoutStart: return ThirteenWaterStartTimeout diff --git a/gamesrv/thirteen/scenepolicy.go b/gamesrv/thirteen/scenepolicy.go index e8ac247..356cd2e 100644 --- a/gamesrv/thirteen/scenepolicy.go +++ b/gamesrv/thirteen/scenepolicy.go @@ -1109,35 +1109,8 @@ func (this *StateShow) OnEnter(s *base.Scene) { logger.Logger.Tracef("(this *StateShow) OnEnter, sceneid=%v currpos:%v", s.GetSceneId(), sceneEx.currOpPos) sceneEx.ShowCards() // 每人看牌5秒,特殊牌型不算; - //var n int - //var has bool - //for _, v := range sceneEx.players { - // if v != nil && v.IsGameing() && v.cardsO != nil { - // n++ - // if v.cardsO.PokerType == 1 { // 有青龙 - // has = true - // } - // } - //} - //n -= sceneEx.specialTypeNum - //sceneEx.specialTime = time.Second * time.Duration(n*5) - //// pk动画 2秒 - //sceneEx.specialTime += time.Second * 2 - //// 特殊牌型 4.5秒;至尊青龙5.5秒 - //if sceneEx.specialTypeNum > 0 { - // if has { - // sceneEx.specialTime += time.Millisecond * 5500 - // } else { - // sceneEx.specialTime += time.Millisecond * 4500 - // } - //} - - sceneEx.specialTime = 0 - // pk动画 2秒 - sceneEx.specialTime += time.Second * 2 - // 2人且有特殊牌型,直接播放特殊牌型动画' - var n int // 玩家数量 - var has bool // 是否有青龙 + var n int + var has bool for _, v := range sceneEx.players { if v != nil && v.IsGameing() && v.cardsO != nil { n++ @@ -1146,16 +1119,18 @@ func (this *StateShow) OnEnter(s *base.Scene) { } } } - if n == 2 && sceneEx.specialTypeNum > 0 { + n -= sceneEx.specialTypeNum + sceneEx.specialTime = time.Second * time.Duration(n*5) + // pk动画 2秒 + sceneEx.specialTime += time.Second * 2 + // 特殊牌型 4.5秒;至尊青龙5.5秒 + if sceneEx.specialTypeNum > 0 { if has { sceneEx.specialTime += time.Millisecond * 5500 } else { sceneEx.specialTime += time.Millisecond * 4500 } - } else { - sceneEx.specialTime = time.Second * time.Duration(5) } - logger.Logger.Tracef("show cards: %v %v", n, sceneEx.specialTime) if sceneEx.specialTime <= 0 { sceneEx.specialTime = time.Second