Angband
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
cave.h File Reference

Matters relating to the current dungeon level. More...

#include "z-type.h"
#include "z-bitflag.h"
#include "list-square-flags.h"
#include "list-terrain-flags.h"

Go to the source code of this file.

Data Structures

struct  feature
 Information about terrain features. More...
 
struct  grid_data
 
struct  square
 
struct  heatmap
 
struct  connector
 
struct  chunk
 

Macros

#define SQUARE(a, b)   SQUARE_##a,
 
#define SQUARE_SIZE   FLAG_SIZE(SQUARE_MAX)
 
#define sqinfo_has(f, flag)   flag_has_dbg(f, SQUARE_SIZE, flag, #f, #flag)
 
#define sqinfo_next(f, flag)   flag_next(f, SQUARE_SIZE, flag)
 
#define sqinfo_is_empty(f)   flag_is_empty(f, SQUARE_SIZE)
 
#define sqinfo_is_full(f)   flag_is_full(f, SQUARE_SIZE)
 
#define sqinfo_is_inter(f1, f2)   flag_is_inter(f1, f2, SQUARE_SIZE)
 
#define sqinfo_is_subset(f1, f2)   flag_is_subset(f1, f2, SQUARE_SIZE)
 
#define sqinfo_is_equal(f1, f2)   flag_is_equal(f1, f2, SQUARE_SIZE)
 
#define sqinfo_on(f, flag)   flag_on_dbg(f, SQUARE_SIZE, flag, #f, #flag)
 
#define sqinfo_off(f, flag)   flag_off(f, SQUARE_SIZE, flag)
 
#define sqinfo_wipe(f)   flag_wipe(f, SQUARE_SIZE)
 
#define sqinfo_setall(f)   flag_setall(f, SQUARE_SIZE)
 
#define sqinfo_negate(f)   flag_negate(f, SQUARE_SIZE)
 
#define sqinfo_copy(f1, f2)   flag_copy(f1, f2, SQUARE_SIZE)
 
#define sqinfo_union(f1, f2)   flag_union(f1, f2, SQUARE_SIZE)
 
#define sqinfo_inter(f1, f2)   flag_inter(f1, f2, SQUARE_SIZE)
 
#define sqinfo_diff(f1, f2)   flag_diff(f1, f2, SQUARE_SIZE)
 
#define TF(a, b)   TF_##a,
 
#define TF_SIZE   FLAG_SIZE(TF_MAX)
 
#define tf_has(f, flag)   flag_has_dbg(f, TF_SIZE, flag, #f, #flag)
 

Typedefs

typedef bool(* square_predicate) (struct chunk *c, int y, int x)
 square_predicate is a function pointer which tests a given square to see if the predicate in question is true. More...
 

Enumerations

enum  { SQUARE_MAX }
 Square flags. More...
 
enum  { TF_MAX }
 Terrain flags. More...
 
enum  grid_light_level {
  LIGHTING_LOS = 0, LIGHTING_TORCH, LIGHTING_LIT, LIGHTING_DARK,
  LIGHTING_MAX
}
 

Functions

int distance (int y1, int x1, int y2, int x2)
 Approximate distance between two points. More...
 
bool los (struct chunk *c, int y1, int x1, int y2, int x2)
 A simple, fast, integer-based line-of-sight algorithm. More...
 
void update_view (struct chunk *c, struct player *p)
 Update the player's current view. More...
 
bool no_light (void)
 Returns true if the player's grid is dark. More...
 
void map_info (unsigned x, unsigned y, struct grid_data *g)
 This function takes a grid location (x, y) and extracts information the player is allowed to know about it, filling in the grid_data structure passed in 'g'. More...
 
void square_note_spot (struct chunk *c, int y, int x)
 Memorize interesting viewable object/features in the given grid. More...
 
void square_light_spot (struct chunk *c, int y, int x)
 Tell the UI that a given map location has been updated. More...
 
void light_room (int y1, int x1, bool light)
 Illuminate or darken any room containing the given location. More...
 
void wiz_light (struct chunk *c, struct player *p, bool full)
 Light up the dungeon using "claravoyance". More...
 
void cave_illuminate (struct chunk *c, bool daytime)
 Light or Darken the town. More...
 
void cave_update_flow (struct chunk *c)
 
void cave_forget_flow (struct chunk *c)
 
bool feat_is_magma (int feat)
 FEATURE PREDICATES. More...
 
bool feat_is_quartz (int feat)
 True if the square is a quartz wall. More...
 
bool feat_is_granite (int feat)
 True if the square is a granite wall. More...
 
bool feat_is_treasure (int feat)
 True if the square is a mineral wall with treasure (magma/quartz). More...
 
bool feat_is_wall (int feat)
 True is the feature is a solid wall (not rubble). More...
 
bool feat_is_floor (int feat)
 True is the feature is a floor. More...
 
bool feat_is_trap_holding (int feat)
 True is the feature can hold a trap. More...
 
bool feat_is_object_holding (int feat)
 True is the feature can hold an object. More...
 
bool feat_is_monster_walkable (int feat)
 True if a monster can walk through the feature. More...
 
bool feat_is_shop (int feat)
 True if the feature is a shop entrance. More...
 
bool feat_is_passable (int feat)
 True if the feature is passable by the player. More...
 
bool feat_is_projectable (int feat)
 True if any projectable can pass through the feature. More...
 
bool feat_is_torch (int feat)
 True if the feature can be lit by light sources. More...
 
bool feat_is_bright (int feat)
 True if the feature is internally lit. More...
 
bool feat_is_fiery (int feat)
 True if the feature is internally lit. More...
 
bool feat_is_no_flow (int feat)
 True if the feature doesn't carry monster flow information. More...
 
bool feat_is_no_scent (int feat)
 True if the feature doesn't carry player scent. More...
 
bool feat_is_smooth (int feat)
 True if the feature should have smooth boundaries (for dungeon generation). More...
 
bool square_isfloor (struct chunk *c, int y, int x)
 SQUARE FEATURE PREDICATES. More...
 
bool square_istrappable (struct chunk *c, int y, int x)
 True if the square can hold a trap. More...
 
bool square_isobjectholding (struct chunk *c, int y, int x)
 True if the square can hold an object. More...
 
bool square_isrock (struct chunk *c, int y, int x)
 True if the square is a normal granite rock wall. More...
 
bool square_isgranite (struct chunk *c, int y, int x)
 True if the square is granite. More...
 
bool square_isperm (struct chunk *c, int y, int x)
 True if the square is a permanent wall. More...
 
bool square_ismagma (struct chunk *c, int y, int x)
 True if the square is a magma wall. More...
 
bool square_isquartz (struct chunk *c, int y, int x)
 True if the square is a quartz wall. More...
 
bool square_ismineral (struct chunk *c, int y, int x)
 True if the square is a mineral wall (magma/quartz). More...
 
bool square_hasgoldvein (struct chunk *c, int y, int x)
 
bool square_isrubble (struct chunk *c, int y, int x)
 True if the square is rubble. More...
 
bool square_issecretdoor (struct chunk *c, int y, int x)
 True if the square is a hidden secret door. More...
 
bool square_isopendoor (struct chunk *c, int y, int x)
 True if the square is an open door. More...
 
bool square_iscloseddoor (struct chunk *c, int y, int x)
 True if the square is a closed door (possibly locked or jammed). More...
 
bool square_islockeddoor (struct chunk *c, int y, int x)
 True if the square is a closed, locked door. More...
 
bool square_isbrokendoor (struct chunk *c, int y, int x)
 
bool square_isdoor (struct chunk *c, int y, int x)
 True if the square is a door. More...
 
bool square_isstairs (struct chunk *c, int y, int x)
 True if square is any stair. More...
 
bool square_isupstairs (struct chunk *c, int y, int x)
 True if square is an up stair. More...
 
bool square_isdownstairs (struct chunk *c, int y, int x)
 True if square is a down stair. More...
 
bool square_isshop (struct chunk *c, int y, int x)
 True if the square is a shop entrance. More...
 
bool square_isplayer (struct chunk *c, int y, int x)
 True if the square contains the player. More...
 
bool square_isoccupied (struct chunk *c, int y, int x)
 True if the square contains the player or a monster. More...
 
bool square_isknown (struct chunk *c, int y, int x)
 True if the the player knows the terrain of the square. More...
 
bool square_isnotknown (struct chunk *c, int y, int x)
 True if the the player's knowledge of the terrain of the square is wrong or missing. More...
 
bool square_ismark (struct chunk *c, int y, int x)
 SQUARE INFO PREDICATES. More...
 
bool square_isglow (struct chunk *c, int y, int x)
 True if the square is lit. More...
 
bool square_isvault (struct chunk *c, int y, int x)
 True if the square is part of a vault. More...
 
bool square_isroom (struct chunk *c, int y, int x)
 True if the square is part of a room. More...
 
bool square_isseen (struct chunk *c, int y, int x)
 True if the square has been seen by the player. More...
 
bool square_isview (struct chunk *c, int y, int x)
 True if the cave square is currently viewable by the player. More...
 
bool square_wasseen (struct chunk *c, int y, int x)
 True if the cave square was seen before the current update. More...
 
bool square_isfeel (struct chunk *c, int y, int x)
 True if cave square is a feeling trigger square. More...
 
bool square_istrap (struct chunk *c, int y, int x)
 True if the square has a known trap. More...
 
