From e80676d145343847ea8f90581d6bfa487375ef62 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 13 Jul 2008 20:06:21 +0000 Subject: Apply my latest commits to 0.4. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6531 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/034_changes.txt | 2 +- crawl-ref/docs/crawl_manual.txt | 15 ++++++++------- crawl-ref/source/acr.cc | 4 ++-- crawl-ref/source/command.cc | 4 ++-- crawl-ref/source/directn.cc | 27 ++++++++++++++++++++------- crawl-ref/source/item_use.cc | 2 +- crawl-ref/source/mon-util.cc | 3 ++- crawl-ref/source/output.cc | 19 ++++++++++++------- crawl-ref/source/output.h | 2 +- crawl-ref/source/overmap.cc | 5 +++-- crawl-ref/source/util/docs/key_changes.tex | 4 ++-- 11 files changed, 54 insertions(+), 33 deletions(-) diff --git a/crawl-ref/docs/034_changes.txt b/crawl-ref/docs/034_changes.txt index 5e1616ef74..0ceb44845c 100644 --- a/crawl-ref/docs/034_changes.txt +++ b/crawl-ref/docs/034_changes.txt @@ -27,7 +27,7 @@ them: Q quiver an item for firing ` repeat previous command 0 repeat next command # of times - G verbose list of monsters in sight + V verbose list of monsters in sight Ctrl-D define macros (synonym to '~') Ctrl-T change your allies' pickup behaviour (only available to some characters) diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt index a0131efd8c..94e17cc397 100644 --- a/crawl-ref/docs/crawl_manual.txt +++ b/crawl-ref/docs/crawl_manual.txt @@ -382,16 +382,16 @@ with yellow glyphs. Automated Travel and Exploration -------------------------------- -Crawl has an extensive automated travel system: pressing 'G' lets you -choose any dungeon level; the game will then take the shortest path to -reach this destination. You can also use autotravel on the level map +Crawl has an extensive automated travel system: pressing 'Ctrl-G' lets +you choose any dungeon level; the game will then take the shortest path +to reach this destination. You can also use autotravel on the level map ('X'): Move the cursor to the place where you want to go and hit Enter. There are several shortcuts when choosing destinations: For example, try '<' and '>' to quickly reach the staircases. When your autotravel gets interrupted, Crawl will remember the previous -destination. Hitting 'G' again and following with Enter puts the cursor -on that square. See Appendix 4 for all commands and shortcuts in +destination. Hitting 'Ctrl-G' again and following with Enter puts the +cursor on that square. See Appendix 4 for all commands and shortcuts in level-map mode. Another use of autotravel is exploration: 'o' makes your character move @@ -443,7 +443,8 @@ also appears in Appendix 4 of this text. Various other help texts are available as well, including this manual. You can also read the logbook from there by pressing ':'. Note that several commands have their own help screens, among them are targeting ('f'), level map ('X'), travel -('G') and searching ('Ctrl-F'); again, press '?' when asked for input. +('Ctrl-G') and searching ('Ctrl-F'); again, press '?' when asked for +input. If you don't like the standard keyset (either because some keys do not work properly, or because you want to decrease the amount of typing @@ -2378,7 +2379,7 @@ Other game-playing commands: p Pray (or renew an existing prayer). z Cast a spell. I List spells. - G Prints a short list of monsters in sight. + V Prints a short list of monsters in sight. t Tell commands to allies, or shout (the latter with tt). Ctrl-A Toggle autopickup. Note that encounters with diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 6e270d640a..2ac242a32d 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3476,7 +3476,7 @@ static command_type _keycode_to_command( keycode_type key ) case 'D': return CMD_NO_CMD; case 'E': return CMD_EXPERIENCE_CHECK; case 'F': return CMD_THROW_ITEM_NO_QUIVER; - case 'G': return CMD_FULL_VIEW; + case 'G': return CMD_INTERLEVEL_TRAVEL; case 'I': return CMD_DISPLAY_SPELLS; case 'M': return CMD_MEMORISE_SPELL; case 'O': return CMD_OPEN_DOOR; @@ -3485,7 +3485,7 @@ static command_type _keycode_to_command( keycode_type key ) case 'R': return CMD_REMOVE_JEWELLERY; case 'S': return CMD_SAVE_GAME; case 'T': return CMD_REMOVE_ARMOUR; - case 'V': return CMD_NO_CMD; + case 'V': return CMD_FULL_VIEW; case 'W': return CMD_WEAR_ARMOUR; case 'X': return CMD_DISPLAY_MAP; case 'Z': return CMD_ZAP_WAND; diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index eff2e4047c..e276b49933 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1744,7 +1744,7 @@ static void _add_formatted_keyhelp(column_composer &cols) 0, "Extended Movement:\n" "o : auto-explore\n" - "Ctrl-G : interlevel travel\n" + "Ctrl-G : interlevel travel (also G)\n" "Ctrl-F : Find items\n" "Ctrl-W : set Waypoint\n" "Ctrl-E : Exclude square from searches\n" @@ -1830,7 +1830,7 @@ static void _add_formatted_keyhelp(column_composer &cols) ") : display current weapons\n" "\" : display worn jewellery\n" "E : display experience info\n" - "G : list monsters in sight\n", + "V : list monsters in sight\n", true, true, _cmdhelp_textfilter); cols.add_formatted( diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index ba9bf9fe5c..746ac18bb3 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -474,10 +474,11 @@ void direction(dist& moves, targeting_type restricts, bool needs_path, bool may_target_monster, const char *prompt, targeting_behaviour *beh, bool cancel_at_self) { - static targeting_behaviour stock_behaviour; if (!beh) + { + static targeting_behaviour stock_behaviour; beh = &stock_behaviour; - + } beh->just_looking = just_looking; #ifndef USE_TILE @@ -485,8 +486,16 @@ void direction(dist& moves, targeting_type restricts, && Options.mlist_targetting == MLIST_TARGET_HIDDEN) { Options.mlist_targetting = MLIST_TARGET_ON; - bool full_info = update_monster_pane(); - _fill_monster_list(full_info); + + const int full_info = update_monster_pane(); + if (full_info == -1) + { + // If there are no monsters after all, turn the the targetting + // off again. + Options.mlist_targetting = MLIST_TARGET_HIDDEN; + } + else + _fill_monster_list(full_info); } #endif @@ -735,10 +744,14 @@ void direction(dist& moves, targeting_type restricts, else Options.mlist_targetting = MLIST_TARGET_ON; - bool full_info = update_monster_pane(); - + const int full_info = update_monster_pane(); if (Options.mlist_targetting == MLIST_TARGET_ON) - _fill_monster_list(full_info); + { + if (full_info == -1) + Options.mlist_targetting = MLIST_TARGET_HIDDEN; + else + _fill_monster_list(full_info); + } break; } #endif diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 9398b487ca..cf2efd52d2 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1412,7 +1412,7 @@ command_type fire_target_behaviour::get_command(int key) // Do this stuff unconditionally to make the prompt redraw. message_ammo_prompt(); need_prompt = true; - break; + return (CMD_NO_CMD); } case 'i': { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index ba81b53e8a..0a80500e7e 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3333,9 +3333,10 @@ void monsters::equip_weapon(item_def &item, int near, bool msg) case SPWPN_DISTORTION: mpr("Its appearance distorts for a moment."); break; + default: // A ranged weapon without special message is known to be unbranded. - if (!is_range_weapon(item)) + if (brand != SPWPN_NORMAL || !is_range_weapon(item)) message_given = false; } diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index cc48f273a0..8c7fdaf49d 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1477,13 +1477,15 @@ void get_monster_pane_info(std::vector& mons) } #define BOTTOM_JUSTIFY_MONSTER_LIST 0 -bool update_monster_pane() +// Returns -1 if the monster list is empty, 0 if there are so many monsters +// they have to be consolidated, and 1 otherwise. +int update_monster_pane() { const int max_print = crawl_view.mlistsz.y; textbackground(BLACK); if (max_print <= 0) - return (false); + return (-1); std::vector mons; get_monster_pane_info(mons); @@ -1495,10 +1497,10 @@ bool update_monster_pane() if (!monster_pane_info::less_than(mons[i-1], mons[i])) --lines_needed; - bool zombified = true; + bool full_info = true; if (lines_needed > (unsigned int) max_print) { - zombified = false; + full_info = false; // Use type names rather than full names ("small zombie" vs // "rat zombie") in order to take up less lines. @@ -1527,7 +1529,7 @@ bool update_monster_pane() // i_mons is incremented by _print_next_monster_desc if (i_print >= skip_lines && i_mons < (int) mons.size()) { - _print_next_monster_desc(mons, i_mons, zombified, + _print_next_monster_desc(mons, i_mons, full_info, Options.mlist_targetting == MLIST_TARGET_ON ? i_print : -1); } @@ -1542,11 +1544,14 @@ bool update_monster_pane() cprintf(" ... "); } - return zombified; + if (mons.empty()) + return (-1); + + return full_info; } #else // FIXME: Implement this for Tiles! -bool update_monster_pane() +int update_monster_pane() { return (false); } diff --git a/crawl-ref/source/output.h b/crawl-ref/source/output.h index 7d017f0ae8..abb0b72722 100644 --- a/crawl-ref/source/output.h +++ b/crawl-ref/source/output.h @@ -53,7 +53,7 @@ void print_stats_level(void); void draw_border(void); std::string mpr_monster_list(bool past = false); void redraw_skill(const std::string &your_name, const std::string &class_name); -bool update_monster_pane(); +int update_monster_pane(void); const char *equip_slot_to_name(int equip); diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc index 158590d297..580c7b9426 100644 --- a/crawl-ref/source/overmap.cc +++ b/crawl-ref/source/overmap.cc @@ -631,7 +631,7 @@ void annotate_level() li = li2; else if (li2 != level_id::current()) { - if (yesno("Annotate level on other end of current stairs?")) + if (yesno("Annotate level on other end of current stairs?", true, 'n')) li = li2; } @@ -644,7 +644,8 @@ void annotate_level() mpr( "Set level annotation to what? ", MSGCH_PROMPT ); char buf[77]; - cancelable_get_line( buf, sizeof(buf) ); + if (cancelable_get_line( buf, sizeof(buf) )) + return; if (strlen(buf) == 0) { diff --git a/crawl-ref/source/util/docs/key_changes.tex b/crawl-ref/source/util/docs/key_changes.tex index 42dd93ea90..3d411a1508 100644 --- a/crawl-ref/source/util/docs/key_changes.tex +++ b/crawl-ref/source/util/docs/key_changes.tex @@ -73,7 +73,7 @@ key & new command \\ \hline \key{Q} & \mc{quiver item} \\ \key{`} & \mc{redo previous command} \\ \key{0} & \mc{repeat next command} \\ -\key{G} & \mc{verbose list of monsters in sight} \\ +\key{V} & \mc{verbose list of monsters in sight} \\ \key{Ctrl-T} & \mc{toggle ally pickup mode (only for permanent allies)} \\ \key{Ctrl-D} & \mc{add macro (a new synonym for \key{$\sim$})} \\ \\ @@ -88,7 +88,7 @@ new key & command & old key \\ \hline \key{c} & chop up & was \key{D}, dissect \\ \key{E} & show experience & was \key{C} \\ \key{v} & evoke & was \key{E} \\ -\key{F} & manually throw & was \key{t} \\ +\key{F} & manually throw & was \key{t} \\ \key{t} & tell/yell & was \key{!} \\ \key{Ctrl-V} & Tiles settings & was \key{Ctrl-Q} \\ \key{Ctrl-Q} & quit & was \key{Q} -- cgit v1.2.3-54-g00ecf