Angband
Functions
cave-square.c File Reference

functions for dealing with individual squares More...

#include "angband.h"
#include "cave.h"
#include "game-world.h"
#include "init.h"
#include "monster.h"
#include "obj-util.h"
#include "obj-pile.h"
#include "object.h"
#include "trap.h"

Functions

bool feat_is_magma (int feat)
 FEATURE PREDICATES.
bool feat_is_quartz (int feat)
 True if the square is a quartz wall.
bool feat_is_treasure (int feat)
 True if the square is a mineral wall with treasure (magma/quartz).
bool feat_is_wall (int feat)
 True is the feature is a solid wall (not rubble).
bool feat_is_monster_walkable (int feat)
 True if a monster can walk through the feature.
bool feat_is_shop (int feat)
 True if the feature is a shop entrance.
bool feat_is_passable (int feat)
 True if the feature is passable by the player.
bool feat_is_projectable (int feat)
 True if any projectable can pass through the feature.
bool feat_is_boring (int feat)
 True if the feature is "boring".
bool square_isfloor (struct chunk *c, int y, int x)
 SQUARE FEATURE PREDICATES.
bool square_isrock (struct chunk *c, int y, int x)
 True if the square is a normal granite rock wall.
bool square_isperm (struct chunk *c, int y, int x)
 True if the square is a permanent wall.
bool square_ismagma (struct chunk *c, int y, int x)
 True if the square is a magma wall.
bool square_isquartz (struct chunk *c, int y, int x)
 True if the square is a quartz wall.
bool square_ismineral (struct chunk *c, int y, int x)
 True if the square is a mineral wall (magma/quartz).
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.
bool square_issecretdoor (struct chunk *c, int y, int x)
 True if the square is a hidden secret door.
bool square_isopendoor (struct chunk *c, int y, int x)
 True if the square is an open door.
bool square_iscloseddoor (struct chunk *c, int y, int x)
 True if the square is a closed door (possibly locked or jammed).
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.
bool square_isstairs (struct chunk *c, int y, int x)
 True if square is any stair.
bool square_isupstairs (struct chunk *c, int y, int x)
 True if square is an up stair.
bool square_isdownstairs (struct chunk *c, int y, int x)
 True if square is a down stair.
bool square_isshop (struct chunk *c, int y, int x)
 True if the square is a shop entrance.
bool square_noticeable (struct chunk *c, int y, int x)
bool square_isplayer (struct chunk *c, int y, int x)
 True if the square contains the player.
bool square_ismark (struct chunk *c, int y, int x)
 SQUARE INFO PREDICATES.
bool square_isglow (struct chunk *c, int y, int x)
 True if the square is lit.
bool square_isvault (struct chunk *c, int y, int x)
 True if the square is part of a vault.
bool square_isroom (struct chunk *c, int y, int x)
 True if the square is part of a room.
bool square_isseen (struct chunk *c, int y, int x)
 True if the square has been seen by the player.
bool square_isview (struct chunk *c, int y, int x)
 True if the cave square is currently viewable by the player.
bool square_wasseen (struct chunk *c, int y, int x)
 True if the cave square was seen before the current update.
bool square_isdtrap (struct chunk *c, int y, int x)
 True if the square has been detected for traps.
bool square_isfeel (struct chunk *c, int y, int x)
 True if cave square is a feeling trigger square.
bool square_isdedge (struct chunk *c, int y, int x)
 True if the square is on the trap detection edge.
bool square_istrap (struct chunk *c, int y, int x)
 True if the square has a known trap.
bool square_isinvis (struct chunk *c, int y, int x)
 True if the square has an unknown trap.
bool square_iswall_inner (struct chunk *c, int y, int x)
 True if cave square is an inner wall (generation)
bool square_iswall_outer (struct chunk *c, int y, int x)
 True if cave square is an outer wall (generation)
bool square_iswall_solid (struct chunk *c, int y, int x)
 True if cave square is a solid wall (generation)
bool square_ismon_restrict (struct chunk *c, int y, int x)
 True if cave square has monster restrictions (generation)
bool square_isno_teleport (struct chunk *c, int y, int x)
 True if cave square can't be teleported from by the player.
bool square_isno_map (struct chunk *c, int y, int x)
 True if cave square can't be magically mapped by the player.
bool square_isno_esp (struct chunk *c, int y, int x)
 True if cave square can't be detected by player ESP.
bool square_isproject (struct chunk *c, int y, int x)
 True if cave square is marked for projection processing.
bool square_isopen (struct chunk *c, int y, int x)
 SQUARE BEHAVIOR PREDICATES.
bool square_isempty (struct chunk *c, int y, int x)
 True if the square is empty (an open square without any items).
