Commit 9e5f9701ec243cdc16328acaf1af2d02ab0f2e79

Authored by zhangqijia
1 parent cd90db08

feat: 玛尼的英雄帖增加任务类型

增加任务类型:
44:玩家拥有拾荒者总星级达到xxx
45:玩家累计解锁xx张CG
src/models/Activity.lua
... ... @@ -497,6 +497,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = {
497 497 --role:checkTaskEnter("HangPass", {id = 0})
498 498 role:checkCalendaTask(true, 15, 3)
499 499 role:checkTaskEnter("HeroStarCollect", {})
  500 + role:checkTaskEnter("HeroStartSum", {})
500 501 role:checkTaskEnter("RuneQualityCollect", {})
501 502  
502 503 end,
... ... @@ -565,6 +566,7 @@ activityFunc[Activity.ActivityType.BattleCommandTask] = {
565 566 --role:checkTaskEnter("HangPass", {id = 0})
566 567 role:checkCalendaTask(true, 15, 3)
567 568 role:checkTaskEnter("HeroStarCollect", {})
  569 + role:checkTaskEnter("HeroStartSum", {})
568 570 role:checkTaskEnter("RuneQualityCollect", {})
569 571  
570 572 end,
... ... @@ -669,6 +671,7 @@ activityFunc[Activity.ActivityType.NewUserTask] = {
669 671 --role:checkTaskEnter("HangPass", {id = 0})
670 672 role:checkCalendaTask(true, 15, 3)
671 673 role:checkTaskEnter("HeroStarCollect", {})
  674 + role:checkTaskEnter("HeroStartSum", {})
672 675 role:checkTaskEnter("RuneQualityCollect", {})
673 676  
674 677 end,
... ...
src/models/RoleCross.lua
... ... @@ -167,6 +167,7 @@ RoleCross.bind = function (Role)
167 167 })
168 168 self:checkTaskEnter("Wake", {heroType = heroId, wakeL = initData.heros.wakeL})
169 169 self:checkTaskEnter("WakeCG", {heroType = heroId})
  170 + self:checkTaskEnter("WakeCGSum", {count = 1})
170 171 self:checkTaskEnter("HeroTalent", {heroType = heroId, alv = aheadLevel})
171 172  
172 173 end
... ...
src/models/RolePlugin.lua
... ... @@ -608,6 +608,7 @@ function RolePlugin.bind(Role)
608 608 }
609 609 if heroInfo.wakeL == 3 then
610 610 self:checkTaskEnter("WakeCG", {heroType = heroType})
  611 + self:checkTaskEnter("WakeCGSum", {count = 1})
611 612 end
612 613 local newHero = require("models.Hero").new(heroInfo)
613 614 newHero:create()
... ...
src/models/RoleTask.lua
... ... @@ -17,6 +17,9 @@ local TaskType = {
17 17 HeroStarCollect = 12, -- 英雄星级收集进度
18 18 DrawHeroNotFriend = 13, -- 非友情招募 -- count
19 19 DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count
  20 + HeroStartSum = 15, -- 英雄星级总数
  21 + WakeCGSum = 16, -- 累计解锁xx张CG
  22 +
20 23  
21 24 --装备相关
22 25 AddEquip = 101, -- 获得装备 - equipId rarity
... ... @@ -325,6 +328,8 @@ local CalendaTaskListener = {
325 328 [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}},
326 329 [TaskType.AdvPass] = {{41, 3, f("id")}},
327 330 [TaskType.CostJade] = {{43, 1, f("count")}},
  331 + [TaskType.HeroStartSum] = {{44, 3}},
  332 + [TaskType.WakeCGSum] = {{45, 1, f("count")}},
328 333 }
329 334 }
330 335  
... ... @@ -745,7 +750,7 @@ function RoleTask.bind(Role)
745 750 for _,uid in pairs(hero:getRunes()) do
746 751 if uid > 0 then
747 752 local runeData = self.runeBag[uid]
748   - if runeData then
  753 + if runeData then
749 754 local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")]
750 755  
751 756 if csvData and cfg.condition2 <= csvData.rarity then
... ... @@ -765,9 +770,9 @@ function RoleTask.bind(Role)
765 770 end
766 771 elseif cfg.type == 15 then -- 通关关卡
767 772 if (calTask[id] or 0) == 0 then
768   - if self:checkHangPass(cfg.condition2) then
  773 + if self:checkHangPass(cfg.condition2) then
769 774 calTask[id] = 1
770   - end
  775 + end
771 776 --local hangPass = self:getProperty("hangPass")
772 777 --local diff = math.floor(cfg.condition2 / 10000)
773 778 --if (hangPass[diff] or 0) >= cfg.condition2 then
... ... @@ -798,7 +803,7 @@ function RoleTask.bind(Role)
798 803 elseif cfg.type == 37 then -- 拾荒使用道具
799 804 if cfg.condition2 == param1 then
800 805 calTask[id] = (calTask[id] or 0) + (param2 or 0)
801   - end
  806 + end
802 807 elseif cfg.type == 38 then -- 和指定建筑交互
803 808 local condArr = cfg.condition3:toArray(true, "=")
804 809 for i = 0, #condArr do
... ... @@ -827,6 +832,14 @@ function RoleTask.bind(Role)
827 832 if cfg.condition2 <= param1 and param2 == 1 then
828 833 calTask[id] = (calTask[id] or 0) + 1
829 834 end
  835 + elseif cfg.type == 44 then --玩家拥有拾荒者总星级达到xxx
  836 + local count = 0
  837 + for _, hero in pairs(self.heros) do
  838 + count = count + hero:getProperty("wakeL")
  839 + end
  840 + if (calTask[id] or 0) < count then
  841 + calTask[id] = count
  842 + end
830 843 end
831 844 end
832 845 end
... ...