| 1 |
root |
1.1 |
/* |
| 2 |
root |
1.14 |
* This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. |
| 3 |
|
|
* |
| 4 |
|
|
* Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
| 5 |
|
|
* Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team |
| 6 |
|
|
* Copyright (©) 1992,2007 Frank Tore Johansen |
| 7 |
|
|
* |
| 8 |
|
|
* Crossfire TRT is free software; you can redistribute it and/or modify it |
| 9 |
|
|
* under the terms of the GNU General Public License as published by the Free |
| 10 |
|
|
* Software Foundation; either version 2 of the License, or (at your option) |
| 11 |
|
|
* any later version. |
| 12 |
|
|
* |
| 13 |
|
|
* This program is distributed in the hope that it will be useful, but |
| 14 |
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 15 |
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 |
|
|
* for more details. |
| 17 |
|
|
* |
| 18 |
|
|
* You should have received a copy of the GNU General Public License along |
| 19 |
|
|
* with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 |
| 20 |
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 |
|
|
* |
| 22 |
|
|
* The authors can be reached via e-mail to <crossfire@schmorp.de> |
| 23 |
root |
1.1 |
*/ |
| 24 |
|
|
|
| 25 |
|
|
#ifndef RANDOM_MAP_H |
| 26 |
|
|
#define RANDOM_MAP_H |
| 27 |
|
|
|
| 28 |
root |
1.6 |
struct random_map_params |
| 29 |
|
|
{ |
| 30 |
root |
1.1 |
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 |
root |
1.7 |
shstr origin_map; |
| 39 |
|
|
shstr final_map; |
| 40 |
root |
1.1 |
char exitstyle[512]; |
| 41 |
root |
1.7 |
shstr this_map; |
| 42 |
root |
1.1 |
char exit_on_final_map[512]; |
| 43 |
root |
1.10 |
char *custom; |
| 44 |
root |
1.3 |
|
| 45 |
root |
1.11 |
int xsize, ysize; |
| 46 |
root |
1.1 |
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 |
root |
1.8 |
|
| 55 |
root |
1.1 |
int dungeon_level; |
| 56 |
|
|
int dungeon_depth; |
| 57 |
root |
1.8 |
|
| 58 |
root |
1.1 |
int decoroptions; |
| 59 |
|
|
int orientation; |
| 60 |
|
|
int origin_y; |
| 61 |
|
|
int origin_x; |
| 62 |
root |
1.12 |
uint32_t random_seed; |
| 63 |
root |
1.6 |
uint64_t total_map_hp; |
| 64 |
root |
1.1 |
int map_layout_style; |
| 65 |
|
|
int treasureoptions; |
| 66 |
|
|
int symmetry_used; |
| 67 |
root |
1.6 |
|
| 68 |
elmex |
1.2 |
struct region *region; |
| 69 |
root |
1.11 |
|
| 70 |
|
|
// "private", adjusted sizes |
| 71 |
|
|
int Xsize; |
| 72 |
|
|
int Ysize; |
| 73 |
root |
1.6 |
}; |
| 74 |
root |
1.1 |
|
| 75 |
root |
1.6 |
enum { |
| 76 |
|
|
LAYOUT_NONE, |
| 77 |
|
|
LAYOUT_ONION, |
| 78 |
|
|
LAYOUT_MAZE, |
| 79 |
|
|
LAYOUT_SPIRAL, |
| 80 |
|
|
LAYOUT_ROGUELIKE, |
| 81 |
|
|
LAYOUT_SNAKE, |
| 82 |
|
|
LAYOUT_SQUARE_SPIRAL, |
| 83 |
|
|
NROFLAYOUTS, |
| 84 |
|
|
}; |
| 85 |
root |
1.1 |
|
| 86 |
|
|
/* |
| 87 |
|
|
* Move these defines out of room_gen_onion.c to here, as |
| 88 |
|
|
* other files (like square_spiral) also uses them. |
| 89 |
|
|
|
| 90 |
|
|
options: |
| 91 |
|
|
0 Pick random options below |
| 92 |
|
|
1 "centered" |
| 93 |
|
|
2 linear doors (default is nonlinear) |
| 94 |
|
|
4 bottom "centered" |
| 95 |
|
|
8 bottom-right centered |
| 96 |
|
|
16 irregularly/randomly spaced layers (default: regular) |
| 97 |
|
|
32 outer wall off: i.e., no outer wall. |
| 98 |
|
|
|
| 99 |
|
|
*/ |
| 100 |
|
|
|
| 101 |
root |
1.6 |
enum { |
| 102 |
|
|
RMOPT_RANDOM = 0, |
| 103 |
|
|
RMOPT_CENTERED = 1, |
| 104 |
|
|
RMOPT_LINEAR = 2, |
| 105 |
|
|
RMOPT_BOTTOM_C = 4, |
| 106 |
|
|
RMOPT_BOTTOM_R = 8, |
| 107 |
|
|
RMOPT_IRR_SPACE = 16, |
| 108 |
|
|
RMOPT_WALL_OFF = 32, |
| 109 |
|
|
RMOPT_WALLS_ONLY = 64, |
| 110 |
|
|
RMOPT_NO_DOORS = 256, /* Place walls insead of doors. Produces broken map. */ |
| 111 |
|
|
}; |
| 112 |
root |
1.1 |
|
| 113 |
|
|
/* symmetry definitions--used in this file AND in treasure.c: |
| 114 |
|
|
the numerical values matter so don't change them. */ |
| 115 |
root |
1.6 |
enum { |
| 116 |
|
|
SYMMETRY_RANDOM, |
| 117 |
|
|
SYMMETRY_NONE, |
| 118 |
|
|
SYMMETRY_X, |
| 119 |
|
|
SYMMETRY_Y, |
| 120 |
|
|
SYMMETRY_XY, |
| 121 |
|
|
}; |
| 122 |
root |
1.1 |
|
| 123 |
root |
1.13 |
// 12 has been experimentally :( determined ot be a lot more stable |
| 124 |
|
|
// than 11 or 10, leading to the assumption that something inherently |
| 125 |
|
|
// needs a minimum size of at least 12 |
| 126 |
|
|
#define MIN_RANDOM_MAP_SIZE 12 |
| 127 |
root |
1.1 |
|
| 128 |
root |
1.6 |
#endif |
| 129 |
root |
1.1 |
|