From baae7169e4bc55caf75c5a9ba5772a8c4c33977c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 20 Feb 2023 10:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BF=80=E6=B4=BB=E5=A5=97=E8=A3=85ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- modules/smithy/api_forgeequip.go | 9 +++++++++ pb/userexpand.pb.go | 28 +++++++++++++++++++--------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/comm/const.go b/comm/const.go index c1c5d2d6e..e6af34292 100644 --- a/comm/const.go +++ b/comm/const.go @@ -731,7 +731,7 @@ const ( SmithyReelType1 = 1 //炉温消耗减少 SmithyReelType2 = 2 // 材料消耗减少 SmithyReelType3 = 3 // 解锁图纸【紫金雷神锤】 - SmithyReelType4 = 4 + SmithyReelType4 = 4 // 解锁新套装 SmithyReelType5 = 5 // 概率制造两件装备 ) diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 4ca04c2dd..806df5114 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -85,6 +85,15 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq Value: 0, } } + // 是否解锁新套装 + if nextProficiency.Type == comm.SmithyReelType4 { + if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { + rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1) + update := make(map[string]interface{}, 0) + update["suiteId"] = rst.SuiteId + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update) + } + } } if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success { return diff --git a/pb/userexpand.pb.go b/pb/userexpand.pb.go index 9b64e4c8d..dd8075b3a 100644 --- a/pb/userexpand.pb.go +++ b/pb/userexpand.pb.go @@ -56,6 +56,7 @@ type DBUserExpand struct { SociatyTicketBuyNum int32 `protobuf:"varint,32,opt,name=sociatyTicketBuyNum,proto3" json:"sociatyTicketBuyNum" bson:"sociatyTicketBuyNum"` //公会boss挑战券购买次数 SociatyTicket int32 `protobuf:"varint,33,opt,name=sociatyTicket,proto3" json:"sociatyTicket" bson:"sociatyTicket"` //公会boss挑战券数量 Mline map[int32]int32 `protobuf:"bytes,34,rep,name=mline,proto3" json:"mline" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"mline"` //主线关卡最大进度 key难度val是关卡ID + SuiteId []int32 `protobuf:"varint,35,rep,packed,name=suiteId,proto3" json:"suiteId" bson:"suiteId"` // 套装Id } func (x *DBUserExpand) Reset() { @@ -300,11 +301,18 @@ func (x *DBUserExpand) GetMline() map[int32]int32 { return nil } +func (x *DBUserExpand) GetSuiteId() []int32 { + if x != nil { + return x.SuiteId + } + return nil +} + var File_userexpand_proto protoreflect.FileDescriptor var file_userexpand_proto_rawDesc = []byte{ 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xf2, 0x09, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, + 0x74, 0x6f, 0x22, 0x8c, 0x0a, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, @@ -376,15 +384,17 @@ var file_userexpand_proto_rawDesc = []byte{ 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x6d, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6d, 0x6c, 0x69, 0x6e, - 0x65, 0x1a, 0x3a, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x69, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x38, 0x0a, - 0x0a, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 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, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x23, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x1a, 0x3a, 0x0a, 0x0c, 0x45, + 0x78, 0x70, 0x69, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x4d, 0x6c, 0x69, 0x6e, 0x65, + 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 (