Defines | Functions | Variables

region.c File Reference

#include "hack.h"
#include "lev.h"
Include dependency graph for region.c:

Defines

#define NO_CALLBACK   (-1)
#define INSIDE_GAS_CLOUD   0
#define EXPIRE_GAS_CLOUD   1
#define REVIVE_CTHULHU   2

Functions

boolean FDECL (inside_gas_cloud,(genericptr, genericptr))
boolean FDECL (expire_gas_cloud,(genericptr, genericptr))
boolean FDECL (revive_cthulhu,(genericptr, genericptr))
boolean FDECL (inside_rect,(NhRect *, int, int))
boolean FDECL (inside_region,(NhRegion *, int, int))
NhRegionFDECL (create_region,(NhRect *, int))
void FDECL (add_rect_to_reg,(NhRegion *, NhRect *))
void FDECL (add_mon_to_reg,(NhRegion *, struct monst *))
void FDECL (remove_mon_from_reg,(NhRegion *, struct monst *))
boolean FDECL (mon_in_region,(NhRegion *, struct monst *))
void FDECL (free_region,(NhRegion *))
void FDECL (add_region,(NhRegion *))
void FDECL (remove_region,(NhRegion *))
static void FDECL (reset_region_mids,(NhRegion *))
boolean inside_rect (NhRect *r, int x, int y)
boolean inside_region (NhRegion *reg, int x, int y)
NhRegioncreate_region (NhRect *rects, int nrect)
void add_rect_to_reg (NhRegion *reg, NhRect *rect)
void add_mon_to_reg (NhRegion *reg, struct monst *mon)
void remove_mon_from_reg (NhRegion *reg, struct monst *mon)
boolean mon_in_region (NhRegion *reg, struct monst *mon)
void free_region (NhRegion *reg)
void add_region (NhRegion *reg)
void remove_region (NhRegion *reg)
void clear_regions ()
void run_regions ()
boolean in_out_region (xchar x, xchar y)
boolean m_in_out_region (struct monst *mon, xchar x, xchar y)
void update_player_regions ()
void update_monster_region (struct monst *mon)
NhRegionvisible_region_at (xchar x, xchar y)
void show_region (NhRegion *reg, xchar x, xchar y)
void save_regions (int fd, int mode)
void rest_regions (int fd, boolean ghostly)
static void reset_region_mids (NhRegion *reg)
boolean expire_gas_cloud (genericptr_t p1, genericptr_t p2)
boolean revive_cthulhu (genericptr_t p1, genericptr_t p2)
boolean inside_gas_cloud (genericptr_t p1, genericptr_t p2)
NhRegioncreate_cthulhu_death_cloud (xchar x, xchar y, int radius, size_t damage, int duration)
NhRegioncreate_gas_cloud (xchar x, xchar y, int radius, size_t damage, int duration)

Variables

static NhRegion ** regions
static int n_regions = 0
static int max_regions = 0
static callback_proc callbacks []

Define Documentation

#define EXPIRE_GAS_CLOUD   1

Referenced by create_gas_cloud().

#define INSIDE_GAS_CLOUD   0

Referenced by create_gas_cloud().

#define NO_CALLBACK   (-1)
#define REVIVE_CTHULHU   2

Function Documentation

void add_mon_to_reg ( NhRegion reg,
struct monst mon 
)

References monst::m_id, and MONST_INC.

Referenced by add_region(), m_in_out_region(), and update_monster_region().

Here is the caller graph for this function:

void add_rect_to_reg ( NhRegion reg,
NhRect rect 
)

References nhrect::hx, nhrect::hy, nhrect::lx, nhrect::ly, and rect.

Referenced by create_gas_cloud().

Here is the caller graph for this function:

void add_region ( NhRegion reg )

References add_mon_to_reg(), cansee, clear_hero_inside, inside_region(), isok(), level, max_regions, MON_AT, dlevel_t::monsters, n_regions, newsym(), regions, set_hero_inside, u, you::ux, and you::uy.

Referenced by create_gas_cloud().

Here is the call graph for this function:

Here is the caller graph for this function:

void clear_regions (  )

References free_region(), max_regions, and n_regions.

Referenced by clear_level_structures(), rest_regions(), and save_regions().

Here is the call graph for this function:

Here is the caller graph for this function:

NhRegion* create_cthulhu_death_cloud ( xchar  x,
xchar  y,
int  radius,
size_t  damage,
int  duration 
)

References create_gas_cloud(), NhRegion::expire_f, and REVIVE_CTHULHU.

Referenced by cthulhu_dies().

Here is the call graph for this function:

Here is the caller graph for this function:

NhRegion* create_gas_cloud ( xchar  x,
xchar  y,
int  radius,
size_t  damage,
int  duration 
)
NhRegion* create_region ( NhRect rects,
int  nrect 
)
boolean expire_gas_cloud ( genericptr_t  p1,
genericptr_t  p2 
)

References NhRegion::arg, FALSE, if(), TRUE, and NhRegion::ttl.

