Crossfire Server, Branches 1.12  R18729
rproto.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 
int can_make_wall (char **maze, int dx, int dy, int dir, RMParms *RP)
 
void centered_onion (char **maze, int xsize, int ysize, int option, int layers)
 
void connect_spirals (int xsize, int ysize, int sym, char **layout)
 
void doorify_layout (char **maze, RMParms *RP)
 
void draw_onion (char **maze, float *xlocations, float *ylocations, int layers)
 
void dump_layout (char **layout, RMParms *RP)
 
char ** expand2x (char **layout, int xsize, int ysize)
 
objectfind_closest_monster (mapstruct *map, int x, int y, RMParms *RP)
 
object ** find_doors_in_room (mapstruct *map, int x, int y, RMParms *RP)
 
void find_doors_in_room_recursive (char **layout, mapstruct *map, int x, int y, object **doorlist, int *ndoors, RMParms *RP)
 
void find_enclosed_spot (mapstruct *map, int *cx, int *cy, RMParms *RP)
 
void find_in_layout (int mode, char target, int *fx, int *fy, char **layout, RMParms *RP)
 
objectfind_monster_in_room (mapstruct *map, int x, int y, RMParms *RP)
 
objectfind_monster_in_room_recursive (char **layout, mapstruct *map, int x, int y, RMParms *RP)
 
int find_spot_for_submap (mapstruct *map, char **layout, int *ix, int *iy, int xsize, int ysize)
 
int find_spot_in_room (mapstruct *map, int x, int y, int *kx, int *ky, RMParms *RP)
 
mapstructfind_style (const char *dirname, const char *stylename, int difficulty)
 
void find_top_left_corner (char **maze, int *cx, int *cy)
 
void free_style_maps (void)
 
mapstructgenerate_random_map (const char *OutFileName, RMParms *RP, char **use_layout)
 
void include_map_in_map (mapstruct *dest_map, mapstruct *in_map, int x, int y)
 
void insert_multisquare_ob_in_map (object *new_obj, mapstruct *map)
 
int keyplace (mapstruct *map, int x, int y, char *keycode, int door_flag, int n_keys, RMParms *RP)
 
char ** layoutgen (RMParms *RP)
 
int load_dir (const char *dir, char ***namelist, int skip_dirs)
 
mapstructload_style_map (char *style_name)
 
void lock_and_hide_doors (object **doorlist, mapstruct *map, int opts, RMParms *RP)
 
void make_doors (char **maze, float *xlocations, float *ylocations, int layers, int options)
 
mapstructmake_map_floor (char **layout, char *floorstyle, RMParms *RP)
 
void make_map_walls (mapstruct *map, char **layout, char *w_style, RMParms *RP)
 
char ** make_snake_layout (int xsize, int ysize)
 
char ** make_square_spiral_layout (int xsize, int ysize)
 
int make_wall (char **maze, int x, int y, int dir)
 
char ** map_gen_onion (int xsize, int ysize, int option, int layers)
 
char ** map_gen_spiral (int xsize, int ysize, int option)
 
char ** maze_gen (int xsize, int ysize, int option)
 
void nuke_map_region (mapstruct *map, int xstart, int ystart, int xsize, int ysize)
 
int obj_count_in_map (mapstruct *map, int x, int y)
 
objectpick_joined_wall (object *the_wall, char **layout, int i, int j, RMParms *RP)
 
objectpick_random_object (mapstruct *style)
 
objectplace_chest (int treasureoptions, int x, int y, mapstruct *map, mapstruct *style_map, int n_treasures, RMParms *RP)
 
void place_exits (mapstruct *map, char **maze, char *exitstyle, int orientation, RMParms *RP)
 
void place_fountain_with_specials (mapstruct *map)
 
void place_monsters (mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP)
 
void place_special_exit (mapstruct *map, int hole_type, RMParms *RP)
 
void place_specials_in_map (mapstruct *map, char **layout, RMParms *RP)
 
void place_treasure (mapstruct *map, char **layout, char *treasure_style, int treasureoptions, RMParms *RP)
 
void put_decor (mapstruct *map, char **maze, char *decorstyle, int decor_option, RMParms *RP)
 
void put_doors (mapstruct *the_map, char **maze, const char *doorstyle, RMParms *RP)
 
void remove_monsters (int x, int y, mapstruct *map)
 
objectretrofit_joined_wall (mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP)
 
char ** roguelike_layout_gen (int xsize, int ysize, int options)
 
void roomify_layout (char **maze, RMParms *RP)
 
char ** rotate_layout (char **maze, int rotation, RMParms *RP)
 
int surround_check (char **layout, int i, int j, int Xsize, int Ysize)
 
int surround_check2 (char **layout, int i, int j, int Xsize, int Ysize)
 
int surround_flag (char **layout, int i, int j, RMParms *RP)
 
int surround_flag2 (char **layout, int i, int j, RMParms *RP)
 
int surround_flag3 (mapstruct *map, int i, int j, RMParms *RP)
 
int surround_flag4 (mapstruct *map, int i, int j, RMParms *RP)
 
char ** symmetrize_layout (char **maze, int sym, RMParms *RP)
 
void unblock_exits (mapstruct *map, char **maze, RMParms *RP)
 
int wall_blocked (mapstruct *m, int x, int y)
 
void write_map_parameters_to_string (RMParms *RP, char *buf, int size)
 
void write_parameters_to_string (char *buf, int xsize_n, int ysize_n, const char *wallstyle_n, const char *floorstyle_n, const char *monsterstyle_n, const char *treasurestyle_n, const char *layoutstyle_n, const char *decorstyle_n, const char *doorstyle_n, const char *exitstyle_n, const char *final_map_n, const char *exit_on_final_map_n, const 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)
 

