1 |
/* |
2 |
* CrossFire, A Multiplayer game for X-windows |
3 |
* |
4 |
* Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 |
* Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
6 |
* Copyright (C) 1992 Frank Tore Johansen |
7 |
* |
8 |
* This program is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
10 |
* the Free Software Foundation; either version 2 of the License, or |
11 |
* (at your option) any later version. |
12 |
* |
13 |
* This program is distributed in the hope that it will be useful, |
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
* GNU General Public License for more details. |
17 |
* |
18 |
* You should have received a copy of the GNU General Public License |
19 |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 |
* |
22 |
* The authors can be reached via e-mail at crossfire@schmorp.de |
23 |
*/ |
24 |
|
25 |
#ifndef RANDOM_MAP_H |
26 |
#define RANDOM_MAP_H |
27 |
|
28 |
struct random_map_params |
29 |
{ |
30 |
char wallstyle[512]; |
31 |
char wall_name[512]; |
32 |
char floorstyle[512]; |
33 |
char monsterstyle[512]; |
34 |
char treasurestyle[512]; |
35 |
char layoutstyle[512]; |
36 |
char doorstyle[512]; |
37 |
char decorstyle[512]; |
38 |
shstr origin_map; |
39 |
shstr final_map; |
40 |
char exitstyle[512]; |
41 |
shstr this_map; |
42 |
char exit_on_final_map[512]; |
43 |
|
44 |
int Xsize; |
45 |
int Ysize; |
46 |
int expand2x; |
47 |
int layoutoptions1; |
48 |
int layoutoptions2; |
49 |
int layoutoptions3; |
50 |
int symmetry; |
51 |
int difficulty; |
52 |
int difficulty_given; |
53 |
float difficulty_increase; |
54 |
|
55 |
int dungeon_level; |
56 |
int dungeon_depth; |
57 |
|
58 |
int decoroptions; |
59 |
int orientation; |
60 |
int origin_y; |
61 |
int origin_x; |
62 |
int random_seed; |
63 |
uint64_t total_map_hp; |
64 |
int map_layout_style; |
65 |
int treasureoptions; |
66 |
int symmetry_used; |
67 |
|
68 |
struct region *region; |
69 |
}; |
70 |
|
71 |
enum { |
72 |
LAYOUT_NONE, |
73 |
LAYOUT_ONION, |
74 |
LAYOUT_MAZE, |
75 |
LAYOUT_SPIRAL, |
76 |
LAYOUT_ROGUELIKE, |
77 |
LAYOUT_SNAKE, |
78 |
LAYOUT_SQUARE_SPIRAL, |
79 |
NROFLAYOUTS, |
80 |
}; |
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 |
enum { |
98 |
RMOPT_RANDOM = 0, |
99 |
RMOPT_CENTERED = 1, |
100 |
RMOPT_LINEAR = 2, |
101 |
RMOPT_BOTTOM_C = 4, |
102 |
RMOPT_BOTTOM_R = 8, |
103 |
RMOPT_IRR_SPACE = 16, |
104 |
RMOPT_WALL_OFF = 32, |
105 |
RMOPT_WALLS_ONLY = 64, |
106 |
RMOPT_NO_DOORS = 256, /* Place walls insead of doors. Produces broken map. */ |
107 |
}; |
108 |
|
109 |
/* symmetry definitions--used in this file AND in treasure.c: |
110 |
the numerical values matter so don't change them. */ |
111 |
enum { |
112 |
SYMMETRY_RANDOM, |
113 |
SYMMETRY_NONE, |
114 |
SYMMETRY_X, |
115 |
SYMMETRY_Y, |
116 |
SYMMETRY_XY, |
117 |
}; |
118 |
|
119 |
#define MIN_RANDOM_MAP_SIZE 10 |
120 |
|
121 |
/* a macro to get a strongly centered random distribution, |
122 |
from 0 to x, centered at x/2 */ |
123 |
#define BC_RANDOM(x) ((int) ((RANDOM() % (x)+RANDOM()%(x)+RANDOM()%(x))/3.)) |
124 |
|
125 |
#endif |
126 |
|