diff --git a/bin/json/game_global.json b/bin/json/game_global.json index 4bb6eb8f8..d68710de7 100644 --- a/bin/json/game_global.json +++ b/bin/json/game_global.json @@ -382,7 +382,7 @@ ], "VIP_DaysSent": 7, "MonthlyCard_DaysSent": 30, - "opennewguide": 1, + "opennewguide": 0, "library_StoryUnlocking": 3, "ps_recovery": 300, "ps_ul": 2000, @@ -444,45 +444,84 @@ "n": 1 }, "Inletopening": 1, - "VikingExpedition_cos": { - "a": "item", - "t": "100100", - "n": 6 + "gold": { + "a": "attr", + "t": "gold", + "n": 0 }, - "dreamland_cos": { - "a": "item", - "t": "100100", - "n": 3 + "diamond": { + "a": "attr", + "t": "diamond", + "n": 0 }, - "enchantboss_cos": { - "a": "item", - "t": "100100", - "n": 9 + "ps": { + "a": "attr", + "t": "ps", + "n": 0 }, - "hunting_cos": { + "recruit": { "a": "item", - "t": "100100", - "n": 6 + "t": "30001", + "n": 0 }, - "VikingExpedition_Return": { + "GuildBoss_buy": [ + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + }, + { + "a": "attr", + "t": "diamond", + "n": 1000 + } + ], + "GuildBoss_InitialNum": 5, + "GuildBoss_BuyGet": { "a": "item", - "t": "100100", - "n": 5 + "t": "100006", + "n": 1 }, - "dreamland_Return": { - "a": "item", - "t": "100100", - "n": 2 - }, - "enchantboss_Return": { - "a": "item", - "t": "100100", - "n": 8 - }, - "hunting_Return": { - "a": "item", - "t": "100100", - "n": 5 - } + "GuildBoss_MaxBuyNum": 5 } ] \ No newline at end of file diff --git a/modules/moonfantasy/api_battle.go b/modules/moonfantasy/api_battle.go index 69558a451..45c6c9df5 100644 --- a/modules/moonfantasy/api_battle.go +++ b/modules/moonfantasy/api_battle.go @@ -81,7 +81,7 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle // if umfantasy, err = this.module.modelUserMF.queryUsermfantasy(session.GetUserId()); err != nil { // cd = pb.ErrorCode_CacheReadError // } - if cd = this.module.ConsumeRes(session, []*cfg.Gameatn{this.module.configure.GetGlobalConf().DreamlandCos}, true); cd != pb.ErrorCode_Success { + if cd = this.module.CheckRes(session, boss.PsConsume); cd != pb.ErrorCode_Success { return } // if umfantasy.Ticket < this.module.configure.GetGlobalConf().DreamlandCos { diff --git a/modules/moonfantasy/api_receive.go b/modules/moonfantasy/api_receive.go index 28f159f89..4fdd68fad 100644 --- a/modules/moonfantasy/api_receive.go +++ b/modules/moonfantasy/api_receive.go @@ -35,10 +35,17 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MoonfantasyRecei return } if !iswin { - code = pb.ErrorCode_MoonfantasyBattleNoWin + if code = this.module.ConsumeRes(session, boss.PsMg, true); code != pb.ErrorCode_Success { + return + } return + } else { + if code = this.module.ConsumeRes(session, boss.PsConsume, true); code != pb.ErrorCode_Success { + return + } + this.module.DispenseRes(session, boss.Prize, true) } - this.module.DispenseRes(session, boss.Prize, true) + session.SendMsg(string(this.module.GetType()), "receive", &pb.MoonfantasyReceiveResp{Issucc: true}) return } diff --git a/sys/configure/structs/game.globalData.go b/sys/configure/structs/game.globalData.go index 27b4a3824..23f2fafe6 100644 --- a/sys/configure/structs/game.globalData.go +++ b/sys/configure/structs/game.globalData.go @@ -158,14 +158,14 @@ type GameGlobalData struct { PsBuy []*Gameatn PsItem *Gameatn Inletopening int32 - VikingExpeditionCos *Gameatn - DreamlandCos *Gameatn - EnchantbossCos *Gameatn - HuntingCos *Gameatn - VikingExpeditionReturn *Gameatn - DreamlandReturn *Gameatn - EnchantbossReturn *Gameatn - HuntingReturn *Gameatn + Gold *Gameatn + Diamond *Gameatn + Ps *Gameatn + Recruit *Gameatn + GuildBossBuy []*Gameatn + GuildBossInitialNum int32 + GuildBossBuyGet *Gameatn + GuildBossMaxBuyNum int32 } const TypeId_GameGlobalData = 477542761 @@ -673,14 +673,27 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["ps_item"].(map[string]interface{}); !_ok_ { err = errors.New("ps_item error"); return }; if _v.PsItem, err = DeserializeGameatn(_x_); err != nil { return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Inletopening"].(float64); !_ok_ { err = errors.New("Inletopening error"); return }; _v.Inletopening = int32(_tempNum_) } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["VikingExpedition_cos"].(map[string]interface{}); !_ok_ { err = errors.New("VikingExpedition_cos error"); return }; if _v.VikingExpeditionCos, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["dreamland_cos"].(map[string]interface{}); !_ok_ { err = errors.New("dreamland_cos error"); return }; if _v.DreamlandCos, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["enchantboss_cos"].(map[string]interface{}); !_ok_ { err = errors.New("enchantboss_cos error"); return }; if _v.EnchantbossCos, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["hunting_cos"].(map[string]interface{}); !_ok_ { err = errors.New("hunting_cos error"); return }; if _v.HuntingCos, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["VikingExpedition_Return"].(map[string]interface{}); !_ok_ { err = errors.New("VikingExpedition_Return error"); return }; if _v.VikingExpeditionReturn, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["dreamland_Return"].(map[string]interface{}); !_ok_ { err = errors.New("dreamland_Return error"); return }; if _v.DreamlandReturn, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["enchantboss_Return"].(map[string]interface{}); !_ok_ { err = errors.New("enchantboss_Return error"); return }; if _v.EnchantbossReturn, err = DeserializeGameatn(_x_); err != nil { return } } - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["hunting_Return"].(map[string]interface{}); !_ok_ { err = errors.New("hunting_Return error"); return }; if _v.HuntingReturn, err = DeserializeGameatn(_x_); err != nil { return } } + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["gold"].(map[string]interface{}); !_ok_ { err = errors.New("gold error"); return }; if _v.Gold, err = DeserializeGameatn(_x_); err != nil { return } } + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["diamond"].(map[string]interface{}); !_ok_ { err = errors.New("diamond error"); return }; if _v.Diamond, err = DeserializeGameatn(_x_); err != nil { return } } + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["ps"].(map[string]interface{}); !_ok_ { err = errors.New("ps error"); return }; if _v.Ps, err = DeserializeGameatn(_x_); err != nil { return } } + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["recruit"].(map[string]interface{}); !_ok_ { err = errors.New("recruit error"); return }; if _v.Recruit, err = DeserializeGameatn(_x_); err != nil { return } } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["GuildBoss_buy"].([]interface{}); !_ok_ { err = errors.New("GuildBoss_buy error"); return } + + _v.GuildBossBuy = 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.GuildBossBuy = append(_v.GuildBossBuy, _list_v_) + } + } + + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["GuildBoss_InitialNum"].(float64); !_ok_ { err = errors.New("GuildBoss_InitialNum error"); return }; _v.GuildBossInitialNum = int32(_tempNum_) } + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["GuildBoss_BuyGet"].(map[string]interface{}); !_ok_ { err = errors.New("GuildBoss_BuyGet error"); return }; if _v.GuildBossBuyGet, err = DeserializeGameatn(_x_); err != nil { return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["GuildBoss_MaxBuyNum"].(float64); !_ok_ { err = errors.New("GuildBoss_MaxBuyNum error"); return }; _v.GuildBossMaxBuyNum = int32(_tempNum_) } return }