Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef OBJCLASS_H
00006 #define OBJCLASS_H
00007
00008
00009
00010 struct objclass {
00011 short oc_name_idx;
00012 short oc_descr_idx;
00013 char * oc_uname;
00014 Bitfield(oc_name_known,1);
00015 Bitfield(oc_merge,1);
00016 Bitfield(oc_uses_known,1);
00017
00018
00019
00020 Bitfield(oc_pre_discovered,1);
00021
00022 Bitfield(oc_magic,1);
00023 Bitfield(oc_charged,1);
00024 Bitfield(oc_unique,1);
00025 Bitfield(oc_nowish,1);
00026
00027 Bitfield(oc_big,1);
00028 #define oc_bimanual oc_big
00029 #define oc_bulky oc_big
00030 Bitfield(oc_tough,1);
00031
00032 Bitfield(oc_dir,2);
00033 #define NODIR 1
00034 #define IMMEDIATE 2
00035 #define RAY 3
00036
00037 #define PIERCE 1
00038 #define SLASH 2
00039 #define WHACK 0
00040
00041
00042
00043 Bitfield(oc_material,5);
00044 #define LIQUID 1
00045 #define WAX 2
00046 #define VEGGY 3
00047 #define FLESH 4
00048 #define PAPER 5
00049 #define CLOTH 6
00050 #define LEATHER 7
00051 #define WOOD 8
00052 #define BONE 9
00053 #define DRAGON_HIDE 10
00054 #define IRON 11
00055 #define METAL 12
00056 #define COPPER 13
00057 #define SILVER 14
00058 #define GOLD 15
00059 #define PLATINUM 16
00060 #define MITHRIL 17
00061 #define PLASTIC 18
00062 #define GLASS 19
00063 #define GEMSTONE 20
00064 #define MINERAL 21
00065
00066 #define is_organic(otmp) (objects[otmp->otyp].oc_material <= WOOD)
00067 #define is_metallic(otmp) (objects[otmp->otyp].oc_material >= IRON && \
00068 objects[otmp->otyp].oc_material <= MITHRIL)
00069
00070
00071
00072 #define is_rustprone(otmp) (objects[otmp->otyp].oc_material == IRON)
00073
00074
00075 #define is_corrodeable(otmp) (objects[otmp->otyp].oc_material == COPPER || objects[otmp->otyp].oc_material == IRON)
00076
00077 #define is_damageable(otmp) (is_rustprone(otmp) || is_flammable(otmp) || \
00078 is_rottable(otmp) || is_corrodeable(otmp))
00079
00080 schar oc_subtyp;
00081 #define oc_skill oc_subtyp
00082 #define oc_armcat oc_subtyp
00083 #define ARM_SHIELD 1
00084 #define ARM_HELM 2
00085 #define ARM_GLOVES 3
00086 #define ARM_BOOTS 4
00087 #define ARM_CLOAK 5
00088 #define ARM_SHIRT 6
00089 #define ARM_SUIT 0
00090
00091 uchar oc_oprop;
00092 char oc_class;
00093 schar oc_delay;
00094 uchar oc_color;
00095
00096 short oc_prob;
00097 unsigned short oc_weight;
00098 short oc_cost;
00099
00100
00101 schar oc_wsdam, oc_wldam;
00102 schar oc_oc1, oc_oc2;
00103 #define oc_hitbon oc_oc1
00104
00105 #define a_ac oc_oc1
00106 #define a_can oc_oc2
00107 #define oc_level oc_oc2
00108
00109 unsigned short oc_nutrition;
00110 };
00111
00112 struct objdescr {
00113 const char *oc_name;
00114 const char *oc_descr;
00115 };
00116
00117 extern NEARDATA struct objclass objects[];
00118 extern NEARDATA struct objdescr obj_descr[];
00119
00120
00121
00122
00123
00124 #define RANDOM_CLASS 0
00125 #define ILLOBJ_CLASS 1
00126 #define WEAPON_CLASS 2
00127 #define ARMOR_CLASS 3
00128 #define RING_CLASS 4
00129 #define AMULET_CLASS 5
00130 #define TOOL_CLASS 6
00131 #define FOOD_CLASS 7
00132 #define POTION_CLASS 8
00133 #define SCROLL_CLASS 9
00134 #define SPBOOK_CLASS 10
00135 #define WAND_CLASS 11
00136 #define COIN_CLASS 12
00137 #define GEM_CLASS 13
00138 #define ROCK_CLASS 14
00139 #define BALL_CLASS 15
00140 #define CHAIN_CLASS 16
00141 #define VENOM_CLASS 17
00142 #define MAXOCLASSES 18
00143
00144 #define ALLOW_COUNT (MAXOCLASSES+1)
00145 #define ALL_CLASSES (MAXOCLASSES+2)
00146 #define ALLOW_NONE (MAXOCLASSES+3)
00147
00148 #define BURNING_OIL (MAXOCLASSES+1)
00149 #define MON_EXPLODE (MAXOCLASSES+2)
00150
00151 #if 0
00152 extern const char def_oc_syms[MAXOCLASSES];
00153 extern uchar oc_syms[MAXOCLASSES];
00154 #endif
00155
00156
00157
00158 #define ILLOBJ_SYM ']'
00159 #define WEAPON_SYM ')'
00160 #define ARMOR_SYM '['
00161 #define RING_SYM '='
00162 #define AMULET_SYM '"'
00163 #define TOOL_SYM '('
00164 #define FOOD_SYM '%'
00165 #define POTION_SYM '!'
00166 #define SCROLL_SYM '?'
00167 #define SPBOOK_SYM '+'
00168 #define WAND_SYM '/'
00169 #define GOLD_SYM '$'
00170 #define GEM_SYM '*'
00171 #define ROCK_SYM '`'
00172 #define BALL_SYM '0'
00173 #define CHAIN_SYM '_'
00174 #define VENOM_SYM '.'
00175
00176 struct fruit {
00177 char fname[PL_FSIZ];
00178 int fid;
00179 struct fruit *nextf;
00180 };
00181 #define newfruit() (struct fruit *)alloc(sizeof(struct fruit))
00182 #define dealloc_fruit(rind) free((genericptr_t) (rind))
00183
00184 #define OBJ_NAME(obj) (obj_descr[(obj).oc_name_idx].oc_name)
00185 #define OBJ_DESCR(obj) (obj_descr[(obj).oc_descr_idx].oc_descr)
00186 #endif