bool square_isinvis (struct chunk *c, int y, int x)
 True if the square has an unknown trap. More...
 
bool square_iswall_inner (struct chunk *c, int y, int x)
 True if cave square is an inner wall (generation) More...
 
bool square_iswall_outer (struct chunk *c, int y, int x)
 True if cave square is an outer wall (generation) More...
 
bool square_iswall_solid (struct chunk *c, int y, int x)
 True if cave square is a solid wall (generation) More...
 
bool square_ismon_restrict (struct chunk *c, int y, int x)
 True if cave square has monster restrictions (generation) More...
 
bool square_isno_teleport (struct chunk *c, int y, int x)
 True if cave square can't be teleported from by the player. More...
 
bool square_isno_map (struct chunk *c, int y, int x)
 True if cave square can't be magically mapped by the player. More...
 
bool square_isno_esp (struct chunk *c, int y, int x)
 True if cave square can't be detected by player ESP. More...
 
bool square_isproject (struct chunk *c, int y, int x)
 True if cave square is marked for projection processing. More...
 
bool square_isdtrap (struct chunk *c, int y, int x)
 True if cave square has been detected for traps. More...
 
bool square_isno_stairs (struct chunk *c, int y, int x)
 True if cave square is inappropriate to place stairs. More...
 
bool square_isopen (struct chunk *c, int y, int x)
 SQUARE BEHAVIOR PREDICATES. More...
 
bool square_isempty (struct chunk *c, int y, int x)
 True if the square is empty (an open square without any items). More...
 
bool square_isarrivable (struct chunk *c, int y, int x)
 True if the square is empty (an open square without any items). More...
 
bool square_canputitem (struct chunk *c, int y, int x)
 True if the square is an untrapped floor square without items. More...
 
bool square_isdiggable (struct chunk *c, int y, int x)
 True if the square can be dug: this includes rubble and non-permanent walls. More...
 
bool square_is_monster_walkable (struct chunk *c, int y, int x)
 True if a monster can walk through the tile. More...
 
bool square_ispassable (struct chunk *c, int y, int x)
 True if the square is passable by the player. More...
 
bool square_isprojectable (struct chunk *c, int y, int x)
 True if any projectable can pass through the square. More...
 
bool square_iswall (struct chunk *c, int y, int x)
 True if the square is a wall square (impedes the player). More...
 
bool square_isstrongwall (struct chunk *c, int y, int x)
 True if the square is a permanent wall or one of the "stronger" walls. More...
 
bool square_isbright (struct chunk *c, int y, int x)
 True if the cave square is internally lit. More...
 
bool square_isfiery (struct chunk *c, int y, int x)
 True if the cave square is fire-based. More...
 
bool square_isdamaging (struct chunk *c, int y, int x)
 True if the cave square can damage the inhabitant - only lava so far. More...
 
bool square_isnoflow (struct chunk *c, int y, int x)
 True if the cave square doesn't allow monster flow information. More...
 
bool square_isnoscent (struct chunk *c, int y, int x)
 True if the cave square doesn't carry player scent. More...
 
bool square_iswarded (struct chunk *c, int y, int x)
 
bool square_canward (struct chunk *c, int y, int x)
 
bool square_seemslikewall (struct chunk *c, int y, int x)
 
bool square_isinteresting (struct chunk *c, int y, int x)
 
bool square_isplayertrap (struct chunk *c, int y, int x)
 True if there is a player trap (known or unknown) in this square. More...
 
bool square_isvisibletrap (struct chunk *c, int y, int x)
 True if there is a visible trap in this square. More...
 
bool square_issecrettrap (struct chunk *c, int y, int x)
 True if the square is an unknown player trap (it will appear as a floor tile) More...
 
bool square_isdisabledtrap (struct chunk *c, int y, int x)
 True if the square is a known, disabled player trap. More...
 
bool square_isdisarmabletrap (struct chunk *c, int y, int x)
 True if the square is a known, disarmable player trap. More...
 
bool square_dtrap_edge (struct chunk *c, int y, int x)
 Checks if a square is at the (inner) edge of a trap detect area. More...
 
bool square_changeable (struct chunk *c, int y, int x)
 Determine if a given location may be "destroyed". More...
 
bool square_in_bounds (struct chunk *c, int y, int x)
 
bool square_in_bounds_fully (struct chunk *c, int y, int x)
 
bool square_isbelievedwall (struct chunk *c, int y, int x)
 Checks if a square is thought by the player to block projections. More...
 
bool square_suits_stairs_well (struct chunk *c, int y, int x)
 Checks if a square is in a cul-de-sac. More...
 
bool square_suits_stairs_ok (struct chunk *c, int y, int x)
 Checks if a square is in a corridor. More...
 
struct featuresquare_feat (struct chunk *c, int y, int x)
 OTHER SQUARE FUNCTIONS. More...
 
struct monstersquare_monster (struct chunk *c, int y, int x)
 Get a monster on the current level by its position. More...
 
struct objectsquare_object (struct chunk *c, int y, int x)
 Get the top object of a pile on the current level by its position. More...
 
struct trapsquare_trap (struct chunk *c, int y, int x)
 Get the first (and currently only) trap in a position on the current level. More...
 
bool square_holds_object (struct chunk *c, int y, int x, struct object *obj)
 Return true if the given object is on the floor at this grid. More...
 
void square_excise_object (struct chunk *c, int y, int x, struct object *obj)
 Excise an object from a floor pile, leaving it orphaned. More...
 
void square_excise_pile (struct chunk *c, int y, int x)
 Excise an entire floor pile. More...
 
void square_sense_pile (struct chunk *c, int y, int x)
 Sense the existence of objects on a grid in the current level. More...
 
void square_know_pile (struct chunk *c, int y, int x)
 Update the player's knowledge of the objects on a grid in the current level. More...
 
int square_num_walls_adjacent (struct chunk *c, int y, int x)
 Return how many cardinal directions around (x, y) contain walls. More...
 
int square_num_walls_diagonal (struct chunk *c, int y, int x)
 Return how many diagonal directions around (x, y) contain walls. More...
 
void square_set_feat (struct chunk *c, int y, int x, int feat)
 Set the terrain type for a square. More...
 
void square_add_trap (struct chunk *c, int y, int x)
 
void square_add_ward (struct chunk *c, int y, int x)
 
void square_add_stairs (struct chunk *c, int y, int x, int depth)
 
void square_add_door (struct chunk *c, int y, int x, bool closed)
 
void square_open_door (struct chunk *c, int y, int x)
 
void square_close_door (struct chunk *c, int y, int x)
 
void square_smash_door (struct chunk *c, int y, int x)
 
void square_lock_door (struct chunk *c, int y, int x, int power)
 
void square_unlock_door (struct chunk *c, int y, int x)
 
void square_destroy_door (struct chunk *c, int y, int x)
 
void square_show_trap (struct chunk *c, int y, int x, int type)
 
void square_destroy_trap (struct chunk *c, int y, int x)
 
void square_disable_trap (struct chunk *c, int y, int x)
 
void square_tunnel_wall (struct chunk *c, int y, int x)
 
void square_destroy_wall (struct chunk *c, int y, int x)
 
void square_destroy (struct chunk *c, int y, int x)
 
void square_earthquake (struct chunk *c, int y, int x)
 
void square_remove_ward (struct chunk *c, int y, int x)
 
void square_upgrade_mineral (struct chunk *c, int y, int x)
 Add visible treasure to a mineral square. More...
 
void square_destroy_rubble (struct chunk *c, int y, int x)
 
void square_force_floor (struct chunk *c, int y, int x)
 
int square_shopnum (struct chunk *c, int y, int x)
 
int square_digging (struct chunk *c, int y, int x)
 
const char * square_apparent_name (struct chunk *c, struct player *p, int y, int x)
 
void square_memorize (struct chunk *c, int y, int x)
 
void square_forget (struct chunk *c, int y, int x)
 
void square_mark (struct chunk *c, int y, int x)
 
void square_unmark (struct chunk *c, int y, int x)
 
int lookup_feat (const char *name)
 Find a terrain feature index by name. More...
 
void set_terrain (void)
 Set terrain constants to the indices from terrain.txt. More...
 
struct chunkcave_new (int height, int width)
 Allocate a new chunk of the world. More...
 
void cave_free (struct chunk *c)
 Free a chunk. More...
 
void list_object (struct chunk *c, struct object *obj)
 Enter an object in the list of objects for the current level/chunk. More...
 
void delist_object (struct chunk *c, struct object *obj)
 Remove an object from the list of objects for the current level/chunk. More...
 
void object_lists_check_integrity (struct chunk *c, struct chunk *c_k)
 Check that a pair of object lists are consistent and relate to locations of objects correctly. More...
 
void scatter (struct chunk *c, int *yp, int *xp, int y, int x, int d, bool need_los)
 Standard "find me a location" function, now with all legal outputs! More...
 
struct monstercave_monster (struct chunk *c, int idx)
 Get a monster on the current level by its index. More...
 
int cave_monster_max (struct chunk *c)
 The maximum number of monsters allowed in the level. More...
 
int cave_monster_count (struct chunk *c)
 The current number of monsters present on the level. More...
 
int count_feats (int *y, int *x, bool(*test)(struct chunk *c, int y, int x), bool under)
 Return the number of doors/traps around (or under) the character. More...
 
