diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-29 15:42:46 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-29 15:42:46 +0000 |
commit | 9295e4fb393749bedc6ccdbe99c5147435949d35 (patch) | |
tree | b3e70eb49b9f5b1f93255eaca78e63254c30c89b /crawl-ref/source/mapdef.h | |
parent | 95ae20f32661c0f904607c46471a4324ce470e34 (diff) | |
download | crawl-ref-9295e4fb393749bedc6ccdbe99c5147435949d35.tar.gz crawl-ref-9295e4fb393749bedc6ccdbe99c5147435949d35.zip |
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
Diffstat (limited to 'crawl-ref/source/mapdef.h')
-rw-r--r-- | crawl-ref/source/mapdef.h | 29 |
1 files changed, 16 insertions, 13 deletions
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> 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: |