Function Documentation

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

Create a bottom-centered layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 224 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Create a bottom-right-centered layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 460 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int can_make_wall ( char **  maze,
int  dx,
int  dy,
int  dir,
RMParms RP 
)

Checks the layout to see if we can stick a horizontal (dir = 0) wall (or vertical, dir == 1) here which ends up on other walls sensibly.

Parameters
mazelayout.
dx
dycoordinates to check
dirdirection:
  • 0: horizontally.
  • 1: vertically.
RPrandom map parameters.
Returns
-1 if wall can't be made, possibly wall length else.

Definition at line 516 of file random_map.c.

References surround_flag2(), RMParms::Xsize, and RMParms::Ysize.

Referenced by roomify_layout().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Creates a centered onion layout.

Parameters
mazelayout.
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers to create.

Definition at line 149 of file room_gen_onion.c.

References draw_onion(), make_doors(), MIN, and OPT_IRR_SPACE.

Referenced by map_gen_onion().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void connect_spirals ( int  xsize,
int  ysize,
int  sym,
char **  layout 
)

Connects disjoint spirals which may result from the symmetrization process.

Parameters
xsize
ysizelayout size.
symone of the SYM_xxx values.
layoutlayout to alter.

Definition at line 159 of file room_gen_spiral.c.

References surround_check(), X_SYM, XY_SYM, and Y_SYM.

Referenced by symmetrize_layout().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void doorify_layout ( char **  maze,
RMParms RP 
)

Puts doors at appropriate locations in a layout.

Parameters
mazelayout.
RPmap parameters.

Definition at line 636 of file random_map.c.

References surround_flag(), RMParms::Xsize, and RMParms::Ysize.

Referenced by layoutgen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Draws the lines in the maze defining the onion layers.

Parameters
mazemap to draw to.
xlocations
ylocationsarray of locations.
layersnumber of layers.
Todo:
explain what locations arrays should be, and the meaning of layers.

Definition at line 306 of file room_gen_onion.c.

Referenced by bottom_centered_onion(), bottom_right_centered_onion(), and centered_onion().

+ Here is the caller graph for this function:

void dump_layout ( char **  layout,
RMParms RP 
)

Dumps specified layout using printf().

Parameters
layoutlayout to dump.
RPlayout parameters.

Definition at line 53 of file random_map.c.

References RMParms::Xsize, and RMParms::Ysize.

Referenced by generate_random_map(), and layoutgen().

+ Here is the caller graph for this function:

char** expand2x ( char **  layout,
int  xsize,
int  ysize 
)

Expands the layout be a factor 2. Doors and walls are taken care of.

Parameters
layoutlayout to expand. Memory is free()d at the end, so pointer becomes invalid.
xsize
ysizelayout size.
Returns
new layout. Must be free()d by caller.

Definition at line 39 of file expand2x.c.

References expand_door(), expand_misc(), and expand_wall().

