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