diff --git a/comm/const.go b/comm/const.go index 6fc628b87..93334f7bb 100644 --- a/comm/const.go +++ b/comm/const.go @@ -636,6 +636,10 @@ const ( Rtype160 TaskType = 160 //主线总星数达到X星 Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗 + Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品 + Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个 + Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分 + Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层 Rtype169 TaskType = 169 //触发指定套装的套装效果 Rtype170 TaskType = 170 //获得指定材料X个 diff --git a/comm/imodule.go b/comm/imodule.go index e13c8592f..4450fd571 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -65,7 +65,7 @@ type ( //英雄 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) @@ -422,10 +422,7 @@ type ( IReddot } 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 } diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 5cacfaa04..65d776515 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -101,9 +101,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c } var szTask []*comm.TaskParam 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.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) if cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv)) diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index 79a4a89eb..1f433159a 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -137,7 +137,9 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt 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.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...) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 6e80cb690..3ba68a930 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -95,7 +95,8 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } else if _hero.Star == 6 { 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...) return } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 343a97b22..15288fcc1 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" 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, 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 } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 2bf92171d..5bd6350f1 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -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.Rtype118, hero.Lv, hero.JuexingLv)) go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) //this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) } diff --git a/modules/hero/module.go b/modules/hero/module.go index f1db05e35..b0aabd167 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -182,15 +182,14 @@ func (this *Hero) GetHeroList(uid string) []*pb.DBHero { return this.modelHero.getHeroList(uid) } -// 查询英雄数量 -func (this *Hero) QueryHeroAmount(uId string, heroCfgId string) (amount uint32) { +func (this *Hero) QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero) { heroes := this.GetHeroList(uId) for _, v := range heroes { if v.HeroID == heroCfgId { - amount++ + return v } } - return amount + return nil } // 删除指定卡牌 diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index b2fa46fbe..821deecb6 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -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) - 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 diff --git a/modules/library/module.go b/modules/library/module.go index 7dfee587f..cfced6ed8 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -252,38 +252,6 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe 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 { ft := this.modelFetterstory.getFetterTasks(uid, fetterId) if ft == nil { diff --git a/modules/smithy/api_atlasactivate.go b/modules/smithy/api_atlasactivate.go index e53d2d3e6..2d5b58747 100644 --- a/modules/smithy/api_atlasactivate.go +++ b/modules/smithy/api_atlasactivate.go @@ -59,6 +59,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla code = pb.ErrorCode_SmithyNoFoundAtlas return } + this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype166, 1)) } else if conf.TypeId == 2 { if v, ok := atlas.Collect[req.Id]; ok { if !v.Activate { // 激活 @@ -74,8 +75,10 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla code = pb.ErrorCode_SmithyNoFoundAtlas 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}) return } diff --git a/modules/smithy/api_rise.go b/modules/smithy/api_rise.go index ced8cf39c..e54ad591e 100644 --- a/modules/smithy/api_rise.go +++ b/modules/smithy/api_rise.go @@ -61,7 +61,7 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (cod this.module.modelStove.updateSmithyStove(session.GetUserId(), update) session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove}) 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...) }