summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mapdef.cc28
-rw-r--r--crawl-ref/source/mapdef.h1
-rw-r--r--crawl-ref/source/monplace.cc14
3 files changed, 41 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 713c3bce9f..9678d68edc 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -2569,6 +2569,31 @@ mons_spec mons_list::get_hydra_spec(const std::string &name) const
return mons_spec(MONS_HYDRA, MONS_NO_MONSTER, nheads);
}
+mons_spec mons_list::get_slime_spec(const std::string &name) const
+{
+ std::string prefix = name.substr(0, name.find(" slime creature"));
+
+ int slime_size = 1;
+
+ if (prefix == "large")
+ slime_size = 2;
+ else if (prefix == "very large")
+ slime_size = 3;
+ else if (prefix == "enormous")
+ slime_size = 4;
+ else if (prefix == "titanic")
+ slime_size = 5;
+ else
+ {
+#if DEBUG || DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "Slime spec wants invalid size '%s'",
+ prefix.c_str());
+#endif
+ }
+
+ return mons_spec(MONS_SLIME_CREATURE, MONS_NO_MONSTER, slime_size);
+}
+
// Handle draconians specified as:
// Exactly as in mon-data.h:
// yellow draconian or draconian knight - the monster specified.
@@ -2702,6 +2727,9 @@ mons_spec mons_list::mons_by_name(std::string name) const
if (ends_with(name, "-headed hydra") && !starts_with(name, "spectral "))
return get_hydra_spec(name);
+ if (ends_with(name, " slime creature"))
+ return get_slime_spec(name);
+
mons_spec spec;
get_zombie_type(name, spec);
if (spec.mid != MONS_PROGRAM_BUG)
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h
index 1ae98bf10e..eba71964b2 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -516,6 +516,7 @@ private:
mons_spec drac_monspec(std::string name) const;
void get_zombie_type(std::string s, mons_spec &spec) const;
mons_spec get_hydra_spec(const std::string &name) const;
+ mons_spec get_slime_spec(const std::string &name) const;
mons_spec get_zombified_monster(const std::string &name,
monster_type zomb) const;
mons_spec_slot parse_mons_spec(std::string spec);
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index a340ff226a..f253d18204 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1221,9 +1221,19 @@ static int _place_monster_aux(const mgen_data &mg,
if (mg.cls == MONS_MANTICORE)
menv[id].number = 8 + random2(9);
- // Slime creatures start off as only a single merged blob.
if (mg.cls == MONS_SLIME_CREATURE)
- menv[id].number = 1;
+ {
+ if (mg.number == 0)
+ // Slime creatures start off as only a single un-merged blob.
+ menv[id].number = 1;
+ else
+ {
+ // Boost HP to what it would have been if it grown this big
+ // by merging.
+ menv[id].hit_points *= mg.number;
+ menv[id].max_hit_points *= mg.number;
+ }
+ }
// Set attitude, behaviour and target.
menv[id].attitude = ATT_HOSTILE;