Commit 19d3f079b3d640645385ec4f0682d53ca0ded6bc
Merge branch 'develop' of 120.26.43.151:wasteland/server into develop
Showing
5 changed files
with
28 additions
and
8 deletions
Show diff stats
src/actions/RoleAction.lua
... | ... | @@ -114,6 +114,19 @@ function _M.loginRpc( agent, data ) |
114 | 114 | role:setBan(0) |
115 | 115 | end |
116 | 116 | end |
117 | + if msg.deviceMode then | |
118 | + local deviceMode = tostring(msg.deviceMode) | |
119 | + if self:getProperty("dmode") ~= deviceMode then | |
120 | + self:setProperty("dmode", deviceMode) | |
121 | + end | |
122 | + end | |
123 | + if msg.device then | |
124 | + local device = tostring(msg.device) | |
125 | + if self:getProperty("device") ~= device then | |
126 | + self:setProperty("device", device) | |
127 | + end | |
128 | + end | |
129 | + | |
117 | 130 | SERV_OPEN = redisproxy:hget("autoincrement_set", "server_start") |
118 | 131 | |
119 | 132 | role:changeStructVersion() -- 数据结构 版本更新 |
... | ... | @@ -287,6 +300,7 @@ function _M.createRpc(agent, data) |
287 | 300 | name = roleName, |
288 | 301 | uname = msg.uname or "", |
289 | 302 | device = tostring(msg.device) |
303 | + dmode = msg.deviceMode and tostring(msg.deviceMode) or nil | |
290 | 304 | }) |
291 | 305 | |
292 | 306 | if newRole:create() then | ... | ... |
src/adv/AdvPassive.lua
... | ... | @@ -300,8 +300,8 @@ function Passive:canEffect(effType, effValue) |
300 | 300 | return |
301 | 301 | end |
302 | 302 | --禁用被动技 |
303 | - local count, bc = self.owner:getDisablePassiveCount() | |
304 | - if bc > 0 and (count == 0 or self.owner:getPassiveIdx(self) <= count) then | |
303 | + local count = self.owner:getDisablePassiveCount() | |
304 | + if count and (count == 0 or self.owner:getPassiveIdx(self) <= count) then | |
305 | 305 | return |
306 | 306 | end |
307 | 307 | return true |
... | ... | @@ -466,7 +466,8 @@ function Passive:effect8(dropId) |
466 | 466 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) |
467 | 467 | end |
468 | 468 | local item = dropData["range"]:randWeight(true) |
469 | - self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}}) | |
469 | + self.owner.battle.adv:backReward(self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}}), {roomId = self.owner.roomId, blockId = self.owner.blockId}) | |
470 | + | |
470 | 471 | end |
471 | 472 | |
472 | 473 | --9=直接获得item(可在结算触发时使用) |
... | ... | @@ -480,7 +481,7 @@ function Passive:effect9(itemId, triggerPms, ratio, max) |
480 | 481 | return |
481 | 482 | end |
482 | 483 | if not cond then return end |
483 | - self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}, {log = {desc = "passive", int1 = self.id}}) | |
484 | + self.owner.battle.adv:backReward(self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}, {log = {desc = "passive", int1 = self.id}}), {roomId = self.owner.roomId, blockId = self.owner.blockId}) | |
484 | 485 | end |
485 | 486 | |
486 | 487 | --10=战斗额外掉落次数 | ... | ... |
src/adv/AdvPlayer.lua
... | ... | @@ -122,14 +122,16 @@ function BaseObject:getPassiveIdx(passive) |
122 | 122 | end |
123 | 123 | |
124 | 124 | function BaseObject:getDisablePassiveCount() |
125 | - local count, bc = 0, 0 | |
125 | + local count | |
126 | 126 | for _, buff in ipairs(self.buffs) do |
127 | 127 | if not buff.isDel and buff:getType() == Buff.DISABLE_BUFF then |
128 | - count = count + buff:effect() | |
129 | - bc = bc + 1 | |
128 | + if buff:effect() == 0 then | |
129 | + return 0 | |
130 | + end | |
131 | + count = (count or 0) + buff:effect() | |
130 | 132 | end |
131 | 133 | end |
132 | - return count, bc | |
134 | + return count | |
133 | 135 | end |
134 | 136 | |
135 | 137 | function BaseObject:addBuff(buffId, releaser) | ... | ... |
src/models/Role.lua
... | ... | @@ -38,6 +38,8 @@ Role.schema = { |
38 | 38 | headId = {"number", globalCsv.defaultHead}, |
39 | 39 | sid = {"number", 0}, |
40 | 40 | device = {"string", ""}, |
41 | + dmode = {"string", ""}, | |
42 | + lday = {"string", 0}, | |
41 | 43 | banTime = {"number", 0}, |
42 | 44 | banType = {"number", 0}, |
43 | 45 | heartWarning = {"number", 0}, | ... | ... |
src/models/RoleTimeReset.lua
... | ... | @@ -13,6 +13,7 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) |
13 | 13 | self.storeData:onCrossDay() |
14 | 14 | |
15 | 15 | self:setProperty("dTask", {}) |
16 | + self:incrProperty("lday", 1) | |
16 | 17 | self:advRandomSupportEffect(not notify) |
17 | 18 | |
18 | 19 | self:checkExpireItem(not notify) | ... | ... |