Defines | Functions

teleport.c File Reference

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

Defines

#define MAX_GOOD   15
#define EPATHTO_UNSEEN   0x0
#define EPATHTO_INACCESSIBLE   0x1
#define EPATHTO_DONE   0x2
#define EPATHTO_TAIL(n)   (0x3 + ((n) & 7))
#define EPATHTO_XY(x, y)   (((y) + 1) * COLNO + (x))
#define EPATHTO_Y(xy)   ((xy) / COLNO - 1)
#define EPATHTO_X(xy)   ((xy) % COLNO)

Functions

STATIC_DCL boolean FDECL (tele_jump_ok,(int, int, int, int))
STATIC_DCL boolean FDECL (teleok,(int, int, BOOLEAN_P))
STATIC_DCL void NDECL (vault_tele)
STATIC_DCL boolean FDECL (rloc_pos_ok,(int, int, struct monst *))
STATIC_DCL void FDECL (mvault_tele,(struct monst *))
static int badpos (int x, int y, struct monst *mtmp, unsigned gpflags)
boolean goodpos (int x, int y, struct monst *mtmp, unsigned gpflags)
boolean enexto (coord *cc, xchar xx, xchar yy, struct permonst *mdat)
boolean enexto_core (coord *cc, xchar xx, xchar yy, struct permonst *mdat, unsigned entflags)
boolean enexto_core_range (coord *cc, xchar xx, xchar yy, struct permonst *mdat, unsigned entflags, int start_range)
int epathto (coord *cc, int nc, xchar xx, xchar yy, struct permonst *mdat)
STATIC_OVL boolean tele_jump_ok (int x1, int y1, int x2, int y2)
STATIC_OVL boolean teleok (int x, int y, boolean trapok)
void teleds (int nux, int nuy, boolean allow_drag)
boolean safe_teleds (boolean allow_drag)
STATIC_OVL void vault_tele ()
boolean teleport_pet (struct monst *mtmp, boolean force_it)
void tele ()
int dotele ()
void level_tele ()
void domagicportal (struct trap *ttmp)
void tele_trap (struct trap *trap)
void level_tele_trap (struct trap *trap)
STATIC_OVL boolean rloc_pos_ok (int x, int y, struct monst *mtmp)
void rloc_to (struct monst *mtmp, int x, int y)
boolean rloc (struct monst *mtmp, boolean suppress_impossible)
STATIC_OVL void mvault_tele (struct monst *mtmp)
boolean tele_restrict (struct monst *mon)
void mtele_trap (struct monst *mtmp, struct trap *trap, int in_sight)
int mlevel_tele_trap (struct monst *mtmp, struct trap *trap, boolean force_it, int in_sight)
void rloco (struct obj *obj)
int random_teleport_level ()
boolean u_teleport_mon (struct monst *mtmp, boolean give_feedback)

Define Documentation

#define EPATHTO_DONE   0x2

Referenced by epathto().

#define EPATHTO_INACCESSIBLE   0x1

Referenced by epathto().

#define EPATHTO_TAIL (   n )    (0x3 + ((n) & 7))

Referenced by epathto().

#define EPATHTO_UNSEEN   0x0

Referenced by epathto().

#define EPATHTO_X (   xy )    ((xy) % COLNO)

Referenced by epathto().

#define EPATHTO_XY (   x,
 
)    (((y) + 1) * COLNO + (x))

Referenced by epathto().

#define EPATHTO_Y (   xy )    ((xy) / COLNO - 1)

Referenced by epathto().

#define MAX_GOOD   15

Referenced by enexto_core_range().


Function Documentation

static int badpos ( int  x,
int  y,
struct monst mtmp,
unsigned  gpflags 
) [static]
void domagicportal ( struct trap ttmp )

References FALSE, In_endgame, next_to_u(), on_level(), schedule_goto(), shudder_for_moment, u, you::uhave, you::uz, and you::uz0.

Referenced by dotrap().

Here is the call graph for this function:

Here is the caller graph for this function:

int dotele (  )
boolean enexto ( coord cc,
xchar  xx,
xchar  yy,
struct permonst mdat 
)
boolean enexto_core ( coord cc,
xchar  xx,
xchar  yy,
struct permonst mdat,
unsigned  entflags 
)

References enexto_core_range().

Referenced by enexto(), and makemon().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean enexto_core_range ( coord cc,
xchar  xx,
xchar  yy,
struct permonst mdat,
unsigned  entflags,
int  start_range 
)
Parameters:
start_rangeDistance of checked tiles to begin with. Should be >=1.

References COLNO, monst::data, FALSE, goodpos(), max, MAX_GOOD, min, mons, pline(), rn2(), ROWNO, TRUE, u, you::umonster, nhcoord::x, xmax, xmin, nhcoord::y, ymax, and ymin.

Referenced by enexto_core(), and u_teleport_mon().

Here is the call graph for this function:

Here is the caller graph for this function:

