Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 6th, 2020 169 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_areas(cell, minrange, maxrange, @r_cells)
  2. {
  3.     while (minrange <= maxrange)
  4.     {
  5.         for (var cell_ in ALL_CIRCLES[cell][minrange])
  6.             if (!IS_LEEK[cell_])
  7.              push(r_cells, cell_);
  8.         minrange++;
  9.     }
  10. }
  11.  
  12. function get_lines(cell, i, maxrange, @r_cells)
  13. {
  14.     while (i <= maxrange)
  15.     {
  16.         for (var cell_ in ALL_LINES[cell][i])
  17.                 if (!IS_LEEK[cell_])
  18.                   push(r_cells, cell_);
  19.         i++;
  20.     }
  21. }
  22.  
  23. function get_cells_touse_tool_oncell(tool, cell)
  24. {
  25.     var cells = [];
  26.  
  27.     var minrange;
  28.     var maxrange;
  29.     var need_line;
  30.  
  31.     var r_cells = [];
  32.    
  33.     if (isWeapon(tool))
  34.     {
  35.         minrange = getWeaponMinRange(tool);
  36.         maxrange = getWeaponMaxRange(tool);
  37.         need_line = isInlineWeapon(tool);
  38.     }
  39.     else if (isChip(tool))
  40.     {
  41.         minrange = getChipMinRange(tool);
  42.         maxrange = getChipMaxRange(tool);
  43.         need_line = isInlineChip(tool);
  44.     }
  45.     if (need_line)
  46.         get_lines(cell, minrange, maxrange , r_cells);
  47.     else
  48.         get_areas(cell,  minrange,  maxrange, r_cells);
  49.     for (var cell_ in r_cells)
  50.     {
  51.         if(lineOfSight(cell, cell_ ) || tool == CHIP_SPARK)
  52.                 push(cells, cell_);
  53.     }
  54.     return(cells);
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top