ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/random_map.h
Revision: 1.6
Committed: Sat Dec 30 18:45:28 2006 UTC (17 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.5: +54 -56 lines
Log Message:
random maps are nphard

File Contents

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