Commit 8342ad3885540af27f0dff497947e1012c4a9383

Authored by zhouhaihai
2 parents 876d9fbd b021e351

Merge branch 'tr/bugfix' into tr/publish/preview

* tr/bugfix:
  计算英雄战斗力,天赋,信赖
  错误的
src/actions/AdvAction.lua
@@ -134,7 +134,7 @@ function _M.startAdvRpc( agent, data ) @@ -134,7 +134,7 @@ function _M.startAdvRpc( agent, data )
134 else -- 普通模式判断 134 else -- 普通模式判断
135 if layer >= chapterData.limitlevel then return 4 end 135 if layer >= chapterData.limitlevel then return 4 end
136 136
137 - local relayData = role:getAdvData():isHaveRelay(layer, chapterId) 137 + local relayData = role:getAdvData():isHaveRelay(layer, chapterId, true)
138 if not relayData then return 6 end -- 不是中继层 138 if not relayData then return 6 end -- 不是中继层
139 if layer ~= 1 then 139 if layer ~= 1 then
140 if (advPass[chapterId] or 0) < relayData.floor then return 21 end 140 if (advPass[chapterId] or 0) < relayData.floor then return 21 end
@@ -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 = {}
@@ -61,10 +61,10 @@ function Adv:initByInfo(advInfo) @@ -61,10 +61,10 @@ function Adv:initByInfo(advInfo)
61 self:initBattle(advInfo) 61 self:initBattle(advInfo)
62 end 62 end
63 -- 找出level 是否存在中继层 63 -- 找出level 是否存在中继层
64 -function Adv:isHaveRelay(level, chapterId) 64 +function Adv:isHaveRelay(level, chapterId, force)
65 level = level or self.level 65 level = level or self.level
66 chapterId = chapterId or self.chapterId 66 chapterId = chapterId or self.chapterId
67 - if level == 1 then return end 67 + if level == 1 and not force then return end
68 68
69 local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId] 69 local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId]
70 for _, campsite in ipairs(campsiteCsv) do 70 for _, campsite in ipairs(campsiteCsv) do
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