summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-13 14:08:38 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-13 14:08:38 +0000
commit3719e3c8c35ad7bd924373512c25ce7828d62a03 (patch)
treeb9c4436ae2d9046a45ccba1a2b7ff2d93a56b405 /crawl-ref/source/mon-util.cc
parentc92159fe7f003977dee3ea4d16a18176f6435435 (diff)
downloadcrawl-ref-3719e3c8c35ad7bd924373512c25ce7828d62a03.tar.gz
crawl-ref-3719e3c8c35ad7bd924373512c25ce7828d62a03.zip
Fixed bad grammar on shield block messages in melee.
Split up Abyss/Pan/Labyrinth save files. The only practical use right now is to be able to correctly place Abyss and Pan ghosts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1295 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index dd52595fbe..5c06518fd0 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -63,13 +63,13 @@ enum habitat_type
};
static bool initialized_randmons = false;
-static std::vector<int> monsters_by_habitat[NUM_HABITATS];
+static std::vector<monster_type> monsters_by_habitat[NUM_HABITATS];
static struct monsterentry mondata[] = {
#include "mon-data.h"
};
-#define MONDATASIZE (sizeof(mondata)/sizeof(struct monsterentry))
+#define MONDATASIZE (sizeof(mondata)/sizeof(monsterentry))
static int mspell_list[][7] = {
#include "mon-spll.h"
@@ -125,7 +125,7 @@ static void initialize_randmons()
if (invalid_monster_class(m))
continue;
if (monster_habitable_grid(m, grid))
- monsters_by_habitat[i].push_back(m);
+ monsters_by_habitat[i].push_back(static_cast<monster_type>(m));
}
}
initialized_randmons = true;
@@ -142,10 +142,10 @@ monster_type random_monster_at_grid(int grid)
initialize_randmons();
const habitat_type ht = grid2habitat(grid);
- const std::vector<int> &valid_mons = monsters_by_habitat[ht];
+ const std::vector<monster_type> &valid_mons = monsters_by_habitat[ht];
ASSERT(!valid_mons.empty());
return valid_mons.empty()? MONS_PROGRAM_BUG
- : monster_type(valid_mons[ random2(valid_mons.size()) ]);
+ : valid_mons[ random2(valid_mons.size()) ];
}
monster_type get_monster_by_name(std::string name, bool exact)
@@ -2389,7 +2389,13 @@ item_def *monsters::shield()
std::string monsters::name(description_level_type desc) const
{
- return (ptr_monam(this, desc));
+ const bool possessive =
+ (desc == DESC_NOCAP_YOUR || desc == DESC_NOCAP_ITS);
+
+ if (possessive)
+ desc = DESC_NOCAP_THE;
+ std::string mname = ptr_monam(this, desc);
+ return (possessive? apostrophise(mname) : mname);
}
std::string monsters::name(description_level_type desc, bool force_vis) const
@@ -2415,7 +2421,7 @@ std::string monsters::conj_verb(const std::string &verb) const
if (verb == "are")
return ("is");
- return (pluralize(verb));
+ return (pluralise(verb));
}
int monsters::id() const
@@ -2855,7 +2861,7 @@ bool monsters::needs_transit() const
&& !mons_is_summoned(this));
}
-void monsters::set_transit(level_id dest)
+void monsters::set_transit(const level_id &dest)
{
add_monster_to_transit(dest, *this);
}