summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-31 08:41:27 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-31 08:41:27 +0000
commit86d488e3efa0b1d8ec12223527235e3ef3a5fec2 (patch)
tree88b3d97a6f74ea6eb21405b3072e1e1a9c6830b0 /crawl-ref/source/mon-util.cc
parent496a1b4c58651aa28878db51bb1d5f3534d8a0a5 (diff)
downloadcrawl-ref-86d488e3efa0b1d8ec12223527235e3ef3a5fec2.tar.gz
crawl-ref-86d488e3efa0b1d8ec12223527235e3ef3a5fec2.zip
Add arena mode, activated on the command-line by 'crawl -arena "monster v monster"' (eg: crawl -arena "Sigmund v Jessica") to let monsters fight each other undisturbed by the player. Good to examine monster AI and monster behaviour when the player is AWOL.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8059 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 9314094e1f..2ac2063a78 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -46,6 +46,7 @@
#include "shopping.h" // for item values
#include "spells3.h"
#include "spl-util.h"
+#include "state.h"
#include "stuff.h"
#include "terrain.h"
#include "tiles.h"
@@ -1972,15 +1973,14 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
// (Uniques don't get this, because their names are proper nouns.)
if (!mons_is_unique(mon.type))
{
+ const bool use_your = !crawl_state.arena && mons_friendly(&mon);
switch (desc)
{
case DESC_CAP_THE:
- result = (mons_friendly(&mon) ? "Your "
- : "The ");
+ result = (use_your ? "Your " : "The ");
break;
case DESC_NOCAP_THE:
- result = (mons_friendly(&mon) ? "your "
- : "the ");
+ result = (use_your ? "your " : "the ");
break;
case DESC_CAP_A:
result = "A ";
@@ -7870,7 +7870,9 @@ std::string do_mon_str_replacements(const std::string &in_msg,
msg = replace_all(msg, "@the_monster@", name);
msg = replace_all(msg, "@The_monster@", name);
}
- else if (monster->attitude == ATT_FRIENDLY && !mons_is_unique(monster->type)
+ else if (monster->attitude == ATT_FRIENDLY
+ && !mons_is_unique(monster->type)
+ && !crawl_state.arena
&& player_monster_visible(monster))
{
nocap = DESC_PLAIN;