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