From 3719e3c8c35ad7bd924373512c25ce7828d62a03 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 13 Apr 2007 14:08:38 +0000 Subject: 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 --- crawl-ref/source/mon-util.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/mon-util.cc') 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 monsters_by_habitat[NUM_HABITATS]; +static std::vector 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(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 &valid_mons = monsters_by_habitat[ht]; + const std::vector &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); } -- cgit v1.2.3-54-g00ecf