Commit b5481708f1de88e7aafd90ef8ce4c2fbf86ce1ab

Authored by zhouhaihai
1 parent c048e676

保底日志

Showing 2 changed files with 7 additions and 2 deletions   Show diff stats
src/actions/HeroAction.lua
... ... @@ -855,14 +855,17 @@ function _M.drawHeroRpc(agent, data)
855 855 floorHeroCount = 0
856 856 end
857 857  
  858 + local logReward = {}
858 859 if role:isHaveHero(itemData.id - ItemStartId.Hero) then
859 860 local fragId = itemData.id - ItemStartId.Hero
860 861 local heroData = csvdb["unitCsv"][fragId]
861 862 local count = globalCsv.draw_unit_tofragment[heroData.rare]
862 863 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  864 + logReward[fragId] = (logReward[fragId] or 0) + count
863 865 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1})
864 866 else
865 867 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  868 + logReward[itemId] = (logReward[itemId] or 0) + 1
866 869 table.insert(reward, {id = itemId, count = 1})
867 870 end
868 871 end
... ... @@ -884,14 +887,15 @@ function _M.drawHeroRpc(agent, data)
884 887 role:checkTaskEnter("DrawSSR", {count = ssrCount})
885 888 end
886 889 role:finishGuide(11)
887   -
  890 +
888 891 role:log("gacha", {
889 892 gacha_id = poolId, -- 卡池ID
890 893 gacha_type = btype, -- 卡池类型
891 894 gacha_up = 0, -- 卡池UP角色
892 895 gacha_times = drawCount[drawType], -- 抽卡次数
893   - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  896 + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
894 897 currency = cost, -- 购买道具消耗的货币
  898 + gacha_cnt = floorHeroCount,
895 899 })
896 900 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
897 901 return true
... ...
src/models/RoleLog.lua
... ... @@ -266,6 +266,7 @@ local MethodType = {
266 266 gacha_times = true, -- 抽卡次数
267 267 gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
268 268 currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  269 + gacha_cnt = true, -- 保底计数
269 270 },
270 271 equip_wear = { --装备穿戴与卸载
271 272 hero_id = true, --英雄ID
... ...