This commit is contained in:
liwei1dao 2023-05-24 18:52:42 +08:00
commit 3d48f7cc12
15 changed files with 81 additions and 56 deletions

View File

@ -632,19 +632,18 @@ const (
Rtype152 TaskType = 152 //熊猫武馆解锁柱子 Rtype152 TaskType = 152 //熊猫武馆解锁柱子
Rtype153 TaskType = 153 //商队交易x次 Rtype153 TaskType = 153 //商队交易x次
Rtype154 TaskType = 154 //狩猎副本掉落x个觉醒材料 Rtype154 TaskType = 154 //狩猎副本掉落x个觉醒材料
Rtype155 TaskType = 155 //调整助战英雄n次
Rtype156 TaskType = 156 //完成工会任务n次 Rtype156 TaskType = 156 //完成工会任务n次
Rtype157 TaskType = 157 //战斗在xx系统中完成xx事件 Rtype157 TaskType = 157 //战斗在xx系统中完成xx事件
Rtype158 TaskType = 158 //主线第X章关卡总星数达到N星 Rtype158 TaskType = 158 //主线第X章关卡总星数达到N星
Rtype159 TaskType = 159 //主线第X章关卡全部达到三星 Rtype159 TaskType = 159 //主线第X章关卡全部达到三星
Rtype160 TaskType = 160 //主线总星数达到X星 Rtype160 TaskType = 160 //主线总星数达到X星
Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗 Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗
Rtype162 TaskType = 162 //收藏X件攻击套装部件(激活一个套装部位+1)
Rtype163 TaskType = 163 //收藏X件防御套装部件(激活一个套装部位+1)
Rtype164 TaskType = 164 //收藏X件辅助套装部件(激活一个套装部位+1)
Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品 Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品
Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个 Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个
Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分 Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分
Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层 Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层
Rtype169 TaskType = 169 //触发指定套装的套装效果 Rtype169 TaskType = 169 //触发指定套装的套装效果
Rtype170 TaskType = 170 //获得指定材料X个 Rtype170 TaskType = 170 //获得指定材料X个

View File

@ -65,7 +65,7 @@ type (
//英雄 //英雄
IHero interface { IHero interface {
//查询用户卡片数量 //查询用户卡片数量
QueryHeroAmount(uId string, heroCfgId string) (amount uint32) QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero)
// 批量创建英雄 // 批量创建英雄
CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode) CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode)
@ -422,10 +422,7 @@ type (
IReddot IReddot
} }
ILibrary interface { ILibrary interface {
//与N个英雄好感度等级达到A
CheckRtype132(uid string, num int32, lv int32) bool
//与指定英雄好感度等级达到N
CheckRtype133(uid string, heroId string, lv int32) bool
// 任务完成通知 // 任务完成通知
TaskFinishNotify(uid string, taskId, fetterId int32) error TaskFinishNotify(uid string, taskId, fetterId int32) error
} }

View File

@ -101,9 +101,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
} }
var szTask []*comm.TaskParam var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype34, 1, _hero.JuexingLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype34, 1, _hero.JuexingLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype119, _hero.JuexingLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype119, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID))) szTask = append(szTask, comm.GettaskParam(comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype118, _hero.Lv, _hero.JuexingLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype120, _hero.JuexingLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype122, _hero.JuexingLv, _hero.Star))
cfg := this.module.configure.GetHeroConfig(_hero.HeroID) cfg := this.module.configure.GetHeroConfig(_hero.HeroID)
if cfg != nil { if cfg != nil {
szTask = append(szTask, comm.GettaskParam(comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv))

View File

@ -137,7 +137,9 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
if cfg := this.module.configure.GetHeroConfig(_hero.HeroID); cfg != nil { if cfg := this.module.configure.GetHeroConfig(_hero.HeroID); cfg != nil {
szTask = append(szTask, comm.GettaskParam(comm.Rtype55, 1, cfg.Color)) szTask = append(szTask, comm.GettaskParam(comm.Rtype55, 1, cfg.Color))
szTask = append(szTask, comm.GettaskParam(comm.Rtype56, 1, 1, cfg.Job)) szTask = append(szTask, comm.GettaskParam(comm.Rtype56, 1, 1, cfg.Job))
szTask = append(szTask, comm.GettaskParam(comm.Rtype116, lvUpCount, cfg.Race))
} }
szTask = append(szTask, comm.GettaskParam(comm.Rtype117, lvUpCount, utils.ToInt32(_hero.HeroID)))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
return return
} }

View File

