Commit 2685b519a6bce7e2c4cbc99f4aba92c9e62c8d91

Authored by zhouhaihai
2 parents 4b6f2d84 cdbe8a36

Merge branch 'develop' into player

@@ -43,6 +43,12 @@ AttsEnumEx = { @@ -43,6 +43,12 @@ AttsEnumEx = {
43 [9] = "vampire", -- 吸血 43 [9] = "vampire", -- 吸血
44 [10] = "pierce", -- 穿透 44 [10] = "pierce", -- 穿透
45 } 45 }
  46 +TalentAttsEnumEx = {
  47 + [1] = "atk",
  48 + [2] = "def",
  49 + [3] = "hit",
  50 + [4] = "miss",
  51 +}
46 52
47 ItemType = { 53 ItemType = {
48 Coin = 1, -- 货币&材料(金币、钻石、经验、突破材料等) 54 Coin = 1, -- 货币&材料(金币、钻石、经验、突破材料等)
src/actions/HeroAction.lua
@@ -105,7 +105,6 @@ function _M.talentRpc(agent, data) @@ -105,7 +105,6 @@ function _M.talentRpc(agent, data)
105 if not curData then return 4 end 105 if not curData then return 4 end
106 106
107 if index == 0 then 107 if index == 0 then
108 - if not csvdb["unit_talentCsv"][curStage + 1] then return 11 end  
109 --是否进阶 108 --是否进阶
110 local max = true 109 local max = true
111 for i = 1, 4 do 110 for i = 1, 4 do
src/models/HeroPlugin.lua
@@ -36,11 +36,11 @@ function HeroPlugin.bind(Hero) @@ -36,11 +36,11 @@ function HeroPlugin.bind(Hero)
36 curData = csvdb["unit_talentCsv"][#csvdb["unit_talentCsv"]] 36 curData = csvdb["unit_talentCsv"][#csvdb["unit_talentCsv"]]
37 local strength = curData[#curData].strength 37 local strength = curData[#curData].strength
38 for i = 1, 4 do 38 for i = 1, 4 do
39 - talentAttrS[AttsEnumEx[i]] = (talentAttrS[AttsEnumEx[i]] or 0) + strength 39 + talentAttrS[TalentAttsEnumEx[i]] = (talentAttrS[TalentAttsEnumEx[i]] or 0) + strength
40 end 40 end
41 else 41 else
42 for i = 1, 4 do --4个天赋 42 for i = 1, 4 do --4个天赋
43 - talentAttrS[AttsEnumEx[i]] = (talentAttrS[AttsEnumEx[i]] or 0) + curData[talent:getv(i, 0)].strength 43 + talentAttrS[TalentAttsEnumEx[i]] = (talentAttrS[TalentAttsEnumEx[i]] or 0) + curData[talent:getv(i, 0)].strength
44 end 44 end
45 end 45 end
46 --阶段属性 46 --阶段属性
@@ -51,8 +51,10 @@ function HeroPlugin.bind(Hero) @@ -51,8 +51,10 @@ function HeroPlugin.bind(Hero)
51 end 51 end
52 52
53 53
54 - for i = 1, 4 do  
55 - talentAttrS[AttsEnumEx[i]] = (unitData[AttsEnumEx[i]] or 0) * talentAttrS[AttsEnumEx[i]] 54 + for _, attrName in pairs(AttsEnumEx) do
  55 + if talentAttrS[attrName] then
  56 + talentAttrS[attrName] = (unitData[attrName] or 0) * talentAttrS[attrName]
  57 + end
56 end 58 end
57 59
58 local attrs = {} 60 local attrs = {}