测试
This commit is contained in:
parent
35003a0d66
commit
a5e480e6ff
@ -47,11 +47,6 @@ func (this *ModuleRobot_Hero) Receive(robot IRobot, stype string, message proto.
|
||||
}
|
||||
|
||||
func (this *ModuleRobot_Hero) OncePipeline(robot IRobot) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
//机器人执行流
|
||||
func (this *ModuleRobot_Hero) DoPipeline(robot IRobot) (err error) {
|
||||
var (
|
||||
errdata *pb.ErrorData
|
||||
)
|
||||
@ -66,6 +61,15 @@ func (this *ModuleRobot_Hero) DoPipeline(robot IRobot) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
//机器人执行流
|
||||
func (this *ModuleRobot_Hero) DoPipeline(robot IRobot) (err error) {
|
||||
if _, errdata := robot.SendMessage("hero", "drawcard", &pb.HeroDrawCardReq{DrawType: 2, DrawCount: 10, Consume: 1}); errdata != nil {
|
||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//做任务
|
||||
func (this *ModuleRobot_Hero) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskData, condconf *cfg.GameBuriedCondiData) (err error) {
|
||||
var (
|
||||
|
@ -40,6 +40,33 @@ func (this *ModuleRobot_Viking) OncePipeline(robot IRobot) (err error) {
|
||||
|
||||
//机器人执行流
|
||||
func (this *ModuleRobot_Viking) DoPipeline(robot IRobot) (err error) {
|
||||
// 获取爬塔信息
|
||||
if _, errdata := robot.SendMessage("viking", "getlist", &pb.VikingGetListReq{}); errdata != nil {
|
||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||
return
|
||||
}
|
||||
heromodule := robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
||||
heros := heromodule.getbattlehero()
|
||||
var bossid int32
|
||||
var difficulty int32
|
||||
for k, v := range this.viking.Boss {
|
||||
bossid = k
|
||||
difficulty = v
|
||||
break
|
||||
}
|
||||
if bossid == 0 || difficulty == 0 {
|
||||
bossid = 1
|
||||
difficulty = 1
|
||||
}
|
||||
if _, errdata := robot.SendMessage("viking", "challenge", &pb.VikingChallengeReq{
|
||||
BossId: bossid,
|
||||
Difficulty: difficulty,
|
||||
Battle: &pb.BattleFormation{
|
||||
Format: heros,
|
||||
}}); errdata != nil {
|
||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user