玩法临时修改 等最终配置
This commit is contained in:
parent
876a33e84b
commit
e3509b4023
@ -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 {
|
||||
|
@ -143,6 +143,7 @@ func (this *MapData) InitMap(module *Entertainment, iType int32) {
|
||||
}
|
||||
}
|
||||
this.SetIndelibilityPlat()
|
||||
this.Plat = this.GetPalatData()
|
||||
//this.SetMap() // 方便测试固定地图
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user