Commit a29d837731338916a5c7af52ccab891f0e760840

Authored by liuzujun
2 parents 74bb1229 923a626e

Merge branch 'cn/develop' of 120.26.43.151:wasteland/server into cn/develop

Showing 2 changed files with 15 additions and 1 deletions   Show diff stats
src/models/RolePlugin.lua
... ... @@ -426,8 +426,15 @@ function RolePlugin.bind(Role)
426 426 return
427 427 end
428 428 end
  429 +
  430 + if itemCountT[ItemId.Jade] then --扣除
  431 + pms.itemId = ItemId.Jade
  432 + pms.count = - itemCountT[ItemId.Jade]
  433 + self:costJade(pms)
  434 + end
  435 +
429 436 for itemId, count in pairs(itemCountT) do
430   - if itemId ~= ItemId.Diamond then
  437 + if itemId ~= ItemId.Diamond and itemId ~= ItemId.Jade then
431 438 pms.itemId = itemId
432 439 pms.count = - count
433 440 self:addItem(pms)
... ... @@ -566,6 +573,11 @@ function RolePlugin.bind(Role)
566 573 return true
567 574 end
568 575  
  576 + function Role:costJade(param)
  577 + self:addItem(param)
  578 + self:checkTaskEnter("CostJade", {count = - param.count})
  579 + end
  580 +
569 581 function Role:increBy(field, val)
570 582 local roleIncre = self:getProperty("roleIncre")
571 583 local curId = roleIncre[field] or 0
... ...
src/models/RoleTask.lua
... ... @@ -112,6 +112,7 @@ local TaskType = {
112 112 ActBattlePass = 911, -- 活动关卡通关 -- chapterId
113 113 Appoint = 912, -- 触发限时礼包,指定id
114 114 Rename = 913, -- 重命名
  115 + CostJade = 914, -- 消耗虹光玉
115 116  
116 117 --功能未实现 todo
117 118 AdvShop = 1002, -- 冒险商城
... ... @@ -318,6 +319,7 @@ local CalendaTaskListener = {
318 319 [TaskType.AdvKill] = {{39, 1, f("chapterId")}},
319 320 [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}},
320 321 [TaskType.AdvPass] = {{41, 3, f("id")}},
  322 + [TaskType.CostJade] = {{43, 1, f("count")}},
321 323 }
322 324 }
323 325  
... ...