消耗英雄卡片
This commit is contained in:
parent
4a17e34518
commit
13648d9471
@ -36,7 +36,7 @@ type (
|
|||||||
//查询用户卡片数量
|
//查询用户卡片数量
|
||||||
QueryHeroAmount(uId string, heroCfgId int32) (amount uint32)
|
QueryHeroAmount(uId string, heroCfgId int32) (amount uint32)
|
||||||
//消耗卡片
|
//消耗卡片
|
||||||
ChangeCard(uId string, heroCfgId int32, count int32) (code pb.ErrorCode)
|
ConsumeCard(uId string, heroCfgId int32, count int32) (code pb.ErrorCode)
|
||||||
//创建新英雄
|
//创建新英雄
|
||||||
CreateHero(uid string, heroCfgId ...int32) error
|
CreateHero(uid string, heroCfgId ...int32) error
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ func (this *Hero) CreateHero(uid string, heroCfgId ...int32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//消耗英雄卡
|
//消耗英雄卡
|
||||||
func (this *Hero) ChangeCard(uId string, heroCfgId int32, count int32) (code pb.ErrorCode) {
|
func (this *Hero) ConsumeCard(uId string, heroCfgId int32, count int32) (code pb.ErrorCode) {
|
||||||
heroes := this.GetHeroList(uId)
|
heroes := this.GetHeroList(uId)
|
||||||
var curList []*pb.DBHero
|
var curList []*pb.DBHero
|
||||||
for _, v := range heroes {
|
for _, v := range heroes {
|
||||||
|
@ -165,7 +165,7 @@ func (this *ModuleBase) CheckConsumeRes(uid string, res []*cfg.Game_atn) (code p
|
|||||||
this.ModuleItems.AddItem(source, uid, int32(resID), -1*v.N)
|
this.ModuleItems.AddItem(source, uid, int32(resID), -1*v.N)
|
||||||
} else if v.A == comm.CardType { //卡片资源
|
} else if v.A == comm.CardType { //卡片资源
|
||||||
resID, _ = strconv.Atoi(v.T)
|
resID, _ = strconv.Atoi(v.T)
|
||||||
this.ModuleHero.ChangeCard(uid, int32(resID), -1*v.N)
|
this.ModuleHero.ConsumeCard(uid, int32(resID), -1*v.N)
|
||||||
}
|
}
|
||||||
// } else if v.A == comm.EquipmentType {
|
// } else if v.A == comm.EquipmentType {
|
||||||
// resID, _ = strconv.Atoi(v.T)
|
// resID, _ = strconv.Atoi(v.T)
|
||||||
@ -194,7 +194,7 @@ func (this *ModuleBase) DispenseRes(uid string, res []*cfg.Game_atn) (code pb.Er
|
|||||||
this.ModuleItems.AddItem(source, uid, int32(resID), v.N)
|
this.ModuleItems.AddItem(source, uid, int32(resID), v.N)
|
||||||
} else if v.A == comm.CardType { //卡片资源
|
} else if v.A == comm.CardType { //卡片资源
|
||||||
resID, _ = strconv.Atoi(v.T)
|
resID, _ = strconv.Atoi(v.T)
|
||||||
this.ModuleHero.ChangeCard(uid, int32(resID), v.N)
|
this.ModuleHero.ConsumeCard(uid, int32(resID), v.N)
|
||||||
} else if v.A == comm.EquipmentType {
|
} else if v.A == comm.EquipmentType {
|
||||||
resID, _ = strconv.Atoi(v.T)
|
resID, _ = strconv.Atoi(v.T)
|
||||||
this.ModuleEquipment.AddNewEquipments(source, uid, map[int32]uint32{int32(resID): uint32(v.N)})
|
this.ModuleEquipment.AddNewEquipments(source, uid, map[int32]uint32{int32(resID): uint32(v.N)})
|
||||||
|
Loading…
Reference in New Issue
Block a user