积分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/pb"
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 {
for _, v := range c {
if mp, e := this.module.configure.GetIntegralBUff(v); e == nil {
bFound := false
for _, v := range mp {
bFound := false
// 必须是一样的
if len(req.Report.Info.Buffer) == len(mp) {
skillgroup = v
for _, v1 := range req.Report.Info.Buffer {
if v1 == v {
bFound = true
break
}
}
if !bFound {
if _, ok := mp[v1]; !ok {
skillgroup = 0
break
}
}
if bFound {
skillgroup = v
}
if skillgroup != 0 {
break
}
}
@ -220,7 +214,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
}
}
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) {

View File

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