diff --git a/bin/json/game_heroawaken.json b/bin/json/game_heroawaken.json new file mode 100644 index 000000000..19661df1b --- /dev/null +++ b/bin/json/game_heroawaken.json @@ -0,0 +1,586 @@ +[ + { + "key": 1, + "hid": 15001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10001", + "n": 10 + } + ] + }, + { + "key": 2, + "hid": 15001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10001", + "n": 20 + } + ] + }, + { + "key": 3, + "hid": 15001, + "phase": 3, + "phasebonus": [ + "121500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10002", + "n": 10 + }, + { + "a": "item", + "t": "10001", + "n": 10 + } + ] + }, + { + "key": 4, + "hid": 15001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10002", + "n": 20 + }, + { + "a": "item", + "t": "10001", + "n": 20 + } + ] + }, + { + "key": 5, + "hid": 15001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10003", + "n": 10 + }, + { + "a": "item", + "t": "10002", + "n": 10 + } + ] + }, + { + "key": 6, + "hid": 15001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10003", + "n": 20 + }, + { + "a": "item", + "t": "10002", + "n": 20 + } + ] + }, + { + "key": 7, + "hid": 25001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10011", + "n": 10 + } + ] + }, + { + "key": 8, + "hid": 25001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10011", + "n": 20 + } + ] + }, + { + "key": 9, + "hid": 25001, + "phase": 3, + "phasebonus": [ + "122500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10012", + "n": 10 + }, + { + "a": "item", + "t": "10011", + "n": 10 + } + ] + }, + { + "key": 10, + "hid": 25001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10012", + "n": 20 + }, + { + "a": "item", + "t": "10011", + "n": 20 + } + ] + }, + { + "key": 11, + "hid": 25001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10013", + "n": 10 + }, + { + "a": "item", + "t": "10012", + "n": 10 + } + ] + }, + { + "key": 12, + "hid": 25001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10013", + "n": 20 + }, + { + "a": "item", + "t": "10012", + "n": 20 + } + ] + }, + { + "key": 13, + "hid": 35001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10021", + "n": 10 + } + ] + }, + { + "key": 14, + "hid": 35001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10021", + "n": 20 + } + ] + }, + { + "key": 15, + "hid": 35001, + "phase": 3, + "phasebonus": [ + "123500100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10022", + "n": 10 + }, + { + "a": "item", + "t": "10021", + "n": 10 + } + ] + }, + { + "key": 16, + "hid": 35001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10022", + "n": 20 + }, + { + "a": "item", + "t": "10021", + "n": 20 + } + ] + }, + { + "key": 17, + "hid": 35001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10023", + "n": 10 + }, + { + "a": "item", + "t": "10022", + "n": 10 + } + ] + }, + { + "key": 18, + "hid": 35001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10023", + "n": 20 + }, + { + "a": "item", + "t": "10022", + "n": 20 + } + ] + }, + { + "key": 19, + "hid": 44001, + "phase": 1, + "phasebonus": [ + "hp", + "950" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 10000 + }, + { + "a": "item", + "t": "10031", + "n": 10 + } + ] + }, + { + "key": 20, + "hid": 44001, + "phase": 2, + "phasebonus": [ + "def", + "70" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 20000 + }, + { + "a": "item", + "t": "10031", + "n": 20 + } + ] + }, + { + "key": 21, + "hid": 44001, + "phase": 3, + "phasebonus": [ + "124400100", + "3" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 30000 + }, + { + "a": "item", + "t": "10032", + "n": 10 + }, + { + "a": "item", + "t": "10031", + "n": 10 + } + ] + }, + { + "key": 22, + "hid": 44001, + "phase": 4, + "phasebonus": [ + "defpro", + "100" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 40000 + }, + { + "a": "item", + "t": "10032", + "n": 20 + }, + { + "a": "item", + "t": "10031", + "n": 20 + } + ] + }, + { + "key": 23, + "hid": 44001, + "phase": 5, + "phasebonus": [ + "speed", + "10" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 50000 + }, + { + "a": "item", + "t": "10033", + "n": 10 + }, + { + "a": "item", + "t": "10032", + "n": 10 + } + ] + }, + { + "key": 24, + "hid": 44001, + "phase": 6, + "phasebonus": [ + "hppro", + "200" + ], + "phaseneed": [ + { + "a": "attr", + "t": "gold", + "n": 60000 + }, + { + "a": "item", + "t": "10033", + "n": 20 + }, + { + "a": "item", + "t": "10032", + "n": 20 + } + ] + } +] \ No newline at end of file diff --git a/modules/hero/api.go b/modules/hero/api.go index 35fd4d2e6..70d57278c 100644 --- a/modules/hero/api.go +++ b/modules/hero/api.go @@ -23,6 +23,7 @@ const ( //消息回复的头名称 ResonanceReset = "resonancereset" // 共鸣重置 StrengthenUpSkill = "strengthenupskill" // 技能强化 StrengthenUpStar = "strengthensupstar" // 英雄升星 + Awaken = "awaken" // 英雄觉醒 ) //组件初始化接口 diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go new file mode 100644 index 000000000..5193e2d51 --- /dev/null +++ b/modules/hero/api_awaken.go @@ -0,0 +1,121 @@ +package hero + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "strconv" +) + +//参数校验 +func (this *apiComp) AwakenCheck(session comm.IUserSession, req *pb.HeroAwakenReq) (result map[string]interface{}, code comm.ErrorCode) { + var ( + costRes map[string]int32 + ) + costRes = make(map[string]int32, 0) + if req.HeroObjID == "" { + code.Code = pb.ErrorCode_ReqParameterError + return + } + var ( + awakenData *cfg.Game_heroAwakenData + bCheckOk bool + ) + bCheckOk = true + + _hero, err := this.moduleHero.GetHero(session.GetUserId(), req.HeroObjID) + + if err != pb.ErrorCode_Success { + code.Code = pb.ErrorCode_HeroNoExist + return + } + AwakenConfig, err1 := this.moduleHero.configure.GetHeroAwakenConfig() + if err1 != nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + for _, v := range AwakenConfig.GetDataMap() { + if v.Hid == _hero.HeroID && v.Phase == _hero.JuexingLv+1 { + awakenData = v + break + } + } + if awakenData == nil { + code.Code = pb.ErrorCode_ConfigNoFound + return + } + // 参数校验 + for _, v := range awakenData.Phaseneed { + if v.A == "attr" { // 消耗玩家身上资源 + curGold := this.user.QueryAttributeValue(session.GetUserId(), v.T) + if curGold < v.N { + bCheckOk = false + break + } + costRes[v.T] = v.N + } else if v.A == "item" { //消耗道具 + itemid, err := strconv.Atoi(v.T) + if err != nil { + curCount := this.moduleHero.items.QueryItemAmount(nil, session.GetUserId(), int32(itemid)) + if curCount < uint32(v.N) { + bCheckOk = false + break + } + } + } + } + if !bCheckOk { + code.Code = pb.ErrorCode_GoldNoEnough + return + } + result = map[string]interface{}{ + "awakenData": awakenData, + "heroObj": _hero, + "costRes": costRes, + } + return +} + +/// 英雄觉醒 +func (this *apiComp) Awaken(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroAwakenReq) (code pb.ErrorCode) { + + awakenData := agrs["awakenData"].(*cfg.Game_heroAwakenData) + _hero := agrs["heroObj"].(*pb.DBHero) + costRes := agrs["costRes"].(map[string]int32) + if _hero == nil || awakenData == nil { + code = pb.ErrorCode_HeroNoExist + return + } + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroAwakenResp{Hero: _hero}) + } + }() + + for _, v := range awakenData.Phaseneed { + if v.A == "attr" { // 消耗玩家身上资源 + if data, ok := costRes[v.T]; ok { + code = this.user.AddAttributeValue(session.GetUserId(), v.T, data) + if code != pb.ErrorCode_Success { + return + } + } + + } else if v.A == "item" { //消耗道具 + itemid, err := strconv.Atoi(v.T) + if err != nil { + code = this.moduleHero.items.AddItem(nil, session.GetUserId(), int32(itemid), -v.N) + if code != pb.ErrorCode_Success { + return + } + } + } + } + + err := this.moduleHero.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + if err != nil { + log.Errorf("PushHeroProperty err!") + } + return +} diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 78d31eddf..e5f8a2310 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -6,7 +6,6 @@ import ( cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/lego/core" - "go_dreamfactory/lego/sys/log" ) const ( @@ -20,6 +19,7 @@ const ( game_skillatk = "game_skillatk.json" // 英雄技能 hero_resonance = "game_heroresonance.json" // 英雄共鸣 hero_comatn = "game_comatn.json" // 英雄共鸣重置 + hero_awaken = "game_heroawaken.json" // 英雄觉醒 ) ///配置管理组件 @@ -42,11 +42,9 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_skillatk: cfg.NewGame_skillAtk, hero_resonance: cfg.NewGame_heroResonance, hero_comatn: cfg.NewGame_comAtn, + hero_awaken: cfg.NewGame_heroAwaken, }) - _data, err := this.GetHeroResonanceRestConfig() - if err == nil { - log.Debugf("%v", _data) - } + return } @@ -331,3 +329,19 @@ func (this *configureComp) GetHeroResonanceRestConfig() (data *cfg.Game_comAtnDa return } +func (this *configureComp) GetHeroAwakenConfig() (configure *cfg.Game_heroAwaken, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(hero_awaken); err == nil { + if configure, ok = v.(*cfg.Game_heroAwaken); !ok { + err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + return + } + } else { + err = fmt.Errorf("%T no is *cfg.Game_hero", v) + } + + return +} diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 46b850f12..e8253575c 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -981,17 +981,16 @@ func (x *HeroResonanceUseEnergyResp) GetHero() *DBHero { } // 觉醒 -type HeroJuexingReq struct { +type HeroAwakenReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID - CostItmes *ItemData `protobuf:"bytes,2,opt,name=costItmes,proto3" json:"costItmes"` // 觉醒消耗待定 + HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID } -func (x *HeroJuexingReq) Reset() { - *x = HeroJuexingReq{} +func (x *HeroAwakenReq) Reset() { + *x = HeroAwakenReq{} if protoimpl.UnsafeEnabled { mi := &file_hero_hero_msg_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -999,13 +998,13 @@ func (x *HeroJuexingReq) Reset() { } } -func (x *HeroJuexingReq) String() string { +func (x *HeroAwakenReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HeroJuexingReq) ProtoMessage() {} +func (*HeroAwakenReq) ProtoMessage() {} -func (x *HeroJuexingReq) ProtoReflect() protoreflect.Message { +func (x *HeroAwakenReq) ProtoReflect() protoreflect.Message { mi := &file_hero_hero_msg_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1017,27 +1016,20 @@ func (x *HeroJuexingReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HeroJuexingReq.ProtoReflect.Descriptor instead. -func (*HeroJuexingReq) Descriptor() ([]byte, []int) { +// Deprecated: Use HeroAwakenReq.ProtoReflect.Descriptor instead. +func (*HeroAwakenReq) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{18} } -func (x *HeroJuexingReq) GetHeroObjID() string { +func (x *HeroAwakenReq) GetHeroObjID() string { if x != nil { return x.HeroObjID } return "" } -func (x *HeroJuexingReq) GetCostItmes() *ItemData { - if x != nil { - return x.CostItmes - } - return nil -} - // 觉醒返回 -type HeroJuexingResp struct { +type HeroAwakenResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1045,8 +1037,8 @@ type HeroJuexingResp struct { Hero *DBHero `protobuf:"bytes,1,opt,name=hero,proto3" json:"hero"` // 英雄对象 } -func (x *HeroJuexingResp) Reset() { - *x = HeroJuexingResp{} +func (x *HeroAwakenResp) Reset() { + *x = HeroAwakenResp{} if protoimpl.UnsafeEnabled { mi := &file_hero_hero_msg_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1054,13 +1046,13 @@ func (x *HeroJuexingResp) Reset() { } } -func (x *HeroJuexingResp) String() string { +func (x *HeroAwakenResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HeroJuexingResp) ProtoMessage() {} +func (*HeroAwakenResp) ProtoMessage() {} -func (x *HeroJuexingResp) ProtoReflect() protoreflect.Message { +func (x *HeroAwakenResp) ProtoReflect() protoreflect.Message { mi := &file_hero_hero_msg_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1072,12 +1064,12 @@ func (x *HeroJuexingResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HeroJuexingResp.ProtoReflect.Descriptor instead. -func (*HeroJuexingResp) Descriptor() ([]byte, []int) { +// Deprecated: Use HeroAwakenResp.ProtoReflect.Descriptor instead. +func (*HeroAwakenResp) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{19} } -func (x *HeroJuexingResp) GetHero() *DBHero { +func (x *HeroAwakenResp) GetHero() *DBHero { if x != nil { return x.Hero } @@ -1332,42 +1324,39 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 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, 0x22, 0x29, 0x0a, 0x0d, 0x48, - 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, - 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x68, - 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x34, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, - 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, - 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0xa4, 0x02, 0x0a, - 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, - 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x72, - 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x72, 0x6f, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x2d, 0x0a, 0x0d, + 0x48, 0x65, 0x72, 0x6f, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 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, 0x30, 0x0a, 0x0e, 0x48, + 0x65, 0x72, 0x6f, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 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, 0x29, 0x0a, + 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x34, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, + 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x06, 0x68, 0x65, + 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0xa4, + 0x02, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x48, + 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, + 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x64, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1402,8 +1391,8 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroResonanceResetResp)(nil), // 15: pb.HeroResonanceResetResp (*HeroResonanceUseEnergyReq)(nil), // 16: pb.HeroResonanceUseEnergyReq (*HeroResonanceUseEnergyResp)(nil), // 17: pb.HeroResonanceUseEnergyResp - (*HeroJuexingReq)(nil), // 18: pb.HeroJuexingReq - (*HeroJuexingResp)(nil), // 19: pb.HeroJuexingResp + (*HeroAwakenReq)(nil), // 18: pb.HeroAwakenReq + (*HeroAwakenResp)(nil), // 19: pb.HeroAwakenResp (*HeroChoukaReq)(nil), // 20: pb.HeroChoukaReq (*HeroChoukaResp)(nil), // 21: pb.HeroChoukaResp (*HeroProperty)(nil), // 22: pb.HeroProperty @@ -1423,16 +1412,15 @@ var file_hero_hero_msg_proto_depIdxs = []int32{ 25, // 8: pb.HeroResonanceResp.upStarCard:type_name -> pb.DBHero 25, // 9: pb.HeroResonanceResetResp.hero:type_name -> pb.DBHero 25, // 10: pb.HeroResonanceUseEnergyResp.hero:type_name -> pb.DBHero - 4, // 11: pb.HeroJuexingReq.costItmes:type_name -> pb.ItemData - 25, // 12: pb.HeroJuexingResp.hero:type_name -> pb.DBHero - 25, // 13: pb.HeroChoukaResp.heroes:type_name -> pb.DBHero - 23, // 14: pb.HeroProperty.property:type_name -> pb.HeroProperty.PropertyEntry - 24, // 15: pb.HeroProperty.addProperty:type_name -> pb.HeroProperty.AddPropertyEntry - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 25, // 11: pb.HeroAwakenResp.hero:type_name -> pb.DBHero + 25, // 12: pb.HeroChoukaResp.heroes:type_name -> pb.DBHero + 23, // 13: pb.HeroProperty.property:type_name -> pb.HeroProperty.PropertyEntry + 24, // 14: pb.HeroProperty.addProperty:type_name -> pb.HeroProperty.AddPropertyEntry + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_hero_hero_msg_proto_init() } @@ -1659,7 +1647,7 @@ func file_hero_hero_msg_proto_init() { } } file_hero_hero_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroJuexingReq); i { + switch v := v.(*HeroAwakenReq); i { case 0: return &v.state case 1: @@ -1671,7 +1659,7 @@ func file_hero_hero_msg_proto_init() { } } file_hero_hero_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroJuexingResp); i { + switch v := v.(*HeroAwakenResp); i { case 0: return &v.state case 1: diff --git a/pb/proto/hero/hero_msg.proto b/pb/proto/hero/hero_msg.proto index c8a0e28b5..a8c4b6e05 100644 --- a/pb/proto/hero/hero_msg.proto +++ b/pb/proto/hero/hero_msg.proto @@ -97,13 +97,12 @@ message HeroResonanceUseEnergyResp { } // 觉醒 -message HeroJuexingReq { +message HeroAwakenReq { string heroObjID = 1; // 英雄对象ID - ItemData costItmes = 2; // 觉醒消耗待定 } // 觉醒返回 -message HeroJuexingResp { +message HeroAwakenResp { DBHero hero = 1; // 英雄对象 } diff --git a/sys/configure/structs/game.heroAwaken.go b/sys/configure/structs/game.heroAwaken.go new file mode 100644 index 000000000..1f4bace1e --- /dev/null +++ b/sys/configure/structs/game.heroAwaken.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_heroAwaken struct { + _dataMap map[int32]*Game_heroAwakenData + _dataList []*Game_heroAwakenData +} + +func NewGame_heroAwaken(_buf []map[string]interface{}) (*Game_heroAwaken, error) { + _dataList := make([]*Game_heroAwakenData, 0, len(_buf)) + dataMap := make(map[int32]*Game_heroAwakenData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_heroAwakenData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &Game_heroAwaken{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_heroAwaken) GetDataMap() map[int32]*Game_heroAwakenData { + return table._dataMap +} + +func (table *Game_heroAwaken) GetDataList() []*Game_heroAwakenData { + return table._dataList +} + +func (table *Game_heroAwaken) Get(key int32) *Game_heroAwakenData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.heroAwakenData.go b/sys/configure/structs/game.heroAwakenData.go new file mode 100644 index 000000000..a2408aacf --- /dev/null +++ b/sys/configure/structs/game.heroAwakenData.go @@ -0,0 +1,59 @@ + +//------------------------------------------------------------------------------ +// +// 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_heroAwakenData struct { + Key int32 + Hid int32 + Phase int32 + Phasebonus []string + Phaseneed []*Game_atn +} + +func (Game_heroAwakenData) GetTypeId() int { + return -1396976663 +} + +func NewGame_heroAwakenData(_buf map[string]interface{}) (_v *Game_heroAwakenData, err error) { + _v = &Game_heroAwakenData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) } + { 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["phase"].(float64); !_ok_ { err = errors.New("phase error"); return }; _v.Phase = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["phasebonus"].([]interface{}); !_ok_ { err = errors.New("phasebonus error"); return } + + _v.Phasebonus = make([]string, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ string + { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } + _v.Phasebonus = append(_v.Phasebonus, _list_v_) + } + } + + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["phaseneed"].([]interface{}); !_ok_ { err = errors.New("phaseneed error"); return } + + _v.Phaseneed = 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.Phaseneed = append(_v.Phaseneed, _list_v_) + } + } + + return +}