还原十三张阶段时间和比牌时间

This commit is contained in:
skeleton 2024-11-26 20:54:31 +08:00
parent 9629db34e6
commit 5f31432a2c
2 changed files with 11 additions and 36 deletions

View File

@ -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

View File

@ -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