int epathto ( coord cc,
int  nc,
xchar  xx,
xchar  yy,
struct permonst mdat 
)
STATIC_DCL boolean FDECL ( rloc_pos_ok  ,
(int, int, struct monst *)   
)
STATIC_DCL boolean FDECL ( teleok  ,
(int, int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( mvault_tele  ,
(struct monst *)   
)
STATIC_DCL boolean FDECL ( tele_jump_ok  ,
(int, int, int, int)   
)
boolean goodpos ( int  x,
int  y,
struct monst mtmp,
unsigned  gpflags 
)
void level_tele (  )
void level_tele_trap ( struct trap trap )

References Antimagic, Blind, monst::data, deltrap(), In_endgame, level_tele(), Levitation, locomotion(), newsym(), shieldeff(), u, you::ux, you::uy, you::uz, and youmonst.

Referenced by dotrap().

Here is the call graph for this function:

Here is the caller graph for this function:

int mlevel_tele_trap ( struct monst mtmp,
struct trap trap,
boolean  force_it,
int  in_sight 
)
void mtele_trap ( struct monst mtmp,
struct trap trap,
int  in_sight 
)

References canseemon, FALSE, Monnam(), mvault_tele(), pline(), rloc(), seetrap(), tele_restrict(), and teleport_pet().

Referenced by mintrap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mvault_tele ( struct monst mtmp )

References FALSE, goodpos(), rloc(), rloc_to(), search_special(), somexy(), VAULT, nhcoord::x, and nhcoord::y.

Referenced by mtele_trap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL void NDECL ( vault_tele   )
int random_teleport_level (  )

References depth(), dungeon::depth_start, d_level::dnum, dungeons, dunlevs_in_dungeon(), In_quest(), Inhell, Is_botlevel(), Is_knox, rn2(), rnd(), u, you::uevent, and you::uz.

Referenced by launch_obj(), level_tele(), mlevel_tele_trap(), moverock(), and use_defensive().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rloc ( struct monst mtmp,
boolean  suppress_impossible 
)
STATIC_OVL boolean rloc_pos_ok ( int  x,
int  y,
struct monst mtmp 
)

References dndest, FALSE, goodpos(), dest_area::hx, dest_area::hy, dest_area::lx, dest_area::ly, monst::mx, monst::my, dest_area::nhx, dest_area::nhy, dest_area::nlx, dest_area::nly, On_W_tower_level(), tele_jump_ok(), TRUE, u, updest, you::uz, and within_bounded_area.

Referenced by rloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void rloc_to ( struct monst mtmp,
int  x,
int  y 
)
void rloco ( struct obj obj )
boolean safe_teleds ( boolean  allow_drag )

References COLNO, FALSE, rn2(), rnd(), ROWNO, teleds(), teleok(), and TRUE.

Referenced by drown(), fix_worst_trouble(), lava_effects(), and tele().

Here is the call graph for this function:

Here is the caller graph for this function:

void tele (  )
STATIC_OVL boolean tele_jump_ok ( int  x1,
int  y1,
int  x2,
int  y2 
)

References dndest, FALSE, dest_area::nhx, dest_area::nhy, dest_area::nlx, dest_area::nly, TRUE, updest, and within_bounded_area.

Referenced by rloc_pos_ok(), and teleok().

Here is the caller graph for this function:

boolean tele_restrict ( struct monst mon )

References canseemon, FALSE, dlevel_t::flags, level, mon_nam(), pline(), and TRUE.

Referenced by demon_talk(), dochug(), gem_accept(), hitmu(), m_move(), mbhitm(), mdamagem(), mtele_trap(), stealamulet(), stealarm(), stealgold(), use_defensive(), and use_mirror().

Here is the call graph for this function:

Here is the caller graph for this function:

void tele_trap ( struct trap trap )

References Antimagic, deltrap(), In_endgame, newsym(), next_to_u(), shieldeff(), shudder_for_moment, tele(), u, you::ux, you::uy, you::uz, and vault_tele().

Referenced by dotrap().

Here is the call graph for this function:

Here is the caller graph for this function:

void teleds ( int  nux,
int  nuy,
boolean  allow_drag 
)
STATIC_OVL boolean teleok ( int  x,
int  y,
boolean  trapok 
)

References FALSE, goodpos(), in_out_region(), t_at(), tele_jump_ok(), TRUE, u, you::ux, you::uy, and youmonst.

Referenced by safe_teleds(), tele(), and vault_tele().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean teleport_pet ( struct monst mtmp,
boolean  force_it 
)

References FALSE, get_mleash(), m_unleash(), Monnam(), otmp, TRUE, u, and yelp().

Referenced by digactualhole(), mlevel_tele_trap(), and mtele_trap().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean u_teleport_mon ( struct monst mtmp,
boolean  give_feedback 
)

You teleport a monster (via wand, spell, or poly'd q.mechanic attack). returns false iff the attempt fails

References enexto(), enexto_core_range(), FALSE, dlevel_t::flags, in_rooms(), is_rider, level, mon_nam(), Monnam(), mons, pline(), PM_BLACK_MARKETEER, rloc(), rloc_to(), rn2(), rnf(), TEMPLE, TRUE, u, unstuck(), you::ustuck, you::ux, you::uy, nhcoord::x, and nhcoord::y.

Referenced by bhitm(), and damageum().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void vault_tele (  )

References FALSE, search_special(), somexy(), tele(), teleds(), teleok(), VAULT, nhcoord::x, and nhcoord::y.

Referenced by dotele(), and tele_trap().

Here is the call graph for this function:

Here is the caller graph for this function: