Commit 8efb24c972ef586a551d36d817cc4d54993fdd4a
1 parent
42dcb7da
天赋系统属性加成改为百分比
Showing
4 changed files
with
17 additions
and
6 deletions
Show diff stats
src/actions/DinerAction.lua
@@ -609,10 +609,10 @@ function _M.refreshTaskRpc( agent, data ) | @@ -609,10 +609,10 @@ function _M.refreshTaskRpc( agent, data ) | ||
609 | local role = agent.role | 609 | local role = agent.role |
610 | local msg = MsgPack.unpack(data) | 610 | local msg = MsgPack.unpack(data) |
611 | 611 | ||
612 | - local cost = {[ItemId.Diamond] = 40} | ||
613 | - if not role:checkItemEnough(cost) then | ||
614 | - return 1 | ||
615 | - end | 612 | + --local cost = {[ItemId.Diamond] = 40} |
613 | + --if not role:checkItemEnough(cost) then | ||
614 | + -- return 1 | ||
615 | + --end | ||
616 | 616 | ||
617 | local orders = json.decode(role.dinerData:getProperty("order")) | 617 | local orders = json.decode(role.dinerData:getProperty("order")) |
618 | 618 |
src/actions/RadioAction.lua
@@ -121,10 +121,15 @@ function _M.finishQuestRpc(agent, data) | @@ -121,10 +121,15 @@ function _M.finishQuestRpc(agent, data) | ||
121 | if not carbonData then return 4 end | 121 | if not carbonData then return 4 end |
122 | -- get heros | 122 | -- get heros |
123 | local totalCoef = 0 | 123 | local totalCoef = 0 |
124 | + local exp = config.time / 60 | ||
125 | + heroFaithMap = {} | ||
124 | for _, heroId in ipairs(task.heros) do | 126 | for _, heroId in ipairs(task.heros) do |
125 | local hero = role.heros[heroId] | 127 | local hero = role.heros[heroId] |
126 | if hero then | 128 | if hero then |
127 | totalCoef = totalCoef + getHeroCoef(hero, config.success) | 129 | totalCoef = totalCoef + getHeroCoef(hero, config.success) |
130 | + -- 增加英雄信赖 | ||
131 | + hero:addHeroFaith(exp) | ||
132 | + heroFaithMap[heroId] = hero:getProperty("faith") | ||
128 | end | 133 | end |
129 | end | 134 | end |
130 | -- send award | 135 | -- send award |
@@ -152,6 +157,7 @@ function _M.finishQuestRpc(agent, data) | @@ -152,6 +157,7 @@ function _M.finishQuestRpc(agent, data) | ||
152 | local msg = role:packReward(r, change) | 157 | local msg = role:packReward(r, change) |
153 | msg["big"] = bigSuccess | 158 | msg["big"] = bigSuccess |
154 | msg["id"] = id | 159 | msg["id"] = id |
160 | + msg["heroFaith"] = heroFaithMap | ||
155 | SendPacket(actionCodes.Radio_finishQuestRpc, MsgPack.pack(msg)) | 161 | SendPacket(actionCodes.Radio_finishQuestRpc, MsgPack.pack(msg)) |
156 | return true | 162 | return true |
157 | end | 163 | end |
src/models/HeroPlugin.lua
@@ -74,7 +74,7 @@ function HeroPlugin.bind(Hero) | @@ -74,7 +74,7 @@ function HeroPlugin.bind(Hero) | ||
74 | 74 | ||
75 | for _, attrName in pairs(AttsEnumEx) do | 75 | for _, attrName in pairs(AttsEnumEx) do |
76 | if talentAttrS[attrName] then | 76 | if talentAttrS[attrName] then |
77 | - talentAttrS[attrName] = addAttr(unitData[attrName], talentAttrS[attrName], 0, attrName) | 77 | + talentAttrS[attrName] = addAttr(unitData[attrName], talentAttrS[attrName], 1, attrName) |
78 | end | 78 | end |
79 | end | 79 | end |
80 | 80 | ||
@@ -88,6 +88,11 @@ function HeroPlugin.bind(Hero) | @@ -88,6 +88,11 @@ function HeroPlugin.bind(Hero) | ||
88 | faithAttr[add[1]] = (faithAttr[add[1]] or 0) + add[2] | 88 | faithAttr[add[1]] = (faithAttr[add[1]] or 0) + add[2] |
89 | end | 89 | end |
90 | end | 90 | end |
91 | + for _, attrName in pairs(AttsEnumEx) do | ||
92 | + if faithAttr[attrName] then | ||
93 | + faithAttr[attrName] = addAttr(unitData[attrName], faithAttr[attrName], 1, attrName) | ||
94 | + end | ||
95 | + end | ||
91 | 96 | ||
92 | local attrs = {} | 97 | local attrs = {} |
93 | for _, attName in pairs(AttsEnumEx) do | 98 | for _, attName in pairs(AttsEnumEx) do |