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

Function enough_hp

crawl-ref/source/player.cc:3980–4012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3978}
3979
3980bool 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
4014bool enough_mp(int minimum, bool suppress_msg, bool abort_macros)
4015{

Callers 4

enough_mpFunction · 0.85
_check_ability_possibleFunction · 0.85

Calls 4

mprFunction · 0.85
game_is_arenaMethod · 0.80
cancel_cmd_againMethod · 0.80
cancel_cmd_repeatMethod · 0.80

Tested by

no test coverage detected