xref: /netbsd/games/hack/def.obj.h (revision bf9ec67e)
1 /*	$NetBSD: def.obj.h,v 1.4 1997/10/19 16:57:09 christos Exp $	*/
2 
3 /*
4  * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
5  */
6 #ifndef _DEF_OBJ_H_
7 #define _DEF_OBJ_H_
8 struct obj {
9 	struct obj *nobj;
10 	unsigned o_id;
11 	unsigned o_cnt_id;		/* id of container object is in */
12 	xchar ox,oy;
13 	xchar odx,ody;
14 	uchar otyp;
15 	uchar owt;
16 	uchar quan;		/* use oextra for tmp gold objects */
17 	schar spe;		/* quality of weapon, armor or ring (+ or -)
18 				   number of charges for wand ( >= -1 )
19 				   special for uball and amulet %% BAH */
20 	char olet;
21 	char invlet;
22 	Bitfield(oinvis,1);	/* not yet implemented */
23 	Bitfield(odispl,1);
24 	Bitfield(known,1);	/* exact nature known */
25 	Bitfield(dknown,1);	/* color or text known */
26 	Bitfield(cursed,1);
27 	Bitfield(unpaid,1);	/* on some bill */
28 	Bitfield(rustfree,1);
29 	Bitfield(onamelth,6);
30 	long age;		/* creation date */
31 	long owornmask;
32 #define	W_ARM	01L
33 #define	W_ARM2	02L
34 #define	W_ARMH	04L
35 #define	W_ARMS	010L
36 #define	W_ARMG	020L
37 #define	W_ARMOR		(W_ARM | W_ARM2 | W_ARMH | W_ARMS | W_ARMG)
38 #define	W_RINGL	010000L	/* make W_RINGL = RING_LEFT (see uprop) */
39 #define	W_RINGR	020000L
40 #define	W_RING		(W_RINGL | W_RINGR)
41 #define	W_WEP	01000L
42 #define	W_BALL	02000L
43 #define	W_CHAIN	04000L
44 	long oextra[1];		/* used for name of ordinary objects - length
45 				   is flexible; amount for tmp gold objects */
46 };
47 
48 extern struct obj *fobj;
49 
50 #define newobj(xl)	(struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
51 #define	ONAME(otmp)	((char *) otmp->oextra)
52 #define	OGOLD(otmp)	(otmp->oextra[0])
53 #endif /* _DEF_OBJ_H_ */
54