Atrinik Server 2.5
Functions
random_maps/room_gen_onion.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

void centered_onion (char **maze, int xsize, int ysize, int option, int layers)
void bottom_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
void bottom_right_centered_onion (char **maze, int xsize, int ysize, int option, int layers)
void draw_onion (char **maze, float *xlocations, float *ylocations, int layers)
void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options)
char ** map_gen_onion (int xsize, int ysize, int option, int layers)

Detailed Description

The onion room generator.

Onion rooms are like this:

regular random

centered, linear onion bottom/right centered, nonlinear

######################### ######################### # # # # # ######## ########## # # ##################### # # # # # # # # # ###### ######## # # # # # # # # # # # # # ######## ######## # # # #### ###### # # # # # # # # # # # # # # # # # # # # # # ############ # # # # # # ########### ## # # # # # # # # # # # # # ################ # # # # # # ######### # # # # # # # # # # #################### # # # # # # # # # # # # # # ######################### #########################

Definition in file room_gen_onion.c.


Function Documentation

void bottom_centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Create a bottom-centered layout.

Parameters:
mazeMaze layout.
xsizeX size of the layout.
ysizeY size of the layout.
optionCombination of OPT_xxx values.
layersNumber of layers to create.

Definition at line 242 of file room_gen_onion.c.

void bottom_right_centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Create a bottom-right-centered layout.

Parameters:
mazeMaze layout.
xsizeX size of the layout.
ysizeY size of the layout.
optionCombination of OPT_xxx values.
layersNumber of layers to create.

Definition at line 556 of file room_gen_onion.c.

void centered_onion ( char **  maze,
int  xsize,
int  ysize,
int  option,
int  layers 
)

Creates a centered onion layout.

Parameters:
mazeMaze layout.
xsizeX size of the layout.
ysizeY size of the layout.
optionCombination of OPT_xxx values.
layersNumber of layers to create.

Definition at line 151 of file room_gen_onion.c.

void draw_onion ( char **  maze,
float *  xlocations,
float *  ylocations,
int  layers 
)

Draws the lines in the maze defining the onion layers.

Parameters:
mazeNap to draw to.
xlocationsArray of X coordinate locations.
ylocationsArray of Y coordinate locations.
layersNumber of layers.

Definition at line 348 of file room_gen_onion.c.

void make_doors ( char **  maze,
float *  xlocations,
float *  ylocations,
int  layers,
int  options 
)

Add doors to the layout.

Parameters:
mazeMap to draw to.
xlocationsArray of X coordinate locations.
ylocationsArray of Y coordinate locations.
layersNumber of layers.
optionsCombination of OPT_xxx values.

Definition at line 385 of file room_gen_onion.c.

char** map_gen_onion ( int  xsize,
int  ysize,
int  option,
int  layers 
)

Generates an onion layout.

Parameters:
xsizeX size of the layout.
ysizeY size of the layout.
optionCombination of OPT_xxx values.
layersNumber of layers the onion should have.
Returns:
The generated layout.

Definition at line 67 of file room_gen_onion.c.