#include "hack.h"
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 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 | |||
) | (((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().
static int badpos | ( | int | x, |
int | y, | ||
struct monst * | mtmp, | ||
unsigned | gpflags | ||
) | [static] |
References ACCESSIBLE, amorphous, Amphibious, BOULDER, closed_door(), monst::data, Flying, HLevitation, is_clinger, is_flyer, is_lava(), is_pool(), is_swimmer, levl, likes_lava, m_at, may_passwall(), permonst::mlet, MM_IGNOREWATER, nohands, passes_walls, rn2(), S_EEL, sobj_at(), STEED, Swimming, throws_rocks, u, you::ux, you::uy, verysmall, Wwalking, and youmonst.
Referenced by epathto().
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().
int dotele | ( | ) |
References A_STR, A_WIS, ACURR, flag::botl, can_teleport, check_capacity(), Confusion, monst::data, deltrap(), exercise(), FALSE, flags, locomotion(), MAXSPELL, morehungry(), newsym(), next_to_u(), objects, pline(), PM_WIZARD, Role_if, shudder_for_moment, SPE_TELEPORT_AWAY, spelleffects(), spl_book, t_at(), tele(), TELEP_TRAP, Teleportation, TRUE, u, you::uen, you::uhunger, you::ulevel, you::ux, you::uy, vault_tele(), wizard, yn, and youmonst.
Referenced by drown().
References enexto_core().
Referenced by cast_cleric_spell(), clone_mon(), create_critters(), create_monster(), dog_move(), dokick(), e_died(), fig_transform(), final_level(), goto_level(), hatch_egg(), m_initgrp(), mattacku(), mkundead(), mnearto(), mnexto(), nasty(), precheck(), revive(), revive_cthulhu(), revive_nasty(), u_teleport_mon(), use_defensive(), use_grapple(), and use_whip().
References enexto_core_range().
Referenced by enexto(), and makemon().
boolean enexto_core_range | ( | coord * | cc, |
xchar | xx, | ||
xchar | yy, | ||
struct permonst * | mdat, | ||
unsigned | entflags, | ||
int | start_range | ||
) |
start_range | Distance 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().
References back_to_glyph(), badpos(), COLNO, create_nhwindow, monst::data, destroy_nhwindow, dirs, display_nhwindow, EPATHTO_DONE, EPATHTO_INACCESSIBLE, EPATHTO_TAIL, EPATHTO_UNSEEN, EPATHTO_X, EPATHTO_XY, EPATHTO_Y, glyph_to_cmap, max, min, mons, NHW_TEXT, PM_GRID_BUG, putstr, rn2(), ROWNO, showsyms, and TRUE.
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) | |||
) |
References ACCESSIBLE, amorphous, Amphibious, BOULDER, closed_door(), monst::data, FALSE, Flying, HLevitation, is_clinger, is_flyer, is_lava(), is_pool(), is_swimmer, isok(), levl, likes_lava, m_at, may_passwall(), permonst::mlet, MM_IGNOREWATER, passes_walls, rn2(), S_EEL, sobj_at(), STEED, Swimming, throws_rocks, TRUE, u, you::ux, you::uy, Wwalking, and youmonst.
Referenced by create_mplayers(), dog_move(), drown(), enexto_core_range(), fixup_special(), kickdmg(), makemon(), mhurtle_step(), mnearto(), mvault_tele(), place_worm_tail_randomly(), revive_nasty(), rloc(), rloc_engr(), rloc_pos_ok(), rloco(), seffects(), and teleok().
void level_tele | ( | ) |
References addinv(), AMULET_OF_YENDOR, assign_level(), BLACKMARKET, BUFSZ, Confusion, monst::data, deferred_goto(), depth(), dungeon::depth_start, DIED, digit(), display_nhwindow, d_level::dlevel, d_level::dnum, done(), dungeons, dunlevs_in_dungeon(), earth_level, FALSE, find_hell(), flags, Flying, get_level(), getlin, In_endgame, in_mklev, In_quest(), In_sokoban, Inhell, invent, Is_knox, is_silent, killer, killer_format, lev_by_name(), Levitation, medusa_level, mksobj(), flag::mon_moving, next_to_u(), NO_KILLER_PREFIX, pline(), qstart_level, random_teleport_level(), RANDOMIZED_PLANES, rnl(), schedule_goto(), shudder_for_moment, Sprintf, Strcat, Strcpy, Stunned, surface(), Teleport_control, TRUE, u, u_left_shop(), you::uevent, you::uhave, uhis, you::ushops, you::ushops0, you::utotype, you::ux, you::uy, you::uz, WIN_MESSAGE, wizard, WIZARD, ynq, and youmonst.
Referenced by arti_invoke(), level_tele_trap(), and seffects().
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().
References assign_level(), depth(), trap::dst, get_level(), HOLE, In_endgame, Is_botlevel(), is_home_elemental(), Is_stronghold, ledger_no(), MAGIC_PORTAL, MIGR_PORTAL, MIGR_RANDOM, migrate_to_level(), permonst::mlet, mon_has_amulet(), mon_nam(), Monnam(), pline(), random_teleport_level(), S_ELEMENTAL, seetrap(), teleport_pet(), TRAPDOOR, u, you::ustuck, you::uz, and valley_level.
Referenced by mintrap().
References canseemon, FALSE, Monnam(), mvault_tele(), pline(), rloc(), seetrap(), tele_restrict(), and teleport_pet().
Referenced by mintrap().
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().
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().
References COLNO, FALSE, goodpos(), In_W_tower(), rloc_pos_ok(), rloc_to(), rn1, rn2(), ROWNO, tele(), TRUE, u, you::ux, you::uy, you::uz, xdnladder, xupladder, xupstair, ydnladder, yupladder, and yupstair.
Referenced by clear_fcorr(), demon_talk(), dochug(), gd_move(), gem_accept(), goto_level(), hitmu(), m_move(), mbhitm(), mdamagem(), minliquid(), mk_mplayer(), mk_roamer(), mkcavepos(), mon_arrive(), mtele_trap(), mvault_tele(), priestini(), put_lregion_here(), shkinit(), stealamulet(), stealarm(), stealgold(), tactics(), u_teleport_mon(), use_defensive(), use_mirror(), and wallify_vault().
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().
void rloc_to | ( | struct monst * | mtmp, |
int | x, | ||
int | y | ||
) |
References docrt(), inhishop(), make_angry_shk(), newsym(), place_worm_tail_randomly(), remove_monster(), remove_worm(), set_apparxy(), u, update_monster_region(), you::ustuck, you::ux, and you::uy.
Referenced by mnearto(), mnexto(), mon_arrive(), mvault_tele(), revive_nasty(), rloc(), tactics(), u_teleport_mon(), and use_grapple().
void rloco | ( | struct obj * | obj ) |
References addtobill(), COLNO, CORPSE, costly_spot(), dndest, FALSE, flooreffects(), goodpos(), dest_area::hx, dest_area::hy, in_rooms(), index, is_rider, dest_area::lx, dest_area::ly, mons, newsym(), dest_area::nhx, dest_area::nhy, dest_area::nlx, dest_area::nly, obj_extract_self(), place_object(), revive_corpse(), rn1, rn2(), ROWNO, stolen_value(), u, you::urooms, you::ux, you::uy, and within_bounded_area.
Referenced by bhito(), flooreffects(), launch_obj(), mkcorpstat(), mon_arrive(), moverock(), and obj_delivery().
void tele | ( | ) |
References Blinded, BUFSZ, FALSE, dlevel_t::flags, getpos(), level, make_blinded(), mon_has_amulet(), mon_nam(), On_W_tower_level(), pline(), safe_teleds(), Sprintf, STEED, Stunned, teleds(), teleok(), Teleport_control, TRUE, u, you::uhave, unconscious(), you::ux, you::uy, you::uz, WIZARD, wizard, nhcoord::x, and nhcoord::y.
Referenced by cursed_book(), dosit(), dotele(), hitmu(), invault(), mbhitm(), moveloop(), rloc(), seffects(), tele_trap(), vault_tele(), and zapyourself().
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().
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().
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().
void teleds | ( | int | nux, |
int | nuy, | ||
boolean | allow_drag | ||
) |
References carried, monst::data, distmin(), docrt(), drag_ball(), FALSE, fill_pit(), hides_under, initrack(), invocation_message(), is_pool(), M_AP_NOTHING, monst::m_ap_type, permonst::mlet, move_bc(), newsym(), nomul(), OBJ_AT, OBJ_FREE, obj::ox, obj::oy, placebc(), Punished, S_EEL, S_MIMIC, see_monsters(), spoteffects(), TRUE, u, uball, unplacebc(), update_player_regions(), you::ustuck, you::uswldtim, you::utrap, you::ux, you::ux0, you::uy, you::uy0, vision_full_recalc, vision_recalc(), obj::where, and youmonst.
Referenced by drown(), e_died(), jump(), mattacku(), safe_teleds(), tele(), use_whip(), and vault_tele().
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().
References FALSE, get_mleash(), m_unleash(), Monnam(), otmp, TRUE, u, and yelp().
Referenced by digactualhole(), mlevel_tele_trap(), and mtele_trap().
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().
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().