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

Go to the source code of this file.

Functions

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)
 
void make_map_walls (mapstruct *map, char **layout, char *w_style, RMParms *RP)
 
objectpick_joined_wall (object *the_wall, char **layout, int i, int j, RMParms *RP)
 
objectretrofit_joined_wall (mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP)
 

Detailed Description

Deals with wall management in random maps.

Definition in file wall.c.

Function Documentation

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.
RPRandom map parameters.

Definition at line 193 of file wall.c.

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.
RPRandom map parameters.
Returns
Correct wall archetype to fit on the square.

Definition at line 254 of file wall.c.

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.

Parameters
insert_flagIf 1, insert the correct wall into the map, otherwise don't insert.
RPRandom map parameters.
Returns
Correct wall for spot.
Todo:
Merge with pick_joined_wall()?

Definition at line 333 of file wall.c.

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
RPRandom map parameters.
Returns
Combination of:
  • 1: Something on left.
  • 2: Something on right.
  • 4: Something on above.
  • 8: Something on below.

Definition at line 45 of file wall.c.

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 or doors.

Parameters
RPRandom map parameters.
Returns
Combination of:
  • 1: Wall/door on left.
  • 2: Wall/door on right.
  • 4: Wall/door on above.
  • 8: Wall/door on below.

Definition at line 80 of file wall.c.

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
RPRandom map parameters.
Returns
Combination of:
  • 1: Blocked on left.
  • 2: Blocked on right.
  • 4: Blocked on above.
  • 8: Blocked on below.

Definition at line 119 of file wall.c.

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
RPRandom map parameters.
Returns
Combination of:
  • 1: Wall on left.
  • 2: Wall on right.
  • 4: Wall on above.
  • 8: Wall on below.

Definition at line 158 of file wall.c.