From 431c95ebb0dc9d803d15ecb66fb0cf0aacaf8500 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 31 Aug 2022 17:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E4=BB=BB=E5=8A=A1=E5=9F=8B?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_smithystove.json | 20 ++++++++++---------- comm/const.go | 2 +- modules/hero/api_awaken.go | 8 ++++++++ modules/hero/api_drawCard.go | 21 +++++++++++++++++++++ modules/hero/api_strengthenUpStar.go | 12 ++++++++++++ modules/hero/api_strengthenUplv.go | 10 ++++++++++ modules/hero/module.go | 24 ++++++++++++++++++++++++ modules/rtask/module.go | 2 +- pb/hunting_db.pb.go | 2 +- 9 files changed, 88 insertions(+), 13 deletions(-) diff --git a/bin/json/game_smithystove.json b/bin/json/game_smithystove.json index dfb91fd95..5cd340b02 100644 --- a/bin/json/game_smithystove.json +++ b/bin/json/game_smithystove.json @@ -21,7 +21,7 @@ ], "probability": 100, "floors": 1, - "time": 300, + "time": 15, "desk": "" }, { @@ -46,7 +46,7 @@ ], "probability": 100, "floors": 1, - "time": 300, + "time": 15, "desk": "" }, { @@ -71,7 +71,7 @@ ], "probability": 100, "floors": 1, - "time": 300, + "time": 15, "desk": "" }, { @@ -96,7 +96,7 @@ ], "probability": 100, "floors": 2, - "time": 300, + "time": 15, "desk": "" }, { @@ -121,7 +121,7 @@ ], "probability": 100, "floors": 3, - "time": 300, + "time": 15, "desk": "" }, { @@ -146,7 +146,7 @@ ], "probability": 100, "floors": 4, - "time": 300, + "time": 15, "desk": "" }, { @@ -171,7 +171,7 @@ ], "probability": 100, "floors": 5, - "time": 300, + "time": 15, "desk": "" }, { @@ -196,7 +196,7 @@ ], "probability": 100, "floors": 5, - "time": 300, + "time": 15, "desk": "" }, { @@ -221,7 +221,7 @@ ], "probability": 100, "floors": 5, - "time": 300, + "time": 15, "desk": "" }, { @@ -235,7 +235,7 @@ "starupneed": [], "probability": 100, "floors": -1, - "time": 300, + "time": 15, "desk": "" }, { diff --git a/comm/const.go b/comm/const.go index 6c01a0204..156fe6a06 100644 --- a/comm/const.go +++ b/comm/const.go @@ -210,7 +210,7 @@ const ( Rtype1 TaskType = 1 //英雄指定 Rtype2 TaskType = 2 //主线之内触发了剧情Id Rtype3 TaskType = 3 //每日任务 - Rtask4 TaskType = 4 //指定英雄的等级限制 + Rtype4 TaskType = 4 //指定英雄的等级限制 Rtype5 TaskType = 5 //指定英雄的装备数量 Rtype6 TaskType = 6 //指定英雄的星级 Rtype7 TaskType = 7 //日常登录一次 diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 9e1a782e8..cda8199cf 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" "strconv" "google.golang.org/protobuf/proto" @@ -119,5 +120,12 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c chanegCard = append(chanegCard, _hero) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: chanegCard}) 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.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)) + cfg := this.module.configure.GetHero(_hero.HeroID) + if cfg != nil { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv) + } return } diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index 26a4f615f..ded38923d 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -190,5 +190,26 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq rsp.Heroes = szCards session.SendMsg(string(this.module.GetType()), DrawCard, rsp) + + // 任务统计 + if req.DrawType == 0 { //普通招募 + if drawCount == 10 { + sz := make(map[int32]int32, 0) + for _, star := range szStar { + sz[star]++ + } + for k, v := range sz { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype17, k, v) + } + } + this.module.ModuleRtask.SendToRtask(session, comm.Rtype14, drawCount) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype18, drawCount) + } else { // 阵营招募 + this.module.ModuleRtask.SendToRtask(session, comm.Rtype15, drawCount) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype19, drawCount) + } + for _, star := range szStar { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1) + } return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index f17fc0059..ba8d24e82 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -168,5 +169,16 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr chanegCard = append(chanegCard, _hero) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: chanegCard}) session.SendMsg(string(this.module.GetType()), StrengthenUpStar, &pb.HeroStrengthenUpStarResp{Hero: _hero}) + + this.module.ModuleRtask.SendToRtask(session, comm.Rtype6, utils.ToInt32(_hero.HeroID), _hero.Star) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype25, 1, utils.ToInt32(_hero.HeroID), _hero.Star) + if _hero.Star == 4 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype26, 1) + } else if _hero.Star == 5 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype27, 1) + } else if _hero.Star == 6 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1) + } + return } diff --git a/modules/hero/api_strengthenUplv.go b/modules/hero/api_strengthenUplv.go index 91fadbe6b..8141d5e0a 100644 --- a/modules/hero/api_strengthenUplv.go +++ b/modules/hero/api_strengthenUplv.go @@ -3,6 +3,7 @@ package hero import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -189,6 +190,15 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero}) if iLvUp > 0 { // 升级了 统计任务 this.module.ModuleTask.SendToTask(session, comm.TaskTypeUpHeroLevel, &pb.TaskParam{Second: iLvUp}) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(_hero.HeroID), _hero.Lv) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, _hero.Star, _hero.Lv) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype24, iLvUp) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype29, 1, _hero.Lv, utils.ToInt32(_hero.HeroID)) + cfg := this.module.configure.GetHero(_hero.HeroID) + if cfg != nil { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype32, 1, cfg.Color, _hero.Lv) + } + this.module.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, _hero.Lv) } return diff --git a/modules/hero/module.go b/modules/hero/module.go index 17bda7e63..4a5c07453 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -7,6 +7,7 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" + "go_dreamfactory/utils" ) func NewModule() core.IModule { @@ -71,10 +72,21 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string, } if len(initUpdate) != 0 { + this.ModuleUser.ChangeUserExpand(uid, initUpdate) } } }(session.GetUserId(), heroCfgId) + // 统计任务 + this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId)) + // 查品质 + cfg := this.configure.GetHero(heroCfgId) + if cfg != nil { + + this.ModuleRtask.SendToRtask(session, comm.Rtype30, 1, cfg.Color) + this.ModuleRtask.SendToRtask(session, comm.Rtype31, 1, cfg.Color) + } + if bPush { //推送 session.SendMsg("hero", "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}}) } @@ -197,6 +209,13 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string] continue } changeHero = append(changeHero, hero) + // 查品质 + cfg := this.configure.GetHero(heroCfgId) + if cfg != nil { + + this.ModuleRtask.SendToRtask(session, comm.Rtype30, 1, cfg.Color) + this.ModuleRtask.SendToRtask(session, comm.Rtype31, 1, cfg.Color) + } } // 添加图鉴 @@ -218,6 +237,11 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string] } } }(session.GetUserId(), heros) + for k := range heros { // 任务统计 + this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(k)) + + } + if bPush && len(changeHero) > 0 { //推送 session.SendMsg("hero", "change", &pb.HeroChangePush{List: changeHero}) } diff --git a/modules/rtask/module.go b/modules/rtask/module.go index bff56a9e9..80b5f84b9 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -78,7 +78,7 @@ func (this *ModuleRtask) initRtaskHandle() { cfg: typeCfg, fn: this.modelRtask.HeroTarget, }) - case comm.Rtask4: + case comm.Rtype4: this.register(v.Id, &rtaskCondi{ cfg: typeCfg, fn: this.modelRtask.HeroLvTarget, diff --git a/pb/hunting_db.pb.go b/pb/hunting_db.pb.go index d26605ccf..e8cbbe590 100644 --- a/pb/hunting_db.pb.go +++ b/pb/hunting_db.pb.go @@ -115,7 +115,7 @@ func (x *DBHunting) GetChallengeTime() map[int32]int32 { return nil } -// 维京远征排行榜 +// 狩猎排行榜 type DBHuntingRank struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache