diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
commit | fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 (patch) | |
tree | 8cc8a0b1312414c79f2c2d6e3d1e455754be41ea /crawl-ref/source/effects.cc | |
parent | b2ea8143ccf52a2cacfa48d19ce2ea603ddaab5e (diff) | |
download | crawl-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/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index fd82b37e24..cf25b6d3af 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -376,11 +376,8 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2) switch (ru) { case 0: - strcpy(info, "The dust glows a "); weird_colours(random2(256), wc); - strcat(info, wc); - strcat(info, " colour!"); - mpr(info); + mprf("The dust glows a %s colour!", wc); break; case 1: @@ -391,14 +388,10 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2) case 2: if (you.equip[EQ_WEAPON] != -1) { - char str_pass[ ITEMNAME_SIZE ]; - in_name(you.equip[EQ_WEAPON], DESC_CAP_YOUR, str_pass); - strcpy(info, str_pass); - strcat(info, " glows "); weird_colours(random2(256), wc); - strcat(info, wc); - strcat(info, " for a moment."); - mpr(info); + mprf("%s glows %s for a moment.", + you.inv[you.equip[EQ_WEAPON]].name(DESC_CAP_YOUR).c_str(), + wc); } else { @@ -1479,9 +1472,7 @@ bool recharge_wand(void) break; } - char str_pass[ ITEMNAME_SIZE ]; - item_name(wand, DESC_CAP_YOUR, str_pass); - mprf("%s glows for a moment.", str_pass); + mprf("%s glows for a moment.", wand.name(DESC_CAP_YOUR).c_str()); wand.plus += 1 + random2avg( ((charge_gain - 1) * 3) + 1, 3 ); @@ -1512,9 +1503,7 @@ bool recharge_wand(void) if (!work) return (false); - char str_pass[ITEMNAME_SIZE]; - item_name( wand, DESC_CAP_YOUR, str_pass ); - mprf("%s glows for a moment.", str_pass); + mprf("%s glows for a moment.", wand.name(DESC_CAP_YOUR).c_str()); } you.wield_change = true; |