1 /*        $NetBSD: def.objects.h,v 1.6 2003/04/02 18:36:34 jsm Exp $  */
2 
3 /*
4  * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
5  * Amsterdam
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * - Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * - Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * - Neither the name of the Stichting Centrum voor Wiskunde en
20  * Informatica, nor the names of its contributors may be used to endorse or
21  * promote products derived from this software without specific prior
22  * written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
25  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
27  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
28  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37 /*
38  * Copyright (c) 1982 Jay Fenlason <hack@gnu.org>
39  * All rights reserved.
40  *
41  * Redistribution and use in source and binary forms, with or without
42  * modification, are permitted provided that the following conditions
43  * are met:
44  * 1. Redistributions of source code must retain the above copyright
45  *    notice, this list of conditions and the following disclaimer.
46  * 2. Redistributions in binary form must reproduce the above copyright
47  *    notice, this list of conditions and the following disclaimer in the
48  *    documentation and/or other materials provided with the distribution.
49  * 3. The name of the author may not be used to endorse or promote products
50  *    derived from this software without specific prior written permission.
51  *
52  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
53  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
54  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
55  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
56  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
57  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
58  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
59  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
60  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
61  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62  */
63 
64 #ifndef _DEF_OBJECTS_H_
65 #define _DEF_OBJECTS_H_
66 /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */
67 #include "config.h"
68 #include "def.objclass.h"
69 
70 struct objclass objects[] = {
71 
72           { "strange object", NULL, NULL, 1, 0,
73                     ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
74           { "amulet of Yendor", NULL, NULL, 1, 0,
75                     AMULET_SYM, 100, 0, 2, 0, 0, 0 },
76 
77 #define   FOOD(name,prob,delay,weight,nutrition)  { name, NULL, NULL, 1, 1,\
78                     FOOD_SYM, prob, delay, weight, 0, 0, nutrition }
79 
80 /* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
81 /* food 4 can be read */
82 /* food 5 improves your vision */
83 /* food 6 makes you stronger (like Popeye) */
84 /* foods CORPSE up to CORPSE+52 are cadavers */
85 
86           FOOD("food ration",           50, 5, 4, 800),
87           FOOD("tripe ration",          20, 1, 2, 200),
88           FOOD("pancake",               3, 1, 1, 200),
89           FOOD("dead lizard", 3, 0, 1, 40),
90           FOOD("fortune cookie",        7, 0, 1, 40),
91           FOOD("carrot",                2, 0, 1, 50),
92           FOOD("tin",                   7, 0, 1, 0),
93           FOOD("orange",                1, 0, 1, 80),
94           FOOD("apple",                 1, 0, 1, 50),
95           FOOD("pear",                  1, 0, 1, 50),
96           FOOD("melon",                 1, 0, 1, 100),
97           FOOD("banana",                1, 0, 1, 80),
98           FOOD("candy bar",   1, 0, 1, 100),
99           FOOD("egg",                   1, 0, 1, 80),
100           FOOD("clove of garlic",       1, 0, 1, 40),
101           FOOD("lump of royal jelly", 0, 0, 1, 200),
102 
103           FOOD("dead human",  0, 4, 40, 400),
104           FOOD("dead giant ant",        0, 1, 3, 30),
105           FOOD("dead giant bat",        0, 1, 3, 30),
106           FOOD("dead centaur",          0, 5, 50, 500),
107           FOOD("dead dragon", 0, 15, 150, 1500),
108           FOOD("dead floating eye",     0, 1, 1, 10),
109           FOOD("dead freezing sphere",  0, 1, 1, 10),
110           FOOD("dead gnome",  0, 1, 10, 100),
111           FOOD("dead hobgoblin",        0, 2, 20, 200),
112           FOOD("dead stalker",          0, 4, 40, 400),
113           FOOD("dead jackal", 0, 1, 10, 100),
114           FOOD("dead kobold", 0, 1, 10, 100),
115           FOOD("dead leprechaun",       0, 4, 40, 400),
116           FOOD("dead mimic",  0, 4, 40, 400),
117           FOOD("dead nymph",  0, 4, 40, 400),
118           FOOD("dead orc",    0, 2, 20, 200),
119           FOOD("dead purple worm",      0, 7, 70, 700),
120           FOOD("dead quasit", 0, 2, 20, 200),
121           FOOD("dead rust monster",     0, 5, 50, 500),
122           FOOD("dead snake",  0, 1, 10, 100),
123           FOOD("dead troll",  0, 4, 40, 400),
124           FOOD("dead umber hulk",       0, 5, 50, 500),
125           FOOD("dead vampire",          0, 4, 40, 400),
126           FOOD("dead wraith", 0, 1, 1, 10),
127           FOOD("dead xorn",   0, 7, 70, 700),
128           FOOD("dead yeti",   0, 7, 70, 700),
129           FOOD("dead zombie", 0, 1, 3, 30),
130           FOOD("dead acid blob",        0, 1, 3, 30),
131           FOOD("dead giant beetle",     0, 1, 1, 10),
132           FOOD("dead cockatrice",       0, 1, 3, 30),
133           FOOD("dead dog",    0, 2, 20, 200),
134           FOOD("dead ettin",  0, 1, 3, 30),
135           FOOD("dead fog cloud",        0, 1, 1, 10),
136           FOOD("dead gelatinous cube",  0, 1, 10, 100),
137           FOOD("dead homunculus",       0, 2, 20, 200),
138           FOOD("dead imp",    0, 1, 1, 10),
139           FOOD("dead jaguar", 0, 3, 30, 300),
140           FOOD("dead killer bee",       0, 1, 1, 10),
141           FOOD("dead leocrotta",        0, 5, 50, 500),
142           FOOD("dead minotaur",         0, 7, 70, 700),
143           FOOD("dead nurse",  0, 4, 40, 400),
144           FOOD("dead owlbear",          0, 7, 70, 700),
145           FOOD("dead piercer",          0, 2, 20, 200),
146           FOOD("dead quivering blob",   0, 1, 10, 100),
147           FOOD("dead giant rat",        0, 1, 3, 30),
148           FOOD("dead giant scorpion",   0, 1, 10, 100),
149           FOOD("dead tengu",  0, 3, 30, 300),
150           FOOD("dead unicorn",          0, 3, 30, 300),
151           FOOD("dead violet fungi",     0, 1, 10, 100),
152           FOOD("dead long worm",        0, 5, 50, 500),
153 /* %% wt of long worm should be proportional to its length */
154           FOOD("dead xan",    0, 3, 30, 300),
155           FOOD("dead yellow light",     0, 1, 1, 10),
156           FOOD("dead zruty",  0, 6, 60, 600),
157 
158 /* weapons ... - ROCK come several at a time */
159 /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
160 /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
161 /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
162 #define WEAPON(name,prob,wt,ldam,sdam)  { name, NULL, NULL, 1, 0 /*%%*/,\
163                     WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 }
164 
165           WEAPON("arrow",               7, 0, 6, 6),
166           WEAPON("sling bullet",        7, 0, 4, 6),
167           WEAPON("crossbow bolt",       7, 0, 4, 6),
168           WEAPON("dart",                7, 0, 3, 2),
169           WEAPON("rock",                6, 1, 3, 3),
170           WEAPON("boomerang", 2, 3, 9, 9),
171           WEAPON("mace",                9, 3, 6, 7),
172           WEAPON("axe",                 6, 3, 6, 4),
173           WEAPON("flail",               6, 3, 6, 5),
174           WEAPON("long sword",          8, 3, 8, 12),
175           WEAPON("two handed sword",    6, 4, 12, 6),
176           WEAPON("dagger",    6, 3, 4, 3),
177           WEAPON("worm tooth",          0, 4, 2, 2),
178           WEAPON("crysknife", 0, 3, 10, 10),
179           WEAPON("spear",               6, 3, 6, 8),
180           WEAPON("bow",                 6, 3, 4, 6),
181           WEAPON("sling",               5, 3, 6, 6),
182           WEAPON("crossbow",  6, 3, 4, 6),
183 
184           { "whistle", "whistle", NULL, 0, 0,
185                     TOOL_SYM, 90, 0, 2, 0, 0, 0 },
186           { "magic whistle", "whistle", NULL, 0, 0,
187                     TOOL_SYM, 10, 0, 2, 0, 0, 0 },
188           { "expensive camera", NULL, NULL, 1, 1,
189                     TOOL_SYM, 0, 0, 3, 0, 0, 0 },
190           { "ice box", "large box", NULL, 0, 0,
191                     TOOL_SYM, 0, 0, 40, 0, 0, 0 },
192           { "pick-axe", NULL, NULL, 1, 1,
193                     TOOL_SYM, 0, 0, 5, 6, 3, 0 },
194           { "can opener", NULL, NULL, 1, 1,
195                     TOOL_SYM, 0, 0, 1, 0, 0, 0 },
196           { "heavy iron ball", NULL, NULL, 1, 0,
197                     BALL_SYM, 100, 0, 20, 0, 0, 0 },
198           { "iron chain", NULL, NULL, 1, 0,
199                     CHAIN_SYM, 100, 0, 20, 0, 0, 0 },
200           { "enormous rock", NULL, NULL, 1, 0,
201                     ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 },
202 
203 #define ARMOR(name,prob,delay,ac,can)   { name, NULL, NULL, 1, 0,\
204                     ARMOR_SYM, prob, delay, 8, ac, can, 0 }
205           ARMOR("helmet",                3, 1, 9, 0),
206           ARMOR("plate mail",            5, 5, 3, 2),
207           ARMOR("splint mail",           8, 5, 4, 1),
208           ARMOR("banded mail",          10, 5, 4, 0),
209           ARMOR("chain mail",           10, 5, 5, 1),
210           ARMOR("scale mail",           10, 5, 6, 0),
211           ARMOR("ring mail",            15, 5, 7, 0),
212           /* the armors below do not rust */
213           ARMOR("studded leather armor", 13, 3, 7, 1),
214           ARMOR("leather armor",        17, 3, 8, 0),
215           ARMOR("elven cloak",           5, 0, 9, 3),
216           ARMOR("shield",                3, 0, 9, 0),
217           ARMOR("pair of gloves",        1, 1, 9, 0),
218 
219 #define POTION(name,color)    { name, color, NULL, 0, 1,\
220                     POTION_SYM, 0, 0, 2, 0, 0, 0 }
221 
222           POTION("restore strength",    "orange"),
223           POTION("booze",               "bubbly"),
224           POTION("invisibility",        "glowing"),
225           POTION("fruit juice",         "smoky"),
226           POTION("healing",   "pink"),
227           POTION("paralysis", "puce"),
228           POTION("monster detection",   "purple"),
229           POTION("object detection",    "yellow"),
230           POTION("sickness",  "white"),
231           POTION("confusion", "swirly"),
232           POTION("gain strength",       "purple-red"),
233           POTION("speed",               "ruby"),
234           POTION("blindness", "dark green"),
235           POTION("gain level",          "emerald"),
236           POTION("extra healing",       "sky blue"),
237           POTION("levitation",          "brown"),
238           POTION(NULL,        "brilliant blue"),
239           POTION(NULL,        "clear"),
240           POTION(NULL,        "magenta"),
241           POTION(NULL,        "ebony"),
242 
243 #define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\
244                     SCROLL_SYM, prob, 0, 3, 0, 0, 0 }
245           SCROLL("mail",      "KIRJE", 0),
246           SCROLL("enchant armor", "ZELGO MER", 6),
247           SCROLL("destroy armor", "JUYED AWK YACC", 5),
248           SCROLL("confuse monster", "NR 9", 5),
249           SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4),
250           SCROLL("blank paper", "READ ME", 3),
251           SCROLL("remove curse", "PRATYAVAYAH", 6),
252           SCROLL("enchant weapon", "DAIYEN FOOELS", 6),
253           SCROLL("damage weapon", "HACKEM MUCHE", 5),
254           SCROLL("create monster", "LEP GEX VEN ZEA", 5),
255           SCROLL("taming", "PRIRUTSENIE", 1),
256           SCROLL("genocide", "ELBIB YLOH",2),
257           SCROLL("light", "VERR YED HORRE", 10),
258           SCROLL("teleportation", "VENZAR BORGAVVE", 5),
259           SCROLL("gold detection", "THARR", 4),
260           SCROLL("food detection", "YUM YUM", 1),
261           SCROLL("identify", "KERNOD WEL", 18),
262           SCROLL("magic mapping", "ELAM EBOW", 5),
263           SCROLL("amnesia", "DUAM XNAHT", 3),
264           SCROLL("fire", "ANDOVA BEGARIN", 5),
265           SCROLL("punishment", "VE FORBRYDERNE", 1),
266           SCROLL(NULL, "VELOX NEB", 0),
267           SCROLL(NULL, "FOOBIE BLETCH", 0),
268           SCROLL(NULL, "TEMOV", 0),
269           SCROLL(NULL, "GARVEN DEH", 0),
270 
271 #define   WAND(name,metal,prob,flags)   { name, metal, NULL, 0, 0,\
272                     WAND_SYM, prob, 0, 3, flags, 0, 0 }
273 
274           WAND("light",       "iridium",                    10,       NODIR),
275           WAND("secret door detection", "tin",    5,        NODIR),
276           WAND("create monster",        "platinum",         5,        NODIR),
277           WAND("wishing",               "glass",  1,        NODIR),
278           WAND("striking",    "zinc",             9,        IMMEDIATE),
279           WAND("slow monster",          "balsa",  5,        IMMEDIATE),
280           WAND("speed monster",         "copper", 5,        IMMEDIATE),
281           WAND("undead turning",        "silver", 5,        IMMEDIATE),
282           WAND("polymorph",   "brass",  5,        IMMEDIATE),
283           WAND("cancellation",          "maple",  5,        IMMEDIATE),
284           WAND("teleportation",         "pine",             5,        IMMEDIATE),
285           WAND("make invisible",        "marble", 9,        IMMEDIATE),
286           WAND("digging",               "iron",             5,        RAY),
287           WAND("magic missile",         "aluminium",        10,       RAY),
288           WAND("fire",        "steel",  5,        RAY),
289           WAND("sleep",       "curved", 5,        RAY),
290           WAND("cold",        "short",  5,        RAY),
291           WAND("death",       "long",             1,        RAY),
292           WAND(NULL,          "oak",              0,        0),
293           WAND(NULL,          "ebony",  0,        0),
294           WAND(NULL,          "runed",  0,        0),
295 
296 #define   RING(name,stone,spec)         { name, stone, NULL, 0, 0,\
297                     RING_SYM, 0, 0, 1, spec, 0, 0 }
298 
299           RING("adornment",   "engagement",       0),
300           RING("teleportation",         "wooden", 0),
301           RING("regeneration",          "black onyx",       0),
302           RING("searching",   "topaz",  0),
303           RING("see invisible",         "pearl",  0),
304           RING("stealth",               "sapphire",         0),
305           RING("levitation",  "moonstone",        0),
306           RING("poison resistance", "agate",      0),
307           RING("aggravate monster", "tiger eye",  0),
308           RING("hunger",                "shining",          0),
309           RING("fire resistance",       "gold",             0),
310           RING("cold resistance",       "copper", 0),
311           RING("protection from shape changers", "diamond", 0),
312           RING("conflict",    "jade",             0),
313           RING("gain strength",         "ruby",             SPEC),
314           RING("increase damage",       "silver", SPEC),
315           RING("protection",  "granite",          SPEC),
316           RING("warning",               "wire",             0),
317           RING("teleport control", "iron",        0),
318           RING(NULL,                    "ivory",  0),
319           RING(NULL,                    "blackened",        0),
320 
321 /* gems ************************************************************/
322 #define   GEM(name,color,prob,gval)     { name, color, NULL, 0, 1,\
323                     GEM_SYM, prob, 0, 1, 0, 0, gval }
324           GEM("diamond", "blue", 1, 4000),
325           GEM("ruby", "red", 1, 3500),
326           GEM("sapphire", "blue", 1, 3000),
327           GEM("emerald", "green", 1, 2500),
328           GEM("turquoise", "green", 1, 2000),
329           GEM("aquamarine", "blue", 1, 1500),
330           GEM("tourmaline", "green", 1, 1000),
331           GEM("topaz", "yellow", 1, 900),
332           GEM("opal", "yellow", 1, 800),
333           GEM("garnet", "dark", 1, 700),
334           GEM("amethyst", "violet", 2, 650),
335           GEM("agate", "green", 2, 600),
336           GEM("onyx", "white", 2, 550),
337           GEM("jasper", "yellowish brown", 2, 500),
338           GEM("jade", "green", 2, 450),
339           GEM("worthless piece of blue glass", "blue", 20, 0),
340           GEM("worthless piece of red glass", "red", 20, 0),
341           GEM("worthless piece of yellow glass", "yellow", 20, 0),
342           GEM("worthless piece of green glass", "green", 20, 0),
343           { NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }
344 };
345 
346 const char obj_symbols[] = {
347           ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM,
348           BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM,
349           WAND_SYM, RING_SYM, GEM_SYM, 0 };
350 int bases[sizeof(obj_symbols)];
351 #endif /* _DEF_OBJECTS_H_ */
352