summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-04 23:09:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-04 23:09:49 +0000
commit166e51b5cc6e35ec1bea7dd24e9e6ae549ac3dde (patch)
tree9f2c5fec17e2aa7ce7ba0ce83d05ad4182c775b4 /crawl-ref/source/misc.cc
parentb5aaf5c3c48fd6200fd99babdc7b31580c43acd1 (diff)
downloadcrawl-ref-166e51b5cc6e35ec1bea7dd24e9e6ae549ac3dde.tar.gz
crawl-ref-166e51b5cc6e35ec1bea7dd24e9e6ae549ac3dde.zip
Move your_hand() from spells4.cc to misc.cc.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4870 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 181dd8f2a3..18316ca38f 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2895,3 +2895,46 @@ void reveal_secret_door(int x, int y)
grd[x][y] = grid_is_opaque(door) ?
DNGN_CLOSED_DOOR : DNGN_OPEN_DOOR;
}
+
+// A feeble attempt at Nethack-like completeness for cute messages.
+std::string your_hand(bool plural)
+{
+ std::string result;
+
+ switch (you.attribute[ATTR_TRANSFORMATION])
+ {
+ default:
+ mpr("ERROR: unknown transformation in your_hand() (spells4.cc)");
+ case TRAN_NONE:
+ case TRAN_STATUE:
+ case TRAN_LICH:
+ if (you.has_usable_claws())
+ {
+ result = "claw";
+ break;
+ }
+ // deliberate fall through
+ case TRAN_ICE_BEAST:
+ result = "hand";
+ break;
+ case TRAN_SPIDER:
+ result = "front leg";
+ break;
+ case TRAN_SERPENT_OF_HELL:
+ case TRAN_DRAGON:
+ case TRAN_BAT:
+ result = "foreclaw";
+ break;
+ case TRAN_BLADE_HANDS:
+ result = "scythe-like blade";
+ break;
+ case TRAN_AIR:
+ result = "misty tendril";
+ break;
+ }
+
+ if (plural)
+ result += 's';
+
+ return result;
+}