summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dat/vaults.des14
-rw-r--r--crawl-ref/source/mapdef.cc32
-rw-r--r--crawl-ref/source/mapdef.h1
3 files changed, 40 insertions, 7 deletions
diff --git a/crawl-ref/source/dat/vaults.des b/crawl-ref/source/dat/vaults.des
index 48f0123dce..53d37cd89e 100644
--- a/crawl-ref/source/dat/vaults.des
+++ b/crawl-ref/source/dat/vaults.des
@@ -6528,12 +6528,14 @@ NAME: fake_naga_vault
DEPTH: 15-26
MONS: mimic, guardian naga
MAP
-xxxxxxxxx
-x1111111x
-x1111111x
-x1111111x
-x11.2.11x
-xxxx+xxxx
+...........
+.xxxxxxxxx.
+.x1111111x.
+.x1111111x.
+.x1111111x.
+.x11.2.11x.
+.xxxx+xxxx.
+...........
ENDMAP
##############################################################################
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 1535b2ffa0..4ef6f3217a 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -881,6 +881,9 @@ mons_spec mons_list::pick_monster(mons_spec_slot &slot)
slot.fix_slot = false;
}
+ if (pick.mid == MONS_WEAPON_MIMIC && !pick.fix_mons)
+ pick.mid = random_range(MONS_GOLD_MIMIC, MONS_POTION_MIMIC);
+
return (pick);
}
@@ -897,6 +900,31 @@ void mons_list::clear()
mons.clear();
}
+bool mons_list::check_mimic(const std::string &s, int *mid, bool *fix) const
+{
+ if (s == "mimic")
+ {
+ *mid = MONS_WEAPON_MIMIC;
+ *fix = false;
+ return (true);
+ }
+ else if (s == "gold mimic")
+ *mid = MONS_GOLD_MIMIC;
+ else if (s == "weapon mimic")
+ *mid = MONS_WEAPON_MIMIC;
+ else if (s == "armour mimic")
+ *mid = MONS_ARMOUR_MIMIC;
+ else if (s == "scroll mimic")
+ *mid = MONS_SCROLL_MIMIC;
+ else if (s == "potion mimic")
+ *mid = MONS_POTION_MIMIC;
+ else
+ return (false);
+
+ *fix = true;
+ return (true);
+}
+
mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
{
mons_spec_slot slot;
@@ -913,7 +941,7 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
if (weight == TAG_UNFOUND || weight <= 0)
weight = 10;
- const bool fixmons = strip_tag(s, "fix_mons");
+ bool fixmons = strip_tag(s, "fix_mons");
const bool generate_awake = strip_tag(s, "generate_awake");
trim_string(s);
@@ -924,6 +952,8 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
mlevel = -8;
else if (s == "9")
mlevel = -9;
+ else if (check_mimic(s, &mid, &fixmons))
+ ;
else if (s != "0")
{
mid = mons_by_name(s);
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h
index 20940a0c77..ffb5cef40e 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -205,6 +205,7 @@ private:
mons_spec_slot parse_mons_spec(std::string spec);
mons_spec pick_monster(mons_spec_slot &slot);
int fix_demon(int id) const;
+ bool check_mimic(const std::string &s, int *mid, bool *fix) const;
private:
std::vector< mons_spec_slot > mons;