From 4ba581107a1d56ce5706593f4a3917f457afb929 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 2 Oct 2007 22:40:40 +0000 Subject: Made Xom be smarter about being amused at losing/missing runes, and made Xom also be amused at runes being destroyed. Related changes: * Keep track of which items have ever been held by the player with ISFLAG_BEEN_IN_INV. * item_was_destroyed() is called when an item is destroyed (as in dropped in lava, not destroy_item() being called), and item_was_lost() is called if the item was lost (i.e., being left behind in the Abyss). * Keeps track of the number of runes that the character has collected, and how many have been left in the Halls of Zot. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2300 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abyss.cc | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'crawl-ref/source/abyss.cc') diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc index f059eb2435..05f1117227 100644 --- a/crawl-ref/source/abyss.cc +++ b/crawl-ref/source/abyss.cc @@ -219,7 +219,7 @@ static int abyss_exit_nearness() // HACK: Why doesn't is_terrain_known() work here? if (grd[x][y] == DNGN_EXIT_ABYSS - && get_screen_glyph(x, y) != '\0') + && get_screen_glyph(x, y) != ' ') { nearness = MIN(nearness, grid_distance(you.x_pos, you.y_pos, @@ -241,7 +241,7 @@ static int abyss_rune_nearness() continue; // HACK: Why doesn't is_terrain_known() work here? - if (get_screen_glyph(x, y) != '\0') + if (get_screen_glyph(x, y) != ' ') { int i = igrd[x][y]; @@ -279,19 +279,22 @@ static void xom_check_nearness() viewwindow(true, false); int exit_is_near = abyss_exit_nearness(); - if ((exit_was_near < INFINITE_DISTANCE && - exit_is_near == INFINITE_DISTANCE) - || (exit_was_near == INFINITE_DISTANCE && - exit_is_near < INFINITE_DISTANCE)) + int rune_is_near = abyss_rune_nearness(); + + if ((exit_was_near < INFINITE_DISTANCE + && exit_is_near == INFINITE_DISTANCE) + || (rune_was_near < INFINITE_DISTANCE + && rune_is_near == INFINITE_DISTANCE + && you.attribute[ATTR_ABYSSAL_RUNES] == 0)) { - xom_is_stimulated(255); + xom_is_stimulated(255, "Xom snickers loudly.", true); } - int rune_is_near = abyss_rune_nearness(); - if ((rune_was_near < INFINITE_DISTANCE && - rune_is_near == INFINITE_DISTANCE) - || (rune_was_near == INFINITE_DISTANCE && - rune_is_near < INFINITE_DISTANCE)) + if ((rune_was_near == INFINITE_DISTANCE + && rune_is_near < INFINITE_DISTANCE + && you.attribute[ATTR_ABYSSAL_RUNES] == 0) + || (exit_was_near == INFINITE_DISTANCE && + exit_is_near < INFINITE_DISTANCE)) { xom_is_stimulated(255); } @@ -338,7 +341,7 @@ void area_shift(void) grd[i][j] = DNGN_UNSEEN; // nuke items - destroy_item_stack( i, j ); + lose_item_stack( i, j ); if (mgrd[i][j] != NON_MONSTER) abyss_lose_monster( menv[ mgrd[i][j] ] ); @@ -474,19 +477,7 @@ void abyss_teleport( bool new_area ) { if (is_valid_item( mitm[k] )) { - if (mitm[k].base_type == OBJ_ORBS) - { - set_unique_item_status( OBJ_ORBS, mitm[k].sub_type, - UNIQ_LOST_IN_ABYSS ); - } - else if (is_fixed_artefact( mitm[k] )) - { - set_unique_item_status( OBJ_WEAPONS, mitm[k].special, - UNIQ_LOST_IN_ABYSS ); - } - - xom_check_lost_item( mitm[k] ); - + item_was_lost( mitm[k] ); destroy_item( k ); } } -- cgit v1.2.3-54-g00ecf