summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-12 16:55:43 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-12 16:55:43 +0000
commit659553d325a49df4870dcfa18af7f9bece5cbf16 (patch)
treea91a34276297d5e773cad2beb02b71aba63e5c1f /crawl-ref/source/delay.cc
parentdae63e7aa1492355fa025d4a18f638ea9cc59553 (diff)
downloadcrawl-ref-659553d325a49df4870dcfa18af7f9bece5cbf16.tar.gz
crawl-ref-659553d325a49df4870dcfa18af7f9bece5cbf16.zip
* Automate all the notetaking I always do when testing Xom.
NOTE_DEBUG_XOM might be a tiny bit technical or spoily, but at the same time I like the results and think this flag could actually be turned into an option to autonote all Xom effects, so I've left it on in this commit, in case someone else is playtesting Xom. * Fix a monster polymorphing into an (invisible) unseen horror naming it. * Reactivate autopickup if you kill an invisible monster or see an invisible monster become visible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9598 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index f0ec367717..5a47ce5e96 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1902,6 +1902,33 @@ inline static bool _monster_warning(activity_interrupt_type ai,
return (false);
}
+// Turns autopickup off if we ran into an invisible monster or saw a monster
+// turn invisible.
+// Turns autopickup on if we saw an invisible monster become visible or
+// killed an invisible monster.
+void autotoggle_autopickup(bool off)
+{
+ if (off)
+ {
+ if (Options.autopickup_on)
+ {
+ Options.autopickup_on = false;
+ mprf(MSGCH_WARN,
+ "Deactivating autopickup; reactivate with <w>Ctrl+A</w>.");
+ }
+ if (Options.tutorial_left)
+ {
+ learned_something_new(TUT_INVISIBLE_DANGER);
+ Options.tut_seen_invisible = you.num_turns;
+ }
+ }
+ else if (!Options.autopickup_on)
+ {
+ Options.autopickup_on = true;
+ mprf(MSGCH_WARN, "Reactivating autopickup.");
+ }
+}
+
static bool _paranoid_option_disable( activity_interrupt_type ai,
const activity_interrupt_data &at )
{
@@ -1909,34 +1936,7 @@ static bool _paranoid_option_disable( activity_interrupt_type ai,
{
const monsters* mon = static_cast<const monsters*>(at.data);
if (mon && !player_monster_visible(mon) && !mons_is_submerged(mon))
- {
- // Now that autoprayer has been removed the vectors aren't
- // really needed anymore, but let's keep them "just in case".
- std::vector<std::string> deactivatees;
- std::vector<std::string> restart;
-
- if (Options.autopickup_on)
- {
- deactivatees.push_back("autopickup");
- Options.autopickup_on = false;
- restart.push_back("Ctrl+A");
- }
-
- if (!deactivatees.empty())
- {
- mprf(MSGCH_WARN, "Deactivating %s; reactivate with %s.",
- comma_separated_line(deactivatees.begin(),
- deactivatees.end()).c_str(),
- comma_separated_line(restart.begin(),
- restart.end()).c_str());
- }
-
- if (Options.tutorial_left)
- {
- learned_something_new(TUT_INVISIBLE_DANGER);
- Options.tut_seen_invisible = you.num_turns;
- }
- }
+ autotoggle_autopickup(true);
return (true);
}
return (false);