diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index bc7e0d9ed..14ec67ee3 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -1,6 +1,7 @@ package entertainment import ( + "crypto/rand" "errors" "fmt" "go_dreamfactory/comm" @@ -9,6 +10,7 @@ import ( "go_dreamfactory/pb" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" + "math/big" "time" "go.mongodb.org/mongo-driver/bson/primitive" @@ -94,14 +96,21 @@ func (this *Room) operateTimeOut(task *timewheel.Task, args ...interface{}) { // 随机一个玩法 func (this *Room) RandomPlayType() (itype int32) { + var weight []int32 // 权重 // 开始随机玩法 list := this.module.configure.GetGameConsumeIntegral() for _, v := range list { weight = append(weight, v.Weight) } + itype = list[comm.GetRandW(weight)].Key - return list[comm.GetRandW(weight)].Key + // 临时修改 50% 概率1类型 + n, _ := rand.Int(rand.Reader, big.NewInt(2)) + if n.Int64() == 0 { + itype = 1 + } + return } func (this *Room) InitRoom(module *Entertainment, p1 *pb.PlayerData, p2 *pb.PlayerData) *Room { diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 173be88b6..836958e20 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -143,6 +143,7 @@ func (this *MapData) InitMap(module *Entertainment, iType int32) { } } this.SetIndelibilityPlat() + this.Plat = this.GetPalatData() //this.SetMap() // 方便测试固定地图 }