Source:Hack 1.0/def.objects.h

From NetHackWiki
Revision as of 22:10, 3 March 2008 by Kernigh bot (talk | contribs) (Hack 1.0/def.objects.h moved to Source:Hack 1.0/def.objects.h: Robot: moved page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is the full text to def.objects.h from the source code of Hack 1.0. To link to a particular line, write [[Hack 1.0/def.objects.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

Screenshots and source code from Hack are used under the CWI license.

1.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
2.    
3.    /* objects have letter " % ) ( 0 _ [ ! ? / = * */
4.    #include "def.objclass.h"
5.    #define	NULL	(char *)0
6.    
7.    struct objclass objects[] = {
8.    
9.    	{ "strange object", NULL, NULL, 1, 0,
10.   		ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
11.   	{ "amulet of Yendor", NULL, NULL, 1, 0,
12.   		AMULET_SYM, 100, 0, 2, 0, 0, 0 },
13.   
14.   #define	FOOD(name,prob,delay,weight,nutrition)	{ name, NULL, NULL, 1, 1,\
15.   		FOOD_SYM, prob, delay, weight, 0, 0, nutrition }
16.   
17.   /* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
18.   /* food 4 can be read */
19.   /* food 5 improves your vision */
20.   /* food 6 makes you stronger (like Popeye) */
21.   /* foods CORPSE=15 up to CORPSE+52 are cadavers */
22.   
23.   	FOOD("food ration", 	50, 5, 4, 800),
24.   	FOOD("tripe ration",	20, 1, 2, 200),
25.   	FOOD("pancake",		3, 1, 1, 200),
26.   	FOOD("dead lizard",	3, 0, 1, 40),
27.   	FOOD("fortune cookie",	7, 0, 1, 40),
28.   	FOOD("carrot",		2, 0, 1, 50),
29.   	FOOD("tin",		7, 0, 1, 0),
30.   	FOOD("orange",		1, 0, 1, 80),
31.   	FOOD("apple",		1, 0, 1, 50),
32.   	FOOD("pear",		1, 0, 1, 50),
33.   	FOOD("melon",		1, 0, 1, 100),
34.   	FOOD("banana",		1, 0, 1, 80),
35.   	FOOD("candy bar",	1, 0, 1, 100),
36.   	FOOD("egg",		1, 0, 1, 80),
37.   	FOOD("clove of garlic",	1, 0, 1, 40),
38.   
39.   	FOOD("dead human",	0, 4, 40, 400),
40.   	FOOD("dead giant ant",	0, 1, 3, 30),
41.   	FOOD("dead giant bat",	0, 1, 3, 30),
42.   	FOOD("dead centaur",	0, 5, 50, 500),
43.   	FOOD("dead dragon",	0, 15, 150, 1500),
44.   	FOOD("dead floating eye",	0, 1, 1, 10),
45.   	FOOD("dead freezing sphere",	0, 1, 1, 10),
46.   	FOOD("dead gnome",	0, 1, 10, 100),
47.   	FOOD("dead hobgoblin",	0, 2, 20, 200),
48.   	FOOD("dead stalker",	0, 4, 40, 400),
49.   	FOOD("dead jackal",	0, 1, 10, 100),
50.   	FOOD("dead kobold",	0, 1, 10, 100),
51.   	FOOD("dead leprechaun",	0, 4, 40, 400),
52.   	FOOD("dead mimic",	0, 4, 40, 400),
53.   	FOOD("dead nymph",	0, 4, 40, 400),
54.   	FOOD("dead orc",	0, 2, 20, 200),
55.   	FOOD("dead purple worm",	0, 7, 70, 700),
56.   	FOOD("dead quasit",	0, 2, 20, 200),
57.   	FOOD("dead rust monster",	0, 5, 50, 500),
58.   	FOOD("dead snake",	0, 1, 10, 100),
59.   	FOOD("dead troll",	0, 4, 40, 400),
60.   	FOOD("dead umber hulk",	0, 5, 50, 500),
61.   	FOOD("dead vampire",	0, 4, 40, 400),
62.   	FOOD("dead wraith",	0, 1, 1, 10),
63.   	FOOD("dead xorn",	0, 7, 70, 700),
64.   	FOOD("dead yeti",	0, 7, 70, 700),
65.   	FOOD("dead zombie",	0, 1, 3, 30),
66.   	FOOD("dead acid blob",	0, 1, 3, 30),
67.   	FOOD("dead giant beetle",	0, 1, 1, 10),
68.   	FOOD("dead cockatrice",	0, 1, 3, 30),
69.   	FOOD("dead dog",	0, 2, 20, 200),
70.   	FOOD("dead ettin",	0, 1, 3, 30),
71.   	FOOD("dead fog cloud",	0, 1, 1, 10),
72.   	FOOD("dead gelatinous cube",	0, 1, 10, 100),
73.   	FOOD("dead homunculus",	0, 2, 20, 200),
74.   	FOOD("dead imp",	0, 1, 1, 10),
75.   	FOOD("dead jaguar",	0, 3, 30, 300),
76.   	FOOD("dead killer bee",	0, 1, 1, 10),
77.   	FOOD("dead leocrotta",	0, 5, 50, 500),
78.   	FOOD("dead minotaur",	0, 7, 70, 700),
79.   	FOOD("dead nurse",	0, 4, 40, 400),
80.   	FOOD("dead owlbear",	0, 7, 70, 700),
81.   	FOOD("dead piercer",	0, 2, 20, 200),
82.   	FOOD("dead quivering blob",	0, 1, 10, 100),
83.   	FOOD("dead giant rat",	0, 1, 3, 30),
84.   	FOOD("dead giant scorpion",	0, 1, 10, 100),
85.   	FOOD("dead tengu",	0, 3, 30, 300),
86.   	FOOD("dead unicorn",	0, 3, 30, 300),
87.   	FOOD("dead violet fungi",	0, 1, 10, 100),
88.   	FOOD("dead long worm",	0, 5, 50, 500),
89.   /* %% wt of long worm should be proportional to its length */
90.   	FOOD("dead xan",	0, 3, 30, 300),
91.   	FOOD("dead yellow light",	0, 1, 1, 10),
92.   	FOOD("dead zruty",	0, 6, 60, 600),
93.   
94.   /* weapons ... - ROCK come several at a time */
95.   /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
96.   /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
97.   /* weapons AXE, DAGGER, CRYSKNIFE are good for tin-opening */
98.   #define WEAPON(name,prob,wt,ldam,sdam)	{ name, NULL, NULL, 1, 0 /*%%*/,\
99.   		WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 }
100.  
101.  	WEAPON("arrow",		7, 0, 6, 6),
102.  	WEAPON("sling bullet",	7, 0, 4, 6),
103.  	WEAPON("crossbow bolt",	7, 0, 4, 6),
104.  	WEAPON("dart",		7, 0, 3, 2),
105.  	WEAPON("rock",		6, 1, 3, 3),
106.  	WEAPON("boomerang",	2, 3, 9, 9),
107.  	WEAPON("mace",		9, 3, 6, 7),
108.  	WEAPON("axe",		6, 3, 6, 4),
109.  	WEAPON("flail",		6, 3, 6, 5),
110.  	WEAPON("long sword",	8, 3, 8, 12),
111.  	WEAPON("two handed sword",	6, 4, 10, 6),
112.  	WEAPON("dagger",	6, 3, 4, 3),
113.  	WEAPON("worm tooth",	0, 4, 2, 2),
114.  	WEAPON("crysknife",	0, 3, 12, 12),
115.  	WEAPON("spear",		6, 3, 6, 8),
116.  	WEAPON("bow",		6, 3, 4, 6),
117.  	WEAPON("sling",		5, 3, 6, 6),
118.  	WEAPON("crossbow",	6, 3, 4, 6),
119.  
120.  	{ "whistle", "whistle", NULL, 0, 0,
121.  		TOOL_SYM, 90, 0, 2, 0, 0, 0 },
122.  	{ "magic whistle", "whistle", NULL, 0, 0,
123.  		TOOL_SYM, 10, 0, 2, 0, 0, 0 },
124.  	{ "expensive camera", NULL, NULL, 1, 1,
125.  		TOOL_SYM, 0, 0, 3, 0, 0, 0 },
126.  	{ "ice box", "large box", NULL, 0, 0,
127.  		TOOL_SYM, 0, 0, 40, 0, 0, 0 },
128.  	{ "heavy iron ball", NULL, NULL, 1, 0,
129.  		BALL_SYM, 100, 0, 20, 0, 0, 0 },
130.  	{ "iron chain", NULL, NULL, 1, 0,
131.  		CHAIN_SYM, 100, 0, 20, 0, 0, 0 },
132.  	{ "enormous rock", NULL, NULL, 1, 0,
133.  		ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 },
134.  
135.  #define ARMOR(name,prob,delay,ac,can)	{ name, NULL, NULL, 1, 0,\
136.  		ARMOR_SYM, prob, delay, 8, ac, can, 0 }
137.  	ARMOR("helmet",		 3, 1, 9, 0),
138.  	ARMOR("plate mail",		 5, 5, 3, 2),
139.  	ARMOR("splint mail",	 8, 5, 4, 1),
140.  	ARMOR("banded mail",	10, 5, 4, 0),
141.  	ARMOR("chain mail",		10, 5, 5, 1),
142.  	ARMOR("scale mail",		10, 5, 6, 0),
143.  	ARMOR("ring mail",		15, 5, 7, 0),
144.  	/* the armors below do not rust */
145.  	ARMOR("studded leather armor", 13, 3, 7, 1),
146.  	ARMOR("leather armor",	17, 3, 8, 0),
147.  	ARMOR("elven cloak",	 5, 0, 9, 3),
148.  	ARMOR("shield",		 3, 0, 9, 0),
149.  	ARMOR("pair of gloves",	 1, 1, 9, 0),
150.  
151.  #define POTION(name,color)	{ name, color, NULL, 0, 1,\
152.  		POTION_SYM, 0, 0, 2, 0, 0, 0 }
153.  
154.  	POTION("restore strength",	"orange"),
155.  	POTION("booze",		"bubbly"),
156.  	POTION("invisibility",	"glowing"),
157.  	POTION("fruit juice",	"smoky"),
158.  	POTION("healing",	"pink"),
159.  	POTION("paralysis",	"puce"),
160.  	POTION("monster detection",	"purple"),
161.  	POTION("object detection",	"yellow"),
162.  	POTION("sickness",	"white"),
163.  	POTION("confusion",	"swirly"),
164.  	POTION("gain strength",	"purple-red"),
165.  	POTION("speed",		"ruby"),
166.  	POTION("blindness",	"dark green"),
167.  	POTION("gain level",	"emerald"),
168.  	POTION("extra healing",	"sky blue"),
169.  	POTION("levitation",	"brown"),
170.  	POTION(NULL,	"brilliant blue"),
171.  	POTION(NULL,	"clear"),
172.  	POTION(NULL,	"magenta"),
173.  	POTION(NULL,	"ebony"),
174.  
175.  #define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\
176.  		SCROLL_SYM, prob, 0, 3, 0, 0, 0 }
177.  	SCROLL("enchant armor", "ZELGO MER", 6),
178.  	SCROLL("destroy armor", "JUYED AWK YACC", 5),
179.  	SCROLL("confuse monster", "NR 9", 5),
180.  	SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4),
181.  	SCROLL("blank paper", "READ ME", 3),
182.  	SCROLL("remove curse", "PRATYAVAYAH", 6),
183.  	SCROLL("enchant weapon", "DAIYEN FOOELS", 6),
184.  	SCROLL("damage weapon", "HACKEM MUCHE", 5),
185.  	SCROLL("create monster", "LEP GEX VEN ZEA", 5),
186.  	SCROLL("taming", "PRIRUTSENIE", 1),
187.  	SCROLL("genocide", "ELBIB YLOH",2),
188.  	SCROLL("light", "VERR YED HORRE", 10),
189.  	SCROLL("teleportation", "VENZAR BORGAVVE", 5),
190.  	SCROLL("gold detection", "THARR", 4),
191.  	SCROLL("food detection", "YUM YUM", 1),
192.  	SCROLL("identify", "KERNOD WEL", 18),
193.  	SCROLL("magic mapping", "ELAM EBOW", 5),
194.  	SCROLL("amnesia", "DUAM XNAHT", 3),
195.  	SCROLL("fire", "ANDOVA BEGARIN", 5),
196.  	SCROLL("punishment", "VE FORBRYDERNE", 1),
197.  	SCROLL(NULL, "VELOX NEB", 0),
198.  	SCROLL(NULL, "FOOBIE BLETCH", 0),
199.  	SCROLL(NULL, "TEMOV", 0),
200.  	SCROLL(NULL, "GARVEN DEH", 0),
201.  
202.  #define	WAND(name,metal,prob,flags)	{ name, metal, NULL, 0, 0,\
203.  		WAND_SYM, prob, 0, 3, flags, 0, 0 }
204.  
205.  	WAND("light",	"iridium",		10,	NODIR),
206.  	WAND("secret door detection",	"tin",	5,	NODIR),
207.  	WAND("create monster",	"platinum",	5,	NODIR),
208.  	WAND("wishing",		"glass",	1,	NODIR),
209.  	WAND("striking",	"zinc",		9,	IMMEDIATE),
210.  	WAND("slow monster",	"balsa",	5,	IMMEDIATE),
211.  	WAND("speed monster",	"copper",	5,	IMMEDIATE),
212.  	WAND("undead turning",	"silver",	5,	IMMEDIATE),
213.  	WAND("polymorph",	"brass",	5,	IMMEDIATE),
214.  	WAND("cancellation",	"maple",	5,	IMMEDIATE),
215.  	WAND("teleport monster",	"pine",	5,	IMMEDIATE),
216.  	WAND("make invisible",	"marble",	9,	IMMEDIATE),
217.  	WAND("digging",	"iron",		5,	RAY),
218.  	WAND("magic missile",	"aluminium",	10,	RAY),
219.  	WAND("fire",	"steel",	5,	RAY),
220.  	WAND("sleep",	"curved",	5,	RAY),
221.  	WAND("cold",	"short",	5,	RAY),
222.  	WAND("death",	"long",		1,	RAY),
223.  	WAND(NULL,	"oak",		0,	0),
224.  	WAND(NULL,	"ebony",	0,	0),
225.  	WAND(NULL,	"runed",	0,	0),
226.  
227.  #define	RING(name,stone,spec)	{ name, stone, NULL, 0, 0,\
228.  		RING_SYM, 0, 0, 1, spec, 0, 0 }
229.  
230.  	RING("adornment",	"engagement",	0),
231.  	RING("teleportation",	"wooden",	0),
232.  	RING("regeneration",	"black onyx",	0),
233.  	RING("searching",	"topaz",	0),
234.  	RING("see invisible",	"pearl",	0),
235.  	RING("stealth",		"sapphire",	0),
236.  	RING("levitation",	"moonstone",	0),
237.  	RING("poison resistance", "agate",	0),
238.  	RING("aggravate monster", "tiger eye",	0),
239.  	RING("hunger",		"shining",	0),
240.  	RING("fire resistance",	"gold",		0),
241.  	RING("cold resistance",	"copper",	0),
242.  	RING("protection from shape changers", "diamond", 0),
243.  	RING("conflict",	"jade",		0),
244.  	RING("gain strength",	"ruby",		SPEC),
245.  	RING("increase damage",	"silver",	SPEC),
246.  	RING("protection",	"granite",	SPEC),
247.  	RING("warning",		"wire",		0),
248.  	RING("teleport control", "iron",	0),
249.  	RING(NULL,		"ivory",	0),
250.  	RING(NULL,		"blackened",	0),
251.  
252.  /* gems ************************************************************/
253.  #define	GEM(name,color,prob,gval)	{ name, color, NULL, 0, 1,\
254.  		GEM_SYM, prob, 0, 1, 0, 0, gval }
255.  	GEM("diamond", "blue", 1, 4000),
256.  	GEM("ruby", "red", 1, 3500),
257.  	GEM("sapphire", "blue", 1, 3000),
258.  	GEM("emerald", "green", 1, 2500),
259.  	GEM("turquoise", "green", 1, 2000),
260.  	GEM("aquamarine", "blue", 1, 1500),
261.  	GEM("tourmaline", "green", 1, 1000),
262.  	GEM("topaz", "yellow", 1, 900),
263.  	GEM("opal", "yellow", 1, 800),
264.  	GEM("garnet", "dark", 1, 700),
265.  	GEM("amethyst", "violet", 2, 650),
266.  	GEM("agate", "green", 2, 600),
267.  	GEM("onyx", "white", 2, 550),
268.  	GEM("jasper", "yellowish brown", 2, 500),
269.  	GEM("jade", "green", 2, 450),
270.  	GEM("worthless piece of blue glass", "blue", 20, 0),
271.  	GEM("worthless piece of red glass", "red", 20, 0),
272.  	GEM("worthless piece of yellow glass", "yellow", 20, 0),
273.  	GEM("worthless piece of green glass", "green", 20, 0),
274.  	{ NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }
275.  };
276.  
277.  char obj_symbols[] = {
278.  	ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM,
279.  	BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM,
280.  	WAND_SYM, RING_SYM, GEM_SYM, 0 };
281.  int bases[sizeof(obj_symbols)];