领奖数据返回
This commit is contained in:
parent
a9f41b7f6c
commit
4d810402d9
File diff suppressed because it is too large
Load Diff
3376
bin/json/game_smithydrop.json
Normal file
3376
bin/json/game_smithydrop.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,8 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (co
|
||||
list.Award += 1
|
||||
update["award"] = list.Award
|
||||
this.module.modelPandaAtlas.modifyPandaAtlasList(session.GetUserId(), update)
|
||||
session.SendMsg(string(this.module.GetType()), "award", &pb.AtlasAwardResp{})
|
||||
session.SendMsg(string(this.module.GetType()), "award", &pb.AtlasAwardResp{
|
||||
Data: list,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
||||
customLv int32 // 定制装备的等级
|
||||
rsp *pb.SmithyForgeEquipResp
|
||||
needTemperatureCos int32 // 需要消耗的温度
|
||||
maxT int32
|
||||
)
|
||||
rsp = &pb.SmithyForgeEquipResp{}
|
||||
update = make(map[string]interface{})
|
||||
@ -53,12 +54,11 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
||||
return
|
||||
}
|
||||
stove.Data[req.ReelId] = &pb.Mastery{
|
||||
Lv: 1,
|
||||
Lv: 0,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
stove.Data[req.ReelId].Value += 1
|
||||
stove.Forge[req.ReelId] += 1
|
||||
|
||||
// 是否是精益打造
|
||||
if req.Quality > 0 {
|
||||
costRes = append(costRes, reelcfg.RefineCos)
|
||||
@ -85,7 +85,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
||||
needTemperatureCos = reelcfg.TemperatureCos
|
||||
// 熟练度减少的温度
|
||||
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
|
||||
needTemperatureCos = reelcfg.TemperatureCos * (1000 - t) / 1000
|
||||
needTemperatureCos = reelcfg.TemperatureCos * (1000 - t) / 1000 // 千分比
|
||||
|
||||
if req.Lava > 0 { // 是否是熔岩打造
|
||||
exemption := this.module.configure.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度
|
||||
@ -133,28 +133,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否提升了熟练度等级
|
||||
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
|
||||
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
|
||||
stove.Data[req.ReelId].Lv += 1
|
||||
stove.Data[req.ReelId].Value = 0
|
||||
// 校验是否解锁了新的图纸
|
||||
if nextProficiency.Type == comm.SmithyReelType3 {
|
||||
stove.Data[nextProficiency.Value1] = &pb.Mastery{
|
||||
Lv: 1,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
// 是否解锁新套装
|
||||
if nextProficiency.Type == comm.SmithyReelType4 {
|
||||
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
||||
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["suiteId"] = rst.SuiteId
|
||||
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update)
|
||||
}
|
||||
}
|
||||
}
|
||||
if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
@ -183,11 +161,41 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
||||
}
|
||||
}
|
||||
|
||||
stove.RecoveTime = configure.Now().Unix()
|
||||
if stoveLvConf := this.module.configure.GetSmithyStoveConf(stove.Lv); stoveLvConf != nil {
|
||||
maxT = stoveLvConf.MaxTemperature
|
||||
}
|
||||
if stove.RecoveTime == 0 && stove.Temperature <= maxT {
|
||||
stove.RecoveTime = configure.Now().Unix()
|
||||
update["recoveTime"] = stove.RecoveTime
|
||||
}
|
||||
stove.Data[req.ReelId].Value += 1
|
||||
stove.Forge[req.ReelId] += 1
|
||||
update["data"] = stove.Data
|
||||
update["recoveTime"] = stove.RecoveTime
|
||||
|
||||
update["forge"] = stove.Forge // 打造次数
|
||||
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
||||
// 检查是否提升了熟练度等级
|
||||
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
|
||||
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
|
||||
stove.Data[req.ReelId].Lv += 1
|
||||
stove.Data[req.ReelId].Value = 0
|
||||
// 校验是否解锁了新的图纸
|
||||
if nextProficiency.Type == comm.SmithyReelType3 {
|
||||
stove.Data[nextProficiency.Value1] = &pb.Mastery{
|
||||
Lv: 1,
|
||||
Value: 0,
|
||||
}
|
||||
}
|
||||
// 是否解锁新套装
|
||||
if nextProficiency.Type == comm.SmithyReelType4 {
|
||||
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
||||
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["suiteId"] = rst.SuiteId
|
||||
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update)
|
||||
}
|
||||
}
|
||||
}
|
||||
rsp.Data = stove
|
||||
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
||||
// 更新图鉴信息
|
||||
|
@ -22,6 +22,7 @@ const (
|
||||
game_smithyatlaslv = "game_smithyatlaslv.json" // 收藏等级积分
|
||||
game_smithyatlasscore = "game_smithyatlasscore.json" // 图鉴积分
|
||||
game_smithytask = "game_smithytask.json" //图鉴任务
|
||||
game_smithyDrop = "game_smithydrop.json" //装备掉落
|
||||
)
|
||||
|
||||
// /配置管理基础组件
|
||||
@ -293,13 +294,13 @@ func (this *configureComp) LoadSmithyAtlasScoreConf() {
|
||||
}
|
||||
|
||||
// 获取图鉴任务配置
|
||||
func(this *configureComp) GetSmithyTask(taskId int32) (data *cfg.GameSmithyTaskData) {
|
||||
func (this *configureComp) GetSmithyTask(taskId int32) (data *cfg.GameSmithyTaskData) {
|
||||
if v, err := this.GetConfigure(game_smithytask); err == nil {
|
||||
if configure, ok := v.(*cfg.GameSmithyTask); ok {
|
||||
data = configure.Get(taskId)
|
||||
return
|
||||
}
|
||||
}
|
||||
this.module.Errorf("GetSmithyTask notfound taskId:%d", taskId)
|
||||
return
|
||||
}
|
||||
if configure, ok := v.(*cfg.GameSmithyTask); ok {
|
||||
data = configure.Get(taskId)
|
||||
return
|
||||
}
|
||||
}
|
||||
this.module.Errorf("GetSmithyTask notfound taskId:%d", taskId)
|
||||
return
|
||||
}
|
||||
|
42
sys/configure/structs/Game.SmithyDrop.go
Normal file
42
sys/configure/structs/Game.SmithyDrop.go
Normal file
@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
type GameSmithyDrop struct {
|
||||
_dataMap map[int32]*GameSmithyDropData
|
||||
_dataList []*GameSmithyDropData
|
||||
}
|
||||
|
||||
func NewGameSmithyDrop(_buf []map[string]interface{}) (*GameSmithyDrop, error) {
|
||||
_dataList := make([]*GameSmithyDropData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameSmithyDropData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameSmithyDropData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Id] = _v
|
||||
}
|
||||
}
|
||||
return &GameSmithyDrop{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameSmithyDrop) GetDataMap() map[int32]*GameSmithyDropData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameSmithyDrop) GetDataList() []*GameSmithyDropData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameSmithyDrop) Get(key int32) *GameSmithyDropData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
58
sys/configure/structs/Game.SmithyDropData.go
Normal file
58
sys/configure/structs/Game.SmithyDropData.go
Normal file
@ -0,0 +1,58 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
import "errors"
|
||||
|
||||
type GameSmithyDropData struct {
|
||||
Id int32
|
||||
Dropid int32
|
||||
Condition int32
|
||||
Prize []*Gameatn
|
||||
Star int32
|
||||
P int32
|
||||
}
|
||||
|
||||
const TypeId_GameSmithyDropData = -1505870933
|
||||
|
||||
func (*GameSmithyDropData) GetTypeId() int32 {
|
||||
return -1505870933
|
||||
}
|
||||
|
||||
func (_v *GameSmithyDropData)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["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 _ok_ bool
|
||||
if _arr_, _ok_ = _buf["prize"].([]interface{}); !_ok_ { err = errors.New("prize error"); return }
|
||||
|
||||
_v.Prize = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Prize = append(_v.Prize, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ 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_) }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameSmithyDropData(_buf map[string]interface{}) (*GameSmithyDropData, error) {
|
||||
v := &GameSmithyDropData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user