comparison arogue5/init.c @ 63:0ed67132cf10

Import Advanced Rogue 5.8 from the Roguelike Restoration Project (r1490)
author elwin
date Thu, 09 Aug 2012 22:58:48 +0000
parents
children c49f7927b0fa
comparison
equal deleted inserted replaced
62:0ef99244acb8 63:0ed67132cf10
1 /*
2 * global variable initializaton
3 *
4 * Advanced Rogue
5 * Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T
6 * All rights reserved.
7 *
8 * Based on "Rogue: Exploring the Dungeons of Doom"
9 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
10 * All rights reserved.
11 *
12 * See the file LICENSE.TXT for full copyright and licensing information.
13 */
14
15 #include "curses.h"
16 #include <ctype.h>
17 #include "rogue.h"
18 #include "mach_dep.h"
19
20
21 char *rainbow[NCOLORS] = {
22
23 "amber", "aquamarine", "beige",
24 "black", "blue", "brown",
25 "clear", "crimson", "ecru",
26 "gold", "green", "grey",
27 "indigo", "khaki", "lavender",
28 "magenta", "orange", "pink",
29 "plaid", "purple", "red",
30 "silver", "saffron", "scarlet",
31 "tan", "tangerine", "topaz",
32 "turquoise", "vermilion", "violet",
33 "white", "yellow",
34 };
35
36 char *sylls[NSYLLS] = {
37 "a", "ab", "ag", "aks", "ala", "an", "ankh","app", "arg", "arze",
38 "ash", "ban", "bar", "bat", "bek", "bie", "bin", "bit", "bjor",
39 "blu", "bot", "bu", "byt", "comp","con", "cos", "cre", "dalf",
40 "dan", "den", "do", "e", "eep", "el", "eng", "er", "ere", "erk",
41 "esh", "evs", "fa", "fid", "for", "fri", "fu", "gan", "gar",
42 "glen","gop", "gre", "ha", "he", "hyd", "i", "ing", "ion", "ip",
43 "ish", "it", "ite", "iv", "jo", "kho", "kli", "klis","la", "lech",
44 "man", "mar", "me", "mi", "mic", "mik", "mon", "mung","mur",
45 "nej", "nelg","nep", "ner", "nes", "nes", "nih", "nin", "o", "od",
46 "ood", "org", "orn", "ox", "oxy", "pay", "pet", "ple", "plu", "po",
47 "pot", "prok","re", "rea", "rhov","ri", "ro", "rog", "rok", "rol",
48 "sa", "san", "sat", "see", "sef", "seh", "shu", "ski", "sna",
49 "sne", "snik","sno", "so", "sol", "sri", "sta", "sun", "ta",
50 "tab", "tem", "ther","ti", "tox", "trol","tue", "turs","u",
51 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly", "vom", "wah",
52 "wed", "werg","wex", "whon","wun", "xo", "y", "yot", "yu",
53 "zant","zap", "zeb", "zim", "zok", "zon", "zum",
54 };
55
56 char *stones[NSTONES] = {
57 "agate", "alexandrite", "amethyst",
58 "azurite", "bloodstone", "cairngorm",
59 "carnelian", "chalcedony", "chrysoberyl",
60 "chrysolite", "chrysoprase", "citrine",
61 "coral", "diamond", "emerald",
62 "garnet", "heliotrope", "hematite",
63 "hyacinth", "jacinth", "jade",
64 "jargoon", "jasper", "kryptonite",
65 "lapus lazuli", "malachite", "mocca stone",
66 "moonstone", "obsidian", "olivine",
67 "onyx", "opal", "pearl",
68 "peridot", "quartz", "rhodochrosite",
69 "rhodolite", "ruby", "sapphire",
70 "sardonyx", "serpintine", "spinel",
71 "tiger eye", "topaz", "tourmaline",
72 "turquoise", "zircon",
73 };
74
75 char *wood[NWOOD] = {
76 "avocado wood", "balsa", "banyan", "birch",
77 "cedar", "cherry", "cinnibar", "dogwood",
78 "driftwood", "ebony", "eucalyptus", "hemlock",
79 "ironwood", "mahogany", "manzanita", "maple",
80 "oak", "pine", "redwood", "rosewood",
81 "teak", "walnut", "zebra wood", "persimmon wood",
82 };
83
84 char *metal[NMETAL] = {
85 "aluminium", "bone", "brass", "bronze",
86 "copper", "chromium", "iron", "lead",
87 "magnesium", "pewter", "platinum", "silver",
88 "steel", "tin", "titanium", "zinc",
89 };
90
91
92
93
94 /*
95 * make sure all the percentages specified in the tables add up to the
96 * right amounts
97 */
98 badcheck(name, magic, bound)
99 char *name;
100 register struct magic_item *magic;
101 register int bound;
102 {
103 register struct magic_item *end;
104
105 if (magic[bound - 1].mi_prob == 1000)
106 return;
107 printf("\nBad percentages for %s:\n", name);
108 for (end = &magic[bound] ; magic < end ; magic++)
109 printf("%4d%% %s\n", magic->mi_prob, magic->mi_name);
110 printf(retstr);
111 fflush(stdout);
112 while (getchar() != '\n')
113 continue;
114 }
115
116 /*
117 * init_colors:
118 * Initialize the potion color scheme for this time
119 */
120
121 init_colors()
122 {
123 register int i, j;
124 bool used[NCOLORS];
125
126 for(i = 0; i < NCOLORS; i++)
127 used[i] = FALSE;
128
129 for (i = 0 ; i < MAXPOTIONS ; i++)
130 {
131 do
132 j = rnd(NCOLORS);
133 until (!used[j]);
134 used[j] = TRUE;
135 p_colors[i] = rainbow[j];
136 p_know[i] = FALSE;
137 p_guess[i] = NULL;
138 if (i > 0)
139 p_magic[i].mi_prob += p_magic[i-1].mi_prob;
140 }
141 badcheck("potions", p_magic, MAXPOTIONS);
142 }
143
144 /*
145 * init_materials:
146 * Initialize the construction materials for wands and staffs
147 */
148
149 init_materials()
150 {
151 register int i, j;
152 register char *str;
153 bool metused[NMETAL], woodused[NWOOD];
154
155 for(i = 0; i < NWOOD; i++)
156 woodused[i] = FALSE;