diff --git a/bin/json/game_item.json b/bin/json/game_item.json index 3c166a170..c20fcf117 100644 --- a/bin/json/game_item.json +++ b/bin/json/game_item.json @@ -79,7 +79,7 @@ }, "usetype": 1, "color": 5, - "bagtype": 3, + "bagtype": 2, "index": 2, "special_type": 0, "time": 0, @@ -88,7 +88,7 @@ "synthetize_num": 50, "access": 0, "use_skip": 0, - "upper_limit": 999, + "upper_limit": -1, "uselv": 0, "isani": 0, "star": 6, @@ -583,7 +583,7 @@ }, "usetype": 1, "color": 5, - "bagtype": 3, + "bagtype": 2, "index": 17, "special_type": 0, "time": 0, @@ -592,7 +592,7 @@ "synthetize_num": 50, "access": 0, "use_skip": 0, - "upper_limit": 999, + "upper_limit": -1, "uselv": 0, "isani": 0, "star": 6, @@ -619,7 +619,7 @@ }, "usetype": 1, "color": 5, - "bagtype": 3, + "bagtype": 2, "index": 18, "special_type": 0, "time": 0, @@ -628,7 +628,7 @@ "synthetize_num": 50, "access": 0, "use_skip": 0, - "upper_limit": 999, + "upper_limit": -1, "uselv": 0, "isani": 0, "star": 6, diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index 51add5257..83a51bfb7 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -49,7 +49,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade return } //找到下一个等级的相关配置 - if intensify, err = this.module.configure.GetEquipmentIntensifyConfigureById(equipment.Lv); err != nil || intensify.Need == nil || len(intensify.Need) == 0 { + if intensify, err = this.module.configure.GetEquipmentIntensifyConfigureById(conf.Star, equipment.Lv); err != nil || intensify.Need == nil || len(intensify.Need) == 0 { this.module.Errorf("Equip_Check err:%v", err) code = pb.ErrorCode_EquipmentLvlimitReached return diff --git a/modules/equipment/configure.go b/modules/equipment/configure.go index 41fc16eb0..6da2c84bc 100644 --- a/modules/equipment/configure.go +++ b/modules/equipment/configure.go @@ -147,17 +147,22 @@ func (this *configureComp) GetEquipmentIntensifyConfigure() (configure *cfg.Game } //获取武器等级消耗表 -func (this *configureComp) GetEquipmentIntensifyConfigureById(Id int32) (configure *cfg.Game_equipIntensifyData, err error) { +func (this *configureComp) GetEquipmentIntensifyConfigureById(star, lv int32) (configure *cfg.Game_equipIntensifyData, err error) { var ( - v interface{} - ok bool + v interface{} ) if v, err = this.GetConfigure(equip_intensify); err != nil { this.module.Errorf("err:%v", err) return } else { - if configure, ok = v.(*cfg.Game_equipIntensify).GetDataMap()[Id]; !ok { - err = fmt.Errorf("EquipmentConfigure not found:%d ", Id) + for _, v1 := range v.(*cfg.Game_equipIntensify).GetDataList() { + + if v1.Star == star && v1.Level == lv { + configure = v1 + } + } + if configure == nil { + err = fmt.Errorf("EquipmentConfigure not found star :%d lv:%d", star, lv) this.module.Errorf("err:%v", err) return } diff --git a/modules/hero/module.go b/modules/hero/module.go index a64692368..967961be2 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -129,7 +129,7 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, return pb.ErrorCode_ReqParameterError } hero, err := this.modelHero.createOneHero(session.GetUserId(), heroConfId) - if err == nil { + if err != nil { return pb.ErrorCode_HeroCreate } hero.Lv = lv diff --git a/modules/items/api_useItem.go b/modules/items/api_useItem.go index d19da4bb1..359df3d3f 100644 --- a/modules/items/api_useItem.go +++ b/modules/items/api_useItem.go @@ -49,7 +49,7 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq) return } sale := RandomProps(prop) - if code = this.module.ModuleHero.GetSpecifiedHero(session, sale.Prize.T, sale.Star, 0, int32(req.Amount)); code != pb.ErrorCode_Success { + if code = this.module.ModuleHero.GetSpecifiedHero(session, sale.Prize.T, sale.Star, 1, int32(req.Amount)); code != pb.ErrorCode_Success { return } case 4: //自选宝箱 diff --git a/sys/configure/structs/game.equipIntensify.go b/sys/configure/structs/game.equipIntensify.go index a0a3de41d..591107eb3 100644 --- a/sys/configure/structs/game.equipIntensify.go +++ b/sys/configure/structs/game.equipIntensify.go @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -9,8 +8,8 @@ package cfg type Game_equipIntensify struct { - _dataMap map[int32]*Game_equipIntensifyData - _dataList []*Game_equipIntensifyData + _dataMap map[int32]*Game_equipIntensifyData + _dataList []*Game_equipIntensifyData } func NewGame_equipIntensify(_buf []map[string]interface{}) (*Game_equipIntensify, error) { @@ -24,19 +23,17 @@ func NewGame_equipIntensify(_buf []map[string]interface{}) (*Game_equipIntensify dataMap[_v.Key] = _v } } - return &Game_equipIntensify{_dataList:_dataList, _dataMap:dataMap}, nil + return &Game_equipIntensify{_dataList: _dataList, _dataMap: dataMap}, nil } func (table *Game_equipIntensify) GetDataMap() map[int32]*Game_equipIntensifyData { - return table._dataMap + return table._dataMap } func (table *Game_equipIntensify) GetDataList() []*Game_equipIntensifyData { - return table._dataList + return table._dataList } func (table *Game_equipIntensify) Get(key int32) *Game_equipIntensifyData { - return table._dataMap[key] + return table._dataMap[key] } - -