Defines | Functions | Variables

hack.c File Reference

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

Defines

#define IS_SHOP(x)   (rooms[x].rtype >= SHOPBASE)
#define goodtype(rno)

Functions

STATIC_DCL void NDECL (maybe_wail)
STATIC_DCL int NDECL (moverock)
STATIC_DCL int FDECL (still_chewing,(XCHAR_P, XCHAR_P))
STATIC_DCL boolean FDECL (findtravelpath,(BOOLEAN_P))
STATIC_DCL boolean FDECL (monstinroom,(struct permonst *, int))
STATIC_DCL void FDECL (move_update,(BOOLEAN_P))
boolean revive_nasty (int x, int y, const char *msg)
STATIC_OVL int moverock ()
STATIC_OVL int still_chewing (xchar x, xchar y)
void movobj (struct obj *obj, xchar ox, xchar oy)
boolean may_dig (xchar x, xchar y)
boolean may_passwall (xchar x, xchar y)
boolean bad_rock (struct permonst *mdat, xchar x, xchar y)
boolean invocation_pos (xchar x, xchar y)
boolean test_move (int ux, int uy, int dx, int dy, int mode)
static boolean findtravelpath (boolean guess)
void domove ()
void invocation_message ()
void spoteffects (boolean pick)
STATIC_OVL boolean monstinroom (struct permonst *mdat, int roomno)
char * in_rooms (xchar x, xchar y, int typewanted)
boolean in_town (int x, int y)
STATIC_OVL void move_update (boolean newlev)
void check_special_room (boolean newlev)
int dopickup ()
void lookaround ()
int monster_nearby ()
void nomul (int nval, const char *txt)
void unmul (char *msg_override) const
STATIC_OVL void maybe_wail ()
void showdmg (int n, boolean you)
void losehp (int n, const char *knam, boolean k_format)
void losehp_how (int n, const char *knam, boolean k_format, int how)
int weight_cap ()
int inv_weight ()
int calc_capacity (int xtra_wt)
int near_capacity ()
int max_capacity ()
boolean check_capacity (char *str) const
int inv_cnt ()

Variables

static boolean door_opened
static int wc

Define Documentation

#define goodtype (   rno )
Value:
(!typewanted || \
             ((typefound = rooms[rno - ROOMOFFSET].rtype) == typewanted) || \
             ((typewanted == SHOPBASE) && (typefound > SHOPBASE))) \

Referenced by in_rooms().

#define IS_SHOP (   x )    (rooms[x].rtype >= SHOPBASE)

Referenced by move_update().


Function Documentation

boolean bad_rock ( struct permonst mdat,
xchar  x,
xchar  y 
)

References BOULDER, In_sokoban, IS_ROCK, levl, may_dig(), may_passwall(), needspick, passes_walls, sobj_at(), tunnels, u, and you::uz.

Referenced by domove(), hurtle_step(), mfndpos(), test_move(), and try_disarm().

Here is the call graph for this function:

Here is the caller graph for this function:

int calc_capacity ( int  xtra_wt )

References inv_weight(), min, OVERLOADED, UNENCUMBERED, and wc.

Referenced by lift_object(), near_capacity(), pickup_object(), and throwit().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean check_capacity ( char *  str ) const

References EXT_ENCUMBER, near_capacity(), and pline().

Referenced by attack(), doapply(), doeat(), dofire(), doloot(), doread(), dotele(), dothrow(), dozap(), engrave(), help_monster_out(), and spelleffects().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_special_room ( boolean  newlev )
void domove (  )

References A_CON, A_DEX, abuse_dog(), adjalign(), ART_STING, AT_EXPL, attack(), attacktype(), bad_rock(), bhitpos, bigmonst, Blind, body_part(), flag::botl, BOULDER, BUFSZ, canspotmon, check_leash(), clear_nhwindow, Cold_resistance, CONDUCT_PACIFISM, confdir(), Conflict, Confusion, curr_mon_load(), curs_on_u(), monst::data, defsyms, delay_output, display_nhwindow, distu, DO_MOVE, drag_ball(), you::dx, you::dy, exercise(), expl, symdef::explanation, fall_asleep(), FALSE, fill_pit(), find_skates(), findtravelpath(), flags, Flying, flag::forcefight, FROMOUTSIDE, gethungry(), glyph_is_invisible, growl(), Hallucination, HFumbling, hides_under, HVY_ENCUMBER, iflags, in_out_region(), In_sokoban, invocation_message(), Is_airlevel, is_clinger, IS_DOOR, is_floater, IS_FURNITURE, is_hider, is_ice(), is_lava(), is_pool(), IS_ROCK, is_safepet, Is_waterlevel, is_whirly, isok(), LEG, Levitation, levl, locomotion(), M_AP_FURNITURE, M_AP_NOTHING, M_AP_OBJECT, monst::m_ap_type, m_at, m_monnam(), m_unleash(), you::mh, you::mhmax, minliquid(), mintrap(), permonst::mlet, permonst::mmove, mon_nam(), mon_visible, flag::move, move_bc(), moves, monst::mtame, multi, monst::mx, monst::my, near_capacity(), newsym(), nomovemsg, nomul(), flag::nopick, obj::oartifact, OBJ_AT, obj::otyp, OVERLOADED, instance_flags::paranoid_trap, PIT, pline(), Protection_from_shape_changers, Punished, rehumanize(), remove_monster(), reset_occupations(), resists_cold, rn2(), rnd(), flag::run, RUN_CRAWL, RUN_LEAP, RUN_TPORT, instance_flags::runmode, S_EEL, seemimic(), sensemon, SLT_ENCUMBER, sobj_at(), SPIKED_PIT, spoteffects(), Sprintf, STEED, sticks(), Strcpy, stumble_onto_mimic(), Stunned, surface(), t_at(), test_move(), flag::time, TIMEOUT, trap_to_defsym, flag::travel, instance_flags::travel1, TRUE, TT_INFLOOR, TT_LAVA, TT_PIT, TT_WEB, trap::tx, trap::ty, rm::typ, u, u_wipe_engr(), uarmf, you::ugangr, you::uhp, you::uhpmax, you::umoved, Underwater, unmap_object(), Upolyd, upstart(), you::ustuck, you::utrap, you::utraptype, uwep, you::ux, you::ux0, you::uy, you::uy0, you::uz, flag::verbose, violated(), vision_full_recalc, vision_recalc(), water_friction(), WIN_MESSAGE, trap::x, nhcoord::x, trap::y, nhcoord::y, y_monnam(), yelp(), yn, and youmonst.

Referenced by moveloop(), and rhack().

Here is the call graph for this function:

Here is the caller graph for this function:

int dopickup (  )
STATIC_DCL boolean FDECL ( findtravelpath  ,
(BOOLEAN_P)   
)
STATIC_DCL boolean FDECL ( monstinroom  ,
(struct permonst *, int)   
)
STATIC_DCL int FDECL ( still_chewing  ,
(XCHAR_P, XCHAR_P)   
)
STATIC_DCL void FDECL ( move_update  ,
(BOOLEAN_P)   
)
static boolean findtravelpath ( boolean  guess ) [static]
char* in_rooms ( xchar  x,
xchar  y,
int  typewanted 
)
boolean in_town ( int  x,
int  y 
)

References FALSE, s_level::flags, mkroom::hx, inside_room(), Is_special(), mkroom::nsubrooms, rooms, TRUE, u, and you::uz.

Referenced by dig(), dipfountain(), dokick(), dryup(), mdig_tunnel(), still_chewing(), watch_dig(), watch_on_duty(), and zap_dig().

Here is the call graph for this function:

Here is the caller graph for this function:

int inv_cnt (  )

References invent, and obj::nobj.

Referenced by damageum(), dog_eat(), emergency_disrobe(), hold_another_object(), lift_object(), steal(), touchfood(), and use_container().

Here is the caller graph for this function:

int inv_weight (  )
void invocation_message (  )

References Blind, body_part(), BUFSZ, CANDELABRUM_OF_INVOCATION, carrying(), distu, Flying, FOOT, inv_pos, Invocation_lev(), invocation_pos(), Levitation, makeplural(), nomul(), On_stairs(), pline(), obj::spe, Sprintf, Strcpy, The(), u, you::ux, you::uy, you::uz, nhcoord::x, xname(), nhcoord::y, and y_monnam().

Referenced by domove(), and teleds().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean invocation_pos ( xchar  x,
xchar  y 
)

References inv_pos, Invocation_lev(), u, you::uz, nhcoord::x, and nhcoord::y.

Referenced by deadbook(), invocation_message(), occupied(), use_bell(), and use_candelabrum().

Here is the call graph for this function:

Here is the caller graph for this function:

void lookaround (  )
void losehp ( int  n,
const char *  knam,
boolean  k_format 
)
void losehp_how ( int  n,
const char *  knam,
boolean  k_format,
int  how 
)

References flag::botl, done(), flags, killer, killer_format, maybe_wail(), you::mh, you::mhmax, rehumanize(), showdmg(), TRUE, u, you::uhp, you::uhpmax, Unchanging, and Upolyd.

Referenced by losehp(), and poisoned().

