Commit 51e101990b812ec3ccafb5e6771ef35931cd96e5
1 parent
a2df11d6
招募增加附加奖励
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
src/actions/HeroAction.lua
@@ -809,6 +809,7 @@ function _M.drawHeroRpc(agent, data) | @@ -809,6 +809,7 @@ function _M.drawHeroRpc(agent, data) | ||
809 | 809 | ||
810 | -- 计算抽卡消耗品 | 810 | -- 计算抽卡消耗品 |
811 | local cost = {} | 811 | local cost = {} |
812 | + local drawAddReward = {} | ||
812 | if buildTypeData["draw_coin_1"] == "" then | 813 | if buildTypeData["draw_coin_1"] == "" then |
813 | return 11 | 814 | return 11 |
814 | end | 815 | end |
@@ -1004,6 +1005,15 @@ function _M.drawHeroRpc(agent, data) | @@ -1004,6 +1005,15 @@ function _M.drawHeroRpc(agent, data) | ||
1004 | table.insert(reward, {id = itemId, count = 1}) | 1005 | table.insert(reward, {id = itemId, count = 1}) |
1005 | end | 1006 | end |
1006 | 1007 | ||
1008 | + -- 招募得到的英雄追加奖励 | ||
1009 | + local unitData = csvdb["unitCsv"][itemData.id - ItemStartId.Hero] | ||
1010 | + if unitData.build_award ~= "" then | ||
1011 | + for tId, tCount in pairs(unitData.build_award:toNumMap()) do | ||
1012 | + drawAddReward[tId] = (drawAddReward[tId] or 0) + tCount | ||
1013 | + end | ||
1014 | + end | ||
1015 | + -- | ||
1016 | + | ||
1007 | dailyDrawCnt = dailyDrawCnt + 1 | 1017 | dailyDrawCnt = dailyDrawCnt + 1 |
1008 | role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) | 1018 | role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) |
1009 | end | 1019 | end |
@@ -1041,7 +1051,7 @@ function _M.drawHeroRpc(agent, data) | @@ -1041,7 +1051,7 @@ function _M.drawHeroRpc(agent, data) | ||
1041 | }) | 1051 | }) |
1042 | 1052 | ||
1043 | role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]}) | 1053 | role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]}) |
1044 | - SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 | 1054 | + SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward, subReward = drawAddReward})) -- 这个 reward 是数组 |
1045 | 1055 | ||
1046 | local feedbackId = buildTypeData["can_feedback"] or 0 | 1056 | local feedbackId = buildTypeData["can_feedback"] or 0 |
1047 | if feedbackId ~= 0 then | 1057 | if feedbackId ~= 0 then |