From e1355da3f04e96486e689e09c74dba37040fa531 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Fri, 6 Mar 2020 11:45:52 +0800 Subject: [PATCH] 神器 被动 --- src/adv/Adv.lua | 8 +++++++- src/models/RolePlugin.lua | 21 +++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 6d1e79a..914dfbd 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -545,6 +545,10 @@ function Adv:artifactLevelUp(id, level) local advAFGet = self.owner:getProperty("advAFGet") if not advAFGet[id] then return end local advAFWear = self.owner:getProperty("advAFWear") + local curWear = {} + for _, _id in pairs(advAFWear) do + curWear[_id] = 1 + end local newLv = advAFGet[id] for i = 1, level do @@ -554,7 +558,7 @@ function Adv:artifactLevelUp(id, level) if newLv == advAFGet[id] then return end local status = 0 - if advAFWear[id] then -- 穿着呢 + if curWear[id] then -- 穿着呢 local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] local newData = csvdb["adv_artifactCsv"][id][newLv] self:delArtifactEffect(oldData.effect) @@ -817,6 +821,8 @@ local function clickOut(self, room, block, params) self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp})) end local isHaveRelay = self:isHaveRelay(self.level) + + self.owner:getProperty("advTeam").player = self.battle.player:getDB() -- 临时缓存住 battle 的player if isHaveRelay and not self.isRelay then self:initByChapter(self.chapterId, self.level, true, true, true, false) else diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 1d318fa..38fe0b5 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -794,16 +794,6 @@ function RolePlugin.bind(Role) adv:forceOver() end - -- 重新设定冒险章节和冒险结束时间 - self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) - self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) - - if not notNotify then - SendPacket(actionCodes.Role_updateProperties, MsgPack.pack({ - advElChapter = self.advElChapter, - advOverTime = self.advOverTime, - })) - end -- 路过的中继层重置掉 local advRelay = self:getProperty("advRelay") advRelay[-1] = nil @@ -814,6 +804,17 @@ function RolePlugin.bind(Role) advElS = nowSeason, advRelay = advRelay, }, notNotify) + + + -- 重新设定冒险章节和冒险结束时间 + self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) + self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) + if not notNotify then + SendPacket(actionCodes.Role_updateProperties, MsgPack.pack({ + advElChapter = self.advElChapter, + advOverTime = self.advOverTime, + })) + end end end -- libgit2 0.21.2