Defines | Functions | Variables

shk.c File Reference

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

Defines

#define PAY_SOME   2
#define PAY_BUY   1
#define PAY_CANT   0
#define PAY_SKIP   (-1)
#define PAY_BROKE   (-2)
#define IS_SHOP(x)   (rooms[x].rtype >= SHOPBASE)
#define HUNGRY   2
#define NEED_UPDATE   1
#define OPEN   2
#define INSHOP   4
#define horiz(i)   ((i%3)-1)
#define vert(i)   ((i/3)-1)
#define GDIST(x, y)   (dist2(x,y,gx,gy))

Functions

STATIC_DCL void FDECL (setpaid,(struct monst *))
STATIC_DCL long FDECL (addupbill,(struct monst *))
STATIC_DCL void FDECL (pacify_shk,(struct monst *))
STATIC_DCL struct bill_xFDECL (onbill,(struct obj *, struct monst *, BOOLEAN_P))
STATIC_DCL struct monstFDECL (next_shkp,(struct monst *, BOOLEAN_P))
STATIC_DCL long FDECL (shop_debt,(struct eshk *))
STATIC_DCL char * FDECL (shk_owns,(char *, struct obj *))
STATIC_DCL char * FDECL (mon_owns,(char *, struct obj *))
STATIC_DCL void FDECL (clear_unpaid,(struct obj *))
STATIC_DCL long FDECL (check_credit,(long, struct monst *))
STATIC_DCL void FDECL (pay,(long, struct monst *))
STATIC_DCL long FDECL (get_cost,(struct obj *, struct monst *))
STATIC_DCL long FDECL (set_cost,(struct obj *, struct monst *))
STATIC_DCL const char * FDECL (shk_embellish,(struct obj *, long))
STATIC_DCL long FDECL (cost_per_charge,(struct monst *, struct obj *, BOOLEAN_P))
STATIC_DCL long FDECL (cheapest_item,(struct monst *))
STATIC_DCL int FDECL (dopayobj,(struct monst *, struct bill_x *, struct obj **, int, BOOLEAN_P))
STATIC_DCL long FDECL (stolen_container,(struct obj *, struct monst *, long, BOOLEAN_P))
STATIC_DCL long FDECL (getprice,(struct obj *, BOOLEAN_P))
STATIC_DCL void FDECL (shk_names_obj,(struct monst *, struct obj *, const char *, long, const char *))
STATIC_DCL struct objFDECL (bp_to_obj,(struct bill_x *))
STATIC_DCL boolean FDECL (inherits,(struct monst *, int, int))
STATIC_DCL void FDECL (set_repo_loc,(struct eshk *))
STATIC_DCL boolean NDECL (angry_shk_exists)
STATIC_DCL void FDECL (rile_shk,(struct monst *))
STATIC_DCL void FDECL (rouse_shk,(struct monst *, BOOLEAN_P))
STATIC_DCL void FDECL (remove_damage,(struct monst *, BOOLEAN_P))
STATIC_DCL void FDECL (sub_one_frombill,(struct obj *, struct monst *))
STATIC_DCL void FDECL (add_one_tobill,(struct obj *, BOOLEAN_P))
STATIC_DCL void FDECL (dropped_container,(struct obj *, struct monst *, BOOLEAN_P))
STATIC_DCL void FDECL (add_to_billobjs,(struct obj *))
STATIC_DCL void FDECL (bill_box_content,(struct obj *, BOOLEAN_P, BOOLEAN_P, struct monst *))
static boolean FDECL (rob_shop,(struct monst *))
STATIC_OVL struct monstnext_shkp (struct monst *shkp, boolean withbill)
char * shkname (struct monst *mtmp)
void shkgone (struct monst *mtmp)
void set_residency (struct monst *shkp, boolean zero_out)
void replshk (struct monst *mtmp, struct monst *mtmp2)
void restshk (struct monst *shkp, boolean ghostly)
STATIC_OVL void clear_unpaid (struct obj *list)
STATIC_OVL void setpaid (struct monst *shkp)
STATIC_OVL long addupbill (struct monst *shkp)
char inside_shop (xchar x, xchar y)
void u_left_shop (char *leavestring, boolean newlev)
void remote_burglary (xchar x, xchar y)
static boolean rob_shop (struct monst *shkp)
void u_entered_shop (char *enterstring)
boolean same_price (struct obj *obj1, struct obj *obj2)
STATIC_OVL long shop_debt (struct eshk *eshkp)
void shopper_financial_report ()
int inhishop (struct monst *mtmp)
struct monstshop_keeper (char rmno)
boolean tended_shop (struct mkroom *sroom)
STATIC_OVL struct bill_xonbill (struct obj *obj, struct monst *shkp, boolean silent)
void delete_contents (struct obj *obj)
void obfree (struct obj *obj, struct obj *merge)
STATIC_OVL long check_credit (long tmp, struct monst *shkp)
STATIC_OVL void pay (long tmp, struct monst *shkp)
void home_shk (struct monst *shkp, boolean killkops)
STATIC_OVL boolean angry_shk_exists ()
STATIC_OVL void pacify_shk (struct monst *shkp)
STATIC_OVL void rile_shk (struct monst *shkp)
STATIC_OVL void rouse_shk (struct monst *shkp, boolean verbosely)
void make_happy_shk (struct monst *shkp, boolean silentkops)
void hot_pursuit (struct monst *shkp)
void make_angry_shk (struct monst *shkp, xchar ox, xchar oy)
STATIC_OVL long cheapest_item (struct monst *shkp)
int dopay ()
STATIC_OVL int dopayobj (struct monst *shkp, struct bill_x *bp, struct obj **obj_p, int which, boolean itemize)
boolean paybill (int croaked)
STATIC_OVL boolean inherits (struct monst *shkp, int numsk, int croaked)
STATIC_OVL void set_repo_loc (struct eshk *eshkp)
void finish_paybill ()
STATIC_OVL struct objbp_to_obj (struct bill_x *bp)
struct objfind_oid (unsigned id)
long get_cost_of_shop_item (struct obj *obj)
STATIC_OVL long get_cost (struct obj *obj, struct monst *shkp)
long contained_cost (struct obj *obj, struct monst *shkp, long price, boolean usell, boolean unpaid_only)
long contained_gold (struct obj *obj)
STATIC_OVL void dropped_container (struct obj *obj, struct monst *shkp, boolean sale)
void picked_container (struct obj *obj)
STATIC_OVL long set_cost (struct obj *obj, struct monst *shkp)
long unpaid_cost (struct obj *unp_obj)
STATIC_OVL void add_one_tobill (struct obj *obj, boolean dummy)
STATIC_OVL void add_to_billobjs (struct obj *obj)
STATIC_OVL void bill_box_content (struct obj *obj, boolean ininv, boolean dummy, struct monst *shkp)
STATIC_OVL void shk_names_obj (struct monst *shkp, struct obj *obj, const char *fmt, long amt, const char *arg)
void addtobill (struct obj *obj, boolean ininv, boolean dummy, boolean silent)
void splitbill (struct obj *obj, struct obj *otmp)
STATIC_OVL void sub_one_frombill (struct obj *obj, struct monst *shkp)
void subfrombill (struct obj *obj, struct monst *shkp)
STATIC_OVL long stolen_container (struct obj *obj, struct monst *shkp, long price, boolean ininv)
long stolen_value (struct obj *obj, xchar x, xchar y, boolean peaceful, boolean silent)
void sellobj_state (int deliberate)
void sellobj (struct obj *obj, xchar x, xchar y)
int doinvbill (int mode)
STATIC_OVL long getprice (struct obj *obj, boolean shk_buying)
struct monstshkcatch (struct obj *obj, xchar x, xchar y)
void add_damage (xchar x, xchar y, long cost)
STATIC_OVL void remove_damage (struct monst *shkp, boolean croaked)
int repair_damage (struct monst *shkp, struct damage *tmp_dam, boolean catchup)
int shk_move (struct monst *shkp)
void after_shk_move (struct monst *shkp)
boolean is_fshk (struct monst *mtmp)
void shopdig (int fall)
void pay_for_damage (char *dmgstr, boolean cant_mollify) const
boolean costly_spot (xchar x, xchar y)
struct objshop_object (xchar x, xchar y)
void price_quote (struct obj *first_obj)
STATIC_OVL const char * shk_embellish (struct obj *itm, long cost)
boolean shk_has_leather_jackets (struct monst *shkp)
void shk_chat (struct monst *shkp)
STATIC_OVL long cost_per_charge (struct monst *shkp, struct obj *otmp, boolean altusage)
void check_unpaid_usage (struct obj *otmp, boolean altusage)
void check_unpaid (struct obj *otmp)
void costly_gold (xchar x, xchar y, long amount)
boolean block_door (xchar x, xchar y)
boolean block_entry (xchar x, xchar y)
char * shk_your (char *buf, struct obj *obj)
char * Shk_Your (char *buf, struct obj *obj)
STATIC_OVL char * shk_owns (char *buf, struct obj *obj)
STATIC_OVL char * mon_owns (char *buf, struct obj *obj)

Variables

struct shclass shtypes []
struct objthrownobj
STATIC_VAR NEARDATA long int followmsg
STATIC_VAR const char no_money [] = "Moreover, you%s have no money."
STATIC_VAR const char not_enough_money [] = "Besides, you don't have enough to interest %s."
static coord repo_location
static char sell_response = 'a'
static int sell_how = SELL_NORMAL
static boolean auto_credit = FALSE
const char * Izchak_speaks []

Define Documentation

#define GDIST (   x,
 
)    (dist2(x,y,gx,gy))
#define horiz (   i )    ((i%3)-1)
#define HUNGRY   2

Referenced by getprice().

#define INSHOP   4

Referenced by repair_damage().

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

Referenced by repair_damage().

#define OPEN   2

Referenced by repair_damage().

#define PAY_BROKE   (-2)

Referenced by dopay(), and dopayobj().

#define PAY_BUY   1

Referenced by dopay(), and dopayobj().

#define PAY_CANT   0

Referenced by dopay(), and dopayobj().

#define PAY_SKIP   (-1)

Referenced by dopay(), and dopayobj().

#define PAY_SOME   2

Referenced by dopay(), and dopayobj().

#define vert (   i )    ((i/3)-1)

Referenced by repair_damage().


Function Documentation

void add_damage ( xchar  x,
xchar  y,
long  cost 
)
STATIC_OVL void add_one_tobill ( struct obj obj,
boolean  dummy 
)

References add_to_billobjs(), BILLSZ, bill_x::bo_id, bp, bill_x::bquan, ESHK, FALSE, FOOD_CLASS, get_cost(), inhishop(), onbill(), bill_x::price, shop_keeper(), u, bill_x::useup, and you::ushops.

Referenced by addtobill(), and bill_box_content().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void add_to_billobjs ( struct obj obj )

References billobjs, OBJ_FREE, OBJ_ONBILL, obj_stop_timers(), and obj::where.

Referenced by add_one_tobill(), obfree(), and sub_one_frombill().

Here is the call graph for this function:

Here is the caller graph for this function:

void addtobill ( struct obj obj,
boolean  ininv,
boolean  dummy,
boolean  silent 
)
STATIC_OVL long addupbill ( struct monst shkp )

References bp, bill_x::bquan, ESHK, and bill_x::price.

Referenced by inherits(), make_angry_shk(), rob_shop(), and shk_chat().

Here is the caller graph for this function:

void after_shk_move ( struct monst shkp )

References eshk::bill, eshk::bill_p, check_special_room(), ESHK, FALSE, and inhishop().

Referenced by home_shk(), m_move(), and shk_move().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean angry_shk_exists (  )

References ANGRY, FALSE, fmon, next_shkp(), monst::nmon, and TRUE.

Referenced by make_happy_shk().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void bill_box_content ( struct obj obj,
boolean  ininv,
boolean  dummy,
struct monst shkp 
)

References add_one_tobill(), obj::cobj, COIN_CLASS, Has_contents, obj::nobj, obj::oclass, and otmp.

Referenced by addtobill().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean block_door ( xchar  x,
xchar  y 
)

References ESHK, FALSE, in_rooms(), inhishop(), Invis, IS_DOOR, IS_SHOP, levl, monst::mx, monst::my, pline(), shkname(), shop_keeper(), SHOPBASE, TRUE, u, and you::ushops.

Referenced by test_move().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean block_entry ( xchar  x,
xchar  y 
)

References carrying(), D_BROKEN, DWARVISH_MATTOCK, ESHK, FALSE, in_rooms(), inhishop(), Invis, IS_DOOR, IS_SHOP, levl, monst::mx, monst::my, PICK_AXE, pline(), shkname(), shop_keeper(), SHOPBASE, STEED, TRUE, u, you::ux, and you::uy.

Referenced by test_move().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct obj* bp_to_obj ( struct bill_x bp ) [read]

References billobjs, find_oid(), and o_on().

Referenced by doinvbill(), and dopay().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL long cheapest_item ( struct monst shkp )

References bp, bill_x::bquan, ESHK, and bill_x::price.

Referenced by dopay().

Here is the caller graph for this function:

STATIC_OVL long check_credit ( long  tmp,
struct monst shkp 
)

References ESHK.

Referenced by pay(), pay_for_damage(), and stolen_value().

Here is the caller graph for this function:

void check_unpaid ( struct obj otmp )

References check_unpaid_usage(), and FALSE.

Referenced by catch_lit(), consume_obj_charge(), dip(), do_break_wand(), dowrite(), dozap(), engrave(), learn(), light_cocktail(), and use_lamp().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_unpaid_usage ( struct obj otmp,
boolean  altusage 
)

References A_WIS, cost_per_charge(), currency(), ESHK, exercise(), inhishop(), POT_OIL, rn2(), shop_keeper(), SPBOOK_CLASS, TRUE, u, and you::ushops.

Referenced by check_unpaid(), and dorub().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void clear_unpaid ( struct obj list )

References Has_contents.

Referenced by setpaid().

Here is the caller graph for this function:

long contained_cost ( struct obj obj,
struct monst shkp,
long  price,
boolean  usell,
boolean  unpaid_only 
)
long contained_gold ( struct obj obj )

References obj::cobj, COIN_CLASS, Has_contents, obj::nobj, obj::oclass, otmp, and obj::quan.

Referenced by addtobill(), hidden_gold(), sellobj(), and stolen_value().

Here is the caller graph for this function:

STATIC_OVL long cost_per_charge ( struct monst shkp,
struct obj otmp,
boolean  altusage 
)
void costly_gold ( xchar  x,
xchar  y,
long  amount 
)

References costly_spot(), eshk::credit, currency(), eshk::debit, ESHK, in_rooms(), eshk::loan, shkname(), shop_keeper(), and SHOPBASE.

Referenced by addtobill(), kick_object(), and pickup_object().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean costly_spot ( xchar  x,
xchar  y 
)
void delete_contents ( struct obj obj )

References obj::cobj, obfree(), and obj_extract_self().

Referenced by chest_trap(), create_object(), in_container(), obfree(), poly_obj(), and readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

int doinvbill ( int  mode )

References eshk::bill_p, eshk::billct, bp, bp_to_obj(), bill_x::bquan, create_nhwindow, eshk::debit, destroy_nhwindow, display_nhwindow, ESHK, FALSE, GOLD_SYM, inhishop(), NHW_MENU, bill_x::price, putstr, obj::quan, shop_keeper(), u, bill_x::useup, you::ushops, and xprname().

Referenced by dotypeinv().

Here is the call graph for this function:

Here is the caller graph for this function:

int dopay (  )
STATIC_OVL int dopayobj ( struct monst shkp,
struct bill_x bp,
struct obj **  obj_p,
int  which,
boolean  itemize 
)

References ANGRY, BUFSZ, currency(), dealloc_obj(), doname(), Doname2(), ESHK, hidden_gold(), invent, obj_extract_self(), pay(), PAY_BROKE, PAY_BUY, PAY_CANT, PAY_SKIP, PAY_SOME, obj::quan, shk_names_obj(), Sprintf, u, you::ugold, update_inventory, xname(), and yn.

Referenced by dopay().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void dropped_container ( struct obj obj,
struct monst shkp,
boolean  sale 
)

References obj::cobj, COIN_CLASS, Has_contents, obj::nobj, obj::oclass, otmp, and saleable().

Referenced by sellobj().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL char* FDECL ( mon_owns  ,
(char *, struct obj *)   
)
STATIC_DCL void FDECL ( bill_box_content  ,
(struct obj *, BOOLEAN_P, BOOLEAN_P, struct monst *)   
)
STATIC_DCL long FDECL ( cheapest_item  ,
(struct monst *)   
)
static boolean FDECL ( rob_shop  ,
(struct monst *)   
) [static]
STATIC_DCL struct bill_x* FDECL ( onbill  ,
(struct obj *, struct monst *, BOOLEAN_P)   
) [read]
STATIC_DCL int FDECL ( dopayobj  ,
(struct monst *, struct bill_x *, struct obj **, int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( clear_unpaid  ,
(struct obj *)   
)
STATIC_DCL long FDECL ( stolen_container  ,
(struct obj *, struct monst *, long, BOOLEAN_P)   
)
STATIC_DCL long FDECL ( getprice  ,
(struct obj *, BOOLEAN_P)   
)
STATIC_DCL long FDECL ( addupbill  ,
(struct monst *)   
)
STATIC_DCL long FDECL ( check_credit  ,
(long, struct monst *)   
)
STATIC_DCL void FDECL ( shk_names_obj  ,
(struct monst *, struct obj *, const char *, long, const char *)   
)
STATIC_DCL void FDECL ( setpaid  ,
(struct monst *)   
)
STATIC_DCL struct obj* FDECL ( bp_to_obj  ,
(struct bill_x *)   
) [read]
STATIC_DCL struct monst* FDECL ( next_shkp  ,
(struct monst *, BOOLEAN_P)   
) [read]
STATIC_DCL void FDECL ( pay  ,
(long, struct monst *)   
)
STATIC_DCL boolean FDECL ( inherits  ,
(struct monst *, int, int)   
)
STATIC_DCL void FDECL ( set_repo_loc  ,
(struct eshk *)   
)
STATIC_DCL void FDECL ( pacify_shk  ,
(struct monst *)   
)
STATIC_DCL long FDECL ( get_cost  ,
(struct obj *, struct monst *)   
)
STATIC_DCL void FDECL ( rile_shk  ,
(struct monst *)   
)
STATIC_DCL long FDECL ( shop_debt  ,
(struct eshk *)   
)
STATIC_DCL void FDECL ( rouse_shk  ,
(struct monst *, BOOLEAN_P)   
)
STATIC_DCL long FDECL ( set_cost  ,
(struct obj *, struct monst *)   
)
STATIC_DCL void FDECL ( remove_damage  ,
(struct monst *, BOOLEAN_P)   
)
STATIC_DCL const char* FDECL ( shk_embellish  ,
(struct obj *, long)   
)
STATIC_DCL void FDECL ( sub_one_frombill  ,
(struct obj *, struct monst *)   
)
STATIC_DCL char* FDECL ( shk_owns  ,
(char *, struct obj *)   
)
STATIC_DCL void FDECL ( add_one_tobill  ,
(struct obj *, BOOLEAN_P)   
)
STATIC_DCL long FDECL ( cost_per_charge  ,
(struct monst *, struct obj *, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( dropped_container  ,
(struct obj *, struct monst *, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( add_to_billobjs  ,
(struct obj *)   
)
struct obj* find_oid ( unsigned  id ) [read]

References dlevel_t::buriedobjlist, fmon, fobj, invent, level, migrating_mons, migrating_objs, monst::minvent, mon, mydogs, monst::nmon, and o_on().

Referenced by bp_to_obj(), relink_light_sources(), relink_timers(), and write_ls().

Here is the call graph for this function:

Here is the caller graph for this function:

void finish_paybill (  )

Dump inventory to the floor, called at game exit, after inventory disclosure but before making bones

References curse(), invent, obj_extract_self(), otmp, obj::owornmask, obj::ox, obj::oy, place_object(), rn2(), unleash_all(), unwield_weapons_silently(), nhcoord::x, and nhcoord::y.

Referenced by done().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL long get_cost ( struct obj obj,
struct monst shkp 
)
long get_cost_of_shop_item ( struct obj obj )

Returns the price of an arbitrary item in the shop. Returns 0 if the item doesn't belong to a shopkeeper.

References COIN_CLASS, contained_cost(), cost(), costly_spot(), FALSE, get_cost(), get_obj_location(), Has_contents, in_rooms(), inhishop(), OBJ_FLOOR, shop_keeper(), SHOPBASE, u, uball, uchain, and you::ushops.

Referenced by doname_base().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL long getprice ( struct obj obj,
boolean  shk_buying 
)

References ARMOR_CLASS, arti_cost(), FOOD_CLASS, HUNGRY, if(), Is_candle, POT_WATER, POTION_CLASS, TOOL_CLASS, u, you::uhs, WAND_CLASS, and WEAPON_CLASS.

Referenced by get_cost(), and set_cost().

Here is the call graph for this function:

Here is the caller graph for this function:

void home_shk ( struct monst shkp,
boolean  killkops 
)

References after_shk_move(), ESHK, dlevel_t::flags, level, mnearto(), pacify_guards(), and TRUE.

Referenced by inherits(), make_happy_shk(), and pay_for_damage().

Here is the call graph for this function:

Here is the caller graph for this function:

void hot_pursuit ( struct monst shkp )

References ESHK, PL_NSIZ, plname, and rile_shk().

Referenced by bhitm(), impact_drop(), make_angry_shk(), pay_for_damage(), poly_obj(), rob_shop(), stolen_value(), throwit(), and zap_over_floor().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean inherits ( struct monst shkp,
int  numsk,
int  croaked 
)
int inhishop ( struct monst mtmp )
char inside_shop ( xchar  x,
xchar  y 
)
boolean is_fshk ( struct monst mtmp )

References ESHK, and eshk::following.

Referenced by levl_follower().

Here is the caller graph for this function:

void make_angry_shk ( struct monst shkp,
xchar  ox,
xchar  oy 
)

References addupbill(), ANGRY, eshk::billct, cansee, eshk::credit, eshk::debit, ESHK, hot_pursuit(), isok(), eshk::loan, Monnam(), pline(), eshk::robbed, and setpaid().

Referenced by breakobj(), chest_trap(), container_impact_dmg(), digactualhole(), poly_obj(), and rloc_to().

Here is the call graph for this function:

Here is the caller graph for this function:

void make_happy_shk ( struct monst shkp,
boolean  silentkops 
)
STATIC_OVL char* mon_owns ( char *  buf,
struct obj obj 
)

References mon_nam(), OBJ_MINVENT, s_suffix(), and obj::where.

Referenced by shk_your().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL boolean NDECL ( angry_shk_exists   )
STATIC_OVL struct monst* next_shkp ( struct monst shkp,
boolean  withbill 
) [read]

References DEADMONSTER, ESHK, NOTANGRY, pacify_shk(), and rile_shk().

Referenced by angry_shk_exists(), dopay(), obfree(), paybill(), same_price(), shopper_financial_report(), and unpaid_cost().

Here is the call graph for this function:

Here is the caller graph for this function:

void obfree ( struct obj obj,
struct obj merge 
)
STATIC_OVL struct bill_x* onbill ( struct obj obj,
struct monst shkp,
boolean  silent 
) [read]

References bill_x::bo_id, bp, ESHK, and pline().

Referenced by add_one_tobill(), addtobill(), obfree(), same_price(), splitbill(), sub_one_frombill(), and unpaid_cost().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void pacify_shk ( struct monst shkp )

References bp, ESHK, FALSE, NOTANGRY, bill_x::price, and TRUE.

Referenced by inherits(), make_happy_shk(), next_shkp(), pay_for_damage(), restshk(), shop_keeper(), and u_entered_shop().

Here is the caller graph for this function:

STATIC_OVL void pay ( long  tmp,
struct monst shkp 
)

References flag::botl, check_credit(), ESHK, flags, u, and you::ugold.

Referenced by dopay(), dopayobj(), and sellobj().

Here is the call graph for this function:

Here is the caller graph for this function:

void pay_for_damage ( char *  dmgstr,
boolean  cant_mollify 
) const
boolean paybill ( int  croaked )

References ESHK, FALSE, fmon, inherits(), inhishop(), mongone(), next_shkp(), monst::nmon, on_level(), shop_keeper(), u, you::ushops, you::uz, nhcoord::x, and nhcoord::y.

Referenced by done().

Here is the call graph for this function:

Here is the caller graph for this function:

void picked_container ( struct obj obj )

References obj::cobj, COIN_CLASS, Has_contents, obj::nobj, obj::oclass, and otmp.

Referenced by addtobill(), impact_drop(), keepdogs(), migrate_to_level(), and ship_object().

Here is the caller graph for this function:

void price_quote ( struct obj first_obj )
void remote_burglary ( xchar  x,
xchar  y 
)

References angry_guards(), eshk::billct, eshk::debit, ESHK, FALSE, in_rooms(), inhishop(), rob_shop(), shop_keeper(), SHOPBASE, u, and you::uz.

Referenced by pick_obj().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void remove_damage ( struct monst shkp,
boolean  croaked 
)
int repair_damage ( struct monst shkp,
struct damage tmp_dam,
boolean  catchup 
)
void replshk ( struct monst mtmp,
struct monst mtmp2 
)

References ESHK, inhishop(), mkroom::resident, ROOMOFFSET, rooms, u, and you::ushops.

Referenced by replmon().

Here is the call graph for this function:

Here is the caller graph for this function:

void restshk ( struct monst shkp,
boolean  ghostly 
)

References ANGRY, assign_level(), eshk::bill, eshk::bill_p, eshk::customer, d_level::dlevel, ESHK, pacify_shk(), PL_NSIZ, plname, eshk::shoplevel, strncmpi(), u, and you::uz.

Referenced by restmonchn().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void rile_shk ( struct monst shkp )

References bp, ESHK, FALSE, NOTANGRY, bill_x::price, and TRUE.

Referenced by hot_pursuit(), next_shkp(), shk_move(), shop_keeper(), and shopdig().

Here is the caller graph for this function:

static boolean rob_shop ( struct monst shkp ) [static]

References addupbill(), adjalign(), eshk::credit, currency(), eshk::debit, ESHK, FALSE, hot_pursuit(), shclass::name, PM_ROGUE, eshk::robbed, Role_if, rouse_shk(), setpaid(), sgn(), shkname(), SHOPBASE, eshk::shoptype, shtypes, TRUE, align::type, u, and you::ualign.

Referenced by remote_burglary(), and u_left_shop().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void rouse_shk ( struct monst shkp,
boolean  verbosely 
)

References canspotmon, Monnam(), and pline().

Referenced by dopay(), inherits(), rob_shop(), and sellobj().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean same_price ( struct obj obj1,
struct obj obj2 
)

References FALSE, fmon, next_shkp(), monst::nmon, onbill(), bill_x::price, and TRUE.

Referenced by mergable().

Here is the call graph for this function:

Here is the caller graph for this function:

void sellobj ( struct obj obj,
xchar  x,
xchar  y 
)
void sellobj_state ( int  deliberate )

References FALSE, and SELL_NORMAL.

Referenced by doddrop(), dodrop(), in_container(), and touchfood().

Here is the caller graph for this function:

STATIC_OVL long set_cost ( struct obj obj,
struct monst shkp 
)

References DUNCE_CAP, ESHK, GEM_CLASS, GEMSTONE, getprice(), GLASS, MAXULEV, objects, obj::otyp, PM_TOURIST, Role_if, TRUE, u, uarm, uarmc, uarmh, and you::ulevel.

Referenced by contained_cost(), and sellobj().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void set_repo_loc ( struct eshk eshkp )

References IS_DOOR, levl, sgn(), eshk::shk, u, you::ushops, you::ux, you::uy, nhcoord::x, and nhcoord::y.

Referenced by inherits().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_residency ( struct monst shkp,
boolean  zero_out 
)

References ESHK, on_level(), mkroom::resident, ROOMOFFSET, rooms, u, and you::uz.

Referenced by getlev(), keepdogs(), migrate_to_level(), and mon_arrive().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void setpaid ( struct monst shkp )

References billobjs, dlevel_t::buriedobjlist, clear_unpaid(), dealloc_obj(), ESHK, fmon, fobj, invent, level, migrating_mons, monst::minvent, monst::nmon, and obj_extract_self().

Referenced by dopay(), inherits(), make_angry_shk(), rob_shop(), and shkgone().

Here is the call graph for this function:

Here is the caller graph for this function:

void shk_chat ( struct monst shkp )

References addupbill(), ANGRY, eshk::billct, eshk::credit, currency(), eshk::customer, eshk::debit, ESHK, eshk::following, Hello(), inhishop(), mhe, mhim, Monnam(), PL_NSIZ, pline(), plname, PM_ARCHEOLOGIST, rn2(), eshk::robbed, Role_if, shk_has_leather_jackets(), shkname(), and SIZE.

Referenced by domonnoise().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL const char* shk_embellish ( struct obj itm,
long  cost 
)

References AMULET_CLASS, FOOD_CLASS, POTION_CLASS, RING_CLASS, rn2(), SCROLL_CLASS, SPBOOK_CLASS, and WAND_CLASS.

Referenced by price_quote().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean shk_has_leather_jackets ( struct monst shkp )

returns TRUE if shopkeeper has at least one leather jacket in his shop.

References costly_spot(), ESHK, FALSE, LEATHER_JACKET, level, mkroom::lx, mkroom::ly, dlevel_t::objects, otmp, obj::otyp, ROOMOFFSET, rooms, eshk::shoproom, and TRUE.

Referenced by shk_chat().

Here is the call graph for this function:

Here is the caller graph for this function:

int shk_move ( struct monst shkp )
STATIC_OVL void shk_names_obj ( struct monst shkp,
struct obj obj,
const char *  fmt,
long  amt,
const char *  arg 
)

References ARMOR_CLASS, BUFSZ, doname(), highc(), makeknown, MIRROR, objects, obj::oclass, obj::otyp, pline(), plur, obj::quan, saleable(), SCROLL_CLASS, SPBOOK_CLASS, Sprintf, TRUE, and WEAPON_CLASS.

Referenced by dopayobj(), and sellobj().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL char* shk_owns ( char *  buf,
struct obj obj 
)

References costly_spot(), get_obj_location(), inside_shop(), OBJ_FLOOR, s_suffix(), shkname(), shop_keeper(), and obj::where.

Referenced by shk_your().

Here is the call graph for this function:

Here is the caller graph for this function:

char* Shk_Your ( char *  buf,
struct obj obj 
)

References highc(), and shk_your().

Referenced by burn_object(), cancel_item(), dip(), doapply(), get_wet(), snuff_candle(), and use_lamp().

Here is the call graph for this function:

Here is the caller graph for this function:

char* shk_your ( char *  buf,
struct obj obj 
)

References carried, mon_owns(), shk_owns(), and Strcpy.

Referenced by break_armor(), hmon_hitmon(), light_cocktail(), Shk_Your(), use_trap(), wield_tool(), yname(), and ysimple_name().

Here is the call graph for this function:

Here is the caller graph for this function:

struct monst* shkcatch ( struct obj obj,
xchar  x,
xchar  y 
) [read]

References cansee, canspotmon, delay_output, dist2(), ESHK, inhishop(), inside_shop(), map_invisible(), mark_synch, mnearto(), Monnam(), mpickobj(), monst::mx, monst::my, pline(), shop_keeper(), subfrombill(), the(), TRUE, u, you::ushops, you::ux, you::uy, and xname().

Referenced by bhit().

Here is the call graph for this function:

Here is the caller graph for this function:

void shkgone ( struct monst mtmp )

References ANY_SHOP, eshk::bill_p, ESHK, dlevel_t::flags, index, level, mkroom::lx, mkroom::ly, dlevel_t::objects, on_level(), otmp, remove_damage(), mkroom::resident, ROOMOFFSET, rooms, search_special(), setpaid(), eshk::shoplevel, eshk::shoproom, TRUE, u, you::ushops, and you::uz.

Referenced by m_detach().

Here is the call graph for this function:

Here is the caller graph for this function:

char* shkname ( struct monst mtmp )
STATIC_OVL long shop_debt ( struct eshk eshkp )

References bp, bill_x::bquan, and bill_x::price.

Referenced by shopper_financial_report().

Here is the caller graph for this function:

struct monst* shop_keeper ( char  rmno ) [read]
struct obj* shop_object ( xchar  x,
xchar  y 
) [read]

References COIN_CLASS, costly_spot(), in_rooms(), inhishop(), level, NOTANGRY, dlevel_t::objects, obj::oclass, otmp, shop_keeper(), and SHOPBASE.

Referenced by dochat().

Here is the call graph for this function:

Here is the caller graph for this function:

void shopdig ( int  fall )
void shopper_financial_report (  )

References eshk::credit, currency(), ESHK, FALSE, fmon, inside_shop(), shclass::name, next_shkp(), monst::nmon, s_suffix(), shkname(), shop_debt(), shop_keeper(), SHOPBASE, eshk::shoptype, shtypes, u, you::ux, and you::uy.

Referenced by doprgold().

Here is the call graph for this function:

Here is the caller graph for this function:

void splitbill ( struct obj obj,
struct obj otmp 
)

References BILLSZ, bill_x::bo_id, bp, bill_x::bquan, ESHK, FALSE, inhishop(), onbill(), bill_x::price, shop_keeper(), u, bill_x::useup, and you::ushops.

Referenced by splitobj().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL long stolen_container ( struct obj obj,
struct monst shkp,
long  price,
boolean  ininv 
)

References obj::cobj, COIN_CLASS, FOOD_CLASS, get_cost(), Has_contents, obj::nobj, obj::oclass, obj::oeaten, otmp, and obj::quan.

Referenced by stolen_value().

Here is the call graph for this function:

Here is the caller graph for this function:

long stolen_value ( struct obj obj,
xchar  x,
xchar  y,
boolean  peaceful,
boolean  silent 
)
STATIC_OVL void sub_one_frombill ( struct obj obj,
struct monst shkp 
)

References add_to_billobjs(), bill_x::bo_id, bp, bill_x::bquan, ESHK, FALSE, flags, flag::ident, newobj, obj::o_id, OATTACHED_NOTHING, OBJ_FREE, obj::onamelth, onbill(), otmp, obj::owt, obj::oxlth, obj::quan, bill_x::useup, and obj::where.

Referenced by sellobj(), and subfrombill().

Here is the call graph for this function:

Here is the caller graph for this function:

void subfrombill ( struct obj obj,
struct monst shkp 
)

References obj::cobj, COIN_CLASS, Has_contents, obj::nobj, obj::oclass, otmp, and sub_one_frombill().

Referenced by bill_dummy_object(), check_shop_obj(), potionhit(), sellobj(), ship_object(), shkcatch(), shopdig(), and stealarm().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean tended_shop ( struct mkroom sroom )

References FALSE, and inhishop().

Referenced by attack(), and dosounds().

Here is the call graph for this function:

Here is the caller graph for this function:

void u_entered_shop ( char *  enterstring )
void u_left_shop ( char *  leavestring,
boolean  newlev 
)

References angry_guards(), eshk::billct, eshk::debit, ESHK, FALSE, inhishop(), levl, NOTANGRY, plname, rob_shop(), shop_keeper(), u, you::ushops0, you::ux, you::ux0, you::uy, you::uy0, and you::uz.

Referenced by check_special_room(), and level_tele().

Here is the call graph for this function:

Here is the caller graph for this function:

long unpaid_cost ( struct obj unp_obj )

References fmon, next_shkp(), monst::nmon, onbill(), bill_x::price, and TRUE.

Referenced by doname_base(), and dounpaid().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

boolean auto_credit = FALSE [static]
STATIC_VAR NEARDATA long int followmsg
const char* Izchak_speaks[]
Initial value:
{
    "%s says: 'These shopping malls give me a headache.'",
    "%s says: 'Slow down.  Think clearly.'",
    "%s says: 'You need to take things one at a time.'",
    "%s says: 'I don't like poofy coffee... give me Columbian Supremo.'",
    "%s says that getting the devteam's agreement on anything is difficult.",
    "%s says that he has noticed those who serve their deity will prosper.",
    "%s says: 'Don't try to steal from me - I have friends in high places!'",
    "%s says: 'You may well need something from this shop in the future.'",
    "%s comments about the Valley of the Dead as being a gateway."
}
STATIC_VAR const char no_money[] = "Moreover, you%s have no money."
STATIC_VAR const char not_enough_money[] = "Besides, you don't have enough to interest %s."
coord repo_location [static]
int sell_how = SELL_NORMAL [static]
char sell_response = 'a' [static]
struct shclass shtypes[]
struct obj* thrownobj