Commit aa74d6ef94bd86a40f794c93e9dee07a23d74c1c

Authored by zhouhaihai
1 parent 70aa8660

掉落反馈

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