Commit ede282c0b0ae0fcd7f23aa5bb48dafe4e16fb933

Authored by liuzujun
1 parent c8c76cda

付费签到规则改为按登录天数计算进度, 世界boss

src/actions/ActivityAction.lua
... ... @@ -192,13 +192,13 @@ function _M.actPaySignRpc(agent, data)
192 192 local open, actId = role.activity:isOpen("PaySignIn")
193 193 if not open then return 2 end
194 194  
195   - local diffDay = diffFromTs(ts) + 1
  195 + --local diffDay = diffFromTs(ts) + 1
196 196  
197 197 local curData = role.activity:getActData("PaySignIn")
198 198 if not curData then return 3 end
199 199 local reward, change = {}
200 200 for day, csvData in ipairs(csvdb["pay_signInCsv"]) do
201   - if day <= diffDay and day == dayIndex then
  201 + if day <= (curData[0] or 0) and day == dayIndex then
202 202 if not curData[day] then
203 203 curData[day] = 1
204 204 -- 奖励
... ... @@ -675,8 +675,6 @@ function _M.endBattleRpc(agent, data)
675 675 role:updateRankCommon(RANK_TYPE.ActBattleBoss, rankVal)
676 676 end
677 677 end
678   - actData[id] = battleInfo
679   - role.activity:updateActData("ChallengeLevel", actData)
680 678  
681 679 if (oldStarNum == 0 and newStarNum > 0) or battleCfg.rank ~= 0 then
682 680 reward = battleCfg.item_clear:toNumMap()
... ... @@ -706,6 +704,8 @@ function _M.endBattleRpc(agent, data)
706 704 if battleCfg.worldBoss_award ~= 0 and msg.point then
707 705 battleInfo["bossP"] = (battleInfo["bossP"] or 0) + msg.point
708 706 end
  707 + actData[id] = battleInfo
  708 + role.activity:updateActData("ChallengeLevel", actData)
709 709  
710 710 reward, change = role:award(reward, {log = {desc = "actBattle", int1 = actid, int2 = newStarNum}})
711 711  
... ... @@ -834,6 +834,10 @@ function _M.bossRewardRpc(agent, data)
834 834 if bossPoint < 1 then return 7 end
835 835  
836 836 local bossRecord = battleInfo["bossR"] or ""
  837 + local r = string.char(string.getbit(bossRecord, index))
  838 + if r == "1" then
  839 + return 9
  840 + end
837 841 local ok = false
838 842 if #preList == 0 then
839 843 ok = true
... ... @@ -849,6 +853,7 @@ function _M.bossRewardRpc(agent, data)
849 853 if not ok then return 8 end
850 854  
851 855 battleInfo["bossR"] = string.setbit(bossRecord, index)
  856 + battleInfo["bossP"] = bossPoint - 1
852 857 actData[id] = battleInfo
853 858 role.activity:updateActData("ChallengeLevel", actData)
854 859  
... ...
1   -Subproject commit 76400551f6a7539d383e1f52e524b613eba61c90
  1 +Subproject commit 6b8861395586f7ac72eba0deacd3e535333ac86e
... ...
src/models/Activity.lua
... ... @@ -58,7 +58,7 @@ Activity.schema = {
58 58 actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time}
59 59 round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum}
60 60 act4 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动
61   - act6 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动
  61 + act6 = {"table", {}}, -- {0 = day, 1 = 1, 2 = 1} == 付费签到活动
62 62 act8 = {"number", 0}, -- 充值返利
63 63  
64 64 act11 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励
... ... @@ -386,6 +386,11 @@ activityFunc[Activity.ActivityType.PaySignIn] = {
386 386 ["init"] = function(self, actType, isCrossDay, notify)
387 387 self:updateActData(actType, {}, not notify)
388 388 end,
  389 + ["crossDay"] = function(self, actType, notify)
  390 + local curData = self:getActData(actType)
  391 + curData[0] = (curData[0] or 0) + 1
  392 + self:updateActData(actType, curData, not notify)
  393 + end,
389 394 ["close"] = function(self, actType, notify)
390 395 self.owner.storeData:SetActGoodsFlag("paySignIn", 0)
391 396  
... ...
src/models/Store.lua
... ... @@ -392,6 +392,9 @@ function Store:onBuyPaySignCard(dur)
392 392 curTs = getServerOpenTs()
393 393  
394 394 self:SetActGoodsFlag("paySignIn", curTs)
  395 + local actData = self.owner.activity:getActData("PaySignIn")
  396 + actData[0] = 1
  397 + self.owner.activity:updateActData("PaySignIn", actData)
395 398  
396 399 --local actGoodsFlag = self:getProperty("actGoodsFlag") or {}
397 400 --local goodsIndex = GetActGoodsIndex("paySignIn")
... ...