summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-04 10:36:54 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-04 10:36:54 +0000
commit12246839e2efa9f89e5c246cdcb5f0ba4037c4fe (patch)
tree47a99027f2cf2a375f7051e32b767fda1e012b79 /crawl-ref/source/effects.cc
parenta639fc9fa82e60bb38792361e1c2bb3242cbd5fc (diff)
downloadcrawl-ref-12246839e2efa9f89e5c246cdcb5f0ba4037c4fe.tar.gz
crawl-ref-12246839e2efa9f89e5c246cdcb5f0ba4037c4fe.zip
Give transformed players appropriate shouts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@977 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 1f304faa06..7c2a4cb9f4 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1506,14 +1506,26 @@ void yell(void)
int mons_targd = MHITNOT;
struct dist targ;
- if (silenced(you.x_pos, you.y_pos))
+ if (silenced(you.x_pos, you.y_pos) || you.cannot_speak())
{
mpr("You are unable to make a sound!");
return;
}
+ const std::string shout_verb = you.shout_verb();
+ std::string cap_shout = shout_verb;
+ cap_shout[0] = toupper(cap_shout[0]);
+
+ int noise_level = 12;
+
+ // Tweak volume for different kinds of vocalisation.
+ if (shout_verb == "roar")
+ noise_level = 18;
+ else if (shout_verb == "hiss")
+ noise_level = 8;
+
mpr("What do you say?", MSGCH_PROMPT);
- mpr(" ! - Yell");
+ mprf(" ! - %s", cap_shout.c_str());
mpr(" a - Order allies to attack a monster");
if (!(you.prev_targ == MHITNOT || you.prev_targ == MHITYOU))
@@ -1527,21 +1539,17 @@ void yell(void)
}
}
- strcpy(info, " Anything else - Stay silent");
-
- if (one_chance_in(20))
- strcat(info, " (and be thought a fool)");
-
- mpr(info);
+ mprf(" Anything else - Stay silent%s",
+ one_chance_in(20)? " (and be thought a fool)" : "");
unsigned char keyn = get_ch();
switch (keyn)
{
case '!':
- mpr("You yell for attention!", MSGCH_SOUND);
+ mprf(MSGCH_SOUND, "You %s for attention!", shout_verb.c_str());
you.turn_is_over = true;
- noisy( 12, you.x_pos, you.y_pos );
+ noisy( noise_level, you.x_pos, you.y_pos );
return;
case 'a':