summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-03-24 19:35:12 +0000
committerChris Campbell <chriscampbell89@gmail.com>2014-03-24 19:35:12 +0000
commitde9d9ae91ff570702377d041fdb13b0a265e56cb (patch)
treeeb6ba1eb09d5230026cacb80b70988712b27e430 /crawl-ref/source/effects.cc
parentb7ac591dc242d7a44a948cf6e595f42b3e0ddb4c (diff)
downloadcrawl-ref-de9d9ae91ff570702377d041fdb13b0a265e56cb.tar.gz
crawl-ref-de9d9ae91ff570702377d041fdb13b0a265e56cb.zip
Rework some checks for player shout volume
Removes a bit of duplication, and makes shoutitis still increase shout volume if transformed into something noisy/quiet.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc25
1 files changed, 3 insertions, 22 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 3e189d0ffe..4f4bc184ac 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -904,36 +904,17 @@ void yell(bool force)
const string shout_verb = you.shout_verb();
string cap_shout = shout_verb;
cap_shout[0] = toupper(cap_shout[0]);
-
- int noise_level = 12; // "shout"
-
- // Tweak volume for different kinds of vocalisation.
- if (shout_verb == "roar")
- noise_level = 18;
- else if (shout_verb == "hiss")
- noise_level = 8;
- else if (shout_verb == "squeak")
- noise_level = 4;
- else if (shout_verb == "__NONE")
- noise_level = 0;
- else if (shout_verb == "yell")
- noise_level = 14;
- else if (shout_verb == "scream")
- noise_level = 16;
+ const int noise_level = you.shout_volume();
if (you.cannot_speak())
- noise_level = 0;
-
- if (noise_level == 0)
{
if (force)
{
- if (shout_verb == "__NONE" || you.paralysed())
+ if (you.paralysed())
{
mprf("You feel a strong urge to %s, but "
"you are unable to make a sound!",
- shout_verb == "__NONE" ? "scream"
- : shout_verb.c_str());
+ shout_verb.c_str());
}
else
{