上传捕羊代码

This commit is contained in:
liwei1dao 2023-10-18 18:37:51 +08:00
parent d377ecca4b
commit d28a2f3e65
3 changed files with 6 additions and 8 deletions

View File

@ -153,10 +153,10 @@ func (this *aiComp) ExceAiHandle_Avoid(_ai *AI, handle *AIHandle) {
weights = append(weights, _ai.Conf.BumpSuccessWeight...) weights = append(weights, _ai.Conf.BumpSuccessWeight...)
indexhandle = comm.GetRandW(weights) indexhandle = comm.GetRandW(weights)
if indexhandle == 0 { //失败 if indexhandle == 0 { //失败
go this.module.avoid(_ai.Bid, _ai.Uid, nil) go this.module.avoid(_ai.Bid, _ai.Uid, 0, nil)
} else { } else {
conf = this.avoidConf[indexhandle-1] conf = this.avoidConf[indexhandle-1]
go this.module.avoid(_ai.Bid, _ai.Uid, conf) go this.module.avoid(_ai.Bid, _ai.Uid, conf.Distance, conf)
} }
handle.cd = _ai.Conf.BumpCD handle.cd = _ai.Conf.BumpCD
} }
@ -171,12 +171,10 @@ func (this *aiComp) ExceAiHandle_Shot(_ai *AI, handle *AIHandle) {
weights = append(weights, _ai.Conf.CatchQteFailWeight) weights = append(weights, _ai.Conf.CatchQteFailWeight)
weights = append(weights, _ai.Conf.CatchQteSuccessWeight...) weights = append(weights, _ai.Conf.CatchQteSuccessWeight...)
indexhandle = comm.GetRandW(weights) indexhandle = comm.GetRandW(weights)
if indexhandle == 0 { //失败 if indexhandle > 0 { //失败
go this.module.qte(_ai.Bid, _ai.Uid, nil)
} else {
conf = this.shotConf[indexhandle-1] conf = this.shotConf[indexhandle-1]
go func() { go func() {
this.module.qte(_ai.Bid, _ai.Uid, conf) this.module.qte(_ai.Bid, _ai.Uid, conf.Time, conf)
this.module.shot(_ai.Bid, _ai.Uid) this.module.shot(_ai.Bid, _ai.Uid)
}() }()
} }

View File

@ -37,7 +37,7 @@ func (this *apiComp) Avoid(session comm.IUserSession, req *pb.ParkourAvoidReq) (
_, ok = this.module.battles[req.Battleid] _, ok = this.module.battles[req.Battleid]
this.module.lock.RUnlock() this.module.lock.RUnlock()
if ok { if ok {
go this.module.avoid(req.Battleid, session.GetUserId(), conf) go this.module.avoid(req.Battleid, session.GetUserId(), req.Distance, conf)
} else { } else {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError, Code: pb.ErrorCode_ReqParameterError,

View File

@ -35,7 +35,7 @@ func (this *apiComp) QTE(session comm.IUserSession, req *pb.ParkourQTEReq) (errd
_, ok = this.module.battles[req.Battleid] _, ok = this.module.battles[req.Battleid]
this.module.lock.RUnlock() this.module.lock.RUnlock()
if ok { if ok {
go this.module.qte(req.Battleid, session.GetUserId(), conf) go this.module.qte(req.Battleid, session.GetUserId(), req.Time, conf)
} else { } else {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError, Code: pb.ErrorCode_ReqParameterError,