Data Structures | Defines | Functions | Variables

apply.c File Reference

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

Data Structures

struct  trapinfo

Defines

#define MAXLEASHED   2
#define WEAK   3
#define PROP_COUNT   6
#define prop2trbl(X)   ((X) + A_MAX)
#define attr2trbl(Y)   (Y)
#define prop_trouble(X)   trouble_list[trouble_count++] = prop2trbl(X)
#define attr_trouble(Y)   trouble_list[trouble_count++] = attr2trbl(Y)
#define BY_OBJECT   ((struct monst *)0)

Functions

STATIC_DCL int FDECL (use_towel,(struct obj *))
STATIC_DCL boolean FDECL (its_dead,(int, int, int *, struct obj *))
STATIC_DCL int FDECL (use_stethoscope,(struct obj *))
STATIC_DCL void FDECL (use_whistle,(struct obj *))
STATIC_DCL void FDECL (use_magic_whistle,(struct obj *))
STATIC_DCL void FDECL (use_leash,(struct obj *))
STATIC_DCL int FDECL (use_mirror,(struct obj *))
STATIC_DCL void FDECL (use_bell,(struct obj **))
STATIC_DCL void FDECL (use_candelabrum,(struct obj *))
STATIC_DCL void FDECL (use_candle,(struct obj **))
STATIC_DCL void FDECL (use_lamp,(struct obj *))
STATIC_DCL void FDECL (light_cocktail,(struct obj *))
STATIC_DCL void FDECL (use_tinning_kit,(struct obj *))
STATIC_DCL void FDECL (use_figurine,(struct obj **))
STATIC_DCL void FDECL (use_grease,(struct obj *))
STATIC_DCL void FDECL (use_trap,(struct obj *))
STATIC_DCL void FDECL (use_stone,(struct obj *))
STATIC_PTR int NDECL (set_trap)
STATIC_DCL int FDECL (use_whip,(struct obj *))
STATIC_DCL int FDECL (use_pole,(struct obj *))
STATIC_DCL int FDECL (use_cream_pie,(struct obj *))
STATIC_DCL int FDECL (use_grapple,(struct obj *))
STATIC_DCL int FDECL (do_break_wand,(struct obj *))
STATIC_DCL boolean FDECL (figurine_location_checks,(struct obj *, coord *, BOOLEAN_P))
STATIC_DCL boolean NDECL (uhave_graystone)
STATIC_DCL void FDECL (add_class,(char *, CHAR_P))
STATIC_OVL int use_towel (struct obj *obj)
STATIC_OVL boolean its_dead (int rx, int ry, int *resp, struct obj *tobj)
STATIC_OVL int use_stethoscope (struct obj *obj)
STATIC_OVL void use_whistle (struct obj *obj)
STATIC_OVL void use_magic_whistle (struct obj *obj)
boolean um_dist (xchar x, xchar y, xchar n)
int number_leashed ()
void o_unleash (struct obj *otmp)
void m_unleash (struct monst *mtmp, boolean feedback)
void unleash_all ()
STATIC_OVL void use_leash (struct obj *obj)
struct objget_mleash (struct monst *mtmp)
boolean next_to_u ()
void check_leash (xchar x, xchar y)
STATIC_OVL int use_mirror (struct obj *obj)
STATIC_OVL void use_bell (struct obj **optr)
STATIC_OVL void use_candelabrum (struct obj *obj)
STATIC_OVL void use_candle (struct obj **optr)
boolean snuff_candle (struct obj *otmp)
boolean snuff_lit (struct obj *obj)
boolean catch_lit (struct obj *obj)
STATIC_OVL void use_lamp (struct obj *obj)
STATIC_OVL void light_cocktail (struct obj *obj)
int dorub ()
int dojump ()
int jump (int magic)
boolean tinnable (struct obj *corpse)
STATIC_OVL void use_tinning_kit (struct obj *obj)
void fix_attributes_and_properties (struct obj *obj, int attr_point)
void fig_transform (genericptr_t arg, long timeout)
STATIC_OVL boolean figurine_location_checks (struct obj *obj, coord *cc, boolean quietly)
STATIC_OVL void use_figurine (struct obj **optr)
STATIC_OVL void use_grease (struct obj *obj)
void reset_trapset ()
STATIC_OVL void use_stone (struct obj *tstone)
STATIC_OVL void use_trap (struct obj *otmp)
STATIC_PTR int set_trap ()
STATIC_OVL int use_whip (struct obj *obj)
STATIC_OVL int use_pole (struct obj *obj)
STATIC_OVL int use_cream_pie (struct obj *obj)
STATIC_OVL int use_grapple (struct obj *obj)
STATIC_OVL int do_break_wand (struct obj *obj)
STATIC_OVL boolean uhave_graystone ()
STATIC_OVL void add_class (char *cl, char class)
int doapply ()
int unfixable_trouble_count (boolean is_horn)

