|
Atrinik Server 2.5
|
Go to the source code of this file.
Data Structures | |
| struct | Room |
Functions | |
| static int | roguelike_place_room (Room *Rooms, int xsize, int ysize, int nrooms) |
| static void | roguelike_make_rooms (Room *Rooms, char **maze, int options) |
| static void | roguelike_link_rooms (Room *Rooms, char **maze) |
| int | surround_check (char **layout, int i, int j, int Xsize, int Ysize) |
| char ** | roguelike_layout_gen (int xsize, int ysize, int options) |
Rogue/nethack-like layout generation.
Definition in file rogue_layout.c.
| char** roguelike_layout_gen | ( | int | xsize, |
| int | ysize, | ||
| int | options | ||
| ) |
Actually make the rogue layout. We work by a reduction process:
first we make everything a wall, then we remove areas to make rooms.
| xsize | X size of the wanted layout size. |
| ysize | Y size of the wanted layout size. |
| options | 2 to have circular rooms, 1 for rectangular ones, another value for random choice. |
Definition at line 102 of file rogue_layout.c.
| static void roguelike_link_rooms | ( | Room * | Rooms, |
| char ** | maze | ||
| ) | [static] |
Link generated rooms with corridors.
| Rooms | Room list. |
| maze | Maze. |
| xsize | X size of the maze. |
| ysize | Y size of the maze. |
Definition at line 375 of file rogue_layout.c.
| static void roguelike_make_rooms | ( | Room * | Rooms, |
| char ** | maze, | ||
| int | options | ||
| ) | [static] |
Write all the rooms into the maze.
| Rooms | List of rooms to write. |
| maze | Where to write to. |
| options | 2 to have circular rooms, 1 for rectangular ones, another value for random choice. |
Definition at line 324 of file rogue_layout.c.
| static int roguelike_place_room | ( | Room * | Rooms, |
| int | xsize, | ||
| int | ysize, | ||
| int | nrooms | ||
| ) | [static] |
Place a room in the layout.
| Rooms | List of existing rooms, new room will be added to it. |
| xsize | X size of the layout. |
| ysize | Y size of the layout. |
| nrooms | Wanted number of room, used to determine size. |
Definition at line 236 of file rogue_layout.c.
| int surround_check | ( | char ** | layout, |
| int | i, | ||
| int | j, | ||
| int | Xsize, | ||
| int | Ysize | ||
| ) |
Checks free spots around a spot.
| layout | Map layout. |
| i | X coordinate to check. |
| j | Y coordinate to check. |
| Xsize | X size of the layout. |
| Ysize | Y size of the layout. |
Definition at line 66 of file rogue_layout.c.
1.7.4