Commit b3f13e563b19f87c021bf084ef1aa411d869759f

Authored by liuzujun
1 parent b07d54c2

英雄令英雄收集相关任务

Showing 1 changed file with 43 additions and 0 deletions   Show diff stats
src/models/RoleTask.lua
... ... @@ -607,6 +607,49 @@ function RoleTask.bind(Role)
607 607 elseif subType == 2 then -- 直接赋值
608 608 calTask[id] = param1
609 609 elseif subType == 3 then -- 自定义类型
  610 + if cfg.type == 7 then -- 英雄品质收集进度
  611 + local count = 0
  612 + for _, hero in pairs(self.heros) do
  613 + local unitData = csvdb["unitCsv"][hero:getProperty("type")]
  614 + if unitData then
  615 + if cfg.condition2 <= unitData.rare then
  616 + count = count + 1
  617 + end
  618 + end
  619 + end
  620 + if calTask[id] < count then
  621 + calTask[id] = count
  622 + end
  623 + elseif cfg.type == 5 then -- 英雄等级收集进度
  624 + local count = 0
  625 + for _, hero in pairs(self.heros) do
  626 + if cfg.condition2 <= hero:getProperty("level") then
  627 + count = count + 1
  628 + end
  629 + end
  630 + if calTask[id] < count then
  631 + calTask[id] = count
  632 + end
  633 + elseif cfg.type == 16 then -- 英雄星级收集进度
  634 + local count = 0
  635 + for _, hero in pairs(self.heros) do
  636 + if cfg.condition2 <= hero:getProperty("wakeL") then
  637 + count = count + 1
  638 + end
  639 + end
  640 + if calTask[id] < count then
  641 + calTask[id] = count
  642 + end
  643 + elseif cfg.type == 18 then -- 挂机累计收获id,y个
  644 + dump(param1)
  645 + for rid, v in pairs(param1) do
  646 + if cfg.condition2 == rid then
  647 + calTask[id] = (calTask[id] or 0) + v
  648 + end
  649 + end
  650 + elseif cfg.type == 19 then -- x名英雄装备y品质以上符文套装
  651 + elseif cfg.type == 20 then -- 开启x品质时钟箱子
  652 + end
610 653 end
611 654 end
612 655 end
... ...