diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index d437604cd..8ecf6d7e7 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -143,8 +143,13 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr "isOverlying": false, } heroConf := this.module.configure.GetHeroConfig(_hero.HeroID) - if heroConf != nil && heroConf.Type == comm.CardTypeStar { - _heroMap["heroID"] = _hero.HeroID + if heroConf != nil && heroConf.Type == comm.CardTypeStar { // 升星卡升星 修改heroid + hid := this.module.configure.GetHeroSpriteStar(_hero.HeroID) + if hid != "" { + _hero.HeroID = hid + _heroMap["heroID"] = _hero.HeroID + } + } // 保存数据 err := this.module.modelHero.ChangeList(session.GetUserId(), _hero.Id, _heroMap) diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index f75e50d1c..bb29b9b43 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -26,6 +26,7 @@ const ( hero_drawupdraw = "game_drawupdraw.json" // 抽卡概率调整 hero_drawcost = "game_drawcost.json" // 抽卡消耗 hero_fusion = "game_herofusion.json" // 卡牌融合 + hero_starupsp = "game_herostarupsp.json" // 精灵升星 ) ///配置管理组件 @@ -55,6 +56,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp hero_comatn: cfg.NewGameComAtn, hero_drawcard: cfg.NewGameDrawCard, hero_fusion: cfg.NewGameHerofusion, + hero_starupsp: cfg.NewGameHeroStarupSp, }) this.drawCardCfg = make(map[string]map[int32][]*cfg.GameDrawCardData, 0) @@ -103,7 +105,8 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp err = fmt.Errorf("%T no is *cfg.Game_drawCard", v) } }) - + hid := this.GetHeroSpriteStar("43901") + fmt.Printf("%s", hid) return } @@ -399,3 +402,17 @@ func (this *configureComp) GetHeroFucionConfig(cid string) (data *cfg.GameHerofu return } + +func (this *configureComp) GetHeroSpriteStar(cid string) (hid string) { + if v, err := this.GetConfigure(hero_starupsp); err == nil { + if configure, ok := v.(*cfg.GameHeroStarupSp); !ok { + err = fmt.Errorf("%T no is *cfg.GameHerofusionData", v) + return + } else { + hid = configure.Get(cid).Starid + } + } else { + err = fmt.Errorf("%T no is *cfg.GameHerofusionData", v) + } + return +} diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 1c550706a..b34f81336 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -1788,118 +1788,6 @@ func (*HeroFusionResp) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{33} } -// 升星精灵升级 -type HeroSpriteStarReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HeroObjID string `protobuf:"bytes,1,opt,name=heroObjID,proto3" json:"heroObjID"` // 英雄对象ID - Hero []*CostCardData `protobuf:"bytes,2,rep,name=hero,proto3" json:"hero"` // 消耗卡牌对象ID - HeroRace []*CostCardData `protobuf:"bytes,3,rep,name=heroRace,proto3" json:"heroRace"` // 消耗种族卡牌对象ID -} - -func (x *HeroSpriteStarReq) Reset() { - *x = HeroSpriteStarReq{} - if protoimpl.UnsafeEnabled { - mi := &file_hero_hero_msg_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeroSpriteStarReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeroSpriteStarReq) ProtoMessage() {} - -func (x *HeroSpriteStarReq) ProtoReflect() protoreflect.Message { - mi := &file_hero_hero_msg_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeroSpriteStarReq.ProtoReflect.Descriptor instead. -func (*HeroSpriteStarReq) Descriptor() ([]byte, []int) { - return file_hero_hero_msg_proto_rawDescGZIP(), []int{34} -} - -func (x *HeroSpriteStarReq) GetHeroObjID() string { - if x != nil { - return x.HeroObjID - } - return "" -} - -func (x *HeroSpriteStarReq) GetHero() []*CostCardData { - if x != nil { - return x.Hero - } - return nil -} - -func (x *HeroSpriteStarReq) GetHeroRace() []*CostCardData { - if x != nil { - return x.HeroRace - } - return nil -} - -// 卡牌升星返回 -type HeroSpriteStarResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Hero *DBHero `protobuf:"bytes,1,opt,name=hero,proto3" json:"hero"` // 英雄对象 -} - -func (x *HeroSpriteStarResp) Reset() { - *x = HeroSpriteStarResp{} - if protoimpl.UnsafeEnabled { - mi := &file_hero_hero_msg_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeroSpriteStarResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeroSpriteStarResp) ProtoMessage() {} - -func (x *HeroSpriteStarResp) ProtoReflect() protoreflect.Message { - mi := &file_hero_hero_msg_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeroSpriteStarResp.ProtoReflect.Descriptor instead. -func (*HeroSpriteStarResp) Descriptor() ([]byte, []int) { - return file_hero_hero_msg_proto_rawDescGZIP(), []int{35} -} - -func (x *HeroSpriteStarResp) GetHero() *DBHero { - if x != nil { - return x.Hero - } - return nil -} - var File_hero_hero_msg_proto protoreflect.FileDescriptor var file_hero_hero_msg_proto_rawDesc = []byte{ @@ -2061,19 +1949,7 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 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, 0x22, 0x10, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x70, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, - 0x61, 0x72, 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, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x52, 0x61, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x73, 0x74, 0x43, - 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x52, 0x61, 0x63, - 0x65, 0x22, 0x31, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x70, 0x72, 0x69, 0x74, 0x65, 0x53, - 0x74, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 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, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2088,7 +1964,7 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte { return file_hero_hero_msg_proto_rawDescData } -var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 39) +var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroInfoReq)(nil), // 0: HeroInfoReq (*HeroInfoResp)(nil), // 1: HeroInfoResp @@ -2124,42 +2000,37 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroDrawCardFloorResp)(nil), // 31: HeroDrawCardFloorResp (*HeroFusionReq)(nil), // 32: HeroFusionReq (*HeroFusionResp)(nil), // 33: HeroFusionResp - (*HeroSpriteStarReq)(nil), // 34: HeroSpriteStarReq - (*HeroSpriteStarResp)(nil), // 35: HeroSpriteStarResp - nil, // 36: HeroPropertyPush.PropertyEntry - nil, // 37: HeroPropertyPush.AddPropertyEntry - nil, // 38: HeroFusionReq.HerosEntry - (*DBHero)(nil), // 39: DBHero + nil, // 34: HeroPropertyPush.PropertyEntry + nil, // 35: HeroPropertyPush.AddPropertyEntry + nil, // 36: HeroFusionReq.HerosEntry + (*DBHero)(nil), // 37: DBHero } var file_hero_hero_msg_proto_depIdxs = []int32{ - 39, // 0: HeroInfoResp.base:type_name -> DBHero - 39, // 1: HeroListResp.list:type_name -> DBHero + 37, // 0: HeroInfoResp.base:type_name -> DBHero + 37, // 1: HeroListResp.list:type_name -> DBHero 5, // 2: HeroStrengthenUplvReq.expCards:type_name -> MapStringInt32 - 39, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero + 37, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero 8, // 4: HeroStrengthenUpStarReq.hero:type_name -> CostCardData 8, // 5: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData - 39, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero - 39, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero - 39, // 8: HeroResonanceResp.hero:type_name -> DBHero - 39, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero - 39, // 10: HeroResonanceResetResp.hero:type_name -> DBHero + 37, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero + 37, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero + 37, // 8: HeroResonanceResp.hero:type_name -> DBHero + 37, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero + 37, // 10: HeroResonanceResetResp.hero:type_name -> DBHero 17, // 11: HeroResonanceUseEnergyReq.energy:type_name -> EnergyData - 39, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero - 39, // 13: HeroAwakenResp.hero:type_name -> DBHero - 36, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry - 37, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry - 39, // 16: HeroLockResp.hero:type_name -> DBHero - 39, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero - 39, // 18: HeroChangePush.list:type_name -> DBHero - 38, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry - 8, // 20: HeroSpriteStarReq.hero:type_name -> CostCardData - 8, // 21: HeroSpriteStarReq.heroRace:type_name -> CostCardData - 39, // 22: HeroSpriteStarResp.hero:type_name -> DBHero - 23, // [23:23] is the sub-list for method output_type - 23, // [23:23] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name + 37, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero + 37, // 13: HeroAwakenResp.hero:type_name -> DBHero + 34, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry + 35, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry + 37, // 16: HeroLockResp.hero:type_name -> DBHero + 37, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero + 37, // 18: HeroChangePush.list:type_name -> DBHero + 36, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_hero_hero_msg_proto_init() } @@ -2577,30 +2448,6 @@ func file_hero_hero_msg_proto_init() { return nil } } - file_hero_hero_msg_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroSpriteStarReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hero_hero_msg_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeroSpriteStarResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2608,7 +2455,7 @@ func file_hero_hero_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hero_hero_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 39, + NumMessages: 37, NumExtensions: 0, NumServices: 0, },