summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 15:00:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 15:00:10 +0000
commitce24f53841be78bb2c80e2faf9c446215a9a8a38 (patch)
tree188d94d29e5cfe7330092baa91e9310900fc3142
parent7b6bdbbe4401348a2e40851809e0a00b480a5be0 (diff)
downloadcrawl-ref-ce24f53841be78bb2c80e2faf9c446215a9a8a38.tar.gz
crawl-ref-ce24f53841be78bb2c80e2faf9c446215a9a8a38.zip
Backport prompt before leaving without the Orb to 0.5.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10321 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/misc.cc22
-rw-r--r--crawl-ref/source/tutorial.cc2
2 files changed, 22 insertions, 2 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index f62cdd7dec..b775941358 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1685,6 +1685,25 @@ static bool _stair_moves_pre(dungeon_feature_type stair)
return (true);
}
+static bool _check_carrying_orb()
+{
+ // We never picked up the Orb, no problem.
+ if (you.char_direction != GDT_ASCENDING)
+ return (true);
+
+ // So we did pick up the Orb. Now check whether we're carrying it.
+ for (int i = 0; i < ENDOFPACK; i++)
+ {
+ if (is_valid_item( you.inv[i] )
+ && you.inv[i].base_type == OBJ_ORBS
+ && you.inv[i].sub_type == ORB_ZOT)
+ {
+ return (true);
+ }
+ }
+ return (yes_or_no("You're not carrying the Orb! Leave anyway"));
+}
+
void up_stairs(dungeon_feature_type force_stair,
entry_cause_type entry_cause)
{
@@ -1746,7 +1765,8 @@ void up_stairs(dungeon_feature_type force_stair,
&& !destination_override.is_valid();
if (leaving_dungeon
- && !yesno("Are you sure you want to leave the Dungeon?", false, 'n'))
+ && (!yesno("Are you sure you want to leave the Dungeon?", false, 'n')
+ || !_check_carrying_orb()))
{
mpr("Alright, then stay!");
return;
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 9a781d9d7b..0a0b545e1d 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -4239,7 +4239,7 @@ static void _tutorial_describe_feature(int x, int y)
{
ostr << "These stairs lead out of the dungeon. Following them "
"will end the game. The only way to win is to "
- "transport the fabled orb of Zot outside.";
+ "transport the fabled Orb of Zot outside.";
}
else
{