Commit 631907228f635bdc651f0235fd7e92b09ef894c3

Authored by 测试
1 parent 251b105a

计算英雄战斗力,天赋,信赖

src/actions/AdvAction.lua
@@ -235,7 +235,8 @@ function _M.startHangRpc(agent, data) @@ -235,7 +235,8 @@ function _M.startHangRpc(agent, data)
235 + 0.226 * player["hit"] 235 + 0.226 * player["hit"]
236 + 0.26 * player["miss"] 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 local info = {} 241 local info = {}
241 info.format = {} 242 info.format = {}
1 -Subproject commit 7320a5f8d782d63b7ad6fc6e310e3f7425c280a1 1 +Subproject commit 516f9d34ccb5dfc9a5fd40c251f3229e5a4651e6
src/models/HeroPlugin.lua
@@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero) @@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero)
53 local talentAttrS = {} 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 end 71 end
71 end 72 end
  73 + else
  74 + break
72 end 75 end
73 end 76 end
74 77
@@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero) @@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero)
85 for lvl = 1, #faithConfig do 88 for lvl = 1, #faithConfig do
86 if faith >= faithConfig[lvl].exp then 89 if faith >= faithConfig[lvl].exp then
87 local add = faithConfig[lvl]["position_"..unitData.position]:toArray(true, "=") 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 end 92 end
90 end 93 end
91 for _, attrName in pairs(AttsEnumEx) do 94 for _, attrName in pairs(AttsEnumEx) do