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