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