Source:NetHack 1.4f/objclass.h

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

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

1.   /*	SCCS Id: @(#)objclass.h	1.4	87/08/08 2.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3.    /* objclass.h - version 1.0.3 */ 4.    5.    /* definition of a class of objects */ 6.    7.    struct objclass { 8.   	char *oc_name;		/* actual name */ 9.   	char *oc_descr;		/* description when name unknown */ 10.  	char *oc_uname;		/* called by user */ 11.  	Bitfield(oc_name_known,1); 12.  	Bitfield(oc_merge,1);	/* merge otherwise equal objects */ 13.  	char oc_olet; 14.  	schar oc_prob;		/* probability for mkobj */ 15.  	schar oc_delay;		/* delay when using such an object */ 16.  	uchar oc_weight; 17.  	schar oc_oc1, oc_oc2; 18.  	int oc_oi; 19.  #define	nutrition	oc_oi	/* for foods */ 20.  #define	a_ac		oc_oc1	/* for armors - only used in ARM_BONUS */ 21.  #define ARM_BONUS(obj)	((10 - objects[obj->otyp].a_ac) + obj->spe) 22.  #define	a_can		oc_oc2	/* for armors */ 23.  #define bits		oc_oc1	/* for wands and rings */ 24.  				/* wands */ 25.  #define		NODIR		1 26.  #define		IMMEDIATE	2 27.  #define		RAY		4 28.  				/* rings */ 29.  #define		SPEC		1	/* +n is meaningful */ 30.    /* Check the AD&D rules! The FIRST is small monster damage. */ 31.   #define	wsdam		oc_oc1	/* for weapons and PICK_AXE */ 32.  #define	wldam		oc_oc2	/* for weapons and PICK_AXE */ 33.   34.   #define	g_val		oc_oi	/* for gems: value on exit */ 35.  #ifdef MSDOS 36.  	int oc_descr_i;		/* where the description comes from */ 37.  #endif 38.  #ifdef SPELLS 39.  #define spl_lev		oc_oi	/* for books: spell level */ 40.  #endif 41.  };  42.    43.   extern struct objclass objects[]; 44.   45.   /* definitions of all object-symbols */ 46.   47.   #define	ILLOBJ_SYM	'\\' 48.  #define	AMULET_SYM	'"'  49.   #define	FOOD_SYM	'%'  50.   #define	WEAPON_SYM	')'  51.   #define	TOOL_SYM	'('  52.   #define	BALL_SYM	'0'  53.   #define	CHAIN_SYM	'_'  54.   #define	ROCK_SYM	'`'  55.   #define	ARMOR_SYM	'['  56.   #define	POTION_SYM	'!'  57.   #define	SCROLL_SYM	'?'  58.   #define	WAND_SYM	'/'  59.   #define	RING_SYM	'='  60.   #define	GEM_SYM		'*'  61.   #define	GOLD_SYM	'$'  62.   #ifdef SPELLS  63.   #define	SPBOOK_SYM	'+'	/* actually SPELL-book */  64.   #endif  65.   /* Other places with explicit knowledge of object symbols:  66.    * ....shk.c:	char shtypes[] = "=/)%?![";  67.    * mklev.c:	"=/)%?![<>+"  68.    * mkobj.c:	char mkobjstr[] = "))[[!!!!????%%%%/=**+";  69.    * apply.c:   otmp = getobj("0#%", "put in");  70.    * eat.c:     otmp = getobj("%", "eat");  71.    * invent.c:          if(index("!%?[)=*(0/+\"", sym)){  72.    * invent.c:    || index("%?!*+",otmp->olet))){  73.    */