From 9e5f9701ec243cdc16328acaf1af2d02ab0f2e79 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Tue, 17 Aug 2021 15:43:45 +0800 Subject: [PATCH] feat: 玛尼的英雄帖增加任务类型 --- src/models/Activity.lua | 3 +++ src/models/RoleCross.lua | 1 + src/models/RolePlugin.lua | 1 + src/models/RoleTask.lua | 21 +++++++++++++++++---- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 0bdb963..b815c59 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -497,6 +497,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = { --role:checkTaskEnter("HangPass", {id = 0}) role:checkCalendaTask(true, 15, 3) role:checkTaskEnter("HeroStarCollect", {}) + role:checkTaskEnter("HeroStartSum", {}) role:checkTaskEnter("RuneQualityCollect", {}) end, @@ -565,6 +566,7 @@ activityFunc[Activity.ActivityType.BattleCommandTask] = { --role:checkTaskEnter("HangPass", {id = 0}) role:checkCalendaTask(true, 15, 3) role:checkTaskEnter("HeroStarCollect", {}) + role:checkTaskEnter("HeroStartSum", {}) role:checkTaskEnter("RuneQualityCollect", {}) end, @@ -669,6 +671,7 @@ activityFunc[Activity.ActivityType.NewUserTask] = { --role:checkTaskEnter("HangPass", {id = 0}) role:checkCalendaTask(true, 15, 3) role:checkTaskEnter("HeroStarCollect", {}) + role:checkTaskEnter("HeroStartSum", {}) role:checkTaskEnter("RuneQualityCollect", {}) end, diff --git a/src/models/RoleCross.lua b/src/models/RoleCross.lua index f72acf8..b7a703d 100644 --- a/src/models/RoleCross.lua +++ b/src/models/RoleCross.lua @@ -167,6 +167,7 @@ RoleCross.bind = function (Role) }) self:checkTaskEnter("Wake", {heroType = heroId, wakeL = initData.heros.wakeL}) self:checkTaskEnter("WakeCG", {heroType = heroId}) + self:checkTaskEnter("WakeCGSum", {count = 1}) self:checkTaskEnter("HeroTalent", {heroType = heroId, alv = aheadLevel}) end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 2250908..37c206b 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -608,6 +608,7 @@ function RolePlugin.bind(Role) } if heroInfo.wakeL == 3 then self:checkTaskEnter("WakeCG", {heroType = heroType}) + self:checkTaskEnter("WakeCGSum", {count = 1}) end local newHero = require("models.Hero").new(heroInfo) newHero:create() diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index b957211..92a0adb 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -17,6 +17,9 @@ local TaskType = { HeroStarCollect = 12, -- 英雄星级收集进度 DrawHeroNotFriend = 13, -- 非友情招募 -- count DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count + HeroStartSum = 15, -- 英雄星级总数 + WakeCGSum = 16, -- 累计解锁xx张CG + --装备相关 AddEquip = 101, -- 获得装备 - equipId rarity @@ -325,6 +328,8 @@ local CalendaTaskListener = { [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}}, [TaskType.AdvPass] = {{41, 3, f("id")}}, [TaskType.CostJade] = {{43, 1, f("count")}}, + [TaskType.HeroStartSum] = {{44, 3}}, + [TaskType.WakeCGSum] = {{45, 1, f("count")}}, } } @@ -745,7 +750,7 @@ function RoleTask.bind(Role) for _,uid in pairs(hero:getRunes()) do if uid > 0 then local runeData = self.runeBag[uid] - if runeData then + if runeData then local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")] if csvData and cfg.condition2 <= csvData.rarity then @@ -765,9 +770,9 @@ function RoleTask.bind(Role) end elseif cfg.type == 15 then -- 通关关卡 if (calTask[id] or 0) == 0 then - if self:checkHangPass(cfg.condition2) then + if self:checkHangPass(cfg.condition2) then calTask[id] = 1 - end + end --local hangPass = self:getProperty("hangPass") --local diff = math.floor(cfg.condition2 / 10000) --if (hangPass[diff] or 0) >= cfg.condition2 then @@ -798,7 +803,7 @@ function RoleTask.bind(Role) elseif cfg.type == 37 then -- 拾荒使用道具 if cfg.condition2 == param1 then calTask[id] = (calTask[id] or 0) + (param2 or 0) - end + end elseif cfg.type == 38 then -- 和指定建筑交互 local condArr = cfg.condition3:toArray(true, "=") for i = 0, #condArr do @@ -827,6 +832,14 @@ function RoleTask.bind(Role) if cfg.condition2 <= param1 and param2 == 1 then calTask[id] = (calTask[id] or 0) + 1 end + elseif cfg.type == 44 then --玩家拥有拾荒者总星级达到xxx + local count = 0 + for _, hero in pairs(self.heros) do + count = count + hero:getProperty("wakeL") + end + if (calTask[id] or 0) < count then + calTask[id] = count + end end end end -- libgit2 0.21.2