From 89338c475b6629e6af75e4bfb56ea20f6dcce2ad Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Thu, 7 Nov 2019 19:45:57 +0800 Subject: [PATCH] 技能目标 --- src/adv/Adv.lua | 2 +- src/adv/AdvSkill.lua | 2 +- src/models/RolePlugin.lua | 2 +- src/models/RoleTask.lua | 21 +++++++++++++-------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index febbd53..6bf2297 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -181,7 +181,7 @@ function Adv:over(success, isAllPass) end end self:clear() - + self.owner:checkTaskEnter("AdvScore", {score = score}) self.owner:updateProperty({field = "advItems", value = ""}) self:backEnd(success, score, scoreInfo, reward) diff --git a/src/adv/AdvSkill.lua b/src/adv/AdvSkill.lua index d052aa3..9c396ee 100644 --- a/src/adv/AdvSkill.lua +++ b/src/adv/AdvSkill.lua @@ -39,7 +39,7 @@ function Skill:filterBySide(sideType, aimType) end elseif sideType == 2 then -- 我方 if aimType == 1 then - table.insert(targets, self) + table.insert(targets, self.owner) elseif aimType == 2 then targets = self.owner:getTeam(1, true) elseif aimType == 3 then diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 14d41c4..9fb9e88 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -509,7 +509,7 @@ function RolePlugin.bind(Role) table.insert(response, newRune:data()) SendPacket(actionCodes.Role_loadRunes, MsgPack.pack(response)) end - self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = set.rarity}, params.notNotify) + self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) return 0 else return 1 diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index 293aded..2d2bfd1 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -41,7 +41,8 @@ local TaskType = { AdvOverTask = 406, -- 完成任务 - id AdvOpenBlock = 407, -- 打开地块 - id AdvUsePotion = 408, -- 使用营养剂 - AdvStartSelf = 409, -- 手动冒险 - id + AdvStartSelf = 409, -- 手动冒险 - id + AdvScore = 410, -- 冒险分数 - score --爬塔相关 TowerPass = 501, -- 爬塔通关 - level @@ -144,7 +145,7 @@ local AchievListener = { [TaskType.PvpWin] = {{v(3)}, {v(4), f("score")}}, [TaskType.AdvAllPass] = {{v(5), f("id")}}, [TaskType.AdvLevel] = {{v(6), f("level")}}, - [TaskType.AdvPass] = {{v(7), f("score")}}, + [TaskType.AdvScore] = {{v(7), f("score")}}, [TaskType.AdvBattleWin] = {{v(8)}}, [TaskType.AdvOverTask] = {{v(9)}}, [TaskType.AdvOpenBlock] = {{v(10)}}, @@ -198,8 +199,8 @@ function RoleTask.bind(Role) end for _, listener in ipairs(TaskListeners) do if listener and listener.listen and listener.listen[taskType] and listener["func"] then - local pms = {} for _, vs in ipairs(listener.listen[taskType]) do + local pms = {} for __, v in ipairs(vs) do if type(v) == "table" and v.type then if v.type == "value" then @@ -343,7 +344,7 @@ function RoleTask.bind(Role) [25] = true, } - for tId , achiveData in ipairs(csvdb["achievement_typeCsv"]) do + for tId , achiveData in pairs(csvdb["achievement_typeCsv"]) do local curStatus = achiveStatus[tId] or 0 if achiveData.type == stype then if achiveData.type == 1 then --取出难度 @@ -360,11 +361,11 @@ function RoleTask.bind(Role) end local nStatus = 0 if achiveData.condition2 == 1 then - for k , v in pairs(jobS) do + for k , v in pairs(campS) do nStatus = math.max(nStatus, v) end elseif achiveData.condition2 == 2 then - for k , v in pairs(campS) do + for k , v in pairs(jobS) do nStatus = math.max(nStatus, v) end end @@ -393,6 +394,10 @@ function RoleTask.bind(Role) end nStatus = math.max(nStatus, n) end + if achiveData.id == 35 then + print(nStatus) + end + if nStatus > curStatus then table.insert(change, {type = "achiveT", field = tId, value = nStatus}) end @@ -402,7 +407,7 @@ function RoleTask.bind(Role) local suitS = {} for _, rune in pairs(self.runeBag) do local runeData = csvdb["runeCsv"][rune:getProperty("type")][rune:getProperty("id")] - if achiveData.condition2 == 0 or achiveData.condition2 == equipData.rarity then + if achiveData.condition2 == 0 or achiveData.condition2 == runeData.rarity then if runeData.suit ~= "" then suitS[runeData.suit] = suitS[runeData.suit] or {} suitS[runeData.suit][runeData.type] = 1 @@ -437,8 +442,8 @@ function RoleTask.bind(Role) if next(change) then self:changeUpdates(change, notNotify) end - end + end return RoleTask \ No newline at end of file -- libgit2 0.21.2