diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-04 23:09:49 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-04 23:09:49 +0000 |
commit | 166e51b5cc6e35ec1bea7dd24e9e6ae549ac3dde (patch) | |
tree | 9f2c5fec17e2aa7ce7ba0ce83d05ad4182c775b4 /crawl-ref/source | |
parent | b5aaf5c3c48fd6200fd99babdc7b31580c43acd1 (diff) | |
download | crawl-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')
-rw-r--r-- | crawl-ref/source/acr.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 43 | ||||
-rw-r--r-- | crawl-ref/source/misc.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 43 | ||||
-rw-r--r-- | crawl-ref/source/spells4.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 1 |
8 files changed, 46 insertions, 47 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index faf67fe2e8..20651e33b8 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -125,7 +125,6 @@ #include "spells1.h" #include "spells2.h" #include "spells3.h" -#include "spells4.h" #include "spl-book.h" #include "spl-cast.h" #include "spl-util.h" 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; +} diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index 120bec657b..0ee8d4e5bc 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -140,4 +140,6 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, void reveal_secret_door(int x, int y); +std::string your_hand(bool plural); + #endif diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 55aeee2407..a9ca5e8a37 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -73,7 +73,6 @@ #include "religion.h" #include "shopping.h" #include "skills2.h" -#include "spells4.h" #include "state.h" #include "stuff.h" #include "tutorial.h" diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 26444302ad..b5fb8a8bea 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -49,7 +49,6 @@ #include "randart.h" #include "religion.h" #include "spells1.h" -#include "spells4.h" #include "spl-cast.h" #include "spl-util.h" #include "stuff.h" diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 1057df3f1e..315edf07c4 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -74,49 +74,6 @@ static int quadrant_blink(int x, int y, int pow, int garbage); void do_monster_rot(int mon); -//jmf: FIXME: put somewhere else (misc.cc?) -// 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; - } - // or 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; -} - // just to avoid typing this over and over // now returns true if monster died -- bwr inline bool player_hurt_monster(int monster, int damage) diff --git a/crawl-ref/source/spells4.h b/crawl-ref/source/spells4.h index 986f2a35a2..d3b0bf36d1 100644 --- a/crawl-ref/source/spells4.h +++ b/crawl-ref/source/spells4.h @@ -18,7 +18,6 @@ struct bolt; -std::string your_hand(bool plural); bool backlight_monsters(int x, int y, int pow, int garbage); int make_a_normal_cloud(int x, int y, int pow, int spread_rate, cloud_type ctype, kill_category); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index bb430e6959..8d96ab7d45 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -38,6 +38,7 @@ #include "macro.h" #include "menu.h" #include "message.h" +#include "misc.h" #include "monplace.h" #include "monstuff.h" #include "mutation.h" |