Commit 8ccecbf9324f51a4ccfc0a14351d3a6d8be30631
Merge branch 'develop' into qa
Showing
6 changed files
with
33 additions
and
14 deletions
 
Show diff stats
src/GlobalVar.lua
| 1 | 1 | XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18" | 
| 2 | 2 | RESET_TIME = 4 | 
| 3 | 3 | |
| 4 | -START_RESET_TIME_BASE = 1584921600 -- 0时区 | |
| 4 | +START_RESET_TIME_BASE = 1584316800 -- 0时区 | |
| 5 | 5 | TIME_ZONE = math.floor(os.difftime(START_RESET_TIME_BASE, os.time(os.date("!*t", START_RESET_TIME_BASE))) / 3600) -- 本地时区 | 
| 6 | 6 | |
| 7 | 7 | START_RESET_TIME = START_RESET_TIME_BASE - TIME_ZONE * 3600 | ... | ... | 
src/actions/PvpAction.lua
| ... | ... | @@ -824,18 +824,8 @@ function _M.highDivisionGiftRpc(agent, data) | 
| 824 | 824 | |
| 825 | 825 | local pvpHGTime = role:getProperty("pvpHGTime") | 
| 826 | 826 | if pvpHGTime == 0 then return end | 
| 827 | - local score = role:unpackPvpScore(redisproxy:zscore(role:getPvpDBKey(RANK_PVP_HIGHT), roleId)) | |
| 828 | 827 | |
| 829 | - local divisionId = nil | |
| 830 | - for _id, division in ipairs(csvdb["pvp_group_divisionCsv"]) do | |
| 831 | - if score >= division.division then | |
| 832 | - divisionId = _id | |
| 833 | - else | |
| 834 | - break | |
| 835 | - end | |
| 836 | - end | |
| 837 | - | |
| 838 | - local newTime, newReward = role:calculatePvpHGift(divisionId) | |
| 828 | + local newTime, newReward = role:calculatePvpHGift(role:getPvpHDivision()) | |
| 839 | 829 | if not next(newReward) then return end | 
| 840 | 830 | |
| 841 | 831 | role:updateProperties({ | ... | ... | 
src/adv/AdvPassive.lua
| ... | ... | @@ -300,7 +300,7 @@ function Passive:canEffect(effType, effValue) | 
| 300 | 300 | return | 
| 301 | 301 | end | 
| 302 | 302 | --禁用被动技 | 
| 303 | - if self.owner:getPassiveIdx(self) <= self.owner:getDisablePassiveCount() then | |
| 303 | + if self.owner:getDisablePassiveCount() == 0 or self.owner:getPassiveIdx(self) <= self.owner:getDisablePassiveCount() then | |
| 304 | 304 | return | 
| 305 | 305 | end | 
| 306 | 306 | return true | ... | ... | 
src/models/RolePlugin.lua
| ... | ... | @@ -1291,6 +1291,7 @@ function RolePlugin.bind(Role) | 
| 1291 | 1291 | end | 
| 1292 | 1292 | local breathes = { | 
| 1293 | 1293 | ["email"] = breath(120), -- email | 
| 1294 | + ["pvphg"] = breath(300), -- 高级竞技场 奖励满的红点 | |
| 1294 | 1295 | } | 
| 1295 | 1296 | function Role:checkNewEvent(now) | 
| 1296 | 1297 | if now - self:getProperty("ltime") < 5 then | 
| ... | ... | @@ -1337,6 +1338,21 @@ function RolePlugin.bind(Role) | 
| 1337 | 1338 | end | 
| 1338 | 1339 | end | 
| 1339 | 1340 | end | 
| 1341 | + | |
| 1342 | + checks["pvphg"] = function() | |
| 1343 | + if not self:isTimeResetOpen(TimeReset.PvpHight) then return end | |
| 1344 | + | |
| 1345 | + local pvpHGTime = self:getProperty("pvpHGTime") | |
| 1346 | + if pvpHGTime == 0 then return end | |
| 1347 | + local division = self:getPvpHDivision() | |
| 1348 | + local divisionData = csvdb["pvp_group_divisionCsv"][division] | |
| 1349 | + | |
| 1350 | + local newTime, newReward = self:calculatePvpHGift(division) | |
| 1351 | + if table.pack(next(newReward))[2] >= divisionData.limit then | |
| 1352 | + return true | |
| 1353 | + end | |
| 1354 | + | |
| 1355 | + end | |
| 1340 | 1356 | |
| 1341 | 1357 | local events = {} | 
| 1342 | 1358 | for name, breath in pairs(breathes) do | ... | ... | 
src/models/RolePvp.lua
| ... | ... | @@ -82,6 +82,19 @@ function Role:changePvpScoreCommon(matchId, isWin) | 
| 82 | 82 | return table.unpack(result) | 
| 83 | 83 | end | 
| 84 | 84 | |
| 85 | +function Role:getPvpHDivision(score) | |
| 86 | + local score = score or self:unpackPvpScore(redisproxy:zscore(self:getPvpDBKey(RANK_PVP_HIGHT), self:getProperty("id"))) | |
| 87 | + local divisionId = nil | |
| 88 | + for _id, division in ipairs(csvdb["pvp_group_divisionCsv"]) do | |
| 89 | + if score >= division.division then | |
| 90 | + divisionId = _id | |
| 91 | + else | |
| 92 | + break | |
| 93 | + end | |
| 94 | + end | |
| 95 | + return divisionId | |
| 96 | +end | |
| 97 | + | |
| 85 | 98 | function Role:calculatePvpHGift(division) | 
| 86 | 99 | local now = skynet.timex() | 
| 87 | 100 | local oldTime = self:getProperty("pvpHGTime") | ... | ... |