helapordo 1.4.23
Loading...
Searching...
No Matches
floors.c File Reference
#include "floors.h"
Include dependency graph for floors.c:

Functions

void init_floor_layout (Floor *floor)
 Takes a Floor pointer and initialises its floor_layout fields to empty.
float calc_distance (int x1, int y1, int x2, int y2)
 Function to calculate the distance between two points.
void init_floor_rooms (Floor *floor)
 Takes a Floor pointer and initialises its rooms_matrix and roomclass_matrix, using the values in floor_layout fields.
void floor_random_walk (Floor *floor, int x, int y, int steps, int do_layout_clean)
 Takes a Floor pointer and tries walking randomly to initialises its floor_layout field.
void floor_set_room_types (Floor *floor)
 Takes a Floor pointer and initialises its roomclass_layout, using the floor_layout fields.
void load_floor_explored (Floor *floor)
 Takes a Floor pointer and initialises its explored_matrix using the values in floor_layout fields.
void debug_print_roomclass_layout (Floor *floor, FILE *fp)
 Takes a Floor pointer and prints its roomClass layout to the passed FILE pointer.
void debug_print_floor_layout (Floor *floor, FILE *fp)
 Takes a Floor pointer and prints its floor layout to the passed FILE pointer.
void debug_print_floor_visible_layout (Floor *floor, FILE *fp)
int room_color (Floor *floor, int cell_x, int cell_y)
char room_char (Floor *floor, int cell_x, int cell_y)
bool blocks_vision (const Floor *floor, int x, int y)
void cast_light (Floor *floor, int cx, int cy, int row, float start_slope, float end_slope, int radius, int xx, int xy, int yx, int yy)
void floor_calculate_fov (Floor *floor, int player_x, int player_y, int radius)

Variables

char roomclass_chars [ROOM_CLASS_MAX+1]
int roomclass_colors [ROOM_CLASS_MAX+1]
int roomclass_colors_alt [ROOM_CLASS_MAX+1]

Function Documentation

◆ blocks_vision()

bool blocks_vision ( const Floor * floor,
int x,
int y )

◆ calc_distance()

float calc_distance ( int x1,
int y1,
int x2,
int y2 )

Function to calculate the distance between two points.

◆ cast_light()

void cast_light ( Floor * floor,
int cx,
int cy,
int row,
float start_slope,
float end_slope,
int radius,
int xx,
int xy,
int yx,
int yy )

◆ debug_print_floor_layout()

void debug_print_floor_layout ( Floor * floor,
FILE * fp )

Takes a Floor pointer and prints its floor layout to the passed FILE pointer.

See also
Floor
floorClass

◆ debug_print_floor_visible_layout()

void debug_print_floor_visible_layout ( Floor * floor,
FILE * fp )

◆ debug_print_roomclass_layout()

void debug_print_roomclass_layout ( Floor * floor,
FILE * fp )

Takes a Floor pointer and prints its roomClass layout to the passed FILE pointer.

See also
Floor
floorClass
roomClass

◆ floor_calculate_fov()

void floor_calculate_fov ( Floor * floor,
int player_x,
int player_y,
int radius )

◆ floor_random_walk()

void floor_random_walk ( Floor * floor,
int x,
int y,
int steps,
int do_layout_clean )

Takes a Floor pointer and tries walking randomly to initialises its floor_layout field.

If do_layout_clean is 1, it will reset floor layout when walked area ratio is below or above expectations.

See also
Floor
floorClass

◆ floor_set_room_types()

void floor_set_room_types ( Floor * floor)

Takes a Floor pointer and initialises its roomclass_layout, using the floor_layout fields.

See also
Floor
floorClass

◆ init_floor_layout()

void init_floor_layout ( Floor * floor)

Takes a Floor pointer and initialises its floor_layout fields to empty.

It also sets the area field to 0.

See also
Floor
floorClass

◆ init_floor_rooms()

void init_floor_rooms ( Floor * floor)

Takes a Floor pointer and initialises its rooms_matrix and roomclass_matrix, using the values in floor_layout fields.

See also
Floor
floorClass

◆ load_floor_explored()

void load_floor_explored ( Floor * floor)

Takes a Floor pointer and initialises its explored_matrix using the values in floor_layout fields.

See also
Floor
floorClass

◆ room_char()

char room_char ( Floor * floor,
int cell_x,
int cell_y )

◆ room_color()

int room_color ( Floor * floor,
int cell_x,
int cell_y )

Variable Documentation

◆ roomclass_chars

char roomclass_chars[ROOM_CLASS_MAX+1]
Initial value:
= {
[ENEMIES] = '^',
[SHOP] = '$',
[BOSS] = 'B',
[TREASURE] = '*',
[ROADFORK] = '+',
[HOME] = 'H',
[WALL] = '#',
[BASIC] = '.'
}
@ BASIC
Definition game_core.h:1670
@ ENEMIES
Definition game_core.h:1663
@ ROADFORK
Definition game_core.h:1667
@ SHOP
Definition game_core.h:1664
@ HOME
Definition game_core.h:1668
@ BOSS
Definition game_core.h:1665
@ TREASURE
Definition game_core.h:1666
@ WALL
Definition game_core.h:1669

◆ roomclass_colors

int roomclass_colors[ROOM_CLASS_MAX+1]
Initial value:
= {
[ENEMIES] = S4C_DARK_CYAN,
[SHOP] = S4C_TEAL,
[BOSS] = S4C_CHERRY,
[TREASURE] = S4C_LIGHT_ORANGE,
[ROADFORK] = S4C_GREY,
[HOME] = S4C_LIGHT_OLIVE,
[WALL] = S4C_DARK_PURPLE,
[BASIC] = S4C_DARK_OLIVE,
}

◆ roomclass_colors_alt

int roomclass_colors_alt[ROOM_CLASS_MAX+1]
Initial value:
= {
[ENEMIES] = S4C_CYAN,
[SHOP] = S4C_MAGENTA,
[BOSS] = S4C_RED,
[TREASURE] = S4C_ORANGE,
[ROADFORK] = S4C_GREY,
[HOME] = S4C_WHITE,
[WALL] = S4C_PURPLE,
[BASIC] = S4C_LIGHT_BROWN,
}