积分boss 异化任务条件

This commit is contained in:
meixiongfeng 2024-02-06 16:54:58 +08:00
parent 26ce697be5
commit 1201c9de28
2 changed files with 12 additions and 15 deletions

View File

@ -4,7 +4,6 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"strconv"
) )
//参数校验 //参数校验
@ -190,22 +189,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
if c, e := this.module.configure.GetIntegralBUffSkillGroup(); e == nil { if c, e := this.module.configure.GetIntegralBUffSkillGroup(); e == nil {
for _, v := range c { for _, v := range c {
if mp, e := this.module.configure.GetIntegralBUff(v); e == nil { if mp, e := this.module.configure.GetIntegralBUff(v); e == nil {
bFound := false // 必须是一样的
for _, v := range mp { if len(req.Report.Info.Buffer) == len(mp) {
bFound := false skillgroup = v
for _, v1 := range req.Report.Info.Buffer { for _, v1 := range req.Report.Info.Buffer {
if v1 == v { if _, ok := mp[v1]; !ok {
bFound = true skillgroup = 0
break break
} }
} }
if !bFound {
skillgroup = 0
break
}
} }
if bFound { if skillgroup != 0 {
skillgroup = v
break break
} }
} }
@ -220,7 +214,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
} }
} }
if skillgroup != 0 { // 统计型任务 来统计积分boss难度对应的异化值 if skillgroup != 0 { // 统计型任务 来统计积分boss难度对应的异化值
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype259, strconv.Itoa(int(skillgroup)), skillgroup)) // 改任意难度 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype259, 1, skillgroup)) // 改任意难度
} }
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {

View File

@ -237,15 +237,17 @@ func (this *configureComp) GetIntegralAchieveByKey(id int32) (result *cfg.GameIn
return return
} }
func (this *configureComp) GetIntegralBUff(group int32) (szSkillId []int32, err error) { func (this *configureComp) GetIntegralBUff(group int32) (szSkillId map[int32]struct{}, err error) {
var ( var (
v interface{} v interface{}
) )
szSkillId = make(map[int32]struct{})
if v, err = this.GetConfigure(game_integralbuffgroup); err == nil { if v, err = this.GetConfigure(game_integralbuffgroup); err == nil {
if configure, ok := v.(*cfg.GameIntegralBuffGroup); ok { if configure, ok := v.(*cfg.GameIntegralBuffGroup); ok {
if result := configure.Get(group); result != nil { if result := configure.Get(group); result != nil {
for _, v := range result.Skillid { for _, v := range result.Skillid {
szSkillId = append(szSkillId, v) //szSkillId = append(szSkillId, v)
szSkillId[v] = struct{}{}
} }
return return
} }
@ -265,6 +267,7 @@ func (this *configureComp) GetIntegralBUffSkillGroup() (sz []int32, err error) {
for _, v := range configure.GetDataList() { for _, v := range configure.GetDataList() {
sz = append(sz, v.Skillgroup) sz = append(sz, v.Skillgroup)
} }
return
} }
} }
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_integralbuffgroup, "") err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_integralbuffgroup, "")