summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/newgame.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-11 21:47:36 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-11 21:47:36 +0000
commit0b8e38c4f5fbfbfa72180c48de2027ff9851bb67 (patch)
treee1611ec65860eae38d414767b8fbd9db68856d2c /crawl-ref/source/newgame.cc
parent3f1f5c2f776026f09ff0603c3ea2d1d1e74a2135 (diff)
downloadcrawl-ref-0b8e38c4f5fbfbfa72180c48de2027ff9851bb67.tar.gz
crawl-ref-0b8e38c4f5fbfbfa72180c48de2027ff9851bb67.zip
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
Diffstat (limited to 'crawl-ref/source/newgame.cc')
-rw-r--r--crawl-ref/source/newgame.cc27
1 files changed, 24 insertions, 3 deletions
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;
}