功夫塔测试

This commit is contained in:
meixiongfeng 2023-09-14 10:36:34 +08:00
parent 98127fdebc
commit 83a5794a4d

View File

@ -15,6 +15,7 @@ import (
type ModuleRobot_Pagoda struct { type ModuleRobot_Pagoda struct {
pagoda *pb.DBPagoda pagoda *pb.DBPagoda
_mapPagoda map[int32]*cfg.GamePagodaData _mapPagoda map[int32]*cfg.GamePagodaData
//mainline *ModuleRobot_MainLine
} }
func (this *ModuleRobot_Pagoda) Init() (err error) { func (this *ModuleRobot_Pagoda) Init() (err error) {
@ -31,6 +32,9 @@ func (this *ModuleRobot_Pagoda) Init() (err error) {
return return
} }
} }
//this.mainline = robot.GetModule(comm.ModuleMainline).(*ModuleRobot_MainLine)
return return
} }
@ -67,9 +71,20 @@ func (this *ModuleRobot_Pagoda) DoPipeline(robot IRobot) (err error) {
) )
heromodule := robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) heromodule := robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
heros := heromodule.getbattlehero() heros := heromodule.getbattlehero()
this.pagoda.PagodaId += 1
// 校验能不能打
if c, e := this.getPagodaDataById(this.pagoda.PagodaId); e != nil { // 参数有误
return
} else {
if c.Unlock != 0 {
this.pagoda.PagodaId -= 1
}
}
if this.pagoda.PagodaId == 0 {
this.pagoda.PagodaId = 1
}
if resp, errdata = robot.SendMessage("pagoda", "challenge", &pb.PagodaChallengeReq{ if resp, errdata = robot.SendMessage("pagoda", "challenge", &pb.PagodaChallengeReq{
Cid: this.pagoda.PagodaId + 1, Cid: +1,
Battle: &pb.BattleFormation{ Battle: &pb.BattleFormation{
Format: heros, Format: heros,
}}); errdata != nil { }}); errdata != nil {
@ -151,3 +166,19 @@ func (this *ModuleRobot_Pagoda) getPagodaData(tab int32, lv int32) (conf *cfg.Ga
err = comm.NewNotFoundConfErr("robot", game_buriedcondi, fmt.Sprintf("tab:%d,lv:%d", tab, lv)) err = comm.NewNotFoundConfErr("robot", game_buriedcondi, fmt.Sprintf("tab:%d,lv:%d", tab, lv))
return return
} }
func (this *ModuleRobot_Pagoda) getPagodaDataById(id int32) (conf *cfg.GamePagodaData, err error) {
var (
v interface{}
)
if v, err = configure.GetConfigure(game_pagoda); err != nil {
return
} else {
conf = v.(*cfg.GamePagoda).Get(id)
if conf != nil {
return
}
}
err = comm.NewNotFoundConfErr("robot", game_buriedcondi, id)
return
}