summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-31 20:26:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-31 20:26:20 +0000
commit57ec78ae83592e5f55457fbcff4de929f5a9b7d7 (patch)
tree7f85295bb2791f405554336cc2e1ebb744571a4c /crawl-ref/source/misc.cc
parent7df3a8aa8296fea631280b085f4c70a93fd23a54 (diff)
downloadcrawl-ref-57ec78ae83592e5f55457fbcff4de929f5a9b7d7.tar.gz
crawl-ref-57ec78ae83592e5f55457fbcff4de929f5a9b7d7.zip
Consolidate all cases where corpses are turned into skeletons, as
suggested by dolorous in BR 1977925, and turn coloured draconian corpses into plain draconian skeletons. Same when the game attempts to create coloured draconian skeletons or simulacrums. Added autoinscription to the single inscription command ('{') - this is necessary for items with long descriptions that can't autoinscribed otherwise. Added a small hack to make death cobs (%) appear correctly in the monster list. The rest is cleanup, I believe. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5376 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index f678914f3d..bc1b0a4df0 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -139,6 +139,30 @@ static void create_monster_hide(int mons_class)
move_item_to_grid( &o, you.x_pos, you.y_pos );
}
+// Vampire draining corpses currently leaves them a time of 90, while the
+// default time is 200. I'm not sure whether this is for balancing reasons
+// or just an arbitrary difference. (jpeg)
+void turn_corpse_into_skeleton(item_def &corpse, int time)
+{
+ ASSERT(corpse.base_type == OBJ_CORPSES && corpse.sub_type == CORPSE_BODY);
+
+ // Some monsters' corpses lack the structure to leave skeletons behind.
+ if (!mons_skeleton( corpse.plus ))
+ return;
+
+ // While it is possible to distinguish draconian corpses by colour, their
+ // skeletons are indistinguishable.
+ if (mons_genus(corpse.plus) == MONS_DRACONIAN
+ && corpse.plus != MONS_DRACONIAN)
+ {
+ corpse.plus = MONS_DRACONIAN;
+ }
+
+ corpse.sub_type = CORPSE_SKELETON;
+ corpse.special = time;
+ corpse.colour = LIGHTGREY;
+}
+
void turn_corpse_into_chunks( item_def &item )
{
ASSERT( item.base_type == OBJ_CORPSES );