From d319c2e18da39b5fd050dddc77b3dd4ff8cababf Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 19 Jul 2009 14:52:59 +0000 Subject: 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 --- crawl-ref/source/misc.cc | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/misc.cc') 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) { -- cgit v1.2.3-54-g00ecf