Attached Files |
9475-fix.patch [^] (3,575 bytes) 2015-03-01 23:06 [Show Content] [Hide Content]From 94f5ad44a0cc3b20811b3fb69a81ea8e2527c305 Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Sun, 1 Mar 2015 15:56:12 -0600
Subject: [PATCH] Remove unique annotations for god gifts (dpeg, 9475) and
pacification
If you convert Saint Roka his annotation follows you around even though he's an
ally. Additionally, prior to this patch, a annotation was only removed for a
pacified unique if the player saw the unique leave. This has been changed to
remove the annotation on pacification.
This has a possible edge case that I don't think can actually happen. If
the unique is pacified and then becomes hostile again before leaving out
of the player's sight the annotation won't be re-added, which could lead
to a player being surprised. If this can happen (maybe with clouds?) it's
far less frequent than an annotation remaining because the player did not
see the monster leave.
---
crawl-ref/source/godcompanions.cc | 7 +++++++
crawl-ref/source/mon-behv.cc | 6 +++++-
crawl-ref/source/mon-util.cc | 4 ++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/crawl-ref/source/godcompanions.cc b/crawl-ref/source/godcompanions.cc
index b9578a6..06ef1e4 100644
--- a/crawl-ref/source/godcompanions.cc
+++ b/crawl-ref/source/godcompanions.cc
@@ -10,6 +10,7 @@
#include <algorithm>
#include "branch.h"
+#include "dgn-overview.h"
#include "message.h"
#include "mon-util.h"
#include "religion.h"
@@ -32,11 +33,17 @@ void init_companions()
void add_companion(monster* mons)
{
ASSERT(mons->alive());
+ // Right now this is a special case for Saint Roka, but
+ // future orcish uniques should behave in the same way.
+ mons->props["no_annotate"] = true;
+ remove_unique_annotation(mons);
companion_list[mons->mid] = companion(*mons);
}
void remove_companion(monster* mons)
{
+ mons->props["no_annotate"] = false;
+ set_unique_annotation(mons);
companion_list.erase(mons->mid);
}
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index 309ad66..91fe844 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1401,6 +1401,11 @@ void behaviour_event(monster* mon, mon_event_type event, const actor *src,
{
// Why only attacks by the player change attitude? -- 1KB
mon->attitude = ATT_HOSTILE;
+ // Non-hostile uniques might be removed from dungeon annotation
+ // so we add them back.
+ if (mon->props.exists("no_annotate"))
+ mon->props["no_annotate"] = false;
+ set_unique_annotation(mon);
mons_att_changed(mon);
}
}
@@ -1570,7 +1575,6 @@ void make_mons_leave_level(monster* mon)
if (you.can_see(mon))
{
_mons_indicate_level_exit(mon);
- remove_unique_annotation(mon);
}
// Pacified monsters leaving the level take their stuff with
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 1de7e2d..9685d7c 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3152,6 +3152,10 @@ void mons_pacify(monster* mon, mon_attitude_type att, bool no_xp)
// Remove haunting, which would otherwise cause monster to continue attacking
mon->del_ench(ENCH_HAUNTING, true, true);
+ // Remove level annotation.
+ mon->props["no_annotate"] = true;
+ remove_unique_annotation(mon);
+
// Make the monster begin leaving the level.
behaviour_event(mon, ME_EVAL);
--
1.9.3 (Apple Git-50)
|