|
|
1 | /* |
|
|
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
|
|
3 | * |
|
|
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
|
|
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
|
|
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
|
|
7 | * |
|
|
8 | * Deliantra 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 3 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, see <http://www.gnu.org/licenses/>. |
|
|
20 | * |
|
|
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
|
|
22 | */ |
|
|
23 | |
1 | /* random_map.c */ |
24 | /* random_map.c */ |
2 | extern void dump_layout(char **layout, RMParms *RP); |
25 | extern void dump_layout (Layout layout); |
3 | extern mapstruct *generate_random_map(const char *OutFileName, RMParms *RP); |
|
|
4 | extern char **layoutgen(RMParms *RP); |
|
|
5 | extern char **symmetrize_layout(char **maze, int sym, RMParms *RP); |
|
|
6 | extern char **rotate_layout(char **maze, int rotation, RMParms *RP); |
|
|
7 | extern void roomify_layout(char **maze, RMParms *RP); |
|
|
8 | extern int can_make_wall(char **maze, int dx, int dy, int dir, RMParms *RP); |
|
|
9 | extern int make_wall(char **maze, int x, int y, int dir); |
26 | extern int make_wall (char **maze, int x, int y, int dir); |
10 | extern void doorify_layout(char **maze, RMParms *RP); |
|
|
11 | extern void write_map_parameters_to_string(char *buf, RMParms *RP); |
27 | extern void write_map_parameters_to_string (char *buf, random_map_params *RP); |
12 | extern void write_parameters_to_string(char *buf, int xsize_n, int ysize_n, char *wallstyle_n, char *floorstyle_n, char *monsterstyle_n, char *treasurestyle_n, char *layoutstyle_n, char *decorstyle_n, char *doorstyle_n, char *exitstyle_n, char *final_map_n, char *exit_on_final_map_n, char *this_map_n, int layoutoptions1_n, int layoutoptions2_n, int layoutoptions3_n, int symmetry_n, int dungeon_depth_n, int dungeon_level_n, int difficulty_n, int difficulty_given_n, int decoroptions_n, int orientation_n, int origin_x_n, int origin_y_n, int random_seed_n, int treasureoptions_n, float difficulty_increase); |
|
|
13 | extern void copy_object_with_inv(object *src_ob, object *dest_ob); |
|
|
14 | /* room_gen_onion.c */ |
28 | /* room_gen_onion.c */ |
15 | extern char **map_gen_onion(int xsize, int ysize, int option, int layers); |
29 | extern void map_gen_onion (Layout maze, int option, int layers); |
16 | extern void centered_onion(char **maze, int xsize, int ysize, int option, int layers); |
|
|
17 | extern void bottom_centered_onion(char **maze, int xsize, int ysize, int option, int layers); |
|
|
18 | extern void draw_onion(char **maze, float *xlocations, float *ylocations, int layers); |
|
|
19 | extern void make_doors(char **maze, float *xlocations, float *ylocations, int layers, int options); |
|
|
20 | extern void bottom_right_centered_onion(char **maze, int xsize, int ysize, int option, int layers); |
|
|
21 | /* room_gen_spiral.c */ |
30 | /* room_gen_spiral.c */ |
22 | extern char **map_gen_spiral(int xsize, int ysize, int option); |
31 | extern void map_gen_spiral (Layout maze, int option); |
23 | extern void connect_spirals(int xsize, int ysize, int sym, char **layout); |
32 | extern void connect_spirals (int xsize, int ysize, int sym, char **layout); |
24 | /* maze_gen.c */ |
33 | /* maze_gen.c */ |
25 | extern char **maze_gen(int xsize, int ysize, int option); |
34 | extern void maze_gen (Layout maze, int option); |
26 | extern void make_wall_free_list(int xsize, int ysize); |
|
|
27 | extern void pop_wall_point(int *x, int *y); |
|
|
28 | extern int find_free_point(char **maze, int *x, int *y, int xc, int yc, int xsize, int ysize); |
|
|
29 | extern void fill_maze_full(char **maze, int x, int y, int xsize, int ysize); |
|
|
30 | extern void fill_maze_sparse(char **maze, int x, int y, int xsize, int ysize); |
|
|
31 | /* floor.c */ |
|
|
32 | extern mapstruct *make_map_floor(char **layout, char *floorstyle, RMParms *RP); |
|
|
33 | /* wall.c */ |
35 | /* wall.c */ |
34 | extern int surround_flag(char **layout, int i, int j, RMParms *RP); |
36 | extern int surround_flag (char **layout, int i, int j, random_map_params *RP); |
35 | extern int surround_flag2(char **layout, int i, int j, RMParms *RP); |
37 | extern int surround_flag2 (char **layout, int i, int j, random_map_params *RP); |
36 | extern int surround_flag3(mapstruct *map, sint16 i, sint16 j, RMParms *RP); |
38 | extern int surround_flag3 (maptile *map, sint16 i, sint16 j, random_map_params *RP); |
37 | extern int surround_flag4(mapstruct *map, int i, int j, RMParms *RP); |
|
|
38 | extern void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP); |
39 | extern void make_map_walls (maptile *map, char **layout, const char *w_style, const char *m_style, random_map_params *RP); |
39 | extern object *pick_joined_wall(object *the_wall, char **layout, int i, int j, RMParms *RP); |
|
|
40 | extern object *retrofit_joined_wall(mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP); |
40 | extern object *retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params *RP); |
41 | /* monster.c */ |
41 | /* monster.c */ |
42 | extern void insert_multisquare_ob_in_map(object *new_obj, mapstruct *map); |
|
|
43 | extern void place_monsters(mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP); |
42 | extern void place_monsters (maptile *map, char *monsterstyle, int difficulty, random_map_params *RP); |
44 | /* door.c */ |
43 | /* door.c */ |
45 | extern int surround_check2(char **layout, int i, int j, int Xsize, int Ysize); |
|
|
46 | extern void put_doors(mapstruct *the_map, char **maze, const char *doorstyle, RMParms *RP); |
44 | extern void put_doors (maptile *the_map, char **maze, const char *doorstyle, random_map_params *RP); |
47 | /* decor.c */ |
45 | /* decor.c */ |
48 | extern int obj_count_in_map(mapstruct *map, int x, int y); |
|
|
49 | extern void put_decor(mapstruct *map, char **maze, char *decorstyle, int decor_option, RMParms *RP); |
46 | extern void put_decor (maptile *map, char **maze, char *decorstyle, int decor_option, random_map_params *RP); |
50 | /* exit.c */ |
47 | /* exit.c */ |
51 | extern void find_in_layout(int mode, char target, int *fx, int *fy, char **layout, RMParms *RP); |
|
|
52 | extern void place_exits(mapstruct *map, char **maze, char *exitstyle, int orientation, RMParms *RP); |
48 | extern void place_exits (maptile *map, char **maze, char *exitstyle, int orientation, random_map_params *RP); |
53 | extern void unblock_exits(mapstruct *map, char **maze, RMParms *RP); |
49 | extern void unblock_exits (maptile *map, char **maze, random_map_params *RP); |
54 | /* treasure.c */ |
50 | /* treasure.c */ |
55 | extern int wall_blocked(mapstruct *m, int x, int y); |
51 | extern int wall_blocked (maptile *m, int x, int y); |
56 | extern void place_treasure(mapstruct *map, char **layout, char *treasure_style, int treasureoptions, RMParms *RP); |
52 | extern void place_treasure (maptile *map, char **layout, char *treasure_style, int treasureoptions, random_map_params *RP); |
57 | extern object *place_chest(int treasureoptions, int x, int y, mapstruct *map, mapstruct *style_map, int n_treasures, RMParms *RP); |
|
|
58 | extern object *find_closest_monster(mapstruct *map, int x, int y, RMParms *RP); |
|
|
59 | extern int keyplace(mapstruct *map, int x, int y, char *keycode, int door_flag, int n_keys, RMParms *RP); |
|
|
60 | extern object *find_monster_in_room_recursive(char **layout, mapstruct *map, int x, int y, RMParms *RP); |
|
|
61 | extern object *find_monster_in_room(mapstruct *map, int x, int y, RMParms *RP); |
|
|
62 | extern void find_spot_in_room_recursive(char **layout, int x, int y, RMParms *RP); |
|
|
63 | extern void find_spot_in_room(mapstruct *map, int x, int y, int *kx, int *ky, RMParms *RP); |
|
|
64 | extern void find_enclosed_spot(mapstruct *map, int *cx, int *cy, RMParms *RP); |
|
|
65 | extern void remove_monsters(int x, int y, mapstruct *map); |
|
|
66 | extern object **surround_by_doors(mapstruct *map, char **layout, int x, int y, int opts); |
|
|
67 | extern object *door_in_square(mapstruct *map, int x, int y); |
|
|
68 | extern void find_doors_in_room_recursive(char **layout, mapstruct *map, int x, int y, object **doorlist, int *ndoors, RMParms *RP); |
|
|
69 | extern object **find_doors_in_room(mapstruct *map, int x, int y, RMParms *RP); |
|
|
70 | extern void lock_and_hide_doors(object **doorlist, mapstruct *map, int opts, RMParms *RP); |
|
|
71 | /* special.c */ |
53 | /* special.c */ |
72 | extern void nuke_map_region(mapstruct *map, int xstart, int ystart, int xsize, int ysize); |
|
|
73 | extern void include_map_in_map(mapstruct *dest_map, mapstruct *in_map, int x, int y); |
|
|
74 | extern int find_spot_for_submap(mapstruct *map, char **layout, int *ix, int *iy, int xsize, int ysize); |
|
|
75 | extern void place_fountain_with_specials(mapstruct *map); |
|
|
76 | extern void place_special_exit(mapstruct *map, int hole_type, RMParms *RP); |
|
|
77 | extern void place_specials_in_map(mapstruct *map, char **layout, RMParms *RP); |
54 | extern void place_specials_in_map (maptile *map, char **layout, random_map_params *RP); |
78 | /* style.c */ |
|
|
79 | extern int load_dir(const char *dir, char ***namelist, int skip_dirs); |
|
|
80 | extern mapstruct *load_style_map(char *style_name); |
|
|
81 | extern mapstruct *find_style(const char *dirname, const char *stylename, int difficulty); |
|
|
82 | extern object *pick_random_object(mapstruct *style); |
|
|
83 | extern void free_style_maps(void); |
|
|
84 | /* rogue_layout.c */ |
55 | /* rogue_layout.c */ |
85 | extern int surround_check(char **layout, int i, int j, int Xsize, int Ysize); |
56 | extern int surround_check (char **layout, int i, int j, int Xsize, int Ysize); |
86 | extern char **roguelike_layout_gen(int xsize, int ysize, int options); |
57 | extern void roguelike_layout_gen (Layout maze, int options); |
87 | /* snake.c */ |
58 | /* snake.c */ |
88 | extern char **make_snake_layout(int xsize, int ysize, int options); |
59 | extern void make_snake_layout (Layout maze, int options); |
89 | /* square_spiral.c */ |
60 | /* square_spiral.c */ |
90 | extern void find_top_left_corner(char **maze, int *cx, int *cy); |
61 | extern void make_square_spiral_layout (Layout maze, int options); |
91 | extern char **make_square_spiral_layout(int xsize, int ysize, int options); |
|
|
92 | /* expand2x.c */ |
62 | /* expand2x.c */ |
93 | extern char **expand2x(char **layout, int xsize, int ysize); |
63 | extern void expand2x (Layout maze); |
|
|
64 | |