summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/kills.cc
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-05-26 18:12:04 +0200
committerRobert Vollmert <rvollmert@gmx.net>2010-07-28 19:21:47 +0200
commit000de2017e1c676cc8266efb2b5827bcb0a22790 (patch)
tree9e5fff03ed152dd1c928ddca13644ecd3fd92663 /crawl-ref/source/kills.cc
parent0d0c82d5f7445506631bf78a800d22ea554c7fe7 (diff)
downloadcrawl-ref-000de2017e1c676cc8266efb2b5827bcb0a22790.tar.gz
crawl-ref-000de2017e1c676cc8266efb2b5827bcb0a22790.zip
Convert several functions to use monster_info
This patch converts several parts of the Crawl code to use monster_info instead of accessing monsters directly. This change is very intrusive and rewrites parts of the code. Thus, bugs are quite likely being introduced. The new code is however easier to understand and maintain and thus hopefully should be a net gain once any problems are solved. The code is probably somewhat slower, but this should be undetectable in practice. Major semantic changes: - Rakshasas/Maras fakes are fully described as if they were the unequipped base form, instead of having special cases - MR is no longer reported with perfect information, but only based on what the player sees - Flight is now always perfectly reported (it already was, except possibly for randarts giving +Lev) - Mimics may be handled a bit different (the idea is that known mimics are always monsters and unknown mimics are always items) - Wounded status in messages is now colored (started as a bug, but seems a feature to me) Possible regressions: - Name generation is totally rewritten, might have regressed - In general, all the monster UI code has been refactored, possibly with regression - Special cases like mimics, rakshasas, Maras, ghosts, pan lords, named monsters, divine minions, draconians and the arena mode are likely to be the most at risk of having regressed Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
Diffstat (limited to 'crawl-ref/source/kills.cc')
-rw-r--r--crawl-ref/source/kills.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc
index 0cab6b6501..3e7e179da5 100644
--- a/crawl-ref/source/kills.cc
+++ b/crawl-ref/source/kills.cc
@@ -632,7 +632,10 @@ kill_ghost::kill_ghost(const monsters *mon)
// Check whether this is really a ghost, since we also have to handle
// the Pandemonic demons.
if (mon->type == MONS_PLAYER_GHOST && !mon->is_summoned())
- ghost_name = "The ghost of " + get_ghost_description(*mon, true);
+ {
+ monster_info mi(mon);
+ ghost_name = "The ghost of " + get_ghost_description(mi, true);
+ }
}
std::string kill_ghost::info() const