掉落规则修改 + 功夫大师挑战塔
This commit is contained in:
parent
2fc9a1cf26
commit
9a241060e1
File diff suppressed because it is too large
Load Diff
@ -57,6 +57,8 @@ func (this *MCompConfigure) Init(service core.IService, module core.IModule, com
|
|||||||
configure.RegisterConfigure(game_drop, cfg.NewGameDrop, this.LoadDropData)
|
configure.RegisterConfigure(game_drop, cfg.NewGameDrop, this.LoadDropData)
|
||||||
configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignData)
|
configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignData)
|
||||||
|
|
||||||
|
_d := this.GetDropData(1001)
|
||||||
|
log.Errorf("%v", _d)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *MCompConfigure) LoadConfigure(name string, fn interface{}) (err error) {
|
func (this *MCompConfigure) LoadConfigure(name string, fn interface{}) (err error) {
|
||||||
@ -70,7 +72,17 @@ func (this *MCompConfigure) LoadDropData() {
|
|||||||
this.hlock.Lock()
|
this.hlock.Lock()
|
||||||
defer this.hlock.Unlock()
|
defer this.hlock.Unlock()
|
||||||
for _, value := range configure.GetDataList() {
|
for _, value := range configure.GetDataList() {
|
||||||
this._dropMap[value.Dropid] = append(this._dropMap[value.Dropid], value)
|
|
||||||
|
if value.Condition == 0 {
|
||||||
|
this._dropMap[value.Dropid] = append(this._dropMap[value.Dropid], value)
|
||||||
|
} else {
|
||||||
|
key := value.Condition
|
||||||
|
key = value.Dropid*100 + key
|
||||||
|
this._dropMap[key] = append(this._dropMap[key], value)
|
||||||
|
for _, v1 := range this._dropMap[value.Dropid] {
|
||||||
|
this._dropMap[key] = append(this._dropMap[key], v1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -16,22 +15,15 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.PagodaGetLi
|
|||||||
|
|
||||||
///获取主线关卡信息
|
///获取主线关卡信息
|
||||||
func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
var (
|
|
||||||
list *pb.DBPagoda
|
|
||||||
)
|
|
||||||
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
|
|
||||||
if list.Id == "" { // 普通塔
|
|
||||||
|
|
||||||
list.Id = primitive.NewObjectID().Hex()
|
list, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
|
||||||
|
if err != nil {
|
||||||
list.Uid = session.GetUserId()
|
code = pb.ErrorCode_DBError
|
||||||
list.PagodaId = 0 // 初始数据0层
|
return
|
||||||
list.Type = comm.PagodaType
|
|
||||||
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list)
|
|
||||||
|
|
||||||
} else if list.Complete {
|
|
||||||
list, _ = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
|
|
||||||
}
|
}
|
||||||
|
// if list.Complete { // 这个版本不给赛季塔信息
|
||||||
|
// list, _ = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
|
||||||
|
// }
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: list})
|
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: list})
|
||||||
return
|
return
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
@ -30,8 +31,14 @@ func (this *ModelPagoda) Init(service core.IService, module core.IModule, comp c
|
|||||||
// 获取爬塔信息
|
// 获取爬塔信息
|
||||||
func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err error) {
|
func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err error) {
|
||||||
result = &pb.DBPagoda{}
|
result = &pb.DBPagoda{}
|
||||||
if err = this.Get(uid, result); err != nil && err == mgo.MongodbNil {
|
if err = this.Get(uid, result); err != nil && err == mgo.MongodbNil { // 初始一条数据
|
||||||
err = nil
|
result.Id = primitive.NewObjectID().Hex()
|
||||||
|
result.Uid = uid
|
||||||
|
result.PagodaId = 0 // 初始数据0层
|
||||||
|
result.Reward = make(map[int32]bool, 0)
|
||||||
|
result.Type = comm.PagodaType
|
||||||
|
err = this.module.modelPagoda.addNewPagoda(uid, result)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +150,9 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res := this.module.configure.GetDropReward(reelcfg.BasicDrop)
|
// 获取掉落id
|
||||||
//res := this.module.configure.GetSmithyDropReward(reelcfg.BasicDrop)
|
newdrop := this.module.modelStove.CheckUnlockSuid(req.ReelId, stove.Data[req.ReelId].Lv, reelcfg.BasicDrop)
|
||||||
|
res := this.module.configure.GetDropReward(newdrop)
|
||||||
if err, atno := this.module.DispenseAtno(session, res, true); err == pb.ErrorCode_Success {
|
if err, atno := this.module.DispenseAtno(session, res, true); err == pb.ErrorCode_Success {
|
||||||
for _, v := range atno {
|
for _, v := range atno {
|
||||||
if eq, err1 := this.module.ModuleEquipment.QueryEquipment(session.GetUserId(), v.O); err1 == pb.ErrorCode_Success {
|
if eq, err1 := this.module.ModuleEquipment.QueryEquipment(session.GetUserId(), v.O); err1 == pb.ErrorCode_Success {
|
||||||
|
@ -207,8 +207,8 @@ func (this *configureComp) LoadProficileData() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) GetSmithyProficileData(reelid int32, proficile int32) *cfg.GameSmithyProficiencyData {
|
func (this *configureComp) GetSmithyProficileData(reelid int32, lv int32) *cfg.GameSmithyProficiencyData {
|
||||||
return this._mapProficile[int64(reelid<<16)+int64(proficile)]
|
return this._mapProficile[int64(reelid<<16)+int64(lv)]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取铁匠铺顾客配置
|
// 获取铁匠铺顾客配置
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -210,3 +211,22 @@ func (this *modelStove) GetRandEquipLv(sz []int32) int32 {
|
|||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *modelStove) CheckUnlockSuid(reelId, lv, dropid int32) int32 {
|
||||||
|
var index int32
|
||||||
|
var szDrop []int32
|
||||||
|
var szLen int32
|
||||||
|
for index = 1; index <= lv; index++ {
|
||||||
|
if conf := this.module.configure.GetSmithyProficileData(reelId, index); conf != nil {
|
||||||
|
if conf.Type == comm.SmithyReelType4 && conf.Value1 != 0 {
|
||||||
|
szDrop = append(szDrop, conf.Value1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
szLen = int32(len(szDrop))
|
||||||
|
dropid *= int32(math.Pow(10, float64(szLen)))
|
||||||
|
for pos, v := range szDrop {
|
||||||
|
dropid += v * int32(math.Pow(10, float64(pos)))
|
||||||
|
}
|
||||||
|
return dropid
|
||||||
|
}
|
||||||
|
@ -13,11 +13,10 @@ import "errors"
|
|||||||
type GameDropData struct {
|
type GameDropData struct {
|
||||||
Id int32
|
Id int32
|
||||||
Dropid int32
|
Dropid int32
|
||||||
|
Condition int32
|
||||||
Prize []*Gameatn
|
Prize []*Gameatn
|
||||||
Star int32
|
Star int32
|
||||||
P int32
|
P int32
|
||||||
EnableType int32
|
|
||||||
Condition int32
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TypeId_GameDropData = 1700203957
|
const TypeId_GameDropData = 1700203957
|
||||||
@ -29,6 +28,7 @@ func (*GameDropData) GetTypeId() int32 {
|
|||||||
func (_v *GameDropData)Deserialize(_buf map[string]interface{}) (err error) {
|
func (_v *GameDropData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["dropid"].(float64); !_ok_ { err = errors.New("dropid error"); return }; _v.Dropid = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["dropid"].(float64); !_ok_ { err = errors.New("dropid error"); return }; _v.Dropid = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["condition"].(float64); !_ok_ { err = errors.New("condition error"); return }; _v.Condition = int32(_tempNum_) }
|
||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
@ -45,8 +45,6 @@ func (_v *GameDropData)Deserialize(_buf map[string]interface{}) (err error) {
|
|||||||
|
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["p"].(float64); !_ok_ { err = errors.New("p error"); return }; _v.P = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["p"].(float64); !_ok_ { err = errors.New("p error"); return }; _v.P = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["enable_type"].(float64); !_ok_ { err = errors.New("enable_type error"); return }; _v.EnableType = int32(_tempNum_) }
|
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["condition"].(float64); !_ok_ { err = errors.New("condition error"); return }; _v.Condition = int32(_tempNum_) }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user