summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-13 19:38:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-13 19:38:46 +0000
commit5006c1e3f3d193c18cd2bf76a50163fbab1b8052 (patch)
treeed1423d4a2f0aaa58dc281d5c6fbfcaa3bc7040e /crawl-ref/source
parent3d4a6ad0b4146eb7a4540cc66474efceadbf9c12 (diff)
downloadcrawl-ref-5006c1e3f3d193c18cd2bf76a50163fbab1b8052.tar.gz
crawl-ref-5006c1e3f3d193c18cd2bf76a50163fbab1b8052.zip
Fix 2017251: The annotation prompt not escaping properly.
Fix 2016627: Ranged weapons of protection autoIDing when wielded by monsters. Fix the double prompt when using Ctrl-P in the quivering interface (part of BR 2017260), fix targetting via monster list to be turned off if there are no monsters in sight, and map auto-travel to both G and Ctrl-G. (The monster list command moves to V.) Again, I'm not sure I got all the relevant documentation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6529 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc4
-rw-r--r--crawl-ref/source/command.cc4
-rw-r--r--crawl-ref/source/directn.cc27
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/mon-util.cc3
-rw-r--r--crawl-ref/source/output.cc19
-rw-r--r--crawl-ref/source/output.h2
-rw-r--r--crawl-ref/source/overmap.cc5
-rw-r--r--crawl-ref/source/util/docs/key_changes.tex4
9 files changed, 46 insertions, 24 deletions
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 298f79f57c..35333535c7 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1745,7 +1745,7 @@ static void _add_formatted_keyhelp(column_composer &cols)
0,
"<h>Extended Movement:\n"
"<w>o</w> : auto-explore\n"
- "<w>Ctrl-G</w> : interlevel travel\n"
+ "<w>Ctrl-G</w> : interlevel travel (also <w>G</w>)\n"
"<w>Ctrl-F</w> : Find items\n"
"<w>Ctrl-W</w> : set Waypoint\n"
"<w>Ctrl-E</w> : Exclude square from searches\n"
@@ -1832,7 +1832,7 @@ static void _add_formatted_keyhelp(column_composer &cols)
"<w>)</w> : display current weapons\n"
"<w>\"</w> : display worn jewellery\n"
"<w>E</w> : display experience info\n"
- "<w>G</w> : list monsters in sight\n",
+ "<w>V</w> : 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..e47f2925e4 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1412,6 +1412,8 @@ command_type fire_target_behaviour::get_command(int key)
// Do this stuff unconditionally to make the prompt redraw.
message_ammo_prompt();
need_prompt = true;
+// key = CMD_NO_CMD;
+ return (CMD_NO_CMD);
break;
}
case 'i':
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index e063531424..986f822ef3 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3331,9 +3331,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..a162edfcfc 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -1477,16 +1477,21 @@ void get_monster_pane_info(std::vector<monster_pane_info>& 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<monster_pane_info> mons;
get_monster_pane_info(mons);
+ if (mons.empty())
+ return (-1);
+
std::sort(mons.begin(), mons.end(), monster_pane_info::less_than);
// Count how many groups of monsters there are
@@ -1495,10 +1500,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 +1532,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 +1547,11 @@ bool update_monster_pane()
cprintf(" ... ");
}
- return zombified;
+ 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}