diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:33:29 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:33:29 +0000 |
commit | ff2f267821153758bcd691e73b1b409c62f0c4e0 (patch) | |
tree | 11f18df98aad81ddfa9798dafd67eceb3b4ed510 /crawl-ref/source/mapdef.cc | |
parent | 3423bbab5a0f024eeafffe6b8260c8c088647db1 (diff) | |
download | crawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.tar.gz crawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.zip |
Cleaned up monster generation functions, separate monster zombie type from monster number. May be buggy.
Allow hydra zombies (they currently do not get the right number of heads).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4872 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 26fb4f78aa..35c95428b8 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1988,7 +1988,8 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec) } mspec.mid = nspec.mid; - mspec.monnum = nspec.monnum; + mspec.monbase = nspec.monbase; + mspec.number = nspec.number; } if (mspec.items.size() > 0) @@ -2072,8 +2073,8 @@ void mons_list::get_zombie_type(std::string s, mons_spec &spec) const { s = s.substr(spectre.length()); spec.mid = MONS_SPECTRAL_THING; - spec.monnum = get_monster_by_name(s, true); - if (!mons_zombie_size(spec.monnum)) + spec.monbase = get_monster_by_name(s, true); + if (!mons_zombie_size(spec.monbase)) spec.mid = MONS_PROGRAM_BUG; return; } @@ -2084,9 +2085,9 @@ void mons_list::get_zombie_type(std::string s, mons_spec &spec) const s = s.substr(0, s.length() - strlen(zombie_types[mod - 1])); trim_string(s); - spec.monnum = get_monster_by_name(s, true); + spec.monbase = get_monster_by_name(s, true); - const int zombie_size = mons_zombie_size(spec.monnum); + const int zombie_size = mons_zombie_size(spec.monbase); if (!zombie_size) { spec.mid = MONS_PROGRAM_BUG; @@ -2104,7 +2105,7 @@ mons_spec mons_list::get_hydra_spec(const std::string &name) const else if (nheads > 19) nheads = 19; - return mons_spec(MONS_HYDRA, nheads); + return mons_spec(MONS_HYDRA, MONS_PROGRAM_BUG, nheads); } // Handle draconians specified as: @@ -2156,7 +2157,7 @@ mons_spec mons_list::drac_monspec(std::string name) const const monster_type colour = get_monster_by_name(name, true); if (colour != MONS_PROGRAM_BUG) { - spec.monnum = colour; + spec.monbase = colour; return (spec); } @@ -2166,7 +2167,7 @@ mons_spec mons_list::drac_monspec(std::string name) const return (MONS_PROGRAM_BUG); std::string scolour = name.substr(0, wordend); - if ((spec.monnum = draconian_colour_by_name(scolour)) == MONS_PROGRAM_BUG) + if ((spec.monbase = draconian_colour_by_name(scolour)) == MONS_PROGRAM_BUG) return (MONS_PROGRAM_BUG); name = trimmed_string(name.substr(wordend + 1)); |