新手召唤 非首次召唤不扣道具

This commit is contained in:
meixiongfeng 2023-12-07 16:41:50 +08:00
parent 548385a562
commit 8cc9bfc2db

View File

@ -117,6 +117,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
drawCount = heroRecord.Count[req.DrawType] // 获取当前阵容抽卡次数
if true { // 普通卡池抽卡
////// 获取消耗
if costRes, errdata = this.module.modelHero.CheckDrawCardRes(session, drawConf, req.Consume, req.DrawCount); errdata != nil {
return
}
@ -225,6 +226,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
}
// 消耗道具
if req.DrawType == 1 && heroRecord.Selectcount > 0 { // 新手抽 非第一次不消耗
costRes = nil
}
if errdata = this.module.ConsumeRes(session, costRes, true); errdata != nil {
return
}
@ -241,7 +245,6 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
update["baodi5"] = heroRecord.Baodi5
for _, heroId := range szCards {
//var
var (
hero *pb.DBHero
HeroConf *cfg.GameHeroData
@ -282,10 +285,6 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
var atno []*pb.UserAtno
if req.DrawType == 1 {
heroRecord.Selectcount += 1 // 抽卡次数+1
heroRecord.Cur = szCards
update["selectcount"] = heroRecord.Selectcount
update["cur"] = heroRecord.Cur
if hero, atno, err = this.module.modelHero.imitateHero(session, heroId); err == nil {
for _, v := range atno {
@ -319,6 +318,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
}
}
if req.DrawType == 1 {
heroRecord.Selectcount += 1 // 抽卡次数+1
heroRecord.Cur = szCards
update["selectcount"] = heroRecord.Selectcount
update["cur"] = heroRecord.Cur
}
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
if req.DrawType != 1 {