aboutsummaryrefslogtreecommitdiff
path: root/hack/def.objclass.h
blob: e3885549e3928ae30ef08a0023c2d0ed06317c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.objclass.h - version 1.0.3 */
/* $DragonFly: src/games/hack/def.objclass.h,v 1.3 2006/08/21 19:45:32 pavalos Exp $ */

#ifndef _DEF_OBJCLASS_H_
#define _DEF_OBJCLASS_H_
/* definition of a class of objects */

struct objclass {
	const char *oc_name;	/* actual name */
	const char *oc_descr;	/* description when name unknown */
	char *oc_uname;		/* called by user */
	Bitfield(oc_name_known, 1);
	Bitfield(oc_merge, 1);	/* merge otherwise equal objects */
	char oc_olet;
	schar oc_prob;		/* probability for mkobj() */
	schar oc_delay;		/* delay when using such an object */
	uchar oc_weight;
	schar oc_oc1, oc_oc2;
	int oc_oi;
#define	nutrition	oc_oi	/* for foods */
#define	a_ac		oc_oc1	/* for armors - only used in ARM_BONUS */
#define	ARM_BONUS(obj)	((10 - objects[obj->otyp].a_ac) + obj->spe)
#define	a_can		oc_oc2	/* for armors */
#define	bits		oc_oc1	/* for wands and rings */
				/* wands */
#define		NODIR		1
#define		IMMEDIATE	2
#define		RAY		4
				/* rings */
#define		SPEC		1	/* +n is meaningful */
#define	wldam		oc_oc1	/* for weapons and PICK_AXE */
#define	wsdam		oc_oc2	/* for weapons and PICK_AXE */
#define	g_val		oc_oi	/* for gems: value on exit */
};

extern struct objclass objects[];

/* definitions of all object-symbols */

#define	ILLOBJ_SYM	'\\'
#define	AMULET_SYM	'"'
#define	FOOD_SYM	'%'
#define	WEAPON_SYM	')'
#define	TOOL_SYM	'('
#define	BALL_SYM	'0'
#define	CHAIN_SYM	'_'
#define	ROCK_SYM	'`'
#define	ARMOR_SYM	'['
#define	POTION_SYM	'!'
#define	SCROLL_SYM	'?'
#define	WAND_SYM	'/'
#define	RING_SYM	'='
#define	GEM_SYM		'*'
/* Other places with explicit knowledge of object symbols:
 * hack.mklev.c:	"=/)%?![<>"[rn2(9)];
 * hack.mkobj.c:	char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
 * hack.apply.c:	otmp = getobj("0#%", "put in");
 * hack.eat.c:		otmp = getobj("%", "eat");
 * hack.invent.c:	else if (strchr("!%?[()= /\"0", sym)) {
 */
#endif /* _DEF_OBJCLASS_H_ */