Commit 6a2b449c1e0f75bdbed544649e6fef0a50c41e41

Authored by liuzujun
1 parent 9be3f3ea

扭蛋机奖励不合并显示, 新增多队挂机,天赋升级日志

src/actions/ActivityAction.lua
@@ -316,6 +316,7 @@ function _M.gachakonRpc(agent, data) @@ -316,6 +316,7 @@ function _M.gachakonRpc(agent, data)
316 local gachakonInfo = role.activity:getActData("Gachakon") or {} 316 local gachakonInfo = role.activity:getActData("Gachakon") or {}
317 local award = {} 317 local award = {}
318 local remain = 0 318 local remain = 0
  319 + local showAward = {}
319 for i = 1, count do 320 for i = 1, count do
320 local tmpCfg = clone(actCfg) 321 local tmpCfg = clone(actCfg)
321 remain = 0 322 remain = 0
@@ -335,6 +336,7 @@ function _M.gachakonRpc(agent, data) @@ -335,6 +336,7 @@ function _M.gachakonRpc(agent, data)
335 if not id then return 4 end 336 if not id then return 4 end
336 gachakonInfo[id] = (gachakonInfo[id] or 0) + 1 337 gachakonInfo[id] = (gachakonInfo[id] or 0) + 1
337 local curAward = tmpCfg[id].award:toNumMap() 338 local curAward = tmpCfg[id].award:toNumMap()
  339 + table.insert(showAward, curAward)
338 for k, v in pairs(curAward) do 340 for k, v in pairs(curAward) do
339 award[k] = (award[k] or 0) + v 341 award[k] = (award[k] or 0) + v
340 end 342 end
@@ -355,7 +357,7 @@ function _M.gachakonRpc(agent, data) @@ -355,7 +357,7 @@ function _M.gachakonRpc(agent, data)
355 end 357 end
356 role.activity:updateActData("Gachakon", gachakonInfo) 358 role.activity:updateActData("Gachakon", gachakonInfo)
357 359
358 - SendPacket(actionCodes.Activity_gachakonRpc, MsgPack.pack(role:packReward(reward, change))) 360 + SendPacket(actionCodes.Activity_gachakonRpc, MsgPack.pack(showAward))
359 return true 361 return true
360 end 362 end
361 363
src/actions/HeroAction.lua
@@ -146,7 +146,9 @@ function _M.talentRpc(agent, data) @@ -146,7 +146,9 @@ function _M.talentRpc(agent, data)
146 local talent = hero:getProperty("talent") 146 local talent = hero:getProperty("talent")
147 local heroCfgId = hero:getProperty("type") 147 local heroCfgId = hero:getProperty("type")
148 local curStage = talent:getv(0, 1) 148 local curStage = talent:getv(0, 1)
  149 + local oldStage = curStage
149 local curLevel = talent:getv(1, 1) 150 local curLevel = talent:getv(1, 1)
  151 + local oldLevel = curLevel
150 local curData = csvdb["unit_talent_"..heroCfgId.."Csv"][curStage] 152 local curData = csvdb["unit_talent_"..heroCfgId.."Csv"][curStage]
151 if not curData then return 1 end 153 if not curData then return 1 end
152 local oldSkillLv = hero:getSkillLevel(1) 154 local oldSkillLv = hero:getSkillLevel(1)
@@ -174,13 +176,16 @@ function _M.talentRpc(agent, data) @@ -174,13 +176,16 @@ function _M.talentRpc(agent, data)
174 176
175 hero:updateProperty({field = "talent", value = talent}) 177 hero:updateProperty({field = "talent", value = talent})
176 178
177 - -- role:log("hero_talent", {  
178 - -- hero_id = hero:getProperty("type"), --英雄ID  
179 - -- hero_talent_id = curStage, --天赋ID  
180 - -- hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}  
181 - -- hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级  
182 - -- hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级  
183 - -- }) 179 +
  180 + role:log("hero_talent", {
  181 + hero_id = hero:getProperty("type"), --英雄ID
  182 + hero_talent_stagebef = oldStage, --英雄精进升级前停留阶段
  183 + hero_talent_stage = curStage, --英雄精进升级后停留阶段
  184 + hero_talent_cost = json.encode(cost), --英雄精进升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,….}
  185 + hero_talent_subid = curData[oldLevel].effect, --升级属性ID,生命、攻击、防御、命中、闪避分别对应(0,1,2,3,4)
  186 + hero_talent_sublevel = curData[oldLevel].level, --升级属性等级,如生命升级从1到2,则记录2
  187 + })
  188 +
184 hero:mylog({desc = "talent", int1 = talent:getv(0, 1), int2 = talent:getv(1, 1)}) 189 hero:mylog({desc = "talent", int1 = talent:getv(0, 1), int2 = talent:getv(1, 1)})
185 190
186 SendPacket(actionCodes.Hero_talentRpc, '') 191 SendPacket(actionCodes.Hero_talentRpc, '')
src/actions/RadioAction.lua
@@ -158,7 +158,27 @@ function _M.finishQuestRpc(agent, data) @@ -158,7 +158,27 @@ function _M.finishQuestRpc(agent, data)
158 msg["big"] = bigSuccess 158 msg["big"] = bigSuccess
159 msg["id"] = id 159 msg["id"] = id
160 msg["heroFaith"] = heroFaithMap 160 msg["heroFaith"] = heroFaithMap
161 - SendPacket(actionCodes.Radio_finishQuestRpc, MsgPack.pack(msg)) 161 + SendPacket(actionCodes.Radio_finishQuestRpc, MsgPack.pack(msg))
  162 +
  163 +
  164 + local herolist = {}
  165 + for _, heroId in ipairs(task.heros) do
  166 + local hero = role.heros[heroId]
  167 + if hero then
  168 + table.insert(herolist, hero:getProperty("type"))
  169 + end
  170 + end
  171 +
  172 + -- 讨伐行动
  173 + role:log("punitive_action", {
  174 + mission_id = id, --关卡ID
  175 + mission_herolist = herolist, -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555]
  176 + mission_success_rate = totalCoef, -- 大成功几率
  177 + mission_reward = json.encode(r), -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
  178 + mission_result = 1, -- 战斗结果(0-无效,1-胜利,2-失败)
  179 + mission_roundtime = config.time, -- 完成耗时(秒)
  180 + })
  181 +
162 return true 182 return true
163 end 183 end
164 184
1 -Subproject commit f019454e533ec12642ab9d7518c80b73c1cc00bb 1 +Subproject commit bb227076bc3bb79747546fdddc380c8018e7e82b