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
IsBaodiPool bool // 是否是保底卡池
appointmap map[int32]string // 指定次数抽卡到指定卡池
reward []*cfg.Gameatn // 许愿石奖励
reward []*cfg.Gameatn // 许愿石奖励
)
update = make(map[string]interface{})
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
var tmp5 *cfg.Gameatn
tmp5 = this.module.ModuleTools.GetGlobalConf().RewardStar5
for i, heroId := range szCards {
HeroConf, _ := this.module.configure.GetHeroConfig(heroId)
szStar = append(szStar, HeroConf.Star) // 获得许愿石
if HeroConf.Star == 4 {
if rsp.Wish == nil {
rsp.Wish = &pb.UserAtno{A: tmp4.A, T: tmp4.T, N: tmp4.N}
} else {
rsp.Wish.N += tmp4.N
if HeroConf, err := this.module.configure.GetHeroConfig(heroId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Message: err.Error(),
}
reward = append(reward, tmp4)
} else if HeroConf.Star == 5 {
if rsp.Wish == nil {
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
}
return
} else {
szStar = append(szStar, HeroConf.Star) // 获得许愿石
if HeroConf.Star == 4 {
if rsp.Wish == nil {
rsp.Wish = &pb.UserAtno{A: tmp4.A, T: tmp4.T, N: tmp4.N}
} else {
rsp.Wish.N += tmp4.N
}
reward = append(reward, tmp4)
} else if HeroConf.Star == 5 {
if rsp.Wish == nil {
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 (

View File

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