summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 20:12:11 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 20:12:11 +0000
commitd82ee4ebd849c7bfebb8d9998604e63767849efb (patch)
tree9c60b216c873b3a257b3eee09cd7fc41296aa26c /crawl-ref/source/spells4.cc
parent778880771386e5f111aca28d397c5d32f3e7dca0 (diff)
downloadcrawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.tar.gz
crawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.zip
Minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1477 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 15068e46f8..f298b40b3b 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -15,6 +15,7 @@
#include "AppHdr.h"
#include <string>
+#include <iostream>
#include <stdio.h>
#include "externs.h"
@@ -34,6 +35,7 @@
#include "items.h"
#include "invent.h"
#include "makeitem.h"
+#include "message.h"
#include "misc.h"
#include "monplace.h"
#include "monstuff.h"
@@ -72,10 +74,9 @@ void do_monster_rot(int mon);
//jmf: FIXME: put somewhere else (misc.cc?)
// A feeble attempt at Nethack-like completeness for cute messages.
-const char *your_hand( bool plural )
+std::string your_hand( bool plural )
{
- static char hand_buff[80];
-
+ std::string result;
switch (you.attribute[ATTR_TRANSFORMATION])
{
default:
@@ -84,33 +85,33 @@ const char *your_hand( bool plural )
case TRAN_STATUE:
if (you.species == SP_TROLL || you.species == SP_GHOUL)
{
- strcpy(hand_buff, "claw");
+ result = "claw";
break;
}
// or fall-through
case TRAN_ICE_BEAST:
case TRAN_LICH:
- strcpy(hand_buff, "hand");
+ result = "hand";
break;
case TRAN_SPIDER:
- strcpy(hand_buff, "front leg");
+ result = "front leg";
break;
case TRAN_SERPENT_OF_HELL:
case TRAN_DRAGON:
- strcpy(hand_buff, "foreclaw");
+ result = "foreclaw";
break;
case TRAN_BLADE_HANDS:
- strcpy(hand_buff, "scythe-like blade");
+ result = "scythe-like blade";
break;
case TRAN_AIR:
- strcpy(hand_buff, "misty tendril");
+ result = "misty tendril";
break;
}
if (plural)
- strcat(hand_buff, "s");
+ result += 's';
- return (hand_buff);
+ return result;
}
// I need to make some debris for metal, crystal and stone.
@@ -668,7 +669,8 @@ void cast_sticks_to_snakes(int pow)
if (weapon == -1)
{
- mprf("Your %s feel slithery!", your_hand(true));
+ msg::stream << "Your " << your_hand(true) << " feel slithery!"
+ << std::endl;
return;
}
@@ -765,7 +767,8 @@ void cast_sticks_to_snakes(int pow)
}
else
{
- mprf("Your %s feel slithery!", your_hand(true));
+ msg::stream << "Your " << your_hand(true) << " feel slithery!"
+ << std::endl;
}
} // end cast_sticks_to_snakes()
@@ -1879,7 +1882,8 @@ void cast_evaporate(int pow)
if (potion == -1)
{
- mprf("Wisps of steam play over your %s!", your_hand(true) );
+ msg::stream << "Wisps of steam play over your " << your_hand(true)
+ << std::endl;
return;
}
else if (you.inv[potion].base_type != OBJ_POTIONS)