diff --git a/src/models/HeroPlugin.lua b/src/models/HeroPlugin.lua index bb3abd7..b26732e 100644 --- a/src/models/HeroPlugin.lua +++ b/src/models/HeroPlugin.lua @@ -126,11 +126,11 @@ function HeroPlugin.bind(Hero) end -- 羁绊加成 - if params.activeRelation then - for k, attName in pairs(AttsEnumEx) do - attrs[attName] = attrs[attName] + addAttr(attrs[attName], params.activeRelation[attName], 1, attName) - end - end + -- if params.activeRelation then + -- for k, attName in pairs(AttsEnumEx) do + -- attrs[attName] = attrs[attName] + addAttr(attrs[attName], params.activeRelation[attName], 1, attName) + -- end + -- end return attrs end @@ -224,8 +224,10 @@ function HeroPlugin.bind(Hero) -- 战斗力(当前属性)= POWER[(生命 + 防御 * 7 + 闪避 * 4)*(攻击*4 + 命中 * 2)*(1 + 暴击几率/100 * 暴击伤害/100)* 攻击速度 / 60000 ,0.8 ] - function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 - local attrs = self:getTotalAttrs({activeRelation = activeRelation}) + -- function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 + function Hero:getBattleValue() -- isReal包括队伍加成 + -- local attrs = self:getTotalAttrs({activeRelation = activeRelation}) + local attrs = self:getTotalAttrs() local battleValue = ((attrs["hp"] + attrs["def"] * 7 + attrs["miss"] * 4) * (attrs["atk"] * 4 + attrs["hit"] * 2) * (1 + attrs["crit"]/100 * attrs["critHurt"]/100) * attrs["atkSpeed"] / 600000) ^ 0.8 return math.floor(battleValue) end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index a31c745..dc3c578 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -835,50 +835,50 @@ function RolePlugin.bind(Role) SendPacket(actionCodes.Sys_maintainNotice, MsgPack.pack({ body = text, iskey = not isNotKey})) end - function Role:getHeroActiveRelationData(heros) - local relations = {} - for _, id in pairs(heros or {}) do - local hero = self.heros[id] - if hero then - local camp = csvdb["unitCsv"][hero:getProperty("type")].camp - relations[camp] = (relations[camp] or 0) + 1 - end - end - local curData = csvdb["unit_relationCsv"][0] - if not next(relations) then return curData end + -- function Role:getHeroActiveRelationData(heros) + -- local relations = {} + -- for _, id in pairs(heros or {}) do + -- local hero = self.heros[id] + -- if hero then + -- local camp = csvdb["unitCsv"][hero:getProperty("type")].camp + -- relations[camp] = (relations[camp] or 0) + 1 + -- end + -- end + -- local curData = csvdb["unit_relationCsv"][0] + -- if not next(relations) then return curData end - for _, data in ipairs(csvdb["unit_relationCsv"]) do - local had = {} - local isDone = true - for _, count in pairs(data.relation:toArray(true, "=")) do - local find = false - for camp, _count in pairs(relations) do - if count == _count and not had[camp] then - had[camp] = true - find = true - break - end - end - if not find then - isDone = false - break - end - end - if isDone then - curData = data - end - end - return curData - end - - function Role:getHeroActiveRelation(heros) - local data = self:getHeroActiveRelationData(heros) - local result = {} - for attr, value in pairs(data.effect:toNumMap()) do - result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value - end - return result - end + -- for _, data in ipairs(csvdb["unit_relationCsv"]) do + -- local had = {} + -- local isDone = true + -- for _, count in pairs(data.relation:toArray(true, "=")) do + -- local find = false + -- for camp, _count in pairs(relations) do + -- if count == _count and not had[camp] then + -- had[camp] = true + -- find = true + -- break + -- end + -- end + -- if not find then + -- isDone = false + -- break + -- end + -- end + -- if isDone then + -- curData = data + -- end + -- end + -- return curData + -- end + + -- function Role:getHeroActiveRelation(heros) + -- local data = self:getHeroActiveRelationData(heros) + -- local result = {} + -- for attr, value in pairs(data.effect:toNumMap()) do + -- result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value + -- end + -- return result + -- end function Role:getHerosCamp(heros) local had = {} @@ -899,14 +899,16 @@ function RolePlugin.bind(Role) return curCamp end - function Role:getRealBattleValue(heros, activeRelation) -- 获取队伍战斗力 羁绊加成 + -- function Role:getRealBattleValue(heros, activeRelation) -- 获取队伍战斗力 羁绊加成 + function Role:getRealBattleValue(heros) -- 获取队伍战斗力 羁绊加成 heros = heros or {} - local activeRelation = activeRelation or self:getHeroActiveRelation(heros) + -- local activeRelation = activeRelation or self:getHeroActiveRelation(heros) local battleValue = 0 for _, id in pairs(heros) do local hero = self.heros[id] if hero then - battleValue = battleValue + hero:getBattleValue(activeRelation) + -- battleValue = battleValue + hero:getBattleValue(activeRelation) + battleValue = battleValue + hero:getBattleValue() end end return battleValue @@ -1292,7 +1294,7 @@ function RolePlugin.bind(Role) function Role:getTeamBattleInfo(team) local teamInfo = {heros = {}, supports = {}} - local activeRelation = self:getHeroActiveRelation(team.heros) + -- local activeRelation = self:getHeroActiveRelation(team.heros) for slot, id in pairs(team.heros or {}) do local info = {} @@ -1300,7 +1302,8 @@ function RolePlugin.bind(Role) if not hero then print("error heroid " .. id) end - local attrs = hero:getTotalAttrs({activeRelation = activeRelation}) + -- local attrs = hero:getTotalAttrs({activeRelation = activeRelation}) + local attrs = hero:getTotalAttrs() for k, v in pairs(AttsEnumEx) do info[v] = (attrs[v] or 0) end -- libgit2 0.21.2