爬塔前置条件判断
This commit is contained in:
parent
a1f7e39c9e
commit
b98daf11fa
@ -15,7 +15,7 @@ import (
|
||||
type ModuleRobot_Pagoda struct {
|
||||
pagoda *pb.DBPagoda
|
||||
_mapPagoda map[int32]*cfg.GamePagodaData
|
||||
//mainline *ModuleRobot_MainLine
|
||||
mainline *ModuleRobot_MainLine
|
||||
}
|
||||
|
||||
func (this *ModuleRobot_Pagoda) Init() (err error) {
|
||||
@ -33,7 +33,7 @@ func (this *ModuleRobot_Pagoda) Init() (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
//this.mainline = robot.GetModule(comm.ModuleMainline).(*ModuleRobot_MainLine)
|
||||
//
|
||||
|
||||
return
|
||||
}
|
||||
@ -71,18 +71,20 @@ func (this *ModuleRobot_Pagoda) DoPipeline(robot IRobot) (err error) {
|
||||
)
|
||||
heromodule := robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
||||
heros := heromodule.getbattlehero()
|
||||
|
||||
this.mainline = robot.GetModule(comm.ModuleMainline).(*ModuleRobot_MainLine)
|
||||
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 _, ok := this.mainline.info.Level[c.Unlock]; !ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if this.pagoda.PagodaId == 0 {
|
||||
this.pagoda.PagodaId = 1
|
||||
}
|
||||
|
||||
if resp, errdata = robot.SendMessage("pagoda", "challenge", &pb.PagodaChallengeReq{
|
||||
Cid: +1,
|
||||
Battle: &pb.BattleFormation{
|
||||
|
Loading…
Reference in New Issue
Block a user