猫咪小学徒
This commit is contained in:
parent
6e4a804079
commit
cd3edb76fb
@ -830,7 +830,7 @@ func ReqChessEx(player *Player, buf []byte) error {
|
||||
LimitedTimeEventMod := player.PlayMod.getLimitedTimeEventMod()
|
||||
err := LimitedTimeEventMod.LuckyCat(int(req.NewChessId))
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResLimitEventLuckyCat{
|
||||
player.SendErrClienRes(&msg.ResChessEx{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: err.Error(),
|
||||
})
|
||||
@ -841,6 +841,23 @@ func ReqChessEx(player *Player, buf []byte) error {
|
||||
})
|
||||
}
|
||||
|
||||
// 限时事件 小学徒
|
||||
if req.Type == msg.CHESS_EX_TYPE_CHESS_EX_EVENT_LITTLE_APPRENTICE {
|
||||
LimitedTimeEventMod := player.PlayMod.getLimitedTimeEventMod()
|
||||
if LimitedTimeEventMod.CheckExist(limitedTimeEvent.EVENT_TYPE_LITTLE_APPRENTICE) {
|
||||
player.SendErrClienRes(&msg.ResChessEx{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: "小学徒活动已结束",
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
player.TeLog("LimitEventLittleApprentice", map[string]interface{}{
|
||||
"req": int(req.NewChessId),
|
||||
"star": req.CostStar,
|
||||
})
|
||||
}
|
||||
|
||||
player.PlayMod.save()
|
||||
player.PushClientRes(ChessMod.BackData())
|
||||
player.PushClientRes(&msg.ResChessEx{
|
||||
|
||||
@ -26,6 +26,7 @@ const (
|
||||
EVENT_TYPE_LUCKY_CAT = 13 // 幸运猫
|
||||
EVENT_TYPE_CAT_TRICK = 14 // 猫咪戏法
|
||||
EVENT_TYPE_PAYBACK_DAY = 15 // 回收日
|
||||
EVENT_TYPE_LITTLE_APPRENTICE = 16 // 小学徒
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -571,6 +571,7 @@ const (
|
||||
CHESS_EX_TYPE_CHESS_EX_BOX CHESS_EX_TYPE = 2 // 宝箱解锁
|
||||
CHESS_EX_TYPE_CHESS_EX_QUICK_BUY CHESS_EX_TYPE = 3 // 快捷购买
|
||||
CHESS_EX_TYPE_CHESS_EX_EVENT CHESS_EX_TYPE = 4 // 限时事件气泡
|
||||
CHESS_EX_TYPE_CHESS_EX_EVENT_LITTLE_APPRENTICE CHESS_EX_TYPE = 5 // 限时事件小学徒
|
||||
)
|
||||
|
||||
// Enum value maps for CHESS_EX_TYPE.
|
||||
@ -581,6 +582,7 @@ var (
|
||||
2: "CHESS_EX_BOX",
|
||||
3: "CHESS_EX_QUICK_BUY",
|
||||
4: "CHESS_EX_EVENT",
|
||||
5: "CHESS_EX_EVENT_LITTLE_APPRENTICE",
|
||||
}
|
||||
CHESS_EX_TYPE_value = map[string]int32{
|
||||
"CHESS_EX_NONE": 0,
|
||||
@ -588,6 +590,7 @@ var (
|
||||
"CHESS_EX_BOX": 2,
|
||||
"CHESS_EX_QUICK_BUY": 3,
|
||||
"CHESS_EX_EVENT": 4,
|
||||
"CHESS_EX_EVENT_LITTLE_APPRENTICE": 5,
|
||||
}
|
||||
)
|
||||
|
||||
@ -3203,6 +3206,7 @@ type ReqChessEx struct {
|
||||
CostDia int32 `protobuf:"varint,3,opt,name=CostDia,proto3" json:"CostDia,omitempty"`
|
||||
Type CHESS_EX_TYPE `protobuf:"varint,4,opt,name=Type,proto3,enum=tutorial.CHESS_EX_TYPE" json:"Type,omitempty"` //1 气泡 2 宝箱解锁 3 快捷购买 4 限时事件气泡
|
||||
MChessData map[string]int32 `protobuf:"bytes,5,rep,name=mChessData,proto3" json:"mChessData,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
|
||||
CostStar int32 `protobuf:"varint,6,opt,name=CostStar,proto3" json:"CostStar,omitempty"` // 消耗星星
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@ -3272,6 +3276,13 @@ func (x *ReqChessEx) GetMChessData() map[string]int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReqChessEx) GetCostStar() int32 {
|
||||
if x != nil {
|
||||
return x.CostStar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ResChessEx struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code RES_CODE `protobuf:"varint,1,opt,name=code,proto3,enum=tutorial.RES_CODE" json:"code,omitempty"`
|
||||
@ -22217,7 +22228,7 @@ const file_proto_Gameapi_proto_rawDesc = "" +
|
||||
"\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"O\n" +
|
||||
"\x13ResGetChessFromBuff\x12&\n" +
|
||||
"\x04code\x18\x01 \x01(\x0e2\x12.tutorial.RES_CODER\x04code\x12\x10\n" +
|
||||
"\x03msg\x18\x02 \x01(\tR\x03msg\"\x98\x02\n" +
|
||||
"\x03msg\x18\x02 \x01(\tR\x03msg\"\xb4\x02\n" +
|
||||
"\n" +
|
||||
"ReqChessEx\x12\x1e\n" +
|
||||
"\n" +
|
||||
@ -22230,7 +22241,8 @@ const file_proto_Gameapi_proto_rawDesc = "" +
|
||||
"\x04Type\x18\x04 \x01(\x0e2\x17.tutorial.CHESS_EX_TYPER\x04Type\x12D\n" +
|
||||
"\n" +
|
||||
"mChessData\x18\x05 \x03(\v2$.tutorial.ReqChessEx.MChessDataEntryR\n" +
|
||||
"mChessData\x1a=\n" +
|
||||
"mChessData\x12\x1a\n" +
|
||||
"\bCostStar\x18\x06 \x01(\x05R\bCostStar\x1a=\n" +
|
||||
"\x0fMChessDataEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"F\n" +
|
||||
@ -23712,13 +23724,14 @@ const file_proto_Gameapi_proto_rawDesc = "" +
|
||||
"\x18LOG_TYPE_CHARGE_RECEIVED\x10\x13\x12\x11\n" +
|
||||
"\rLOG_TYPE_WISH\x10\x14\x12\x1e\n" +
|
||||
"\x1aLOG_TYPE_FRIEND_BECOME_NPC\x10\x15\x12\x1c\n" +
|
||||
"\x18LOG_TYPE_PLAYROOM_UPVOTE\x10\x16*u\n" +
|
||||
"\x18LOG_TYPE_PLAYROOM_UPVOTE\x10\x16*\x9b\x01\n" +
|
||||
"\rCHESS_EX_TYPE\x12\x11\n" +
|
||||
"\rCHESS_EX_NONE\x10\x00\x12\x13\n" +
|
||||
"\x0fCHESS_EX_BUBBLE\x10\x01\x12\x10\n" +
|
||||
"\fCHESS_EX_BOX\x10\x02\x12\x16\n" +
|
||||
"\x12CHESS_EX_QUICK_BUY\x10\x03\x12\x12\n" +
|
||||
"\x0eCHESS_EX_EVENT\x10\x04*%\n" +
|
||||
"\x0eCHESS_EX_EVENT\x10\x04\x12$\n" +
|
||||
" CHESS_EX_EVENT_LITTLE_APPRENTICE\x10\x05*%\n" +
|
||||
"\tLANG_TYPE\x12\v\n" +
|
||||
"\aLANG_CN\x10\x00\x12\v\n" +
|
||||
"\aLANG_EN\x10\x01*`\n" +
|
||||
|
||||
Loading…
Reference in New Issue
Block a user