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