From 32ed1823706542ae3cc6bb8086beca1d81e46caf Mon Sep 17 00:00:00 2001 From: pauldubois Date: Fri, 29 Feb 2008 09:32:40 +0000 Subject: Cleaned up and applied 1895117: formatted_string and tutorial polish. - formatted_message_history handles linebreaks within color spans properly, and now makes print_formatted_paragraph redundant. (changed tutorial.cc to take advantage of this) - formatted_string handles properly (with nesting) instead of reverting to lightgrey. (changed tutorial.cc to take advantage of this, too) - The part of 1895117 that dealt with dec glyphs was already addressed in a previous patch, in a more robust way, so that got cut. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3481 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/format.cc | 121 ++++++++++-- crawl-ref/source/format.h | 15 +- crawl-ref/source/message.cc | 55 ++++-- crawl-ref/source/message.h | 3 +- crawl-ref/source/tutorial.cc | 460 +++++++++++++++++++++---------------------- 5 files changed, 392 insertions(+), 262 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index 9ac2cc71d2..38d175cda0 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -37,14 +37,23 @@ int formatted_string::get_colour(const std::string &tag) // to clobber existing text to the right of the lines being displayed // (some of the tutorial messages need this). // +// If eot_ends_format, the end of text will reset the color to default +// (pop all elements on the color stack) -- this is only useful if the +// string doesn't have balanced tags. +// formatted_string formatted_string::parse_block( const std::string &s, - bool eol_ends_format, + bool eot_ends_format, bool (*process)(const std::string &tag)) { + // Safe assumption, that incoming color is LIGHTGREY + std::vector colour_stack; + colour_stack.push_back(LIGHTGREY); + std::vector lines = split_string("\n", s, false, true); formatted_string fs; + for (int i = 0, size = lines.size(); i < size; ++i) { if (i) @@ -54,7 +63,13 @@ formatted_string formatted_string::parse_block( fs.cgotoxy(1, -1); // CR fs.movexy(0, 1); // LF } - fs += parse_string(lines[i], eol_ends_format, process); + parse_string1(lines[i], fs, colour_stack, process); + } + + if (eot_ends_format) + { + if (colour_stack.back() != colour_stack.front()) + fs.textcolor(colour_stack.front()); } return (fs); @@ -62,22 +77,64 @@ formatted_string formatted_string::parse_block( formatted_string formatted_string::parse_string( const std::string &s, - bool eol_ends_format, + bool eot_ends_format, + bool (*process)(const std::string &tag)) +{ + // Safe assumption, that incoming color is LIGHTGREY + std::vector colour_stack; + colour_stack.push_back(LIGHTGREY); + + formatted_string fs; + + parse_string1(s, fs, colour_stack, process); + if (eot_ends_format) + { + if (colour_stack.back() != colour_stack.front()) + fs.textcolor(colour_stack.front()); + } + return fs; +} + +// Parses a formatted string in much the same way as parse_string, but +// handles EOL by creating a new formatted_string. +void formatted_string::parse_string_to_multiple( + const std::string &s, + std::vector &out) +{ + std::vector colour_stack; + colour_stack.push_back(LIGHTGREY); + + std::vector lines = split_string("\n", s, false, true); + + for (int i = 0, size = lines.size(); i < size; ++i) + { + out.push_back(formatted_string()); + formatted_string& fs = out.back(); + fs.textcolor(colour_stack.back()); + parse_string1(lines[i], fs, colour_stack, NULL); + if (colour_stack.back() != colour_stack.front()) + fs.textcolor(colour_stack.front()); + } +} + +// Helper for the other parse_ methods +void formatted_string::parse_string1( + const std::string &s, + formatted_string &fs, + std::vector &colour_stack, bool (*process)(const std::string &tag)) { // FIXME This is a lame mess, just good enough for the task on hand // (keyboard help). - formatted_string fs; std::string::size_type tag = std::string::npos; std::string::size_type length = s.length(); std::string currs; - int curr_colour = LIGHTGREY; bool masked = false; for (tag = 0; tag < length; ++tag) { - bool invert_colour = false; + bool revert_colour = false; std::string::size_type endpos = std::string::npos; // Break string up if it gets too big. @@ -127,7 +184,7 @@ formatted_string formatted_string::parse_string( if (tagtext[0] == '/') { - invert_colour = true; + revert_colour = true; tagtext = tagtext.substr(1); tag++; } @@ -143,22 +200,33 @@ formatted_string formatted_string::parse_string( continue; } - const int new_colour = invert_colour? LIGHTGREY : get_colour(tagtext); if (!currs.empty()) { fs.cprintf(currs); currs.clear(); } - fs.textcolor( curr_colour = new_colour ); + + if (revert_colour) + { + colour_stack.pop_back(); + if (colour_stack.size() < 1) + { + ASSERT(false); + colour_stack.push_back(LIGHTRED); + } + } + else + { + colour_stack.push_back(get_colour(tagtext)); + } + + // fs.cprintf("%d%d", colour_stack.size(), colour_stack.back()); + fs.textcolor(colour_stack.back()); + tag += tagtext.length() + 1; } if (currs.length()) fs.cprintf(currs); - - if (eol_ends_format && curr_colour != LIGHTGREY) - fs.textcolor(LIGHTGREY); - - return (fs); } formatted_string::operator std::string() const @@ -262,6 +330,31 @@ std::string formatted_string::tostring(int s, int e) const return st; } +std::string formatted_string::to_colour_string() const +{ + std::string st; + const int size = ops.size(); + for (int i = 0; i < size; ++i) + { + if (ops[i] == FSOP_TEXT) { + // gotta double up those '<' chars ... + uint start = st.size(); + st += ops[i].text; + while (true) { + const uint left_angle = st.find('<', start); + if (left_angle == std::string::npos) break; + st.insert(left_angle, "<"); + start = left_angle + 2; + } + } else if (ops[i] == FSOP_COLOUR) { + st += "<"; + st += colour_to_str(ops[i].x); + st += ">"; + } + } + return st; +} + void formatted_string::display(int s, int e) const { int size = ops.size(); diff --git a/crawl-ref/source/format.h b/crawl-ref/source/format.h index cc479fef5c..6979ab3dc0 100644 --- a/crawl-ref/source/format.h +++ b/crawl-ref/source/format.h @@ -24,6 +24,7 @@ public: operator std::string() const; void display(int start = 0, int end = -1) const; std::string tostring(int start = 0, int end = -1) const; + std::string to_colour_string() const; void cprintf(const char *s, ...); void cprintf(const std::string &s); @@ -46,12 +47,16 @@ public: public: static formatted_string parse_string( const std::string &s, - bool eol_ends_format = true, + bool eot_ends_format = true, bool (*process_tag)(const std::string &tag) = NULL ); + static void parse_string_to_multiple( + const std::string &s, + std::vector &out); + static formatted_string parse_block( const std::string &s, - bool eol_ends_format = true, + bool eot_ends_format = true, bool (*process_tag)(const std::string &tag) = NULL ); static int get_colour(const std::string &tag); @@ -59,6 +64,12 @@ public: private: int find_last_colour() const; + static void parse_string1( + const std::string &s, + formatted_string &fs, + std::vector &colour_stack, + bool (*process_tag)(const std::string &tag)); + public: struct fs_op { diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index 75e1a46df1..dfb421c8b2 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -18,6 +18,7 @@ #include #include +#include #ifdef DOS #include @@ -40,6 +41,7 @@ #include "travel.h" #include "tutorial.h" #include "view.h" +#include "menu.h" // circular buffer for keeping past messages message_item Store_Message[ NUM_STORED_MESSAGES ]; // buffer of old messages @@ -672,11 +674,15 @@ void formatted_mpr(const formatted_string& fs, msg_channel_type channel, mpr_store_messages(imsg, channel, param); } -// output given string as formatted message, but check patterns -// for string stripped of tags and store original tagged string -// for message history -void formatted_message_history(const std::string &st, msg_channel_type channel, - int param) +// output given string as formatted message(s), but check patterns +// for string stripped of tags and store the original tagged string +// for message history. Newlines break the string into multiple +// messages. +// +// If wrap_col > 0, text is wrapped at that column. +// +void formatted_message_history(const std::string &st_nocolor, msg_channel_type channel, + int param, int wrap_col) { if (suppress_messages) return; @@ -685,20 +691,41 @@ void formatted_message_history(const std::string &st, msg_channel_type channel, if (colour == MSGCOL_MUTED) return; - formatted_string fs = formatted_string::parse_string(st); + // Apply channel color explicitly, so "foo bar baz" + // renders "baz" correctly + std::string st; + { + std::ostringstream text; + const std::string colour_str = colour_to_str(colour); + text << "<" << colour_str << ">" + << st_nocolor + << ""; + text.str().swap(st); + } - mpr_check_patterns(fs.tostring(), channel, param); + if (wrap_col) + { + linebreak_string2(st, wrap_col); + } - flush_input_buffer( FLUSH_ON_MESSAGE ); + std::vector fss; + formatted_string::parse_string_to_multiple(st, fss); - const int num_lines = crawl_view.msgsz.y; + for (int i=0; i@ in the center. The parts " + "shows your hero as the @ in the center. The parts " "of the map you remember but cannot currently see will be greyed " "out." "" EOL; @@ -449,7 +449,7 @@ static formatted_string tutorial_stats_intro() "To the right, important properties of \n" "the character are displayed. The most \n" "basic one is your health, measured as \n" - "HP: " << you.hp << "/" << you.hp_max << ". "; + "HP: " << you.hp << "/" << you.hp_max << ". "; if (Options.tutorial_type==TUT_MAGIC_CHAR) istr << " "; @@ -458,18 +458,18 @@ static formatted_string tutorial_stats_intro() "These are your current out \n" "of maximum health points. When health \n" "drops to zero, you die. \n" - "Magic: " + "Magic: " << you.magic_points << "/" << you.max_magic_points << - " is your energy for casting \n" + " is your energy for casting \n" "spells, although more mundane actions \n" "often draw from Magic, too. \n" - "Further down, Strength, Dexterity and \n" - "Intelligence are shown and provide an \n" + "Further down, Strength, Dexterity and \n" + "Intelligence are shown and provide an \n" "all-around account of the character's \n" "attributes. \n" - "" + "" " \n" - " --more-- Press Escape to skip the basics\n" + " --more-- Press Escape to skip the basics\n" " \n" " \n"; return formatted_string::parse_block(istr.str(), false); @@ -483,9 +483,9 @@ static formatted_string tutorial_message_intro() "This lower part of the screen is reserved for messages. Everything " "related to the tutorial is shown in this colour. If you missed " "something, previous messages can be read again with " - "Ctrl-P." + "Ctrl-P." "" EOL; - result += " --more-- Press Escape to skip the basics"; + result += " --more-- Press Escape to skip the basics"; linebreak_string2(result,get_tutorial_cols()); return formatted_string::parse_block(result, false); @@ -497,11 +497,11 @@ static void tutorial_movement_info() std::string text = "To move your character, use the numpad; try Numlock both on and off. " "If your system has no number pad, or if you are familiar with the vi " - "keys, movement is also possible with hjklyubn. A basic " - "command list can be found under ?, and the most " + "keys, movement is also possible with hjklyubn. A basic " + "command list can be found under ?, and the most " "important commands will be explained to you as it becomes necessary."; mesclr(); - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); } // copied from display_mutations and adapted @@ -619,9 +619,9 @@ void tutorial_death_screen() break; case 2: text = "Rest between encounters. In Crawl, searching and resting are " - "one and the same. To search for one turn, press s, " - "., delete or keypad-5. " - "Pressing 5 or shift-and-keypad-5 will " + "one and the same. To search for one turn, press s, " + "., delete or keypad-5. " + "Pressing 5 or shift-and-keypad-5 will " "let you rest for a longer time (you will stop resting when " "fully healed)."; break; @@ -644,7 +644,7 @@ void tutorial_death_screen() text = "Sorry, no hint this time, though there should have been one."; } } - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); more(); mpr( "See you next game!", MSGCH_TUTORIAL); @@ -661,32 +661,32 @@ void tutorial_finished() Options.tutorial_left = 0; text = "Congrats! You survived until the end of this tutorial - be sure to " - "try the other ones as well. Note that the help screen (?) " + "try the other ones as well. Note that the help screen (?) " "will look different from now on. Here's a last playing hint:"; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); more(); if (Options.tut_explored) { text = "Walking around and exploring levels gets easier by using " - "auto-explore (Ctrl-O). You can even make Crawl " + "auto-explore (Ctrl-O). You can even make Crawl " "automatically pick up interesting items by setting the " - "option explore_greedy=true in the init file."; + "option explore_greedy=true in the init file."; } else if (Options.tut_travel) { text = "There is a convenient way for travelling between far away " - "dungeon levels: press Ctrl-G and enter the desired " + "dungeon levels: press Ctrl-G and enter the desired " "destination. If your travel gets interrupted, issueing " - "Ctrl-G Enter will continue it."; + "Ctrl-G Enter will continue it."; } else if (Options.tut_stashes) { text = "You can search among all items existing in the dungeon with " - "the Ctrl-F command. For example, " - "Ctrl-F \"knife\" will list all knives. You can then " + "the Ctrl-F command. For example, " + "Ctrl-F \"knife\" will list all knives. You can then " "travel to one of the spots. It is even possible to enter words " - "like \"shop\" or \"altar\"."; + "like \"shop\" or \"altar\"."; } else { @@ -695,33 +695,33 @@ void tutorial_finished() { case 0: text = "The game keeps an automated logbook for your characters. Use " - "?: to read it. You can enter notes manually with " - "the : command. Once your character perishes, two " - "morgue files are left in the /morgue directory. " + "?: to read it. You can enter notes manually with " + "the : command. Once your character perishes, two " + "morgue files are left in the /morgue directory. " "The one ending in .txt contains a copy of your logbook. " - "During play, you can create a dump file with #."; + "During play, you can create a dump file with #."; break; case 1: - text = "Crawl has a macro function built in: press ~m " + text = "Crawl has a macro function built in: press ~m " "to define a macro by first specifying a trigger key (say, " - "F1) and a command sequence, for example " - "Za+.. The latter will make the F1 " + "F1) and a command sequence, for example " + "Za+.. The latter will make the F1 " "key always zap the spell in slot a at the nearest monster. " - "For more information on macros, type ?~."; + "For more information on macros, type ?~."; break; case 2: text = "The interface can be greatly customised. All options are " - "explained in the file crawl_options.txt which " - "can be found in the docs directory. The " - "options themselves are set in init.txt or " - ".crawlrc. Crawl will complain if it can't " + "explained in the file crawl_options.txt which " + "can be found in the docs directory. The " + "options themselves are set in init.txt or " + ".crawlrc. Crawl will complain if it can't " "find either file.\n"; break; default: text = "Oops... No hint for now. Better luck next time!"; } } - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); more(); Options.tutorial_events.init(false); @@ -750,13 +750,13 @@ void tutorial_dissection_reminder(bool healthy) Options.tut_just_triggered = true; std::string text; - text += "If you don't want to eat it, consider Dissecting " - "this corpse under prayer as a sacrifice to "; + text += "If you don't want to eat it, consider Dissecting " + "this corpse under prayer as a sacrifice to "; text += god_name(you.religion); - text += ". Whenever you view a corpse while in tutorial mode " + text += ". Whenever you view a corpse while in tutorial mode " "you can reread this information."; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); if (is_resting()) stop_running(); @@ -789,16 +789,16 @@ void tutorial_healing_reminder() std::string text; text = "Remember to rest between fights and to enter unexplored " "terrain with full hitpoints and magic. For resting, " - "press 5 or Shift-numpad 5."; + "press 5 or Shift-numpad 5."; if (you.religion == GOD_TROG && !you.duration[DUR_BERSERKER] && !you.duration[DUR_EXHAUSTED] && you.hunger_state >= HS_SATIATED) { text += "\nAlso, berserking might help you not to lose so many " "hitpoints in the first place. To use your abilities type " - "a."; + "a."; } - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); if (is_resting()) stop_running(); @@ -853,16 +853,22 @@ void taken_new_item(unsigned char item_type) } #ifndef USE_TILE -static std::string colour_to_tag(int col, bool closed = false) +// As safely as possible, colourize the passed glyph. +// Handles quoting "<", MBCS-ing unicode, and +// making DEC characters safe if not properly printable. +static std::string colourize_glyph(int col, unsigned glyph) { - std::string tag = "<"; - if (closed) - tag += "/"; - tag += colour_to_str(col); - tag += ">"; - - return tag; + std::string colour_str = colour_to_str(col); + std::ostringstream text; + text << "<" << colour_str << ">"; + + text << stringize_glyph(glyph); + if (glyph == '<') text << '<'; + + text << ""; + return text.str(); } + #endif static bool mons_is_highlighted(const monsters *mons) @@ -893,17 +899,16 @@ void tutorial_first_monster(const monsters &mon) Options.tutorial_left--; Options.tut_just_triggered = true; - std::string text = "That "; + std::string text = "That "; #ifndef USE_TILE unsigned ch; unsigned short col; get_mons_glyph(&mon, &ch, &col); - text += colour_to_tag(col); - text += ch; - text += " is a monster, usually depicted by a letter. Some typical " - "early monsters look like r, g, " - "b or K. " + text += colourize_glyph(col, ch); + text += " is a monster, usually depicted by a letter. Some typical " + "early monsters look like r, g, " + "b or K. " #else // need to highlight monster const coord_def ep = grid2view(coord_def(mon.x, mon.y)); @@ -914,27 +919,27 @@ void tutorial_first_monster(const monsters &mon) text += ". Examples for typical early monsters are: rat, " "giant newt, kobold and goblin. " #endif - "You can gain information about it by pressing x and " + "You can gain information about it by pressing x and " "moving the cursor on the monster." "\nTo attack this monster with your wielded weapon, just move into " "it."; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); if (Options.tutorial_type == TUT_RANGER_CHAR) { text = "However, as a hunter you will want to deal with it using your " - "bow. If you have a look at your bow with v, you'll " - "find an explanation of how to do this. First wield " + "bow. If you have a look at your bow with v, you'll " + "find an explanation of how to do this. First wield " "it, then follow the instructions."; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); } else if (Options.tutorial_type == TUT_MAGIC_CHAR) { text = "However, as a conjurer you will want to deal with it using magic. " - "If you have a look at your spellbook with v, you'll " + "If you have a look at your spellbook with v, you'll " "find an explanation of how to do this."; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); } } @@ -954,32 +959,30 @@ void tutorial_first_item(const item_def &item) Options.tutorial_left--; Options.tut_just_triggered = true; - std::string text = "That "; + std::string text = "That "; #ifndef USE_TILE unsigned ch; unsigned short col; get_item_glyph(&item, &ch, &col); - text += colour_to_tag(col); - text += ch; - text += ""; + text += colourize_glyph(col, ch); #else // highlight item const coord_def ep = grid2view(coord_def(item.x, item.y)); tile_place_cursor(ep.x-1,ep.y-1,true); #endif - text += " is an item. If you move there and press g or " - ", you will pick it up. " + text += " is an item. If you move there and press g or " + ", you will pick it up. " #ifndef USE_TILE "Generally, items are shown by " - "non-letter symbols like %?!\"=()[. " + "non-letter symbols like %?!\"=()[. " #endif "Once it is in your inventory, you can drop it again with " - "d. Several types of objects will usually be picked up " + "d. Several types of objects will usually be picked up " "automatically." - "\nAny time you view an item, you can read about its " + "\nAny time you view an item, you can read about its " "properties and description."; - print_formatted_paragraph(text, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols()); } // Here most of the tutorial messages for various triggers are handled. @@ -1014,25 +1017,25 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_SEEN_POTION: text << "You have picked up your first potion" #ifndef USE_TILE - " ('!')" + " ('!')" #endif - ". Use q to drink (quaff) it."; + ". Use q to drink (quaff) it."; break; case TUT_SEEN_SCROLL: text << "You have picked up your first scroll" #ifndef USE_TILE - " ('?')" + " ('?')" #endif - ". Type r to read it."; + ". Type r to read it."; break; case TUT_SEEN_WAND: text << "You have picked up your first wand" #ifndef USE_TILE - " ('/')" + " ('/')" #endif - ". Type z to zap it."; + ". Type z to zap it."; break; case TUT_SEEN_SPBOOK: @@ -1041,12 +1044,12 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) "('"; get_item_symbol(DNGN_ITEM_BOOK, &ch, &colour); text << static_cast(ch) - << "') " + << "') " #endif - << "that you can read by typing r. " + << "that you can read by typing r. " "If it's a spellbook you'll then be able to memorise " - "spells via M and cast a memorised spell with " - "Z."; + "spells via M and cast a memorised spell with " + "Z."; if (you.religion == GOD_TROG) { @@ -1054,7 +1057,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) << god_name(GOD_TROG) << ", though, you might instead wish to burn those tomes of " "hated magic by using the corresponding " - "ability."; + "ability."; } else if (!you.skills[SK_SPELLCASTING]) { @@ -1062,18 +1065,18 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) "spellcasting by reading lots of scrolls."; } text << "\nDuring the tutorial you can reread this information at " - "any time by viewing the item in question."; + "any time by viewing the item in question."; break; case TUT_SEEN_WEAPON: text << "This is the first weapon " #ifndef USE_TILE - "('(') " + "('(') " #endif "you've picked up. " - "Use w to wield it, but be aware that this weapon " + "Use w to wield it, but be aware that this weapon " "might train a different skill from your current one. You can " - "view the weapon's properties with v."; + "view the weapon's properties with v."; if (Options.tutorial_type == TUT_BERSERK_CHAR) { @@ -1083,10 +1086,10 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) break; case TUT_SEEN_MISSILES: - text << "This is the first stack of missiles (')') you've " + text << "This is the first stack of missiles (')') you've " "picked up. Darts can be thrown by hand, but other missile types " "like arrows and needles require a launcher and training in " - "using it to be really effective. v gives more " + "using it to be really effective. v gives more " "information about both missiles and launcher."; if (Options.tutorial_type == TUT_RANGER_CHAR) @@ -1110,11 +1113,11 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_SEEN_ARMOUR: text << "This is the first piece of armour " #ifndef USE_TILE - "('[') " + "('[') " #endif - "you've picked up. Use W to wear it and " - "T to take it off again. You can view its " - "properties with v."; + "you've picked up. Use W to wear it and " + "T to take it off again. You can view its " + "properties with v."; if (you.species == SP_CENTAUR || you.species == SP_MINOTAUR) { @@ -1134,19 +1137,19 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_SEEN_FOOD: text << "You have picked up some food" #ifndef USE_TILE - " ('%')" + " ('%')" #endif - ". You can eat it by typing e."; + ". You can eat it by typing e."; break; case TUT_SEEN_CARRION: text << "You have picked up a corpse" #ifndef USE_TILE - " ('%')" + " ('%')" #endif ". When a corpse is lying on the ground, you can " - "Dissect with a sharp implement. Once hungry you " - "can eat the resulting chunks (though they may " + "Dissect with a sharp implement. Once hungry you " + "can eat the resulting chunks (though they may " "not be healthy)."; if (god_likes_butchery(you.religion)) @@ -1157,27 +1160,27 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) << "accept rotting flesh."; } text << "\nDuring the tutorial you can reread this information at " - "any time by viewing the item in question."; + "any time by viewing the item in question."; break; case TUT_SEEN_JEWELLERY: text << "You have picked up a a piece of jewellery, either a ring" #ifndef USE_TILE - << " ('=')" + << " ('=')" #endif << " or an amulet" #ifndef USE_TILE - << " ('\"')" + << " ('\"')" #endif - << ". Type P to put it on and R to remove " - "it. You can view it with v although often magic " + << ". Type P to put it on and R to remove " + "it. You can view it with v although often magic " "is necessary to reveal its true nature."; break; case TUT_SEEN_MISC: text << "This is a curious object indeed. You can play around with it " - "to find out what it does by wielding and " - "Evoking it."; + "to find out what it does by wielding and " + "Evoking it."; break; case TUT_SEEN_STAFF: @@ -1186,16 +1189,16 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) ", both of which are represented by '"; get_item_symbol(DNGN_ITEM_STAVE, &ch, &colour); text << static_cast(ch) - << "'" + << "'" #endif - ". Both must be wielded to be of use. " + ". Both must be wielded to be of use. " "Magicians use staves to increase their power in certain spell " "schools. By contrast, a rod allows the casting of certain " "spells even without magic knowledge simply by " - "Evoking it. For the latter the power depends on " + "Evoking it. For the latter the power depends on " "your Evocations skill."; text << "\nDuring the tutorial you can reread this information at " - "any time by viewing the item in question."; + "any time by viewing the item in question."; break; case TUT_SEEN_STAIRS: @@ -1206,16 +1209,15 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) #ifndef USE_TILE object = env.show[ex][ey]; colour = env.show_col[ex][ey]; - get_item_symbol( object, &ch, &colour ); + { unsigned short dummy; get_item_symbol( object, &ch, &dummy ); } - text << colour_to_tag(colour) << static_cast(ch) - << " "; + text << colourize_glyph(colour, ch) << " "; #else tile_place_cursor(ep.x-1,ep.y-1,true); #endif text << "are some downstairs. You can enter the next (deeper) " - "level by following them down (>). To get back to " - "this level again, press << while standing on the " + "level by following them down (>). To get back to " + "this level again, press << while standing on the " "upstairs."; break; @@ -1230,21 +1232,18 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) colour = env.show_col[ex][ey]; get_item_symbol( object, &ch, &colour ); - text << colour_to_tag(colour) << static_cast(ch); - if (ch == '<') - text << "<"; - text << " "; + text << colourize_glyph(colour, ch) << " "; #else tile_place_cursor(ep.x-1,ep.y-1,true); #endif text << "are some kind of escape hatch. You can use them to " - "quickly leave a level with << and >, " + "quickly leave a level with << and >, " "respectively, but will usually be unable to return right away."; break; case TUT_SEEN_TRAP: text << "Oops... you just triggered a trap. An unwary adventurer will " - "occasionally stumble into one of these nasty constructions "; + "occasionally stumble into one of these nasty constructions"; #ifndef USE_TILE object = env.show[ex][ey]; colour = env.show_col[ex][ey]; @@ -1252,7 +1251,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) if (ch == ' ' || colour == BLACK) colour = LIGHTCYAN; - text << "depicted by " << colour_to_tag(colour) << "^"; + text << " depicted by " << colourize_glyph(colour, '^'); #endif text << ". They can do physical damage (with darts or needles, for " "example) or have other, more magical effects, like " @@ -1265,13 +1264,12 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) object = env.show[ex][ey]; colour = env.show_col[ex][ey]; get_item_symbol( object, &ch, &colour ); - - text << colour_to_tag(colour) << static_cast(ch) << " "; + text << colourize_glyph(colour, ch) << " "; #else tile_place_cursor(ep.x-1,ep.y-1,true); #endif text << "is an altar. You can get information about it by pressing " - "p while standing on the square. Before taking up " + "p while standing on the square. Before taking up " "the responding faith you'll be asked for confirmation."; break; @@ -1281,10 +1279,9 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) #endif text << "That " #ifndef USE_TILE - "" << stringize_glyph(get_screen_glyph(x,y)) - << " " + << colourize_glyph(YELLOW, get_screen_glyph(x,y)) << " " #endif - "is a shop. You can enter it by typing <<."; + "is a shop. You can enter it by typing <<."; break; case TUT_SEEN_DOOR: @@ -1296,11 +1293,11 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) #endif text << "That " #ifndef USE_TILE - "" << stringize_glyph(get_screen_glyph(x,y)) << " " + << colourize_glyph(WHITE, get_screen_glyph(x,y)) << " " #endif "is a closed door. You can open it by walking into it. " "Sometimes it is useful to close a door. Do so by pressing " - "c, followed by the direction."; + "c, followed by the direction."; break; case TUT_KILLED_MONSTER: @@ -1333,20 +1330,20 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) text << "\nAlso, new experience levels let you learn more spells " "(the Spellcasting skill also does this). For now, " "you should try to memorise the second spell of your " - "starting book with Mcb, which can then be " - "zapped with Zb."; + "starting book with Mcb, which can then be " + "zapped with Zb."; } break; case TUT_SKILL_RAISE: text << "One of your skills just got raised. To view or manage your " - "skill set, type m."; + "skill set, type m."; break; case TUT_YOU_ENCHANTED: text << "Enchantments of all types can befall you temporarily. " "Brief descriptions of these appear at the lower end of the stats " - "area. Press @ for more details. A list of all " + "area. Press @ for more details. A list of all " "possible enchantments is in the manual."; break; @@ -1361,7 +1358,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) if (!i_feel_safe()) text << "find a quiet corner and "; - text << "wait with 5) or you could quaff a potion of " + text << "wait with 5) or you could quaff a potion of " "healing. "; break; @@ -1371,7 +1368,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) if (!i_feel_safe()) text << "find a quiet corner and "; - text << "wait with 5) or you could quaff a potion of " + text << "wait with 5) or you could quaff a potion of " "healing. "; break; @@ -1386,7 +1383,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_YOU_HUNGRY: text << "There are two ways to overcome hunger: food you started " "with or found, and selfmade chunks from corpses. To get the " - "latter, all you need to do is Dissect a corpse " + "latter, all you need to do is Dissect a corpse " "with a sharp implement. Your starting weapon will do nicely. " "Try to dine on chunks in order to save permanent food."; @@ -1396,7 +1393,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_YOU_STARVING: text << "You are now suffering from terrible hunger. You'll need to " - "eat something quickly, or you'll die. The safest " + "eat something quickly, or you'll die. The safest " "way to deal with this is to simply eat something from your " "inventory rather than wait for a monster to leave a corpse."; @@ -1406,7 +1403,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_MULTI_PICKUP: text << "There's a more comfortable way to pick up several items at the " - "same time. If you press , or g twice " + "same time. If you press , or g twice " "you can choose items from a menu. This takes fewer keystrokes " "but has no influence on the number of turns needed. Multi-pickup " "will be interrupted by monsters or other dangerous events."; @@ -1420,7 +1417,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) text << "Sadly, your inventory is limited to 52 items, and it appears " "your knapsack is full."; - text << " However, this is easy enough to rectify: simply drop " + text << " However, this is easy enough to rectify: simply drop " "some of the stuff you don't need or that's too heavy to lug " "around permanently."; break; @@ -1428,13 +1425,13 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_ROTTEN_FOOD: text << "One or more of the chunks or corpses you carry has started to " "rot. Few races can digest these safely, so you might just as " - "well drop them now."; + "well drop them now."; break; case TUT_MAKE_CHUNKS: text << "How lucky! That monster left a corpse which you can now " - "Dissect. One or more chunks will appear that you " - "can then eat. Beware that some chunks may be, " + "Dissect. One or more chunks will appear that you " + "can then eat. Beware that some chunks may be, " "sometimes or always, hazardous. Only experience can help " "you here."; @@ -1456,56 +1453,56 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) text << "Hey, that monster left a corpse! If you don't need it for " "food or other purposes, you can sacrifice it to " << god_name(you.religion) - << " by Dissecting it while praying."; + << " by Dissecting it while praying."; break; case TUT_SHIFT_RUN: text << "Walking around takes fewer keystrokes if you press " - "Shift-direction or / direction. " + "Shift-direction or / direction. " "That will let you run until a monster comes into sight or " "your character sees something interesting."; break; case TUT_MAP_VIEW: text << "As you explore a level, orientation can become difficult. " - "Press X to bring up the level map. Typing " - "? shows the list of level map commands. " + "Press X to bring up the level map. Typing " + "? shows the list of level map commands. " "Most importantly, moving the cursor to a spot and pressing " - ". or Enter lets your character move " + ". or Enter lets your character move " "there on its own."; break; case TUT_DONE_EXPLORE: text << "You have explored the dungeon on this level. The downstairs look " - "like '>'. Proceed there and press > to " + "like '>'. Proceed there and press > to " "go down. "; if (Options.tutorial_events[TUT_SEEN_STAIRS]) { text << "In rare cases, you may have found no downstairs at all. " "Try searching for secret doors in suspicious looking spots; " - "use s, . or 5 to do so."; + "use s, . or 5 to do so."; } else { text << "Each level of Crawl has three white up and three white down " "stairs. Unexplored parts can often be accessed via another " "level or through secret doors. To find the latter, search " - "the adjacent squares of walls for one turn with s " - "or ., or for 100 turns with 5 or " + "the adjacent squares of walls for one turn with s " + "or ., or for 100 turns with 5 or " "Shift-numpad 5."; } break; case TUT_NEED_HEALING: text << "If you're low on hitpoints or magic and there's no urgent need " - "to move, you can rest for a bit. Press 5 or " - "shift-numpad-5 to do so."; + "to move, you can rest for a bit. Press 5 or " + "shift-numpad-5 to do so."; break; case TUT_NEED_POISON_HEALING: text << "Your poisoning could easily kill you, so now would be a good " - "time to quaff a potion of heal wounds or, better " + "time to quaff a potion of heal wounds or, better " "yet, a potion of healing. If you have seen neither of these so " "far, try unknown ones in your inventory. Good luck!"; break; @@ -1513,7 +1510,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_POSTBERSERK: text << "Berserking is extremely exhausting! It burns a lot of nutrition, " "and afterwards you are slowed down and occasionally even pass " - "out. Press @ to see your current status."; + "out. Press @ to see your current status."; break; case TUT_RUN_AWAY: @@ -1531,7 +1528,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) { text << "\nAlso, with " << god_name(you.religion) - << "'s support you can use your Berserk ability (a) " + << "'s support you can use your Berserk ability (a) " "to temporarily gain more hitpoints and greater strength. "; } break; @@ -1548,11 +1545,11 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) "like Invisibility. The only reliable way to get rid of mutations " "is with potions of cure mutation. There are about as many " "harmful as beneficial mutations, and most of them have three " - "levels. Check your mutations with A."; + "levels. Check your mutations with A."; break; case TUT_NEW_ABILITY: - text << "You just gained a new ability. Press a to take a " + text << "You just gained a new ability. Press a to take a " "look at your abilities or to use one of them."; break; @@ -1561,7 +1558,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) && you.inv[ you.equip[EQ_WEAPON] ].sub_type == WPN_BOW) { text << "You can easily switch between weapons in slots a and " - "b by pressing '."; + "b by pressing '."; } break; @@ -1571,12 +1568,12 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) text << "While unsporting, it is sometimes useful to attack a fleeing " "monster by throwing something after it. To do this, press " - "t, choose a throwing weapon, e.g. one of your " - "spears, use + to select a monster and press " - "., f or Enter. The closest " + "t, choose a throwing weapon, e.g. one of your " + "spears, use + to select a monster and press " + "., f or Enter. The closest " "monster will be autoselected. If you've got the fire_order " - "option set you can directly use ff or " - "f+. instead; the game will pick the first weapon " + "option set you can directly use ff or " + "f+. instead; the game will pick the first weapon " "that fits the option."; break; @@ -1585,7 +1582,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) tile_place_cursor(ep.x-1,ep.y-1,true); #endif text << "That monster looks a bit unusual. You might wish to examine " - "it a bit more closely by pressing x and moving " + "it a bit more closely by pressing x and moving " "the cursor onto its square."; break; @@ -1600,7 +1597,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) if ( !text.str().empty() ) { std::string s = text.str(); - print_formatted_paragraph(s, get_tutorial_cols(), MSGCH_TUTORIAL); + formatted_message_history(s, MSGCH_TUTORIAL, 0, get_tutorial_cols()); } if (is_resting()) @@ -1619,15 +1616,16 @@ formatted_string tut_abilities_info() if (you.religion != GOD_NO_GOD) { text << - "Renounce Religion will make your character leave your god" EOL + "Renounce Religion will make your character leave your god" EOL "(and usually anger said god)"; if (you.religion == GOD_TROG) { - text << ", while Berserk temporarily increases your" EOL + text << ", while Berserk temporarily increases your" EOL "damage output in melee fights"; } text << "."; } + text << ""; return formatted_string::parse_string(text.str(), false); } @@ -1638,9 +1636,9 @@ static std::string tut_target_mode(bool spells = false) std::string result; result = "then be taken to target mode with the nearest monster or previous " "target already targetted. You can also cycle through all hostile " - "monsters in sight with + or -. " + "monsters in sight with + or -. " "Once you're aiming at the correct monster, simply hit " - "f, Enter or . to shoot at it. " + "f, Enter or . to shoot at it. " "If you miss, "; if (spells) @@ -1648,14 +1646,14 @@ static std::string tut_target_mode(bool spells = false) else result += "ff"; - result += " fires at the same target again."; + result += " fires at the same target again."; return (result); } static std::string tut_abilities() { - return ("To do this enter the ability menu with a, and then " + return ("To do this enter the ability menu with a, and then " "choose the corresponding ability. Note that such an attempt of " "activation, especially by the untrained, is likely to fail."); } @@ -1664,9 +1662,9 @@ static std::string tut_throw_stuff(const item_def &item) { std::string result; - result = "To do this, type t to throw, then "; + result = "To do this, type t to throw, then "; result += item.slot; - result += " for "; + result += " for "; result += (item.quantity > 1 ? "these" : "this"); result += " "; result += item_base_name(item); @@ -1702,7 +1700,7 @@ void tutorial_describe_item(const item_def &item) { ostr << "\nThis weapon offers its wearer protection from " "certain sources. For an overview of your resistances " - "(among other things) type %."; + "(among other things) type %."; break; } return; @@ -1714,9 +1712,9 @@ void tutorial_describe_item(const item_def &item) if (!wielded) { - ostr << "You can wield this weapon with w, or use " - "' to switch between the weapons in slot " - "a and b. (Use = to adjust item slots.)"; + ostr << "You can wield this weapon with w, or use " + "' to switch between the weapons in slot " + "a and b. (Use = to adjust item slots.)"; // weapon skill used by this weapon and the best weapon skill int curr_wpskill, best_wpskill; @@ -1742,10 +1740,10 @@ void tutorial_describe_item(const item_def &item) { ostr << "\nOn second look you've been training in " << skill_name(best_wpskill) - << " for a while, so maybe you should " + << " for a while, so maybe you should " "continue training that rather than " << skill_name(curr_wpskill) - << ". (Type m to see the skill " + << ". (Type m to see the skill " "management screen for the actual numbers.)"; long_text = true; } @@ -1755,7 +1753,7 @@ void tutorial_describe_item(const item_def &item) if (is_range_weapon(item)) { ostr << "To attack a monster, you only need to " - "fire the appropriate type of ammunition. " + "fire the appropriate type of ammunition. " "You'll "; ostr << tut_target_mode(); } @@ -1767,7 +1765,7 @@ void tutorial_describe_item(const item_def &item) if (is_throwable(item, you.body_size()) && !long_text) { ostr << "\n\nSome weapons (including this one), can also be " - "thrown. "; + "thrown. "; ostr << tut_throw_stuff(item); long_text = true; } @@ -1806,7 +1804,7 @@ void tutorial_describe_item(const item_def &item) else if (is_launched(&you, you.weapon(), item)) { ostr << "As you're already wielding the appropriate launcher, " - "you can simply fire " + "you can simply fire " << (item.quantity > 1 ? "these" : "this") << " " << item.name(DESC_BASENAME) << (item.quantity > 1? "s" : "") @@ -1819,7 +1817,7 @@ void tutorial_describe_item(const item_def &item) << (item.quantity > 1 ? "these" : "this") << " " << item.name(DESC_BASENAME) << (item.quantity > 1? "s" : "") - << ", first you need to wield an appropriate " + << ", first you need to wield an appropriate " "launcher."; } Options.tutorial_events[TUT_SEEN_MISSILES] = 0; @@ -1831,21 +1829,21 @@ void tutorial_describe_item(const item_def &item) if (you.species == SP_CENTAUR && item.sub_type == ARM_BOOTS) { ostr << "As a Centaur you cannot wear boots. " - "(Type A to see a list of your mutations " + "(Type A to see a list of your mutations " "and innate abilities.)"; wearable = false; } else if (you.species == SP_MINOTAUR && is_hard_helmet(item)) { ostr << "As a Minotaur you cannot wear helmets. " - "(Type A to see a list of your mutations " + "(Type A to see a list of your mutations " "and innate abilities.)"; wearable = false; } else { - ostr << "You can wear pieces of armour with W and take " - "them off again with T."; + ostr << "You can wear pieces of armour with W and take " + "them off again with T."; } if (!item_type_known(item) && @@ -1869,7 +1867,7 @@ void tutorial_describe_item(const item_def &item) { ostr << "\n\nThis armour offers its wearer protection from " "certain sources. For an overview of your resistances " - "(among other things) type %."; + "(among other things) type %."; } if (is_artefact(item) && gives_ability(item)) { @@ -1881,12 +1879,12 @@ void tutorial_describe_item(const item_def &item) break; } case OBJ_WANDS: - ostr << "The magic within can be unleashed by zapping it."; + ostr << "The magic within can be unleashed by zapping it."; Options.tutorial_events[TUT_SEEN_WAND] = 0; break; case OBJ_FOOD: - ostr << "Food can simply be eaten. "; + ostr << "Food can simply be eaten. "; if (item.sub_type == FOOD_CHUNK) { ostr << "Note that most species refuse to eat raw meat unless " @@ -1901,13 +1899,13 @@ void tutorial_describe_item(const item_def &item) break; case OBJ_SCROLLS: - ostr << "Type r to read this scroll. "; + ostr << "Type r to read this scroll. "; Options.tutorial_events[TUT_SEEN_SCROLL] = 0; break; case OBJ_JEWELLERY: { - ostr << "Jewellery can be Put on or Removed " + ostr << "Jewellery can be Put on or Removed " "again. "; if (item_known_cursed( item )) @@ -1923,7 +1921,7 @@ void tutorial_describe_item(const item_def &item) << (item.sub_type < NUM_RINGS ? "ring" : "amulet") << " offers its wearer protection " "from certain sources. For an overview of your " - "resistances (among other things) type %."; + "resistances (among other things) type %."; } if (gives_ability(item)) { @@ -1935,21 +1933,21 @@ void tutorial_describe_item(const item_def &item) break; } case OBJ_POTIONS: - ostr << "Use q to quaff this potion. "; + ostr << "Use q to quaff this potion. "; Options.tutorial_events[TUT_SEEN_POTION] = 0; break; case OBJ_BOOKS: if (!item_ident(item, ISFLAG_KNOW_TYPE)) { - ostr << "It's a book, you can read it. "; + ostr << "It's a book, you can read it. "; } else { if (item.sub_type == BOOK_MANUAL) { ostr << "A manual can greatly help you in training a skill. " - "To use it, read it while your experience " + "To use it, read it while your experience " "pool (the number in brackets) is full. Note that " "this will drain said pool, so only use this manual " "if you think you need the skill in question."; @@ -1958,21 +1956,21 @@ void tutorial_describe_item(const item_def &item) { if (you.religion == GOD_TROG) { - ostr << "A spellbook! You could Memorize some " - "spells and then cast them with Z. "; + ostr << "A spellbook! You could Memorize some " + "spells and then cast them with Z. "; ostr << "\nAs a worshipper of " << god_name(GOD_TROG) << ", though, you might instead wish to burn this " "tome of hated magic by using the corresponding " - "ability. " + "ability. " "Note that this only works on books that are " "lying on the floor and not on your current " "square. "; } else if (!you.skills[SK_SPELLCASTING]) { - ostr << "A spellbook! You could Memorize some " - "spells and then cast them with Z. "; + ostr << "A spellbook! You could Memorize some " + "spells and then cast them with Z. "; ostr << "\nFor now, however, that will have to wait " "until you've learned the basics of Spellcasting " "by reading lots of scrolls."; @@ -1981,8 +1979,8 @@ void tutorial_describe_item(const item_def &item) { if (player_can_memorise(item)) { - ostr << "Such a highlighted spell " - "can be Memorised right away. "; + ostr << "Such a highlighted spell " + "can be Memorised right away. "; } else { @@ -1994,9 +1992,9 @@ void tutorial_describe_item(const item_def &item) if (you.spell_no) { - ostr << "\n\nTo do magic, type Z and " - "choose a spell, e.g. a (check " - "with ?). For attack spells " + ostr << "\n\nTo do magic, type Z and " + "choose a spell, e.g. a (check " + "with ?). For attack spells " "you'll "; ostr << tut_target_mode(true); } @@ -2007,7 +2005,7 @@ void tutorial_describe_item(const item_def &item) break; case OBJ_CORPSES: - ostr << "Corpses lying on the floor can be Dissected " + ostr << "Corpses lying on the floor can be Dissected " "with a sharp implement to produce chunks for food " "(though they may not be healthy)"; @@ -2015,24 +2013,24 @@ void tutorial_describe_item(const item_def &item) { ostr << ", or as a sacrifice to " << god_name(you.religion) - << " (while praying)"; + << " (while praying)"; } ostr << ". "; if (food_is_rotten(item)) ostr << "Rotten corpses won't be of any use to you, though, so " - "you might just as well drop this."; + "you might just as well drop this."; Options.tutorial_events[TUT_SEEN_CARRION] = 0; break; case OBJ_STAVES: - ostr << "Staffs have to be wielded to be of use. " + ostr << "Staffs have to be wielded to be of use. " "There are staves that help spellcasters, and others that " "allow you to harness spells hidden within."; if (!item_ident(item, ISFLAG_KNOW_TYPE)) { ostr << "\n\nTo find out what this staff might do, you have to " - "wield it, then Evoke it to see if anything " + "wield it, then Evoke it to see if anything " "interesting happens. If nothing happens, it's probably " "an ancient staff capable of enhancing certain spell " "schools while suppressing others. "; @@ -2047,7 +2045,7 @@ void tutorial_describe_item(const item_def &item) { ostr << "\nThis staff offers its wielder protection from " "certain sources. For an overview of your resistances " - "(among other things) type %."; + "(among other things) type %."; } Options.tutorial_events[TUT_SEEN_STAFF] = 0; @@ -2055,7 +2053,7 @@ void tutorial_describe_item(const item_def &item) case OBJ_MISCELLANY: ostr << "Miscellanous items sometimes harbour magical powers. Try " - "wielding and Evoking it."; + "wielding and Evoking it."; Options.tutorial_events[TUT_SEEN_MISC] = 0; break; @@ -2120,7 +2118,7 @@ void tutorial_describe_feature(dungeon_feature_type feat) if (feat == DNGN_TRAP_MECHANICAL) { ostr << "You can attempt to deactivate the mechanical type by " - "standing next to it and then pressing Shift " + "standing next to it and then pressing Shift " "and the direction of the trap. Note that this usually " "causes the trap to go off, so it can be quite a " "dangerous task."; @@ -2138,8 +2136,8 @@ void tutorial_describe_feature(dungeon_feature_type feat) case DNGN_STONE_STAIRS_DOWN_II: case DNGN_STONE_STAIRS_DOWN_III: ostr << "You can enter the next (deeper) level by following them " - "down (>). To get back to this level again, " - "press << while standing on the upstairs."; + "down (>). To get back to this level again, " + "press << while standing on the upstairs."; Options.tutorial_events[TUT_SEEN_STAIRS] = 0; break; @@ -2155,8 +2153,8 @@ void tutorial_describe_feature(dungeon_feature_type feat) else { ostr << "You can enter the previous (lower) level by following " - "these up (<<). To get back to this level " - "again, press > while standing on the " + "these up (<<). To get back to this level " + "again, press > while standing on the " "downstairs."; } Options.tutorial_events[TUT_SEEN_STAIRS] = 0; @@ -2165,7 +2163,7 @@ void tutorial_describe_feature(dungeon_feature_type feat) case DNGN_ROCK_STAIRS_DOWN: case DNGN_ROCK_STAIRS_UP: ostr << "Escape hatches can be used to quickly leave a level with " - "<< and >, respectively. Note that " + "<< and >, respectively. Note that " "you will usually be unable to return right away."; Options.tutorial_events[TUT_SEEN_ESCAPE_HATCH] = 0; break; @@ -2183,7 +2181,7 @@ void tutorial_describe_feature(dungeon_feature_type feat) "dedication, constant tributes or entertainment in return. " "\nYou can get information about " << god_name(altar_god) - << " by pressing p while standing on " + << " by pressing p while standing on " "the altar. Before taking up the responding faith you'll " "be asked for confirmation."; } @@ -2194,9 +2192,9 @@ void tutorial_describe_feature(dungeon_feature_type feat) ostr << "If " << god_name(you.religion) << " likes to have items or corpses sacrificed on altars, " - "here you can do this by dropping them, " - "then praying. As a follower, pressing " - "^ allows you to check " + "here you can do this by dropping them, " + "then praying. As a follower, pressing " + "^ allows you to check " << god_name(you.religion) << "'s likes and dislikes at any time."; } @@ -2206,13 +2204,13 @@ void tutorial_describe_feature(dungeon_feature_type feat) << " probably won't like it if you switch allegiance, " "but having a look won't hurt: to get information on "; ostr << god_name(altar_god); - ostr << ", press p while standing on the " + ostr << ", press p while standing on the " "altar. Before taking up the responding faith (and " "abandoning your current one!) you'll be asked for " "confirmation." "\nTo see your current standing with " << god_name(you.religion) - << " press ^."; + << " press ^."; } } Options.tutorial_events[TUT_SEEN_ALTAR] = 0; -- cgit v1.2.3-54-g00ecf