Commit 631907228f635bdc651f0235fd7e92b09ef894c3
1 parent
251b105a
计算英雄战斗力,天赋,信赖
Showing
3 changed files
with
21 additions
and
17 deletions
Show diff stats
src/actions/AdvAction.lua
... | ... | @@ -235,7 +235,8 @@ function _M.startHangRpc(agent, data) |
235 | 235 | + 0.226 * player["hit"] |
236 | 236 | + 0.26 * player["miss"] |
237 | 237 | |
238 | - if battleV < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | |
238 | + --print(math.ceil(battleV), campSiteData.idleValue) | |
239 | + if math.ceil(battleV) < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | |
239 | 240 | |
240 | 241 | local info = {} |
241 | 242 | info.format = {} | ... | ... |
src/models/HeroPlugin.lua
... | ... | @@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero) |
53 | 53 | local talentAttrS = {} |
54 | 54 | |
55 | 55 | -- 四个基础属性 |
56 | - local curData = csvdb["unit_talentCsv"][talent:getv(0, 1)] | |
57 | - local curTalentLvl = 0 | |
58 | - if not curData then -- 已经满阶段了 | |
59 | - local cfgName = "unit_talent_"..heroCfgId.."Csv" | |
60 | - curData = csvdb[cfgName][#csvdb[cfgName]] | |
61 | - else | |
62 | - curTalentLvl = talent:getv(1, 1) | |
63 | - end | |
64 | - for lvl, cfg in pairs(curData) do | |
65 | - if lvl < curTalentLvl or curTalentLvl == 0 then | |
66 | - if cfg.effect ~= 99 then | |
67 | - local curVal = talentAttrS[cfg.effect] or 0 | |
68 | - if curVal < cfg.strength then | |
69 | - talentAttrS[cfg.effect] = cfg.strength | |
56 | + local cfgName = "unit_talent_"..heroCfgId.."Csv" | |
57 | + local curRank = talent:getv(0, 1) | |
58 | + local curLv = talent:getv(1,1) - 1 | |
59 | + for i, value in ipairs(csvdb[cfgName]) do | |
60 | + if i <= curRank then | |
61 | + for lv, cfg in ipairs(value) do | |
62 | + if i < curRank or lv <= curLv then | |
63 | + if cfg.effect ~= 99 then | |
64 | + if not talentAttrS[cfg.effect] then | |
65 | + talentAttrS[AttsEnumEx[cfg.effect]] = 0 | |
66 | + end | |
67 | + talentAttrS[AttsEnumEx[cfg.effect]] = cfg.strength | |
68 | + end | |
69 | + else | |
70 | + break | |
70 | 71 | end |
71 | 72 | end |
73 | + else | |
74 | + break | |
72 | 75 | end |
73 | 76 | end |
74 | 77 | |
... | ... | @@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero) |
85 | 88 | for lvl = 1, #faithConfig do |
86 | 89 | if faith >= faithConfig[lvl].exp then |
87 | 90 | local add = faithConfig[lvl]["position_"..unitData.position]:toArray(true, "=") |
88 | - faithAttr[add[1]] = (faithAttr[add[1]] or 0) + add[2] | |
91 | + faithAttr[AttsEnumEx[add[1]]] = (faithAttr[AttsEnumEx[add[1]]] or 0) + add[2] | |
89 | 92 | end |
90 | 93 | end |
91 | 94 | for _, attrName in pairs(AttsEnumEx) do | ... | ... |