宠物宝藏

This commit is contained in:
hahwu 2025-03-19 12:04:48 +08:00
parent e7e8f3aad8
commit bfb9649462
2 changed files with 9 additions and 6 deletions

View File

@ -13,7 +13,7 @@ type FriendTreasureMod struct {
Shift int // 挡位 Shift int // 挡位
Pos []int Pos []int
List map[int]*msg.TreasureInfo List map[int]*msg.TreasureInfo
List2 []int32 // 选择的好友 List2 []int64 // 选择的好友
Status int Status int
} }
@ -36,7 +36,7 @@ func (f *FriendTreasureMod) ZeroUpdate() {
f.Shift = 0 f.Shift = 0
f.Pos = nil f.Pos = nil
f.List = make(map[int]*msg.TreasureInfo) f.List = make(map[int]*msg.TreasureInfo)
f.List2 = nil f.List2 = []int64{}
f.Status = GAME_STATUS_IDLE f.Status = GAME_STATUS_IDLE
} }
@ -44,7 +44,7 @@ func (f *FriendTreasureMod) InitGame(List []*msg.TreasureInfo, List2 []int32) {
for _, v := range List { for _, v := range List {
f.List[int(v.Pos)] = v f.List[int(v.Pos)] = v
} }
f.List2 = List2
f.Status = 1 f.Status = 1
} }
@ -65,6 +65,9 @@ func (f *FriendTreasureMod) Flip(Pos int) ([]*item.Item, error) {
Info.Status = GAME_STATUS_START Info.Status = GAME_STATUS_START
return friendTreasureCfg.GetChestItems(Prob), nil return friendTreasureCfg.GetChestItems(Prob), nil
} }
if Info.Uid != 0 {
f.List2 = append(f.List2, Info.Uid)
}
Info.Status = GAME_STATUS_START Info.Status = GAME_STATUS_START
return nil, nil return nil, nil
} }

View File

@ -19437,7 +19437,7 @@ type ResFriendTreasure struct {
Star int32 `protobuf:"varint,2,opt,name=Star,proto3" json:"Star,omitempty"` // 星级 Star int32 `protobuf:"varint,2,opt,name=Star,proto3" json:"Star,omitempty"` // 星级
Shift int32 `protobuf:"varint,3,opt,name=Shift,proto3" json:"Shift,omitempty"` // 当前挡位 Shift int32 `protobuf:"varint,3,opt,name=Shift,proto3" json:"Shift,omitempty"` // 当前挡位
List []*TreasureInfo `protobuf:"bytes,4,rep,name=List,proto3" json:"List,omitempty"` // 列表 List []*TreasureInfo `protobuf:"bytes,4,rep,name=List,proto3" json:"List,omitempty"` // 列表
List2 []int32 `protobuf:"varint,5,rep,packed,name=List2,proto3" json:"List2,omitempty"` // List2 []int64 `protobuf:"varint,5,rep,packed,name=List2,proto3" json:"List2,omitempty"` // 今日已翻玩家列表
} }
func (x *ResFriendTreasure) Reset() { func (x *ResFriendTreasure) Reset() {
@ -19498,7 +19498,7 @@ func (x *ResFriendTreasure) GetList() []*TreasureInfo {
return nil return nil
} }
func (x *ResFriendTreasure) GetList2() []int32 { func (x *ResFriendTreasure) GetList2() []int64 {
if x != nil { if x != nil {
return x.List2 return x.List2
} }
@ -22641,7 +22641,7 @@ var file_proto_Gameapi_proto_rawDesc = []byte{
0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x75, 0x74, 0x6f, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x75, 0x74, 0x6f,
0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x73, 0x74, 0x32,
0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x22, 0xa6, 0x01, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x22, 0xa6, 0x01,
0x0a, 0x0c, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10,
0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73,
0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,