void prepare_next_level (struct chunk **c, struct player *p)
 Prepare the level the player is about to enter, either by generating or reloading. More...
 
bool is_quest (int level)
 Check if the given level is a quest level. More...
 
void cave_known (struct player *p)
 Make map features known, except wall/lava surrounded by wall/lava. More...
 

Variables

const s16b ddd [9]
 Global array for looping through the "keypad directions". More...
 
const s16b ddx [10]
 Global arrays for converting "keypad direction" into "offsets". More...
 
const s16b ddy [10]
 
const s16b ddx_ddd [9]
 Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]". More...
 
const s16b ddy_ddd [9]
 
const intdist_offsets_y [10]
 
const intdist_offsets_x [10]
 
const byte side_dirs [20][8]
 Given a central direction at position [dir #][0], return a series of directions radiating out on both sides from the central direction all the way back to its rear. More...
 
struct featuref_info
 
int FEAT_NONE
 
int FEAT_FLOOR
 
int FEAT_CLOSED
 
int FEAT_OPEN
 
int FEAT_BROKEN
 
int FEAT_LESS
 
int FEAT_MORE
 
int FEAT_SECRET
 
int FEAT_RUBBLE
 
int FEAT_PASS_RUBBLE
 
int FEAT_MAGMA
 
int FEAT_QUARTZ
 
int FEAT_MAGMA_K
 
int FEAT_QUARTZ_K
 
int FEAT_GRANITE
 
int FEAT_PERM
 
int FEAT_LAVA
 
struct chunkcave
 
struct chunk ** chunk_list
 list of pointers to saved chunks More...
 
u16b chunk_list_max
 current max actual chunk index More...
 

Detailed Description

Matters relating to the current dungeon level.

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

◆ sqinfo_copy

#define sqinfo_copy (   f1,
  f2 
)    flag_copy(f1, f2, SQUARE_SIZE)

Referenced by chunk_copy(), and chunk_write().

◆ sqinfo_diff

#define sqinfo_diff (   f1,
  f2 
)    flag_diff(f1, f2, SQUARE_SIZE)

◆ sqinfo_has

#define sqinfo_has (   f,
  flag 
)    flag_has_dbg(f, SQUARE_SIZE, flag, #f, #flag)

◆ sqinfo_inter

#define sqinfo_inter (   f1,
  f2 
)    flag_inter(f1, f2, SQUARE_SIZE)

◆ sqinfo_is_empty

#define sqinfo_is_empty (   f)    flag_is_empty(f, SQUARE_SIZE)

◆ sqinfo_is_equal

#define sqinfo_is_equal (   f1,
  f2 
)    flag_is_equal(f1, f2, SQUARE_SIZE)

◆ sqinfo_is_full

#define sqinfo_is_full (   f)    flag_is_full(f, SQUARE_SIZE)

◆ sqinfo_is_inter

#define sqinfo_is_inter (   f1,
  f2 
)    flag_is_inter(f1, f2, SQUARE_SIZE)

◆ sqinfo_is_subset

#define sqinfo_is_subset (   f1,
  f2 
)    flag_is_subset(f1, f2, SQUARE_SIZE)

◆ sqinfo_negate

#define sqinfo_negate (   f)    flag_negate(f, SQUARE_SIZE)

◆ sqinfo_next

#define sqinfo_next (   f,
  flag 
)    flag_next(f, SQUARE_SIZE, flag)

◆ sqinfo_off

#define sqinfo_off (   f,
  flag 
)    flag_off(f, SQUARE_SIZE, flag)

◆ sqinfo_on

#define sqinfo_on (   f,
  flag 
)    flag_on_dbg(f, SQUARE_SIZE, flag, #f, #flag)

◆ sqinfo_setall

#define sqinfo_setall (   f)    flag_setall(f, SQUARE_SIZE)

◆ sqinfo_union

#define sqinfo_union (   f1,
  f2 
)    flag_union(f1, f2, SQUARE_SIZE)

◆ sqinfo_wipe

#define sqinfo_wipe (   f)    flag_wipe(f, SQUARE_SIZE)

◆ SQUARE

#define SQUARE (   a,
 
)    SQUARE_##a,

◆ SQUARE_SIZE

#define SQUARE_SIZE   FLAG_SIZE(SQUARE_MAX)

◆ TF

#define TF (   a,
 
)    TF_##a,

◆ tf_has

