diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-23 10:19:28 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-23 10:19:28 +0000 |
commit | 31d23a40fe1ac90e0e319ce9bab1fa3bb0a08bf3 (patch) | |
tree | 3b981f5efc06e3a5e46cf9b1a395f7e35f2ddd9a /crawl-ref/source/item_use.cc | |
parent | 00af6cae236018eae3c659ae02cd8c017549bd15 (diff) | |
download | crawl-ref-31d23a40fe1ac90e0e319ce9bab1fa3bb0a08bf3.tar.gz crawl-ref-31d23a40fe1ac90e0e319ce9bab1fa3bb0a08bf3.zip |
Cleaned up a lot of code which was using info[] to use mprf() directly
instead.
Fixed a bug with affix_weapon_enchantment messaging (mea culpa.)
Fixed shatter() messages getting surpressed.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1347 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 8fd396f0e4..88866eec89 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2633,11 +2633,9 @@ void zap_wand(void) mpr("Your skill with magical items lets you calculate the power of this device..."); } - snprintf( info, INFO_SIZE, "This wand has %d charge%s left.", - you.inv[item_slot].plus, - (you.inv[item_slot].plus == 1) ? "" : "s" ); - - mpr(info); + mprf("This wand has %d charge%s left.", + you.inv[item_slot].plus, + (you.inv[item_slot].plus == 1) ? "" : "s" ); set_ident_flags( you.inv[item_slot], ISFLAG_KNOW_PLUSES ); } @@ -2825,7 +2823,7 @@ bool drink_fountain(void) return true; } // end drink_fountain() -static bool affix_weapon_enchantment( void ) +static bool affix_weapon_enchantment() { const int wpn = you.equip[ EQ_WEAPON ]; bool success = true; @@ -2835,6 +2833,8 @@ static bool affix_weapon_enchantment( void ) if (wpn == -1 || !you.duration[ DUR_WEAPON_BRAND ]) return (false); + strcpy(info, you.inv[wpn].name(DESC_CAP_YOUR).c_str()); + switch (get_weapon_brand( you.inv[wpn] )) { case SPWPN_VORPAL: @@ -3409,14 +3409,14 @@ void read_scroll(void) case SCR_ENCHANT_WEAPON_III: if (you.equip[ EQ_WEAPON ] != -1) { - // Get the name before it changes. - const std::string iname = - you.inv[you.equip[EQ_WEAPON]].name(DESC_CAP_YOUR); // Successfully affixing the enchantment will print // its own message. if (!affix_weapon_enchantment()) { + const std::string iname = + you.inv[you.equip[EQ_WEAPON]].name(DESC_CAP_YOUR); + mprf("%s glows bright yellow for a while.", iname.c_str() ); enchant_weapon( ENCHANT_TO_HIT, true ); |