@ -95,7 +95,8 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
} else if _hero.Star == 6 { } else if _hero.Star == 6 {
szTask = append(szTask, comm.GettaskParam(comm.Rtype28, 1)) szTask = append(szTask, comm.GettaskParam(comm.Rtype28, 1))
} }
szTask = append(szTask, comm.GettaskParam(comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star)) szTask = append(szTask, comm.GettaskParam(comm.Rtype114, _hero.Star, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype115, 1, _hero.Star))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
return return
} }

View File

@ -4,6 +4,7 @@ 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"
"go_dreamfactory/utils"
) )
//参数校验 //参数校验
@ -134,5 +135,19 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
Telnet: talent, Telnet: talent,
TalentID: req.TalentID, // 返回刚学习过的天赋ID TalentID: req.TalentID, // 返回刚学习过的天赋ID
}) })
var szTask []*comm.TaskParam
// 查询英雄相关信息
if heroObj := this.module.QueryHeroByConfId(session.GetUserId(), talent.HeroId); heroObj != nil {
szTask = append(szTask, comm.GettaskParam(comm.Rtype123, 1, heroObj.Lv, heroObj.Star))
szTask = append(szTask, comm.GettaskParam(comm.Rtype124, 1))
szTask = append(szTask, comm.GettaskParam(comm.Rtype125, 1, utils.ToInt32(heroObj.HeroID)))
if cfg := this.module.configure.GetHeroConfig(heroObj.HeroID); cfg != nil {
szTask = append(szTask, comm.GettaskParam(comm.Rtype126, 1, cfg.Race))
}
szTask = append(szTask, comm.GettaskParam(comm.Rtype127, 1, heroObj.Star))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
}
return return
} }

View File

@ -603,7 +603,11 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
} }
} }
} }
szTask = append(szTask, comm.GettaskParam(comm.Rtype111, 1, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype112, 1, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype113, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype33, 1, 1, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype33, 1, 1, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype118, hero.Lv, hero.JuexingLv))
go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
//this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) //this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv)
} }

View File

@ -182,15 +182,14 @@ func (this *Hero) GetHeroList(uid string) []*pb.DBHero {
return this.modelHero.getHeroList(uid) return this.modelHero.getHeroList(uid)
} }
// 查询英雄数量 func (this *Hero) QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero) {
func (this *Hero) QueryHeroAmount(uId string, heroCfgId string) (amount uint32) {
heroes := this.GetHeroList(uId) heroes := this.GetHeroList(uId)
for _, v := range heroes { for _, v := range heroes {
if v.HeroID == heroCfgId { if v.HeroID == heroCfgId {
amount++ return v
} }
} }
return amount return nil
} }
// 删除指定卡牌 // 删除指定卡牌

View File

@ -157,8 +157,13 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
}) })
} }
} }
var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype132, 1, _heroObj.Favorlv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype133, _heroObj.Favorlv, utils.ToInt32(_heroObj.Heroid)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv))
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)) //go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv))
} }
return return

View File

