From 2cb2b54cf855a902a631ada1982bb4d363b86685 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 29 Jun 2022 17:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B1=E9=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_comatn.json | 12 ++ bin/json/game_heroresonance.json | 126 ++++++++++++++++ modules/hero/api_heroResonance.go | 140 ++++++++++++++++++ modules/hero/api_heroResonanceReset.go | 93 ++++++++++++ modules/hero/api_heroResonanceSelect.go | 57 +++++++ modules/hero/api_heroSkillUp.go | 23 ++- modules/hero/configure_comp.go | 47 +++++- pb/errorcode.pb.go | 44 ++++-- pb/hero_msg.pb.go | 86 ++++++----- pb/proto/errorcode.proto | 4 + pb/proto/hero/hero_msg.proto | 1 + sys/configure/structs/game.comAtn.go | 42 ++++++ sys/configure/structs/game.comAtnData.go | 40 +++++ sys/configure/structs/game.heroResonance.go | 42 ++++++ .../structs/game.heroResonanceData.go | 73 +++++++++ 15 files changed, 766 insertions(+), 64 deletions(-) create mode 100644 bin/json/game_comatn.json create mode 100644 bin/json/game_heroresonance.json create mode 100644 modules/hero/api_heroResonance.go create mode 100644 modules/hero/api_heroResonanceReset.go create mode 100644 modules/hero/api_heroResonanceSelect.go create mode 100644 sys/configure/structs/game.comAtn.go create mode 100644 sys/configure/structs/game.comAtnData.go create mode 100644 sys/configure/structs/game.heroResonance.go create mode 100644 sys/configure/structs/game.heroResonanceData.go diff --git a/bin/json/game_comatn.json b/bin/json/game_comatn.json new file mode 100644 index 000000000..46702ae1b --- /dev/null +++ b/bin/json/game_comatn.json @@ -0,0 +1,12 @@ +[ + { + "index": "hero_reset", + "var": [ + { + "a": "attr", + "t": "rmbmoney", + "n": 20 + } + ] + } +] \ No newline at end of file diff --git a/bin/json/game_heroresonance.json b/bin/json/game_heroresonance.json new file mode 100644 index 000000000..964c21f48 --- /dev/null +++ b/bin/json/game_heroresonance.json @@ -0,0 +1,126 @@ +[ + { + "hid": 15001, + "star": 5, + "energy": 6, + "prize": [ + { + "a": "hero", + "t": "45901", + "n": 1 + } + ], + "need": [ + { + "a": "hero", + "t": "15001", + "n": 1 + }, + { + "a": "attr", + "t": "gold", + "n": 10000 + } + ], + "hppro": 10, + "atkpro": 10, + "defpro": 10, + "hpscale": 736, + "atkscale": 90, + "defscale": 174, + "maxnum": 6 + }, + { + "hid": 25001, + "star": 5, + "energy": 6, + "prize": [ + { + "a": "hero", + "t": "45901", + "n": 1 + } + ], + "need": [ + { + "a": "hero", + "t": "25001", + "n": 1 + }, + { + "a": "attr", + "t": "gold", + "n": 10000 + } + ], + "hppro": 10, + "atkpro": 10, + "defpro": 10, + "hpscale": 106, + "atkscale": 50, + "defscale": 844, + "maxnum": 6 + }, + { + "hid": 35001, + "star": 5, + "energy": 6, + "prize": [ + { + "a": "hero", + "t": "45901", + "n": 1 + } + ], + "need": [ + { + "a": "hero", + "t": "35001", + "n": 1 + }, + { + "a": "attr", + "t": "gold", + "n": 10000 + } + ], + "hppro": 10, + "atkpro": 10, + "defpro": 10, + "hpscale": 255, + "atkscale": 140, + "defscale": 605, + "maxnum": 6 + }, + { + "hid": 44001, + "star": 4, + "energy": 5, + "prize": [ + { + "a": "hero", + "t": "44901", + "n": 1 + } + ], + "need": [ + { + "a": "hero", + "t": "44001", + "n": 1 + }, + { + "a": "attr", + "t": "gold", + "n": 10000 + } + ], + "hppro": 10, + "atkpro": 10, + "defpro": 10, + "hpscale": 105, + "atkscale": 750, + "defscale": 145, + "maxnum": 6 + } +] \ No newline at end of file diff --git a/modules/hero/api_heroResonance.go b/modules/hero/api_heroResonance.go new file mode 100644 index 000000000..cf6060b20 --- /dev/null +++ b/modules/hero/api_heroResonance.go @@ -0,0 +1,140 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/pb" + "strconv" +) + +//参数校验 +func (this *apiComp) HeroResonanceCheck(session comm.IUserSession, req *pb.HeroGongmingReq) (result map[string]interface{}, code comm.ErrorCode) { + if req.HeroObjID == "" || req.CostObjID == "" { + code.Code = pb.ErrorCode_ReqParameterError + return + } + var ( + bCheckOk bool + ) + bCheckOk = false + _hero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 查询目标卡是否存在 + if err != 0 { + code.Code = pb.ErrorCode_HeroNoExist + return + } + _costHero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.CostObjID) // 查询消耗卡是否存在 + if err != 0 { + code.Code = pb.ErrorCode_HeroNoExist + return + } + if _costHero.SameCount < req.Amount { // 消耗卡数量不足 + code.Code = pb.ErrorCode_HeroNoEnough + } + // 共鸣次数判断 + resonConfig, errr := this.moduleHero.configure.GetHeroResonanceConfig(_hero.HeroID) + if errr != nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + if resonConfig.Maxnum >= _hero.ResonateNum { + code.Code = pb.ErrorCode_HeroMaxResonate // 共鸣次数已满 + return + } + + // 消耗英雄的配置id + for _, v := range resonConfig.Need { + if v.A == "hero" && v.T == strconv.Itoa(int(_costHero.HeroID)) { + if req.Amount != v.N { + code.Code = pb.ErrorCode_ReqParameterError + return + } else { + bCheckOk = true + break + } + } + } + if !bCheckOk { // 配置校验不通过 + code.Code = pb.ErrorCode_HeroNoEnough + return + } + bCheckOk = false + // 金币校验 + for _, v := range resonConfig.Need { + if v.A == "attr" { // 查询玩家身上资源是否满足 + value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + if value >= v.N { + bCheckOk = true // 财富校验通过 + break + } + } + } + if !bCheckOk { // 配置校验不通过 + code.Code = pb.ErrorCode_ResNoEnough + return + } + + return +} + +/// 英雄共鸣 +func (this *apiComp) HeroResonance(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroGongmingReq) (code pb.ErrorCode) { + + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroGongmingResp{}) + } + }() + + _hero, errr := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 查询目标卡是否存在 + if errr != 0 { + code = pb.ErrorCode_HeroNoExist + log.Errorf("not find card:%s,%v", req.HeroObjID, errr) + return + } + + code = this.moduleHero.DelCard(req.CostObjID, req.Amount) + if code != 0 { + code = pb.ErrorCode_DBError + return + } + + resonConfig, err1 := this.moduleHero.configure.GetHeroResonanceConfig(_hero.HeroID) + if err1 != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + for _, v := range resonConfig.Need { + if v.A == "attr" { // 查询玩家身上资源是否满足 + value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + if value >= v.N { // 直接删除财富 + code = this.user.AddAttributeValue(session.GetUserId(), v.T, -v.N) // 扣除资源 + break + } else { + code = pb.ErrorCode_ResNoEnough + return + } + } + } + _heroMap := map[string]interface{}{ + "resonateNum": _hero.ResonateNum + resonConfig.Energy, + } + err := this.moduleHero.modelHero.modifyHero(session.GetUserId(), req.HeroObjID, _heroMap) // 修改英雄信息 + if err != nil { + log.Errorf("update hero skill failed:%v", err) + } + // 返还对应初始星级的卡 + for _, v := range resonConfig.Prize { + if v.A == "hero" { + value, err := strconv.Atoi(v.T) + if err != nil { + code = pb.ErrorCode_ConfigurationException + return + } + for i := 0; i < int(v.N); i++ { // 有多少张加多少次 + this.moduleHero.modelHero.createOneHero(session.GetUserId(), int32(value)) + } + } + } + + return +} diff --git a/modules/hero/api_heroResonanceReset.go b/modules/hero/api_heroResonanceReset.go new file mode 100644 index 000000000..c71bbc506 --- /dev/null +++ b/modules/hero/api_heroResonanceReset.go @@ -0,0 +1,93 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" +) + +//参数校验 +func (this *apiComp) ResonanceRestCheck(session comm.IUserSession, req *pb.HeroGongmingResetReq) (result map[string]interface{}, code comm.ErrorCode) { + if req.HeroObjID == "" { + code.Code = pb.ErrorCode_ReqParameterError + return + } + _hero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 查询目标卡是否存在 + if err != 0 { + code.Code = pb.ErrorCode_HeroNoExist + return + } + if _hero.ResonateNum <= 0 { // 没有共鸣 不允许重置 + code.Code = pb.ErrorCode_HeroNoResonate + return + } + + // 共鸣次数判断 + resonConfig, errr := this.moduleHero.configure.GetHeroResonanceConfig(_hero.HeroID) + if errr != nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + + if _hero.ResonateNum*resonConfig.Energy >= _hero.DistributionResonate { + code.Code = pb.ErrorCode_HeroNotNeedResonate // 已经是重置状态 + return + } + + _costConfig, err1 := this.moduleHero.configure.GetHeroResonanceRestConfig() + if err1 != nil { + code.Code = pb.ErrorCode_ConfigNoFound // 没找到配置消耗 + return + } + for _, v := range _costConfig.Var { + if v.A == "attr" { + value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + if value < v.N { + code.Code = pb.ErrorCode_ResNoEnough // 资源不足 + return + } + } + } + result = map[string]interface{}{ + "resonateNum": _hero.ResonateNum * resonConfig.Energy, + "heroObj": _hero, + "_costConfig": _costConfig, + } + return +} + +/// 英雄共鸣 +func (this *apiComp) ResonanceRest(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroGongmingResetReq) (code pb.ErrorCode) { + + restResonance := agrs["resonateNum"].(int32) + _hero := agrs["heroObj"].(*pb.DBHero) + _costConfig := agrs["heroObj"].(cfg.Game_comAtnData) + + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), "GongmingReset", &pb.HeroGongmingResetResp{Hero: _hero, Energy: _hero.ResonateNum}) + } + }() + + for _, v := range _costConfig.Var { + if v.A == "attr" { + code = this.moduleHero.api.user.AddAttributeValue(session.GetUserId(), v.T, -v.N) // 扣资源 + } + } + + for k := range _hero.Energy { // 清除玩家选择的共鸣属性 + delete(_hero.Energy, k) + } + _heroMap := map[string]interface{}{ + "DistributionResonate": restResonance, + "Energy": _hero.Energy, + } + + err := this.moduleHero.modelHero.modifyHero(session.GetUserId(), req.HeroObjID, _heroMap) // 修改英雄信息 + if err != nil { + log.Errorf("update hero skill failed:%v", err) + } + + return +} diff --git a/modules/hero/api_heroResonanceSelect.go b/modules/hero/api_heroResonanceSelect.go new file mode 100644 index 000000000..030c4040d --- /dev/null +++ b/modules/hero/api_heroResonanceSelect.go @@ -0,0 +1,57 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) GongmingUseEnergyCheck(session comm.IUserSession, req *pb.HeroGongmingUseEnergyReq) (result map[string]interface{}, code comm.ErrorCode) { + if req.HeroObjID == "" || req.UseEnergy <= 0 || req.UseType < 0 { + code.Code = pb.ErrorCode_ReqParameterError + return + } + _hero, err := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 查询目标卡是否存在 + if err != 0 { + code.Code = pb.ErrorCode_HeroNoExist + return + } + if _hero.DistributionResonate < req.UseEnergy { // 能量点数不够 + code.Code = pb.ErrorCode_HeroNoEnergy + return + } + result = map[string]interface{}{ + "heroObj": _hero, + } + return +} + +func (this *apiComp) GongmingUseEnergy(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroGongmingUseEnergyReq) (code pb.ErrorCode) { + _hero := agrs["heroObj"].(*pb.DBHero) + + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroGongmingUseEnergyResp{Hero: _hero}) + } + }() + + if _hero == nil { + code = pb.ErrorCode_HeroNoExist + return + } + _hero.Energy[req.UseType] += req.UseEnergy + + _heroMap := map[string]interface{}{ + "DistributionResonate": _hero.ResonateNum - req.UseEnergy, // 减没有分配的能量 + "Energy": _hero.Energy, + } + + err := this.moduleHero.modelHero.modifyHero(session.GetUserId(), req.HeroObjID, _heroMap) // 修改英雄信息 + if err != nil { + code = pb.ErrorCode_DBError + log.Errorf("update hero skill failed:%v", err) + } + + return +} diff --git a/modules/hero/api_heroSkillUp.go b/modules/hero/api_heroSkillUp.go index d35410b83..326d2146c 100644 --- a/modules/hero/api_heroSkillUp.go +++ b/modules/hero/api_heroSkillUp.go @@ -14,6 +14,7 @@ func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.H code.Code = pb.ErrorCode_ReqParameterError return } + var ( tagColor int32 costColor int32 @@ -46,7 +47,8 @@ func (this *apiComp) StrengthenUpSkillCheck(session comm.IUserSession, req *pb.H return } result = map[string]interface{}{ - "heroid": _hero.HeroID, + "heroid": _hero.HeroID, + "heroObj": _hero, } return } @@ -70,6 +72,12 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, agrs map[strin tmpUpSkillID = make(map[int32]*pb.SkillData, 0) probability = make(map[int32]int32, 0) tagHero = agrs["heroid"].(int32) + _hero := agrs["heroObj"].(*pb.DBHero) + if _hero == nil { + code = pb.ErrorCode_HeroNoExist + log.Errorf("not find card:%s,", req.HeroObjID) + return + } log.Debugf("英雄:%d 技能升级", tagHero) config, err := this.moduleHero.configure.GetHeroSkillUpConfig() if err != nil { @@ -80,25 +88,16 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, agrs map[strin log.Debugf("%d", value.Hid) } - _hero, errr := this.moduleHero.modelHero.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) // 查询目标卡是否存在 - if errr != 0 { - code = pb.ErrorCode_HeroNoExist - log.Errorf("not find card:%s,%v", req.HeroObjID, errr) - return - } for index, skill := range _hero.NormalSkill { skillMaxLv := this.moduleHero.configure.GetHeroSkillMaxLvConfig(uint32(skill.SkillID)) if skill.SkillLv < skillMaxLv { // 找到没有满级的技能id tmpUpSkillID[int32(index)] = skill } } - skillconfig, err := this.moduleHero.configure.GetHeroSkillUpConfig() - if err != nil { - return - } + // 获取权重 for k, v := range tmpUpSkillID { - for _, v2 := range skillconfig.GetDataList() { + for _, v2 := range config.GetDataList() { if v2.Hid == tagHero && k == v2.Skillpos && v.SkillLv == v2.Skilllevel { probability[k] = v2.Probability // 设置权重 } diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 9963cc1b6..78d31eddf 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -6,6 +6,7 @@ import ( cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" ) const ( @@ -17,6 +18,8 @@ const ( hero_exp = "game_heroexp.json" // 升级 hero_skillup = "game_heroskilllevel.json" // 英雄技能升级 game_skillatk = "game_skillatk.json" // 英雄技能 + hero_resonance = "game_heroresonance.json" // 英雄共鸣 + hero_comatn = "game_comatn.json" // 英雄共鸣重置 ) ///配置管理组件 @@ -37,8 +40,13 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp hero_exp: cfg.NewGame_heroExp, hero_skillup: cfg.NewGame_heroSkillLevel, game_skillatk: cfg.NewGame_skillAtk, + hero_resonance: cfg.NewGame_heroResonance, + hero_comatn: cfg.NewGame_comAtn, }) - + _data, err := this.GetHeroResonanceRestConfig() + if err == nil { + log.Debugf("%v", _data) + } return } @@ -286,3 +294,40 @@ func (this *configureComp) GetHeroSkillMaxLvConfig(skillId uint32) int32 { return 0 } + +// 通过英雄配置ID获取共鸣配置信息 +func (this *configureComp) GetHeroResonanceConfig(cardConfigID int32) (data *cfg.Game_heroResonanceData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(hero_resonance); err == nil { + if configure, ok := v.(*cfg.Game_heroResonance); !ok { + err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + return + } else { + data = configure.Get(cardConfigID) + } + } else { + err = fmt.Errorf("%T no is *cfg.Game_hero", v) + } + + return +} + +func (this *configureComp) GetHeroResonanceRestConfig() (data *cfg.Game_comAtnData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(hero_comatn); err == nil { + if configure, ok := v.(*cfg.Game_comAtn); !ok { + err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + return + } else { + data = configure.Get("hero_reset") + } + } else { + err = fmt.Errorf("%T no is *cfg.Game_hero", v) + } + + return +} diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 8eb6ac6d0..4f83cc38d 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -67,12 +67,16 @@ const ( ErrorCode_ItemsGridNumUpper ErrorCode = 1202 //背包格子数量已达上限 ErrorCode_ItemsGirdAmountUpper ErrorCode = 1203 //背包格子容量已达上限 // hero - ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在 - ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足 - ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级 - ErrorCode_HeroInitCreat ErrorCode = 1303 //初始化英雄 - ErrorCode_HeroColorErr ErrorCode = 1304 // 品质不匹配 - ErrorCode_HeroSkillUpErr ErrorCode = 1035 // 技能升级失败 + ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在 + ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足 + ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级 + ErrorCode_HeroInitCreat ErrorCode = 1303 //初始化英雄 + ErrorCode_HeroColorErr ErrorCode = 1304 // 品质不匹配 + ErrorCode_HeroSkillUpErr ErrorCode = 1035 // 技能升级失败 + ErrorCode_HeroMaxResonate ErrorCode = 1036 // 达到最大共鸣次数 + ErrorCode_HeroNoResonate ErrorCode = 1037 // 没有共鸣 + ErrorCode_HeroNotNeedResonate ErrorCode = 1038 // 不需要重置共鸣 + ErrorCode_HeroNoEnergy ErrorCode = 1039 // 没有能量点数 // equipment ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器 ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限 @@ -127,6 +131,10 @@ var ( 1303: "HeroInitCreat", 1304: "HeroColorErr", 1035: "HeroSkillUpErr", + 1036: "HeroMaxResonate", + 1037: "HeroNoResonate", + 1038: "HeroNotNeedResonate", + 1039: "HeroNoEnergy", 1400: "EquipmentOnFoundEquipment", 1401: "EquipmentLvlimitReached", } @@ -177,6 +185,10 @@ var ( "HeroInitCreat": 1303, "HeroColorErr": 1304, "HeroSkillUpErr": 1035, + "HeroMaxResonate": 1036, + "HeroNoResonate": 1037, + "HeroNotNeedResonate": 1038, + "HeroNoEnergy": 1039, "EquipmentOnFoundEquipment": 1400, "EquipmentLvlimitReached": 1401, } @@ -213,7 +225,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xf7, 0x07, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xcf, 0x08, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -272,12 +284,18 @@ var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, - 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x8b, 0x08, 0x12, 0x1e, 0x0a, - 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, - 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, - 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x8b, 0x08, 0x12, 0x14, 0x0a, + 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, + 0x10, 0x8c, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, + 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x8d, 0x08, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, + 0x4e, 0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, + 0x8e, 0x08, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, + 0x67, 0x79, 0x10, 0x8f, 0x08, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, + 0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 4811966cb..68c5a1536 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -647,6 +647,7 @@ type HeroGongmingReq struct { HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID CostObjID string `protobuf:"bytes,2,opt,name=costObjID,proto3" json:"costObjID"` // 消耗对象 + Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount"` // 消耗的数量 } func (x *HeroGongmingReq) Reset() { @@ -695,6 +696,13 @@ func (x *HeroGongmingReq) GetCostObjID() string { return "" } +func (x *HeroGongmingReq) GetAmount() int32 { + if x != nil { + return x.Amount + } + return 0 +} + type HeroGongmingResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1132,48 +1140,50 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x6e, 0x67, 0x74, 0x68, 0x65, 0x6e, 0x55, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, - 0x6f, 0x22, 0x4d, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, + 0x6f, 0x22, 0x65, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, - 0x22, 0x76, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, - 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x2a, 0x0a, 0x0a, - 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70, - 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x22, 0x34, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6f, - 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, - 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x4f, - 0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, - 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, - 0x70, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, - 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, - 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, - 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, - 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x3b, 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, - 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, - 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a, - 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, - 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, - 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x48, 0x65, - 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, - 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x76, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, + 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, + 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, + 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, + 0x65, 0x72, 0x67, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, + 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, + 0x22, 0x34, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, + 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x4f, 0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, + 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, 0x70, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, 0x47, + 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, + 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3b, 0x0a, 0x19, 0x48, 0x65, 0x72, + 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, + 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, + 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, + 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, + 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, + 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, + 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, + 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, + 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, + 0x04, 0x68, 0x65, 0x72, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index 3b49e7826..366827ab5 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -56,6 +56,10 @@ enum ErrorCode { HeroInitCreat = 1303; //初始化英雄 HeroColorErr = 1304; // 品质不匹配 HeroSkillUpErr = 1035;// 技能升级失败 + HeroMaxResonate = 1036; // 达到最大共鸣次数 + HeroNoResonate = 1037; // 没有共鸣 + HeroNotNeedResonate = 1038; // 不需要重置共鸣 + HeroNoEnergy = 1039; // 没有能量点数 // equipment EquipmentOnFoundEquipment = 1400; // 未找到武器 EquipmentLvlimitReached = 1401; // 武器等级已达上限 diff --git a/pb/proto/hero/hero_msg.proto b/pb/proto/hero/hero_msg.proto index 7fa3a3759..0429a0685 100644 --- a/pb/proto/hero/hero_msg.proto +++ b/pb/proto/hero/hero_msg.proto @@ -66,6 +66,7 @@ message HeroStrengthenUpSkillResp { message HeroGongmingReq { string heroObjID = 1; // 英雄对象ID string costObjID = 2; // 消耗对象 + int32 amount = 3;// 消耗的数量 } message HeroGongmingResp { diff --git a/sys/configure/structs/game.comAtn.go b/sys/configure/structs/game.comAtn.go new file mode 100644 index 000000000..054643b7d --- /dev/null +++ b/sys/configure/structs/game.comAtn.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_comAtn struct { + _dataMap map[string]*Game_comAtnData + _dataList []*Game_comAtnData +} + +func NewGame_comAtn(_buf []map[string]interface{}) (*Game_comAtn, error) { + _dataList := make([]*Game_comAtnData, 0, len(_buf)) + dataMap := make(map[string]*Game_comAtnData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_comAtnData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Index] = _v + } + } + return &Game_comAtn{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_comAtn) GetDataMap() map[string]*Game_comAtnData { + return table._dataMap +} + +func (table *Game_comAtn) GetDataList() []*Game_comAtnData { + return table._dataList +} + +func (table *Game_comAtn) Get(key string) *Game_comAtnData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.comAtnData.go b/sys/configure/structs/game.comAtnData.go new file mode 100644 index 000000000..9aabf1a9a --- /dev/null +++ b/sys/configure/structs/game.comAtnData.go @@ -0,0 +1,40 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_comAtnData struct { + Index string + Var []*Game_atn +} + +func (Game_comAtnData) GetTypeId() int { + return 1272050592 +} + +func NewGame_comAtnData(_buf map[string]interface{}) (_v *Game_comAtnData, err error) { + _v = &Game_comAtnData{} + { var _ok_ bool; if _v.Index, _ok_ = _buf["index"].(string); !_ok_ { err = errors.New("index error"); return } } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["var"].([]interface{}); !_ok_ { err = errors.New("var error"); return } + + _v.Var = make([]*Game_atn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Game_atn + { 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 = NewGame_atn(_x_); err != nil { return } } + _v.Var = append(_v.Var, _list_v_) + } + } + + return +} diff --git a/sys/configure/structs/game.heroResonance.go b/sys/configure/structs/game.heroResonance.go new file mode 100644 index 000000000..4a439170c --- /dev/null +++ b/sys/configure/structs/game.heroResonance.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_heroResonance struct { + _dataMap map[int32]*Game_heroResonanceData + _dataList []*Game_heroResonanceData +} + +func NewGame_heroResonance(_buf []map[string]interface{}) (*Game_heroResonance, error) { + _dataList := make([]*Game_heroResonanceData, 0, len(_buf)) + dataMap := make(map[int32]*Game_heroResonanceData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_heroResonanceData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Hid] = _v + } + } + return &Game_heroResonance{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_heroResonance) GetDataMap() map[int32]*Game_heroResonanceData { + return table._dataMap +} + +func (table *Game_heroResonance) GetDataList() []*Game_heroResonanceData { + return table._dataList +} + +func (table *Game_heroResonance) Get(key int32) *Game_heroResonanceData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.heroResonanceData.go b/sys/configure/structs/game.heroResonanceData.go new file mode 100644 index 000000000..0805a5a5d --- /dev/null +++ b/sys/configure/structs/game.heroResonanceData.go @@ -0,0 +1,73 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_heroResonanceData struct { + Hid int32 + Star int32 + Energy int32 + Prize []*Game_atn + Need []*Game_atn + Hppro int32 + Atkpro int32 + Defpro int32 + Hpscale int32 + Atkscale int32 + Defscale int32 + Maxnum int32 +} + +func (Game_heroResonanceData) GetTypeId() int { + return 1802653762 +} + +func NewGame_heroResonanceData(_buf map[string]interface{}) (_v *Game_heroResonanceData, err error) { + _v = &Game_heroResonanceData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hid"].(float64); !_ok_ { err = errors.New("hid error"); return }; _v.Hid = 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["energy"].(float64); !_ok_ { err = errors.New("energy error"); return }; _v.Energy = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["prize"].([]interface{}); !_ok_ { err = errors.New("prize error"); return } + + _v.Prize = make([]*Game_atn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Game_atn + { 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 = NewGame_atn(_x_); err != nil { return } } + _v.Prize = append(_v.Prize, _list_v_) + } + } + + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["need"].([]interface{}); !_ok_ { err = errors.New("need error"); return } + + _v.Need = make([]*Game_atn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Game_atn + { 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 = NewGame_atn(_x_); err != nil { return } } + _v.Need = append(_v.Need, _list_v_) + } + } + + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hppro"].(float64); !_ok_ { err = errors.New("hppro error"); return }; _v.Hppro = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["atkpro"].(float64); !_ok_ { err = errors.New("atkpro error"); return }; _v.Atkpro = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["defpro"].(float64); !_ok_ { err = errors.New("defpro error"); return }; _v.Defpro = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hpscale"].(float64); !_ok_ { err = errors.New("hpscale error"); return }; _v.Hpscale = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["atkscale"].(float64); !_ok_ { err = errors.New("atkscale error"); return }; _v.Atkscale = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["defscale"].(float64); !_ok_ { err = errors.New("defscale error"); return }; _v.Defscale = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["maxnum"].(float64); !_ok_ { err = errors.New("maxnum error"); return }; _v.Maxnum = int32(_tempNum_) } + return +}