From 13648d94710477d2b801a7b87b73e099329bb40c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 4 Jul 2022 10:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=80=97=E8=8B=B1=E9=9B=84=E5=8D=A1?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/hero/module.go | 2 +- modules/modulebase.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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)})