| 3978 | } |
| 3979 | |
| 3980 | bool enough_hp(int minimum, bool suppress_msg, bool abort_macros) |
| 3981 | { |
| 3982 | ASSERT(!crawl_state.game_is_arena()); |
| 3983 | |
| 3984 | if (you.duration[DUR_DEATHS_DOOR]) |
| 3985 | { |
| 3986 | if (!suppress_msg) |
| 3987 | mpr("You cannot pay life while functionally dead."); |
| 3988 | |
| 3989 | if (abort_macros) |
| 3990 | { |
| 3991 | crawl_state.cancel_cmd_again(); |
| 3992 | crawl_state.cancel_cmd_repeat(); |
| 3993 | } |
| 3994 | return false; |
| 3995 | } |
| 3996 | |
| 3997 | // We want to at least keep 1 HP. -- bwr |
| 3998 | if (you.hp < minimum + 1) |
| 3999 | { |
| 4000 | if (!suppress_msg) |
| 4001 | mpr("You don't have enough health at the moment."); |
| 4002 | |
| 4003 | if (abort_macros) |
| 4004 | { |
| 4005 | crawl_state.cancel_cmd_again(); |
| 4006 | crawl_state.cancel_cmd_repeat(); |
| 4007 | } |
| 4008 | return false; |
| 4009 | } |
| 4010 | |
| 4011 | return true; |
| 4012 | } |
| 4013 | |
| 4014 | bool enough_mp(int minimum, bool suppress_msg, bool abort_macros) |
| 4015 | { |
no test coverage detected