This commit is contained in:
meixiongfeng 2023-12-21 14:29:57 +08:00
commit fbbbd62487
3 changed files with 36 additions and 26 deletions

View File

@ -36,8 +36,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
atno []*pb.UserAtno atno []*pb.UserAtno
IsBaodiPool bool // 是否是保底卡池 IsBaodiPool bool // 是否是保底卡池
appointmap map[int32]string // 指定次数抽卡到指定卡池 appointmap map[int32]string // 指定次数抽卡到指定卡池
reward []*cfg.Gameatn // 许愿石奖励
reward []*cfg.Gameatn // 许愿石奖励
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
appointmap = make(map[int32]string) appointmap = make(map[int32]string)
@ -247,34 +246,43 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
tmp4 = this.module.ModuleTools.GetGlobalConf().RewardStar4 tmp4 = this.module.ModuleTools.GetGlobalConf().RewardStar4
var tmp5 *cfg.Gameatn var tmp5 *cfg.Gameatn
tmp5 = this.module.ModuleTools.GetGlobalConf().RewardStar5 tmp5 = this.module.ModuleTools.GetGlobalConf().RewardStar5
for i, heroId := range szCards { for i, heroId := range szCards {
HeroConf, _ := this.module.configure.GetHeroConfig(heroId) if HeroConf, err := this.module.configure.GetHeroConfig(heroId); err != nil {
szStar = append(szStar, HeroConf.Star) // 获得许愿石 errdata = &pb.ErrorData{
if HeroConf.Star == 4 { Code: pb.ErrorCode_ConfigNoFound,
if rsp.Wish == nil { Message: err.Error(),
rsp.Wish = &pb.UserAtno{A: tmp4.A, T: tmp4.T, N: tmp4.N}
} else {
rsp.Wish.N += tmp4.N
} }
reward = append(reward, tmp4) return
} else if HeroConf.Star == 5 { } else {
if rsp.Wish == nil { szStar = append(szStar, HeroConf.Star) // 获得许愿石
rsp.Wish = &pb.UserAtno{A: tmp5.A, T: tmp5.T, N: tmp5.N} if HeroConf.Star == 4 {
} else { if rsp.Wish == nil {
rsp.Wish.N += tmp5.N rsp.Wish = &pb.UserAtno{A: tmp4.A, T: tmp4.T, N: tmp4.N}
} } else {
reward = append(reward, tmp5) rsp.Wish.N += tmp4.N
if req.DrawType == comm.DrawCardType5 { // 限时招募 }
if heroRecord.LimitHero == "" { reward = append(reward, tmp4)
if conf := this.module.configure.GetApportHeroReplaceConfig(); conf != nil { } else if HeroConf.Star == 5 {
heroRecord.LimitHero = conf.InitHero if rsp.Wish == nil {
update["limitHero"] = heroRecord.LimitHero rsp.Wish = &pb.UserAtno{A: tmp5.A, T: tmp5.T, N: tmp5.N}
} } else {
rsp.Wish.N += tmp5.N
}
reward = append(reward, tmp5)
if req.DrawType == comm.DrawCardType5 { // 限时招募
if heroRecord.LimitHero == "" {
if conf := this.module.configure.GetApportHeroReplaceConfig(); conf != nil {
heroRecord.LimitHero = conf.InitHero
update["limitHero"] = heroRecord.LimitHero
}
}
heroId = heroRecord.LimitHero // 替换成心愿英雄
szCards[i] = heroId
} }
heroId = heroRecord.LimitHero // 替换成心愿英雄
szCards[i] = heroId
} }
} }
} }
var ( var (

View File

@ -104,6 +104,7 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
Title: pb.ErrorCode_ConfigNoFound.ToString(), Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(), Message: err.Error(),
} }
return
} }
hero, atno, err = this.modelHero.createHero(session, heroCfgId, num) hero, atno, err = this.modelHero.createHero(session, heroCfgId, num)
if err == nil { if err == nil {
@ -119,6 +120,7 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
Title: pb.ErrorCode_HeroCreate.ToString(), Title: pb.ErrorCode_HeroCreate.ToString(),
Message: err.Error(), Message: err.Error(),
} }
return
} }
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype1, 1, utils.ToInt32(heroCfgId))) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype1, 1, utils.ToInt32(heroCfgId)))
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype30, heroCfgId, cfg.Color)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype30, heroCfgId, cfg.Color))

View File

@ -58,7 +58,7 @@ func (this *ModuleRobot_GM) OncePipeline(robot IRobot) (err error) {
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message)) err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
return return
} }
if _, errdata = robot.SendMessage("gm", "cmd", &pb.GMCmdReq{Cmod: "bingo:hero,13004,1"}); errdata != nil { if _, errdata = robot.SendMessage("gm", "cmd", &pb.GMCmdReq{Cmod: "bingo:hero,34011,1"}); errdata != nil {
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message)) err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
return return
} }