diff --git a/comm/imodule.go b/comm/imodule.go index f6e3a7782..f72e5fb1e 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -36,7 +36,7 @@ type ( //查询用户卡片数量 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 diff --git a/modules/hero/module.go b/modules/hero/module.go index 0a3adf3d6..040183cf6 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -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) var curList []*pb.DBHero for _, v := range heroes { diff --git a/modules/modulebase.go b/modules/modulebase.go index f5fd333e0..79043cf34 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -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) } else if v.A == comm.CardType { //卡片资源 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 { // 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) } else if v.A == comm.CardType { //卡片资源 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 { resID, _ = strconv.Atoi(v.T) this.ModuleEquipment.AddNewEquipments(source, uid, map[int32]uint32{int32(resID): uint32(v.N)})