From 0b8e38c4f5fbfbfa72180c48de2027ff9851bb67 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 11 Mar 2009 21:47:36 +0000 Subject: Prompt for pre-named characters chosen completely randomly (via option random_pick, !, or #), defaults to 'y' == "I want to play this combination." (Implements part of FR 2088453.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9416 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/newgame.cc | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/newgame.cc') diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 165cce0cc1..402330d32e 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -1231,6 +1231,27 @@ game_start: } } } + else if (Options.random_pick) + { + // For completely random combinations (!, #, or Options.random_pick) + // reroll characters until the player accepts one of them or quits. + clrscr(); + + std::string specs = species_name(you.species, you.experience_level); + if (specs.length() > 79) + specs = specs.substr(0, 79); + + cprintf( "You are a%s %s %s." EOL, + (is_vowel( specs[0] )) ? "n" : "", specs.c_str(), + you.class_name ); + + cprintf(EOL "Do you want to play this combination? (ynq) [y]"); + char c = getch(); + if (c == ESCAPE || tolower(c) == 'q') + end(0); + if (tolower(c) == 'n') + goto game_start; + } // ************ Round-out character statistics and such. ************ @@ -2175,9 +2196,9 @@ static bool _choose_book( int slot, int firstbook, int numbooks ) { for (int i = 0; i < numbooks; i++) { - if (_book_restriction( - _book_to_start(firstbook + i)) == CC_UNRESTRICTED - && one_chance_in(++good_choices)) + if (_book_restriction(_book_to_start(firstbook + i)) + == CC_UNRESTRICTED + && one_chance_in(++good_choices)) { keyin = i; } -- cgit v1.2.3-54-g00ecf