ularn_game.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: ularn_game.h
  4. *
  5. * DESCRIPTION:
  6. * Game data used by Ularn.
  7. * This Contains:
  8. * . The names of data files used by ularn
  9. * . The player's name
  10. * . Current game options
  11. *
  12. * =============================================================================
  13. * EXPORTED VARIABLES
  14. *
  15. * do_fork : True if fork on save (now unsupported)
  16. * boldon : True if objects are to be dislayed in bold (tty only)
  17. * mail : True if mail bills when game is won
  18. * ckpflag : True if checkpoint files are to be used.
  19. * nobeep : True if beep is off.
  20. * libdir : Ularn library path
  21. * savedir : Directroy for save games
  22. * savefilename : Filename for saving the game
  23. * scorefile : Filename for the scores
  24. * helpfile : Filename for ularn help
  25. * larnlevels : Filename for pregenerated levels
  26. * fortfile : Filename for fortunes
  27. * optsfile : Ularn options file
  28. * ckpfile : Checkpoint file name
  29. * diagfile : Diagnostic dump file name
  30. * userid : User Id of the player
  31. * password : Wizard password
  32. * loginname : The login name of the player
  33. * logname : The name to appear on the score board
  34. * nowelcome : True if no welcome message is to be displayed
  35. * nomove : True if player action resulted in no move.
  36. * dropflag : True if the player just dropped the item
  37. * restoreflag : True if the game is to be restored from a file
  38. * diroffx : Direction offsets for x coordinate
  39. * diroffy : Direction offsets for y coordinate
  40. * ReverseDir : Lookup for the index of the reverse direction
  41. * dirname : The name of each direction.
  42. *
  43. * =============================================================================
  44. * EXPORTED FUNCTIONS
  45. *
  46. * newgame : Funtion to initialise a new game.
  47. * sethard : Function to set the game difficulty
  48. * read_options : Function to read the ularn options file
  49. *
  50. * =============================================================================
  51. */
  52. #ifndef __ULARN_GAME_H
  53. #define __ULARN_GAME_H
  54. /* =============================================================================
  55. * Exported variables
  56. */
  57. /*
  58. * Game options
  59. */
  60. extern char do_fork;
  61. extern char boldon; /* 1=bold objects, 0=inverse objects */
  62. extern char mail; /* 1=mail letters after win game */
  63. extern char ckpflag; /* 1 if want checkpointing of game, 0 otherwise */
  64. extern char nobeep; /* true if program is not to beep*/
  65. /* *************** File Names *************** */
  66. #define SCORENAME "Vscore"
  67. #define HELPNAME "Vhelp"
  68. #define LEVELSNAME "Vmaps"
  69. #define FORTSNAME "Vfortune"
  70. /* maximum number moves before the game is called*/
  71. #define TIMELIMIT 90000
  72. /* create a checkpoint file every CKCOUNT moves */
  73. #define CKCOUNT 150
  74. /* max size of the players name */
  75. #define LOGNAMESIZE 80
  76. #define USERNAME_LENGTH 80
  77. #ifndef MAXPATHLEN
  78. #define MAXPATHLEN 1024
  79. #endif
  80. /* The library files directory */
  81. extern char libdir[MAXPATHLEN];
  82. /* The directory for saved games */
  83. extern char savedir[MAXPATHLEN];
  84. /* the game save filename */
  85. extern char savefilename[MAXPATHLEN];
  86. /* the score file */
  87. extern char scorefile[MAXPATHLEN];
  88. /* the help text file */
  89. extern char helpfile[MAXPATHLEN];
  90. /* the maze data file */
  91. extern char larnlevels[MAXPATHLEN];
  92. /* the fortune data file */
  93. extern char fortfile[MAXPATHLEN];
  94. /* the options file filename */
  95. extern char optsfile[MAXPATHLEN];
  96. /* the checkpoint file filename */
  97. extern char ckpfile[MAXPATHLEN];
  98. /* the diagnostic filename */
  99. extern char diagfile[];
  100. /* the wizard's password */
  101. extern char *password;
  102. extern int userid; /* the players login user id number */
  103. extern char loginname[USERNAME_LENGTH + 1]; /* players login name */
  104. extern char logname[LOGNAMESIZE + 1]; /* players name storage for scoring */
  105. extern char nowelcome; /* if nowelcome, don't display welcome message */
  106. extern char nomove; /* if nomove no count next iteration as move */
  107. extern char dropflag; /* if 1 then don't lookforobject() next round */
  108. extern char restorflag; /* 1 means restore has been done */
  109. extern char enhance_interface; /* 1 means use the enhanced command interface */
  110. /*
  111. * Direction deltas
  112. */
  113. extern char diroffx[];
  114. extern char diroffy[];
  115. extern int ReverseDir[];
  116. extern char *dirname[];
  117. /* =============================================================================
  118. * Exported functions
  119. */
  120. /* =============================================================================
  121. * FUNCTION: newgame
  122. *
  123. * DESCRIPTION:
  124. * Function to perform initialisatin for a new game.
  125. *
  126. * PARAMETERS:
  127. *
  128. * None.
  129. *
  130. * RETURN VALUE:
  131. *
  132. * None.
  133. */
  134. void newgame(void);
  135. /* =============================================================================
  136. * FUNCTION: sethard
  137. *
  138. * DESCRIPTION:
  139. * Function to set the game difficulty level.
  140. *
  141. * PARAMETERS:
  142. *
  143. * hard : The difficulty level to set.
  144. * -1 => Default hardness
  145. * any other value is the desired hardness
  146. *
  147. * RETURN VALUE:
  148. *
  149. * None.
  150. */
  151. void sethard(int hard);
  152. /* =============================================================================
  153. * FUNCTION: read_options
  154. *
  155. * DESCRIPTION:
  156. * Function to read the ularn options file.
  157. *
  158. * PARAMETERS:
  159. *
  160. * None.
  161. *
  162. * RETURN VALUE:
  163. *
  164. * None.
  165. */
  166. void read_options(void);
  167. #endif