Variables

static const char tools [] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 }
static const char tools_too []
static const char no_elbow_room [] = "don't have enough elbow-room to maneuver."
static const char hollow_str [] = "a hollow sound. This must be a secret %s!"
static const char whistle_str [] = "produce a %s whistling sound."
static const char look_str [] = "look %s."
static NEARDATA const char cuddly [] = { TOOL_CLASS, GEM_CLASS, 0 }
static NEARDATA const char lubricables [] = { ALL_CLASSES, ALLOW_NONE, 0 }
static NEARDATA const char need_to_remove_outer_armor [] = "need to remove your %s to grease your %s."
static struct trapinfo trapinfo
static const char not_enough_room [] = "There's not enough room here to use that."
static const char where_to_hit [] = "Where do you want to hit?"
static const char cant_see_spot [] = "won't hit anything if you can't see that spot."
static const char cant_reach [] = "can't reach that spot from here."

Define Documentation

#define attr2trbl (   Y )    (Y)
#define attr_trouble (   Y )    trouble_list[trouble_count++] = attr2trbl(Y)
#define BY_OBJECT   ((struct monst *)0)

Referenced by do_break_wand().

#define MAXLEASHED   2

Referenced by use_leash().

#define prop2trbl (   X )    ((X) + A_MAX)
#define PROP_COUNT   6
#define prop_trouble (   X )    trouble_list[trouble_count++] = prop2trbl(X)
#define WEAK   3

Function Documentation

STATIC_OVL void add_class ( char *  cl,
char  class 
)

References Strcat.

Referenced by doapply().

Here is the caller graph for this function:

boolean catch_lit ( struct obj obj )

References begin_burn(), bill_dummy_object(), Blind, BRASS_LANTERN, CANDELABRUM_OF_INVOCATION, cansee, check_unpaid(), costly_spot(), FALSE, get_obj_location(), ignitable, MAGIC_LAMP, makeknown, OBJ_INVENT, OBJ_MINVENT, OIL_LAMP, otense(), pline(), POT_OIL, rn2(), TRUE, u, you::ux, you::uy, and Yname2().

Referenced by dip(), and fire_damage().

Here is the call graph for this function:

Here is the caller graph for this function:

void check_leash ( xchar  x,
xchar  y 
)
STATIC_OVL int do_break_wand ( struct obj obj )
int doapply (  )

