boxAdapt.lua 830 B

123456789101112131415161718192021222324252627282930313233343536
  1. -- 箱子配置
  2. local baseAdapt = require "base.baseAdapt"
  3. local root = {}
  4. ----------------------------------------
  5. -- 盲盒
  6. ----------------------------------------
  7. -- 箱子物品列表
  8. function root:blind_get_box_item_list(boxId)
  9. local confList = {}
  10. local conf = baseAdapt:getConfig("BlindBoxAwardConfig")
  11. for _, v in ipairs(conf) do
  12. if v.boxId == boxId then
  13. table.insert(confList, table.copy(v))
  14. end
  15. end
  16. return confList
  17. end
  18. -- 获取箱子信息
  19. function root:blind_get_box_key_info(boxId, key)
  20. local conf = baseAdapt:getConfig("BlindBoxConfig")
  21. for _, v in ipairs(conf) do
  22. if v.boxId == boxId then
  23. if is_empty(key) then
  24. return v
  25. else
  26. return v[key]
  27. end
  28. end
  29. end
  30. end
  31. return root