From 08afddcc38c182c6aee734156acad1ae1f7aa1f0 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 17:52:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index 781ae8c24..b01751a38 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -74,6 +74,15 @@ type ( RechargeMoney(uid string, money int32) // 多少天没登录 NoLoginDay(uid string, day int32) + + // 拥有N个X级英雄 + CheckLvNum(uid string, lv int32) int32 + + // 激活X个英雄图鉴 + GetTujianHeroNum(uid string) int32 + //拥有觉醒至A级的B星英雄N个 Rtype123 + CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 + //拥有共鸣至N级的英雄 Rtype124 } //玩家 From 4a7ef70fea2ceb32fccb034710246c96892de07f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 17:53:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- modules/hero/api_awaken.go | 2 ++ modules/hero/api_drawCard.go | 7 +++++++ modules/hero/api_strengthenUpStar.go | 2 +- modules/hero/model_hero.go | 2 ++ modules/hero/module.go | 31 ++++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/comm/const.go b/comm/const.go index 0de433217..999fe8fec 100644 --- a/comm/const.go +++ b/comm/const.go @@ -483,7 +483,7 @@ const ( Rtype123 TaskType = 123 //拥有共鸣至A级的B星英雄N个(打开任务时,检查B星英雄中共鸣等级大于等于A级的记入进度,达到任务条件则完成任务) Rtype124 TaskType = 124 //拥有共鸣至N级的英雄(打开任务时,检查英雄中共鸣等级最高的英雄并记入进度,达到任务条件则完成任务) Rtype125 TaskType = 125 //指定英雄共鸣至N级(打开任务时,检查指定英雄的共鸣等级并记入进度,达到任务条件则完成任务) - Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始,A阵营的英雄共鸣每升1级进度+1) + Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始,A阵营的英雄共鸣每升1级进度1) Rtype127 TaskType = 127 //A星英雄共鸣N级(从接到任务开始,A星的英雄共鸣每升1级进度+1) Rtype128 TaskType = 128 //竞技场积分达到N分(历史最高记录计入进度,达到N分则完成任务) Rtype129 TaskType = 129 //竞技场段位达到A段位(打开任务时,检查玩家历史最高段位,如果达到任务条件则完成任务) diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index a3eead735..8750fd3e9 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -106,9 +106,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c session.SendMsg(string(this.module.GetType()), Awaken, &pb.HeroAwakenResp{Hero: _hero}) //任务相关 this.module.ModuleRtask.SendToRtask(session, comm.Rtype34, 1, _hero.JuexingLv) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype119, _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)) cfg := this.module.configure.GetHeroConfig(_hero.HeroID) if cfg != nil { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv) //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index eed2c9110..c39231f49 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -246,9 +246,16 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq } else { // 阵营招募 this.module.ModuleRtask.SendToRtask(session, comm.Rtype15, req.DrawCount) this.module.ModuleRtask.SendToRtask(session, comm.Rtype19, req.DrawCount) + if drawCount == 10 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype91, 1) // 阵营10连 + } } for _, star := range szStar { this.module.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1) } + if drawCount == 10 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype90, 1) + } + this.module.ModuleRtask.SendToRtask(session, comm.Rtype89, req.DrawCount) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index cfd608092..4bf466003 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -178,6 +178,6 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } else if _hero.Star == 6 { this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1) } - + this.module.ModuleRtask.SendToRtask(session, comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star) return } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index f1645577d..5f060896c 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -560,6 +560,8 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex if curLv-preLv > 0 { // 升级了 统计任务 this.ChangeHeroProperty(session, hero) // 重新计算属性值 // 推送 + + this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, hero.Star, hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype24, 1) diff --git a/modules/hero/module.go b/modules/hero/module.go index b11a28491..c98e48210 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -560,3 +560,34 @@ func (this *Hero) CheckCondition(uid string) bool { } return false } + +// 检查大于lv等级英雄的数量 +func (this *Hero) CheckLvNum(uid string, lv int32) int32 { + + tmp := make([]*pb.DBHero, 0) + for _, v := range this.modelHero.getHeroList(uid) { + if v.Lv >= lv { + tmp = append(tmp, v) + } + } + return int32(len(tmp)) +} + +func (this *Hero) GetTujianHeroNum(uid string) int32 { + if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil { + tujian := result.GetTujian() + return int32(len(tujian)) + } + return 0 +} + +////拥有觉醒至A级的B星英雄N个 +func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 { + tmp := make([]*pb.DBHero, 0) + for _, v := range this.modelHero.getHeroList(uid) { + if v.JuexingLv >= juexingLv && v.Star >= star { + tmp = append(tmp, v) + } + } + return int32(len(tmp)) +}