References add_class(), aobjnam(), arti_speak(), BAG_OF_HOLDING, BAG_OF_TRICKS, bagotricks(), BEARTRAP, BELL, BELL_OF_OPENING, Blind, Blindf_off(), Blindf_on(), BLINDFOLD, BRASS_LANTERN, BUFSZ, BUGLE, BULLWHIP, CAN_OF_GREASE, CANDELABRUM_OF_INVOCATION, carrying(), check_capacity(), CHEST, consume_obj_charge(), CREAM_PIE, CREDIT_CARD, CRYSTAL_BALL, cursed(), do_break_wand(), do_play_instrument(), dowrite(), DRUM_OF_EARTHQUAKE, DWARVISH_MATTOCK, EUCALYPTUS_LEAF, EXPENSIVE_CAMERA, FALSE, FIGURINE, FIRE_HORN, fix_attributes_and_properties(), flags, FLINT, FOOD_CLASS, FOOD_RATION, FROST_HORN, getobj(), GRAPPLING_HOOK, hcolor(), hold_another_object(), HORN_OF_PLENTY, ICE, ICE_BOX, IRON_SAFE, IRONBARS, Is_airlevel, is_axe, is_pick, is_pole, Is_waterlevel, LAND_MINE, LARGE_BOX, LEASH, LEATHER_DRUM, LENSES, levl, light_cocktail(), LOADSTONE, LOCK_PICK, LUCKSTONE, LUMP_OF_ROYAL_JELLY, MAGIC_FLUTE, MAGIC_HARP, MAGIC_LAMP, MAGIC_MARKER, MAGIC_WHISTLE, makeknown, MAXOCLASSES, MIRROR, mkobj(), nomul(), nothing_happens, obj::oartifact, objects, obj::oclass, OIL_LAMP, OILSKIN_SACK, otmp, obj::otyp, obj::owt, PICK_AXE, pick_lock(), pline(), POT_BOOZE, POT_OIL, POT_SICKNESS, POT_WATER, POTION_CLASS, rn2(), rnd_class(), SACK, SADDLE, Shk_Your(), SKELETON_KEY, obj::spe, STETHOSCOPE, Strcpy, TALLOW_CANDLE, The(), TIN, TIN_OPENER, TIN_WHISTLE, TINNING_KIT, TOOLED_HORN, tools, tools_too, touch_artifact(), TOUCHSTONE, TOWEL, TRUE, u, ublindf, uhave_graystone(), unbless(), UNICORN_HORN, use_bell(), use_candelabrum(), use_candle(), use_container(), use_cream_pie(), use_crystal_ball(), use_figurine(), use_grapple(), use_grease(), use_lamp(), use_leash(), use_magic_whistle(), use_mirror(), use_pick_axe(), use_pole(), use_stethoscope(), use_stone(), use_tinning_kit(), use_towel(), use_trap(), use_whip(), use_whistle(), uwep, you::ux, you::uy, you::uz, flag::verbose, WAND_CLASS, WAX_CANDLE, weight(), what, WOODEN_FLUTE, WOODEN_HARP, and youmonst.

Here is the call graph for this function:

int dojump (  )

References jump().

Here is the call graph for this function:

