diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index a150c2e..87d24ce 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -855,14 +855,17 @@ function _M.drawHeroRpc(agent, data) floorHeroCount = 0 end + local logReward = {} if role:isHaveHero(itemData.id - ItemStartId.Hero) then local fragId = itemData.id - ItemStartId.Hero local heroData = csvdb["unitCsv"][fragId] local count = globalCsv.draw_unit_tofragment[heroData.rare] role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) + logReward[fragId] = (logReward[fragId] or 0) + count table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) else role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) + logReward[itemId] = (logReward[itemId] or 0) + 1 table.insert(reward, {id = itemId, count = 1}) end end @@ -884,14 +887,15 @@ function _M.drawHeroRpc(agent, data) role:checkTaskEnter("DrawSSR", {count = ssrCount}) end role:finishGuide(11) - + role:log("gacha", { gacha_id = poolId, -- 卡池ID gacha_type = btype, -- 卡池类型 gacha_up = 0, -- 卡池UP角色 gacha_times = drawCount[drawType], -- 抽卡次数 - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} currency = cost, -- 购买道具消耗的货币 + gacha_cnt = floorHeroCount, }) SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 return true diff --git a/src/models/RoleLog.lua b/src/models/RoleLog.lua index 0453c77..9294b32 100644 --- a/src/models/RoleLog.lua +++ b/src/models/RoleLog.lua @@ -266,6 +266,7 @@ local MethodType = { gacha_times = true, -- 抽卡次数 gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} + gacha_cnt = true, -- 保底计数 }, equip_wear = { --装备穿戴与卸载 hero_id = true, --英雄ID -- libgit2 0.21.2