From 41285d522c3e6048bf7271c70df270669d2bbbb3 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 11:56:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BB=99=E8=8B=B1=E9=9B=84=E8=B5=A0?= =?UTF-8?q?=E9=80=81=E9=A3=9F=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_usegift.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 6ac953e60..5da8a3c00 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -37,7 +37,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe return } - _exp := this.module.configure.GetFavorabilityExp(req.Heroid) + _exp := this.module.configure.GetFavorabilityExp(_heroObj.Heroid) if len(_exp) == 0 { code = pb.ErrorCode_ConfigNoFound return From 495d7172b4108d8453562db6963af7fd61343b57 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 12:02:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A5=BD=E6=84=9F?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_usegift.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 5da8a3c00..fdf9557d2 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -67,8 +67,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe } // 校验是否是自己喜欢的食物 - _c := this.module.configure.GetFavorability(req.Heroid, _heroObj.Favorlv) - if _c != nil { + _c := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv) + if _c == nil { code = pb.ErrorCode_ConfigNoFound return } @@ -138,9 +138,9 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe // 任务统计 //赠送英雄礼物并增加N点好感度 if upLv > 0 { - this.module.Errorf("英雄好感度等级提升,英雄ID:%s,增加经验:%s,提升的等级:%d", req.Heroid, addExp, upLv) + this.module.Errorf("英雄好感度等级提升,英雄ID:%s,增加经验:%s,提升的等级:%d", _heroObj.Heroid, addExp, upLv) if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 修改阵营累计好感度 - if heroCfg := this.module.configure.GetHeroConfig(req.Heroid); heroCfg != nil { + if heroCfg := this.module.configure.GetHeroConfig(_heroObj.Heroid); heroCfg != nil { rst.Race[heroCfg.Race] += upLv this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ "race": rst.Race, From a11dfcbababc5afcfb3f56778d65cae8a605addd Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 14:37:35 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A5=BD=E6=84=9F=E5=BA=A6=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_usegift.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index fdf9557d2..470d2c854 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -56,13 +56,13 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe code = pb.ErrorCode_LibraryGiveMaxCount return } - last := 1 - for iPos, v := range c { - for ; last <= iPos; last++ { + var last int32 = 1 + for _, v := range c { + for ; last <= v.K; last++ { attenuation[int32(last)] = v.V // 3,1000|6,500|9,250 } } - for i := _heroObj.Givecount; i <= _heroObj.Givecount+req.Counts; i++ { + for i := _heroObj.Givecount + 1; i <= _heroObj.Givecount+req.Counts; i++ { addExp += attenuation[i] } @@ -106,9 +106,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe code = pb.ErrorCode_ConfigNoFound return } - // 100*1 + 100*0.5 + 100*0.25 - addExp *= itemConf.SpecialType / 1000 - _heroObj.Favorexp += addExp + addExp *= itemConf.SpecialType + _heroObj.Favorexp += addExp / 1000 // 折算出等级 for { @@ -116,8 +115,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe _heroObj.Favorexp = 0 break } - if _exp[_heroObj.Favorlv] <= _heroObj.Favorexp { - _heroObj.Favorexp -= _exp[_heroObj.Favorlv] + if _exp[_heroObj.Favorlv-1] <= _heroObj.Favorexp { + _heroObj.Favorexp -= _exp[_heroObj.Favorlv-1] _heroObj.Favorlv += 1 upLv++ } else { From f6d0dbb7dd0c81184855bbdab205aaa015870186 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 16:30:56 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=B5=A0=E9=80=81=E7=A4=BC=E7=89=A9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_battleready.json | 6 +++--- bin/json/game_item.json | 31 +++++++++++++++++++++++++++++++ bin/json/game_taskround.json | 32 ++++++++++++++++---------------- modules/library/api_usegift.go | 9 ++++++--- 4 files changed, 56 insertions(+), 22 deletions(-) diff --git a/bin/json/game_battleready.json b/bin/json/game_battleready.json index 23d22bdec..505f5d2c2 100644 --- a/bin/json/game_battleready.json +++ b/bin/json/game_battleready.json @@ -51,7 +51,7 @@ "id": 103, "PlayType": "Pagoda", "HeroCount": 5, - "readyScene": "scenesfight_role_interface_02", + "readyScene": "scenesfight_role_interface_03", "battleScenes": [ "scenesfight_06" ], @@ -243,7 +243,7 @@ "id": 115, "PlayType": "test", "HeroCount": 5, - "readyScene": "scenesfight_role_interface_02", + "readyScene": "scenesfight_role_interface_03", "battleScenes": [ "scenesfight_06" ], @@ -275,7 +275,7 @@ "id": 117, "PlayType": "test", "HeroCount": 5, - "readyScene": "scenesfight_role_interface_02", + "readyScene": "scenesfight_role_interface_03", "battleScenes": [ "scenesfight_06" ], diff --git a/bin/json/game_item.json b/bin/json/game_item.json index 47ce805e5..a90bcd974 100644 --- a/bin/json/game_item.json +++ b/bin/json/game_item.json @@ -9908,5 +9908,36 @@ ], "synthetize_deplete": [], "decompose_deplete": [] + }, + { + "id": "15010101", + "name": { + "key": "weektask_dj_15010101", + "text": "活跃度" + }, + "usetype": 15, + "color": 3, + "bagtype": 0, + "index": 1, + "special_type": 0, + "time": 0, + "reddottype": 0, + "effects": "", + "modelName": "", + "box_id": 0, + "synthetize_num": 0, + "access": [ + 902 + ], + "use_skip": 902, + "upper_limit": -1, + "img": "dj_my_tj03", + "intr": { + "key": "weektask15010101", + "text": "秘境神水" + }, + "sale": [], + "synthetize_deplete": [], + "decompose_deplete": [] } ] \ No newline at end of file diff --git a/bin/json/game_taskround.json b/bin/json/game_taskround.json index 15bff18f8..fe6aa4621 100644 --- a/bin/json/game_taskround.json +++ b/bin/json/game_taskround.json @@ -15,8 +15,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -36,8 +36,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -57,8 +57,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -78,8 +78,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -99,8 +99,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -120,8 +120,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -141,8 +141,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] }, @@ -162,8 +162,8 @@ "reword": [ { "a": "item", - "t": "151001", - "n": 1 + "t": "14030414", + "n": 40 } ] } diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 470d2c854..dcea1f9cb 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -24,6 +24,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe attenuation map[int32]int32 likeStates int32 // 0 普通食物 1 喜欢 2 不喜欢 addExp int32 // 获得的经验 + sCount int32 // 赠送开始次数 ) attenuation = make(map[int32]int32, 0) code = this.UseGiftCheck(session, req) @@ -48,11 +49,11 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe code = pb.ErrorCode_LibraryMaxLv return } - + sCount = _heroObj.Givecount // 获取当天最大的次数 c := this.module.ModuleTools.GetGlobalConf().FavorabilityAttenuation maxCoun := c[len(c)-1].K + 1 - if _heroObj.Givecount+req.Counts > maxCoun { // 当天赠送次数 + if sCount+req.Counts > maxCoun { // 当天赠送次数 code = pb.ErrorCode_LibraryGiveMaxCount return } @@ -62,7 +63,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe attenuation[int32(last)] = v.V // 3,1000|6,500|9,250 } } - for i := _heroObj.Givecount + 1; i <= _heroObj.Givecount+req.Counts; i++ { + for i := sCount + 1; i <= sCount+req.Counts; i++ { + _heroObj.Givecount += 1 addExp += attenuation[i] } @@ -130,6 +132,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe mapData := make(map[string]interface{}) mapData["favorexp"] = _heroObj.Favorexp mapData["favorlv"] = _heroObj.Favorlv + mapData["givecount"] = _heroObj.Givecount this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroObj.Id, mapData) rsp.Data = _heroObj session.SendMsg(string(this.module.GetType()), LibraryUseGiftResp, rsp) From 8dca163a32d32634951dea0c9c6f59d39be9bfcc Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 18:42:42 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=BE=81=E7=BB=8A=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_activationfetter.go | 5 ++++- modules/library/module.go | 23 +---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/modules/library/api_activationfetter.go b/modules/library/api_activationfetter.go index 8ffca14fc..bafe588fb 100644 --- a/modules/library/api_activationfetter.go +++ b/modules/library/api_activationfetter.go @@ -20,7 +20,6 @@ func (this *apiComp) ActivationFetter(session comm.IUserSession, req *pb.Library return // 参数校验失败直接返回 } rsp := &pb.LibraryActivationFetterResp{} - defer session.SendMsg(string(this.module.GetType()), LibraryActivationFetterResp, rsp) fetter := this.module.modelLibrary.getOneLibrary(session.GetUserId(), req.Oid) if fetter == nil { code = pb.ErrorCode_LibraryNoData @@ -31,9 +30,13 @@ func (this *apiComp) ActivationFetter(session comm.IUserSession, req *pb.Library return } fetter.Activation = true + fetter.Fetterlv = 1 mapData := make(map[string]interface{}, 0) mapData["activation"] = fetter.Activation + mapData["fetterlv"] = 1 + this.module.modelLibrary.modifyLibraryDataByObjId(session.GetUserId(), fetter.Id, mapData) rsp.Data = fetter + session.SendMsg(string(this.module.GetType()), LibraryActivationFetterResp, rsp) return } diff --git a/modules/library/module.go b/modules/library/module.go index 181d7e355..4a85e263c 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -94,7 +94,7 @@ func (this *Library) GetLibraryListByHid(uid string, hid string) *pb.DBLibrary { func (this *Library) CheckFetter(uid string, hid string) (dbLibrary []*pb.DBLibrary, fetter []*pb.DBHeroFetter) { szFid := this.configure.GetHeroFetterID(hid) - for _, fid := range szFid { + for fid := range szFid { if list := this.GetLibraryListByFid(uid, fid); list == nil { // 没有这条羁绊数据 tmp := &pb.DBLibrary{ // 创建一条羁绊数据 @@ -132,27 +132,6 @@ func (this *Library) CheckFetter(uid string, hid string) (dbLibrary []*pb.DBLibr return } -//通过羁绊id 创建多个羁绊信息 -func (this *Library) CreateLibrary(uid string, fid int32, heroConfId string) (code pb.ErrorCode, obj *pb.DBLibrary) { - obj = &pb.DBLibrary{ - Id: primitive.NewObjectID().Hex(), - Uid: uid, - Fid: fid, - Herofetter: map[string]string{}, - Prize: map[int32]int32{}, - } - - conf := this.configure.GetFriendData(fid, 1) - if conf != nil { - - if err := this.modelLibrary.createLibrary(uid, obj); err != nil { - code = pb.ErrorCode_DBError - } - obj.Herofetter[heroConfId] = obj.Id - } - - return -} func (this *Library) ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (code pb.ErrorCode) { err := this.modelFetter.modifyHeroFetterDataByObjId(uid, obj, data) if err != nil {