From f284d478404c39e10de085fe203d8891db73e95c Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 21 Sep 2009 19:43:00 +0000 Subject: Backport oos mouseover descriptions for Tiles, corpses not being dropped inside walls, and LRD not working at low levels. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10768 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 8 ++++++-- crawl-ref/source/describe.cc | 4 ++-- crawl-ref/source/monstuff.cc | 5 +++++ crawl-ref/source/output.cc | 6 +++--- crawl-ref/source/shopping.cc | 24 ++++++++++++++++++++---- crawl-ref/source/stash.cc | 12 ++++++++++-- crawl-ref/source/stash.h | 1 + crawl-ref/source/tilereg.cc | 15 +++++++++++++-- 8 files changed, 60 insertions(+), 15 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 569fc49a7d..567b6c26e9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3007,6 +3007,10 @@ bool bolt::affects_wall(dungeon_feature_type wall) const if (flavour == BEAM_NUKE) return (true); + // Lee's Rapid Deconstruction + if (flavour == BEAM_FRAG) + return (true); + return (false); } @@ -5272,8 +5276,8 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle) #if DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, - "explosion at (%d, %d) : t=%d c=%d f=%d hit=%d dam=%dd%d", - pos().x, pos().y, type, colour, flavour, hit, damage.num, damage.size); + "explosion at (%d, %d) : t=%d c=%d f=%d hit=%d dam=%dd%d r=%d", + pos().x, pos().y, type, colour, flavour, hit, damage.num, damage.size, r); #endif // make a noise diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index b1497cc744..100a4ad2f3 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2127,8 +2127,8 @@ static std::string _get_feature_description_wide(int feat) void get_feature_desc(const coord_def &pos, describe_info &inf) { const dungeon_feature_type feat = grd(pos); - std::string desc = feature_description(pos, false, DESC_CAP_A, false); - std::string db_name = grd(pos) == DNGN_ENTER_SHOP ? "A shop" : desc; + std::string desc = feature_description(pos, false, DESC_CAP_A, false); + std::string db_name = grd(pos) == DNGN_ENTER_SHOP ? "A shop" : desc; std::string long_desc = getLongDescription(db_name); inf.body << desc << ".$$"; diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index e671a44084..f23f6b7c09 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -392,6 +392,11 @@ int place_monster_corpse(const monsters *monster, bool silent, if (!in_bounds(monster->pos())) return (-1); + // Don't attempt to place corpses within walls, either. + // Currently, this only applies to (shapeshifter) rock worms. + if (grid_is_wall(grd(monster->pos()))) + return (-1); + item_def corpse; const int corpse_class = fill_out_corpse(monster, corpse); diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 536f45d8c1..9f5465bd18 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2502,9 +2502,9 @@ std::string _status_mut_abilities() std::string help = (move_cost < 8) ? "very quick" : (move_cost < 10) ? "quick" : (move_cost < 13) ? "slow" - : ""; - if (!help.empty()) - status.push_back(help); + : "very slow"; + + status.push_back(help); } if (you.duration[DUR_SLOW] && !you.duration[DUR_HASTE]) diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 307873610c..c9d12e77b5 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -92,13 +92,29 @@ static std::string _purchase_keys(const std::string &s) return (list); } -static void _list_shop_keys(const std::string &purchasable, bool viewing) +static void _list_shop_keys(const std::string &purchasable, bool viewing, + int total_stock) { + ASSERT(total_stock > 0); + char buf[200]; const int numlines = get_number_of_lines(); cgotoxy(1, numlines - 1, GOTO_CRT); - std::string pkeys = _purchase_keys(purchasable); + std::string pkeys = ""; + if (viewing) + { + pkeys = "a"; + if (total_stock > 1) + { + pkeys += "-"; + pkeys += 'a' + total_stock - 1; + pkeys += ""; + } + } + else + pkeys = _purchase_keys(purchasable); + if (!pkeys.empty()) { pkeys = "[" + pkeys + "] Select Item to " @@ -287,7 +303,7 @@ static bool _in_a_shop( int shopidx ) const std::string purchasable = _shop_print_stock(stock, selected, shop, total_cost); - _list_shop_keys(purchasable, viewing); + _list_shop_keys(purchasable, viewing, stock.size()); if (!total_cost) { @@ -356,7 +372,7 @@ static bool _in_a_shop( int shopidx ) _shop_print("I'm sorry, you don't seem to have enough money.", 1); } - else if (!total_cost) + else if (!total_cost) // Nothing selected. continue; else { diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 691f387289..d965954a3a 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -123,7 +123,7 @@ bool is_stash(int x, int y) return (false); } -void describe_stash(int x, int y) +std::string get_stash_desc(int x, int y) { LevelStashes *ls = StashTrack.find_current_level(); if (ls) @@ -133,9 +133,17 @@ void describe_stash(int x, int y) { const std::string desc = s->description(); if (!desc.empty()) - mprf(MSGCH_EXAMINE_FILTER, "[Stash: %s]", desc.c_str()); + return ("[Stash: " + desc + "]"); } } + return ""; +} + +void describe_stash(int x, int y) +{ + std::string desc = get_stash_desc(x, y); + if (!desc.empty()) + mpr(desc.c_str(), MSGCH_EXAMINE_FILTER); } diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h index 3638cd52b1..03363cf65e 100644 --- a/crawl-ref/source/stash.h +++ b/crawl-ref/source/stash.h @@ -361,6 +361,7 @@ extern StashTracker StashTrack; void maybe_update_stashes(); bool is_stash(int x, int y); inline bool is_stash( const coord_def& p ) { return is_stash(p.x, p.y); } +std::string get_stash_desc(int x, int y); void describe_stash(int x, int y); std::vector item_list_in_stash( coord_def pos ); diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 66b0fb1a05..1ddc68a0e2 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -28,6 +28,7 @@ REVISION("$Rev$"); #include "player.h" #include "religion.h" #include "spells3.h" +#include "stash.h" #include "stuff.h" #include "terrain.h" #include "transfor.h" @@ -1506,13 +1507,23 @@ bool DungeonRegion::update_alt_text(std::string &alt) return (false); if (!map_bounds(gc)) return (false); - if (!see_grid(gc)) + if (!is_terrain_seen(gc)) return (false); if (you.last_clicked_grid == gc) return (false); describe_info inf; - get_square_desc(gc, inf, true); + if (see_grid(gc)) + get_square_desc(gc, inf, true); + else if (grd(gc) != DNGN_FLOOR) + get_feature_desc(gc, inf); + else + { + // For plain floor, output the stash description. + std::string stash = get_stash_desc(gc.x, gc.y); + if (!stash.empty()) + inf.body << "$" << stash; + } alt_desc_proc proc(crawl_view.msgsz.x, crawl_view.msgsz.y); process_description(proc, inf); -- cgit v1.2.3-54-g00ecf