This commit is contained in:
liwei1dao 2023-09-27 18:04:51 +08:00
commit 0321057d6c
10 changed files with 63 additions and 35 deletions

View File

@ -240,11 +240,20 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
} }
} }
if conf, err := this.configure.GetHDCelebration(list.Val); err == nil { if conf, err := this.configure.GetHDCelebration(list.Val); err == nil {
bfound := false
for _, v1 := range conf.Bosstype { for _, v1 := range conf.Bosstype {
if v1 == 0 { // bosstype 为0 表示所有的boss 类型都算 if v1 == 0 { // bosstype 为0 表示所有的boss 类型都算
bosstype = 0 bosstype = 0
bfound = true
break break
} }
if v1 == bosstype {
bfound = true
break
}
}
if !bfound {
return false
} }
if conf.Systemtype == systemtype { if conf.Systemtype == systemtype {
list.Gotarr[bosstype] += 1 list.Gotarr[bosstype] += 1

View File

@ -64,7 +64,9 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
} }
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
member.Useheros = append(member.Useheros, v.Oid) if v.Oid != "" {
member.Useheros = append(member.Useheros, v.Oid)
}
} }
// if member.Boosticket <= 0 { // if member.Boosticket <= 0 {
@ -122,10 +124,10 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
member.Record[req.Boosid] = record member.Record[req.Boosid] = record
go this.module.modelbattlerank.updateRank(req.Boosid, req.Report.Harm, record.User.Uid) go this.module.modelbattlerank.updateRank(req.Boosid, req.Report.Harm, record.User.Uid)
for i, v := range req.Report.Info.Redflist[0].Team { for i, v := range req.Report.Info.Redflist[0].Team {
if int32(i) == req.Report.Info.Redflist[0].Leadpos && v != nil { if int32(i) == req.Report.Info.Redflist[0].Leadpos && v.Oid != "" {
record.CaptainHeroId = v.HeroID record.CaptainHeroId = v.HeroID
} }
if v != nil { if v.Oid != "" {
record.Formation = append(record.Formation, &pb.DBSimpleHero{ record.Formation = append(record.Formation, &pb.DBSimpleHero{
HeroId: v.HeroID, HeroId: v.HeroID,
Star: v.Star, Star: v.Star,

View File

@ -161,7 +161,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
var heroObjs []string var heroObjs []string
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验 if v.Oid != "" && !v.Ishelp { // 助战英雄不加经验
heroObjs = append(heroObjs, v.Oid) heroObjs = append(heroObjs, v.Oid)
changExp[v.Oid] = cfgHunting.Heroexp changExp[v.Oid] = cfgHunting.Heroexp
} }

View File

@ -385,6 +385,9 @@ func (this *Items) CleanItemById(session comm.IUserSession, t string) (errdata *
} }
if len(itmes) > 0 { if len(itmes) > 0 {
this.modelItems.DeleteUserPack(session.GetUserId(), itmes...) this.modelItems.DeleteUserPack(session.GetUserId(), itmes...)
for _, v := range itmes {
v.Amount = 0
}
this.itemsChangePush(session, itmes) //推送道具背包变化 this.itemsChangePush(session, itmes) //推送道具背包变化
} }
return return

View File

@ -154,7 +154,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
var heroObjs []string var heroObjs []string
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验 if v.Oid != "" && !v.Ishelp { // 助战英雄不加经验
heroObjs = append(heroObjs, v.Oid) heroObjs = append(heroObjs, v.Oid)
} }
} }

View File

@ -99,7 +99,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
var heroObjs []string var heroObjs []string
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验 if v.Oid != "" && !v.Ishelp { // 助战英雄不加经验
heroObjs = append(heroObjs, v.Oid) heroObjs = append(heroObjs, v.Oid)
} }
} }
@ -139,7 +139,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
leadpos := req.Report.Info.Redflist[0].Leadpos leadpos := req.Report.Info.Redflist[0].Leadpos
szLine := make([]*pb.LineUp, 0) szLine := make([]*pb.LineUp, 0)
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if v != nil { if v.Oid != "" {
szLine = append(szLine, &pb.LineUp{ szLine = append(szLine, &pb.LineUp{
Cid: v.HeroID, Cid: v.HeroID,
Star: v.Star, Star: v.Star,

View File

@ -97,7 +97,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
var heroObjs []string var heroObjs []string
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验 if v.Oid != "" && !v.Ishelp { // 助战英雄不加经验
heroObjs = append(heroObjs, v.Oid) heroObjs = append(heroObjs, v.Oid)
} }
} }

View File

@ -441,18 +441,18 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
} }
} }
if stone.Rooms.Complete { // 完成关卡 发放当前关奖励 // if stone.Rooms.Complete { // 完成关卡 发放当前关奖励
if conf := this.module.configure.GetStageConfByStageid(stone.StageID, stone.CurRoomIndes); conf != nil { // if conf := this.module.configure.GetStageConfByStageid(stone.StageID, stone.CurRoomIndes); conf != nil {
if len(conf.FirstReward) > 0 { // if len(conf.FirstReward) > 0 {
if errdata, reward = this.module.DispenseAtno(session, conf.FirstReward, true); errdata != nil { // if errdata, reward = this.module.DispenseAtno(session, conf.FirstReward, true); errdata != nil {
return // return
} // }
} // }
} // }
// 记录首通 // // 记录首通
// stone.Reward[stone.StageID] = true // // stone.Reward[stone.StageID] = true
// update["reward"] = stone.Reward // // update["reward"] = stone.Reward
} // }
if len(eventConf.CostItem) > 0 { if len(eventConf.CostItem) > 0 {
if errdata = this.module.ConsumeRes(session, eventConf.CostItem, true); errdata != nil { //真正的消耗 if errdata = this.module.ConsumeRes(session, eventConf.CostItem, true); errdata != nil { //真正的消耗
return return
@ -479,17 +479,19 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
if eventConf.EventType == EventType28 { // 必须是战斗类型才可以触发 if eventConf.EventType == EventType28 { // 必须是战斗类型才可以触发
var job int32 var job int32
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if h, err := this.module.ModuleTools.GetHeroConfig(v.HeroID); err == nil { if v.HeroID != "" {
if job == 0 { if h, err := this.module.ModuleTools.GetHeroConfig(v.HeroID); err == nil {
job = h.Job if job == 0 {
} job = h.Job
if job != h.Job { }
job = 0 if job != h.Job {
break job = 0
break
}
} }
maxHp := v.Property[battle.AttributesTransBase("hp")]
totalhp += v.Currhp * 1000 / maxHp
} }
maxHp := v.Property[battle.AttributesTransBase("hp")]
totalhp += v.Currhp * 1000 / maxHp
} }
if job != 0 { // 上阵英雄都为指定职业 if job != 0 { // 上阵英雄都为指定职业
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype216, job, stone.StageID)) //上阵英雄都为指定职业,击败石阵秘境中指定关卡的首领 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype216, job, stone.StageID)) //上阵英雄都为指定职业,击败石阵秘境中指定关卡的首领

View File

@ -20,6 +20,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.StonehengeFinishR
err error err error
curintegral int32 curintegral int32
atno []*pb.UserAtno atno []*pb.UserAtno
reward []*pb.UserAtno
) )
update = make(map[string]interface{}) update = make(map[string]interface{})
if errdata = this.FinishCheck(session, req); errdata != nil { if errdata = this.FinishCheck(session, req); errdata != nil {
@ -49,7 +50,16 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.StonehengeFinishR
} }
} }
} }
if stone.Rooms.Complete { // 完成关卡 发放当前关奖励
if conf := this.module.configure.GetStageConfByStageid(stone.StageID, 1); conf != nil {
if len(conf.FirstReward) > 0 {
if errdata, reward = this.module.DispenseAtno(session, conf.FirstReward, true); errdata != nil {
return
}
atno = append(atno, reward...)
}
}
}
stone.StageID = 0 stone.StageID = 0
update["stageID"] = stone.StageID update["stageID"] = stone.StageID
stone.CurRoomIndes = 0 stone.CurRoomIndes = 0

View File

@ -198,10 +198,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
var heroObjs []string var heroObjs []string
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if !v.Ishelp { // 助战英雄不加经验 if v.HeroID != "" {
heroObjs = append(heroObjs, v.Oid) if !v.Ishelp { // 助战英雄不加经验
} else { heroObjs = append(heroObjs, v.Oid)
bHelp = true } else {
bHelp = true
}
} }
} }
} }
@ -227,7 +229,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 { if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if v.Ishelp { // 判断是否有助战 if v.Oid != "" && v.Ishelp { // 判断是否有助战
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype79, req.Difficulty, req.BossId)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype79, req.Difficulty, req.BossId))
break break
} }