summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-28 13:49:28 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-28 13:49:28 +0000
commit90629939ac4ba4ba84acf7b768c8673d4188c108 (patch)
tree1c7ff76f2716b6d9ca193dc29f2edc7fc7d388fc /crawl-ref/source/item_use.cc
parent5b1c13035877e9a9fcfad7b322244a309b49f212 (diff)
downloadcrawl-ref-90629939ac4ba4ba84acf7b768c8673d4188c108.tar.gz
crawl-ref-90629939ac4ba4ba84acf7b768c8673d4188c108.zip
Some code review and cleanup.
extern char info[] is almost gone. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1387 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index c47b373102..7c268236a8 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2834,25 +2834,19 @@ static bool affix_weapon_enchantment()
if (wpn == -1 || !you.duration[ DUR_WEAPON_BRAND ])
return (false);
- strcpy(info, you.inv[wpn].name(DESC_CAP_YOUR).c_str());
+ std::string itname = you.inv[wpn].name(DESC_CAP_YOUR);
switch (get_weapon_brand( you.inv[wpn] ))
{
case SPWPN_VORPAL:
if (get_vorpal_type( you.inv[wpn] ) != DVORP_CRUSHING)
- {
- strcat(info, "'s sharpness seems more permanent.");
- }
+ mprf("%s's sharpness seems more permanent.", itname.c_str());
else
- {
- strcat(info, "'s heaviness feels very stable.");
- }
- mpr(info);
+ mprf("%s's heaviness feels very stable.", itname.c_str());
break;
case SPWPN_FLAMING:
- strcat(info," is engulfed in an explosion of flames!");
- mpr(info);
+ mprf("%s is engulfed in an explosion of flames!", itname.c_str());
beam.type = SYM_BURST;
beam.damage = dice_def( 3, 10 );
@@ -2871,27 +2865,23 @@ static bool affix_weapon_enchantment()
break;
case SPWPN_FREEZING:
- strcat(info," glows brilliantly blue for a moment.");
- mpr(info);
+ mprf("%s glows brilliantly blue for a moment.", itname.c_str());
cast_refrigeration(60);
break;
case SPWPN_DRAINING:
- strcat(info," thirsts for the lives of mortals!");
- mpr(info);
+ mprf("%s thirsts for the lives of mortals!", itname.c_str());
drain_exp();
break;
case SPWPN_VENOM:
- strcat(info, " seems more permanently poisoned.");
- mpr(info);
+ mprf("%s seems more permanently poisoned.", itname.c_str());
cast_toxic_radiance();
break;
case SPWPN_PAIN:
// Can't fix pain brand (balance)...you just get tormented.
- strcat(info, " shrieks out in agony!");
- mpr(info);
+ mprf("%s shrieks out in agony!", itname.c_str());
torment_monsters(you.x_pos, you.y_pos, 0, TORMENT_GENERIC);
success = false;
@@ -2905,8 +2895,7 @@ static bool affix_weapon_enchantment()
case SPWPN_DISTORTION:
// [dshaligram] Attempting to fix a distortion brand gets you a free
// distortion effect, and no permabranding. Sorry, them's the breaks.
- strcat(info, " twongs alarmingly.");
- mpr(info);
+ mprf("%s twongs alarmingly.", itname.c_str());
// from unwield_item
miscast_effect( SPTYP_TRANSLOCATION, 9, 90, 100,