Commit 0df83fa90cfe071a3afb211234ee114c4e1df4ac
1 parent
ab57e0ab
料理解锁bug
Showing
4 changed files
with
61 additions
and
24 deletions
Show diff stats
config/develop.lua
| 1 | 1 | include("basic.lua") |
| 2 | 2 | |
| 3 | -logd = 0 -- 是否开启日志 | |
| 3 | +logd = 1 -- 是否开启日志 | |
| 4 | 4 | thread = 4 |
| 5 | 5 | codeurl = "192.168.0.199:9090" |
| 6 | 6 | servId = 1 |
| ... | ... | @@ -20,4 +20,4 @@ redis_auth = nil |
| 20 | 20 | mysql_host = "127.0.0.1" |
| 21 | 21 | mysql_port = 3306 |
| 22 | 22 | mysql_user = "root" |
| 23 | -mysql_password = "123456" | |
| 24 | 23 | \ No newline at end of file |
| 24 | +mysql_password = "123456" | ... | ... |
src/actions/DinerAction.lua
| ... | ... | @@ -703,31 +703,41 @@ function _M.addWantFoodRpc(agent , data) |
| 703 | 703 | if #ids > buildingData.business then return 2 end |
| 704 | 704 | |
| 705 | 705 | local had = {} |
| 706 | - for _, itemId in ipairs(ids) do | |
| 707 | - if had[itemId] then return end | |
| 708 | - had[itemId] = 1 | |
| 709 | - local foodData = csvdb["diner_materialCsv"][itemId] | |
| 710 | - if not foodData then return 3 end | |
| 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 | |
| 706 | + -- 遍历adv_potion | |
| 707 | + for potionId, potionData in pairs(csvdb["adv_potionCsv"]) do | |
| 708 | + local potionLv = role:getPotionLevel(potionId) | |
| 709 | + if potionLv > 0 then | |
| 710 | + local cfg = potionData[potionLv] | |
| 711 | + if cfg then | |
| 712 | + local cost = cfg.material:toNumMap() | |
| 713 | + for id, _ in pairs(cost) do | |
| 714 | + local itemData = csvdb["itemCsv"][id] | |
| 715 | + local mData = csvdb["diner_materialCsv"][id] | |
| 716 | + if itemData.type == ItemType.Cuisine and not had[id] then | |
| 717 | + had[id] = true | |
| 718 | + end | |
| 719 | + end | |
| 725 | 720 | end |
| 726 | - if not role:checkHangPass(foodData.unlock) then | |
| 727 | - return 4 | |
| 721 | + end | |
| 722 | + end | |
| 723 | + -- 遍历dish | |
| 724 | + for id, lv in pairs(role.dinerData:getProperty("dishTree"):toNumMap()) do | |
| 725 | + if csvdb["diner_dishCsv"][id] and csvdb["diner_dishCsv"][id][lv] then | |
| 726 | + local data = csvdb["diner_dishCsv"][id][lv] | |
| 727 | + local costs = data.material:toNumMap() | |
| 728 | + for id, _ in pairs(costs) do | |
| 729 | + local itemData = csvdb["itemCsv"][id] | |
| 730 | + local mData = csvdb["diner_materialCsv"][id] | |
| 731 | + if itemData.type == ItemType.Cuisine and not had[id] then | |
| 732 | + had[id] = true | |
| 733 | + end | |
| 728 | 734 | end |
| 729 | 735 | end |
| 730 | 736 | end |
| 737 | + for _, itemId in ipairs(ids) do | |
| 738 | + if not had[itemId] then return 3 end | |
| 739 | + end | |
| 740 | + | |
| 731 | 741 | local gfood = {} |
| 732 | 742 | for slot, itemId in ipairs(ids) do |
| 733 | 743 | gfood[slot] = {id = itemId, st = skynet.timex()} | ... | ... |
src/models/RolePlugin.lua
| ... | ... | @@ -2757,6 +2757,33 @@ function RolePlugin.bind(Role) |
| 2757 | 2757 | return towerBnous[SystemBnousType.SweepReward] or {} |
| 2758 | 2758 | end |
| 2759 | 2759 | |
| 2760 | + function Role:getPotionLevel(id) | |
| 2761 | + local level = self.dinerData:getProperty("dishTree"):getv(id, 1) | |
| 2762 | + local talentSet = csvdb["diner_talentCsv"][id] | |
| 2763 | + if not talentSet then return 0 end | |
| 2764 | + local talentData = talentSet[level] | |
| 2765 | + if not talentData then return 0 end | |
| 2766 | + | |
| 2767 | + if talentData.pointFront == "" then | |
| 2768 | + if talentData.levelFront ~= "" and not self:checkHangPass(tonumber(talentData.levelFront)) then | |
| 2769 | + if level == 0 then return 0 end | |
| 2770 | + end | |
| 2771 | + return level | |
| 2772 | + end | |
| 2773 | + | |
| 2774 | + if talentData.levelFront ~= "" and not self:checkHangPass(tonumber(talentData.levelFront)) then | |
| 2775 | + if level == 0 then return 0 end | |
| 2776 | + end | |
| 2777 | + | |
| 2778 | + for preId, needV in pairs(talentData.pointFront:toNumMap()) do | |
| 2779 | + if self.dinerData:getProperty("dishTree"):getv(preId, 0) < needV then | |
| 2780 | + if level == 0 then return 0 end | |
| 2781 | + if level == 1 then return 0 end | |
| 2782 | + end | |
| 2783 | + end | |
| 2784 | + return level | |
| 2785 | + end | |
| 2786 | + | |
| 2760 | 2787 | end |
| 2761 | 2788 | |
| 2762 | 2789 | return RolePlugin |
| 2763 | 2790 | \ No newline at end of file | ... | ... |