Advertisement
Guest User

Untitled

a guest
May 25th, 2019
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. --游戏循环1.2——抽卡
  2. function PrepareARound(teamid)
  3.     Draw5ChessAndShow(teamid, false)
  4. end
  5.  
  6. --游戏循环1.2.x——抽卡用到的方法(第二个参数可以指定下一个棋子)
  7. function Draw5ChessAndShow(team_id, unlock)
  8.     --(略)
  9.     --把上次剩的洗回棋库
  10.     h.ban_chess_list = {}
  11.     if h.curr_chess_table ~= nil then
  12.         for _,chess in pairs(h.curr_chess_table) do
  13.             if chess ~= nil then
  14.                 table.insert(h.ban_chess_list,chess)
  15.                 AddAChessToChessPool(chess)
  16.             end
  17.         end
  18.     end
  19.     h.curr_chess_table = {}
  20.     --抽!
  21.     local cards,curr_chess_table = RandomNDrawChessNew(team_id,5)
  22.     h.curr_chess_table = curr_chess_table
  23.     --(略)
  24. end
  25.  
  26. function RandomNDrawChessNew(team_id,n)
  27.     --(略)
  28.     while chess_count < n do
  29.         local new_chess = RandomDrawChessNew(team_id)
  30.         --(略)
  31.     end
  32.     return new_chess_list_str,new_chess_list_table
  33. end
  34.  
  35. function RandomDrawChessNew(team_id)
  36.     --(略)
  37.     this_chess = DrawAChessFromChessPool(chess_level, table_11chess, h.ban_chess_list)
  38.     return this_chess
  39. end
  40.  
  41. function DrawAChessFromChessPool(cost, table_11chess, table_ban_chess)
  42.     --(略)
  43.     if FindValueInTable(table_ban_chess,chess_name) == true then
  44.         return nil
  45.     end
  46.     --(略)
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement