Source:NetHack 2.2a/obj.h

Below is the full text to obj.h from the source code of NetHack 2.2a. To link to a particular line, write [[NetHack 2.2a/obj.h#line123 ]], for example.

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

1.   /*	SCCS Id: @(#)obj.h	1.4	87/08/08 2.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3.    /* obj.h - version 1.0.3 */ 4.    5.    #ifndef OBJ_H 6.   #define OBJ_H 7.    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.  	unsigned otyp; 15.  #ifdef DGK 16.  	unsigned int	owt; 17.  	unsigned int	quan; 18.  #else 19.  	uchar owt; 20.  	uchar quan;		/* use oextra for tmp gold objects */ 21.  #endif 22.  	schar spe;		/* quality of weapon, armor or ring (+ or -) 23.  				   number of charges for wand ( >= -1 ) 24.  				   special for uball and amulet %% BAH */ 25.  	char olet; 26.  	char invlet; 27.  	Bitfield(oinvis,1);	/* not yet implemented */ 28.  	Bitfield(odispl,1); 29.  	Bitfield(known,1);	/* exact nature known */ 30.  	Bitfield(dknown,1);	/* color or text known */ 31.  	Bitfield(cursed,1); 32.  	Bitfield(unpaid,1);	/* on some bill */ 33.  	Bitfield(rustfree,1); 34.  	Bitfield(no_charge, 1);	/* if shk shouldn't charge for this */ 35.  	Bitfield(onamelth,6); 36.  	long age;		/* creation date */ 37.  	long owornmask; 38.  #define	W_ARM	01L 39.  #define	W_ARM2	02L 40.  #define	W_ARMH	04L 41.  #define	W_ARMS	010L 42.  #define	W_ARMG	020L 43.  #define	W_ARMOR		(W_ARM | W_ARM2 | W_ARMH | W_ARMS | W_ARMG) 44.  #define	W_RINGL	010000L	/* make W_RINGL = RING_LEFT (see uprop) */ 45.  #define	W_RINGR	020000L 46.  #define	W_RING		(W_RINGL | W_RINGR) 47.  #define	W_WEP	01000L 48.  #define	W_BALL	02000L 49.  #define	W_CHAIN	04000L 50.  	long oextra[1];		/* used for name of ordinary objects - length 51.  				   is flexible; amount for tmp gold objects */ 52.  };  53.    54.   extern struct obj *fobj; 55.   56.   #define newobj(xl)	(struct obj *) alloc((unsigned)(xl) + sizeof(struct obj)) 57.  #define	ONAME(otmp)	((char *) otmp->oextra) 58.  #define	OGOLD(otmp)	(otmp->oextra[0]) 59.   60.   #endif