Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef HACK_H
00006 #define HACK_H
00007
00008 #ifndef CONFIG_H
00009 #include "config.h"
00010 #endif
00011
00012
00013 #ifdef BETA
00014 #define Dpline pline
00015 #endif
00016
00017 #define TELL 1
00018 #define NOTELL 0
00019 #define ON 1
00020 #define OFF 0
00021 #define BOLT_LIM 8
00022 #define MAX_CARR_CAP 1000
00023 #define DUMMY { 0 }
00024
00025
00026 #define UNENCUMBERED 0
00027 #define SLT_ENCUMBER 1
00028 #define MOD_ENCUMBER 2
00029 #define HVY_ENCUMBER 3
00030 #define EXT_ENCUMBER 4
00031 #define OVERLOADED 5
00032
00033
00034 #define BY_ORACLE 0
00035 #define BY_COOKIE 1
00036 #define BY_PAPER 2
00037 #define BY_OTHER 9
00038
00039 #ifdef STEED
00040
00041 #define DISMOUNT_GENERIC 0
00042 #define DISMOUNT_FELL 1
00043 #define DISMOUNT_THROWN 2
00044 #define DISMOUNT_POLY 3
00045 #define DISMOUNT_ENGULFED 4
00046 #define DISMOUNT_BONES 5
00047 #define DISMOUNT_BYCHOICE 6
00048 #endif
00049
00050
00051 #define MG_CORPSE 0x01
00052 #define MG_INVIS 0x02
00053 #define MG_DETECT 0x04
00054 #define MG_PET 0x08
00055 #define MG_RIDDEN 0x10
00056 #define MG_INVERSE 0x20
00057
00058
00059 #define SELL_NORMAL (0)
00060 #define SELL_DELIBERATE (1)
00061 #define SELL_DONTSELL (2)
00062
00063
00064
00065
00066
00067
00068 #define DIED 0
00069 #define CHOKING 1
00070 #define POISONING 2
00071 #define STARVING 3
00072 #define DROWNING 4
00073 #define BURNING 5
00074 #define DISSOLVED 6
00075 #define CRUSHING 7
00076 #define STONING 8
00077 #define TURNED_SLIME 9
00078 #ifdef WEBB_DISINT
00079 # define GENOCIDED 10
00080 # define DISINTEGRATED 11
00081 # define MAX_SURVIVABLE_DEATH 11
00082 # define PANICKED 12
00083 # define TRICKED 13
00084 # define QUIT 14
00085 # define ESCAPED 15
00086 #ifdef ASTRAL_ESCAPE
00087 #define DEFIED 16
00088 #define ASCENDED 17
00089 #endif
00090 #endif
00091
00092 #include "align.h"
00093 #include "dungeon.h"
00094 #include "monsym.h"
00095 #include "mkroom.h"
00096 #include "objclass.h"
00097 #include "youprop.h"
00098 #include "wintype.h"
00099 #include "decl.h"
00100 #include "timeout.h"
00101
00102 NEARDATA extern coord bhitpos;
00103
00104
00105 #define ZAPPED_WAND 0
00106 #define THROWN_WEAPON 1
00107 #define KICKED_WEAPON 2
00108 #define FLASHED_LIGHT 3
00109 #define INVIS_BEAM 4
00110
00111 #include "trap.h"
00112 #include "flag.h"
00113 #include "rm.h"
00114 #include "vision.h"
00115 #include "display.h"
00116 #include "engrave.h"
00117 #include "rect.h"
00118 #include "region.h"
00119
00120 #ifdef USE_TRAMPOLI
00121 #undef NDECL
00122 #define NDECL(f) f()
00123 #endif
00124
00125 #include "extern.h"
00126 #include "winprocs.h"
00127
00128 #ifdef USE_TRAMPOLI
00129 #include "wintty.h"
00130 #undef WINTTY_H
00131 #include "trampoli.h"
00132 #undef EXTERN_H
00133 #include "extern.h"
00134 #endif
00135
00136 #define NO_SPELL 0
00137
00138
00139 #define NO_MM_FLAGS 0x00
00140 #define NO_MINVENT 0x01
00141 #define MM_NOWAIT 0x02
00142 #define MM_EDOG 0x04
00143 #define MM_EMIN 0x08
00144 #define MM_ANGRY 0x10
00145 #define MM_NONAME 0x20
00146 #define MM_NOCOUNTBIRTH 0x40
00147 #define MM_IGNOREWATER 0x80
00148 #define MM_ADJACENTOK 0x100
00149
00150
00151 #define DEFUNCT_MONSTER (-100)
00152
00153
00154 #define ALL_FINISHED 0x01
00155
00156
00157 #define BY_NEXTHERE 0x1
00158 #define AUTOSELECT_SINGLE 0x2
00159 #define USE_INVLET 0x4
00160 #define INVORDER_SORT 0x8
00161 #define SIGNAL_NOMENU 0x10
00162 #define FEEL_COCKATRICE 0x20
00163
00164
00165
00166 #define UNPAID_TYPES 0x02
00167 #define GOLD_TYPES 0x04
00168 #define WORN_TYPES 0x08
00169 #define ALL_TYPES 0x10
00170 #define BILLED_TYPES 0x20
00171 #define CHOOSE_ALL 0x40
00172 #define BUC_BLESSED 0x80
00173 #define BUC_CURSED 0x100
00174 #define BUC_UNCURSED 0x200
00175 #define BUC_UNKNOWN 0x400
00176 #define BUC_ALLBKNOWN (BUC_BLESSED|BUC_CURSED|BUC_UNCURSED)
00177 #define UNIDENTIFIED_TYPES 0x800
00178 #define ALL_TYPES_SELECTED -2
00179
00180
00181 #define FM_FMON 0x01
00182 #define FM_MIGRATE 0x02
00183 #define FM_MYDOGS 0x04
00184 #define FM_EVERYWHERE (FM_FMON | FM_MIGRATE | FM_MYDOGS)
00185
00186
00187 #define PICK_RANDOM 0
00188 #define PICK_RIGID 1
00189
00190
00191 #define NOWEBMSG 0x01
00192 #define FORCEBUNGLE 0x02
00193 #define RECURSIVETRAP 0x04
00194
00195
00196 #define DO_MOVE 0
00197 #define TEST_MOVE 1
00198 #define TEST_TRAV 2
00199
00200
00201 #define yn(query) yn_function(query,ynchars, 'n')
00202 #define ynq(query) yn_function(query,ynqchars, 'q')
00203 #define ynaq(query) yn_function(query,ynaqchars, 'y')
00204 #define nyaq(query) yn_function(query,ynaqchars, 'n')
00205 #define nyNaq(query) yn_function(query,ynNaqchars, 'n')
00206 #define ynNaq(query) yn_function(query,ynNaqchars, 'y')
00207
00208
00209 #define VIS_EFFECTS 0x01
00210 #define MAY_HITMON 0x02
00211 #define MAY_HITYOU 0x04
00212 #define MAY_HIT (MAY_HITMON|MAY_HITYOU)
00213 #define MAY_DESTROY 0x08
00214 #define MAY_FRACTURE 0x10
00215
00216
00217 #define ROLL 0x01
00218 #define FLING 0x02
00219 #define LAUNCH_UNSEEN 0x40
00220 #define LAUNCH_KNOWN 0x80
00221
00222
00223 #define EXPL_DARK 0
00224 #define EXPL_NOXIOUS 1
00225 #define EXPL_MUDDY 2
00226 #define EXPL_WET 3
00227 #define EXPL_MAGICAL 4
00228 #define EXPL_FIERY 5
00229 #define EXPL_FROSTY 6
00230 #define EXPL_MAX 7
00231
00232
00233 #define ARM 0
00234 #define EYE 1
00235 #define FACE 2
00236 #define FINGER 3
00237 #define FINGERTIP 4
00238 #define FOOT 5
00239 #define HAND 6
00240 #define HANDED 7
00241 #define HEAD 8
00242 #define LEG 9
00243 #define LIGHT_HEADED 10
00244 #define NECK 11
00245 #define SPINE 12
00246 #define TOE 13
00247 #define HAIR 14
00248 #define BLOOD 15
00249 #define LUNG 16
00250 #define NOSE 17
00251 #define STOMACH 18
00252
00253
00254 #define MENUTYPELEN sizeof("traditional ")
00255 #define MENU_TRADITIONAL 0
00256 #define MENU_COMBINATION 1
00257 #define MENU_PARTIAL 2
00258 #define MENU_FULL 3
00259
00260 #define MENU_SELECTED TRUE
00261 #define MENU_UNSELECTED FALSE
00262
00263
00264
00265
00266
00267
00268 #define SET_IN_FILE 0
00269 #define SET_VIA_PROG 1
00270 #define DISP_IN_GAME 2
00271 #define SET_IN_GAME 3
00272
00273 #define FEATURE_NOTICE_VER(major,minor,patch) (((unsigned long)major << 24) | \
00274 ((unsigned long)minor << 16) | \
00275 ((unsigned long)patch << 8) | \
00276 ((unsigned long)0))
00277
00278 #define FEATURE_NOTICE_VER_MAJ (flags.suppress_alert >> 24)
00279 #define FEATURE_NOTICE_VER_MIN (((unsigned long)(0x0000000000FF0000L & flags.suppress_alert)) >> 16)
00280 #define FEATURE_NOTICE_VER_PATCH (((unsigned long)(0x000000000000FF00L & flags.suppress_alert)) >> 8)
00281
00282 #ifndef max
00283 #define max(a,b) ((a) > (b) ? (a) : (b))
00284 #endif
00285 #ifndef min
00286 #define min(x,y) ((x) < (y) ? (x) : (y))
00287 #endif
00288 #define plur(x) (((x) == 1) ? "" : "s")
00289
00290 #define ARM_BONUS(obj) (objects[(obj)->otyp].a_ac + (obj)->spe \
00291 - min((int)greatest_erosion(obj),objects[(obj)->otyp].a_ac))
00292
00293 #define makeknown(x) discover_object((x),TRUE,TRUE)
00294 #define distu(xx,yy) dist2((int)(xx),(int)(yy),(int)u.ux,(int)u.uy)
00295 #define onlineu(xx,yy) online2((int)(xx),(int)(yy),(int)u.ux,(int)u.uy)
00296
00297 #define rn1(x,y) (rn2(x)+(y))
00298
00299
00300 #define AC_VALUE(AC) ((AC) >= 0 ? (AC) : -rnd(-(AC)))
00301
00302 #if defined(MICRO) && !defined(__DJGPP__)
00303 #define getuid() 1
00304 #define getlogin() ((char *)0)
00305 #endif
00306
00307 #if defined(OVERLAY)&&(defined(OVL0)||defined(OVL1)||defined(OVL2)||defined(OVL3)||defined(OVLB))
00308 # define USE_OVLx
00309 # define STATIC_DCL extern
00310 # define STATIC_OVL
00311 # ifdef OVLB
00312 # define STATIC_VAR
00313 # else
00314 # define STATIC_VAR extern
00315 # endif
00316
00317 #else
00318 # define STATIC_DCL static
00319 # define STATIC_OVL static
00320 # define STATIC_VAR static
00321
00322
00323 # define OVL0
00324 # define OVL1
00325 # define OVL2
00326 # define OVL3
00327 # define OVLB
00328 #endif
00329
00330
00331 #if defined(USE_TRAMPOLI) || defined(USE_OVLx)
00332 # define STATIC_PTR
00333 #else
00334 # define STATIC_PTR static
00335 #endif
00336
00337
00338
00339
00340
00341 #if defined(WIN_CE)
00342 # define CFDECLSPEC __cdecl
00343 #else
00344 # define CFDECLSPEC
00345 #endif
00346
00347 #endif