summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-21 16:18:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-21 16:18:19 +0000
commitfac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 (patch)
tree8cc8a0b1312414c79f2c2d6e3d1e455754be41ea /crawl-ref/source/spells4.cc
parentb2ea8143ccf52a2cacfa48d19ce2ea603ddaab5e (diff)
downloadcrawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.tar.gz
crawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.zip
Eliminated it_name(), in_name(), item_name(). The function to use is
now item_def::name(). Cleaned up a lot of code in the process. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1341 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index a5e3c7564f..8d89d88fbe 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1078,7 +1078,8 @@ void cast_ignite_poison(int pow)
{
if (set_item_ego_type( you.inv[wpn], OBJ_WEAPONS, SPWPN_FLAMING ))
{
- mprf("%s bursts into flame!", in_name(wpn, DESC_CAP_YOUR));
+ mprf("%s bursts into flame!",
+ you.inv[wpn].name(DESC_CAP_YOUR).c_str());
you.wield_change = true;
you.duration[DUR_WEAPON_BRAND] += 1 + you.duration[DUR_WEAPON_BRAND] / 2;
@@ -2031,8 +2032,6 @@ void cast_evaporate(int pow)
// using up the corpse might also lead to game balance problems. -- bwr
void cast_fulsome_distillation( int powc )
{
- char str_pass[ ITEMNAME_SIZE ];
-
if (powc > 50)
powc = 50;
@@ -2047,11 +2046,11 @@ void cast_fulsome_distillation( int powc )
curr_item != NON_ITEM;
curr_item = mitm[curr_item].link)
{
- if (mitm[curr_item].base_type == OBJ_CORPSES
- && mitm[curr_item].sub_type == CORPSE_BODY)
+ const item_def& item = mitm[curr_item];
+ if (item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_BODY)
{
- it_name( curr_item, DESC_NOCAP_THE, str_pass );
- snprintf( info, INFO_SIZE, "Distill a potion from %s?", str_pass );
+ snprintf( info, INFO_SIZE, "Distill a potion from %s?",
+ item.name(DESC_NOCAP_THE).c_str() );
if (yesno( info, true, 0, false ))
{
@@ -2169,10 +2168,8 @@ void cast_fulsome_distillation( int powc )
mitm[corpse].plus2 = 0;
item_colour( mitm[corpse] ); // sets special as well
- it_name( corpse, DESC_NOCAP_A, str_pass );
- snprintf( info, INFO_SIZE, "You extract %s from the corpse.",
- str_pass );
- mpr( info );
+ mprf("You extract %s from the corpse.",
+ mitm[corpse].name(DESC_NOCAP_A).c_str());
// try to move the potion to the player (for convenience)
if (move_item_to_player( corpse, 1 ) != 1)