home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / decl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  8.5 KB  |  305 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)decl.h    3.1    93/03/18    */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef DECL_H
  6. #define DECL_H
  7.  
  8. #define E extern
  9.  
  10. E int NDECL((*occupation));
  11. E int NDECL((*afternmv));
  12.  
  13. E const char *hname;
  14. E int hackpid;
  15. #if defined(UNIX) || defined(VMS)
  16. E int locknum;
  17. #endif
  18. #ifdef DEF_PAGER
  19. E char *catmore;
  20. #endif    /* DEF_PAGER */
  21.  
  22. E char SAVEF[];
  23. #ifdef MICRO
  24. E char SAVEP[];
  25. #endif
  26.  
  27. E NEARDATA int bases[];
  28.  
  29. E NEARDATA int multi;
  30. E NEARDATA int warnlevel;
  31. E NEARDATA int nroom;
  32. E NEARDATA int nsubroom;
  33. E NEARDATA int occtime;
  34.  
  35. E int x_maze_max, y_maze_max;
  36. E int otg_temp;
  37.  
  38. #ifdef REDO
  39. E NEARDATA int in_doagain;
  40. #endif
  41.  
  42. E struct dgn_topology {    /* special dungeon levels for speed */
  43.     d_level    d_oracle_level;
  44.     d_level    d_bigroom_level;    /* unused */
  45. #ifdef REINCARNATION
  46.     d_level    d_rogue_level;
  47. #endif
  48.     d_level    d_medusa_level;
  49.     d_level    d_stronghold_level;
  50.     d_level    d_valley_level;
  51.     d_level    d_wiz1_level;
  52.     d_level    d_wiz2_level;
  53.     d_level    d_wiz3_level;
  54.     d_level     d_juiblex_level;
  55.     d_level     d_orcus_level;
  56.     d_level    d_baalzebub_level;    /* unused */
  57.     d_level    d_asmodeus_level;    /* unused */
  58.     d_level    d_portal_level;        /* only in goto_level() [do.c] */
  59.     d_level    d_sanctum_level;
  60.     d_level    d_earth_level;
  61.     d_level    d_water_level;
  62.     d_level    d_fire_level;
  63.     d_level    d_air_level;
  64.     d_level    d_astral_level;
  65.     xchar    d_tower_dnum;
  66. #ifdef MULDGN
  67.     xchar    d_mines_dnum, d_quest_dnum;
  68.     d_level    d_qstart_level, d_qlocate_level, d_nemesis_level;
  69.     d_level    d_knox_level;
  70. #endif
  71. } dungeon_topology;
  72. /* macros for accesing the dungeon levels by their old names */
  73. #define oracle_level        (dungeon_topology.d_oracle_level)
  74. #define bigroom_level        (dungeon_topology.d_bigroom_level)
  75. #ifdef REINCARNATION
  76. #define rogue_level        (dungeon_topology.d_rogue_level)
  77. #endif
  78. #define medusa_level        (dungeon_topology.d_medusa_level)
  79. #define stronghold_level    (dungeon_topology.d_stronghold_level)
  80. #define valley_level        (dungeon_topology.d_valley_level)
  81. #define wiz1_level        (dungeon_topology.d_wiz1_level)
  82. #define wiz2_level        (dungeon_topology.d_wiz2_level)
  83. #define wiz3_level        (dungeon_topology.d_wiz3_level)
  84. #define juiblex_level        (dungeon_topology.d_juiblex_level)
  85. #define orcus_level        (dungeon_topology.d_orcus_level)
  86. #define baalzebub_level        (dungeon_topology.d_baalzebub_level)
  87. #define asmodeus_level        (dungeon_topology.d_asmodeus_level)
  88. #define portal_level        (dungeon_topology.d_portal_level)
  89. #define sanctum_level        (dungeon_topology.d_sanctum_level)
  90. #define earth_level        (dungeon_topology.d_earth_level)
  91. #define water_level        (dungeon_topology.d_water_level)
  92. #define fire_level        (dungeon_topology.d_fire_level)
  93. #define air_level        (dungeon_topology.d_air_level)
  94. #define astral_level        (dungeon_topology.d_astral_level)
  95. #define tower_dnum        (dungeon_topology.d_tower_dnum)
  96. #ifdef MULDGN
  97. #define mines_dnum        (dungeon_topology.d_mines_dnum)
  98. #define quest_dnum        (dungeon_topology.d_quest_dnum)
  99. #define qstart_level        (dungeon_topology.d_qstart_level)
  100. #define qlocate_level        (dungeon_topology.d_qlocate_level)
  101. #define nemesis_level        (dungeon_topology.d_nemesis_level)
  102. #define knox_level        (dungeon_topology.d_knox_level)
  103. #endif
  104.  
  105. E NEARDATA stairway dnstair, upstair; /* stairs up and down. */
  106. #define xdnstair    (dnstair.sx)
  107. #define ydnstair    (dnstair.sy)
  108. #define xupstair    (upstair.sx)
  109. #define yupstair    (upstair.sy)
  110.  
  111. E NEARDATA stairway dnladder, upladder; /* ladders up and down. */
  112. #define xdnladder    (dnladder.sx)
  113. #define ydnladder    (dnladder.sy)
  114. #define xupladder    (upladder.sx)
  115. #define yupladder    (upladder.sy)
  116.  
  117. E NEARDATA stairway sstairs;
  118.  
  119. E NEARDATA dest_area updest, dndest; /* level-change dest. areas */
  120.  
  121. E NEARDATA coord inv_pos;
  122. E NEARDATA dungeon dungeons[];
  123. E NEARDATA s_level *sp_levchn;
  124. #define dunlev_reached(x)    (dungeons[(x)->dnum].dunlev_ureached)
  125.  
  126. #ifdef MULDGN
  127. #include "quest.h"
  128. E struct q_score     quest_status;
  129. #endif
  130.  
  131. E NEARDATA int done_stopprint;
  132. E NEARDATA int done_hup;
  133.  
  134. E NEARDATA char pl_character[PL_CSIZ];
  135. #ifdef TUTTI_FRUTTI
  136. E NEARDATA char pl_fruit[PL_FSIZ];
  137. E NEARDATA int current_fruit;
  138. E NEARDATA struct fruit *ffruit;
  139. #endif
  140.  
  141. E NEARDATA char tune[6];
  142.  
  143. E NEARDATA const char quitchars[];
  144. E NEARDATA const char vowels[];
  145. E NEARDATA const char ynchars[];
  146. E NEARDATA const char ynqchars[];
  147. E NEARDATA const char ynaqchars[];
  148. E NEARDATA const char ynNaqchars[];
  149. E NEARDATA long yn_number;
  150. E NEARDATA int smeq[];
  151. E NEARDATA int doorindex;
  152. E NEARDATA char *save_cm;
  153. #define KILLED_BY_AN     0
  154. #define KILLED_BY     1
  155. #define NO_KILLER_PREFIX 2
  156. E NEARDATA int killer_format;
  157. E NEARDATA const char *killer;
  158. E const char *configfile;
  159. E NEARDATA char plname[PL_NSIZ];
  160. E NEARDATA char dogname[];
  161. E NEARDATA char catname[];
  162. E char preferred_pet;
  163. E NEARDATA const char *occtxt;        /* defined when occupation != NULL */
  164. E NEARDATA const char *nomovemsg;
  165. E NEARDATA const char nul[];
  166. E const char *traps[];
  167. E char lock[];
  168.  
  169. E NEARDATA const char sdir[], ndir[];
  170. E NEARDATA const schar xdir[], ydir[], zdir[];
  171.  
  172. E NEARDATA schar tbx, tby;        /* set in mthrowu.c */
  173. E NEARDATA int dig_effort;    /* apply.c, hack.c */
  174. E NEARDATA d_level dig_level;
  175. E NEARDATA coord dig_pos;
  176. E NEARDATA boolean dig_down;
  177.  
  178. E NEARDATA long moves, monstermoves;
  179. E NEARDATA long wailmsg;
  180.  
  181. E NEARDATA boolean in_mklev;
  182. E NEARDATA boolean stoned;
  183. E NEARDATA boolean unweapon;
  184. E NEARDATA boolean mrg_to_wielded;
  185.  
  186. #ifdef KOPS
  187. E NEARDATA boolean allow_kops;
  188. #endif
  189.  
  190. E const int shield_static[];
  191.  
  192. #ifndef SPELLS_H
  193. #include "spell.h"
  194. #endif
  195. E NEARDATA struct spell spl_book[];    /* sized in decl.c */
  196.  
  197. #ifdef TEXTCOLOR
  198. # ifndef COLOR_H
  199. #include "color.h"
  200. # endif
  201. E const int zapcolors[];
  202. #endif
  203.  
  204. E const char def_oc_syms[MAXOCLASSES];    /* default class symbols */
  205. E uchar oc_syms[MAXOCLASSES];        /* current class symbols */
  206. E const char def_monsyms[MAXMCLASSES];    /* default class symbols */
  207. E uchar monsyms[MAXMCLASSES];        /* current class symbols */
  208.  
  209. #ifndef OBJ_H
  210. # include "obj.h"
  211. #endif
  212.  
  213. E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
  214. #ifdef TOURIST
  215.     *uarmu, /* under-wear, so to speak */
  216. #endif
  217. #ifdef POLYSELF
  218.     *uskin,
  219. #endif
  220.     *uamul, *uleft, *uright, *ublindf, *uwep;
  221.  
  222. E NEARDATA struct obj *uchain;    /* defined only when punished */
  223. E NEARDATA struct obj *uball;
  224. E NEARDATA struct obj *migrating_objs;
  225. E NEARDATA struct obj *billobjs;
  226. E NEARDATA struct obj zeroobj;        /* init'd and defined in decl.c */
  227.  
  228. E NEARDATA const char *he[3];
  229. E NEARDATA const char *him[3];
  230. E NEARDATA const char *his[3];
  231.  
  232. #ifndef YOU_H
  233. # include "you.h"
  234. #endif
  235.  
  236. E NEARDATA struct you u;
  237.  
  238. #ifndef ONAMES_H
  239. # include "onames.h"
  240. #endif
  241. #ifndef PM_H
  242. # include "pm.h"
  243. #endif
  244.  
  245. E NEARDATA struct permonst playermon, *uasmon;
  246.                     /* also decl'd extern in permonst.h */
  247.                     /* init'd in monst.c */
  248.  
  249. E NEARDATA struct monst youmonst;    /* init'd and defined in decl.c */
  250. E NEARDATA struct monst *mydogs, *migrating_mons;
  251.  
  252. E struct c_color_names {
  253.     char const    *const c_black, *const c_amber, *const c_golden,
  254.         *const c_light_blue,*const c_red, *const c_green,
  255.         *const c_silver, *const c_blue, *const c_purple,
  256.         *const c_white;
  257. } NEARDATA c_color_names;
  258. #define Black        c_color_names.c_black
  259. #define amber        c_color_names.c_amber
  260. #define golden        c_color_names.c_golden
  261. #define light_blue    c_color_names.c_light_blue
  262. #define red        c_color_names.c_red
  263. #define green        c_color_names.c_green
  264. #define silver        c_color_names.c_silver
  265. #define blue        c_color_names.c_blue
  266. #define purple        c_color_names.c_purple
  267. #define White        c_color_names.c_white
  268.  
  269. E struct c_common_strings {
  270.     char const    *const c_nothing_happens, *const c_thats_enough_tries,
  271.         *const c_silly_thing_to, *const c_shudder_for_moment;
  272. } c_common_strings;
  273. #define nothing_happens    c_common_strings.c_nothing_happens
  274. #define thats_enough_tries c_common_strings.c_thats_enough_tries
  275. #define silly_thing_to       c_common_strings.c_silly_thing_to
  276. #define shudder_for_moment c_common_strings.c_shudder_for_moment
  277.  
  278. /* Vision */
  279. E NEARDATA boolean vision_full_recalc;    /* TRUE if need vision recalc */
  280. E NEARDATA char **viz_array;    /* could see/in sight row pointers */
  281.  
  282. /* Window system stuff */
  283. E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
  284. E NEARDATA winid WIN_MAP, WIN_INVEN;
  285. E char toplines[];
  286. #ifndef TERMCAP_H
  287. E struct tc_gbl_data {    /* also declared in termcap.h */
  288.     char *tc_AS, *tc_AE;    /* graphics start and end (tty font swapping) */
  289.     int   tc_LI,  tc_CO;    /* lines and columns */
  290. } tc_gbl_data;
  291. #define AS tc_gbl_data.tc_AS
  292. #define AE tc_gbl_data.tc_AE
  293. #define LI tc_gbl_data.tc_LI
  294. #define CO tc_gbl_data.tc_CO
  295. #endif
  296.  
  297. /* xxxexplain[] is in drawing.c */
  298. E const char *monexplain[], *objexplain[], *oclass_names[];
  299.  
  300. E NEARDATA const char *pl_classes;
  301.  
  302. #undef E
  303.  
  304. #endif /* DECL_H */
  305.