MCPcopy Create free account
hub / github.com/crawl/crawl / cannot_use_schools

Function cannot_use_schools

crawl-ref/source/spl-util.cc:1919–1938  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1917 * @return Whether the player is unable use any of the given schools.
1918 */
1919bool 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/**

Callers 2

_get_spell_listFunction · 0.85

Calls 1

has_mutationMethod · 0.80

Tested by

no test coverage detected