Commit 37502372199f49f1df2775bf80be94063bbe8a32
1 parent
bc50c971
feat: 付费战令每日任务获得额外50%经验
Showing
2 changed files
with
22 additions
and
2 deletions
Show diff stats
src/GlobalVar.lua
@@ -133,7 +133,7 @@ ItemStartId = { | @@ -133,7 +133,7 @@ ItemStartId = { | ||
133 | --常用的物品id的枚举 | 133 | --常用的物品id的枚举 |
134 | ItemId = { | 134 | ItemId = { |
135 | Gold = 1, -- 金币 | 135 | Gold = 1, -- 金币 |
136 | - Exp = 2, -- 经验 | 136 | + Exp = 2, -- 能量饮料 |
137 | Jade = 3, -- 虹光玉 | 137 | Jade = 3, -- 虹光玉 |
138 | PlayerExp = 4, -- 突破材料 | 138 | PlayerExp = 4, -- 突破材料 |
139 | FriendPoint = 5, -- 友情点 | 139 | FriendPoint = 5, -- 友情点 |
src/actions/ActivityAction.lua
@@ -315,7 +315,27 @@ function _M.actBattleCommandTaskRpc(agent, data) | @@ -315,7 +315,27 @@ function _M.actBattleCommandTaskRpc(agent, data) | ||
315 | 315 | ||
316 | role:updateProperty({field = "bcTask", value = calTask}) | 316 | role:updateProperty({field = "bcTask", value = calTask}) |
317 | 317 | ||
318 | - local reward, change = role:award(taskCfg.reward, {log = {desc = "battleCommandTask"}}) | 318 | + local rechargeRecord = role.storeData:getProperty("payR") or {} |
319 | + local recordFlag = false | ||
320 | + for _, id in ipairs(taskCfg.battlepass_id:toArray(true, "=")) do | ||
321 | + if rechargeRecord[id] then | ||
322 | + local cfg = csvdb["shop_rechargeCsv"][id] | ||
323 | + if cfg and cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then | ||
324 | + recordFlag = true | ||
325 | + break | ||
326 | + end | ||
327 | + end | ||
328 | + end | ||
329 | + | ||
330 | + local taskReward = {} | ||
331 | + if recordFlag then | ||
332 | + for k, v in pairs(taskCfg.reward:toNumMap()) do | ||
333 | + taskReward[k] = (taskReward[k] or 0) + v + taskCfg.battlepass_reward | ||
334 | + break | ||
335 | + end | ||
336 | + end | ||
337 | + | ||
338 | + local reward, change = role:award(taskReward, {log = {desc = "battleCommandTask"}}) | ||
319 | 339 | ||
320 | role:log("activity", { | 340 | role:log("activity", { |
321 | activity_id = taskId, -- 活动ID(或活动指定任务的ID) | 341 | activity_id = taskId, -- 活动ID(或活动指定任务的ID) |