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