#define tf_has (   f,
  flag 
)    flag_has_dbg(f, TF_SIZE, flag, #f, #flag)

◆ TF_SIZE

#define TF_SIZE   FLAG_SIZE(TF_MAX)

Referenced by parse_feat_flags().

Typedef Documentation

◆ square_predicate

typedef bool(* square_predicate) (struct chunk *c, int y, int x)

square_predicate is a function pointer which tests a given square to see if the predicate in question is true.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Square flags.

Enumerator
SQUARE_MAX 

◆ anonymous enum

anonymous enum

Terrain flags.

Enumerator
TF_MAX 

◆ grid_light_level

Enumerator
LIGHTING_LOS 
LIGHTING_TORCH 
LIGHTING_LIT 
LIGHTING_DARK 
LIGHTING_MAX 

Function Documentation

◆ cave_forget_flow()

void cave_forget_flow ( struct chunk c)

◆ cave_free()

void cave_free ( struct chunk c)

◆ cave_illuminate()

void cave_illuminate ( struct chunk c,
bool  daytime 
)

◆ cave_known()

void cave_known ( struct player p)

Make map features known, except wall/lava surrounded by wall/lava.

References cave, player::cave, ddx_ddd, ddy_ddd, square::feat, chunk::height, square_isbright(), square_isprojectable(), chunk::squares, and chunk::width.

Referenced by prepare_next_level().

◆ cave_monster()

struct monster* cave_monster ( struct chunk c,
int  idx 
)

◆ cave_monster_count()

int cave_monster_count ( struct chunk c)

The current number of monsters present on the level.

References chunk::mon_cnt.

Referenced by process_world().

◆ cave_monster_max()

int cave_monster_max ( struct chunk c)

◆ cave_new()

struct chunk* cave_new ( int  height,
int  width 
)

◆ cave_update_flow()

void cave_update_flow ( struct chunk c)

◆ count_feats()

int count_feats ( int y,
int x,
bool(*)(struct chunk *c, int y, int x)  test,
bool  under 
)

Return the number of doors/traps around (or under) the character.

References ddx_ddd, ddy_ddd, player::px, player::py, square_in_bounds_fully(), and square_isknown().

Referenced by do_cmd_close(), do_cmd_disarm(), do_cmd_open(), and effect_handler_RUBBLE().

◆ delist_object()

void delist_object ( struct chunk c,
struct object obj 
)

Remove an object from the list of objects for the current level/chunk.

This function is robust against delisting of unlisted objects.

References player::cave, NULL, chunk::objects, and object::oidx.

Referenced by become_aware(), delete_monster_idx(), floor_carry(), floor_carry_fail(), floor_object_for_use(), monster_turn_grab_objects(), player_pickup_aux(), player_pickup_gold(), project_o(), square_know_pile(), and uncurse_object().

◆ distance()

int distance ( int  y1,
int  x1,
int  y2,
int  x2 
)

Approximate distance between two points.

When either the X or Y component dwarfs the other component, this function is almost perfect, and otherwise, it tends to over-estimate about one grid per fifteen grids of distance.

Algorithm: hypot(dy,dx) = max(dy,dx) + min(dy,dx) / 2

References abs.

Referenced by add_monster_lights(), chance_of_missile_hit(), effect_handler_DESTRUCTION(), effect_handler_EARTHQUAKE(), effect_handler_TELEPORT(), effect_handler_WAKE(), generate_starburst_room(), get_injured_kin(), get_move_find_hiding(), get_move_find_safety(), get_move_flee(), pick_and_place_distant_monster(), project(), ranged_helper(), scatter(), summon_possible(), target_set_interactive(), and update_view_one().

◆ feat_is_bright()

bool feat_is_bright ( int  feat)

True if the feature is internally lit.

References f_info, flags, and tf_has.

Referenced by square_isbright(), and square_set_feat().

◆ feat_is_fiery()

bool feat_is_fiery ( int  feat)

True if the feature is internally lit.

References f_info, flags, and tf_has.

Referenced by square_isdamaging(), and square_isfiery().

◆ feat_is_floor()

bool feat_is_floor ( int  feat)

True is the feature is a floor.

References f_info, flags, and tf_has.

Referenced by generate_starburst_room(), grid_get_attr(), pick_trap(), and square_isfloor().

◆ feat_is_granite()

bool feat_is_granite ( int  feat)

True if the square is a granite wall.

References f_info, flags, and tf_has.

Referenced by square_isgranite().

◆ feat_is_magma()

bool feat_is_magma ( int  feat)

FEATURE PREDICATES.

These functions test a terrain feature index for the obviously described type. They are used in the square feature predicates below, and occasionally on their own True if the square is a magma wall.

References f_info, flags, and tf_has.

Referenced by grid_get_attr(), and square_ismagma().

◆ feat_is_monster_walkable()

bool feat_is_monster_walkable ( int  feat)

True if a monster can walk through the feature.

References f_info, flags, and tf_has.

Referenced by square_is_monster_walkable().

◆ feat_is_no_flow()

bool feat_is_no_flow ( int  feat)

True if the feature doesn't carry monster flow information.

References f_info, flags, and tf_has.

Referenced by square_isnoflow().

◆ feat_is_no_scent()

bool feat_is_no_scent ( int  feat)

True if the feature doesn't carry player scent.

References f_info, flags, and tf_has.

Referenced by square_isnoscent().

◆ feat_is_object_holding()

bool feat_is_object_holding ( int  feat)

True is the feature can hold an object.

References f_info, flags, and tf_has.

Referenced by square_isobjectholding().

◆ feat_is_passable()

bool feat_is_passable ( int  feat)

True if the feature is passable by the player.

References f_info, flags, and tf_has.

Referenced by generate_starburst_room(), and square_ispassable().

◆ feat_is_projectable()

bool feat_is_projectable ( int  feat)

True if any projectable can pass through the feature.

References f_info, flags, and tf_has.

Referenced by square_isprojectable().

◆ feat_is_quartz()

bool feat_is_quartz ( int  feat)

True if the square is a quartz wall.

References f_info, flags, and tf_has.

Referenced by grid_get_attr(), and square_isquartz().

◆ feat_is_shop()

bool feat_is_shop ( int  feat)

True if the feature is a shop entrance.

References f_info, flags, and tf_has.

Referenced by build_store(), and square_isshop().

◆ feat_is_smooth()

bool feat_is_smooth ( int  feat)

True if the feature should have smooth boundaries (for dungeon generation).

References f_info, flags, and tf_has.

Referenced by generate_starburst_room().

◆ feat_is_torch()

bool feat_is_torch ( int  feat)

True if the feature can be lit by light sources.

References f_info, flags, and tf_has.

Referenced by grid_get_attr().

◆ feat_is_trap_holding()

bool feat_is_trap_holding ( int  feat)

True is the feature can hold a trap.

References f_info, flags, and tf_has.

Referenced by pick_trap(), and square_istrappable().

◆ feat_is_treasure()

bool feat_is_treasure ( int  feat)

True if the square is a mineral wall with treasure (magma/quartz).

References f_info, flags, and tf_has.

Referenced by grid_get_attr().

◆ feat_is_wall()

bool feat_is_wall ( int  feat)

True is the feature is a solid wall (not rubble).

References f_info, flags, and tf_has.

Referenced by grid_get_attr(), square_num_walls_adjacent(), and square_num_walls_diagonal().

◆ is_quest()

bool is_quest ( int  level)

◆ light_room()

void light_room ( int  y1,
int  x1,
bool  light 
)

◆ list_object()

void list_object ( struct chunk c,
struct object obj 
)

Enter an object in the list of objects for the current level/chunk.

This function is robust against listing of duplicates or non-objects

References player::cave, i, mem_realloc(), NULL, chunk::obj_max, OBJECT_LIST_INCR, chunk::objects, and object::oidx.

Referenced by floor_carry(), mon_create_mimicked_object(), monster_carry(), place_gold(), and place_object().

◆ lookup_feat()

int lookup_feat ( const char *  name)

Find a terrain feature index by name.

References angband_constants::f_max, i, feature::name, quit_fmt(), streq, and z_info.

Referenced by map_info(), parse_prefs_feat(), set_terrain(), and square_apparent_name().

◆ los()

bool los ( struct chunk c,
int  y1,
int  x1,
int  y2,
int  x2 
)

A simple, fast, integer-based line-of-sight algorithm.

By Joseph Hall, 4116 Brewster Drive, Raleigh NC 27606. Email to jnh@e.nosp@m.cemw.nosp@m.l.ncs.nosp@m.u.ed.nosp@m.u.

This function returns true if a "line of sight" can be traced from the center of the grid (x1,y1) to the center of the grid (x2,y2), with all of the grids along this path (except for the endpoints) being non-wall grids. Actually, the "chess knight move" situation is handled by some special case code which allows the grid diagonally next to the player to be obstructed, because this yields better gameplay semantics. This algorithm is totally reflexive, except for "knight move" situations.

Because this function uses (short) ints for all calculations, overflow may occur if dx and dy exceed 90.

Once all the degenerate cases are eliminated, we determine the "slope" ("m"), and we use special "fixed point" mathematics in which we use a special "fractional component" for one of the two location components ("qy" or "qx"), which, along with the slope itself, are "scaled" by a scale factor equal to "abs(dy*dx*2)" to keep the math simple. Then we simply travel from start to finish along the longer axis, starting at the border between the first and second tiles (where the y offset is thus half the slope), using slope and the fractional component to see when motion along the shorter axis is necessary. Since we assume that vision is not blocked by "brushing" the corner of any grid, we must do some special checks to avoid testing grids which are "brushed" but not actually "entered".

Angband three different "line of sight" type concepts, including this function (which is used almost nowhere), the "project()" method (which is used for determining the paths of projectables and spells and such), and the "update_view()" concept (which is used to determine which grids are "viewable" by the player, which is used for many things, such as determining which grids are illuminated by the player's torch, and which grids and monsters can be "seen" by the player, etc).

References ABS, f1, f2, and square_isprojectable().

Referenced by add_monster_lights(), can_call_monster(), drop_find_grid(), get_injured_kin(), monster_list_collect(), object_list_collect(), object_list_format_name(), project(), scatter(), summon_possible(), and update_view_one().

◆ map_info()

void map_info ( unsigned  y,
unsigned  x,
struct grid_data g 
)

This function takes a grid location (x, y) and extracts information the player is allowed to know about it, filling in the grid_data structure passed in 'g'.

The information filled in is as follows:

  • g->f_idx is filled in with the terrain's feature type, or FEAT_NONE if the player doesn't know anything about the grid. The function makes use of the "mimic" field in terrain in order to allow one feature to look like another (hiding secret doors, invisible traps, etc). This will return the terrain type the player "Knows" about, not necessarily the real terrain.
  • g->m_idx is set to the monster index, or 0 if there is none (or the player doesn't know it).
  • g->first_kind is set to the object_kind of the first object in a grid that the player knows about, or NULL for no objects.
  • g->muliple_objects is true if there is more than one object in the grid that the player knows and cares about (to facilitate any special floor stack symbol that might be used).
  • g->in_view is true if the player can currently see the grid - this can be used to indicate field-of-view, such as through the OPT(player, view_bright_light) option.
  • g->lighting is set to indicate the lighting level for the grid: LIGHTING_DARK for unlit grids, LIGHTING_LIT for inherently light grids (lit rooms, etc), LIGHTING_TORCH for grids lit by the player's light source, and LIGHTING_LOS for grids in the player's line of sight. Note that lighting is always LIGHTING_LIT for known "interesting" grids like walls.
  • g->is_player is true if the player is on the given grid.
  • g->hallucinate is true if the player is hallucinating something "strange" for this grid - this should pick a random monster to show if the m_idx is non-zero, and a random object if first_kind is non-zero.

NOTES: This is called pretty frequently, whenever a grid on the map display needs updating, so don't overcomplicate it.

Terrain is remembered separately from objects and monsters, so can be shown even when the player can't "see" it. This leads to things like doors out of the player's view still change from closed to open and so on.

TODO: Hallucination is currently disabled (it was a display-level hack before, and we need it to be a knowledge-level hack). The idea is that objects may turn into different objects, monsters into different monsters, and terrain may be objects, monsters, or stay the same.

References cave, player::cave, cave_monster(), grid_data::f_idx, f_info, square::feat, FEAT_NONE, FEAT_PASS_RUBBLE, FEAT_PERM, grid_data::first_kind, trap::flags, grid_data::hallucinate, chunk::height, ignore_known_item_ok(), grid_data::in_view, grid_data::is_player, k_info, object::kind, grid_data::lighting, LIGHTING_DARK, LIGHTING_LIT, LIGHTING_LOS, LIGHTING_TORCH, lookup_feat(), grid_data::m_idx, feature::mimic, square::mon, chunk::mon_max, monster_is_visible(), grid_data::multiple_objects, trap::next, object::next, NULL, one_in_, OPT, square_isglow(), square_isknown(), square_isseen(), square_istrap(), square_memorize(), square_object(), chunk::squares, player::timed, trap::timeout, grid_data::trap, square::trap, trf_has, unknown_gold_kind, unknown_item_kind, grid_data::unseen_money, grid_data::unseen_object, and chunk::width.

Referenced by display_map(), is_unknown(), prt_map(), prt_map_aux(), and update_maps().

◆ no_light()

bool no_light ( void  )

◆ object_lists_check_integrity()

void object_lists_check_integrity ( struct chunk c,
struct chunk c_k 
)

Check that a pair of object lists are consistent and relate to locations of objects correctly.

References i, object::ix, object::iy, object::known, square::obj, chunk::obj_max, chunk::objects, object::oidx, pile_contains(), player_upkeep::playing, chunk::squares, and player::upkeep.

Referenced by square_know_pile().

◆ prepare_next_level()

void prepare_next_level ( struct chunk **  c,
struct player p 
)

Prepare the level the player is about to enter, either by generating or reloading.

Parameters
cis the level we're going to end up with, in practice the global cave
pis the current player struct, in practice the global player

References object::artifact, cave, player::cave, cave_clear(), cave_free(), cave_generate(), cave_known(), cave_store(), character_dungeon, chunk_find_name(), chunk_list_remove(), compact_monsters(), artifact::created, player::depth, format(), get_min_level_size(), history_lose_artifact(), i, object::known, level_by_depth(), level::name, object::next, NULL, chunk::obj_max, chunk::objects, OPT, player_place(), player::px, player::py, restore_monsters(), sanitize_player_loc(), and square_object().

Referenced by run_game_loop(), start_game(), test_magic_missile(), and test_newgame().

◆ scatter()

void scatter ( struct chunk c,
int yp,
int xp,
int  y,
int  x,
int  d,
bool  need_los 
)

Standard "find me a location" function, now with all legal outputs!

Obtains a legal location within the given distance of the initial location, and with "los()" from the source to destination location.

This function is often called from inside a loop which searches for locations while increasing the "d" distance.

need_los determines whether line of sight is needed

References distance(), los(), rand_spread, and square_in_bounds_fully().

Referenced by build_quest_stairs(), do_cmd_wiz_named(), multiply_monster(), place_friends(), summon_specific(), and vault_monsters().

◆ set_terrain()

void set_terrain ( void  )

◆ square_add_door()

void square_add_door ( struct chunk c,
int  y,
int  x,
bool  closed 
)

◆ square_add_stairs()

void square_add_stairs ( struct chunk c,
int  y,
int  x,
int  depth 
)

◆ square_add_trap()

void square_add_trap ( struct chunk c,
int  y,
int  x 
)

◆ square_add_ward()

void square_add_ward ( struct chunk c,
int  y,
int  x 
)

◆ square_apparent_name()

const char* square_apparent_name ( struct chunk c,
struct player p,
int  y,
int  x 
)

◆ square_canputitem()

bool square_canputitem ( struct chunk c,
int  y,
int  x 
)

True if the square is an untrapped floor square without items.

References square_isfloor(), square_isplayertrap(), square_iswarded(), and square_object().

Referenced by drop_find_grid(), place_gold(), place_object(), place_random_stairs(), and vault_objects().

◆ square_canward()

bool square_canward ( struct chunk c,
int  y,
int  x 
)

References square_isfloor().

Referenced by effect_handler_RUNE().

◆ square_changeable()

bool square_changeable ( struct chunk c,
int  y,
int  x 
)

Determine if a given location may be "destroyed".

Used by destruction spells, and for placing stairs, etc.

References object::artifact, object::next, square_isperm(), square_isshop(), square_isstairs(), and square_object().

Referenced by build_quest_stairs(), and effect_handler_EARTHQUAKE().

◆ square_close_door()

void square_close_door ( struct chunk c,
int  y,
int  x 
)

References FEAT_CLOSED, and square_set_feat().

Referenced by do_cmd_close_aux().

◆ square_destroy()

void square_destroy ( struct chunk c,
int  y,
int  x 
)

◆ square_destroy_door()

void square_destroy_door ( struct chunk c,
int  y,
int  x 
)

◆ square_destroy_rubble()

void square_destroy_rubble ( struct chunk c,
int  y,
int  x 
)

◆ square_destroy_trap()

void square_destroy_trap ( struct chunk c,
int  y,
int  x 
)

◆ square_destroy_wall()

void square_destroy_wall ( struct chunk c,
int  y,
int  x 
)

◆ square_digging()

int square_digging ( struct chunk c,
int  y,
int  x 
)

◆ square_disable_trap()

void square_disable_trap ( struct chunk c,
int  y,
int  x 
)

◆ square_dtrap_edge()

bool square_dtrap_edge ( struct chunk c,
int  y,
int  x 
)

Checks if a square is at the (inner) edge of a trap detect area.

References square_in_bounds_fully(), and square_isdtrap().

Referenced by prt_dtrap().

◆ square_earthquake()

void square_earthquake ( struct chunk c,
int  y,
int  x 
)

◆ square_excise_object()

void square_excise_object ( struct chunk c,
int  y,
int  x,
struct object obj 
)

◆ square_excise_pile()

void square_excise_pile ( struct chunk c,
int  y,
int  x 
)

◆ square_feat()

struct feature* square_feat ( struct chunk c,
int  y,
int  x 
)

OTHER SQUARE FUNCTIONS.

Below are various square-specific functions which are not predicates

References f_info, square::feat, square_in_bounds(), and chunk::squares.

Referenced by cave_generate(), get_move_find_safety(), monster_hates_grid(), move_player(), player_take_terrain_damage(), and push_object().

◆ square_force_floor()

void square_force_floor ( struct chunk c,
int  y,
int  x 
)

References FEAT_FLOOR, and square_set_feat().

Referenced by push_object().

◆ square_forget()

void square_forget ( struct chunk c,
int  y,
int  x 
)

◆ square_hasgoldvein()

bool square_hasgoldvein ( struct chunk c,
int  y,
int  x 
)

◆ square_holds_object()

bool square_holds_object ( struct chunk c,
int  y,
int  x,
struct object obj 
)

Return true if the given object is on the floor at this grid.

References pile_contains(), square_in_bounds(), and square_object().

Referenced by item_is_available(), object_see(), player_know_object(), and square_know_pile().

◆ square_in_bounds()

bool square_in_bounds ( struct chunk c,
int  y,
int  x 
)

References chunk::height, and chunk::width.

Referenced by build_room_of_chambers(), build_streamer(), build_tunnel(), cave_room_aux(), delete_monster(), delete_monster_idx(), effect_handler_MAP_AREA(), generate_starburst_room(), get_move_advance(), get_move_flee(), make_noise(), next_to_corr(), place_gold(), place_monster(), place_new_monster_one(), place_object(), possible_doorway(), project(), prt_map(), prt_map_aux(), scan_distant_floor(), scan_floor(), see_wall(), spread_monsters(), square_excise_object(), square_excise_pile(), square_feat(), square_holds_object(), square_is_monster_walkable(), square_isbright(), square_isdamaging(), square_isdtrap(), square_isfeel(), square_isfiery(), square_isglow(), square_isinvis(), square_ismark(), square_ismon_restrict(), square_isno_esp(), square_isno_map(), square_isno_stairs(), square_isno_teleport(), square_isnoflow(), square_isnoscent(), square_ispassable(), square_isproject(), square_isprojectable(), square_isroom(), square_isseen(), square_isstrongwall(), square_istrap(), square_isvault(), square_isview(), square_iswall(), square_iswall_inner(), square_iswall_outer(), square_iswall_solid(), square_monster(), square_num_walls_adjacent(), square_num_walls_diagonal(), square_object(), square_remove_all_traps(), square_remove_trap(), square_set_feat(), square_set_trap_timeout(), square_trap(), square_wasseen(), summon_possible(), target_set_interactive_aux(), try_door(), update_scent(), update_view_one(), vault_monsters(), and wiz_light().

◆ square_in_bounds_fully()

bool square_in_bounds_fully ( struct chunk c,
int  y,
int  x 
)

◆ square_is_monster_walkable()

bool square_is_monster_walkable ( struct chunk c,
int  y,
int  x 
)

True if a monster can walk through the tile.

This is needed for polymorphing. A monster may be on a feature that isn't an empty space, causing problems when it is replaced with a new monster.

References square::feat, feat_is_monster_walkable(), square_in_bounds(), and chunk::squares.

Referenced by place_new_monster_one().

◆ square_isarrivable()

bool square_isarrivable ( struct chunk c,
int  y,
int  x 
)

True if the square is empty (an open square without any items).

References square::mon, square_isfloor(), square_isplayertrap(), square_isstairs(), and chunk::squares.

Referenced by sanitize_player_loc().

◆ square_isbelievedwall()

bool square_isbelievedwall ( struct chunk c,
int  y,
int  x 
)

Checks if a square is thought by the player to block projections.

References player::cave, square_in_bounds_fully(), square_isknown(), and square_isprojectable().

Referenced by project_path().

◆ square_isbright()

bool square_isbright ( struct chunk c,
int  y,
int  x 
)

◆ square_isbrokendoor()

bool square_isbrokendoor ( struct chunk c,
int  y,
int  x 
)

◆ square_iscloseddoor()

bool square_iscloseddoor ( struct chunk c,
int  y,
int  x 
)

◆ square_isdamaging()

bool square_isdamaging ( struct chunk c,
int  y,
int  x 
)

True if the cave square can damage the inhabitant - only lava so far.

References square::feat, feat_is_fiery(), square_in_bounds(), and chunk::squares.

Referenced by get_move_find_safety(), is_valid_pf(), monster_hates_grid(), and move_player().

◆ square_isdiggable()

bool square_isdiggable ( struct chunk c,
int  y,
int  x 
)

True if the square can be dug: this includes rubble and non-permanent walls.

References square_ismineral(), square_isrubble(), and square_issecretdoor().

Referenced by context_menu_cave(), do_cmd_alter_aux(), do_cmd_tunnel_test(), square_digging(), and twall().

◆ square_isdisabledtrap()

bool square_isdisabledtrap ( struct chunk c,
int  y,
int  x 
)

True if the square is a known, disabled player trap.

References square_isvisibletrap(), and square_trap_timeout().

Referenced by square_isdisarmabletrap().

◆ square_isdisarmabletrap()

bool square_isdisarmabletrap ( struct chunk c,
int  y,
int  x 
)

◆ square_isdoor()

bool square_isdoor ( struct chunk c,
int  y,
int  x 
)

◆ square_isdownstairs()

bool square_isdownstairs ( struct chunk c,
int  y,
int  x 
)

True if square is a down stair.

References f_info, square::feat, flags, chunk::squares, and tf_has.

Referenced by context_menu_player(), do_cmd_go_down(), labyrinth_gen(), and textui_process_click().

◆ square_isdtrap()

bool square_isdtrap ( struct chunk c,
int  y,
int  x 
)

True if cave square has been detected for traps.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by move_player(), prt_dtrap(), and square_dtrap_edge().

◆ square_isempty()

bool square_isempty ( struct chunk c,
int  y,
int  x 
)

◆ square_isfeel()

bool square_isfeel ( struct chunk c,
int  y,
int  x 
)

True if cave square is a feeling trigger square.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by place_feeling(), and update_one().

◆ square_isfiery()

bool square_isfiery ( struct chunk c,
int  y,
int  x 
)

◆ square_isfloor()

bool square_isfloor ( struct chunk c,
int  y,
int  x 
)

SQUARE FEATURE PREDICATES.

These functions are used to figure out what kind of square something is, via c->squares[y][x].feat. All direct testing of c->squares[y][x].feat should be rewritten in terms of these functions.

It's often better to use square behavior predicates (written in terms of these functions) instead of these functions directly. For instance, square_isrock() will return false for a secret door, even though it will behave like a rock wall until the player determines it's a door.

Use functions like square_isdiggable, square_iswall, etc. in these cases. True if the square is normal open floor.

References square::feat, feat_is_floor(), and chunk::squares.

Referenced by build_room_of_chambers(), cave_illuminate(), cave_unlight(), count_adj_walls(), drop_find_grid(), effect_handler_CREATE_STAIRS(), effect_handler_MAP_AREA(), generate_starburst_room(), get_debug_command(), next_to_corr(), project_feature_handler_FIRE(), project_feature_handler_MAKE_DOOR(), project_feature_handler_PLASMA(), square_canputitem(), square_canward(), square_isarrivable(), square_isopen(), town_gen_layout(), and wiz_light().

◆ square_isglow()

bool square_isglow ( struct chunk c,
int  y,
int  x 
)

True if the square is lit.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by become_viewable(), map_info(), and update_view().

◆ square_isgranite()

bool square_isgranite ( struct chunk c,
int  y,
int  x 
)

True if the square is granite.

References square::feat, feat_is_granite(), and chunk::squares.

Referenced by build_tunnel().

◆ square_isinteresting()

bool square_isinteresting ( struct chunk c,
int  y,
int  x 
)

◆ square_isinvis()

bool square_isinvis ( struct chunk c,
int  y,
int  x 
)

True if the square has an unknown trap.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

◆ square_isknown()

bool square_isknown ( struct chunk c,
int  y,
int  x 
)

◆ square_islockeddoor()

bool square_islockeddoor ( struct chunk c,
int  y,
int  x 
)

◆ square_ismagma()

bool square_ismagma ( struct chunk c,
int  y,
int  x 
)

True if the square is a magma wall.

References square::feat, feat_is_magma(), and chunk::squares.

Referenced by project_feature_handler_KILL_WALL(), and square_ismineral().

◆ square_ismark()

bool square_ismark ( struct chunk c,
int  y,
int  x 
)

SQUARE INFO PREDICATES.

These functions tell whether a square is marked with one of the SQUARE_* flags. These flags are mostly used to mark a square with some information about its location or status. True if the square is marked

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by wiz_light().

◆ square_ismineral()

bool square_ismineral ( struct chunk c,
int  y,
int  x 
)

True if the square is a mineral wall (magma/quartz).

References square_ismagma(), square_isquartz(), and square_isrock().

Referenced by square_isdiggable(), and square_isstrongwall().

◆ square_ismon_restrict()

bool square_ismon_restrict ( struct chunk c,
int  y,
int  x 
)

True if cave square has monster restrictions (generation)

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by pick_and_place_distant_monster().

◆ square_isno_esp()

bool square_isno_esp ( struct chunk c,
int  y,
int  x 
)

True if cave square can't be detected by player ESP.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by update_mon().

◆ square_isno_map()

bool square_isno_map ( struct chunk c,
int  y,
int  x 
)

True if cave square can't be magically mapped by the player.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by effect_handler_MAP_AREA().

◆ square_isno_stairs()

bool square_isno_stairs ( struct chunk c,
int  y,
int  x 
)

True if cave square is inappropriate to place stairs.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by alloc_stairs(), find_start(), square_suits_stairs_ok(), and square_suits_stairs_well().

◆ square_isno_teleport()

bool square_isno_teleport ( struct chunk c,
int  y,
int  x 
)

True if cave square can't be teleported from by the player.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by effect_handler_TELEPORT().

◆ square_isnoflow()

bool square_isnoflow ( struct chunk c,
int  y,
int  x 
)

True if the cave square doesn't allow monster flow information.

References square::feat, feat_is_no_flow(), square_in_bounds(), and chunk::squares.

Referenced by make_noise().

◆ square_isnoscent()

bool square_isnoscent ( struct chunk c,
int  y,
int  x 
)

True if the cave square doesn't carry player scent.

References square::feat, feat_is_no_scent(), square_in_bounds(), and chunk::squares.

Referenced by update_scent().

◆ square_isnotknown()

bool square_isnotknown ( struct chunk c,
int  y,
int  x 
)

True if the the player's knowledge of the terrain of the square is wrong or missing.

References cave, player::cave, square::feat, NULL, and chunk::squares.

Referenced by effect_handler_DETECT_DOORS(), effect_handler_MAP_AREA(), and wiz_light().

◆ square_isobjectholding()

bool square_isobjectholding ( struct chunk c,
int  y,
int  x 
)

True if the square can hold an object.

References square::feat, feat_is_object_holding(), and chunk::squares.

Referenced by floor_carry().

◆ square_isoccupied()

bool square_isoccupied ( struct chunk c,
int  y,
int  x 
)

True if the square contains the player or a monster.

References square::mon, chunk::squares, and true.

Referenced by project_feature_handler_COLD(), and project_feature_handler_ICE().

◆ square_isopen()

bool square_isopen ( struct chunk c,
int  y,
int  x 
)

SQUARE BEHAVIOR PREDICATES.

These functions define how a given square behaves, e.g. whether it is passable by the player, whether it is diggable, contains items, etc.

These functions use the SQUARE FEATURE PREDICATES (among other info) to make the determination. True if the square is open (a floor square not occupied by a monster).

References square::mon, square_isfloor(), and chunk::squares.

Referenced by lab_is_tunnel(), place_friends(), and square_isempty().

◆ square_isopendoor()

bool square_isopendoor ( struct chunk c,
int  y,
int  x 
)

True if the square is an open door.

References f_info, square::feat, feature::flags, chunk::squares, and tf_has.

Referenced by context_menu_cave(), do_cmd_close(), and do_cmd_close_test().

◆ square_ispassable()

bool square_ispassable ( struct chunk c,
int  y,
int  x 
)

◆ square_isperm()

bool square_isperm ( struct chunk c,
int  y,
int  x 
)

◆ square_isplayer()

bool square_isplayer ( struct chunk c,
int  y,
int  x 
)

True if the square contains the player.

References square::mon, chunk::squares, and true.

Referenced by monster_turn(), project_feature_handler_MAKE_DOOR(), and project_p().

◆ square_isplayertrap()

bool square_isplayertrap ( struct chunk c,
int  y,
int  x 
)

◆ square_isproject()

bool square_isproject ( struct chunk c,
int  y,
int  x 
)

True if cave square is marked for projection processing.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by project().

◆ square_isprojectable()

bool square_isprojectable ( struct chunk c,
int  y,
int  x 
)

◆ square_isquartz()

bool square_isquartz ( struct chunk c,
int  y,
int  x 
)

True if the square is a quartz wall.

References square::feat, feat_is_quartz(), and chunk::squares.

Referenced by project_feature_handler_KILL_WALL(), and square_ismineral().

◆ square_isrock()

bool square_isrock ( struct chunk c,
int  y,
int  x 
)

True if the square is a normal granite rock wall.

References f_info, square::feat, feature::flags, chunk::squares, and tf_has.

Referenced by build_streamer(), init_cavern(), and square_ismineral().

◆ square_isroom()

bool square_isroom ( struct chunk c,
int  y,
int  x 
)

True if the square is part of a room.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by alloc_object(), build_tunnel(), cave_room_aux(), get_move(), next_to_corr(), and try_door().

◆ square_isrubble()

bool square_isrubble ( struct chunk c,
int  y,
int  x 
)

◆ square_issecretdoor()

bool square_issecretdoor ( struct chunk c,
int  y,
int  x 
)

True if the square is a hidden secret door.

These squares appear as if they were granite–when detected a secret door is replaced by a closed door.

References f_info, square::feat, feature::flags, chunk::squares, and tf_has.

Referenced by effect_handler_DETECT_DOORS(), monster_turn_can_move(), project_feature_handler_KILL_TRAP(), search(), and square_isdiggable().

◆ square_issecrettrap()

bool square_issecrettrap ( struct chunk c,
int  y,
int  x 
)

True if the square is an unknown player trap (it will appear as a floor tile)

References square_isplayertrap(), and square_isvisibletrap().

Referenced by move_player(), and square_note_spot().

◆ square_isseen()

bool square_isseen ( struct chunk c,
int  y,
int  x 
)

◆ square_isshop()

bool square_isshop ( struct chunk c,
int  y,
int  x 
)

◆ square_isstairs()

bool square_isstairs ( struct chunk c,
int  y,
int  x 
)

◆ square_isstrongwall()

bool square_isstrongwall ( struct chunk c,
int  y,
int  x 
)

True if the square is a permanent wall or one of the "stronger" walls.

The stronger walls are granite, magma and quartz. This excludes things like secret doors and rubble.

References square_in_bounds(), square_ismineral(), and square_isperm().

Referenced by possible_doorway(), and try_door().

◆ square_istrap()

bool square_istrap ( struct chunk c,
int  y,
int  x 
)

◆ square_istrappable()

bool square_istrappable ( struct chunk c,
int  y,
int  x 
)

True if the square can hold a trap.

References square::feat, feat_is_trap_holding(), and chunk::squares.

Referenced by square_player_trap_allowed().

◆ square_isupstairs()

bool square_isupstairs ( struct chunk c,
int  y,
int  x 
)

True if square is an up stair.

References f_info, square::feat, flags, chunk::squares, and tf_has.

Referenced by context_menu_player(), do_cmd_go_up(), labyrinth_gen(), and textui_process_click().

◆ square_isvault()

bool square_isvault ( struct chunk c,
int  y,
int  x 
)

True if the square is part of a vault.

This doesn't say what kind of square it is, just that it is part of a vault.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by alloc_stairs(), effect_handler_TELEPORT(), find_start(), generate_starburst_room(), join_region(), sanitize_player_loc(), square_suits_stairs_ok(), and square_suits_stairs_well().

◆ square_isview()

bool square_isview ( struct chunk c,
int  y,
int  x 
)

◆ square_isvisibletrap()

bool square_isvisibletrap ( struct chunk c,
int  y,
int  x 
)

◆ square_iswall()

bool square_iswall ( struct chunk c,
int  y,
int  x 
)

True if the square is a wall square (impedes the player).

This function is the logical negation of square_isprojectable().

References square_in_bounds(), and square_isprojectable().

Referenced by become_viewable(), build_quest_stairs(), monster_turn_can_move(), path_analyse(), place_feeling(), project_feature_handler_KILL_WALL(), and update_view_one().

◆ square_iswall_inner()

bool square_iswall_inner ( struct chunk c,
int  y,
int  x 
)

True if cave square is an inner wall (generation)

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by build_room_of_chambers(), and make_chamber().

◆ square_iswall_outer()

bool square_iswall_outer ( struct chunk c,
int  y,
int  x 
)

True if cave square is an outer wall (generation)

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by build_room_of_chambers(), and make_inner_chamber_wall().

◆ square_iswall_solid()

bool square_iswall_solid ( struct chunk c,
int  y,
int  x 
)

True if cave square is a solid wall (generation)

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by build_room_of_chambers(), and make_inner_chamber_wall().

◆ square_iswarded()

bool square_iswarded ( struct chunk c,
int  y,
int  x 
)

◆ square_know_pile()

void square_know_pile ( struct chunk c,
int  y,
int  x 
)

◆ square_light_spot()

void square_light_spot ( struct chunk c,
int  y,
int  x 
)

◆ square_lock_door()

void square_lock_door ( struct chunk c,
int  y,
int  x,
int  power 
)

◆ square_mark()

void square_mark ( struct chunk c,
int  y,
int  x 
)

References square::info, sqinfo_on, and chunk::squares.

Referenced by wiz_light().

◆ square_memorize()

void square_memorize ( struct chunk c,
int  y,
int  x 
)

◆ square_monster()

struct monster* square_monster ( struct chunk c,
int  y,
int  x 
)

◆ square_note_spot()

void square_note_spot ( struct chunk c,
int  y,
int  x 
)

Memorize interesting viewable object/features in the given grid.

This function should only be called on "legal" grids.

This function will memorize the object and/or feature in the given grid, if they are (1) see-able and (2) interesting. Note that all objects are interesting, all terrain features except floors (and invisible traps) are interesting, and floors (and invisible traps) are interesting sometimes (depending on various options involving the illumination of floor grids).

The automatic memorization of all objects and non-floor terrain features as soon as they are displayed allows incredible amounts of optimization in various places, especially "map_info()" and this function itself.

Note that the memorization of objects is completely separate from the memorization of terrain features, preventing annoying floor memorization when a detected object is picked up from a dark floor, and object memorization when an object is dropped into a floor grid which is memorized but out-of-sight.

This function should be called every time the "memorization" of a grid (or the object in a grid) is called into question, such as when an object is created in a grid, when a terrain feature "changes" from "floor" to "non-floor", and when any grid becomes "see-able" for any reason.

This function is called primarily from the "update_view()" function, for each grid which becomes newly "see-able".

References cave, square_isknown(), square_issecrettrap(), square_isseen(), square_know_pile(), square_memorize(), and square_reveal_trap().

Referenced by become_aware(), floor_carry(), monster_turn_grab_objects(), project_o(), square_set_feat(), square_verify_trap(), uncurse_object(), and update_one().

◆ square_num_walls_adjacent()

int square_num_walls_adjacent ( struct chunk c,
int  y,
int  x 
)

Return how many cardinal directions around (x, y) contain walls.

Parameters
ccurrent chunk
yco-ordinates
xco-ordinates
Returns
the number of walls

References square::feat, feat_is_wall(), square_in_bounds(), and chunk::squares.

Referenced by alloc_stairs(), find_start(), square_suits_stairs_ok(), and square_suits_stairs_well().

◆ square_num_walls_diagonal()

int square_num_walls_diagonal ( struct chunk c,
int  y,
int  x 
)

Return how many diagonal directions around (x, y) contain walls.

Parameters
ccurrent chunk
yco-ordinates
xco-ordinates
Returns
the number of walls

References square::feat, feat_is_wall(), square_in_bounds(), and chunk::squares.

Referenced by alloc_stairs(), find_start(), square_suits_stairs_ok(), and square_suits_stairs_well().

◆ square_object()

struct object* square_object ( struct chunk c,
int  y,
int  x 
)

◆ square_open_door()

void square_open_door ( struct chunk c,
int  y,
int  x 
)

◆ square_remove_ward()

void square_remove_ward ( struct chunk c,
int  y,
int  x 
)

◆ square_seemslikewall()

bool square_seemslikewall ( struct chunk c,
int  y,
int  x 
)

◆ square_sense_pile()

void square_sense_pile ( struct chunk c,
int  y,
int  x 
)

Sense the existence of objects on a grid in the current level.

References cave, object::next, object_sense(), and square_object().

Referenced by effect_handler_SENSE_OBJECTS(), and wiz_light().

◆ square_set_feat()

void square_set_feat ( struct chunk c,
int  y,
int  x,
int  feat 
)

◆ square_shopnum()

int square_shopnum ( struct chunk c,
int  y,
int  x 
)

◆ square_show_trap()

void square_show_trap ( struct chunk c,
int  y,
int  x,
int  type 
)

◆ square_smash_door()

void square_smash_door ( struct chunk c,
int  y,
int  x 
)

◆ square_suits_stairs_ok()

bool square_suits_stairs_ok ( struct chunk c,
int  y,
int  x 
)

◆ square_suits_stairs_well()

bool square_suits_stairs_well ( struct chunk c,
int  y,
int  x 
)

◆ square_trap()

struct trap* square_trap ( struct chunk c,
int  y,
int  x 
)

◆ square_tunnel_wall()

void square_tunnel_wall ( struct chunk c,
int  y,
int  x 
)

References FEAT_FLOOR, and square_set_feat().

Referenced by twall().

◆ square_unlock_door()

void square_unlock_door ( struct chunk c,
int  y,
int  x 
)

◆ square_unmark()

void square_unmark ( struct chunk c,
int  y,
int  x 
)

◆ square_upgrade_mineral()

void square_upgrade_mineral ( struct chunk c,
int  y,
int  x 
)

Add visible treasure to a mineral square.

References square::feat, FEAT_MAGMA, FEAT_MAGMA_K, FEAT_QUARTZ, FEAT_QUARTZ_K, square_set_feat(), and chunk::squares.

Referenced by build_streamer().

◆ square_wasseen()

bool square_wasseen ( struct chunk c,
int  y,
int  x 
)

True if the cave square was seen before the current update.

References square::info, sqinfo_has, square_in_bounds(), and chunk::squares.

Referenced by update_one().

◆ update_view()

void update_view ( struct chunk c,
struct player p 
)

◆ wiz_light()

void wiz_light ( struct chunk c,
struct player p,
bool  full 
)

Light up the dungeon using "claravoyance".

This function "illuminates" every grid in the dungeon, memorizes all "objects" (or notes the existence of an object "if" full is true), and memorizes all grids as with magic mapping.

References ddx_ddd, ddy_ddd, chunk::height, i, square::info, PR_ITEMLIST, PR_MAP, PR_MONLIST, PU_MONSTERS, PU_UPDATE_VIEW, player_upkeep::redraw, sqinfo_on, square_forget(), square_in_bounds(), square_in_bounds_fully(), square_isfloor(), square_ismark(), square_isnotknown(), square_isvisibletrap(), square_know_pile(), square_mark(), square_memorize(), square_seemslikewall(), square_sense_pile(), square_unmark(), chunk::squares, player_upkeep::update, player::upkeep, and chunk::width.

Referenced by cave_generate(), effect_handler_LIGHT_LEVEL(), and get_debug_command().

Variable Documentation

◆ cave

struct chunk* cave

Referenced by acquirement(), autoinscribe_ground(), become_aware(), blow_after_effects(), build_quest_stairs(), call_monster(), can_call_monster(), cave_known(), cave_light(), cave_room_aux(), cave_unlight(), chest_check(), chest_death(), cleanup_angband(), close_game(), compact_monsters(), compact_monsters_aux(), context_menu_cave(), context_menu_object(), context_menu_player(), delete_monster(), delete_monster_idx(), display_feeling(), display_map(), do_animation(), do_autopickup(), do_cmd_alter_aux(), do_cmd_buy(), do_cmd_close(), do_cmd_close_aux(), do_cmd_close_test(), do_cmd_disarm(), do_cmd_disarm_aux(), do_cmd_disarm_test(), do_cmd_go_down(), do_cmd_go_up(), do_cmd_hold(), do_cmd_lock_door(), do_cmd_open(), do_cmd_open_aux(), do_cmd_open_chest(), do_cmd_open_test(), do_cmd_retrieve(), do_cmd_sell(), do_cmd_stash(), do_cmd_tunnel(), do_cmd_tunnel_aux(), do_cmd_tunnel_test(), do_cmd_walk(), do_cmd_walk_test(), do_cmd_wiz_bamf(), do_cmd_wiz_features(), do_cmd_wiz_hack_nick(), do_cmd_wiz_named(), do_cmd_wiz_query(), do_cmd_wiz_zap(), draw_path(), drop_find_grid(), drop_near(), effect_handler_BALL(), effect_handler_BANISH(), effect_handler_BREATH(), effect_handler_CREATE_STAIRS(), effect_handler_DAMAGE(), effect_handler_DESTRUCTION(), effect_handler_DETECT_DOORS(), effect_handler_DETECT_EVIL(), effect_handler_DETECT_GOLD(), effect_handler_DETECT_INVISIBLE_MONSTERS(), effect_handler_DETECT_OBJECTS(), effect_handler_DETECT_STAIRS(), effect_handler_DETECT_TRAPS(), effect_handler_DETECT_VISIBLE_MONSTERS(), effect_handler_DRAIN_MANA(), effect_handler_EARTHQUAKE(), effect_handler_LIGHT_LEVEL(), effect_handler_MAP_AREA(), effect_handler_MASS_BANISH(), effect_handler_MON_HEAL_HP(), effect_handler_MON_HEAL_KIN(), effect_handler_MON_TIMED_INC(), effect_handler_PROBE(), effect_handler_PROJECT_LOS(), effect_handler_PROJECT_LOS_AWARE(), effect_handler_RUBBLE(), effect_handler_RUNE(), effect_handler_SENSE_OBJECTS(), effect_handler_SUMMON(), effect_handler_TELEPORT(), effect_handler_TELEPORT_TO(), effect_handler_THRUST_AWAY(), effect_handler_WAKE(), enter_store(), fill_terrain_info(), find_artifact(), findpath(), floor_carry_fail(), floor_object_for_use(), get_debug_command(), get_panel_skills(), get_target(), grid_data_as_text(), hit_trap(), hp_colour_change(), ignore_drop(), ignore_known_item_ok(), inven_drop(), is_valid_pf(), item_is_available(), light_room(), look_mon_desc(), make_attack_spell(), make_noise(), make_ranged_shot(), make_ranged_throw(), map_info(), melee_effect_handler_EAT_GOLD(), melee_effect_handler_EAT_ITEM(), modify_panel(), monster_death(), monster_list_can_update(), monster_list_collect(), monster_list_new(), monster_list_reset(), monster_list_show_subwindow(), monster_swap(), monster_take_terrain_damage(), move_player(), no_light(), object_delete(), object_flavor_aware(), object_list_collect(), object_list_entry_line_attribute(), object_list_format_name(), object_list_should_ignore_object(), object_list_standard_compare(), origin_get_loc(), pack_overflow(), panel_should_modify(), path_analyse(), player_check_terrain_damage(), player_inc_check(), player_know_object(), player_pickup_aux(), player_pickup_gold(), player_pickup_item(), player_take_terrain_damage(), prepare_next_level(), process_player_cleanup(), project(), project_feature_handler_ACID(), project_feature_handler_ARROW(), project_feature_handler_CHAOS(), project_feature_handler_COLD(), project_feature_handler_DARK_WEAK(), project_feature_handler_DISEN(), project_feature_handler_ELEC(), project_feature_handler_FIRE(), project_feature_handler_FORCE(), project_feature_handler_GRAVITY(), project_feature_handler_HOLY_ORB(), project_feature_handler_ICE(), project_feature_handler_INERTIA(), project_feature_handler_KILL_DOOR(), project_feature_handler_KILL_TRAP(), project_feature_handler_KILL_WALL(), project_feature_handler_LIGHT_WEAK(), project_feature_handler_MAKE_DOOR(), project_feature_handler_MAKE_TRAP(), project_feature_handler_MANA(), project_feature_handler_METEOR(), project_feature_handler_MISSILE(), project_feature_handler_NETHER(), project_feature_handler_NEXUS(), project_feature_handler_PLASMA(), project_feature_handler_POIS(), project_feature_handler_SHARD(), project_feature_handler_SOUND(), project_feature_handler_TIME(), project_feature_handler_WATER(), project_m(), project_m_apply_side_effects(), project_monster_handler_MON_CLONE(), project_o(), project_p(), project_path(), project_player_handler_NEXUS(), prt_dtrap(), prt_level_feeling(), prt_map(), prt_map_aux(), push_object(), py_attack(), py_attack_real(), ranged_helper(), rd_dungeon(), rd_monsters(), rd_objects(), rd_traps(), recharge_objects(), refill_lamp(), remove_bad_spells(), reset_monsters(), restore_monsters(), run_game_loop(), run_step(), run_test(), rune_autoinscribe(), scan_distant_floor(), scan_floor(), search(), see_wall(), show_obj(), spell_value_base_dungeon_level(), spell_value_base_spell_power(), square_forget(), square_isknown(), square_isnotknown(), square_know_pile(), square_light_spot(), square_memorize(), square_note_spot(), square_sense_pile(), start_game(), store_at(), store_will_buy_tester(), summon_possible(), summon_specific(), take1(), target_able(), target_accept(), target_get_monsters(), target_recall_loop_object(), target_set_closest(), target_set_interactive(), target_set_interactive_aux(), target_set_location(), target_sighted(), teardown_tests(), test_drop_eat(), test_drop_pickup(), test_loadgame(), test_magic_missile(), test_newgame(), textui_process_click(), twall(), uncurse_object(), update_minimap_subwindow(), update_mon(), update_monsters(), update_player_object_knowledge(), update_scent(), update_stuff(), use_aux(), use_store(), wiz_create_item_drop_object(), wiz_statistics(), wiz_test_kind(), wr_dungeon(), wr_monsters(), wr_objects(), and wr_traps().

◆ chunk_list

struct chunk** chunk_list

list of pointers to saved chunks

Referenced by cleanup_angband(), player_get_recall_depth(), and wr_chunks().

◆ chunk_list_max

u16b chunk_list_max

◆ ddd

const s16b ddd[9]

Global array for looping through the "keypad directions".

Referenced by build_streamer(), monster_turn(), player_confuse_dir(), and use_aux().

◆ ddx

const s16b ddx[10]

◆ ddx_ddd

const s16b ddx_ddd[9]

◆ ddy

const s16b ddy[10]

◆ ddy_ddd

const s16b ddy_ddd[9]

◆ dist_offsets_x

const int* dist_offsets_x[10]

◆ dist_offsets_y

const int* dist_offsets_y[10]

◆ f_info

struct feature* f_info

◆ FEAT_BROKEN

int FEAT_BROKEN

◆ FEAT_CLOSED

int FEAT_CLOSED

◆ FEAT_FLOOR

int FEAT_FLOOR

◆ FEAT_GRANITE

int FEAT_GRANITE

◆ FEAT_LAVA

int FEAT_LAVA

◆ FEAT_LESS

int FEAT_LESS

◆ FEAT_MAGMA

int FEAT_MAGMA

◆ FEAT_MAGMA_K

int FEAT_MAGMA_K

◆ FEAT_MORE

int FEAT_MORE

◆ FEAT_NONE

int FEAT_NONE

◆ FEAT_OPEN

int FEAT_OPEN

◆ FEAT_PASS_RUBBLE

int FEAT_PASS_RUBBLE

◆ FEAT_PERM

int FEAT_PERM

◆ FEAT_QUARTZ

int FEAT_QUARTZ

◆ FEAT_QUARTZ_K

int FEAT_QUARTZ_K

◆ FEAT_RUBBLE

int FEAT_RUBBLE

◆ FEAT_SECRET

int FEAT_SECRET

◆ side_dirs

const byte side_dirs[20][8]

Given a central direction at position [dir #][0], return a series of directions radiating out on both sides from the central direction all the way back to its rear.

Side directions come in pairs; for example, directions '1' and '3' flank direction '2'. The code should know which side to consider first. If the left, it must add 10 to the central direction to access the second part of the table.

Referenced by monster_turn().