int dorub (  )
STATIC_DCL void FDECL ( use_bell  ,
(struct obj **)   
)
STATIC_DCL void FDECL ( use_trap  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_stone  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_whistle  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_candelabrum  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( use_whip  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( use_towel  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_magic_whistle  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_candle  ,
(struct obj **)   
)
STATIC_DCL int FDECL ( use_pole  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( use_cream_pie  ,
(struct obj *)   
)
STATIC_DCL boolean FDECL ( its_dead  ,
(int, int, int *, struct obj *)   
)
STATIC_DCL int FDECL ( use_grapple  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_lamp  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( do_break_wand  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( use_stethoscope  ,
(struct obj *)   
)
STATIC_DCL boolean FDECL ( figurine_location_checks  ,
(struct obj *, coord *, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( use_leash  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( light_cocktail  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_tinning_kit  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( add_class  ,
(char *, CHAR_P)   
)
STATIC_DCL int FDECL ( use_mirror  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( use_figurine  ,
(struct obj **)   
)
STATIC_DCL void FDECL ( use_grease  ,
(struct obj *)   
)
void fig_transform ( genericptr_t  arg,
long  timeout 
)
STATIC_OVL boolean figurine_location_checks ( struct obj obj,
coord cc,
boolean  quietly 
)

References BOULDER, carried, FALSE, IS_ROCK, IS_TREE, isok(), levl, may_passwall(), mons, passes_walls, sobj_at(), throws_rocks, TRUE, u, nhcoord::x, and nhcoord::y.

Referenced by fig_transform(), and use_figurine().

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_attributes_and_properties ( struct obj obj,
int  attr_point 
)
struct obj* get_mleash ( struct monst mtmp ) [read]

References invent, LEASH, obj::nobj, otmp, and obj::otyp.

Referenced by teleport_pet().

Here is the caller graph for this function:

STATIC_OVL boolean its_dead ( int  rx,
int  ry,
int *  resp,
struct obj tobj 
)

References can_reach_floor(), CORPSE, obj::corpsenm, FALSE, Hallucination, IRON_SAFE, permonst::mname, mons, otmp, obj::otyp, pick_lock(), pline(), PM_HEALER, Role_if, sobj_at(), STATUE, STATUE_TRAP, t_at(), The(), TRUE, u, you::ux, you::uy, and vobj_at.

Referenced by use_stethoscope().

Here is the call graph for this function:

Here is the caller graph for this function:

int jump ( int  magic )
STATIC_OVL void light_cocktail ( struct obj obj )

References addinv(), begin_burn(), bill_dummy_object(), Blind, BUFSZ, check_unpaid(), costly_spot(), doname(), end_burn(), FALSE, freeinv(), hold_another_object(), makeknown, obj_extract_self(), shk_your(), splitobj(), TRUE, u, Underwater, you::ux, and you::uy.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

void m_unleash ( struct monst mtmp,
boolean  feedback 
)

References canseemon, invent, LEASH, mhis, Monnam(), obj::nobj, otmp, obj::otyp, and pline().

Referenced by abuse_dog(), check_leash(), dog_move(), domove(), keepdogs(), m_detach(), migrate_to_level(), mon_catchup_elapsed_time(), teleport_pet(), and wary_dog().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int NDECL ( set_trap   )
STATIC_DCL boolean NDECL ( uhave_graystone   )
boolean next_to_u (  )

References DEADMONSTER, distu, FALSE, fmon, invent, LEASH, monst::m_id, mnexto(), mon_has_amulet(), monst::mx, monst::my, monst::nmon, obj::nobj, number_leashed(), otmp, obj::otyp, TRUE, and u.

Referenced by digactualhole(), dodown(), domagicportal(), dotele(), doup(), fall_through(), level_tele(), moveloop(), and tele_trap().

Here is the call graph for this function:

Here is the caller graph for this function:

int number_leashed (  )

References invent, LEASH, obj::nobj, and obj::otyp.

Referenced by drown(), gulpmu(), next_to_u(), and use_leash().

Here is the caller graph for this function:

void o_unleash ( struct obj otmp )

References fmon, monst::m_id, and monst::nmon.

Referenced by bury_an_obj(), eatspecial(), obfree(), and steal().

Here is the caller graph for this function:

void reset_trapset (  )

References trapinfo::force_bungle, and trapinfo::tobj.

Referenced by reset_occupations(), set_trap(), and use_trap().

Here is the caller graph for this function:

STATIC_PTR int set_trap (  )
boolean snuff_candle ( struct obj otmp )

References Blind, BUFSZ, CANDELABRUM_OF_INVOCATION, cansee, end_burn(), FALSE, get_obj_location(), Is_candle, OBJ_MINVENT, pline(), Shk_Your(), and TRUE.

Referenced by kick_object(), snuff_lit(), and throwit().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean snuff_lit ( struct obj obj )

References Blind, BRASS_LANTERN, cansee, end_burn(), FALSE, get_obj_location(), MAGIC_LAMP, OBJ_MINVENT, OIL_LAMP, otense(), pline(), POT_OIL, snuff_candle(), TRUE, and Yname2().

Referenced by dotrap(), get_wet(), gulpmm(), gulpmu(), gulpum(), in_container(), litroom(), mintrap(), and water_damage().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean tinnable ( struct obj corpse )

References permonst::cnutrit, CORPSE, and mons.

Referenced by floorfood(), and getobj().

Here is the caller graph for this function:

STATIC_OVL boolean uhave_graystone (  )

References FALSE, invent, is_graystone, obj::nobj, otmp, and TRUE.

Referenced by doapply().

Here is the caller graph for this function:

boolean um_dist ( xchar  x,
xchar  y,
xchar  n 
)

References u, you::ux, and you::uy.

Referenced by check_leash(), dochug(), expels(), gd_move(), pay_for_damage(), and shopdig().

Here is the caller graph for this function:

int unfixable_trouble_count ( boolean  is_horn )

References Confusion, HHallucination, HStun, Sick, Slimed, STEED, Stoned, Strangled, u, Vomiting, and Wounded_legs.

Referenced by fix_attributes_and_properties(), and peffects().

Here is the caller graph for this function:

void unleash_all (  )

References fmon, invent, LEASH, monst::nmon, obj::nobj, otmp, and obj::otyp.

Referenced by drown(), finish_paybill(), gulpmu(), and savebones().

Here is the caller graph for this function:

STATIC_OVL void use_bell ( struct obj **  optr )
STATIC_OVL void use_candelabrum ( struct obj obj )

References begin_burn(), Blind, end_burn(), FALSE, invocation_pos(), pline(), The(), the(), Tobjnam(), TRUE, u, Underwater, you::ux, you::uy, vtense(), and xname().

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_candle ( struct obj **  optr )

References obj::age, CANDELABRUM_OF_INVOCATION, carrying(), end_burn(), eos(), if(), obj_merge_light_sources(), otmp, obj::otyp, pline(), QBUFSZ, obj::quan, safe_qbuf(), simple_typename(), obj::spe, splitobj(), Sprintf, The(), the(), TRUE, u, Underwater, use_lamp(), useupall(), vtense(), xname(), and yn.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int use_cream_pie ( struct obj obj )

References AT_WEAP, bill_dummy_object(), Blind, Blinded, body_part(), can_blnd(), delobj(), FACE, FALSE, Hallucination, make_blinded(), makeplural(), obj_extract_self(), pline(), rnd(), splitobj(), the(), TRUE, u, you::ucreamed, xname(), and youmonst.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_figurine ( struct obj **  optr )

References you::dx, you::dy, you::dz, FALSE, FIG_TRANSFORM, figurine_location_checks(), flags, getdir(), Is_airlevel, is_pool(), Is_waterlevel, make_familiar(), flag::move, multi, stop_timer(), u, useup(), you::ux, you::uy, you::uz, nhcoord::x, and nhcoord::y.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int use_grapple ( struct obj obj )
STATIC_OVL void use_grease ( struct obj obj )

References body_part(), BUFSZ, consume_obj_charge(), monst::data, dropx(), FINGER, Fumbling, getobj(), Glib, HAND, incr_itimeout(), makeplural(), nohands, otmp, obj::owornmask, pline(), rn2(), rnd(), Strcat, Strcpy, Tobjnam(), TRUE, uarm, uarmc, update_inventory, WORN_ARMOR, xname(), yname(), youmonst, and zeroobj.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_lamp ( struct obj obj )

References begin_burn(), bill_dummy_object(), Blind, BRASS_LANTERN, BUFSZ, check_unpaid(), costly_spot(), end_burn(), FALSE, Is_candle, MAGIC_LAMP, objects, objclass::oc_cost, OIL_LAMP, otense(), pline(), plur, rn2(), s_suffix(), Shk_Your(), Tobjnam(), TRUE, u, Underwater, you::ux, you::uy, xname(), yname(), and Yname2().

Referenced by doapply(), and use_candle().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_leash ( struct obj obj )

References canspotmon, you::dz, get_adjacent_loc(), l_monnam(), m_at, monst::m_id, MAXLEASHED, Monnam(), monst::mtame, number_leashed(), pline(), TRUE, u, you::ux, you::uy, nhcoord::x, and nhcoord::y.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_magic_whistle ( struct obj obj )

References canspotmon, change_luck(), DEADMONSTER, fill_pit(), fmon, Hallucination, makeknown, mintrap(), mnexto(), monst::mtame, monst::mx, monst::my, monst::nmon, rn2(), and wake_nearby().

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int use_mirror ( struct obj obj )
STATIC_OVL int use_pole ( struct obj obj )
STATIC_OVL int use_stethoscope ( struct obj obj )
STATIC_OVL void use_stone ( struct obj tstone )
STATIC_OVL void use_tinning_kit ( struct obj obj )
STATIC_OVL int use_towel ( struct obj obj )

References Blinded, Blindf_off(), body_part(), dropx(), FACE, freehand(), Glib, HAND, LENSES, make_blinded(), makeplural(), obj::otyp, pline(), rn1, rn2(), TRUE, u, ublindf, you::ucreamed, and what.

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void use_trap ( struct obj otmp )
STATIC_OVL int use_whip ( struct obj obj )
STATIC_OVL void use_whistle ( struct obj obj )

References wake_nearby().

Referenced by doapply().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char cant_reach[] = "can't reach that spot from here."

Referenced by use_grapple(), and use_pole().

const char cant_see_spot[] = "won't hit anything if you can't see that spot."

Referenced by use_grapple(), and use_pole().

NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 } [static]
const char hollow_str[] = "a hollow sound. This must be a secret %s!" [static]
const char look_str[] = "look %s." [static]
NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 } [static]
NEARDATA const char need_to_remove_outer_armor[] = "need to remove your %s to grease your %s." [static]
const char no_elbow_room[] = "don't have enough elbow-room to maneuver." [static]
const char not_enough_room[] = "There's not enough room here to use that." [static]

Referenced by use_grapple(), and use_pole().

const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 } [static]

Referenced by doapply().

const char tools_too[] [static]
Initial value:

Referenced by doapply().

struct trapinfo trapinfo [static]
const char where_to_hit[] = "Where do you want to hit?"

Referenced by use_grapple(), and use_pole().

const char whistle_str[] = "produce a %s whistling sound." [static]