Referenced by layoutgen(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

object* find_closest_monster ( mapstruct map,
int  x,
int  y,
RMParms RP 
)

finds the closest monster and returns him, regardless of doors or walls

Parameters
map
x
ywhere to look from.
RPparameters for random map.
Returns
monster, or NULL if none found.
Todo:
shouldn't it search further away?

Definition at line 311 of file treasure.c.

References obj::above, FLAG_MONSTER, freearr_x, freearr_y, GET_MAP_FLAGS, GET_MAP_OB, P_IS_ALIVE, QUERY_FLAG, and SIZEOFFREE.

Referenced by keyplace().

+ Here is the caller graph for this function:

object** find_doors_in_room ( mapstruct map,
int  x,
int  y,
RMParms RP 
)

Gets all doors in a room.

Parameters
mapmap to look into.
x
ypoint of a room to find door for.
RPmap parameters.
Returns
door list. Should be free()d be caller. NULL-terminated.
Todo:
couldn't layout be given instead of being computed?

Definition at line 871 of file treasure.c.

References find_doors_in_room_recursive(), wall_blocked(), RMParms::Xsize, and RMParms::Ysize.

Referenced by place_treasure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void find_doors_in_room_recursive ( char **  layout,
mapstruct map,
int  x,
int  y,
object **  doorlist,
int *  ndoors,
RMParms RP 
)

The workhorse routine, which finds the doors in a room

Parameters
layout
map
x
yrandom map to look into.
doorlistlist of doors.
ndoorsnumber of found doors.
RPmap parameters.

Definition at line 824 of file treasure.c.

References door_in_square(), freearr_x, freearr_y, llevError, and LOG().

Referenced by find_doors_in_room().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void find_enclosed_spot ( mapstruct map,
int *  cx,
int *  cy,
RMParms RP 
)

Searches the map for a spot with walls around it. The more walls the better, but it'll settle for 1 wall, or even 0, but it'll return 0 if no FREE spots are found.

Parameters
mapwhere to look.
cx
cywhere to look, and coordinates of found spot. -1 if no spot found.
RPparameters of the random map.

Definition at line 653 of file treasure.c.

References find_archetype(), find_first_free_spot(), freearr_x, freearr_y, SIZEOFFREE1, and surround_flag3().

Referenced by place_treasure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void find_in_layout ( int  mode,
char  target,
int *  fx,
int *  fy,
char **  layout,
RMParms RP 
)

Find a character in the layout.

Parameters
modehow to look:
  • 1: from top/left to bottom/right.
  • 2: from top/right to bottom/left.
  • 3: from bottom/left to top/right.
  • 4: from bottom/right to top/left.
  • other value: one random order is chosen.
targetcharacter to search.
fx
fyposition of character, or -1 if not found.
layoutmaze.
RPmaze parameters.

Definition at line 58 of file exit.c.

References RMParms::Xsize, and RMParms::Ysize.

Referenced by place_exits().

+ Here is the caller graph for this function:

object* find_monster_in_room ( mapstruct map,
int  x,
int  y,
RMParms RP 
)

Find a monster in a room. Real work is done by find_monster_in_room_recursive().

Parameters
mapgenerated map.
x
ywhere to look from.
RPrandom map parameters.
Returns
monster, or NULL if none found.
Todo:
couldn't the layout be given instead of being calculated?

Definition at line 513 of file treasure.c.

References find_monster_in_room_recursive(), wall_blocked(), RMParms::Xsize, and RMParms::Ysize.

Referenced by keyplace().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

object* find_monster_in_room_recursive ( char **  layout,
mapstruct map,
int  x,
int  y,
RMParms RP 
)

A recursive routine which will return a monster, eventually, if there is one. One should really call find_monster_in_room().

Parameters
layoutmap layout.
mapgenerated map.
x
ywhere to look from.
RPrandom map parameters.
Returns
monster, or NULL if none found.

Definition at line 465 of file treasure.c.

References obj::above, FLAG_ALIVE, freearr_x, freearr_y, GET_MAP_FLAGS, GET_MAP_OB, P_IS_ALIVE, and QUERY_FLAG.

Referenced by find_monster_in_room().

+ Here is the caller graph for this function:

int find_spot_for_submap ( mapstruct map,
char **  layout,
int *  ix,
int *  iy,
int  xsize,
int  ysize 
)

Finds a place to put a submap into.

Parameters
mapmap to insert.
layoutwhere to insert into.
ix
iycoordinates of suitable location if return is 1.
xsize
ysizesize of layout.
Returns
0 if no space found, 1 else.

Definition at line 141 of file special.c.

References MAP_HEIGHT, and MAP_WIDTH.

Referenced by place_specials_in_map().

+ Here is the caller graph for this function:

int find_spot_in_room ( mapstruct map,
int  x,
int  y,
int *  kx,
int *  ky,
RMParms RP 
)

Find a random non-blocked spot in this room to drop a key. Returns 1 if success, 0 else.

Parameters
mapmap to look into.
x
ywhere to look from.
[out]kx
[out]kyfound spot if 1 is returned.
RPrandom map parameters.
Returns
1 if spot found, 0 else.
Todo:
couldn't layout be given instead of being computed?

Definition at line 600 of file treasure.c.

References find_spot_in_room_recursive(), free_spots_struct::number_of_free_spots_in_room, free_spots_struct::room_free_spots_x, free_spots_struct::room_free_spots_y, wall_blocked(), RMParms::Xsize, and RMParms::Ysize.

Referenced by keyplace().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

mapstruct* find_style ( const char *  dirname,
const char *  stylename,
int  difficulty 
)

Loads and returns the map requested. Dirname, for example, is "/styles/wallstyles", stylename, is, for example, "castle", difficulty is -1 when difficulty is irrelevant to the style. If dirname is given, but stylename isn't, and difficult is -1, it returns a random style map. Otherwise, it tries to match the difficulty given with a style file, named style_name_# where # is an integer

Parameters
dirnamewhere to look.
stylenamestyle to use, can be NULL.
difficultystyle difficulty.
Returns
style, or NULL if none suitable.
Todo:
better document.

Definition at line 177 of file style.c.

References Settings::datadir, load_dir(), load_style_map(), S_ISDIR, settings, and snprintf().

Referenced by make_map_floor(), make_map_walls(), place_chest(), place_exits(), place_fountain_with_specials(), place_monsters(), place_special_exit(), place_specials_in_map(), place_treasure(), put_decor(), and put_doors().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void find_top_left_corner ( char **  maze,
int *  cx,
int *  cy 
)

This starts from within a centered onion layer (or between two layers), and looks up until it finds a wall, and then looks right until it finds a vertical wall, i.e., the corner. It sets cx and cy to that. it also starts from cx and cy.

Parameters
mazewhere to look.
cx
cywhere to start from, and detected corner.

Definition at line 68 of file square_spiral.c.

Referenced by make_square_spiral_layout().

+ Here is the caller graph for this function:

void free_style_maps ( void  )

Frees cached style maps.

Definition at line 300 of file style.c.

References delete_map(), llevDebug, LOG(), and mapdef::next.

Referenced by cleanup().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

mapstruct* generate_random_map ( const char *  OutFileName,
RMParms RP,
char **  use_layout 
)
void include_map_in_map ( mapstruct dest_map,
mapstruct in_map,
int  x,
int  y 
)

Copy in_map into dest_map at point x,y

Parameters
dest_mapmap where to copy to.
in_mapmap to copy from.
x
ycoordinates to put in_map to.

Definition at line 100 of file special.c.

References obj::above, add_button_link(), obj::arch, arch_to_object(), copy_object_with_inv(), FLAG_IS_LINKED, GET_MAP_OB, obj::head, insert_multisquare_ob_in_map(), MAP_HEIGHT, MAP_WIDTH, nuke_map_region(), obj::path_attuned, QUERY_FLAG, obj::x, and obj::y.

Referenced by place_specials_in_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void insert_multisquare_ob_in_map ( object new_obj,
mapstruct map 
)

Inserts a monster in the map. Some monsters are multisquare, and these guys require special handling.

Parameters
new_objmonster to insert. Its x and y fields must be the desired location.
mapwhere to insert to.
Todo:
there probably is a function in the common library for that, so remove this one.

Definition at line 49 of file monster.c.

References obj::arch, arch_to_object(), archt::clone, obj::head, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), obj::map, obj::more, archt::more, obj::x, and obj::y.

