diff --git a/modules/comp_configure.go b/modules/comp_configure.go index ee5bf526a..03eff39b1 100644 --- a/modules/comp_configure.go +++ b/modules/comp_configure.go @@ -354,3 +354,22 @@ func (this *MCompConfigure) GetEquipmentConfigureById(equipmentId string) (confi } return } +func (this *MCompConfigure) GetAllItemConfigure() (item []*cfg.GameItemData) { + if v, err := this.GetConfigure(game_item); err == nil { + for _, v1 := range v.(*cfg.GameItem).GetDataMap() { + item = append(item, v1) + } + } + return +} + +func (this *MCompConfigure) GetAllEquipmentConfigure(equipmentId string) (configure []*cfg.GameEquipData) { + + if v, err := this.GetConfigure(game_equip); err == nil { + for _, v1 := range v.(*cfg.GameEquip).GetDataMap() { + configure = append(configure, v1) + } + return + } + return +} diff --git a/modules/gm/module.go b/modules/gm/module.go index a5708bbeb..36aa43755 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -111,25 +111,38 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC var ( res []*cfg.Gameatn ) - if val, err := this.configure.GetYouDaddyConf(); err == nil { - for _, v := range val.GetDataList() { - res = append(res, v.Var...) + equip := this.configure.GetAllItemConfigure() + for _, v1 := range equip { + + res = append(res, &cfg.Gameatn{ + A: "equi", + T: v1.Id, + N: 1, + }) + } + data := this.configure.GetHeroConfigData() + for _, v := range data { + if v.Handbook != -1 { + res = append(res, &cfg.Gameatn{ + A: "hero", + T: v.Hid, + N: 1, + }) } - data := this.configure.GetHeroConfigData() - for _, v := range data { - if v.Handbook != -1 { - res = append(res, &cfg.Gameatn{ - A: "hero", - T: v.Hid, - N: 1, - }) - } - } - code = this.DispenseRes(session, res, true) - if code != pb.ErrorCode_Success { - this.Errorf("资源发放失败,%v", code) - } + } + // 发所有道具 + item := this.configure.GetAllItemConfigure() + for _, v := range item { + res = append(res, &cfg.Gameatn{ + A: "item", + T: v.Id, + N: 100, + }) + } + code = this.DispenseRes(session, res, true) + if code != pb.ErrorCode_Success { + this.Errorf("资源发放失败,%v", code) } this.Debug("使用bingo命令", log.Field{Key: "uid", Value: session.GetUserId()}, diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index 086390902..0e7d3c05d 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -336,8 +336,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq N: 1, } if code, atno := this.module.DispenseAtno(session, []*cfg.Gameatn{res}, true); code == pb.ErrorCode_Success { - var list *pb.AtnoData - list.Atno = atno + + list := &pb.AtnoData{} + list.Atno = append(list.Atno, atno...) rsp.Data = append(rsp.Data, list) for _, v := range atno { if v.A == "hero" { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 15a7a6585..454aacf1a 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -339,22 +339,22 @@ func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DB suite2Star := hero.Suite2Star suite1Lv := hero.Suite1Lv suite2Lv := hero.Suite2Lv - if hero.SameCount > 1 { - // 克隆一个新的 - hero.SameCount -= 1 - hero.Suite1Star = 0 - hero.Suite2Star = 0 - hero.Suite1Lv = 0 - hero.Suite2Lv = 0 - hero.SuiteId = 0 - hero.SuiteExtId = 0 - hero.EquipID = make([]string, 8) - newHero = this.CloneNewHero(uid, hero) - hero.EquipID = make([]string, 8) - hero.SameCount = 1 - update["sameCount"] = 1 - update["horoscopeProperty"] = hero.HoroscopeProperty - } + // if hero.SameCount > 1 { + // // 克隆一个新的 + // hero.SameCount -= 1 + // hero.Suite1Star = 0 + // hero.Suite2Star = 0 + // hero.Suite1Lv = 0 + // hero.Suite2Lv = 0 + // hero.SuiteId = 0 + // hero.SuiteExtId = 0 + // hero.EquipID = make([]string, 8) + // newHero = this.CloneNewHero(uid, hero) + // hero.EquipID = make([]string, 8) + // hero.SameCount = 1 + // update["sameCount"] = 1 + // update["horoscopeProperty"] = hero.HoroscopeProperty + // } // 修改装备属性 并更新 update["suiteId"] = _suiteId update["suiteExtId"] = _suiteExtId @@ -456,6 +456,7 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) { if hero.Id != "" { // objID 为空表示是怪物对象 不享受天赋属性加成 this.resetTalentProperty(hero) + this.moduleHero.moduleHoroscope.ComputeHeroNumeric(hero.Uid, hero) } this.resetJuexingProperty(hero) } @@ -464,9 +465,10 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) { func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DBHero) (err error) { this.PropertyCompute(hero) //重新计算 property 的值 update := map[string]interface{}{ - "property": hero.Property, - "talentProperty": hero.TalentProperty, - "juexProperty": hero.JuexProperty, + "property": hero.Property, + "talentProperty": hero.TalentProperty, + "juexProperty": hero.JuexProperty, + "horoscopeProperty": hero.HoroscopeProperty, } if err = this.ChangeList(session.GetUserId(), hero.Id, update); err != nil { diff --git a/modules/hero/module.go b/modules/hero/module.go index 265f776f5..a5143aa60 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -344,15 +344,15 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero}) return } - if _hero.SameCount > 1 { - _hero.SameCount -= 1 - newHero := this.modelHero.CloneNewHero(session.GetUserId(), _hero) - _changeHero = append(_changeHero, newHero) - } + // if _hero.SameCount > 1 { + // _hero.SameCount -= 1 + // newHero := this.modelHero.CloneNewHero(session.GetUserId(), _hero) + // _changeHero = append(_changeHero, newHero) + // } _heroMap := map[string]interface{}{ - "status": pb.HeroType_HeroTypeKongFu, - "sameCount": 1, - "horoscopeProperty": _hero.HoroscopeProperty, + "status": pb.HeroType_HeroTypeKongFu, + "sameCount": 1, + //"horoscopeProperty": _hero.HoroscopeProperty, } _hero.Status = pb.HeroType_HeroTypeKongFu _hero.SameCount = 1 @@ -660,13 +660,15 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) { hero.SameCount = 1 this.modelHero.PropertyCompute(hero) // 重新计算属性 _heroMap := map[string]interface{}{ - "lv": hero.Lv, - "star": hero.Star, - "juexingLv": hero.JuexingLv, - "sameCount": 1, - "normalSkill": hero.NormalSkill, - "talentProperty": hero.TalentProperty, - "property": hero.Property, + "lv": hero.Lv, + "star": hero.Star, + "juexingLv": hero.JuexingLv, + "sameCount": 1, + "normalSkill": hero.NormalSkill, + "talentProperty": hero.TalentProperty, + "property": hero.Property, + "horoscopeProperty": hero.HoroscopeProperty, + "juexProperty": hero.JuexProperty, } // 保存数据