From 9295e4fb393749bedc6ccdbe99c5147435949d35 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 29 Jan 2007 15:42:46 +0000 Subject: Allow vaults to ask for a monster to be generated awake (generate_awake tag). Add Enter as a synonym for . in targeting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@905 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mapdef.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'crawl-ref/source/mapdef.h') diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h index b0f0d23818..52ce7ecf3d 100644 --- a/crawl-ref/source/mapdef.h +++ b/crawl-ref/source/mapdef.h @@ -84,6 +84,20 @@ private: bool solid_checked; }; +struct mons_spec +{ + int mid; + int genweight; + bool fix_mons; + bool generate_awake; + + mons_spec(int id = RANDOM_MONSTER, int gw = 10, bool _fixmons = false, + bool awaken = false) + : mid(id), genweight(gw), fix_mons(_fixmons), generate_awake(awaken) + { + } +}; + class mons_list { public: @@ -91,7 +105,7 @@ public: void clear(); - int get_monster(int index); + mons_spec get_monster(int index); // Returns an error string if the monster is unrecognised. std::string add_mons(const std::string &s); @@ -99,17 +113,6 @@ public: size_t size() const { return mons.size(); } private: - struct mons_spec - { - int mid; - int genweight; - bool fix_mons; - - mons_spec(int id = RANDOM_MONSTER, int gw = 10, bool _fixmons = false) - : mid(id), genweight(gw), fix_mons(_fixmons) - { - } - }; typedef std::vector mons_spec_list; struct mons_spec_slot @@ -131,7 +134,7 @@ private: private: int mons_by_name(std::string name) const; mons_spec_slot parse_mons_spec(std::string spec); - int pick_monster(mons_spec_slot &slot); + mons_spec pick_monster(mons_spec_slot &slot); int fix_demon(int id) const; private: -- cgit v1.2.3-54-g00ecf