Referenced by include_map_in_map(), and place_monsters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int keyplace ( mapstruct map,
int  x,
int  y,
char *  keycode,
int  door_flag,
int  n_keys,
RMParms RP 
)

Places keys in the map, preferably in something alive.

The idea is that you call keyplace on x,y where a door is, and it'll make sure a key is placed on both sides of the door.

Parameters
map
x
ywhere to put a key.
keycodekeycode is the key's code.
door_flagif NO_PASS_DOORS won't cross doors or walls to keyplace, PASS_DOORS will. if PASS_DOORS is set, the x & y values that are passed in are basically meaningless - IMO, it is a bit of misnomer, as when it is set, it just randomly chooses spaces on the map, ideally finding a close monster, to put the key in. In fact, if PASS_DOORS is set, there is no guarantee that the keys will be on both sides of the door - it may happen by randomness, but the code doesn't work to make sure it happens.
n_keysnumber of keys to place. If 1, it will place 1 key. Else, it will place 2-4 keys.
RPrandom map parameters.
Returns
1 if key was successfully placed, 0 else.

Definition at line 361 of file treasure.c.

References add_string(), create_archetype(), distance(), RMParms::dungeon_level, RMParms::dungeon_name, find_closest_monster(), find_first_free_spot(), find_monster_in_room(), find_spot_in_room(), free_string(), freearr_x, freearr_y, insert_ob_in_map(), insert_ob_in_ob(), obj::name, NO_PASS_DOORS, PASS_DOORS, obj::slaying, snprintf(), wall_blocked(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by lock_and_hide_doors(), and place_chest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char** layoutgen ( RMParms RP)

This function builds the actual layout. Selects the layout based on parameters and gives it whatever arguments it needs.

Parameters
RPrandom map parameters.
Returns
layout, must be free()d be caller.
Todo:
use an array for name/style mapping. Refactor to call only one function for each (will make it easier to override later on).

Definition at line 203 of file random_map.c.

References doorify_layout(), dump_layout(), expand2x(), RMParms::expand2x, RMParms::layoutoptions1, RMParms::layoutoptions2, RMParms::layoutstyle, make_snake_layout(), make_square_spiral_layout(), map_gen_onion(), map_gen_spiral(), RMParms::map_layout_style, maze_gen(), MAZE_LAYOUT, MIN_RANDOM_MAP_SIZE, NO_SYM, NROFLAYOUTS, ONION_LAYOUT, OPT_WALLS_ONLY, RANDOM_SYM, ROGUELIKE_LAYOUT, roguelike_layout_gen(), roomify_layout(), SNAKE_LAYOUT, SPIRAL_LAYOUT, SQUARE_SPIRAL_LAYOUT, symmetrize_layout(), RMParms::symmetry, RMParms::symmetry_used, X_SYM, RMParms::Xsize, XY_SYM, Y_SYM, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int load_dir ( const char *  dir,
char ***  namelist,
int  skip_dirs 
)

This is our own version of scandir/select_regular_files/sort. To support having subdirectories in styles, we need to know if in fact the directory we read is a subdirectory. However, we can't get that through the normal dirent entry. So instead, we do our own where we do have the full directory path so can do stat calls to see if in fact it is a directory. dir is the name of the director to scan. namelist is the array of file names returned. IT needs to be freed by the caller. skip_dirs controls our behavioru - if nonzero, we don't skip any subdirectories - if zero, we store those away, since there are cases where we want to choose a random directory.

Parameters
dirdirectory to list.
[out]namelistlist of files found.
skip_dirsif non 0, don't list directories.
Returns
-1 if dir is invalid, number of files else.

Definition at line 83 of file style.c.

References closedir(), dirent::d_name, NAME_MAX, opendir(), pointer_strcmp(), readdir(), S_ISDIR, snprintf(), and strdup_local().

Referenced by find_style().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

mapstruct* load_style_map ( char *  style_name)

Loads specified map (or take it from cache list).

Parameters
style_namemap to load.
Returns
map.

Definition at line 131 of file style.c.

References first_map, load_original_map(), MAP_STYLE, mapdef::next, mapdef::path, and styles.

Referenced by find_style().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lock_and_hide_doors ( object **  doorlist,
mapstruct map,
int  opts,
RMParms RP 
)

Locks and/or hides all the doors in doorlist, or does nothing if opts doesn't say to lock/hide doors. Note that some doors can be not locked if no good spot to put a key was found.

Parameters
doorlistdoors to list. NULL-terminated.
mapmap we're working on.
optsoptions.
RPmap parameters.
Todo:
document opts. Isn't it part of RP?

Definition at line 952 of file treasure.c.

References add_string(), create_archetype(), DOORED, obj::face, FLAG_REMOVED, free_object(), HIDDEN, insert_ob_in_map(), keyplace(), NO_PASS_DOORS, QUERY_FLAG, remove_adjacent_doors(), remove_ob(), retrofit_joined_wall(), obj::slaying, snprintf(), obj::x, and obj::y.

Referenced by place_treasure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Add doors to the layout.

Parameters
mazemap to draw to.
xlocations
ylocationsarray of locations. Will be free()d.
layersnumber of layers.
optionscombination of OPT_xxx values.
Todo:
explain what locations arrays should be, and the meaning of layers.

Definition at line 344 of file room_gen_onion.c.

References OPT_BOTTOM_C, OPT_BOTTOM_R, OPT_LINEAR, and OPT_NO_DOORS.

Referenced by bottom_centered_onion(), bottom_right_centered_onion(), and centered_onion().

+ Here is the caller graph for this function:

mapstruct* make_map_floor ( char **  layout,
char *  floorstyle,
RMParms RP 
)

Creates the Crossfire mapstruct object from the layout, and adds the floor.

Parameters
layoutgenerated layout.
floorstylefloor style. Can be NULL, in which case a random one is chosen.
RPparameters of the random map.
Returns
Crossfire map.

Definition at line 89 of file floor.c.

References obj::arch, arch_to_object(), find_style(), get_empty_map(), GET_MAP_OB, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), RMParms::multiple_floors, pick_random_object(), put_floor(), snprintf(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void make_map_walls ( mapstruct map,
char **  layout,
char *  w_style,
RMParms RP 
)

takes a map and a layout, and puts walls in the map (picked from w_style) at '#' marks.

Parameters
mapmap where walls will be put.
layoutlayout containing walls and such.
w_stylewall style. Must not be NULL, can be "none".
RPmap parameters.

Definition at line 180 of file wall.c.

References obj::arch, arch_to_object(), find_style(), INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), MOVE_ALL, obj::move_allow, obj::move_block, archt::name, pick_joined_wall(), pick_random_object(), snprintf(), RMParms::wall_name, obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char** make_snake_layout ( int  xsize,
int  ysize 
)

