summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 14:52:59 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 14:52:59 +0000
commitd319c2e18da39b5fd050dddc77b3dd4ff8cababf (patch)
treefbf4500f007e0745491851c75acc27efaa21f455 /crawl-ref/source/misc.cc
parent56e35d49256c15144dcbfd2ebcc417d465f07879 (diff)
downloadcrawl-ref-d319c2e18da39b5fd050dddc77b3dd4ff8cababf.tar.gz
crawl-ref-d319c2e18da39b5fd050dddc77b3dd4ff8cababf.zip
Add a yes_or_no prompt if you attempt to leave the Dungeon and picked up
the Orb at one point, but are not carrying it now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10320 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index b14ae92f3a..64fe325825 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1700,6 +1700,25 @@ static bool _stair_moves_pre(dungeon_feature_type stair)
return (true);
}
+static bool _check_carrying_orb()
+{
+ // We never picked up the Orb, all's okay.
+ 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)
{
@@ -1761,7 +1780,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;
@@ -1860,9 +1880,9 @@ void up_stairs(dungeon_feature_type force_stair,
viewwindow(true, true);
- // Left Zot without enough runes to get back in (probably because
- // of dropping some runes within Zot), but need to get back in Zot
- // to get the Orb? Xom finds that funny.
+ // Left Zot without enough runes to get back in (because they were
+ // destroyed), but need to get back in Zot to get the Orb?
+ // Xom finds that funny.
if (stair_find == DNGN_RETURN_FROM_ZOT
&& branches[BRANCH_HALL_OF_ZOT].branch_flags & BFLAG_HAS_ORB)
{