bool square_canputitem (struct chunk *c, int y, int x)
 True if the square is a floor square without items.
bool square_isdiggable (struct chunk *c, int y, int x)
 True if the square can be dug: this includes rubble and non-permanent walls.
bool square_is_monster_walkable (struct chunk *c, int y, int x)
 True if a monster can walk through the tile.
bool square_ispassable (struct chunk *c, int y, int x)
 True if the square is passable by the player.
bool square_isprojectable (struct chunk *c, int y, int x)
 True if any projectable can pass through the square.
bool square_iswall (struct chunk *c, int y, int x)
 True if the square is a wall square (impedes the player).
bool square_isstrongwall (struct chunk *c, int y, int x)
 True if the square is a permanent wall or one of the "stronger" walls.
bool square_isboring (struct chunk *c, int y, int x)
 True if the cave square is "boring".
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_islockeddoor (struct chunk *c, int y, int x)
 True if the square is a closed, locked door.
bool square_isplayertrap (struct chunk *c, int y, int x)
 True if there is a player trap (known or unknown) in this square.
bool square_isvisibletrap (struct chunk *c, int y, int x)
 True if there is a visible trap in this square.
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)
bool square_isknowntrap (struct chunk *c, int y, int x)
 True if the square is a known player trap.
bool square_changeable (struct chunk *c, int y, int x)
 Determine if a given location may be "destroyed".
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.
bool square_in_bounds (struct chunk *c, int y, int x)
bool square_in_bounds_fully (struct chunk *c, int y, int x)
struct featuresquare_feat (struct chunk *c, int y, int x)
 OTHER SQUARE FUNCTIONS.
struct monstersquare_monster (struct chunk *c, int y, int x)
 Get a monster on the current level by its position.
struct objectsquare_object (struct chunk *c, int y, int x)
 Get the top object of a pile on the current level by its position.
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.
void square_excise_object (struct chunk *c, int y, int x, struct object *obj)
 Excise an object from a floor pile, leaving it orphaned.
void square_set_feat (struct chunk *c, int y, int x, int feat)
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_unlock_door (struct chunk *c, int y, int x)
void square_destroy_door (struct chunk *c, int y, int x)
void square_destroy_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.
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)

Detailed Description

functions for dealing with individual squares

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.

Function Documentation

bool feat_is_boring ( int  feat)

True if the feature is "boring".

References f_info, flags, and tf_has.

Referenced by square_isboring().

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().

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().

bool feat_is_passable ( int  feat)

True if the feature is passable by the player.

References f_info, flags, and tf_has.

Referenced by square_ispassable().

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().

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().

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().

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().

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().

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

References chunk::depth, and place_trap().

Referenced by get_debug_command().

void square_add_ward ( struct chunk c,
int  y,
int  x 
)
const char* square_apparent_name ( struct chunk c,
struct player p,
int  y,
int  x 
)
bool square_canputitem ( struct chunk c,
int  y,
int  x 
)

True if the square is a floor square without items.

References square_isfloor(), and square_object().

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

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

References square_isfloor().

Referenced by effect_handler_RUNE().

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, FALSE, object::next, square_isperm(), square_isshop(), square_isstairs(), square_object(), and TRUE.

Referenced by build_quest_stairs(), and effect_handler_EARTHQUAKE().

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

References FEAT_CLOSED, and square_set_feat().

Referenced by do_cmd_close_aux().

void square_destroy ( struct chunk c,
int  y,
int  x 
)
void square_destroy_door ( struct chunk c,
int  y,
int  x 
)
void square_destroy_rubble ( struct chunk c,
int  y,
int  x 
)
void square_destroy_trap ( struct chunk c,
int  y,
int  x 
)
void square_destroy_wall ( struct chunk c,
int  y,
int  x 
)
int square_digging ( struct chunk c,
int  y,
int  x 
)
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 FALSE, square_in_bounds_fully(), square_isdtrap(), and TRUE.

Referenced by effect_handler_DETECT_TRAPS().

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

Excise an object from a floor pile, leaving it orphaned.

References square::obj, pile_excise(), and chunk::squares.

Referenced by floor_carry(), floor_object_for_use(), player_pickup_aux(), player_pickup_gold(), process_monster_grab_objects(), project_o(), and wield_item().

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

OTHER SQUARE FUNCTIONS.

Below are various square-specific functions which are not predicates

References f_info, square::feat, height, chunk::squares, and width.

Referenced by push_object().

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

References FEAT_FLOOR, and square_set_feat().

Referenced by push_object().

bool square_hasgoldvein ( struct chunk c,
int  y,
int  x 
)
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(), and square_object().

