diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 0ea93d2..947790a 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -105,7 +105,6 @@ function _M.talentRpc(agent, data) if not curData then return 4 end if index == 0 then - if not csvdb["unit_talentCsv"][curStage + 1] then return 11 end --是否进阶 local max = true for i = 1, 4 do diff --git a/src/models/HeroPlugin.lua b/src/models/HeroPlugin.lua index e59e749..8aecd19 100644 --- a/src/models/HeroPlugin.lua +++ b/src/models/HeroPlugin.lua @@ -47,12 +47,14 @@ function HeroPlugin.bind(Hero) for i = 1, (talent:getv(0, 1) - 1) do local curData = csvdb["unit_talentCsv"][i] local effect = curData[#curData].effect:toArray(true, "=") - talentAttrS[TalentAttsEnumEx[effect[1]]] = (talentAttrS[TalentAttsEnumEx[effect[1]]] or 0) + effect[2] + talentAttrS[AttsEnumEx[effect[1]]] = (talentAttrS[AttsEnumEx[effect[1]]] or 0) + effect[2] end - for i = 1, 4 do - talentAttrS[TalentAttsEnumEx[i]] = (unitData[TalentAttsEnumEx[i]] or 0) * talentAttrS[TalentAttsEnumEx[i]] + for _, attrName in pairs(AttsEnumEx) do + if talentAttrS[attrName] then + talentAttrS[attrName] = (unitData[attrName] or 0) * talentAttrS[attrName] + end end local attrs = {} -- libgit2 0.21.2