@ -252,38 +252,6 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe
return return
} }
//与N个英雄好感度等级达到A
func (this *Library) CheckRtype132(uid string, num int32, lv int32) bool {
fetter := this.GetHeroFetterList(uid)
if len(fetter) == 0 {
return false
}
for _, v := range fetter {
if v.Favorlv >= lv {
num--
}
}
if num >= 0 {
return true
}
return false
}
//与指定英雄好感度等级达到N
func (this *Library) CheckRtype133(uid string, heroId string, lv int32) bool {
fetter := this.GetHeroFetterList(uid)
if len(fetter) == 0 {
return false
}
for _, v := range fetter {
if v.Heroid == heroId && v.Favorlv >= lv {
return true
}
}
return false
}
func (this *Library) TaskFinishNotify(uid string, taskId, fetterId int32) error { func (this *Library) TaskFinishNotify(uid string, taskId, fetterId int32) error {
ft := this.modelFetterstory.getFetterTasks(uid, fetterId) ft := this.modelFetterstory.getFetterTasks(uid, fetterId)
if ft == nil { if ft == nil {

View File

@ -91,7 +91,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
handle := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
verify: this.modelRtask.verifyRtype3, verify: this.modelRtask.verifyRtype3,
update: this.modelRtaskRecord.overrideUpdate,
} }
handles = append(handles, handle) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle) this.registerVerifyHandle(v.Id, handle)
@ -107,7 +106,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
handle := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
verify: this.modelRtask.verfiyRtype9, verify: this.modelRtask.verfiyRtype9,
update: this.modelRtaskRecord.overrideUpdate,
} }
handles = append(handles, handle) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle) this.registerVerifyHandle(v.Id, handle)
@ -125,8 +123,7 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype132, comm.Rtype135, comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype132, comm.Rtype135,
comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146, comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146,
comm.Rtype147, comm.Rtype148, comm.Rtype149, comm.Rtype152, comm.Rtype153, comm.Rtype154, comm.Rtype147, comm.Rtype148, comm.Rtype149, comm.Rtype152, comm.Rtype153, comm.Rtype154,
comm.Rtype155, comm.Rtype156, comm.Rtype161, comm.Rtype162, comm.Rtype163, comm.Rtype164, comm.Rtype156, comm.Rtype161, comm.Rtype165, comm.Rtype166, comm.Rtype167,
comm.Rtype165, comm.Rtype166, comm.Rtype167,
comm.Rtype171, comm.Rtype172, comm.Rtype173, comm.Rtype175, comm.Rtype177, comm.Rtype171, comm.Rtype172, comm.Rtype173, comm.Rtype175, comm.Rtype177,
comm.Rtype181, comm.Rtype182, comm.Rtype183, comm.Rtype184, comm.Rtype185, comm.Rtype186, comm.Rtype187: comm.Rtype181, comm.Rtype182, comm.Rtype183, comm.Rtype184, comm.Rtype185, comm.Rtype186, comm.Rtype187:
handle := &rtaskCondHandle{ handle := &rtaskCondHandle{
@ -148,7 +145,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
handle := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
verify: this.modelRtask.verifyRtype20, verify: this.modelRtask.verifyRtype20,
update: this.modelRtaskRecord.overrideUpdate,
} }
handles = append(handles, handle) handles = append(handles, handle)
@ -162,6 +158,14 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle)
case comm.Rtype138:
handle := &rtaskCondHandle{
condId: v.Id,
verify: this.modelRtask.verifyRtype138,
}
handles = append(handles, handle) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype16, comm.Rtype17, case comm.Rtype16, comm.Rtype17,

View File

@ -4,6 +4,7 @@ package rtask
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils" "go_dreamfactory/utils"
@ -345,3 +346,20 @@ func (this *ModelRtask) verifyRtype63(uid string, record *pb.DBRtaskRecord, cfg
return return
} }
// 记录玩家在线时间并记入进度
func (this *ModelRtask) verifyRtype138(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
userModule, err := this.service.GetModule(comm.ModuleUser)
if err != nil {
return
}
if um, y := userModule.(comm.IUser); y {
if user := um.GetUser(uid); user != nil {
now := configure.Now().Unix()
l := (now - user.Logintime) / 60
return soGreatEqual(int32(l), cfg.Data1)
}
}
return
}

View File

@ -59,6 +59,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
code = pb.ErrorCode_SmithyNoFoundAtlas code = pb.ErrorCode_SmithyNoFoundAtlas
return return
} }
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype166, 1))
} else if conf.TypeId == 2 { } else if conf.TypeId == 2 {
if v, ok := atlas.Collect[req.Id]; ok { if v, ok := atlas.Collect[req.Id]; ok {
if !v.Activate { // 激活 if !v.Activate { // 激活
@ -74,8 +75,10 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
code = pb.ErrorCode_SmithyNoFoundAtlas code = pb.ErrorCode_SmithyNoFoundAtlas
return return
} }
}
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype165, 1))
}
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype167, atlas.Score))
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas}) session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
return return
} }

View File

@ -61,7 +61,7 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (cod
this.module.modelStove.updateSmithyStove(session.GetUserId(), update) this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove}) session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove})
tasks := make([]*comm.TaskParam, 0) tasks := make([]*comm.TaskParam, 0)
tasks = append(tasks, comm.GettaskParam(comm.Rtype171, stove.Temperature)) tasks = append(tasks, comm.GettaskParam(comm.Rtype175, stove.Temperature))
this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...) this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...)
} }

View File

@ -160,6 +160,14 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId
this.Error("添加世界任务失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err}) this.Error("添加世界任务失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err})
return err return err
} }
} else if mytask.Uid == "" {
update := map[string]interface{}{
"uid": uid,
}
if err := this.modelWorldtask.Change(uid, update); err != nil {
this.Error("更新世界任务失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err})
return err
}
} }
if _, ok := utils.Findx(mytask.TaskList, taskId); ok { if _, ok := utils.Findx(mytask.TaskList, taskId); ok {