Atrinik Server  4.0
exit.c File Reference
#include <global.h>
#include <arch.h>

Go to the source code of this file.


void find_in_layout (int mode, char target, int *fx, int *fy, char **layout, RMParms *RP)
void place_exits (mapstruct *map, char **maze, char *exitstyle, int orientation, RMParms *RP)
void unblock_exits (mapstruct *map, char **maze, RMParms *RP)

Detailed Description

Handle exit placement in map.

Definition in file exit.c.

Function Documentation

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

Find a character in the layout.

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: One random order is chosen.
targetCharacter to search.
layoutMaze layout.
RPRandom map parameters.

Definition at line 49 of file exit.c.

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

Place exits in the map.

mapMap to put exits into.
mazeMap layout.
exitstyleWhat style to use. If NULL uses a random one.
orientationHow exits should be oriented:
  • 0: Random.
  • 1: Descending dungeon.
  • 2: Ascending dungeon.
RPRandom map parameters.
unblock_exits() should be called at some point, as exits will be blocking everything to avoid putting other objects on them.

Definition at line 155 of file exit.c.

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.

mapMap to alter.
mazeMap layout.
RPRandom map parameters.

Definition at line 406 of file exit.c.