Generate a snake-like layout.

Parameters
xsize
ysizelayout size.
Returns
generated layout.

Definition at line 20 of file snake.c.

Referenced by layoutgen().

+ Here is the caller graph for this function:

char** make_square_spiral_layout ( int  xsize,
int  ysize 
)

Generates a square-spiral layout.

Parameters
xsize
ysizesize of the layout.
Returns
generated layout.
Todo:
use function in another file for character searching.

Definition at line 90 of file square_spiral.c.

Referenced by layoutgen().

+ Here is the caller graph for this function:

int make_wall ( char **  maze,
int  x,
int  y,
int  dir 
)

Cuts the layout horizontally or vertically by a wall with a door.

Parameters
mazelayout.
x
ywhere to put the door.
dirwall direction:
  • 0: horizontally.
  • 1: vertically.
Returns
0

Definition at line 602 of file random_map.c.

Referenced by make_square_spiral_layout(), and roomify_layout().

+ Here is the caller graph for this function:

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

Generates an onion layout.

Parameters
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers the onion should have.
Returns
layout.

Definition at line 85 of file room_gen_onion.c.

char** map_gen_spiral ( int  xsize,
int  ysize,
int  option 
)

Generates a spiral layout.

Parameters
xsize
ysizelayout size.
optioncombination of SPIRAL_xxx values.
Returns
generated layout.

Definition at line 68 of file room_gen_spiral.c.

char** maze_gen ( int  xsize,
int  ysize,
int  option 
)

This function generates a random blocked maze with the property that there is only one path from one spot to any other, and there is always a path from one spot to any other.

Parameters
xsize
ysizewanted map size.
optionif 0, maze will be sparse (sizeable rooms), else totally filled.
Returns
a char** array with # and . for closed and open respectively. a char value of 0 represents a blank space: a '#' is a wall.

Definition at line 68 of file maze_gen.c.

References fill_maze_full(), fill_maze_sparse(), make_wall_free_list(), pop_wall_point(), free_walls_struct::wall_free_size, free_walls_struct::wall_x_list, and free_walls_struct::wall_y_list.

Referenced by layoutgen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nuke_map_region ( mapstruct map,
int  xstart,
int  ystart,
int  xsize,
int  ysize 
)

Erases all objects (except floor) in the given rectangle.

Parameters
mapmap to process.
xstart
ystarttop-left coordinates of zone.
xsize
ysizesize of zone.

Definition at line 70 of file special.c.

References obj::above, FLAG_IS_FLOOR, free_object(), GET_MAP_OB, obj::head, QUERY_FLAG, and remove_ob().

Referenced by include_map_in_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int obj_count_in_map ( mapstruct map,
int  x,
int  y 
)

Count objects at a spot.

Parameters
mapmap we want to check
x
ycoordinates
Returns
count of objects in the map at x,y.

Definition at line 51 of file decor.c.

References obj::above, and GET_MAP_OB.

Referenced by put_decor().

+ Here is the caller graph for this function:

object* pick_joined_wall ( object the_wall,
char **  layout,
int  i,
int  j,
RMParms RP 
)

Picks the right wall type for this square, to make it look nice, and have everything nicely joined. It uses the layout.

Parameters
the_wallwall we want to insert.
layout
i
jwhere to insert.
RPmap parameters.
Returns
correct wall archetype to fit on the square.
Todo:
check if there isn't an equivalent function in the building code, merge?

Definition at line 241 of file wall.c.

References obj::arch, arch_to_object(), archt::name, surround_flag2(), and try_find_archetype().

Referenced by make_map_walls().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

object* pick_random_object ( mapstruct style)

Picks a random object from a style map. Redone by MSW so it should be faster and not use static variables to generate tables.

Parameters
stylemap to pick from.
Returns
random object. Can be NULL.

Definition at line 275 of file style.c.

References GET_MAP_OB, obj::head, MAP_HEIGHT, and MAP_WIDTH.

Referenced by make_map_floor(), make_map_walls(), place_chest(), place_exits(), place_fountain_with_specials(), place_monsters(), place_special_exit(), put_decor(), and put_doors().

+ Here is the caller graph for this function:

object* place_chest ( int  treasureoptions,
int  x,
int  y,
mapstruct map,
mapstruct style_map,
int  n_treasures,
RMParms RP 
)

