summaryrefslogtreecommitdiffstats
path: root/crawl-ref
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
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')
-rw-r--r--crawl-ref/docs/options_guide.txt7
-rw-r--r--crawl-ref/source/newgame.cc27
2 files changed, 27 insertions, 7 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index 6215c2e9b2..b288da8edf 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -1011,10 +1011,9 @@ always_confirm_butcher = false
square, you will always be prompted, regardless of this option.
prefer_safe_chunks = true
- If eat.lua has been sourced, the (e)at command will prompt for
- all chunks on the floor and in your inventory, sorted by age.
- If this option is set to true, clean chunks will be offered
- before contaminated ones even if the latter are older.
+ The (e)at command will prompt for all chunks on the floor and in your
+ inventory, sorted by age. If this option is set to true, clean chunks
+ will be offered before contaminated ones even if the latter are older.
Poisonous, mutagenic, rot-inducing, and chunks forbidden by
your religion will always be offered last.
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;
}