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