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

  1. /*    SCCS Id: @(#)decl.c    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. #include    "hack.h"
  6.  
  7. int NDECL((*afternmv));
  8. int NDECL((*occupation));
  9.  
  10. /* from xxxmain.c */
  11. const char *hname = 0;        /* name of the game (argv[0] of main) */
  12. int hackpid = 0;        /* current process id */
  13. #if defined(UNIX) || defined(VMS)
  14. int locknum = 0;        /* max num of simultaneous users */
  15. #endif
  16. #ifdef DEF_PAGER
  17. char *catmore = 0;        /* default pager */
  18. #endif
  19.  
  20. NEARDATA int bases[MAXOCLASSES] = DUMMY;
  21.  
  22. NEARDATA int multi = 0;
  23. NEARDATA int warnlevel = 0;        /* used by movemon and dochugw */
  24. NEARDATA int nroom = 0;
  25. NEARDATA int nsubroom = 0;
  26. NEARDATA int occtime = 0;
  27.  
  28. int x_maze_max, y_maze_max;    /* initialized in main, used in mkmaze.c */
  29. int otg_temp;            /* used by object_to_glyph() [otg] */
  30.  
  31. #ifdef REDO
  32. NEARDATA int in_doagain = 0;
  33. #endif
  34.  
  35. /*
  36.  *    The following structure will be initialized at startup time with
  37.  *    the level numbers of some "important" things in the game.
  38.  */
  39. struct dgn_topology dungeon_topology = {DUMMY};
  40.  
  41. #ifdef MULDGN
  42. #include    "quest.h"
  43. struct q_score    quest_status = DUMMY;
  44. #endif
  45.  
  46. NEARDATA int smeq[MAXNROFROOMS+1] = DUMMY;
  47. NEARDATA int doorindex = 0;
  48.  
  49. NEARDATA char *save_cm = 0;
  50. NEARDATA int killer_format = 0;
  51. NEARDATA const char *killer = 0;
  52. NEARDATA const char *nomovemsg = 0;
  53. NEARDATA const char nul[40] = DUMMY;        /* contains zeros */
  54. NEARDATA char plname[PL_NSIZ] = DUMMY;        /* player name */
  55. NEARDATA char pl_character[PL_CSIZ] = DUMMY;
  56.  
  57. #ifdef TUTTI_FRUTTI
  58. NEARDATA char pl_fruit[PL_FSIZ] = DUMMY;
  59. NEARDATA int current_fruit = 0;
  60. NEARDATA struct fruit *ffruit = (struct fruit *)0;
  61. #endif
  62.  
  63. NEARDATA char tune[6] = DUMMY;
  64.  
  65. NEARDATA const char *occtxt = DUMMY;
  66. NEARDATA const char quitchars[] = " \r\n\033";
  67. NEARDATA const char vowels[] = "aeiouAEIOU";
  68. NEARDATA const char ynchars[] = "yn";
  69. NEARDATA const char ynqchars[] = "ynq";
  70. NEARDATA const char ynaqchars[] = "ynaq";
  71. NEARDATA const char ynNaqchars[] = "yn#aq";
  72. NEARDATA long yn_number = 0L;
  73.  
  74. #ifdef MICRO
  75. char hackdir[PATHLEN];        /* where rumors, help, record are */
  76. char levels[PATHLEN];        /* where levels are */
  77. #endif /* MICRO */
  78.  
  79. #define INFOSIZE    MAXLEVEL * MAXDUNGEON
  80.  
  81. #ifdef MFLOPPY
  82. char permbones[PATHLEN];    /* where permanent copy of bones go */
  83. int ramdisk = FALSE;        /* whether to copy bones to levels or not */
  84. int saveprompt = TRUE;
  85. struct finfo fileinfo[INFOSIZE];
  86. const char *alllevels = "levels.*";
  87. const char *allbones = "bones*.*";
  88. #else
  89. boolean level_exists[INFOSIZE];
  90. #endif
  91.  
  92. #undef INFOSIZE
  93.  
  94. /* 'rogue'-like direction commands (cmd.c) */
  95. NEARDATA const char sdir[] = "hykulnjb><";
  96. NEARDATA const char ndir[] = "47896321><";    /* number pad mode */
  97. NEARDATA const schar xdir[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 };
  98. NEARDATA const schar ydir[10] = {  0,-1,-1,-1, 0, 1, 1, 1, 0, 0 };
  99. NEARDATA const schar zdir[10]          = {  0, 0, 0, 0, 0, 0, 0, 0, 1,-1 };
  100.  
  101. NEARDATA schar tbx = 0, tby = 0;    /* mthrowu: target */
  102. NEARDATA int dig_effort = 0;    /* effort expended on current pos */
  103. NEARDATA d_level dig_level = { 0, 0 };
  104. NEARDATA coord dig_pos = DUMMY;
  105. NEARDATA boolean dig_down = FALSE;
  106.  
  107. NEARDATA dungeon dungeons[MAXDUNGEON];    /* ini'ed by init_dungeon() */
  108. NEARDATA s_level *sp_levchn;
  109. NEARDATA int done_stopprint = 0;
  110. NEARDATA int done_hup = 0;
  111. NEARDATA stairway upstair = { 0, 0 }, dnstair = { 0, 0 };
  112. NEARDATA stairway upladder = { 0, 0 }, dnladder = { 0, 0 };
  113. NEARDATA stairway sstairs = { 0, 0 };
  114. NEARDATA dest_area updest = { 0, 0, 0, 0, 0, 0, 0, 0 };
  115. NEARDATA dest_area dndest = { 0, 0, 0, 0, 0, 0, 0, 0 };
  116. NEARDATA coord inv_pos = { 0, 0 };
  117.  
  118. NEARDATA boolean in_mklev = FALSE;
  119. NEARDATA boolean stoned = FALSE;    /* done to monsters hit by 'c' */
  120. NEARDATA boolean unweapon = FALSE;
  121. NEARDATA boolean mrg_to_wielded = FALSE;
  122.              /* weapon picked is merged with wielded one */
  123.  
  124. #ifdef KOPS
  125. NEARDATA boolean allow_kops = TRUE;
  126. #endif
  127.  
  128. NEARDATA coord bhitpos = DUMMY;
  129. NEARDATA coord doors[DOORMAX] = {DUMMY};
  130.  
  131. NEARDATA struct mkroom rooms[(MAXNROFROOMS+1)*2] = {DUMMY};
  132. NEARDATA struct mkroom* subrooms = &rooms[MAXNROFROOMS+1];
  133. struct mkroom *upstairs_room, *dnstairs_room, *sstairs_room;
  134.  
  135. dlevel_t level;        /* level map */
  136. struct trap *ftrap = (struct trap *)0;
  137. NEARDATA struct monst youmonst = DUMMY;
  138. NEARDATA struct flag flags = DUMMY;
  139. NEARDATA struct you u = DUMMY;
  140.  
  141. NEARDATA struct obj *invent = (struct obj *)0, 
  142.     *uwep = (struct obj *)0, *uarm = (struct obj *)0,
  143. #ifdef TOURIST
  144.     *uarmu = (struct obj *)0, /* under-wear, so to speak */
  145. #endif
  146. #ifdef POLYSELF
  147.      *uskin = (struct obj *)0, /* dragon armor, if a dragon */
  148. #endif
  149.     *uarmc = (struct obj *)0, *uarmh = (struct obj *)0, 
  150.         *uarms = (struct obj *)0, *uarmg = (struct obj *)0,
  151.         *uarmf = (struct obj *)0, *uamul = (struct obj *)0,
  152.     *uright = (struct obj *)0,
  153.         *uleft = (struct obj *)0,
  154.         *ublindf = (struct obj *)0,
  155.     *uchain = (struct obj *)0,
  156.         *uball = (struct obj *)0;
  157.  
  158. #ifdef TEXTCOLOR
  159. /*
  160.  *  This must be the same order as used for buzz() in zap.c.
  161.  */
  162. const int zapcolors[NUM_ZAP] = {
  163.     HI_ZAP,        /* 0 - missile */
  164.     ORANGE_COLORED,    /* 1 - fire */
  165.     WHITE,        /* 2 - frost */
  166.     HI_ZAP,        /* 3 - sleep */
  167.     BLACK,        /* 4 - death */
  168.     WHITE,        /* 5 - lightning */
  169.     YELLOW,        /* 6 - poison gas */
  170.     GREEN,        /* 7 - acid */
  171. };
  172. #endif /* text color */
  173.  
  174. const int shield_static[SHIELD_COUNT] = {
  175.     S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,    /* 7 per row */
  176.     S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
  177.     S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
  178. };
  179.  
  180. NEARDATA struct spell spl_book[MAXSPELL + 1] = {DUMMY};
  181.  
  182. NEARDATA long moves = 1L, monstermoves = 1L;
  183.      /* These diverge when player is Fast */
  184. NEARDATA long wailmsg = 0L;
  185.  
  186. /* objects that are moving to another dungeon level */
  187. NEARDATA struct obj *migrating_objs = (struct obj *)0;
  188. /* objects not yet paid for */
  189. NEARDATA struct obj *billobjs = (struct obj *)0;
  190.  
  191. /* used to zero all elements of a struct obj */
  192. NEARDATA struct obj zeroobj = DUMMY;
  193.  
  194. /* monster pronouns, index is return value of gender(mtmp) */
  195. NEARDATA const char *he[3]  = { "he",  "she", "it" };
  196. NEARDATA const char *him[3] = { "him", "her", "it" };
  197. NEARDATA const char *his[3] = { "his", "her", "its" };
  198.  
  199. /* originally from dog.c */
  200. NEARDATA char dogname[63] = DUMMY;
  201. NEARDATA char catname[63] = DUMMY;
  202. char preferred_pet;    /* '\0', 'c', 'd' */
  203. /* monsters that went down/up together with @ */
  204. NEARDATA struct monst *mydogs = (struct monst *)0;
  205. /* monsters that are moving to another dungeon level */
  206. NEARDATA struct monst *migrating_mons = (struct monst *)0;
  207.  
  208. NEARDATA struct c_color_names c_color_names = {
  209.     "black", "amber", "golden",
  210.     "light blue", "red", "green",
  211.     "silver", "blue", "purple",
  212.     "white"
  213. };
  214.  
  215. struct c_common_strings c_common_strings = {
  216.     "Nothing happens.",        "That's enough tries!",
  217.     "That is a silly thing to %s.",    "shudder for a moment."
  218. };
  219.  
  220. /* Vision */
  221. NEARDATA boolean vision_full_recalc = 0;
  222. NEARDATA char     **viz_array = 0;/* used in cansee() and couldsee() macros */
  223.  
  224. /* Global windowing data, defined here for multi-window-system support */
  225. NEARDATA winid WIN_MESSAGE = WIN_ERR, WIN_STATUS = WIN_ERR;
  226. NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR;
  227. char toplines[BUFSZ];
  228. /* Windowing stuff that's really tty oriented, but present for all ports */
  229. struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 };    /* AS,AE, LI,CO */
  230.  
  231. #ifdef TOURIST
  232. const char NEARDATA *pl_classes = "ABCEHKPRSTVW";
  233. #else
  234. const char NEARDATA *pl_classes = "ABCEHKPRSVW";
  235. #endif
  236.  
  237. /* dummy routine used to force linkage */
  238. void
  239. decl_init()
  240. {
  241.     return;
  242. }
  243.  
  244. /*decl.c*/
  245.