Commit 5ef0f2c7546e69f5884de79ded06560d53f72c51

Authored by jiyue
2 parents 057afd89 21c09fa2

Merge branch 'cn/develop' into cn/publish/preview

src/actions/RadioAction.lua
... ... @@ -113,14 +113,35 @@ function _M.startQuestRpc(agent, data)
113 113 local msg = MsgPack.unpack(data)
114 114 local id = msg.id
115 115 local heros = msg.heros
116   - local result = {}
117   - local radioTask = role:getProperty("radioTask")
118   - if table.numbers(radioTask) >= getQuestMax(role) then
119   - return 1
120   - end
  116 +
121 117 -- check id
122 118 local config = csvdb["crusadeCsv"][id]
123   - if not config then return 2 end
  119 + if not config then return 1 end
  120 +
  121 + local radioTask = role:getProperty("radioTask")
  122 +
  123 + local getActIDs = function ()
  124 + local actids = {}
  125 + for _, v in pairs(radioTask or {}) do
  126 + actids[v.actid] = (actids[v.actid] or 0) + 1
  127 + end
  128 + return actids
  129 + end
  130 +
  131 + local actids = getActIDs()
  132 + if config.activity_ctrl_id == 0 then
  133 + --非活动 判断数量
  134 + if (actids[config.activity_ctrl_id] or 0) >= getQuestMax(role) then
  135 + return 2
  136 + end
  137 +
  138 + else
  139 + --活动 同时只能有一个存在
  140 + if actids[config.activity_ctrl_id] >= 1 then
  141 + return 5
  142 + end
  143 + end
  144 +
124 145 if not role:checkHangPass(config.unlock) then return 3 end
125 146 if radioTask[id] then return 4 end
126 147 -- check hero
... ... @@ -172,6 +193,7 @@ function _M.startQuestRpc(agent, data)
172 193 local taskData = {}
173 194 taskData["time"] = skynet.timex() + config.time + timeSub
174 195 taskData["heros"] = heros
  196 + taskData["actid"] = config.activity_ctrl_id
175 197 radioTask[id] = taskData
176 198 role:updateProperty({field="radioTask", value=radioTask, notNotify=true})
177 199  
... ...
src/models/Activity.lua
... ... @@ -1484,7 +1484,7 @@ activityFunc[Activity.ActivityType.RadioTask] = {
1484 1484 -- check id
1485 1485 local config = csvdb["crusadeCsv"][id]
1486 1486 if config then
1487   - if config.actid == actid then
  1487 + if config.activity_ctrl_id == actid then
1488 1488 radioTask[id] = nil
1489 1489  
1490 1490 if not task then return 4 end
... ...
src/models/RolePlugin.lua
... ... @@ -2177,6 +2177,16 @@ function RolePlugin.bind(Role)
2177 2177 return (hangPass[diff] or 0) >= carbonId
2178 2178 end
2179 2179  
  2180 + function Role:checkActivityBattlePass(battleId)
  2181 + local isOpen, actId = self.activity:isOpen("ChallengeLevel")
  2182 + if not isOpen then return end
  2183 +
  2184 + local actData = self.activity:getActData("ChallengeLevel") or {}
  2185 + local battleInfo = actData[battleId] or {}
  2186 +
  2187 + return battleInfo["star"] ~= nil
  2188 + end
  2189 +
2180 2190 function Role:checkAdvChapterPass(chapterId)
2181 2191 local chapterData = csvdb["adv_chapterCsv"][chapterId]
2182 2192 local advPass = self:getProperty("advPass") or {}
... ...