Commit e8ca14c4c0b329cde866350b5a4fd67adec5bd8d
1 parent
993def2f
羁绊加成去掉
Showing
2 changed files
with
60 additions
and
55 deletions
Show diff stats
src/models/HeroPlugin.lua
@@ -126,11 +126,11 @@ function HeroPlugin.bind(Hero) | @@ -126,11 +126,11 @@ function HeroPlugin.bind(Hero) | ||
126 | end | 126 | end |
127 | 127 | ||
128 | -- 羁绊加成 | 128 | -- 羁绊加成 |
129 | - if params.activeRelation then | ||
130 | - for k, attName in pairs(AttsEnumEx) do | ||
131 | - attrs[attName] = attrs[attName] + addAttr(attrs[attName], params.activeRelation[attName], 1, attName) | ||
132 | - end | ||
133 | - end | 129 | + -- if params.activeRelation then |
130 | + -- for k, attName in pairs(AttsEnumEx) do | ||
131 | + -- attrs[attName] = attrs[attName] + addAttr(attrs[attName], params.activeRelation[attName], 1, attName) | ||
132 | + -- end | ||
133 | + -- end | ||
134 | return attrs | 134 | return attrs |
135 | end | 135 | end |
136 | 136 | ||
@@ -224,8 +224,10 @@ function HeroPlugin.bind(Hero) | @@ -224,8 +224,10 @@ function HeroPlugin.bind(Hero) | ||
224 | 224 | ||
225 | 225 | ||
226 | -- 战斗力(当前属性)= POWER[(生命 + 防御 * 7 + 闪避 * 4)*(攻击*4 + 命中 * 2)*(1 + 暴击几率/100 * 暴击伤害/100)* 攻击速度 / 60000 ,0.8 ] | 226 | -- 战斗力(当前属性)= POWER[(生命 + 防御 * 7 + 闪避 * 4)*(攻击*4 + 命中 * 2)*(1 + 暴击几率/100 * 暴击伤害/100)* 攻击速度 / 60000 ,0.8 ] |
227 | - function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 | ||
228 | - local attrs = self:getTotalAttrs({activeRelation = activeRelation}) | 227 | + -- function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 |
228 | + function Hero:getBattleValue() -- isReal包括队伍加成 | ||
229 | + -- local attrs = self:getTotalAttrs({activeRelation = activeRelation}) | ||
230 | + local attrs = self:getTotalAttrs() | ||
229 | 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 | 231 | 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 |
230 | return math.floor(battleValue) | 232 | return math.floor(battleValue) |
231 | end | 233 | end |
src/models/RolePlugin.lua
@@ -835,50 +835,50 @@ function RolePlugin.bind(Role) | @@ -835,50 +835,50 @@ function RolePlugin.bind(Role) | ||
835 | SendPacket(actionCodes.Sys_maintainNotice, MsgPack.pack({ body = text, iskey = not isNotKey})) | 835 | SendPacket(actionCodes.Sys_maintainNotice, MsgPack.pack({ body = text, iskey = not isNotKey})) |
836 | end | 836 | end |
837 | 837 | ||
838 | - function Role:getHeroActiveRelationData(heros) | ||
839 | - local relations = {} | ||
840 | - for _, id in pairs(heros or {}) do | ||
841 | - local hero = self.heros[id] | ||
842 | - if hero then | ||
843 | - local camp = csvdb["unitCsv"][hero:getProperty("type")].camp | ||
844 | - relations[camp] = (relations[camp] or 0) + 1 | ||
845 | - end | ||
846 | - end | ||
847 | - local curData = csvdb["unit_relationCsv"][0] | ||
848 | - if not next(relations) then return curData end | 838 | + -- function Role:getHeroActiveRelationData(heros) |
839 | + -- local relations = {} | ||
840 | + -- for _, id in pairs(heros or {}) do | ||
841 | + -- local hero = self.heros[id] | ||
842 | + -- if hero then | ||
843 | + -- local camp = csvdb["unitCsv"][hero:getProperty("type")].camp | ||
844 | + -- relations[camp] = (relations[camp] or 0) + 1 | ||
845 | + -- end | ||
846 | + -- end | ||
847 | + -- local curData = csvdb["unit_relationCsv"][0] | ||
848 | + -- if not next(relations) then return curData end | ||
849 | 849 | ||
850 | - for _, data in ipairs(csvdb["unit_relationCsv"]) do | ||
851 | - local had = {} | ||
852 | - local isDone = true | ||
853 | - for _, count in pairs(data.relation:toArray(true, "=")) do | ||
854 | - local find = false | ||
855 | - for camp, _count in pairs(relations) do | ||
856 | - if count == _count and not had[camp] then | ||
857 | - had[camp] = true | ||
858 | - find = true | ||
859 | - break | ||
860 | - end | ||
861 | - end | ||
862 | - if not find then | ||
863 | - isDone = false | ||
864 | - break | ||
865 | - end | ||
866 | - end | ||
867 | - if isDone then | ||
868 | - curData = data | ||
869 | - end | ||
870 | - end | ||
871 | - return curData | ||
872 | - end | ||
873 | - | ||
874 | - function Role:getHeroActiveRelation(heros) | ||
875 | - local data = self:getHeroActiveRelationData(heros) | ||
876 | - local result = {} | ||
877 | - for attr, value in pairs(data.effect:toNumMap()) do | ||
878 | - result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value | ||
879 | - end | ||
880 | - return result | ||
881 | - end | 850 | + -- for _, data in ipairs(csvdb["unit_relationCsv"]) do |
851 | + -- local had = {} | ||
852 | + -- local isDone = true | ||
853 | + -- for _, count in pairs(data.relation:toArray(true, "=")) do | ||
854 | + -- local find = false | ||
855 | + -- for camp, _count in pairs(relations) do | ||
856 | + -- if count == _count and not had[camp] then | ||
857 | + -- had[camp] = true | ||
858 | + -- find = true | ||
859 | + -- break | ||
860 | + -- end | ||
861 | + -- end | ||
862 | + -- if not find then | ||
863 | + -- isDone = false | ||
864 | + -- break | ||
865 | + -- end | ||
866 | + -- end | ||
867 | + -- if isDone then | ||
868 | + -- curData = data | ||
869 | + -- end | ||
870 | + -- end | ||
871 | + -- return curData | ||
872 | + -- end | ||
873 | + | ||
874 | + -- function Role:getHeroActiveRelation(heros) | ||
875 | + -- local data = self:getHeroActiveRelationData(heros) | ||
876 | + -- local result = {} | ||
877 | + -- for attr, value in pairs(data.effect:toNumMap()) do | ||
878 | + -- result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value | ||
879 | + -- end | ||
880 | + -- return result | ||
881 | + -- end | ||
882 | 882 | ||
883 | function Role:getHerosCamp(heros) | 883 | function Role:getHerosCamp(heros) |
884 | local had = {} | 884 | local had = {} |
@@ -899,14 +899,16 @@ function RolePlugin.bind(Role) | @@ -899,14 +899,16 @@ function RolePlugin.bind(Role) | ||
899 | return curCamp | 899 | return curCamp |
900 | end | 900 | end |
901 | 901 | ||
902 | - function Role:getRealBattleValue(heros, activeRelation) -- 获取队伍战斗力 羁绊加成 | 902 | + -- function Role:getRealBattleValue(heros, activeRelation) -- 获取队伍战斗力 羁绊加成 |
903 | + function Role:getRealBattleValue(heros) -- 获取队伍战斗力 羁绊加成 | ||
903 | heros = heros or {} | 904 | heros = heros or {} |
904 | - local activeRelation = activeRelation or self:getHeroActiveRelation(heros) | 905 | + -- local activeRelation = activeRelation or self:getHeroActiveRelation(heros) |
905 | local battleValue = 0 | 906 | local battleValue = 0 |
906 | for _, id in pairs(heros) do | 907 | for _, id in pairs(heros) do |
907 | local hero = self.heros[id] | 908 | local hero = self.heros[id] |
908 | if hero then | 909 | if hero then |
909 | - battleValue = battleValue + hero:getBattleValue(activeRelation) | 910 | + -- battleValue = battleValue + hero:getBattleValue(activeRelation) |
911 | + battleValue = battleValue + hero:getBattleValue() | ||
910 | end | 912 | end |
911 | end | 913 | end |
912 | return battleValue | 914 | return battleValue |
@@ -1292,7 +1294,7 @@ function RolePlugin.bind(Role) | @@ -1292,7 +1294,7 @@ function RolePlugin.bind(Role) | ||
1292 | 1294 | ||
1293 | function Role:getTeamBattleInfo(team) | 1295 | function Role:getTeamBattleInfo(team) |
1294 | local teamInfo = {heros = {}, supports = {}} | 1296 | local teamInfo = {heros = {}, supports = {}} |
1295 | - local activeRelation = self:getHeroActiveRelation(team.heros) | 1297 | + -- local activeRelation = self:getHeroActiveRelation(team.heros) |
1296 | 1298 | ||
1297 | for slot, id in pairs(team.heros or {}) do | 1299 | for slot, id in pairs(team.heros or {}) do |
1298 | local info = {} | 1300 | local info = {} |
@@ -1300,7 +1302,8 @@ function RolePlugin.bind(Role) | @@ -1300,7 +1302,8 @@ function RolePlugin.bind(Role) | ||
1300 | if not hero then | 1302 | if not hero then |
1301 | print("error heroid " .. id) | 1303 | print("error heroid " .. id) |
1302 | end | 1304 | end |
1303 | - local attrs = hero:getTotalAttrs({activeRelation = activeRelation}) | 1305 | + -- local attrs = hero:getTotalAttrs({activeRelation = activeRelation}) |
1306 | + local attrs = hero:getTotalAttrs() | ||
1304 | for k, v in pairs(AttsEnumEx) do | 1307 | for k, v in pairs(AttsEnumEx) do |
1305 | info[v] = (attrs[v] or 0) | 1308 | info[v] = (attrs[v] or 0) |
1306 | end | 1309 | end |