comparison rogue5/init.c @ 33:f502bf60e6e4

Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
author elwin
date Mon, 24 May 2010 20:10:59 +0000
parents
children
comparison
equal deleted inserted replaced
32:2dcd75e6a736 33:f502bf60e6e4
1 /*
2 * global variable initializaton
3 *
4 * @(#)init.c 4.31 (Berkeley) 02/05/99
5 *
6 * Rogue: Exploring the Dungeons of Doom
7 * Copyright (C) 1980-1983, 1985, 1999 Michael Toy, Ken Arnold and Glenn Wichman
8 * All rights reserved.
9 *
10 * See the file LICENSE.TXT for full copyright and licensing information.
11 */
12
13 #include <stdlib.h>
14 #include <curses.h>
15 #include <ctype.h>
16 #include <string.h>
17 #include "rogue.h"
18
19 /*
20 * init_player:
21 * Roll her up
22 */
23 void
24 init_player(void)
25 {
26 THING *obj;
27
28 pstats = max_stats;
29 food_left = HUNGERTIME;
30 /*
31 * Give him some food
32 */
33 obj = new_item();
34 obj->o_type = FOOD;
35 obj->o_count = 1;
36 add_pack(obj, TRUE);
37 /*
38 * And his suit of armor
39 */
40 obj = new_item();
41 obj->o_type = ARMOR;
42 obj->o_which = RING_MAIL;
43 obj->o_arm = a_class[RING_MAIL] - 1;
44 obj->o_flags |= ISKNOW;
45 obj->o_count = 1;
46 cur_armor = obj;
47 add_pack(obj, TRUE);
48 /*
49 * Give him his weaponry. First a mace.
50 */
51 obj = new_item();
52 init_weapon(obj, MACE);
53 obj->o_hplus = 1;
54 obj->o_dplus = 1;
55 obj->o_flags |= ISKNOW;
56 add_pack(obj, TRUE);
57 cur_weapon = obj;
58 /*
59 * Now a +1 bow
60 */
61 obj = new_item();
62 init_weapon(obj, BOW);
63 obj->o_hplus = 1;
64 obj->o_flags |= ISKNOW;
65 add_pack(obj, TRUE);
66 /*
67 * Now some arrows
68 */
69 obj = new_item();
70 init_weapon(obj, ARROW);
71 obj->o_count = rnd(15) + 25;
72 obj->o_flags |= ISKNOW;
73 add_pack(obj, TRUE);
74 }
75
76 /*
77 * Contains defintions and functions for dealing with things like
78 * potions and scrolls
79 */
80
81 const char *rainbow[] = {
82 "amber",
83 "aquamarine",
84 "black",
85 "blue",
86 "brown",
87 "clear",
88 "crimson",
89 "cyan",
90 "ecru",
91 "gold",
92 "green",
93 "grey",
94 "magenta",
95 "orange",
96 "pink",
97 "plaid",
98 "purple",
99 "red",
100 "silver",
101 "tan",
102 "tangerine",
103 "topaz",
104 "turquoise",
105 "vermilion",
106 "violet",
107 "white",
108 "yellow",
109 };
110
111 #define NCOLORS (sizeof rainbow / sizeof (char *))
112
113 static const char *sylls[] = {
114 "a", "ab", "ag", "aks", "ala", "an", "app", "arg", "arze", "ash",
115 "bek", "bie", "bit", "bjor", "blu", "bot", "bu", "byt", "comp",
116 "con", "cos", "cre", "dalf", "dan", "den", "do", "e", "eep", "el",
117 "eng", "er", "ere", "erk", "esh", "evs", "fa", "fid", "fri", "fu",
118 "gan", "gar", "glen", "gop", "gre", "ha", "hyd", "i", "ing", "ip",
119 "ish", "it", "ite", "iv", "jo", "kho", "kli", "klis", "la", "lech",
120 "mar", "me", "mi", "mic", "mik", "mon", "mung", "mur", "nej",
121 "nelg", "nep", "ner", "nes", "nes", "nih", "nin", "o", "od", "ood",
122 "org", "orn", "ox", "oxy", "pay", "ple", "plu", "po", "pot",
123 "prok", "re", "rea", "rhov", "ri", "ro", "rog", "rok", "rol", "sa",
124 "san", "sat", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
125 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab", "tem",
126 "ther", "ti", "tox", "trol", "tue", "turs", "u", "ulk", "um", "un",
127 "uni", "ur", "val", "viv", "vly", "vom", "wah", "wed", "werg",
128 "wex", "whon", "wun", "xo", "y", "yot", "yu", "zant", "zeb", "zim",
129 "zok", "zon", "zum",
130 };
131
132 const STONE stones[] = {
133 { "agate", 25},
134 { "alexandrite", 40},
135 { "amethyst", 50},
136 { "carnelian", 40},
137 { "diamond", 300},
138 { "emerald", 300},
139 { "germanium", 225},
140 { "granite", 5},
141 { "garnet", 50},
142 { "jade", 150},
143 { "kryptonite", 300},
144 { "lapis lazuli", 50},
145 { "moonstone", 50},
146 { "obsidian", 15},
147 { "onyx", 60},
148 { "opal", 200},
149 { "pearl", 220},
150 { "peridot", 63},
151 { "ruby", 350},
152 { "sapphire", 285},
153 { "stibotantalite", 200},
154 { "tiger eye", 50},
155 { "topaz", 60},
156 { "turquoise", 70},
157 { "taaffeite", 300},
158 { "zircon", 80},
159 };
160
161 #define NSTONES (sizeof stones / sizeof (STONE))
162
163 const char *wood[] = {
164 "avocado wood",
165 "balsa",
166 "bamboo",