Referenced by player_pickup_item(), and wield_item().

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_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().

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

True if the cave square is "boring".

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

Referenced by target_accept().

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

True if the square is on the trap detection edge.

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

Referenced by map_info(), and prt_dtrap().

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().

bool square_isdoor ( struct chunk c,
int  y,
int  x 
)
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().

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

True if the 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().

bool square_isempty ( struct chunk c,
int  y,
int  x 
)
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().

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 f_info, square::feat, feature::flags, chunk::squares, and tf_has.

Referenced by count_adj_walls(), drop_near(), effect_handler_CREATE_STAIRS(), get_debug_command(), next_to_corr(), project_feature_handler_MAKE_DOOR(), square_canputitem(), square_canward(), square_isopen(), and wiz_light().

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().

bool square_isinteresting ( struct chunk c,
int  y,
int  x 
)
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.

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

True if the square is a known player trap.

References square_isplayertrap(), and square_isvisibletrap().

Referenced by context_menu_cave(), do_cmd_alter_aux(), do_cmd_disarm(), do_cmd_disarm_test(), and move_player().

bool square_islockeddoor ( struct chunk c,
int  y,
int  x 
)
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().

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 a square's terrain is memorized by the player

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

Referenced by count_feats(), do_cmd_close_test(), do_cmd_disarm_test(), do_cmd_open_test(), do_cmd_tunnel_test(), do_cmd_walk_test(), do_cmd_wiz_query(), draw_path(), is_valid_pf(), map_info(), move_player(), process_monster_glyph(), run_step(), run_test(), see_wall(), square_apparent_name(), square_note_spot(), and target_accept().

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().

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().

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().

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().

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().

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().

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().

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

True if the square contains the player.

References FALSE, square::mon, chunk::squares, and TRUE.

Referenced by process_monster().

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

True if there is a player trap (known or unknown) in this square.

References square_trap_flag().

Referenced by effect_handler_DETECT_TRAPS(), project_feature_handler_KILL_DOOR(), square_isknowntrap(), square_issecrettrap(), and square_reveal_trap().

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().

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

True if any projectable can pass through the square.

This function is the logical negation of square_iswall().

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

Referenced by add_monster_lights(), draw_path(), effect_handler_THRUST_AWAY(), light_room(), los(), project(), project_m(), project_path(), ranged_helper(), and square_iswall().

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().

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().

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_moves(), next_to_corr(), and try_door().

bool square_isrubble ( struct chunk c,
int  y,
int  x 
)
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 do_cmd_tunnel_aux(), effect_handler_DETECT_DOORS(), process_monster_can_move(), project_feature_handler_KILL_TRAP(), search(), and square_isdiggable().

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 search().

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

True if the square has been seen by the player.

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

Referenced by map_info(), mark_wasseen(), square_note_spot(), update_mon(), and update_one().

bool square_isshop ( struct chunk c,
int  y,
int  x 
)
bool square_isstairs ( struct chunk c,
int  y,
int  x 
)
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().

bool square_istrap ( struct chunk c,
int  y,
int  x 
)
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().

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 effect_handler_TELEPORT(), generate_starburst_room(), join_region(), and square_isstart().

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

True if the cave square is currently viewable by the player.

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

Referenced by become_viewable(), forget_view(), and update_mon().

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

True if there is a visible trap in this square.

References square_trap_flag().

Referenced by square_isknowntrap(), square_issecrettrap(), target_accept(), target_set_interactive_aux(), and wiz_light().

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(), next_to_walls(), place_feeling(), process_monster_can_move(), project_feature_handler_KILL_WALL(), and update_view_one().

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().

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().

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().

bool square_iswarded ( struct chunk c,
int  y,
int  x 
)
struct monster* square_monster ( struct chunk c,
int  y,
int  x 
)
read
bool square_noticeable ( struct chunk c,
int  y,
int  x 
)

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

Referenced by run_test().

struct object* square_object ( struct chunk c,
int  y,
int  x 
)
read
void square_open_door ( struct chunk c,
int  y,
int  x 
)
void square_remove_ward ( struct chunk c,
int  y,
int  x 
)
bool square_seemslikewall ( struct chunk c,
int  y,
int  x 
)
void square_set_feat ( struct chunk c,
int  y,
int  x,
int  feat 
)
int square_shopnum ( struct chunk c,
int  y,
int  x 
)
void square_smash_door ( struct chunk c,
int  y,
int  x 
)
void square_tunnel_wall ( struct chunk c,
int  y,
int  x 
)

References FEAT_FLOOR, and square_set_feat().

Referenced by twall().

void square_unlock_door ( 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.

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

Referenced by build_streamer().

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().