Here is the call graph for this function:

Here is the caller graph for this function:

int max_capacity (  )

References inv_weight().

Referenced by carry_count(), and pickup_object().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean may_dig ( xchar  x,
xchar  y 
)

References IS_STWALL, levl, and W_NONDIGGABLE.

Referenced by bad_rock(), can_reach_location(), dig(), dog_move(), m_move(), mfndpos(), still_chewing(), and zap_dig().

Here is the caller graph for this function:

boolean may_passwall ( xchar  x,
xchar  y 
)

References IS_STWALL, levl, and W_NONPASSWALL.

Referenced by bad_rock(), badpos(), figurine_location_checks(), goodpos(), hurtle_step(), mfndpos(), and test_move().

Here is the caller graph for this function:

STATIC_OVL void maybe_wail (  )

References COLD_RES, DISINT_RES, FAST, FIRE_RES, if(), INTRINSIC, prop::intrinsic, INVIS, RoleName::m, moves, Role::name, pline(), PM_ELF, PM_VALKYRIE, PM_WIZARD, POISON_RES, Race_if, Role_if, SEE_INVIS, SHOCK_RES, SIZE, SLEEP_RES, STEALTH, TELEPORT, TELEPORT_CONTROL, u, you::uhp, you::uprops, urole, and wailmsg.

Referenced by losehp_how().

Here is the call graph for this function:

Here is the caller graph for this function:

int monster_nearby (  )

References canspotmon, monst::data, Hallucination, is_hider, isok(), M_AP_FURNITURE, M_AP_OBJECT, monst::m_ap_type, m_at, noattacks(), onscary(), u, you::ux, you::uy, trap::x, and trap::y.

Referenced by moveloop().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean monstinroom ( struct permonst mdat,
int  roomno 
)

References monst::data, DEADMONSTER, FALSE, fmon, in_rooms(), index, monst::mx, monst::my, monst::nmon, ROOMOFFSET, and TRUE.

Referenced by check_special_room().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void move_update ( boolean  newlev )

References in_rooms(), index, IS_SHOP, ROOMOFFSET, Strcpy, u, you::uentered, you::urooms, you::urooms0, you::ushops, you::ushops0, you::ushops_entered, you::ushops_left, you::ux, and you::uy.

Referenced by check_special_room().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int moverock (  )
void movobj ( struct obj obj,
xchar  ox,
xchar  oy 
)

References newsym(), place_object(), and remove_object().

Referenced by drop_ball(), float_down(), move_bc(), and moverock().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL void NDECL ( maybe_wail   )
STATIC_DCL int NDECL ( moverock   )
int near_capacity (  )
void nomul ( int  nval,
const char *  txt 
)
boolean revive_nasty ( int  x,
int  y,
const char *  msg 
)

References CORPSE, obj::corpsenm, monst::data, enexto(), FALSE, goodpos(), is_rider, level, m_at, mons, dlevel_t::objects, otmp, obj::otyp, PM_WIZARD_OF_YENDOR, revive_corpse(), rloc_to(), nhcoord::x, and nhcoord::y.

Referenced by close_drawbridge(), moverock(), and open_drawbridge().

Here is the call graph for this function:

Here is the caller graph for this function:

void showdmg ( int  n,
boolean  you 
)

Print the amount n of damage inflicted. In contrast to Slash'Em, in UnNetHack the damage is only shown in Wizard mode.

Parameters:
nPrint the amount n of damage inflicted. In contrast to Slash'Em, in UnNetHack the damage is only shown in Wizard mode. amount of damage inflicted
youPrint the amount n of damage inflicted. In contrast to Slash'Em, in UnNetHack the damage is only shown in Wizard mode. true, if you are hit

References iflags, pline(), instance_flags::showdmg, and wizard.

Referenced by buzz(), damageum(), explode(), hmon_hitmon(), kickdmg(), losehp_how(), and mdamageu().

Here is the call graph for this function:

Here is the caller graph for this function:

void spoteffects ( boolean  pick )
STATIC_OVL int still_chewing ( xchar  x,
xchar  y 
)
boolean test_move ( int  ux,
int  uy,
int  dx,
int  dy,
int  mode 
)
void unmul ( char *  msg_override ) const

References BUFSZ, multi, multi_txt, nomovemsg, pline(), u, you::usleep, and You_can_move_again.

Referenced by drown(), invault(), mattacku(), moveloop(), polyman(), polymon(), and steal().

Here is the call graph for this function:

Here is the caller graph for this function:

int weight_cap (  )

Variable Documentation

boolean door_opened [static]
int wc [static]

Referenced by calc_capacity(), and try_lift().