summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-selfench.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-28 23:33:32 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-29 01:07:35 +0100
commit5f4ae1ef05d92d9da03cde00b07d187f2f53a06d (patch)
tree01dbc85606ad5ab882333b1695c915b63e97b96d /crawl-ref/source/spl-selfench.cc
parent2965f04181dcb6530b93acb194ba5f7561d8adc9 (diff)
downloadcrawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.tar.gz
crawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.zip
Replace `mpr(s, ch)` with `mprf(ch, s)`
Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
Diffstat (limited to 'crawl-ref/source/spl-selfench.cc')
-rw-r--r--crawl-ref/source/spl-selfench.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc
index 19e97357b6..f4daa80bbb 100644
--- a/crawl-ref/source/spl-selfench.cc
+++ b/crawl-ref/source/spl-selfench.cc
@@ -46,8 +46,7 @@ spret_type cast_deaths_door(int pow, bool fail)
{
fail_check();
mpr("You feel invincible!");
- mpr("You seem to hear sand running through an hourglass...",
- MSGCH_SOUND);
+ mprf(MSGCH_SOUND, "You seem to hear sand running through an hourglass...");
set_hp(allowed_deaths_door_hp());
deflate_hp(you.hp_max, false);
@@ -65,7 +64,7 @@ spret_type cast_deaths_door(int pow, bool fail)
void remove_ice_armour()
{
- mpr("Your icy armour melts away.", MSGCH_DURATION);
+ mprf(MSGCH_DURATION, "Your icy armour melts away.");
you.redraw_armour_class = true;
you.duration[DUR_ICY_ARMOUR] = 0;
}
@@ -156,7 +155,7 @@ spret_type cast_revivification(int pow, bool fail)
if (you.duration[DUR_DEATHS_DOOR])
{
- mpr("Your life is in your own hands once again.", MSGCH_DURATION);
+ mprf(MSGCH_DURATION, "Your life is in your own hands once again.");
// XXX: better cause name?
paralyse_player("Death's Door abortion", 5 + random2(5));
confuse_player(10 + random2(10));
@@ -264,7 +263,7 @@ int cast_selective_amnesia(string *pre_msg)
int slot;
// Pick a spell to forget.
- mpr("Forget which spell ([?*] list [ESC] exit)? ", MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "Forget which spell ([?*] list [ESC] exit)? ");
keyin = Options.auto_list
? list_spells(false, false, false, "Forget which spell?")
: get_ch();
@@ -297,7 +296,7 @@ int cast_selective_amnesia(string *pre_msg)
if (spell == SPELL_NO_SPELL)
{
mpr("You don't know that spell.");
- mpr("Forget which spell ([?*] list [ESC] exit)? ", MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "Forget which spell ([?*] list [ESC] exit)? ");
keyin = get_ch();
}
else