diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-27 21:05:46 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-27 21:05:46 +0000 |
commit | ffd7b999da940618860de7ce6e786175bc9af184 (patch) | |
tree | c63ae48a90b609dfa7391acd60b39fb338544fc4 /crawl-ref/source/acr.cc | |
parent | 6c3c530aa8b2d0d48c90e67d7dcac3681b405131 (diff) | |
download | crawl-ref-ffd7b999da940618860de7ce6e786175bc9af184.tar.gz crawl-ref-ffd7b999da940618860de7ce6e786175bc9af184.zip |
Implement a very basic attempt at message condensation: Store the most
recent message in prev_message and only output it when another non-matching
message rolls in or the player gets a turn. Matching messages (must be
identical and issued in direct succession, like is the case with the
message history condensation) increase the counter, so you end up with
messages like:
You feel sick.
The killer bee misses you. (x3)
The killer bee stings you.
The killer bee stings you but doesn't do any damage.
The killer bee misses you. (x5)
...instead of the 11 lines it would have been in total.
This behaviour is controlled by the same option as the condensation in the
message history, msg_condense_repeats.
There's definitely room for improvement. At the moment the bracketed
information is written into the message itself, which will prevent
further merging in the message history, or, probably worse, cause ugly
double-merging like "The killer bee misses you. (x3) (x2)".
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9262 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 0d75164a24..3502c222c4 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -880,6 +880,7 @@ static void _input() // Currently only set if Xom accidentally kills the player. you.reset_escaped_death(); + flush_prev_message(); if (crawl_state.is_replaying_keys() && crawl_state.is_repeating_cmd() && kbhit()) @@ -909,7 +910,7 @@ static void _input() else if (player_feels_safe && you.level_type != LEVEL_ABYSS) { // We don't want those "Whew, it's safe to rest now" messages - // when you were just cast into the Abyss. Right? + // if you were just cast into the Abyss. Right? if (2 * you.hp < you.hp_max || 2 * you.magic_points < you.max_magic_points) @@ -946,9 +947,10 @@ static void _input() if (you.cannot_act()) { if (crawl_state.repeat_cmd != CMD_WIZARD) + { crawl_state.cancel_cmd_repeat("Cannot move, cancelling command " "repetition."); - + } world_reacts(); return; } @@ -990,6 +992,8 @@ static void _input() crawl_state.input_line_curr = 0; { + flush_prev_message(); + // Enable the cursor to read input. The cursor stays on while // the command is being processed, so subsidiary prompts // shouldn't need to turn it on explicitly. |