Mid-Autumn Festival gambling game Tomorrow is the Mid-Autumn festival, and in the spirit of that holiday, I will introduce a gambling game that we (people from Xiamen) play during the holiday!
Rules
The game is played with six 6-sided dice. Different combinations of numbers have different ranks, with a special emphasis on fours and ones. Your job is to write a program/function that will rank the hand, given a roll of 6 dice. Here are the ranks (I've modified/simplified the rules a bit):

 I guess only Chinese people can do this challenge!  Okay, fine, here are some English explanations.

0: 4 fours and 2 ones.
1: 6 fours.
2: 6 ones.
3: 6 of any kind except fours and ones.
4: 5 fours.
5: 5 of any kind except for fours.
6: 4 fours.
7: Straight. (1-6)
8: 3 fours.
9: 4 of any kind except 4.
10: 2 fours.
11: 1 four.
12: Nothing.

Input
6 numbers, an array of 6 numbers, or a string of 6 numbers that represent the values of the 6 dice rolls from 1-6
Output
Your program/function may return/output anything to indicate the rank, as long as each rank is indicated by one output and vice versa. Ex. Using the numbers 0-12, 1-13, etc.
Examples(Using 0-12 as the outputs)
[1,1,1,1,1,1]-&gt;2
[1,4,4,4,1,4]-&gt;0
[3,6,5,1,4,2]-&gt;7
[1,2,3,5,6,6]-&gt;12
[3,6,3,3,3,3]-&gt;5
[4,5,5,5,5,5]-&gt;5

This is code-golf, so shortest byte count wins!
JavaScript (ES6), 88 bytes

a=&gt;a.map(o=n=&gt;[x=o[n]=-~o[n],6,,,21,9,8^o[1]][a=x&lt;a?a:x])[5]|[,1,4,5,o[1]&amp;2|8,2,4][o[4]]


Try it online!
or Test all possible rolls!

Outputs an integer according to the following mapping:

 Rank | Output       Rank | Output
------+--------     ------+--------
   0  |  31            7  |   7
   1  |  12            8  |   5
   2  |  14            9  |  21
   3  |   8           10  |   4
   4  |  11           11  |   1
   5  |   9           12  |   0
   6  |  29


How?

Method

The output is computed by performing a bitwise OR between:


a bitmask based on \$F\$: the number of 4's
a bitmask based on \$M\$: the maximum number of occurrences of the same dice


Exceptions:


When \$F=4\$: we use a special bitmask \$4b\$ when the two other dice are 1's, or a default bitmask \$4a\$ otherwise.
When \$M=6\$: we use a special bitmask \$6b\$ when we have a six-of-a-kind of 1's, or a default bitmask \$6a\$ otherwise.


Table

Valid combinations of \$F\$ and \$M\$ are highlighted in bold and blue in the following table.

$$\begin{array}{c|c|cccccccc}
&amp;F&amp;0&amp;1&amp;2&amp;3&amp;4a&amp;4b&amp;5&amp;6\\
\hline
M&amp;\text{OR}&amp;0&amp;1&amp;4&amp;5&amp;8&amp;10&amp;2&amp;4\\
\hline
1&amp;6&amp;\color{grey}{6}&amp;\color{blue}{\textbf{7}}&amp;\color{grey}{6}&amp;\color{grey}{7}&amp;\color{grey}{14}&amp;\color{grey}{14}&amp;\color{grey}{6}&amp;\color{grey}{6}\\
2&amp;0&amp;\color{blue}{\textbf{0}}&amp;\color{blue}{\textbf{1}}&amp;\color{blue}{\textbf{4}}&amp;\color{grey}{5}&amp;\color{grey}{8}&amp;\color{grey}{10}&amp;\color{grey}{2}&amp;\color{grey}{4}\\
3&amp;0&amp;\color{blue}{\textbf{0}}&amp;\color{blue}{\textbf{1}}&amp;\color{blue}{\textbf{4}}&amp;\color{blue}{\textbf{5}}&amp;\color{grey}{8}&amp;\color{grey}{10}&amp;\color{grey}{2}&amp;\color{grey}{4}\\
4&amp;21&amp;\color{blue}{\textbf{21}}&amp;\color{blue}{\textbf{21}}&amp;\color{blue}{\textbf{21}}&amp;\color{grey}{21}&amp;\color{blue}{\textbf{29}}&amp;\color{blue}{\textbf{31}}&amp;\color{grey}{23}&amp;\color{grey}{21}\\
5&amp;9&amp;\color{blue}{\textbf{9}}&amp;\color{blue}{\textbf{9}}&amp;\color{grey}{13}&amp;\color{grey}{13}&amp;\color{grey}{9}&amp;\color{grey}{11}&amp;\color{blue}{\textbf{11}}&amp;\color{grey}{13}\\
6a&amp;8&amp;\color{blue}{\textbf{8}}&amp;\color{grey}{9}&amp;\color{grey}{12}&amp;\color{grey}{13}&amp;\color{grey}{8}&amp;\color{grey}{10}&amp;\color{grey}{10}&amp;\color{blue}{\textbf{12}}\\
6b&amp;14&amp;\color{blue}{\textbf{14}}&amp;\color{grey}{15}&amp;\color{grey}{14}&amp;\color{grey}{15}&amp;\color{grey}{14}&amp;\color{grey}{14}&amp;\color{grey}{14}&amp;\color{grey}{14}\\
\end{array}$$

All other combinations (in gray) can't possibly happen. For instance, if we have three 4's, we must have \$M\ge3\$. But because there are only 3 other remaining dice in such a roll, we also have \$M\le3\$. So, there's only one possible value of \$M\$ for \$F=3\$.

Example

If we have a straight, each dice appears exactly once. So we have \$M=1\$ and \$F=1\$. Using the bitmasks described in the above table, this leads to:

$$6 \text{ OR } 1 = 7$$

There is another \$7\$ in the table, but it's invalid. Therefore, a straight is uniquely identified by \$7\$.

Commented

a =&gt;                   // a[] = input array, reused as an integer to keep track of the
  a.map(               //       maximum number of occurrences of the same dice (M)
    o =                // o = object used to count the number of occurrences of each dice
    n =&gt;               // for each dice n in a[]:
    [                  //   this is the lookup array for M-bitmasks:
      x =              //     x = o[n] = number of occurrences of the current dice
        o[n] = -~o[n], //     increment o[n] (we can't have M = 0, so this slot is not used)
      6,               //     M = 1 -&gt; bitmask = 6
      ,                //     M = 2 -&gt; bitmask = 0
      ,                //     M = 3 -&gt; bitmask = 0
      21,              //     M = 4 -&gt; bitmask = 21
      9,               //     M = 5 -&gt; bitmask = 9
      8 ^ o[1]         //     M = 6 -&gt; bitmask = 14 for six 1's, or 8 otherwise
    ][a =              //   take the entry corresponding to M (stored in a)
        x &lt; a ? a : x] //   update a to max(a, x)
  )[5]                 // end of map(); keep the last value
  |                    // do a bitwise OR with the second bitmask
  [                    // this is the lookup array for F-bitmasks:
    ,                  //   F = 0 -&gt; bitmask = 0
    1,                 //   F = 1 -&gt; bitmask = 1
    4,                 //   F = 2 -&gt; bitmask = 4
    5,                 //   F = 3 -&gt; bitmask = 5
    o[1] &amp; 2 | 8,      //   F = 4 -&gt; bitmask = 10 if we also have two 1's, 8 otherwise
    2,                 //   F = 5 -&gt; bitmask = 2
    4                  //   F = 6 -&gt; bitmask = 4
  ][o[4]]              // take the entry corresponding to F (the number of 4's)