Commit f4bbb20842c1cf202874f5665a4c1f7e3780a135
1 parent
0889982f
餐厅任务解锁
Showing
2 changed files
with
19 additions
and
2 deletions
Show diff stats
src/actions/DinerAction.lua
| @@ -565,8 +565,17 @@ function _M.refreshTaskRpc( agent, data ) | @@ -565,8 +565,17 @@ function _M.refreshTaskRpc( agent, data ) | ||
| 565 | end | 565 | end |
| 566 | 566 | ||
| 567 | local pool = {} | 567 | local pool = {} |
| 568 | + | ||
| 569 | + local dishTree = role.dinerData:getProperty("dishTree") | ||
| 568 | for id, temp in pairs(taskData) do | 570 | for id, temp in pairs(taskData) do |
| 569 | - if not hadTask[id] then | 571 | + local unlock = true |
| 572 | + for _, front in ipairs(temp.front:toArray(true, "=")) do | ||
| 573 | + if dishTree:getv(front, 0) == 0 then | ||
| 574 | + unlock = false | ||
| 575 | + break | ||
| 576 | + end | ||
| 577 | + end | ||
| 578 | + if not hadTask[id] and unlock then | ||
| 570 | table.insert(pool, temp) | 579 | table.insert(pool, temp) |
| 571 | end | 580 | end |
| 572 | end | 581 | end |
src/models/Diner.lua
| @@ -92,8 +92,16 @@ function Diner:refreshDailyData(notify) | @@ -92,8 +92,16 @@ function Diner:refreshDailyData(notify) | ||
| 92 | local taskData = csvdb["diner_questCsv"][taskLevel] | 92 | local taskData = csvdb["diner_questCsv"][taskLevel] |
| 93 | if not taskData then return end | 93 | if not taskData then return end |
| 94 | local pool = {} | 94 | local pool = {} |
| 95 | + local dishTree = self:getProperty("dishTree") | ||
| 95 | for id, temp in pairs(taskData) do | 96 | for id, temp in pairs(taskData) do |
| 96 | - if not hadTask[id] then | 97 | + local unlock = true |
| 98 | + for _, front in ipairs(temp.front:toArray(true, "=")) do | ||
| 99 | + if dishTree:getv(front, 0) == 0 then | ||
| 100 | + unlock = false | ||
| 101 | + break | ||
| 102 | + end | ||
| 103 | + end | ||
| 104 | + if not hadTask[id] and unlock then | ||
| 97 | table.insert(pool, temp) | 105 | table.insert(pool, temp) |
| 98 | end | 106 | end |
| 99 | end | 107 | end |