| 1855 | } |
| 1856 | |
| 1857 | bool check_transform_into(transformation which_trans, bool involuntary, |
| 1858 | const item_def* talisman) |
| 1859 | { |
| 1860 | |
| 1861 | if (!involuntary && talisman && you.active_talisman() |
| 1862 | && !check_warning_inscriptions(*you.active_talisman(), OPER_REMOVE)) |
| 1863 | { |
| 1864 | canned_msg(MSG_OK); |
| 1865 | return false; |
| 1866 | } |
| 1867 | if (!involuntary && talisman && you.active_talisman() != talisman |
| 1868 | && !check_warning_inscriptions(*talisman , OPER_PUTON)) |
| 1869 | { |
| 1870 | canned_msg(MSG_OK); |
| 1871 | return false; |
| 1872 | } |
| 1873 | |
| 1874 | const string reason = cant_transform_reason(which_trans, involuntary, true); |
| 1875 | if (!reason.empty()) |
| 1876 | { |
| 1877 | if (!involuntary) |
| 1878 | mpr(reason); |
| 1879 | return false; |
| 1880 | } |
| 1881 | |
| 1882 | // XXX: This is left out of cant_transform_reason because it can involve |
| 1883 | // melding and unwinding the player's entire inventory, which feels a |
| 1884 | // bit heavyweight for item_is_useless() |
| 1885 | const auto feat = env.grid(you.pos()); |
| 1886 | if (!involuntary && feat_dangerous_for_form(which_trans, feat, talisman)) |
| 1887 | { |
| 1888 | mprf("Transforming right now would cause you to %s!", |
| 1889 | feat == DNGN_DEEP_WATER ? "drown" : "burn"); |
| 1890 | return false; |
| 1891 | } |
| 1892 | |
| 1893 | if (!involuntary && get_form(which_trans)->mult_hp(100) < 90) |
| 1894 | { |
| 1895 | if (!yesno("This transformation would significantly lower your maximum hit points. " |
| 1896 | "Transform anyway?", true, 'n')) |
| 1897 | { |
| 1898 | return false; |
| 1899 | } |
| 1900 | } |
| 1901 | |
| 1902 | return true; |
| 1903 | } |
| 1904 | |
| 1905 | static void _print_death_brand_changes(item_def *weapon, bool entering_death) |
| 1906 | { |
no test coverage detected