summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
commitbdb45bf27b86ff63c5afdff311b4065c83faf37d (patch)
treecf3a914532ecc372932b8d897e8c9abf57fbe2a4 /crawl-ref/source/monstuff.cc
parentc500c6b3582877a10bd362722bde81eb9b94b917 (diff)
downloadcrawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.tar.gz
crawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.zip
Merged in crawl.akrasiac.org patches (simple messaging, milestones). These take
effect only if compiled with -DDGAMELAUNCH. Simple messaging: interacts with dgamelaunch's messaging facility allowing viewers to send messages to the player. Milestones: Writes a milestones.txt file (in xlogfile format) for things like the player killing uniques, reaching the end of a dungeon branch, etc. (similar to notes). milestones.txt is used for game announcements by an IRC bot. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1095 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 22374c4f0c..985e40c1ab 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -34,8 +34,10 @@
#include "beam.h"
#include "cloud.h"
#include "debug.h"
+#include "describe.h"
#include "dungeon.h"
#include "fight.h"
+#include "hiscores.h"
#include "itemname.h"
#include "items.h"
#include "itemprop.h"
@@ -342,6 +344,31 @@ static void tutorial_inspect_kill()
}
}
+#ifdef MILESTONES
+static std::string milestone_kill_verb(int killer)
+{
+ return (killer == KILL_RESET? "banished " : "killed ");
+}
+
+static void check_kill_milestone(const monsters *mons, int killer, int i)
+{
+ if (mons->type == MONS_PLAYER_GHOST)
+ {
+ std::string milestone = milestone_kill_verb(killer) + "the ghost of ";
+ milestone += ghost_description(*mons, true);
+ milestone += ".";
+ mark_milestone("ghost", milestone);
+ }
+ else if (mons_is_unique(mons->type))
+ {
+ mark_milestone("unique",
+ milestone_kill_verb(killer)
+ + mons->name(DESC_NOCAP_THE, true)
+ + ".");
+ }
+}
+#endif // MILESTONES
+
void monster_die(monsters *monster, char killer, int i, bool silent)
{
if (monster->type == -1)
@@ -354,6 +381,10 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
bool in_transit = false;
const bool hard_reset = testbits(monster->flags, MF_HARD_RESET);
+#ifdef MILESTONES
+ check_kill_milestone(monster, killer, i);
+#endif
+
// From time to time Trog gives you a little bonus
if (killer == KILL_YOU && you.berserker)
{