Commit ede282c0b0ae0fcd7f23aa5bb48dafe4e16fb933

Authored by liuzujun
1 parent c8c76cda

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

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