1 |
root |
1.1 |
/* |
2 |
|
|
* static char *rcsid_map_c = |
3 |
elmex |
1.2 |
* "$Id$"; |
4 |
root |
1.1 |
*/ |
5 |
|
|
|
6 |
|
|
/* |
7 |
|
|
CrossFire, A Multiplayer game for X-windows |
8 |
|
|
|
9 |
|
|
Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
10 |
|
|
Copyright (C) 1992 Frank Tore Johansen |
11 |
|
|
|
12 |
|
|
This program is free software; you can redistribute it and/or modify |
13 |
|
|
it under the terms of the GNU General Public License as published by |
14 |
|
|
the Free Software Foundation; either version 2 of the License, or |
15 |
|
|
(at your option) any later version. |
16 |
|
|
|
17 |
|
|
This program is distributed in the hope that it will be useful, |
18 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 |
|
|
GNU General Public License for more details. |
21 |
|
|
|
22 |
|
|
You should have received a copy of the GNU General Public License |
23 |
|
|
along with this program; if not, write to the Free Software |
24 |
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 |
|
|
|
26 |
|
|
The authors can be reached via e-mail at crossfire-devel@real-time.com |
27 |
|
|
*/ |
28 |
|
|
|
29 |
|
|
#ifndef RANDOM_MAP_H |
30 |
|
|
#define RANDOM_MAP_H |
31 |
|
|
|
32 |
|
|
typedef struct { |
33 |
|
|
char wallstyle[512]; |
34 |
|
|
char wall_name[512]; |
35 |
|
|
char floorstyle[512]; |
36 |
|
|
char monsterstyle[512]; |
37 |
|
|
char treasurestyle[512]; |
38 |
|
|
char layoutstyle[512]; |
39 |
|
|
char doorstyle[512]; |
40 |
|
|
char decorstyle[512]; |
41 |
|
|
char origin_map[512]; |
42 |
|
|
char final_map[512]; |
43 |
|
|
char exitstyle[512]; |
44 |
|
|
char this_map[512]; |
45 |
|
|
char exit_on_final_map[512]; |
46 |
|
|
|
47 |
|
|
int Xsize; |
48 |
|
|
int Ysize; |
49 |
|
|
int expand2x; |
50 |
|
|
int layoutoptions1; |
51 |
|
|
int layoutoptions2; |
52 |
|
|
int layoutoptions3; |
53 |
|
|
int symmetry; |
54 |
|
|
int difficulty; |
55 |
|
|
int difficulty_given; |
56 |
|
|
float difficulty_increase; |
57 |
|
|
int dungeon_level; |
58 |
|
|
int dungeon_depth; |
59 |
|
|
int decoroptions; |
60 |
|
|
int orientation; |
61 |
|
|
int origin_y; |
62 |
|
|
int origin_x; |
63 |
|
|
int random_seed; |
64 |
|
|
long unsigned int total_map_hp; |
65 |
|
|
int map_layout_style; |
66 |
|
|
int treasureoptions; |
67 |
|
|
int symmetry_used; |
68 |
elmex |
1.2 |
struct region *region; |
69 |
root |
1.1 |
} RMParms; |
70 |
|
|
|
71 |
|
|
int load_parameters(FILE *fp, int bufstate,RMParms *RP); |
72 |
|
|
|
73 |
|
|
|
74 |
|
|
#define ONION_LAYOUT 1 |
75 |
|
|
#define MAZE_LAYOUT 2 |
76 |
|
|
#define SPIRAL_LAYOUT 3 |
77 |
|
|
#define ROGUELIKE_LAYOUT 4 |
78 |
|
|
#define SNAKE_LAYOUT 5 |
79 |
|
|
#define SQUARE_SPIRAL_LAYOUT 6 |
80 |
|
|
#define NROFLAYOUTS 6 |
81 |
|
|
|
82 |
|
|
/* |
83 |
|
|
* Move these defines out of room_gen_onion.c to here, as |
84 |
|
|
* other files (like square_spiral) also uses them. |
85 |
|
|
|
86 |
|
|
options: |
87 |
|
|
0 Pick random options below |
88 |
|
|
1 "centered" |
89 |
|
|
2 linear doors (default is nonlinear) |
90 |
|
|
4 bottom "centered" |
91 |
|
|
8 bottom-right centered |
92 |
|
|
16 irregularly/randomly spaced layers (default: regular) |
93 |
|
|
32 outer wall off: i.e., no outer wall. |
94 |
|
|
|
95 |
|
|
*/ |
96 |
|
|
|
97 |
|
|
#define OPT_RANDOM 0 |
98 |
|
|
#define OPT_CENTERED 1 |
99 |
|
|
#define OPT_LINEAR 2 |
100 |
|
|
#define OPT_BOTTOM_C 4 |
101 |
|
|
#define OPT_BOTTOM_R 8 |
102 |
|
|
#define OPT_IRR_SPACE 16 |
103 |
|
|
#define OPT_WALL_OFF 32 |
104 |
|
|
#define OPT_WALLS_ONLY 64 |
105 |
|
|
#define OPT_NO_DOORS 256 /* Place walls insead of doors. Produces broken map. */ |
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
/* symmetry definitions--used in this file AND in treasure.c: |
110 |
|
|
the numerical values matter so don't change them. */ |
111 |
|
|
#define RANDOM_SYM 0 |
112 |
|
|
#define NO_SYM 1 |
113 |
|
|
#define X_SYM 2 |
114 |
|
|
#define Y_SYM 3 |
115 |
|
|
#define XY_SYM 4 |
116 |
|
|
|
117 |
|
|
#define MIN_RANDOM_MAP_SIZE 10 |
118 |
|
|
|
119 |
|
|
/* a macro to get a strongly centered random distribution, |
120 |
|
|
from 0 to x, centered at x/2 */ |
121 |
|
|
#define BC_RANDOM(x) ((int) ((RANDOM() % (x)+RANDOM()%(x)+RANDOM()%(x))/3.)) |
122 |
|
|
|
123 |
|
|
int set_random_map_variable(RMParms *rp,const char *buf); |
124 |
|
|
|
125 |
|
|
#endif |