玩法临时修改 等最终配置

This commit is contained in:
meixiongfeng 2023-11-06 15:33:35 +08:00
parent 876a33e84b
commit e3509b4023
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -143,6 +143,7 @@ func (this *MapData) InitMap(module *Entertainment, iType int32) {
}
}
this.SetIndelibilityPlat()
this.Plat = this.GetPalatData()
//this.SetMap() // 方便测试固定地图
}