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

Function cant_transform_reason

crawl-ref/source/transform.cc:1832–1855  ·  view source on GitHub ↗

* Is the player unable to enter the given form? If so, why? */

Source from the content-addressed store, hash-verified

1830 * Is the player unable to enter the given form? If so, why?
1831 */
1832string cant_transform_reason(transformation which_trans,
1833 bool involuntary, bool temp)
1834{
1835 if (!involuntary && you.has_mutation(MUT_NO_FORMS))
1836 return "You have sacrificed the ability to change form!";
1837
1838 // the undead cannot enter most forms.
1839 if (lifeless_prevents_form(which_trans))
1840 return "Your unliving flesh cannot be transformed in this way.";
1841
1842 if (SP_GARGOYLE == you.species && which_trans == transformation::statue)
1843 return "You're already a statue.";
1844
1845 if (!temp)
1846 return "";
1847
1848 if (you.transform_uncancellable && which_trans != transformation::slaughter)
1849 return "You are stuck in your current form!";
1850
1851 if (which_trans == transformation::death && you.duration[DUR_DEATHS_DOOR])
1852 return "You cannot mock death while in death's door.";
1853
1854 return "";
1855}
1856
1857bool check_transform_into(transformation which_trans, bool involuntary,
1858 const item_def* talisman)

Callers 6

check_transform_intoFunction · 0.85
polymorphMethod · 0.85
_check_ability_possibleFunction · 0.85
can_quaffMethod · 0.85
cannot_evoke_item_reasonFunction · 0.85

Calls 2

lifeless_prevents_formFunction · 0.85
has_mutationMethod · 0.80

Tested by

no test coverage detected