Referenced by revive_cthulhu().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean FDECL ( inside_rect  ,
(NhRect *, int, int)   
)
void FDECL ( add_mon_to_reg  ,
(NhRegion *, struct monst *)   
)
void FDECL ( remove_mon_from_reg  ,
(NhRegion *, struct monst *)   
)
boolean FDECL ( inside_gas_cloud  ,
(genericptr, genericptr)   
)
boolean FDECL ( expire_gas_cloud  ,
(genericptr, genericptr)   
)
boolean FDECL ( mon_in_region  ,
(NhRegion *, struct monst *)   
)
boolean FDECL ( inside_region  ,
(NhRegion *, int, int)   
)
void FDECL ( free_region  ,
(NhRegion *)   
)
boolean FDECL ( revive_cthulhu  ,
(genericptr, genericptr)   
)
NhRegion* FDECL ( create_region  ,
(NhRect *, int)   
)
void FDECL ( add_region  ,
(NhRegion *)   
)
void FDECL ( remove_region  ,
(NhRegion *)   
)
void FDECL ( add_rect_to_reg  ,
(NhRegion *, NhRect *)   
)
static void FDECL ( reset_region_mids  ,
(NhRegion *)   
) [static]
void free_region ( NhRegion reg )

Referenced by clear_regions(), and remove_region().

Here is the caller graph for this function:

boolean in_out_region ( xchar  x,
xchar  y 
)

References NhRegion::attach_2_u, clear_hero_inside, FALSE, hero_inside, inside_region(), n_regions, NO_CALLBACK, pline(), set_hero_inside, and TRUE.

Referenced by domove(), goto_level(), hurtle_step(), and teleok().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean inside_gas_cloud ( genericptr_t  p1,
genericptr_t  p2 
)
boolean inside_rect ( NhRect r,
int  x,
int  y 
)

Referenced by inside_region().

Here is the caller graph for this function:

boolean inside_region ( NhRegion reg,
int  x,
int  y 
)

References FALSE, inside_rect(), and TRUE.

Referenced by add_region(), in_out_region(), m_in_out_region(), remove_region(), update_monster_region(), update_player_regions(), and visible_region_at().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean m_in_out_region ( struct monst mon,
xchar  x,
xchar  y 
)

References add_mon_to_reg(), NhRegion::attach_2_u, FALSE, hero_inside, inside_region(), mon, mon_in_region(), n_regions, NO_CALLBACK, remove_mon_from_reg(), and TRUE.

Referenced by dog_move(), kickdmg(), m_move(), and mhurtle_step().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean mon_in_region ( NhRegion reg,
struct monst mon 
)

References FALSE, monst::m_id, and TRUE.

Referenced by m_in_out_region(), and update_monster_region().

Here is the caller graph for this function:

void remove_mon_from_reg ( NhRegion reg,
struct monst mon 
)

References monst::m_id.

Referenced by m_in_out_region(), and update_monster_region().

Here is the caller graph for this function:

void remove_region ( NhRegion reg )

References cansee, free_region(), inside_region(), isok(), n_regions, and newsym().

Referenced by rest_regions(), and run_regions().

Here is the call graph for this function:

Here is the caller graph for this function:

static void reset_region_mids ( NhRegion reg ) [static]

References lookup_id_mapping(), and NhRegion::n_monst.

Referenced by rest_regions().

Here is the call graph for this function:

Here is the caller graph for this function:

void rest_regions ( int  fd,
boolean  ghostly 
)
boolean revive_cthulhu ( genericptr_t  p1,
genericptr_t  p2 
)
void run_regions (  )

References find_mid(), FM_FMON, hero_inside, NhRegion::inside_f, monst::mhp, NhRegion::monsters, NhRegion::n_monst, n_regions, NO_CALLBACK, remove_region(), and NhRegion::ttl.

Referenced by moveloop().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_regions ( int  fd,
int  mode 
)

save_regions :

References bwrite(), clear_regions(), NhRegion::enter_msg, NhRegion::leave_msg, moves, NhRegion::n_monst, n_regions, NhRegion::nrects, perform_bwrite, and release_data.

Referenced by savelev().

Here is the call graph for this function:

Here is the caller graph for this function:

void show_region ( NhRegion reg,
xchar  x,
xchar  y 
)

References show_glyph().

Referenced by newsym().

Here is the call graph for this function:

Here is the caller graph for this function:

void update_monster_region ( struct monst mon )

References add_mon_to_reg(), inside_region(), mon_in_region(), n_regions, and remove_mon_from_reg().

Referenced by do_entity(), and rloc_to().

Here is the call graph for this function:

Here is the caller graph for this function:

void update_player_regions (  )

References clear_hero_inside, inside_region(), n_regions, set_hero_inside, u, you::ux, and you::uy.

Referenced by teleds().

Here is the call graph for this function:

Here is the caller graph for this function:

NhRegion* visible_region_at ( xchar  x,
xchar  y 
)

References inside_region(), and n_regions.

Referenced by newsym().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

callback_proc callbacks[] [static]
Initial value:
 {
#define INSIDE_GAS_CLOUD
    inside_gas_cloud,
#define EXPIRE_GAS_CLOUD
    expire_gas_cloud,
#define REVIVE_CTHULHU
    revive_cthulhu
}
int max_regions = 0 [static]
int n_regions = 0 [static]
NhRegion** regions [static]

Referenced by add_region().