1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 2 /* def.objclass.h - version 1.0.3 */ 3 /* $DragonFly: src/games/hack/def.objclass.h,v 1.2 2005/05/22 03:37:05 y0netan1 Exp $ */ 4 5 /* definition of a class of objects */ 6 7 struct objclass { 8 const char *oc_name; /* actual name */ 9 const 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 #define wldam oc_oc1 /* for weapons and PICK_AXE */ 31 #define wsdam oc_oc2 /* for weapons and PICK_AXE */ 32 #define g_val oc_oi /* for gems: value on exit */ 33 }; 34 35 extern struct objclass objects[]; 36 37 /* definitions of all object-symbols */ 38 39 #define ILLOBJ_SYM '\\' 40 #define AMULET_SYM '"' 41 #define FOOD_SYM '%' 42 #define WEAPON_SYM ')' 43 #define TOOL_SYM '(' 44 #define BALL_SYM '0' 45 #define CHAIN_SYM '_' 46 #define ROCK_SYM '`' 47 #define ARMOR_SYM '[' 48 #define POTION_SYM '!' 49 #define SCROLL_SYM '?' 50 #define WAND_SYM '/' 51 #define RING_SYM '=' 52 #define GEM_SYM '*' 53 /* Other places with explicit knowledge of object symbols: 54 * ....shk.c: char shtypes[] = "=/)%?!["; 55 * mklev.c: "=/)%?![<>" 56 * hack.mkobj.c: char mkobjstr[] = "))[[!!!!????%%%%/=**"; 57 * hack.apply.c: otmp = getobj("0#%", "put in"); 58 * hack.eat.c: otmp = getobj("%", "eat"); 59 * hack.invent.c: if(index("!%?[)=*(0/\"", sym)){ 60 * hack.invent.c: || index("%?!*",otmp->olet))){ 61 */ 62