From 6955acb9183290db2324db41e55916abc7bd8990 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 11 Apr 2023 19:24:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/items/core.go | 9 +++++---- modules/items/modelitems.go | 12 ++++++++---- modules/items/module.go | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/items/core.go b/modules/items/core.go index ea4fd157a..d38ec6039 100644 --- a/modules/items/core.go +++ b/modules/items/core.go @@ -20,10 +20,11 @@ const ( ) var ( - ItemNotEnoughError = errors.New("item not enough!") //物品不足 - NoFoundGirdError = errors.New("no found gvrid!") //未找到格子 - PackGridNumUpper = errors.New("grid amount upper!") //背包格子达到上限 - GirdAmountUpper = errors.New("grid amount upper!") //格子容量达到上限 + NoFoundItemConfig = errors.New("no found itemconfig!") //道具配置未找到 + ItemNotEnoughError = errors.New("item not enough!") //物品不足 + NoFoundGirdError = errors.New("no found gvrid!") //未找到格子 + PackGridNumUpper = errors.New("grid amount upper!") //背包格子达到上限 + GirdAmountUpper = errors.New("grid amount upper!") //格子容量达到上限 ) //随机权重宝箱 diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index d7ae75bcc..1b517bda3 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -228,7 +228,9 @@ func (this *ModelItemsComp) AddItemToUserPack(uId string, itemId string, addnum return } change = make([]*pb.DB_UserItemData, 0) - add, update, del, leftnum = this.addItemToUserPack(uId, itmes, itemId, addnum) + if add, update, del, leftnum, err = this.addItemToUserPack(uId, itmes, itemId, addnum); err != nil { + return + } if leftnum < 0 { err = ItemNotEnoughError return @@ -275,7 +277,9 @@ func (this *ModelItemsComp) AddItemsToUserPack(uId string, items map[string]int3 } change = make([]*pb.DB_UserItemData, 0) for k, v := range items { - add, update, del, leftnum = this.addItemToUserPack(uId, itmes, k, v) + if add, update, del, leftnum, err = this.addItemToUserPack(uId, itmes, k, v); err != nil { + return + } if leftnum < 0 { err = ItemNotEnoughError return @@ -352,9 +356,8 @@ func (this *ModelItemsComp) AddItemToUserPackByGrid(uId string, gridid string, a } ///添加移除物品到用户背包 -func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserItemData, itemId string, addnum int32) (add, update, del []*pb.DB_UserItemData, leftnum int64) { +func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserItemData, itemId string, addnum int32) (add, update, del []*pb.DB_UserItemData, leftnum int64, err error) { var ( - err error conf *cfg.GameItemData num int64 isNew bool @@ -364,6 +367,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte } if conf, err = this.module.configure.GetItemConfigure(itemId); err != nil { this.module.Errorln(err) + err = NoFoundItemConfig return } if conf.UpperLimit == 0 { diff --git a/modules/items/module.go b/modules/items/module.go index 29bb9ebdd..24f77f1f0 100644 --- a/modules/items/module.go +++ b/modules/items/module.go @@ -148,6 +148,8 @@ func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, b code = pb.ErrorCode_ItemsNoEnough } else if err == PackGridNumUpper { code = pb.ErrorCode_ItemsGridNumUpper + } else if err == NoFoundItemConfig { + code = pb.ErrorCode_ConfigNoFound } else { code = pb.ErrorCode_Unknown } @@ -192,7 +194,6 @@ func (this *Items) RecoverTicket(session comm.IUserSession) (code pb.ErrorCode) //Evens-------------------------------------------------------------------------------------------------------------------------------- //推送道具变化消息 func (this *Items) itemsChangePush(session comm.IUserSession, items []*pb.DB_UserItemData) (err error) { - session.SendMsg(string(this.GetType()), "change", &pb.ItemsChangePush{Grids: items}) return } From 5fbd68322b0217fd8e5927ff12bc424f12e9173e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 11 Apr 2023 20:07:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_battleready.json | 2 +- bin/json/game_lottery.json | 16 +-- bin/json/game_potions.json | 218 +++++++++++++++---------------- bin/json/game_skillafteratk.json | 144 ++++++++++++++++++++ bin/json/game_skillatk.json | 84 ++++++++++++ bin/json/game_smithystovev1.json | 20 +-- 6 files changed, 356 insertions(+), 128 deletions(-) diff --git a/bin/json/game_battleready.json b/bin/json/game_battleready.json index 656f16157..8b6e155b5 100644 --- a/bin/json/game_battleready.json +++ b/bin/json/game_battleready.json @@ -170,7 +170,7 @@ "HeroCount": 5, "readyScene": "scenesfight_role_interface_02", "battleScenes": [ - "scenesfight_03_02" + "scenesfight_07" ], "DefaultHero": 0, "DisableHero": [], diff --git a/bin/json/game_lottery.json b/bin/json/game_lottery.json index 4462598f0..d5bad4b39 100644 --- a/bin/json/game_lottery.json +++ b/bin/json/game_lottery.json @@ -124,10 +124,10 @@ "lotteryid": 40001001, "description": "随机蓝色英雄", "type": 0, - "groupwt": 500, - "groupid": 1002, - "subtype": 2, - "groupnum": 1, + "groupwt": 0, + "groupid": 1001, + "subtype": 0, + "groupnum": 0, "itemid": { "a": "item", "t": "132005", @@ -149,7 +149,7 @@ "description": "随机蓝色英雄", "type": 0, "groupwt": 0, - "groupid": 1002, + "groupid": 1001, "subtype": 0, "groupnum": 0, "itemid": { @@ -173,7 +173,7 @@ "description": "随机蓝色英雄", "type": 0, "groupwt": 0, - "groupid": 1002, + "groupid": 1001, "subtype": 0, "groupnum": 0, "itemid": { @@ -197,7 +197,7 @@ "description": "随机蓝色英雄", "type": 0, "groupwt": 0, - "groupid": 1002, + "groupid": 1001, "subtype": 0, "groupnum": 0, "itemid": { @@ -221,7 +221,7 @@ "description": "随机蓝色英雄", "type": 0, "groupwt": 0, - "groupid": 1002, + "groupid": 1001, "subtype": 0, "groupnum": 0, "itemid": { diff --git a/bin/json/game_potions.json b/bin/json/game_potions.json index 8162713e7..22f482a13 100644 --- a/bin/json/game_potions.json +++ b/bin/json/game_potions.json @@ -23,26 +23,26 @@ { "Id": "120001", "weight": 500, - "score": 1, + "score": 5, "effectType": 1 }, { "Id": "120002", "weight": 200, - "score": 5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120003", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120004", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -55,21 +55,21 @@ "standard_yield": [ { "a": "item", - "t": "100001", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100001", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100001", + "t": "100006", "n": 7 } ] @@ -96,8 +96,8 @@ { "Id": "120001", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120002", @@ -108,14 +108,14 @@ { "Id": "120003", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120004", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -128,21 +128,21 @@ "standard_yield": [ { "a": "item", - "t": "100002", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100002", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100002", + "t": "100006", "n": 7 } ] @@ -169,26 +169,26 @@ { "Id": "120001", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120002", "weight": 200, - "score": -5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120003", "weight": 200, "score": 5, - "effectType": 2 + "effectType": 1 }, { "Id": "120004", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -201,21 +201,21 @@ "standard_yield": [ { "a": "item", - "t": "100003", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100003", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100003", + "t": "100006", "n": 7 } ] @@ -242,26 +242,26 @@ { "Id": "120001", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120002", "weight": 200, - "score": -5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120003", "weight": 200, - "score": 5, + "score": -1, "effectType": 2 }, { "Id": "120004", "weight": 100, - "score": 10, - "effectType": 3 + "score": 5, + "effectType": 1 } ], "material": [ @@ -274,21 +274,21 @@ "standard_yield": [ { "a": "item", - "t": "100004", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100004", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100004", + "t": "100006", "n": 7 } ] @@ -315,26 +315,26 @@ { "Id": "120005", "weight": 500, - "score": 1, + "score": 5, "effectType": 1 }, { "Id": "120006", "weight": 200, - "score": -5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120007", "weight": 200, - "score": 5, + "score": -1, "effectType": 2 }, { "Id": "120008", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -347,21 +347,21 @@ "standard_yield": [ { "a": "item", - "t": "100005", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100005", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100005", + "t": "100006", "n": 7 } ] @@ -388,26 +388,26 @@ { "Id": "120005", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120006", "weight": 200, - "score": -5, + "score": 5, "effectType": 1 }, { "Id": "120007", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120008", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -461,26 +461,26 @@ { "Id": "120005", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120006", "weight": 200, - "score": 5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120007", "weight": 200, "score": 5, - "effectType": 2 + "effectType": 1 }, { "Id": "120008", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -493,21 +493,21 @@ "standard_yield": [ { "a": "item", - "t": "100007", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100007", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100007", + "t": "100006", "n": 7 } ] @@ -534,26 +534,26 @@ { "Id": "120005", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120006", "weight": 200, - "score": 5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120007", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120008", "weight": 100, - "score": 10, - "effectType": 3 + "score": 5, + "effectType": 1 } ], "material": [ @@ -566,21 +566,21 @@ "standard_yield": [ { "a": "item", - "t": "100008", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100008", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100008", + "t": "100006", "n": 7 } ] @@ -607,26 +607,26 @@ { "Id": "120009", "weight": 500, - "score": 1, + "score": 5, "effectType": 1 }, { "Id": "120101", "weight": 200, - "score": 5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120102", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120103", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -639,21 +639,21 @@ "standard_yield": [ { "a": "item", - "t": "100009", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100009", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100009", + "t": "100006", "n": 7 } ] @@ -680,26 +680,26 @@ { "Id": "120009", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120101", "weight": 200, "score": 5, - "effectType": 1 + "effectType": 2 }, { "Id": "120102", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120103", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -712,21 +712,21 @@ "standard_yield": [ { "a": "item", - "t": "100010", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100010", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100010", + "t": "100006", "n": 7 } ] @@ -753,14 +753,14 @@ { "Id": "120009", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120101", "weight": 200, - "score": -5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120102", @@ -771,8 +771,8 @@ { "Id": "120103", "weight": 100, - "score": 10, - "effectType": 3 + "score": -1, + "effectType": 2 } ], "material": [ @@ -785,21 +785,21 @@ "standard_yield": [ { "a": "item", - "t": "100011", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100011", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100011", + "t": "100006", "n": 7 } ] @@ -826,26 +826,26 @@ { "Id": "120009", "weight": 500, - "score": 1, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120101", "weight": 200, - "score": 5, - "effectType": 1 + "score": -1, + "effectType": 2 }, { "Id": "120102", "weight": 200, - "score": -5, + "score": -1, "effectType": 2 }, { "Id": "120103", "weight": 100, - "score": 10, - "effectType": 3 + "score": 5, + "effectType": 2 } ], "material": [ @@ -858,21 +858,21 @@ "standard_yield": [ { "a": "item", - "t": "100012", + "t": "100006", "n": 3 } ], "low_yield": [ { "a": "item", - "t": "100012", + "t": "100006", "n": 1 } ], "high_yield": [ { "a": "item", - "t": "100012", + "t": "100006", "n": 7 } ] diff --git a/bin/json/game_skillafteratk.json b/bin/json/game_skillafteratk.json index c1e1b4c07..1c20920b7 100644 --- a/bin/json/game_skillafteratk.json +++ b/bin/json/game_skillafteratk.json @@ -28793,5 +28793,149 @@ "DpsCondition": "", "RevisiCondition": "", "RevisiParams": [] + }, + { + "Id": 211021111, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 1, + "Argu": [ + 1, + 4, + 1000 + ], + "FollowSK": [ + 211021112 + ], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] + }, + { + "Id": 211021112, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 3, + "Argu": [ + 390001007, + 1000, + 1, + 2 + ], + "FollowSK": [], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] + }, + { + "Id": 211021211, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 1, + "Argu": [ + 1, + 4, + 1200 + ], + "FollowSK": [ + 211021212 + ], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] + }, + { + "Id": 211021212, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 3, + "Argu": [ + 390001105, + 1000, + 1, + 2 + ], + "FollowSK": [], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] + }, + { + "Id": 211021311, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 1, + "Argu": [ + 1, + 4, + 2000 + ], + "FollowSK": [ + 211021312 + ], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] + }, + { + "Id": 211021312, + "EmitPR": 1000, + "From": 2, + "Where": [], + "Order": "", + "Limit": 10, + "ExecuteCnt": 1, + "Type": 29, + "Argu": [ + 200 + ], + "FollowSK": [], + "SucFollowSK": [], + "FailFollowSK": [], + "MustHit": false, + "DpsRevisiType": 0, + "DpsCondition": "", + "RevisiCondition": "", + "RevisiParams": [] } ] \ No newline at end of file diff --git a/bin/json/game_skillatk.json b/bin/json/game_skillatk.json index 38816b473..78443fa21 100644 --- a/bin/json/game_skillatk.json +++ b/bin/json/game_skillatk.json @@ -15200,5 +15200,89 @@ }, "buffid": [], "map": "" + }, + { + "id": 111021111, + "level": 1, + "MaxLV": 1, + "UnavailablePlayTypes": [], + "Name": { + "key": "skillname_111021111", + "text": "悲痛之爪" + }, + "ico": "jn_44002_1", + "CorrectPos": 0, + "IsMelee": 0, + "act": "Skill_1", + "Type": 1, + "CD": 0, + "Target": 2, + "ChildSkill": { + "Id": [ + 211021111 + ] + }, + "Desc": { + "key": "skill_1110211111", + "text": "巨怪对全体敌方造成一次AOE伤害,并附带2回合防御下降" + }, + "buffid": [], + "map": "" + }, + { + "id": 111021211, + "level": 1, + "MaxLV": 1, + "UnavailablePlayTypes": [], + "Name": { + "key": "skillname_111021211", + "text": "愤怒一击" + }, + "ico": "jn_44002_2", + "CorrectPos": 0, + "IsMelee": 0, + "act": "Skill_2", + "Type": 1, + "CD": 2, + "Target": 2, + "ChildSkill": { + "Id": [ + 211021211 + ] + }, + "Desc": { + "key": "skill_1110212111", + "text": "巨怪对全体敌方造成一次震击,并附带2回合眩晕" + }, + "buffid": [], + "map": "" + }, + { + "id": 111021311, + "level": 1, + "MaxLV": 1, + "UnavailablePlayTypes": [], + "Name": { + "key": "skillname_111021311", + "text": "死灵射线" + }, + "ico": "jn_44002_3", + "CorrectPos": 0, + "IsMelee": 0, + "act": "Skill_3", + "Type": 1, + "CD": 5, + "Target": 2, + "ChildSkill": { + "Id": [ + 211021311 + ] + }, + "Desc": { + "key": "skill_1110213111", + "text": "巨怪对全体敌方发出死灵射线,并恢复造成伤害20%的血量" + }, + "buffid": [], + "map": "" } ] \ No newline at end of file diff --git a/bin/json/game_smithystovev1.json b/bin/json/game_smithystovev1.json index 6210140f1..97b35805a 100644 --- a/bin/json/game_smithystovev1.json +++ b/bin/json/game_smithystovev1.json @@ -11,7 +11,7 @@ } ], "title_text": { - "key": "1", + "key": "newsmithy_stove_title_text1", "text": "冶炼炉lv.1" } }, @@ -27,7 +27,7 @@ } ], "title_text": { - "key": "2", + "key": "newsmithy_stove_title_text2", "text": "冶炼炉lv.2" } }, @@ -43,7 +43,7 @@ } ], "title_text": { - "key": "3", + "key": "newsmithy_stove_title_text3", "text": "冶炼炉lv.3" } }, @@ -59,7 +59,7 @@ } ], "title_text": { - "key": "4", + "key": "newsmithy_stove_title_text4", "text": "冶炼炉lv.4" } }, @@ -75,7 +75,7 @@ } ], "title_text": { - "key": "5", + "key": "newsmithy_stove_title_text5", "text": "冶炼炉lv.5" } }, @@ -91,7 +91,7 @@ } ], "title_text": { - "key": "6", + "key": "newsmithy_stove_title_text6", "text": "冶炼炉lv.6" } }, @@ -107,7 +107,7 @@ } ], "title_text": { - "key": "7", + "key": "newsmithy_stove_title_text7", "text": "冶炼炉lv.7" } }, @@ -123,7 +123,7 @@ } ], "title_text": { - "key": "8", + "key": "newsmithy_stove_title_text8", "text": "冶炼炉lv.8" } }, @@ -139,7 +139,7 @@ } ], "title_text": { - "key": "9", + "key": "newsmithy_stove_title_text9", "text": "冶炼炉lv.9" } }, @@ -155,7 +155,7 @@ } ], "title_text": { - "key": "10", + "key": "newsmithy_stove_title_text10", "text": "冶炼炉lv.10" } }