Defines | Functions | Variables

cmd.c File Reference

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

Defines

#define CMD_TRAVEL   (char)0x90
#define enl_msg(prefix, present, past, suffix)   enlght_line(prefix, final ? past : present, suffix)
#define you_are(attr)   enl_msg(You_,are,were,attr)
#define you_have(attr)   enl_msg(You_,have,had,attr)
#define you_can(attr)   enl_msg(You_,can,could,attr)
#define you_have_been(goodthing)   enl_msg(You_,have_been,were,goodthing)
#define you_have_never(badthing)   enl_msg(You_,have_never,never,badthing)
#define you_have_X(something)   enl_msg(You_,have,(const char *)"",something)
#define M(c)   (0x80 | (c))
#define C(c)   (0x1f & (c))
#define unctrl(c)   ((c) <= C('z') ? (0x60 | (c)) : (c))
#define unmeta(c)   (0x7f & (c))

Functions

static int NDECL ((*timed_occ_fn))
STATIC_PTR int NDECL (doprev_message)
STATIC_PTR int NDECL (timed_occupation)
STATIC_PTR int NDECL (doextcmd)
STATIC_PTR int NDECL (domonability)
STATIC_PTR int NDECL (dooverview_or_wiz_where)
STATIC_PTR int NDECL (dotravel)
int NDECL (tutorial_redisplay)
STATIC_PTR int NDECL (enter_explore_mode)
STATIC_PTR int NDECL (doattributes)
STATIC_PTR int NDECL (doconduct)
STATIC_PTR boolean NDECL (minimal_enlightenment)
STATIC_DCL void FDECL (enlght_line,(const char *, const char *, const char *))
STATIC_DCL char * FDECL (enlght_combatinc,(const char *, int, int, char *))
STATIC_DCL char * NDECL (parse)
STATIC_DCL boolean FDECL (help_dir,(CHAR_P, const char *))
STATIC_PTR int doprev_message ()
STATIC_PTR int timed_occupation ()
void reset_occupations ()
void set_occupation (fn, const char *txt, int xtime)
STATIC_PTR int doextcmd ()
int doextlist ()
STATIC_PTR int domonability ()
STATIC_PTR int enter_explore_mode ()
STATIC_PTR int dooverview_or_wiz_where ()
static void enlght_line (char *start, char *middle, char *end) const
static char * enlght_combatinc (char *inctyp, int incamt, int final, char *outbuf) const
void enlightenment (int final, boolean want_disp)
STATIC_OVL boolean minimal_enlightenment ()
STATIC_PTR int doattributes ()
STATIC_PTR int doconduct ()
void show_conduct (int final, boolean want_disp)
void rhack (char *cmd)
int xytod (schar x, schar y)
void dtoxy (coord *cc, int dd)
int movecmd (char sym)
int get_adjacent_loc (char *prompt, char *emsg, xchar x, xchar y, coord *cc) const
int getdir (char *s) const
STATIC_OVL boolean help_dir (char sym, const char *msg)
void confdir ()
int isok (int x, int y)
const char * click_to_cmd (int x, int y, int mod)
STATIC_OVL char * parse ()
char readchar ()
STATIC_PTR int dotravel ()
char yn_function (char *query, char *resp, char def) const
char paranoid_yn (char *query, boolean paranoid) const

Variables

static const char * readchar_queue = ""
static winid en_win
static const char You_ [] = "You "
static const char are [] = "are "
static const char were [] = "were "
static const char have [] = "have "
static const char had [] = "had "
static const char can [] = "can "
static const char could [] = "could "
static const char have_been [] = "have been "
static const char have_never [] = "have never "
static const char never [] = "never "
static int want_display = FALSE
static struct func_tab cmdlist []
struct ext_func_tab extcmdlist []
static NEARDATA int last_multi

Define Documentation

#define C (   c )    (0x1f & (c))

Referenced by click_to_cmd(), and rhack().

#define CMD_TRAVEL   (char)0x90

Referenced by click_to_cmd(), dotravel(), and rhack().

#define enl_msg (   prefix,
  present,
  past,
  suffix 
)    enlght_line(prefix, final ? past : present, suffix)

Referenced by enlightenment(), and show_conduct().

#define M (   c )    (0x80 | (c))

Referenced by click_to_cmd(), and rhack().

#define unctrl (   c )    ((c) <= C('z') ? (0x60 | (c)) : (c))

Referenced by rhack().

#define unmeta (   c )    (0x7f & (c))

Referenced by rhack().

#define you_are (   attr )    enl_msg(You_,are,were,attr)

Referenced by enlightenment().

#define you_can (   attr )    enl_msg(You_,can,could,attr)

Referenced by enlightenment().

#define you_have (   attr )    enl_msg(You_,have,had,attr)

Referenced by enlightenment().

#define you_have_been (   goodthing )    enl_msg(You_,have_been,were,goodthing)
#define you_have_never (   badthing )    enl_msg(You_,have_never,never,badthing)

Referenced by show_conduct().

#define you_have_X (   something )    enl_msg(You_,have,(const char *)"",something)

Referenced by show_conduct().


Function Documentation

const char* click_to_cmd ( int  x,
int  y,
int  mod 
)
void confdir (  )

References you::dx, you::dy, PM_GRID_BUG, rn2(), u, you::umonnum, xdir, and ydir.

Referenced by domove(), getdir(), use_pick_axe2(), use_stethoscope(), and use_whip().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int doattributes (  )

References discover, enlightenment(), minimal_enlightenment(), TRUE, and wizard.

Here is the call graph for this function:

STATIC_PTR int doconduct (  )

References show_conduct(), and TRUE.

Here is the call graph for this function:

STATIC_PTR int doextcmd (  )

References doextlist(), extcmdlist, and get_ext_cmd.

Here is the call graph for this function:

int doextlist (  )

References BUFSZ, create_nhwindow, destroy_nhwindow, display_nhwindow, ext_func_tab::ef_desc, ext_func_tab::ef_txt, extcmdlist, FALSE, NHW_TEXT, putstr, and Sprintf.

Referenced by doextcmd(), and dohelp().

Here is the caller graph for this function:

STATIC_PTR int domonability (  )
STATIC_PTR int dooverview_or_wiz_where (  )

References dooverview().

Here is the call graph for this function:

STATIC_PTR int doprev_message (  )

References nh_doprev_message.

STATIC_PTR int dotravel (  )
void dtoxy ( coord cc,
int  dd 
)

References xdir, and ydir.

Referenced by dog_move().

Here is the caller graph for this function:

static char* enlght_combatinc ( char *  inctyp,
int  incamt,
int  final,
char *  outbuf 
) const [static]

References an(), Sprintf, wizard, and WIZARD.

Referenced by enlightenment().

Here is the call graph for this function:

Here is the caller graph for this function:

static void enlght_line ( char *  start,
char *  middle,
char *  end 
) const [static]

References BUFSZ, dump_list_item(), putstr, and Sprintf.

Here is the call graph for this function:

void enlightenment ( int  final,
boolean  want_disp 
)

References a_monnam(), Acid_resistance, Adornment, Aggravate_monster, ALIGNLIM, Amphibious, an(), Antimagic, ARTICLE_YOUR, BInvis, Blind_telepat, Blinded, body_part(), Breathless, BUFSZ, can_pray(), carrying(), Clairvoyant, Cold_resistance, Conflict, Confusion, create_nhwindow, monst::data, destroy_nhwindow, Detect_monsters, Disint_resistance, Displaced, display_nhwindow, Drain_resistance, dump(), dump_list_end(), dump_list_start(), dump_title(), EInvis, enl_msg, enlght_combatinc(), eos(), FALSE, Fast, FINGER, Fire_resistance, Fixed_abil, flags, Flying, Free_action, Fumbling, Glib, Halluc_resistance, Hallucination, highc(), HInvis, HProtection, Hunger, Infravision, INTRINSIC, Invis, Invisible, Invulnerable, Jumping, killer, LEG, Lev_at_will, level_difficulty(), Levitation, Lifesaved, LOW_PM, Luck, LUCKSTONE, M2_DEMON, M2_GIANT, M2_ORC, M2_UNDEAD, M2_WERE, makeplural(), max_monster_difficulty(), min_monster_difficulty(), permonst::mname, mons, you::moreluck, you::mtimedone, NHW_MENU, ordin(), obj::otyp, Passes_walls, pm_invisible, Poison_resistance, Polymorph, Polymorph_control, Protection, Protection_from_shape_changers, putstr, align::record, Reflecting, Regeneration, RIN_ADORNMENT, RIN_PROTECTION, Searching, See_invisible, Shock_resistance, Sick, SICK_NONVOMITABLE, Sick_resistance, SICK_VOMITABLE, Sleep_resistance, Sleeping, Slimed, Slow_digestion, something, obj::spe, Sprintf, Stealth, STEED, sticks(), stone_luck(), Stone_resistance, Stoned, Strangled, Strcpy, Stunned, SUPPRESS_HALLUCINATION, SUPPRESS_SADDLE, Swimming, Teleport_control, Teleportation, TRUE, you::twoweap, u, u_gname(), you::ualign, you::ublesscnt, you::ublessed, you::udaminc, you::uevent, you::ugangr, you::uhitinc, you::uhunger, uleft, you::ulycn, you::umconf, you::umonnum, you::umortality, Unchanging, Undead_warning, Upolyd, uright, you::uspellprot, you::ustuck, you::uswldtim, uwep, Very_fast, Warn_of_mon, Warning, flag::warntype, wizard, Wounded_legs, Wwalking, x_monnam(), y_monnam(), You_, you_are, you_can, you_have, and youmonst.

Referenced by arti_invoke(), disclose(), doattributes(), drinkfountain(), peffects(), and zapnodir().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int enter_explore_mode (  )

References clear_nhwindow, discover, iflags, instance_flags::paranoid_quit, paranoid_yn(), pline(), TRUE, WIN_MESSAGE, and wizard.

