* Are some subset of the given schools unusable by the player? * (Due to Sacrifice Arcana) * * @param schools A bitfield containing a union of spschools. * @return Whether the player is unable use any of the given schools. */
| 1917 | * @return Whether the player is unable use any of the given schools. |
| 1918 | */ |
| 1919 | bool cannot_use_schools(spschools_type schools) |
| 1920 | { |
| 1921 | COMPILE_CHECK(ARRAYSZ(arcana_sacrifice_map) == SPSCHOOL_LAST_EXPONENT + 1); |
| 1922 | |
| 1923 | // iter over every school |
| 1924 | for (int i = 0; i <= SPSCHOOL_LAST_EXPONENT; i++) |
| 1925 | { |
| 1926 | // skip schools not in the provided set |
| 1927 | const auto school = spschools_type::exponent(i); |
| 1928 | if (!(schools & school)) |
| 1929 | continue; |
| 1930 | |
| 1931 | // check if the player has this school locked out |
| 1932 | const mutation_type lockout_mut = arcana_sacrifice_map[i]; |
| 1933 | if (you.has_mutation(lockout_mut)) |
| 1934 | return true; |
| 1935 | } |
| 1936 | |
| 1937 | return false; |
| 1938 | } |
| 1939 | |
| 1940 | |
| 1941 | /** |
no test coverage detected