Put a chest into the map. near x and y, with the treasure style determined (may be null, or may be a treasure list from lib/treasures, if the global variable "treasurestyle" is set to that treasure list's name

Parameters
treasureoptionsoptions.
x
yaround which spot to put treasure.
mapmap to put on.
style_mapunused.
n_treasures?
RPparameters the map was generated from.
Returns
inserted chest, NULL for failure.
Todo:
document treasureoptions. Clean parameters. Check meaning of chest hp's field.

Definition at line 232 of file treasure.c.

References add_string(), obj::arch, arch_to_object(), BC_RANDOM, liv::Cha, copy_object(), create_archetype(), RMParms::difficulty, find_first_free_spot(), find_style(), find_treasurelist(), free_object(), freearr_x, freearr_y, liv::hp, insert_ob_in_map(), insert_ob_in_ob(), keyplace(), KEYREQUIRED, obj::level, PASS_DOORS, pick_random_object(), obj::randomitems, obj::slaying, snprintf(), obj::stats, TRAPPED, wall_blocked(), obj::x, and obj::y.

Referenced by place_treasure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_exits ( mapstruct map,
char **  maze,
char *  exitstyle,
int  orientation,
RMParms RP 
)

Place exits in the map.

Parameters
mapmap to put exits into.
mazemap layout.
exitstylewhat style to use. If NULL uses a random one.
orientationhow exits should be oriented:
  • 0 means random.
  • 1 means descending dungeon.
  • 2 means ascending dungeon.
  • 3 means rightward.
  • 4 means leftward.
  • 5 means northward.
  • 6 means southward.
RPmap parameters.
Note
unblock_exits() should be called at some point, as exits will be blocking everything to avoid putting other objects on them.
Todo:
add orientations 3-6 or fix previous comment.

Definition at line 153 of file exit.c.

References add_string(), obj::arch, arch_to_object(), create_archetype(), RMParms::dungeon_depth, RMParms::dungeon_level, EXIT, RMParms::exit_on_final_map, EXIT_PATH, EXIT_X, EXIT_Y, RMParms::final_exit_archetype, RMParms::final_map, find_archetype(), find_first_free_spot(), find_in_layout(), find_style(), free_object(), freearr_x, freearr_y, GET_MAP_OB, liv::hp, insert_ob_in_map(), MAP_ENTER_X, MAP_ENTER_Y, MOVE_ALL, obj::move_block, obj::msg, RMParms::origin_map, RMParms::origin_x, RMParms::origin_y, mapdef::path, pick_random_object(), ready_map_name(), remove_ob(), set_map_timeout(), obj::slaying, snprintf(), liv::sp, obj::stats, wall_blocked(), write_map_parameters_to_string(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_fountain_with_specials ( mapstruct map)

Places a special fountain on the map.

Parameters
mapmap to place to.
Todo:
change logic to allocate potion only if success?

Definition at line 192 of file special.c.

References add_string(), copy_object(), create_archetype(), obj::face, find_first_free_spot(), find_style(), FLAG_IDENTIFIED, FLAG_NO_PICK, free_object(), freearr_x, freearr_y, get_object(), insert_ob_in_map(), M_ADAMANT, MAP_HEIGHT, MAP_WIDTH, obj::material, obj::name, obj::name_pl, pick_random_object(), SET_FLAG, obj::x, and obj::y.

Referenced by place_specials_in_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_monsters ( mapstruct map,
char *  monsterstyle,
int  difficulty,
RMParms RP 
)

Place some monsters into the map. Their experience is linked to difficulty to insert a suitable number of critters.

Parameters
mapwhere to put monsters on.
monsterstylestyle. Can be NULL, in which case a random one is used.
difficultyhow difficult the monsters should be, and how many there should be.
RPrandom map parameters.

Definition at line 89 of file monster.c.

References obj::arch, arch_to_object(), copy_object_with_inv(), liv::exp, find_first_free_spot(), find_style(), freearr_x, freearr_y, liv::hp, insert_multisquare_ob_in_map(), level_exp(), MAP_HEIGHT, MAP_WIDTH, archt::more, pick_random_object(), snprintf(), obj::stats, RMParms::total_map_hp, obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_special_exit ( mapstruct map,
int  hole_type,
RMParms RP 
)

Place an exit with a resource map.

Parameters
mapwhere to put the exit.
hole_typetype of random map to link to, see HOLE_xxx.
RPparameters from which map was generated.

Definition at line 235 of file special.c.

References add_string(), copy_object(), RMParms::difficulty, RMParms::difficulty_increase, RMParms::dungeon_level, RMParms::exitstyle, find_first_free_spot(), find_style(), RMParms::floorstyle, freearr_x, freearr_y, get_object(), GLORY_HOLE, HUGE_BUF, insert_ob_in_map(), llevError, LOG(), MAP_HEIGHT, MAP_WIDTH, MIN_RANDOM_MAP_SIZE, MINING_ZONE, mon, obj::msg, NR_OF_HOLE_TYPES, OPT_WALLS_ONLY, ORC_ZONE, pick_random_object(), obj::slaying, RMParms::wallstyle, write_parameters_to_string(), obj::x, and obj::y.

Referenced by place_specials_in_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_specials_in_map ( mapstruct map,
char **  layout,
RMParms RP 
)

Main function for specials.

Parameters
mapmap to alter.
layoutlayout the map was generated from.
RPparameters the map was generated from.

Definition at line 323 of file special.c.

References RMParms::difficulty, find_spot_for_submap(), find_style(), include_map_in_map(), MAP_HEIGHT, MAP_WIDTH, NUM_OF_SPECIAL_TYPES, place_fountain_with_specials(), place_special_exit(), SPECIAL_EXIT, SPECIAL_FOUNTAIN, and SPECIAL_SUBMAP.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_treasure ( mapstruct map,
char **  layout,
char *  treasure_style,
int  treasureoptions,
RMParms RP 
)

Place treasures in the map. map, (required) layout, (required) treasure style (may be empty or NULL, or "none" to cause no treasure.) treasureoptions (may be 0 for random choices or positive)

Parameters
mapwhere to insert to.
layoutlayout the map was generated from.
treasure_styletreasure style. May be empty or NULL for random style, or "none" for no treasures.
treasureoptionstreasure options.
RPrandom map parameters.
Todo:
flags for treasureoptions.

Definition at line 101 of file treasure.c.

References BC_RANDOM, CONCENTRATED, RMParms::difficulty, DOORED, find_doors_in_room(), find_enclosed_spot(), find_style(), HIDDEN, LAST_OPTION, lock_and_hide_doors(), RMParms::map_layout_style, ONION_LAYOUT, place_chest(), RICH, snprintf(), SPARSE, SPIRAL_LAYOUT, SQUARE_SPIRAL_LAYOUT, surround_by_doors(), RMParms::symmetry_used, RMParms::total_map_hp, wall_blocked(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void put_decor ( mapstruct map,
char **  maze,
char *  decorstyle,
int  decor_option,
RMParms RP 
)

Put the decor into the map. Right now, it's very primitive.

Parameters
mapmap to add decor to.
mazelayout of the map, as was generated.
decorstylestyle to use. Can be NULL.
decor_optionhow to place decor:
  • 0 means no decor.
  • 1 means to place randomly decor.
  • other means to fill the map with decor.
RPparameters of the random map.

Definition at line 76 of file decor.c.

References obj::arch, arch_to_object(), copy_object(), find_style(), insert_ob_in_map(), obj::move_block, MOVE_BLOCK_DEFAULT, NR_DECOR_OPTIONS, obj_count_in_map(), pick_random_object(), snprintf(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void put_doors ( mapstruct the_map,
char **  maze,
const char *  doorstyle,
RMParms RP 
)

Add doors to a map.

Parameters
the_mapmap we're adding doors to.
mazemaze layout.
doorstyledoor style to be. If "none", won't do anything. If NULL, will choose one randomly.
RPrandom map parameters.

Definition at line 80 of file door.c.

References obj::arch, arch_to_object(), copy_object(), find_style(), insert_ob_in_map(), mapdef::path, pick_random_object(), snprintf(), surround_check2(), obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void remove_monsters ( int  x,
int  y,
mapstruct map 
)

Remove living things on specified spot.

Parameters
x
y
mapwhere to remove.

Definition at line 722 of file treasure.c.

References obj::above, FLAG_ALIVE, free_object(), GET_MAP_OB, obj::head, QUERY_FLAG, and remove_ob().

Referenced by surround_by_doors().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

object* retrofit_joined_wall ( mapstruct the_map,
int  i,
int  j,
int  insert_flag,
RMParms RP 
)

this takes a map, and changes an existing wall to match what's blocked around it, counting only doors and walls as blocked. If insert_flag is 1, . If not, it will only return the wall which would belong there, and doesn't remove anything. It depends on the global, previously-set variable, "wall_name"

Parameters
the_map
i
jwhere to look.
insert_flagif 1, insert the correct wall into the map, else don't insert.
RPmap parameters.
Returns
correct wall for spot.
Todo:
merge with pick_joined_wall()?

Definition at line 362 of file wall.c.

References obj::above, arch_to_object(), DOOR, EXIT, free_object(), GET_MAP_OB, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), LOCKED_DOOR, obj::map, MOVE_ALL, obj::move_block, obj::move_type, MOVE_WALK, remove_ob(), surround_flag4(), TELEPORTER, try_find_archetype(), obj::type, RMParms::wall_name, obj::x, and obj::y.

Referenced by lock_and_hide_doors().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Parameters
xsize
ysizewanted layout size.
options2 to have circular rooms, 1 for rectanglar ones, another value for random choice.
Returns
generated layout.

Definition at line 69 of file rogue_layout.c.

void roomify_layout ( char **  maze,
RMParms RP 
)

Take a layout and make some rooms in it. Works best on onions.

Parameters
mazelayout to alter.
RPmap parameters.

Definition at line 471 of file random_map.c.

References can_make_wall(), make_wall(), RMParms::Xsize, and RMParms::Ysize.

Referenced by layoutgen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char** rotate_layout ( char **  maze,
int  rotation,
RMParms RP 
)

Takes a map and rotates it. This completes the onion layouts, making them possibly centered on any wall. It'll modify Xsize and Ysize if they're swapped.

Parameters
mazelayout to rotate, will be free()d by this function.
rotationhow to rotate:
  • 0: don't do anything.
  • 1: rotate 90 deg clockwise.
  • 2: rotate 180 deg.
  • 3: rotate 90 deg counter-clockwise.
RPrandom map parameters.
Returns
new layout, must be free()d be caller. NULL if invalid rotation.

Definition at line 403 of file random_map.c.

References RMParms::Xsize, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the caller graph for this function:

int surround_check ( char **  layout,
int  i,
int  j,
int  Xsize,
int  Ysize 
)

Checks free spots around a spot.

Parameters
layoutmap layout.
i
jcoordinates to check.
Xsize
Ysizesize of the layout.
Returns
combination of the following values:
  • 1 = free space to left,
  • 2 = free space to right,
  • 4 = free space above
  • 8 = free space below
Todo:
there is an equivalent function in another layout, merge them together.

Definition at line 44 of file rogue_layout.c.

Referenced by roguelike_layout_gen().

+ Here is the caller graph for this function:

int surround_check2 ( char **  layout,
int  i,
int  j,
int  Xsize,
int  Ysize 
)

Serch for doors or walls around a spot.

Parameters
layoutmaze.
i
jcoordinates to check.
Xsize
Ysizemaze size.
Returns
Combination of flags:
  • 1 = door or wall to left.
  • 2 = door or wall to right.
  • 4 = door or wall above.
  • 8 = door or wall below.

Definition at line 55 of file door.c.

Referenced by put_doors().

+ Here is the caller graph for this function:

int surround_flag ( char **  layout,
int  i,
int  j,
RMParms RP 
)

Given a layout and a coordinate, tell me which squares up/down/right/left are occupied.

Parameters
layout
i
jspot to look.
RPmap parameters.
Returns
combination of:
  • 1 = something on left.
  • 2 = something on right.
  • 4 = something on above.
  • 8 = something on below.
Todo:
merge with surround_flag2() and friends, check if such a function doesn't exist in other files.

Definition at line 56 of file wall.c.

Referenced by doorify_layout().

+ Here is the caller graph for this function:

int surround_flag2 ( char **  layout,
int  i,
int  j,
RMParms RP 
)

Given a layout and a coordinate, tell me which squares up/down/right/left are occupied by walls.

Parameters
layout
i
jspot to look.
RPmap parameters.
Returns
combination of:
  • 1 = wall on left.
  • 2 = wall on right.
  • 4 = wall on above.
  • 8 = wall on below.
Todo:
merge with surround_flag() and friends, check if such a function doesn't exist in other files.

Definition at line 88 of file wall.c.

Referenced by can_make_wall(), and pick_joined_wall().

+ Here is the caller graph for this function:

int surround_flag3 ( mapstruct map,
int  i,
int  j,
RMParms RP 
)

Check a map for blocked spots. Since this is part of the random map code, presumption is that this is not a tiled map. What is considered blocking and not is somewhat hard coded.

Parameters
map
i
jspot to look.
RPmap parameters.
Returns
combination of:
  • 1 = blocked on left.
  • 2 = blocked on right.
  • 4 = blocked on above.
  • 8 = blocked on below.

Definition at line 120 of file wall.c.

References GET_MAP_MOVE_BLOCK, and MOVE_BLOCK_DEFAULT.

Referenced by find_enclosed_spot().

+ Here is the caller graph for this function:

int surround_flag4 ( mapstruct map,
int  i,
int  j,
RMParms RP 
)

Check a map for spots with walls. Since this is part of the random map code, presumption is that this is not a tiled map. What is considered blocking and not is somewhat hard coded.

Parameters
map
i
jspot to look.
RPmap parameters.
Returns
combination of:
  • 1 = blocked on left.
  • 2 = blocked on right.
  • 4 = blocked on above.
  • 8 = blocked on below.

Definition at line 153 of file wall.c.

References wall_blocked().

Referenced by retrofit_joined_wall().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char** symmetrize_layout ( char **  maze,
int  sym,
RMParms RP 
)

Takes a map and makes it symmetric: adjusts Xsize and Ysize to produce a symmetric map.

Parameters
mazelayout to symmetrize. Will be free()d by this function.
symhow to make symetric, a Random map symetry value.
RPmap parameters.
Returns
new layout, must be free()d by caller.

Definition at line 327 of file random_map.c.

References connect_spirals(), RMParms::map_layout_style, NO_SYM, ROGUELIKE_LAYOUT, SPIRAL_LAYOUT, RMParms::symmetry_used, X_SYM, RMParms::Xsize, XY_SYM, Y_SYM, and RMParms::Ysize.

Referenced by layoutgen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unblock_exits ( mapstruct map,
char **  maze,
RMParms RP 
)

This function unblocks the exits. We blocked them to keep things from being dumped on them during the other phases of random map generation.

Parameters
mapmap to alter.
mazemap layout.
RPmap generation parameters.

Definition at line 392 of file exit.c.

References obj::above, GET_MAP_OB, LOCKED_DOOR, MOVE_ALL, obj::move_block, MOVE_BLOCK_DEFAULT, obj::type, UP_OBJ_CHANGE, update_object(), RMParms::Xsize, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int wall_blocked ( mapstruct m,
int  x,
int  y 
)

Returns true if square x,y has P_NO_PASS set, which is true for walls and doors but not monsters. This function is not map tile aware.

Parameters
m
x
ymap and coordinates to check for.
Returns
non zero if blocked, 0 else.

Definition at line 73 of file treasure.c.

References GET_MAP_MOVE_BLOCK, MOVE_BLOCK_DEFAULT, and OUT_OF_REAL_MAP.

Referenced by find_doors_in_room(), find_monster_in_room(), find_spot_in_room(), keyplace(), place_chest(), place_exits(), place_treasure(), surround_by_doors(), and surround_flag4().

+ Here is the caller graph for this function:

void write_parameters_to_string ( char *  buf,
int  xsize_n,
int  ysize_n,
const char *  wallstyle_n,
const char *  floorstyle_n,
const char *  monsterstyle_n,
const char *  treasurestyle_n,
const char *  layoutstyle_n,
const char *  decorstyle_n,
const char *  doorstyle_n,
const char *  exitstyle_n,
const char *  final_map_n,
const char *  exit_on_final_map_n,
const 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 
)

Converts various parameters to string suitable for an exit message.

Parameters
bufbuffer to write to.
xsize_n
ysize_n
wallstyle_n
floorstyle_n
monsterstyle_n
treasurestyle_n
layoutstyle_n
decorstyle_n
doorstyle_n
exitstyle_n
final_map_n
exit_on_final_map_n
this_map_n
layoutoptions1_n
layoutoptions2_n
layoutoptions3_n
symmetry_n
dungeon_depth_n
dungeon_level_n
difficulty_n
difficulty_given_n
decoroptions_n
orientation_n
origin_x_n
origin_y_n
random_seed_n
treasureoptions_n
difficulty_increaserandom map parameters.
Todo:
remove this and replace with calls to write_map_parameters_to_string().

Definition at line 877 of file random_map.c.

References snprintf().

Referenced by place_special_exit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: