Defines | Functions | Variables

pickup.c File Reference

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

Defines

#define FOLLOW(curr, flags)   (((flags) & BY_NEXTHERE) ? (curr)->nexthere : (curr)->nobj)
#define DELTA_CWT(cont, obj)
#define GOLD_WT(n)   (((n) + 50L) / 100L)
#define GOLD_CAPACITY(w, n)   (((w) * -100L) - ((n) + 50L) - 1L)
#define Icebox   (current_container->otyp == ICE_BOX)

Functions

STATIC_DCL void FDECL (simple_look,(struct obj *, BOOLEAN_P))
STATIC_DCL boolean FDECL (query_classes,(char *, boolean *, boolean *, const char *, struct obj *, BOOLEAN_P, BOOLEAN_P, int *))
STATIC_DCL void FDECL (check_here,(BOOLEAN_P))
STATIC_DCL boolean FDECL (n_or_more,(struct obj *))
STATIC_DCL boolean FDECL (all_but_uchain,(struct obj *))
STATIC_DCL int FDECL (autopick,(struct obj *, int, menu_item **))
STATIC_DCL int FDECL (count_categories,(struct obj *, int))
STATIC_DCL long FDECL (carry_count,(struct obj *, struct obj *, long, BOOLEAN_P, int *, int *))
STATIC_DCL int FDECL (lift_object,(struct obj *, struct obj *, long *, BOOLEAN_P))
STATIC_DCL boolean FDECL (mbag_explodes,(struct obj *, int))
STATIC_PTR int FDECL (in_container,(struct obj *))
STATIC_PTR int FDECL (ck_bag,(struct obj *))
STATIC_PTR int FDECL (out_container,(struct obj *))
STATIC_DCL long FDECL (mbag_item_gone,(int, struct obj *))
STATIC_DCL void FDECL (observe_quantum_cat,(struct obj *))
STATIC_DCL int FDECL (menu_loot,(int, struct obj *, BOOLEAN_P))
STATIC_DCL int FDECL (in_or_out_menu,(const char *, struct obj *, BOOLEAN_P, BOOLEAN_P))
STATIC_DCL int FDECL (container_at,(int, int, BOOLEAN_P))
STATIC_DCL boolean FDECL (able_to_loot,(int, int))
STATIC_DCL boolean FDECL (mon_beside,(int, int))
STATIC_DCL void NDECL (del_sokoprize)
STATIC_OVL void simple_look (struct obj *otmp, boolean here)
int collect_obj_classes (ilets, struct obj *otmp, boolean here, boolean incl_gold, filter, int *itemcount)
STATIC_OVL boolean query_classes (oclasses, boolean *one_at_a_time, boolean *everything, const char *action, struct obj *objs, boolean here, boolean incl_gold, int *menu_on_demand)
STATIC_OVL void check_here (boolean picked_some)
STATIC_OVL boolean n_or_more (struct obj *obj)
void add_valid_menu_class (int c)
STATIC_OVL boolean all_but_uchain (struct obj *obj)
boolean allow_all (struct obj *obj)
boolean allow_category (struct obj *obj)
boolean is_worn_by_type (struct obj *otmp)
int pickup (int what)
STATIC_OVL int autopick (struct obj *olist, int follow, menu_item **pick_list)
int query_objlist (char *qstr, struct obj *olist, int qflags, menu_item **pick_list, int how, allow) const
int query_category (char *qstr, struct obj *olist, int qflags, menu_item **pick_list, int how) const
STATIC_OVL int count_categories (struct obj *olist, int qflags)
STATIC_OVL long carry_count (struct obj *obj, struct obj *container, long count, boolean telekinesis, int *wt_before, int *wt_after)
STATIC_OVL int lift_object (struct obj *obj, struct obj *container, long *cnt_p, boolean telekinesis)
const char * safe_qbuf (char *qbuf, unsigned padlength, char *planA, char *planB, char *last_resort) const
int pickup_object (struct obj *obj, long count, boolean telekinesis)
struct objpick_obj (struct obj *otmp)
int encumber_msg ()
STATIC_OVL int container_at (int x, int y, boolean countem)
STATIC_OVL boolean able_to_loot (int x, int y)
STATIC_OVL boolean mon_beside (int x, int y)
int doloot ()
int loot_mon (struct monst *mtmp, int *passed_info, boolean *prev_loot)
STATIC_OVL boolean mbag_explodes (struct obj *obj, int depthin)
STATIC_PTR int in_container (struct obj *obj)
STATIC_PTR int ck_bag (struct obj *obj)
STATIC_PTR int out_container (struct obj *obj)
STATIC_OVL long mbag_item_gone (int held, struct obj *item)
STATIC_OVL void observe_quantum_cat (struct obj *box)
int use_container (struct obj *obj, int held)
STATIC_OVL int menu_loot (int retry, struct obj *container, boolean put_in)
STATIC_OVL int in_or_out_menu (char *prompt, struct obj *obj, boolean outokay, boolean inokay) const
STATIC_OVL void del_sokoprize ()

Variables

static const char moderateloadmsg [] = "You have a little trouble lifting"
static const char nearloadmsg [] = "You have much trouble lifting"
static const char overloadmsg [] = "You have extreme difficulty lifting"
static long val_for_n_or_more
static char valid_menu_classes [MAXOCLASSES+2]
static NEARDATA struct objcurrent_container

Define Documentation

#define DELTA_CWT (   cont,
  obj 
)
Value:
((cont)->cursed ? (obj)->owt * 2 :      \
                      1 + ((obj)->owt / ((cont)->blessed ? 4 : 2)))

Referenced by carry_count().

#define FOLLOW (   curr,
  flags 
)    (((flags) & BY_NEXTHERE) ? (curr)->nexthere : (curr)->nobj)
#define GOLD_CAPACITY (   w,
 
)    (((w) * -100L) - ((n) + 50L) - 1L)

Referenced by carry_count(), and pickup_object().

#define GOLD_WT (   n )    (((n) + 50L) / 100L)

Referenced by carry_count(), and pickup_object().

#define Icebox   (current_container->otyp == ICE_BOX)

Referenced by in_container(), and out_container().


Function Documentation

STATIC_OVL boolean able_to_loot ( int  x,
int  y 
)

References body_part(), can_reach_floor(), monst::data, FALSE, freehand(), HAND, is_lava(), is_pool(), nolimbs, P_BASIC, P_SKILL, pline(), surface(), TRUE, u, and youmonst.

Referenced by doloot().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_valid_menu_class ( int  c )

Referenced by doddoremarm(), doddrop(), ggetobj(), menu_drop(), menu_loot(), menu_remarm(), pickup(), query_classes(), and use_container().

Here is the caller graph for this function:

STATIC_OVL boolean all_but_uchain ( struct obj obj )

References uchain.

Referenced by pickup().

Here is the caller graph for this function:

boolean allow_all ( struct obj obj )

References TRUE.

Referenced by display_cinventory(), display_minventory(), menu_drop(), menu_loot(), and pickup().

Here is the caller graph for this function:

boolean allow_category ( struct obj obj )

References COIN_CLASS, FALSE, index, not_fully_identified(), PM_PRIEST, Role_if, and TRUE.

Referenced by ckvalidcat(), menu_drop(), menu_loot(), and pickup().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int autopick ( struct obj olist,
int  follow,
menu_item **  pick_list 
)
STATIC_OVL long carry_count ( struct obj obj,
struct obj container,
long  count,
boolean  telekinesis,
int *  wt_before,
int *  wt_after 
)

References BAG_OF_HOLDING, BUFSZ, carried, COIN_CLASS, DELTA_CWT, doname(), GOLD_CAPACITY, GOLD_WT, if(), invent, max_capacity(), otense(), obj::quan, Sprintf, STATIC_OVL, Strcpy, the(), u, you::ugold, weight(), where, and xname().

Referenced by lift_object().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void check_here ( boolean  picked_some )

References flags, flush_screen(), level, look_here(), nomul(), dlevel_t::objects, read_engr_at(), flag::run, u, uchain, you::ux, and you::uy.

Referenced by pickup().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int ck_bag ( struct obj obj )

References current_container.

Referenced by use_container().

Here is the caller graph for this function:

int collect_obj_classes ( ilets  ,
struct obj otmp,
boolean  here,
boolean  incl_gold,
filter  ,
int *  itemcount 
)

References COIN_CLASS, def_oc_syms, if(), index, and otmp.

Referenced by dotypeinv(), ggetobj(), and query_classes().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int container_at ( int  x,
int  y,
boolean  countem 
)

References obj::cobj, Is_container, level, obj::nobj, and dlevel_t::objects.

Referenced by doloot().

Here is the caller graph for this function:

STATIC_OVL int count_categories ( struct obj olist,
int  qflags 
)

References FALSE, flags, FOLLOW, flag::inv_order, obj::oclass, obj::owornmask, TRUE, W_AMUL, W_ARMOR, W_QUIVER, W_RING, W_SWAPWEP, W_TOOL, W_WEP, and WORN_TYPES.

Referenced by query_category().

Here is the caller graph for this function:

STATIC_OVL void del_sokoprize (  )

References an(), dlevel_t::buriedobjlist, cansee, flags, fobj, Is_sokoprize, level, newsym(), obj::nobj, obfree(), obj_extract_self(), otmp, obj::ox, obj::oy, flag::soundok, and xname().

Referenced by pickup_object().

Here is the call graph for this function:

Here is the caller graph for this function:

