Commit e6845afa9dd8a67632762c9572c391b02766fdf2
1 parent
2a542865
餐厅食材供应商供应食材条件调整
Showing
2 changed files
with
34 additions
and
1 deletions
Show diff stats
src/actions/CarAction.lua
... | ... | @@ -13,9 +13,28 @@ function _M.makePotionRpc( agent, data ) |
13 | 13 | local count = msg.count |
14 | 14 | if count < 1 then return 0 end |
15 | 15 | local potionBag = role:getProperty("potionBag") |
16 | - local potionLv = role.dinerData:getProperty("dishTree"):getv(potionId, 1) | |
16 | + local dishTree = role.dinerData:getProperty("dishTree") | |
17 | + local potionLv = dishTree:getv(potionId, 1) | |
17 | 18 | if potionLv < 1 then return 1 end |
18 | 19 | |
20 | + local talentSet = csvdb["diner_talentCsv"][potionId] | |
21 | + if not talentSet then | |
22 | + return 10 | |
23 | + end | |
24 | + | |
25 | + local talentData = talentSet[potionLv] | |
26 | + if not talentData then | |
27 | + return 11 | |
28 | + end | |
29 | + local limit = talentData.pointFront:toNumMap() | |
30 | + for k,v in pairs(limit) do | |
31 | + local lv = dishTree:getv(k, 0) | |
32 | + if lv < v then | |
33 | + return 12 | |
34 | + end | |
35 | + end | |
36 | + | |
37 | + | |
19 | 38 | local potionSet = csvdb["adv_potionCsv"][potionId] |
20 | 39 | if not potionSet then return 2 end |
21 | 40 | ... | ... |
src/actions/DinerAction.lua
... | ... | @@ -709,6 +709,20 @@ function _M.addWantFoodRpc(agent , data) |
709 | 709 | local foodData = csvdb["diner_materialCsv"][itemId] |
710 | 710 | if not foodData then return 3 end |
711 | 711 | if foodData.unlock ~= 0 then |
712 | + -- 遍历adv_potion | |
713 | + for potionId, _ in pairs(csvdb["adv_potionCsv"]) do | |
714 | + local potionLv = role.dinerData:getProperty("dishTree"):getv(potionId, 0) | |
715 | + if potionLv < 1 then return 4 end | |
716 | + | |
717 | + local potionSet = csvdb["adv_potionCsv"][potionId] | |
718 | + if not potionSet then return 5 end | |
719 | + | |
720 | + local potionData = potionSet[potionLv] | |
721 | + if not potionData then return 6 end | |
722 | + | |
723 | + local cost = potionData.material:toNumMap() | |
724 | + if not cost[itemId] then return 7 end | |
725 | + end | |
712 | 726 | if not role:checkHangPass(foodData.unlock) then |
713 | 727 | return 4 |
714 | 728 | end | ... | ... |