Here is the call graph for this function:

STATIC_DCL boolean FDECL ( help_dir  ,
(CHAR_P, const char *)   
)
STATIC_DCL void FDECL ( enlght_line  ,
(const char *, const char *, const char *)   
)
STATIC_DCL char* FDECL ( enlght_combatinc  ,
(const char *, int, int, char *)   
)
int get_adjacent_loc ( char *  prompt,
char *  emsg,
xchar  x,
xchar  y,
coord cc 
) const

References you::dx, you::dy, getdir(), isok(), Never_mind, pline(), u, nhcoord::x, and nhcoord::y.

Referenced by pick_lock(), and use_leash().

Here is the call graph for this function:

Here is the caller graph for this function:

int getdir ( char *  s ) const
STATIC_OVL boolean help_dir ( char  sym,
const char *  msg 
)

References BUFSZ, create_nhwindow, destroy_nhwindow, display_nhwindow, dowhatdoes_core(), expl, FALSE, highc(), iflags, index, letter(), NHW_TEXT, instance_flags::num_pad, PM_GRID_BUG, putstr, Sprintf, TRUE, u, you::umonnum, and wizard.

Referenced by getdir(), and rhack().

Here is the call graph for this function:

Here is the caller graph for this function:

int isok ( int  x,
int  y 
)
STATIC_OVL boolean minimal_enlightenment (  )
int movecmd ( char  sym )

References you::dx, you::dy, you::dz, iflags, index, ndir, instance_flags::num_pad, PM_GRID_BUG, sdir, u, you::umonnum, xdir, ydir, and zdir.

Referenced by getdir(), rhack(), and use_pick_axe().

Here is the caller graph for this function:

STATIC_PTR int NDECL ( timed_occupation   )
int NDECL ( tutorial_redisplay   )
STATIC_PTR int NDECL ( doprev_message   )
static int NDECL ( timed_occ_fn ) [static]
STATIC_PTR int NDECL ( domonability   )
STATIC_PTR int NDECL ( doattributes   )
STATIC_PTR int NDECL ( dooverview_or_wiz_where   )
STATIC_PTR int NDECL ( doextcmd   )
STATIC_PTR boolean NDECL ( minimal_enlightenment   )
STATIC_DCL char* NDECL ( parse   )
STATIC_PTR int NDECL ( dotravel   )
STATIC_PTR int NDECL ( enter_explore_mode   )
STATIC_PTR int NDECL ( doconduct   )
char paranoid_yn ( char *  query,
boolean  paranoid 
) const

Asks the player a yes/no question if paranoid is true.

Returns:
'y' or 'n'

References BUFSZ, getlin, lcase(), Sprintf, and yn.

Referenced by attack_checks(), done(), done2(), and enter_explore_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL char* parse (  )

References clear_nhwindow, COLNO, FALSE, flags, flush_screen(), iflags, in_line, LARGEST_INT, last_multi, mark_synch, flag::move, multi, instance_flags::num_pad, pline(), readchar(), save_cm, Sprintf, TRUE, and WIN_MESSAGE.

Referenced by rhack().

Here is the call graph for this function:

Here is the caller graph for this function:

char readchar (  )

References click_to_cmd(), Getchar, nh_poskey, u, you::ux, and you::uy.

Referenced by getdir(), getobj(), and parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_occupations (  )

References reset_pick(), reset_remarm(), and reset_trapset().

Referenced by doddrop(), dodrop(), domove(), and gulpmu().

Here is the call graph for this function:

Here is the caller graph for this function:

void rhack ( char *  cmd )
void set_occupation ( fn  ,
const char *  txt,
int  xtime 
)

References occtime, occtxt, timed_occupation(), and txt.

Referenced by doddoremarm(), doforce(), dowipe(), eatspecial(), pick_lock(), rhack(), start_eating(), start_tin(), study_book(), take_off(), use_pick_axe2(), and use_trap().

Here is the call graph for this function:

Here is the caller graph for this function:

void show_conduct ( int  final,
boolean  want_disp 
)
STATIC_PTR int timed_occupation (  )

References multi.

Referenced by set_occupation().

Here is the caller graph for this function:

int xytod ( schar  x,
schar  y 
)

References xdir, and ydir.

Referenced by click_to_cmd(), and dog_move().

Here is the caller graph for this function:

char yn_function ( char *  query,
char*  resp,
char  def 
) const

Variable Documentation

const char are[] = "are "
const char can[] = "can "

Referenced by use_tinning_kit().

struct func_tab cmdlist[] [static]
const char could[] = "could "
winid en_win [static]

Referenced by doextcmd(), and doextlist().

const char had[] = "had "
const char have[] = "have "
const char have_been[] = "have been " [static]
const char have_never[] = "have never "
NEARDATA int last_multi [static]

Referenced by parse().

const char never[] = "never "
const char* readchar_queue = "" [static]
int want_display = FALSE [static]
const char were[] = "were "
const char You_[] = "You " [static]

Referenced by enlightenment(), and show_conduct().