int doloot (  )
int encumber_msg (  )
STATIC_DCL boolean FDECL ( n_or_more  ,
(struct obj *)   
)
STATIC_DCL long FDECL ( carry_count  ,
(struct obj *, struct obj *, long, BOOLEAN_P, int *, int *)   
)
STATIC_DCL int FDECL ( menu_loot  ,
(int, struct obj *, BOOLEAN_P)   
)
STATIC_DCL int FDECL ( in_or_out_menu  ,
(const char *, struct obj *, BOOLEAN_P, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( simple_look  ,
(struct obj *, BOOLEAN_P)   
)
STATIC_DCL int FDECL ( container_at  ,
(int, int, BOOLEAN_P)   
)
STATIC_DCL int FDECL ( lift_object  ,
(struct obj *, struct obj *, long *, BOOLEAN_P)   
)
STATIC_DCL boolean FDECL ( able_to_loot  ,
(int, int)   
)
STATIC_DCL boolean FDECL ( mon_beside  ,
(int, int)   
)
STATIC_DCL boolean FDECL ( query_classes  ,
(char *, boolean *, boolean *, const char *, struct obj *, BOOLEAN_P, BOOLEAN_P, int *)   
)
STATIC_DCL boolean FDECL ( mbag_explodes  ,
(struct obj *, int)   
)
STATIC_DCL boolean FDECL ( all_but_uchain  ,
(struct obj *)   
)
STATIC_DCL long FDECL ( mbag_item_gone  ,
(int, struct obj *)   
)
STATIC_PTR int FDECL ( in_container  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( autopick  ,
(struct obj *, int, menu_item **)   
)
STATIC_PTR int FDECL ( ck_bag  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( check_here  ,
(BOOLEAN_P)   
)
STATIC_PTR int FDECL ( out_container  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( count_categories  ,
(struct obj *, int)   
)
STATIC_DCL void FDECL ( observe_quantum_cat  ,
(struct obj *)   
)
STATIC_PTR int in_container ( struct obj obj )
STATIC_OVL int in_or_out_menu ( char *  prompt,
struct obj obj,
boolean  outokay,
boolean  inokay 
) const

References any::a_int, any::a_void, add_menu, ATR_NONE, BUFSZ, create_nhwindow, destroy_nhwindow, end_menu, iflags, mi::item, instance_flags::lootabc, MENU_UNSELECTED, NHW_MENU, NO_GLYPH, PICK_ONE, select_menu, something, Sprintf, start_menu, the(), and xname().

Referenced by use_container().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean is_worn_by_type ( struct obj otmp )

References index, W_AMUL, W_ARMOR, W_QUIVER, W_RING, W_SWAPWEP, W_TOOL, and W_WEP.

Referenced by menu_remarm().

Here is the caller graph for this function:

STATIC_OVL int lift_object ( struct obj obj,
struct obj container,
long *  cnt_p,
boolean  telekinesis 
)
int loot_mon ( struct monst mtmp,
int *  passed_info,
boolean prev_loot 
)

References ARTICLE_THE, monst::data, doname(), FALSE, hold_another_object(), nolimbs, obj_extract_self(), otmp, obj::owornmask, pickup(), QBUFSZ, rnd(), Sprintf, SUPPRESS_SADDLE, TRUE, u, update_mon_intrinsics(), which_armor(), x_monnam(), yn_function(), ynqchars, and youmonst.

Referenced by dopickup().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean mbag_explodes ( struct obj obj,
int  depthin 
)

References BAG_OF_TRICKS, obj::cobj, FALSE, Has_contents, Is_mbag, obj::nobj, otmp, rn2(), TRUE, and WAN_CANCELLATION.

Referenced by in_container().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL long mbag_item_gone ( int  held,
struct obj item 
)

References Blind, costly_spot(), doname(), Doname2(), obfree(), otense(), pline(), shop_keeper(), stolen_value(), TRUE, u, you::ushops, you::ux, and you::uy.

Referenced by use_container().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int menu_loot ( int  retry,
struct obj container,
boolean  put_in 
)
STATIC_OVL boolean mon_beside ( int  x,
int  y 
)

References FALSE, isok(), MON_AT, and TRUE.

Here is the call graph for this function:

STATIC_OVL boolean n_or_more ( struct obj obj )

References FALSE, and uchain.

Referenced by pickup().

Here is the caller graph for this function:

STATIC_DCL void NDECL ( del_sokoprize   )
STATIC_OVL void observe_quantum_cat ( struct obj box )
STATIC_PTR int out_container ( struct obj obj )
struct obj* pick_obj ( struct obj otmp ) [read]

References addinv(), addtobill(), costly_spot(), FALSE, in_rooms(), index, newsym(), obj_extract_self(), remote_burglary(), SHOPBASE, Strcpy, TRUE, u, uball, and you::ushops.

Referenced by pickup_object().

Here is the call graph for this function:

Here is the caller graph for this function:

int pickup ( int  what )
int pickup_object ( struct obj obj,
long  count,
boolean  telekinesis 
)
int query_category ( char *  qstr,
struct obj olist,
int  qflags,
menu_item **  pick_list,
int  how 
) const
STATIC_OVL boolean query_classes ( oclasses  ,
boolean one_at_a_time,
boolean everything,
const char *  action,
struct obj objs,
boolean  here,
boolean  incl_gold,
int *  menu_on_demand 
)

References add_valid_menu_class(), BUFSZ, collect_obj_classes(), def_char_to_objclass(), display_inventory(), FALSE, FDECL, getlin, index, invent, QBUFSZ, simple_look(), Sprintf, TRUE, and where.

Referenced by pickup(), and use_container().

Here is the call graph for this function:

Here is the caller graph for this function:

int query_objlist ( char *  qstr,
struct obj olist,
int  qflags,
menu_item **  pick_list,
int  how,
allow   
) const
const char* safe_qbuf ( char *  qbuf,
unsigned  padlength,
char *  planA,
char *  planB,
char *  last_resort 
) const

References QBUFSZ.

Referenced by askchain(), do_break_wand(), do_oname(), dodip(), doforce(), doloot(), lift_object(), pick_lock(), pickup(), untrap(), use_candle(), and use_container().

Here is the caller graph for this function:

STATIC_OVL void simple_look ( struct obj otmp,
boolean  here 
)

References create_nhwindow, destroy_nhwindow, display_nhwindow, doname(), NHW_MENU, pline(), putstr, and TRUE.

Referenced by query_classes().

Here is the call graph for this function:

Here is the caller graph for this function:

int use_container ( struct obj obj,
int  held 
)

Variable Documentation

NEARDATA struct obj* current_container [static]

Referenced by ck_bag().

const char moderateloadmsg[] = "You have a little trouble lifting" [static]
const char nearloadmsg[] = "You have much trouble lifting" [static]
const char overloadmsg[] = "You have extreme difficulty lifting" [static]
long val_for_n_or_more [static]
char valid_menu_classes[MAXOCLASSES+2] [static]