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

Function enough_mp

crawl-ref/source/player.cc:4014–4039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4012}
4013
4014bool enough_mp(int minimum, bool suppress_msg, bool abort_macros)
4015{
4016 ASSERT(!crawl_state.game_is_arena());
4017
4018 if (you.has_mutation(MUT_HP_CASTING))
4019 return enough_hp(minimum, suppress_msg, abort_macros);
4020
4021 if (you.magic_points < minimum)
4022 {
4023 if (!suppress_msg)
4024 {
4025 if (get_real_mp(true) < minimum)
4026 mpr("You don't have enough magic capacity.");
4027 else
4028 mpr("You don't have enough magic at the moment.");
4029 }
4030 if (abort_macros)
4031 {
4032 crawl_state.cancel_cmd_again();
4033 crawl_state.cancel_cmd_repeat();
4034 }
4035 return false;
4036 }
4037
4038 return true;
4039}
4040
4041void inc_mp(int mp_gain, bool silent)
4042{

Callers 7

handle_channelled_spellFunction · 0.85
_place_dragonFunction · 0.85
clockwork_bee_rechargeFunction · 0.85
fire_fusilladeFunction · 0.85
fill_status_infoFunction · 0.85
_check_ability_possibleFunction · 0.85

Calls 7

enough_hpFunction · 0.85
get_real_mpFunction · 0.85
mprFunction · 0.85
game_is_arenaMethod · 0.80
has_mutationMethod · 0.80
cancel_cmd_againMethod · 0.80
cancel_cmd_repeatMethod · 0.80

Tested by

no test coverage detected