summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/newgame_def.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-04-23 22:39:17 +0200
committerRobert Vollmert <rvollmert@gmx.net>2010-04-23 23:43:49 +0200
commitf7fe51cc8c502c5c12cbafcbb68782cfb1de716b (patch)
treeae1de8632d7ab76edb1e83d97066e7e42fc8832e /crawl-ref/source/newgame_def.h
parent7dd7c0d264d6fc8cbf915b2f8fcf6c8e6d29a26e (diff)
downloadcrawl-ref-f7fe51cc8c502c5c12cbafcbb68782cfb1de716b.tar.gz
crawl-ref-f7fe51cc8c502c5c12cbafcbb68782cfb1de716b.zip
A start at cleaning up handling of new game choices.
No more storing species and background indices. Instead, there's now a few instances of newgame_def: Options.game: command line and option game settings (used to be Options.cls, Options.race, ...) Options.prev_game: the previous game's choices (used to be Options.prev_cls, ...; should not be in Options) ngchoice: current choices, internal to newgame.cc The species and background choice now separate interrogating the user from applying settings from Options.game. This is not the case yet for the secondary choices. Secondary choice memory may be slightly broken at the moment.
Diffstat (limited to 'crawl-ref/source/newgame_def.h')
-rw-r--r--crawl-ref/source/newgame_def.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/crawl-ref/source/newgame_def.h b/crawl-ref/source/newgame_def.h
new file mode 100644
index 0000000000..35a3575082
--- /dev/null
+++ b/crawl-ref/source/newgame_def.h
@@ -0,0 +1,52 @@
+#ifndef NEWGAME_DEF_H
+#define NEWGAME_DEF_H
+
+#include "itemprop-enum.h"
+
+enum startup_book_type
+{
+ SBT_NO_SELECTION = 0,
+ SBT_FIRE,
+ SBT_COLD,
+ SBT_SUMM,
+ SBT_RANDOM
+};
+
+enum startup_wand_type
+{
+ SWT_NO_SELECTION = 0,
+ SWT_ENSLAVEMENT,
+ SWT_CONFUSION,
+ SWT_MAGIC_DARTS,
+ SWT_FROST,
+ SWT_FLAME,
+ SWT_STRIKING, // actually a rod
+ SWT_RANDOM
+};
+
+// Either a character definition, with real species, job, and
+// weapon book, religion, wand as appropriate.
+// Or a character choice, with possibly random/viable entries.
+struct newgame_def
+{
+ std::string name;
+
+ species_type species;
+ job_type job;
+
+ weapon_type weapon;
+ startup_book_type book;
+ god_type religion;
+ startup_wand_type wand;
+
+ // Only relevant for character choice, where the entire
+ // character was randomly picked in one step.
+ // If this is true, the species field encodes whether
+ // the choice was for a viable character or not.
+ bool fully_random;
+
+ newgame_def();
+};
+
+#endif
+