积分boss debuff 带入
This commit is contained in:
parent
dd08881031
commit
a9f5ceadb7
@ -52,8 +52,23 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.IntegralChalle
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for k := range list.Buff {
|
if list.Itype == 2 { // 事件模式
|
||||||
dibuff = append(dibuff, k)
|
var condiIds []int32
|
||||||
|
if confList := this.configure.GetIntegralCondition(); len(confList) > 0 {
|
||||||
|
for _, v := range confList {
|
||||||
|
condiIds = append(condiIds, v.Id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, progress, err := this.module.ModuleBuried.CheckCondition(session, condiIds...); err == nil {
|
||||||
|
condiIds = []int32{}
|
||||||
|
for _, v := range progress { // 没有完成的
|
||||||
|
if v.State == pb.BuriedItemFinishState_buried_finish {
|
||||||
|
condiIds = append(condiIds, v.Conid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dibuff = this.module.configure.GetIntegralConditionByKeys(condiIds)
|
||||||
}
|
}
|
||||||
errdata, record := this.module.battle.CreateDebuffBattle(session, &pb.BattlePVEReq{
|
errdata, record := this.module.battle.CreateDebuffBattle(session, &pb.BattlePVEReq{
|
||||||
Rulesid: cfgData.BattleReadyID,
|
Rulesid: cfgData.BattleReadyID,
|
||||||
|
@ -161,6 +161,17 @@ func (this *configureComp) GetIntegralConditionByKey(id int32) (result *cfg.Game
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) GetIntegralConditionByKeys(ids []int32) (result []int32) {
|
||||||
|
if v, err := this.GetConfigure(game_integralcondition); err == nil {
|
||||||
|
if configure, ok := v.(*cfg.GameIntegralCondition); ok {
|
||||||
|
for _, id := range ids {
|
||||||
|
result = append(result, configure.Get(id).Skillid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (this *configureComp) LoadIntegralCondition() {
|
func (this *configureComp) LoadIntegralCondition() {
|
||||||
|
|
||||||
if v, err := this.GetConfigure(game_integralcondition); err == nil {
|
if v, err := this.GetConfigure(game_integralcondition); err == nil {
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/base"
|
"go_dreamfactory/lego/base"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/sys/log"
|
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
@ -60,52 +59,53 @@ func (this *Integral) OnInstallComp() {
|
|||||||
|
|
||||||
// 任务条件达成通知
|
// 任务条件达成通知
|
||||||
func (this *Integral) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIProgress) {
|
func (this *Integral) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIProgress) {
|
||||||
var bChange bool
|
return
|
||||||
this.Debug("积分boss条件达成通知", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "conds", Value: conds})
|
// var bChange bool
|
||||||
dt, err := this.modelIntegral.getIntegralList(session)
|
// this.Debug("积分boss条件达成通知", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "conds", Value: conds})
|
||||||
|
// dt, err := this.modelIntegral.getIntegralList(session)
|
||||||
|
|
||||||
if dt.Itype != 2 { // 只有事件模式才有debuff
|
// if dt.Itype != 2 { // 只有事件模式才有debuff
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
confList := this.configure.GetIntegralCondition()
|
// confList := this.configure.GetIntegralCondition()
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
this.Error(err.Error())
|
// this.Error(err.Error())
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
condMap := make(map[int32]*pb.ConIProgress)
|
// condMap := make(map[int32]*pb.ConIProgress)
|
||||||
for _, conf := range confList {
|
// for _, conf := range confList {
|
||||||
for _, cond := range conds {
|
// for _, cond := range conds {
|
||||||
if cond.Conid == conf.TaskId {
|
// if cond.Conid == conf.TaskId {
|
||||||
condMap[conf.TaskId] = cond
|
// condMap[conf.TaskId] = cond
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
update := make(map[string]interface{})
|
// update := make(map[string]interface{})
|
||||||
|
|
||||||
if dt.Buff == nil {
|
// if dt.Buff == nil {
|
||||||
dt.Buff = make(map[int32]int32)
|
// dt.Buff = make(map[int32]int32)
|
||||||
for _, v := range condMap {
|
// for _, v := range condMap {
|
||||||
if v.State == pb.BuriedItemFinishState_buried_finish {
|
// if v.State == pb.BuriedItemFinishState_buried_finish {
|
||||||
if c, err := this.configure.GetIntegralConditionByTask(v.Conid); err == nil {
|
// if c, err := this.configure.GetIntegralConditionByTask(v.Conid); err == nil {
|
||||||
dt.Buff[c.Id] = 1
|
// dt.Buff[c.Id] = 1
|
||||||
bChange = true
|
// bChange = true
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
for k, v := range condMap {
|
// for k, v := range condMap {
|
||||||
if dt.Buff[k] != 1 && v.State == pb.BuriedItemFinishState_buried_finish {
|
// if dt.Buff[k] != 1 && v.State == pb.BuriedItemFinishState_buried_finish {
|
||||||
dt.Buff[k] = 1
|
// dt.Buff[k] = 1
|
||||||
bChange = true
|
// bChange = true
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if bChange {
|
// if bChange {
|
||||||
update["buff"] = dt.Buff
|
// update["buff"] = dt.Buff
|
||||||
if err := this.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil {
|
// if err := this.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil {
|
||||||
this.Error(err.Error())
|
// this.Error(err.Error())
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user