合成功能

This commit is contained in:
DESKTOP-45ANQ2C\unis 2024-11-22 10:06:28 +08:00
parent eb265f69e8
commit 7b76389509
10 changed files with 1524 additions and 810 deletions

View File

@ -324,6 +324,8 @@ const (
GainWayClientUpgrade = 115 //客户端升级奖励
GainWayLottery = 116 //开奖码抽奖
GainWayGuide2 = 117 // 竞技馆引导奖励
GainWayCompound = 118 // 道具合成消耗
GainWayCompoundGain = 119 // 道具合成获得
)
// 后台选择 金币变化类型 的充值 类型id号起始

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -369,7 +369,7 @@ type CSUpBagInfo struct {
ItemId int32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //物品ID
ItemNum int32 `protobuf:"varint,2,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //物品数量
Opt int32 `protobuf:"varint,3,opt,name=Opt,proto3" json:"Opt,omitempty"` //操作 0.使用 1.赠送 2.出售 3.兑换 4.分解
Opt int32 `protobuf:"varint,3,opt,name=Opt,proto3" json:"Opt,omitempty"` //操作 0.使用 1.赠送 2.出售 3.兑换 4.分解 5.合成
AcceptSnId int32 `protobuf:"varint,4,opt,name=AcceptSnId,proto3" json:"AcceptSnId,omitempty"` //被赠送玩家id
NowEffect int32 `protobuf:"varint,5,opt,name=NowEffect,proto3" json:"NowEffect,omitempty"` //0.竖版 1.横版
ShowId int64 `protobuf:"varint,6,opt,name=ShowId,proto3" json:"ShowId,omitempty"` // 邮件显示位置 0 所有大厅都显示 1 主大厅显示 2 len大厅显示 4 fish大厅显示

View File

@ -65,7 +65,7 @@ message SCBagInfo {
message CSUpBagInfo {
int32 ItemId = 1;//ID
int32 ItemNum = 2;//
int32 Opt = 3;// 0.使 1. 2. 3. 4.
int32 Opt = 3;// 0.使 1. 2. 3. 4. 5.
int32 AcceptSnId = 4;//id
int32 NowEffect = 5;//0. 1.
int64 ShowId = 6;// 0 1 2 len大厅显示 4 fish大厅显示

File diff suppressed because it is too large Load Diff

View File

@ -885,6 +885,8 @@ message DB_GameItem {
map<int64, int64> Gain = 19;
map<int64, int64> Compound = 20;
}
message DB_GameItemArray {

View File

@ -451,6 +451,52 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
pack.NowItemNum = item.ItemNum
}
}
case ItemCanCompound:
logger.Logger.Trace("道具合成", msg.ItemId)
itemInfo := srvdata.GameItemMgr.Get(p.Platform, msg.ItemId)
if msg.ItemNum > 0 && itemInfo != nil {
_, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: msg.GetItemId(),
ItemNum: int64(-msg.GetItemNum()),
},
},
GainWay: common.GainWayItemFen,
Operator: "system",
Remark: fmt.Sprintf("道具合成%v消耗", msg.GetItemId()),
})
if isF {
pack.RetCode = bag.OpResultCode_OPRC_Sucess
var changeItems []*model.Item
for k, v := range itemInfo.GetCompound() {
if v > 0 {
changeItems = append(changeItems, &model.Item{
ItemId: int32(k),
ItemNum: int64(msg.GetItemNum()) / v,
})
}
}
BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
SnId: p.SnId,
Change: changeItems,
Cost: []*model.Item{
{
ItemId: msg.GetItemId(),
ItemNum: int64(msg.GetItemNum()),
},
},
GainWay: common.GainWayItemFenGain,
Operator: "system",
Remark: "道具合成获得",
})
pack.NowItemId = item.ItemId
pack.NowItemNum = item.ItemNum
}
}
}
send()
return nil

View File

@ -37,6 +37,7 @@ const (
ItemCanSell //可以出售
ItemCanExchange //可以兑换
ItemCanFen //可以分解
ItemCanCompound //可以合成
ItemMax
)

Binary file not shown.