Description |
I idly mentioned in ##crawl-dev I was thinking about making a rune mimic and dpeg said go for it. (And it was easier than I thought.) So, here it is. :)
As written, it only appears on Vaults:8, where it has a 1/11 chance of appearing in each nonrune subvault (but only once). So the chance it appears in a given game is 1-(10/11)^3, or 331 in 1331, about 25%.
Also, it's not flagged as a unique. Haven't quite figured that out yet. |
Attached Files |
0001-Add-a-special-rune-mimic.patch [^] (2,449 bytes) 2011-09-22 09:53 [Show Content] [Hide Content]From edadb94c3b5d35883f93681b360621ae90a5adeb Mon Sep 17 00:00:00 2001
From: Zannick <jokeserver@gmail.com>
Date: Wed, 21 Sep 2011 23:13:06 -0700
Subject: [PATCH] Add a special rune mimic.
---
crawl-ref/source/dat/des/branches/vaults.des | 14 ++++++++++++++
crawl-ref/source/mon-info.cc | 2 ++
crawl-ref/source/monster.cc | 7 +++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/dat/des/branches/vaults.des b/crawl-ref/source/dat/des/branches/vaults.des
index b4be54a..b5bb032 100644
--- a/crawl-ref/source/dat/des/branches/vaults.des
+++ b/crawl-ref/source/dat/des/branches/vaults.des
@@ -500,6 +500,20 @@ MAP
o
ENDMAP
+############################################################
+# Vault:8 - the subvault used for potential rune locations that do not
+# contain the rune, but rather a mimic of it!
+#
+# Used by the 'vault8_rune()' function in the prelude.
+#
+NAME: vault8_rune_mimic
+TAGS: vault8_norune
+WEIGHT: 1
+KITEM: o = silver rune of Zot mimic
+MAP
+o
+ENDMAP
+
###############################################################################
# Vaults:8 quadrants
###############################################################################
diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc
index 479898d..8d2a5bd 100644
--- a/crawl-ref/source/mon-info.cc
+++ b/crawl-ref/source/mon-info.cc
@@ -783,6 +783,8 @@ std::string monster_info::mimic_name() const
{
if (item->base_type == OBJ_GOLD)
s = "pile of gold";
+ else if (item->sub_type == MISC_RUNE_OF_ZOT)
+ s = "rune";
else
s = item->name(DESC_BASENAME);
}
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index b864cf1..c255240 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -1949,9 +1949,12 @@ bool monster::pickup_gold(item_def &item, int near)
bool monster::pickup_misc(item_def &item, int near)
{
- // Never pick up runes.
- if (item.base_type == OBJ_MISCELLANY && item.sub_type == MISC_RUNE_OF_ZOT)
+ // Never pick up runes, except rune mimics.
+ if (item.base_type == OBJ_MISCELLANY && item.sub_type == MISC_RUNE_OF_ZOT
+ && !mons_is_item_mimic(type))
+ {
return (false);
+ }
// Holy monsters and worshippers of good gods won't pick up evil
// miscellaneous items.
--
1.7.2.5
|