diff --git a/bin/json/game_herotalent.json b/bin/json/game_herotalent.json index 577b4b9b0..d0e7fe5ba 100644 --- a/bin/json/game_herotalent.json +++ b/bin/json/game_herotalent.json @@ -1,12 +1,26 @@ [ { - "id": 1, - "type": 1, - "typeline": 1, - "talentid": 40101, + "skillid": 40101, + "hid": "25001", + "skilltyp": 0, "before": [ 0 ], + "skillname": { + "key": "hppower", + "text": "生命核心" + }, + "skilltxt": { + "key": "Life increased by 1.6%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 16, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -22,13 +36,27 @@ "point": 20 }, { - "id": 2, - "type": 0, - "typeline": 1, - "talentid": 10101, + "skillid": 40102, + "hid": "25001", + "skilltyp": 0, "before": [ - 1 + 40101 ], + "skillname": { + "key": "atkpower", + "text": "攻击核心" + }, + "skilltxt": { + "key": "Attack increased by 1.0%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": 10, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -39,13 +67,27 @@ "point": 10 }, { - "id": 3, - "type": 0, - "typeline": 1, - "talentid": 10102, + "skillid": 40103, + "hid": "25001", + "skilltyp": 0, "before": [ - 2 + 40102 ], + "skillname": { + "key": "defpower", + "text": "防御核心" + }, + "skilltxt": { + "key": "Defence increased by 1.0%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": -1, + "def": 10, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -56,13 +98,27 @@ "point": 10 }, { - "id": 4, - "type": 0, - "typeline": 1, - "talentid": 10103, + "skillid": 10101, + "hid": "25001", + "skilltyp": 1, "before": [ - 3 + 40103 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 10, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -73,13 +129,27 @@ "point": 10 }, { - "id": 5, - "type": 0, - "typeline": 1, - "talentid": 10104, + "skillid": 10102, + "hid": "25001", + "skilltyp": 1, "before": [ - 4 + 10101 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 10, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -90,13 +160,27 @@ "point": 10 }, { - "id": 6, - "type": 0, - "typeline": 1, - "talentid": 10105, + "skillid": 10103, + "hid": "25001", + "skilltyp": 1, "before": [ - 5 + 10102 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 18, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -107,13 +191,27 @@ "point": 10 }, { - "id": 7, - "type": 0, - "typeline": 1, - "talentid": 10106, + "skillid": 10104, + "hid": "25001", + "skilltyp": 1, "before": [ - 6 + 10103 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 18, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -124,13 +222,27 @@ "point": 10 }, { - "id": 8, - "type": 1, - "typeline": 2, - "talentid": 40102, + "skillid": 10105, + "hid": "25001", + "skilltyp": 1, "before": [ - 0 + 10104 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 18, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -146,13 +258,27 @@ "point": 20 }, { - "id": 9, - "type": 0, - "typeline": 2, - "talentid": 20101, + "skillid": 10106, + "hid": "25001", + "skilltyp": 1, "before": [ - 8 + 10105 ], + "skillname": { + "key": "hppower", + "text": "生命天赋" + }, + "skilltxt": { + "key": "Life increased by 1.8%", + "text": "这是生命天赋的描述tips" + }, + "skillicon": "js_jx_img_icon03", + "hp": 18, + "atk": -1, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -163,13 +289,27 @@ "point": 10 }, { - "id": 10, - "type": 0, - "typeline": 2, - "talentid": 20102, + "skillid": 20101, + "hid": "25001", + "skilltyp": 1, "before": [ - 9 + 10106 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 10, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -180,13 +320,27 @@ "point": 10 }, { - "id": 11, - "type": 0, - "typeline": 2, - "talentid": 20103, + "skillid": 20102, + "hid": "25001", + "skilltyp": 1, "before": [ - 10 + 20101 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 10, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -197,13 +351,27 @@ "point": 10 }, { - "id": 12, - "type": 0, - "typeline": 2, - "talentid": 20104, + "skillid": 20103, + "hid": "25001", + "skilltyp": 1, "before": [ - 11 + 20102 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 15, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -214,13 +382,27 @@ "point": 10 }, { - "id": 13, - "type": 0, - "typeline": 2, - "talentid": 20105, + "skillid": 20104, + "hid": "25001", + "skilltyp": 1, "before": [ - 12 + 20103 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 15, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -231,13 +413,27 @@ "point": 10 }, { - "id": 14, - "type": 0, - "typeline": 2, - "talentid": 20106, + "skillid": 20105, + "hid": "25001", + "skilltyp": 1, "before": [ - 13 + 20104 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 15, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -248,13 +444,27 @@ "point": 10 }, { - "id": 15, - "type": 1, - "typeline": 3, - "talentid": 40103, + "skillid": 20106, + "hid": "25001", + "skilltyp": 1, "before": [ - 0 + 20105 ], + "skillname": { + "key": "atkpower", + "text": "攻击天赋" + }, + "skilltxt": { + "key": "Attack increased by 1.5%", + "text": "这是攻击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon01", + "hp": -1, + "atk": -1, + "def": 15, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -270,13 +480,27 @@ "point": 20 }, { - "id": 16, - "type": 0, - "typeline": 3, - "talentid": 30101, + "skillid": 30101, + "hid": "25001", + "skilltyp": 1, "before": [ - 15 + 20106 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 10, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -287,13 +511,27 @@ "point": 10 }, { - "id": 17, - "type": 0, - "typeline": 3, - "talentid": 30102, + "skillid": 30102, + "hid": "25001", + "skilltyp": 1, "before": [ - 16 + 30101 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 10, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -304,13 +542,27 @@ "point": 10 }, { - "id": 18, - "type": 0, - "typeline": 3, - "talentid": 30103, + "skillid": 30103, + "hid": "25001", + "skilltyp": 1, "before": [ - 17 + 30102 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 15, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -321,13 +573,27 @@ "point": 10 }, { - "id": 19, - "type": 0, - "typeline": 3, - "talentid": 30104, + "skillid": 30104, + "hid": "25001", + "skilltyp": 1, "before": [ - 18 + 30103 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 15, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -338,13 +604,27 @@ "point": 10 }, { - "id": 20, - "type": 0, - "typeline": 3, - "talentid": 30105, + "skillid": 30105, + "hid": "25001", + "skilltyp": 1, "before": [ - 19 + 30104 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 15, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", @@ -355,13 +635,120 @@ "point": 10 }, { - "id": 21, - "type": 0, - "typeline": 3, - "talentid": 30106, + "skillid": 30106, + "hid": "25001", + "skilltyp": 1, "before": [ - 20 + 30105 ], + "skillname": { + "key": "defpower", + "text": "防御天赋" + }, + "skilltxt": { + "key": "Defence increased by 1.5%", + "text": "这是防御天赋的描述tips" + }, + "skillicon": "js_jx_img_icon02", + "hp": -1, + "atk": 15, + "def": -1, + "cri": -1, + "speed": -1, + "skill": 0, + "thing": [ + { + "a": "attr", + "t": "gold", + "n": 15000 + } + ], + "point": 10 + }, + { + "skillid": 99101, + "hid": "25001", + "skilltyp": 2, + "before": [ + 30106 + ], + "skillname": { + "key": "Attackspeed", + "text": "攻速天赋" + }, + "skilltxt": { + "key": "Attack speed increased by 3%", + "text": "这是攻速天赋的描述tips" + }, + "skillicon": "js_jx_img_icon04", + "hp": -1, + "atk": -1, + "def": -1, + "cri": -1, + "speed": 30, + "skill": 0, + "thing": [ + { + "a": "attr", + "t": "gold", + "n": 15000 + } + ], + "point": 10 + }, + { + "skillid": 99102, + "hid": "25001", + "skilltyp": 2, + "before": [ + 99101 + ], + "skillname": { + "key": "Attackspeed", + "text": "攻速天赋" + }, + "skilltxt": { + "key": "Attack speed increased by 4%", + "text": "这是攻速天赋的描述tips" + }, + "skillicon": "js_jx_img_icon04", + "hp": -1, + "atk": -1, + "def": -1, + "cri": -1, + "speed": 30, + "skill": 0, + "thing": [ + { + "a": "attr", + "t": "gold", + "n": 15000 + } + ], + "point": 10 + }, + { + "skillid": 99103, + "hid": "25001", + "skilltyp": 2, + "before": [ + 99102 + ], + "skillname": { + "key": "Criticalstrike", + "text": "暴击天赋" + }, + "skilltxt": { + "key": "Critical hit increased by 10%", + "text": "这是暴击天赋的描述tips" + }, + "skillicon": "js_jx_img_icon05", + "hp": -1, + "atk": -1, + "def": -1, + "cri": 100, + "speed": -1, + "skill": 0, "thing": [ { "a": "attr", diff --git a/bin/json/game_talentbox.json b/bin/json/game_talentbox.json new file mode 100644 index 000000000..f0205f6ec --- /dev/null +++ b/bin/json/game_talentbox.json @@ -0,0 +1,286 @@ +[ + { + "heroid": "13001", + "itemid": "513001" + }, + { + "heroid": "13002", + "itemid": "513002" + }, + { + "heroid": "13003", + "itemid": "513003" + }, + { + "heroid": "13004", + "itemid": "513004" + }, + { + "heroid": "13005", + "itemid": "513005" + }, + { + "heroid": "14001", + "itemid": "514001" + }, + { + "heroid": "14002", + "itemid": "514002" + }, + { + "heroid": "14003", + "itemid": "514003" + }, + { + "heroid": "14004", + "itemid": "514004" + }, + { + "heroid": "14005", + "itemid": "514005" + }, + { + "heroid": "14006", + "itemid": "514006" + }, + { + "heroid": "14007", + "itemid": "514007" + }, + { + "heroid": "15001", + "itemid": "515001" + }, + { + "heroid": "15002", + "itemid": "515002" + }, + { + "heroid": "15003", + "itemid": "515003" + }, + { + "heroid": "15004", + "itemid": "515004" + }, + { + "heroid": "23001", + "itemid": "523001" + }, + { + "heroid": "23002", + "itemid": "523002" + }, + { + "heroid": "23003", + "itemid": "523003" + }, + { + "heroid": "23004", + "itemid": "523004" + }, + { + "heroid": "24001", + "itemid": "524001" + }, + { + "heroid": "24002", + "itemid": "524002" + }, + { + "heroid": "24003", + "itemid": "524003" + }, + { + "heroid": "24004", + "itemid": "524004" + }, + { + "heroid": "24005", + "itemid": "524005" + }, + { + "heroid": "24006", + "itemid": "524006" + }, + { + "heroid": "24007", + "itemid": "524007" + }, + { + "heroid": "24008", + "itemid": "524008" + }, + { + "heroid": "24009", + "itemid": "524009" + }, + { + "heroid": "25001", + "itemid": "525001" + }, + { + "heroid": "25002", + "itemid": "525002" + }, + { + "heroid": "25003", + "itemid": "525003" + }, + { + "heroid": "25004", + "itemid": "525004" + }, + { + "heroid": "33001", + "itemid": "533001" + }, + { + "heroid": "33002", + "itemid": "533002" + }, + { + "heroid": "33003", + "itemid": "533003" + }, + { + "heroid": "33004", + "itemid": "533004" + }, + { + "heroid": "33005", + "itemid": "533005" + }, + { + "heroid": "33006", + "itemid": "533006" + }, + { + "heroid": "34001", + "itemid": "534001" + }, + { + "heroid": "34002", + "itemid": "534002" + }, + { + "heroid": "34003", + "itemid": "534003" + }, + { + "heroid": "34004", + "itemid": "534004" + }, + { + "heroid": "34005", + "itemid": "534005" + }, + { + "heroid": "34006", + "itemid": "534006" + }, + { + "heroid": "34007", + "itemid": "534007" + }, + { + "heroid": "34008", + "itemid": "534008" + }, + { + "heroid": "35001", + "itemid": "535001" + }, + { + "heroid": "35002", + "itemid": "535002" + }, + { + "heroid": "35003", + "itemid": "535003" + }, + { + "heroid": "35004", + "itemid": "535004" + }, + { + "heroid": "35005", + "itemid": "535005" + }, + { + "heroid": "35006", + "itemid": "535006" + }, + { + "heroid": "43001", + "itemid": "543001" + }, + { + "heroid": "43002", + "itemid": "543002" + }, + { + "heroid": "43003", + "itemid": "543003" + }, + { + "heroid": "43004", + "itemid": "543004" + }, + { + "heroid": "43005", + "itemid": "543005" + }, + { + "heroid": "43006", + "itemid": "543006" + }, + { + "heroid": "43007", + "itemid": "543007" + }, + { + "heroid": "44001", + "itemid": "544001" + }, + { + "heroid": "44002", + "itemid": "544002" + }, + { + "heroid": "44003", + "itemid": "544003" + }, + { + "heroid": "44004", + "itemid": "544004" + }, + { + "heroid": "44006", + "itemid": "544006" + }, + { + "heroid": "45001", + "itemid": "545001" + }, + { + "heroid": "45002", + "itemid": "545002" + }, + { + "heroid": "45003", + "itemid": "545003" + }, + { + "heroid": "45004", + "itemid": "545004" + }, + { + "heroid": "44005", + "itemid": "544005" + }, + { + "heroid": "15005", + "itemid": "515005" + } +] \ No newline at end of file diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index e3c6eeca7..6f8a3abf3 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -119,17 +119,17 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe if err = this.module.modelTalent.ChangeHeroTalent(talent, update); err != nil { this.module.Errorf("update failed :%v", err) } - talentSkill := this.module.configure.GetHeroTalentSkill(talentConf.Talentid) - if talentSkill == nil { - code = pb.ErrorCode_ConfigNoFound - return - } + // 同步修改属性 heroList := this.module.GetHeroList(session.GetUserId()) for _, v := range heroList { if v.HeroID == talent.HeroId { // 找到对应的英雄ID - this.module.modelHero.setTalentProperty(v, talentSkill) + this.module.modelHero.setTalentProperty(v, talentConf) chanegCard = append(chanegCard, v) // 添加推送属性变化信息 + // 天赋学技能 + if talentConf.Skill != 0 { + + } } } diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 0bb1bac76..cdc6bc1b4 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -27,12 +27,10 @@ const ( hero_drawupdraw = "game_drawupdraw.json" // 抽卡概率调整 hero_drawcost = "game_drawcost.json" // 抽卡消耗 hero_fusion = "game_herofusion.json" // 卡牌融合 - //hero_starupsp = "game_herostarupsp.json" // 精灵升星 - hero_talentskill = "game_talentskill.json" // 天赋 - hero_talent = "game_herotalent.json" // 天赋详细数据 - hero_itembox = "game_itembox.json" // 天赋详细数据 - game_shopitem = "game_shopitem.json" - hero_skill = "game_heroskill.json" + hero_talent = "game_herotalent.json" // 天赋详细数据 + hero_itembox = "game_itembox.json" // 天赋详细数据 + game_shopitem = "game_shopitem.json" + hero_skill = "game_heroskill.json" ) ///配置管理组件 @@ -61,12 +59,10 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_skillatk: cfg.NewGameSkillAtk, hero_drawcard: cfg.NewGameDrawCard, hero_fusion: cfg.NewGameHerofusion, - //hero_starupsp: cfg.NewGameHeroStarupSp, - hero_talentskill: cfg.NewGameTalentSkill, - hero_talent: cfg.NewGameHeroTalent, - hero_itembox: cfg.NewGameItemBox, - game_shopitem: cfg.NewGameShopitem, - hero_skill: cfg.NewGameHeroSkill, + hero_talent: cfg.NewGameHeroTalent, + hero_itembox: cfg.NewGameItemBox, + game_shopitem: cfg.NewGameShopitem, + hero_skill: cfg.NewGameHeroSkill, }) this.drawCardCfg = make(map[string]map[int32][]*cfg.GameDrawCardData, 0) configure.RegisterConfigure(hero_drawcard, cfg.NewGameDrawCard, this.SetHeroDrawConfig) @@ -286,17 +282,6 @@ func (this *configureComp) GetHeroFucionConfig(cid string) (data *cfg.GameHerofu return } -// func (this *configureComp) GetHeroSpriteStar(cid string) (hid string) { -// if v, err := this.GetConfigure(hero_starupsp); err == nil { -// if configure, ok := v.(*cfg.GameHeroStarupSp); ok { -// hid = configure.Get(cid).Starid -// return -// } -// } -// this.module.Errorf("cfg.GameHeroStarupSpData GetHeroSpriteStar:id = %s", cid) -// return "" -// } - func (this *configureComp) GetHeroTalent(id int32) (data *cfg.GameHeroTalentData) { if v, err := this.GetConfigure(hero_talent); err == nil { if configure, ok := v.(*cfg.GameHeroTalent); ok { @@ -308,17 +293,6 @@ func (this *configureComp) GetHeroTalent(id int32) (data *cfg.GameHeroTalentData return nil } -func (this *configureComp) GetHeroTalentSkill(skillId int32) (data *cfg.GameTalentSkillData) { - if v, err := this.GetConfigure(hero_talentskill); err == nil { - if configure, ok := v.(*cfg.GameTalentSkill); ok { - data = configure.Get(skillId) - return - } - } - this.module.Errorf("cfg.GameTalentSkillData GetHeroTalentSkill:skillId = %d", skillId) - return nil -} - // 天赋指定消耗 func (this *configureComp) GetHeroTalentBoxItem(heroid string) (itemid string) { if v, err := this.GetConfigure(hero_itembox); err == nil { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 791a2f3b3..3e29e5cfe 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -709,7 +709,7 @@ func (this *ModelHero) InitMonsterHero(heroCfgId string, star, lv int32) *pb.DBH } //设置天赋属性 -func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameTalentSkillData) { +func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameHeroTalentData) { if conf == nil || hero == nil { return } @@ -752,8 +752,15 @@ func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameTalentSk hero.TalentProperty[comm.Speed] = int32(math.Floor((float64(conf.Speed) / 1000) * float64(hero.Property[comm.Speed]))) } } - _heroMap := make(map[string]interface{}, 0) + if conf.Skill != 0 { + hero.NormalSkill = append(hero.NormalSkill, &pb.SkillData{ + SkillID: conf.Skill, + SkillLv: 1, + }) + _heroMap["normalSkill"] = hero.NormalSkill + } + _heroMap["talentProperty"] = hero.TalentProperty if err := this.ChangeList(hero.Uid, hero.Id, _heroMap); err != nil { this.moduleHero.Errorf("mergeenegryProperty err %v", err) @@ -785,7 +792,7 @@ func (this *ModelHero) resetTalentProperty(hero *pb.DBHero) { for _, v := range rst { if v.HeroId == hero.HeroID { // 找到对应的英雄 for k := range v.Talent { - if conf := this.moduleHero.configure.GetHeroTalentSkill(k); conf != nil { //获取天赋树 + if conf := this.moduleHero.configure.GetHeroTalent(k); conf != nil { //获取天赋树 if conf.Hp != -1 { attr[0] += conf.Hp } diff --git a/sys/configure/structs/Game.HeroTalent.go b/sys/configure/structs/Game.HeroTalent.go index 740df43a3..791460e75 100644 --- a/sys/configure/structs/Game.HeroTalent.go +++ b/sys/configure/structs/Game.HeroTalent.go @@ -21,7 +21,7 @@ func NewGameHeroTalent(_buf []map[string]interface{}) (*GameHeroTalent, error) { return nil, err2 } else { _dataList = append(_dataList, _v) - dataMap[_v.Id] = _v + dataMap[_v.Skillid] = _v } } return &GameHeroTalent{_dataList:_dataList, _dataMap:dataMap}, nil diff --git a/sys/configure/structs/Game.HeroTalentData.go b/sys/configure/structs/Game.HeroTalentData.go index 1e2b88162..1c75588fd 100644 --- a/sys/configure/structs/Game.HeroTalentData.go +++ b/sys/configure/structs/Game.HeroTalentData.go @@ -11,11 +11,19 @@ package cfg import "errors" type GameHeroTalentData struct { - Id int32 - Type int32 - Typeline int32 - Talentid int32 + Skillid int32 + Hid string + Skilltyp int32 Before []int32 + Skillname string + Skilltxt string + Skillicon string + Hp int32 + Atk int32 + Def int32 + Cri int32 + Speed int32 + Skill int32 Thing []*Gameatn Point int32 } @@ -27,10 +35,9 @@ func (*GameHeroTalentData) GetTypeId() int32 { } func (_v *GameHeroTalentData)Deserialize(_buf map[string]interface{}) (err error) { - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["typeline"].(float64); !_ok_ { err = errors.New("typeline error"); return }; _v.Typeline = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["talentid"].(float64); !_ok_ { err = errors.New("talentid error"); return }; _v.Talentid = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skillid"].(float64); !_ok_ { err = errors.New("skillid error"); return }; _v.Skillid = int32(_tempNum_) } + { var _ok_ bool; if _v.Hid, _ok_ = _buf["hid"].(string); !_ok_ { err = errors.New("hid error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skilltyp"].(float64); !_ok_ { err = errors.New("skilltyp error"); return }; _v.Skilltyp = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool @@ -45,6 +52,15 @@ func (_v *GameHeroTalentData)Deserialize(_buf map[string]interface{}) (err error } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["skillname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Skillname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Skillname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["skilltxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Skilltxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Skilltxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + { var _ok_ bool; if _v.Skillicon, _ok_ = _buf["skillicon"].(string); !_ok_ { err = errors.New("skillicon error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hp"].(float64); !_ok_ { err = errors.New("hp error"); return }; _v.Hp = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["atk"].(float64); !_ok_ { err = errors.New("atk error"); return }; _v.Atk = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["def"].(float64); !_ok_ { err = errors.New("def error"); return }; _v.Def = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cri"].(float64); !_ok_ { err = errors.New("cri error"); return }; _v.Cri = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["speed"].(float64); !_ok_ { err = errors.New("speed error"); return }; _v.Speed = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill"].(float64); !_ok_ { err = errors.New("skill error"); return }; _v.Skill = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool diff --git a/sys/configure/structs/Game.TalentBox.go b/sys/configure/structs/Game.TalentBox.go new file mode 100644 index 000000000..48da1ce0b --- /dev/null +++ b/sys/configure/structs/Game.TalentBox.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameTalentBox struct { + _dataMap map[string]*GameTalentBoxData + _dataList []*GameTalentBoxData +} + +func NewGameTalentBox(_buf []map[string]interface{}) (*GameTalentBox, error) { + _dataList := make([]*GameTalentBoxData, 0, len(_buf)) + dataMap := make(map[string]*GameTalentBoxData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTalentBoxData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Heroid] = _v + } + } + return &GameTalentBox{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTalentBox) GetDataMap() map[string]*GameTalentBoxData { + return table._dataMap +} + +func (table *GameTalentBox) GetDataList() []*GameTalentBoxData { + return table._dataList +} + +func (table *GameTalentBox) Get(key string) *GameTalentBoxData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TalentBoxData.go b/sys/configure/structs/Game.TalentBoxData.go new file mode 100644 index 000000000..06123e7b8 --- /dev/null +++ b/sys/configure/structs/Game.TalentBoxData.go @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type GameTalentBoxData struct { + Heroid string + Itemid string +} + +const TypeId_GameTalentBoxData = -1223889779 + +func (*GameTalentBoxData) GetTypeId() int32 { + return -1223889779 +} + +func (_v *GameTalentBoxData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; if _v.Heroid, _ok_ = _buf["heroid"].(string); !_ok_ { err = errors.New("heroid error"); return } } + { var _ok_ bool; if _v.Itemid, _ok_ = _buf["itemid"].(string); !_ok_ { err = errors.New("itemid error"); return } } + return +} + +func DeserializeGameTalentBoxData(_buf map[string]interface{}) (*GameTalentBoxData, error) { + v := &GameTalentBoxData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go index 9a0289a9e..05ca78b64 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -87,7 +87,6 @@ type Tables struct { Herofusion *GameHerofusion PlayerInfor *GamePlayerInfor PlayerInfor_overview *GamePlayerInfor_overview - HeroTalent *GameHeroTalent TalentSkill *GameTalentSkill ArenaBuyChallenge *GameArenaBuyChallenge ArenaActiveReward *GameArenaActiveReward @@ -182,7 +181,6 @@ type Tables struct { itinerant_battle *Gameitinerant_battle itinerant_event *Gameitinerant_event NewRedDot *GameNewRedDot - Talent *GameTalent Favorability *GameFavorability Friends *GameFriends CampLv *GameCampLv @@ -196,6 +194,9 @@ type Tables struct { Pricegroup *GamePricegroup Loading *GameLoading RuleDesc *GameRuleDesc + HeroTalent *GameHeroTalent + TalentBox *GameTalentBox + Talent *GameTalent } func NewTables(loader JsonLoader) (*Tables, error) { @@ -659,12 +660,6 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.PlayerInfor_overview, err = NewGamePlayerInfor_overview(buf) ; err != nil { return nil, err } - if buf, err = loader("game_herotalent") ; err != nil { - return nil, err - } - if tables.HeroTalent, err = NewGameHeroTalent(buf) ; err != nil { - return nil, err - } if buf, err = loader("game_talentskill") ; err != nil { return nil, err } @@ -1229,12 +1224,6 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.NewRedDot, err = NewGameNewRedDot(buf) ; err != nil { return nil, err } - if buf, err = loader("game_talent") ; err != nil { - return nil, err - } - if tables.Talent, err = NewGameTalent(buf) ; err != nil { - return nil, err - } if buf, err = loader("game_favorability") ; err != nil { return nil, err } @@ -1313,5 +1302,23 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.RuleDesc, err = NewGameRuleDesc(buf) ; err != nil { return nil, err } + if buf, err = loader("game_herotalent") ; err != nil { + return nil, err + } + if tables.HeroTalent, err = NewGameHeroTalent(buf) ; err != nil { + return nil, err + } + if buf, err = loader("game_talentbox") ; err != nil { + return nil, err + } + if tables.TalentBox, err = NewGameTalentBox(buf) ; err != nil { + return nil, err + } + if buf, err = loader("game_talent") ; err != nil { + return nil, err + } + if tables.Talent, err = NewGameTalent(buf) ; err != nil { + return nil, err + } return tables, nil }