Data Structures | Defines | Functions | Variables

mkobj.c File Reference

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

Data Structures

struct  icp

Defines

#define TAINT_AGE   (50L)
#define TROLL_REVIVE_CHANCE   37
#define ROT_AGE   (250L)
#define special_corpse(num)
#define ON_ICE(a)   ((a)->recharged)
#define ROT_ICE_ADJUSTMENT   2

Functions

STATIC_DCL void FDECL (mkbox_cnts,(struct obj *))
STATIC_DCL void FDECL (obj_timer_checks,(struct obj *, XCHAR_P, XCHAR_P, int))
STATIC_DCL void FDECL (container_weight,(struct obj *))
STATIC_DCL struct objFDECL (save_mtraits,(struct obj *, struct monst *))
struct objmkobj_at (char let, int x, int y, boolean artif)
struct objmksobj_at (int otyp, int x, int y, boolean init, boolean artif)
struct objmkobj (char oclass, boolean artif)
STATIC_OVL void mkbox_cnts (struct obj *box)
int rndmonnum ()
struct objsplitobj (struct obj *obj, long num)
void replace_object (struct obj *obj, struct obj *otmp)
void bill_dummy_object (struct obj *otmp)
struct objmksobj (int otyp, boolean init, boolean artif)
void start_corpse_timeout (struct obj *body)
void bless (struct obj *otmp)
void unbless (struct obj *otmp)
void curse (struct obj *otmp)
void uncurse (struct obj *otmp)
void blessorcurse (struct obj *otmp, int chance)
int bcsign (struct obj *otmp)
int weight (struct obj *obj)
struct objrnd_treefruit_at (int x, int y)
struct objmkgold (long amount, int x, int y)
struct objmkcorpstat (int objtype, struct monst *mtmp, struct permonst *ptr, int x, int y, boolean init)
struct objobj_attach_mid (struct obj *obj, unsigned mid)
static struct objsave_mtraits (struct obj *obj, struct monst *mtmp)
struct monstget_mtraits (struct obj *obj, boolean copyof)
struct objmk_tt_object (int objtype, int x, int y)
struct objmk_named_object (int objtype, struct permonst *ptr, int x, int y, const char *nm)
boolean is_flammable (struct obj *otmp)
boolean is_rottable (struct obj *otmp)
void place_object (struct obj *otmp, int x, int y)
void obj_ice_effects (int x, int y, boolean do_buried)
long peek_at_iced_corpse_age (struct obj *otmp)
STATIC_OVL void obj_timer_checks (struct obj *otmp, xchar x, xchar y, int force)
void remove_object (struct obj *otmp)
void discard_minvent (struct monst *mtmp)
void obj_extract_self (struct obj *obj)
void extract_nobj (struct obj *obj, struct obj **head_ptr)
void extract_nexthere (struct obj *obj, struct obj **head_ptr)
int add_to_minv (struct monst *mon, struct obj *obj)
struct objadd_to_container (struct obj *container, struct obj *obj)
void add_to_migration (struct obj *obj)
void add_to_buried (struct obj *obj)
STATIC_OVL void container_weight (struct obj *container)
void dealloc_obj (struct obj *obj)

Variables

struct objthrownobj
struct icp mkobjprobs []
struct icp boxiprobs []
struct icp hellprobs []
static const char dknowns []
static int treefruits [] = {APPLE,ORANGE,PEAR,BANANA,EUCALYPTUS_LEAF}

Define Documentation

#define ON_ICE (   a )    ((a)->recharged)
#define ROT_AGE   (250L)

Referenced by start_corpse_timeout().

#define ROT_ICE_ADJUSTMENT   2
#define special_corpse (   num )
Value:
(((num) == PM_LIZARD)           \
                                || ((num) == PM_LICHEN)         \
                                || (is_rider(&mons[num]))       \
                                || (mons[num].mlet == S_TROLL))

Referenced by mkcorpstat().

#define TAINT_AGE   (50L)

Referenced by start_corpse_timeout().

#define TROLL_REVIVE_CHANCE   37

Referenced by start_corpse_timeout().


Function Documentation

void add_to_buried ( struct obj obj )

References dlevel_t::buriedobjlist, level, OBJ_BURIED, and OBJ_FREE.

Referenced by bury_an_obj(), mineralize(), and mkgrave().

Here is the caller graph for this function:

struct obj* add_to_container ( struct obj container,
struct obj obj 
) [read]

References obj::cobj, merged(), obj::nobj, OBJ_CONTAINED, OBJ_FREE, OBJ_INVENT, OBJ_MINVENT, obj_no_longer_held(), and otmp.

Referenced by create_object(), doloot(), drop_upon_death(), fill_zoo(), in_container(), maketrap(), mkbox_cnts(), mksobj(), monstone(), and observe_quantum_cat().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_to_migration ( struct obj obj )

References migrating_objs, OBJ_FREE, and OBJ_MIGRATING.

Referenced by impact_drop(), launch_obj(), moverock(), and ship_object().

Here is the caller graph for this function:

int add_to_minv ( struct monst mon,
struct obj obj 
)

References merged(), mon, obj::nobj, OBJ_FREE, OBJ_MINVENT, otmp, and obj::where.

Referenced by animate_statue(), clonewiz(), display_minventory(), doloot(), drop_upon_death(), gd_move(), ghitm(), mdamagem(), mpickgold(), mpickobj(), relobj(), shopdig(), and throw_gold().

Here is the call graph for this function:

Here is the caller graph for this function:

int bcsign ( struct obj otmp )

Referenced by arti_speak(), doread(), dowrite(), fpostfx(), mksobj(), peffects(), seffects(), use_defensive(), and use_offensive().

Here is the caller graph for this function:

void bill_dummy_object ( struct obj otmp )
void bless ( struct obj otmp )

References BAG_OF_HOLDING, carried, COIN_CLASS, confers_luck(), FIG_TRANSFORM, FIGURINE, otmp, set_moreluck(), stop_timer(), and weight().

Referenced by blessorcurse(), create_object(), dip(), dipfountain(), final_level(), m_initweap(), mk_mplayer_armor(), and pleased().

Here is the call graph for this function:

Here is the caller graph for this function:

void blessorcurse ( struct obj otmp,
int  chance 
)

References bless(), curse(), and rn2().

Referenced by mksobj(), and seffects().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void container_weight ( struct obj container )

References OBJ_CONTAINED, and weight().

Referenced by obj_extract_self().

Here is the call graph for this function:

Here is the caller graph for this function:

void curse ( struct obj otmp )
void dealloc_obj ( struct obj obj )
void discard_minvent ( struct monst mtmp )

References obfree(), obj_extract_self(), and otmp.

Referenced by create_monster(), makemon(), and mongone().

Here is the call graph for this function:

Here is the caller graph for this function:

void extract_nexthere ( struct obj obj,
struct obj **  head_ptr 
)

Referenced by remove_object(), and replace_object().

Here is the caller graph for this function:

void extract_nobj ( struct obj obj,
struct obj **  head_ptr 
)

References obj::nobj, and OBJ_FREE.

Referenced by doorganize(), freeinv(), inven_inuse(), obj_extract_self(), remove_object(), and replace_object().

Here is the caller graph for this function:

STATIC_DCL struct obj* FDECL ( save_mtraits  ,
(struct obj *, struct monst *)   
) [read]
STATIC_DCL void FDECL ( obj_timer_checks  ,
(struct obj *, XCHAR_P, XCHAR_P, int)   
)
STATIC_DCL void FDECL ( container_weight  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( mkbox_cnts  ,
(struct obj *)   
)
struct monst* get_mtraits ( struct obj obj,
boolean  copyof 
) [read]

References if(), monst::mnamelth, monst::mxlth, newmonst, and OATTACHED_MONST.

Referenced by dosacrifice(), montraits(), and start_corpse_timeout().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean is_flammable ( struct obj otmp )

References FALSE, FIRE_RES, LIQUID, objects, obj::otyp, PLASTIC, WAN_FIRE, and WOOD.

Referenced by add_erosion_words(), dip(), fire_damage(), not_fully_identified(), poly_obj(), readobjnam(), and rust_dmg().

Here is the caller graph for this function:

boolean is_rottable ( struct obj otmp )

References LIQUID, objects, obj::otyp, and WOOD.

Referenced by fill_zoo(), poly_obj(), readobjnam(), and rust_dmg().

Here is the caller graph for this function:

struct obj* mk_named_object ( int  objtype,
struct permonst ptr,
int  x,
int  y,
const char *  nm 
) [read]

References mkcorpstat(), oname(), otmp, and STATUE.

Referenced by done(), observe_quantum_cat(), and savebones().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* mk_tt_object ( int  objtype,
int  x,
int  y 
) [read]

References FALSE, mksobj_at(), otmp, STATUE, and tt_oname().

Referenced by dig_up_grave(), fill_zoo(), and fixup_special().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mkbox_cnts ( struct obj box )
struct obj* mkcorpstat ( int  objtype,
struct monst mtmp,
struct permonst ptr,
int  x,
int  y,
boolean  init 
) [read]
struct obj* mkgold ( long  amount,
int  x,
int  y 
) [read]
struct obj* mkobj ( char  oclass,
boolean  artif 
) [read]
struct obj* mkobj_at ( char  let,
int  x,
int  y,
boolean  artif 
) [read]

References mkobj(), otmp, and place_object().

Referenced by create_object(), dokick(), fill_empty_maze(), fill_zoo(), makelevel(), makemaz(), makemon(), makeniche(), mkshobj_at(), and xkilled().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* mksobj ( int  otyp,
boolean  init,
boolean  artif 
) [read]

References A_NONE, add_to_container(), obj::age, AMULET_CLASS, AMULET_OF_CHANGE, AMULET_OF_RESTFUL_SLEEP, AMULET_OF_STRANGULATION, AMULET_OF_YENDOR, ARMOR_CLASS, attach_egg_hatch_timeout(), BAG_OF_HOLDING, BAG_OF_TRICKS, BALL_CLASS, bcsign(), BELL_OF_OPENING, blessorcurse(), BRASS_LANTERN, can_be_hatched(), CAN_OF_GREASE, CHAIN_CLASS, CHEST, COIN_CLASS, CORPSE, obj::corpsenm, CRYSTAL_BALL, current_fruit, curse(), dead_species(), DRUM_OF_EARTHQUAKE, EGG, ELVEN_SHIELD, EXPENSIVE_CAMERA, FALSE, FIGURINE, FIRE_HORN, flags, FOOD_CLASS, FROST_HORN, FUMBLE_BOOTS, G_NOCORPSE, GAUNTLETS_OF_FUMBLING, GEM_CLASS, HELM_OF_OPPOSITE_ALIGNMENT, HORN_OF_PLENTY, ICE_BOX, flag::ident, In_quest(), index, IRON_SAFE, is_human, is_multigen, is_poisonable, KELP_FROND, LARGE_BOX, level_difficulty(), LEVITATION_BOOTS, LOADSTONE, LUCKSTONE, flag::made_amulet, MAGIC_FLUTE, MAGIC_HARP, MAGIC_LAMP, MAGIC_MARKER, MAX_OIL_IN_FLASK, MEAT_RING, mk_artifact(), mkbox_cnts(), mkobj(), mons, monstermoves, moves, mvitals::mvflags, newobj, NODIR, NON_PM, obj::o_id, obj::oartifact, OBJ_FREE, objects, objclass::oc_class, objclass::oc_cost, obj::oclass, obj::oeaten, OIL_LAMP, OILSKIN_SACK, ORCISH_SHIELD, otmp, obj::otyp, obj::owt, PM_HUMAN, PM_SAMURAI, POT_OIL, POTION_CLASS, obj::quan, RIN_AGGRAVATE_MONSTER, RIN_HUNGER, RIN_POLYMORPH, RIN_TELEPORTATION, RING_CLASS, rn1, rn2(), rnd(), rndmonnum(), rne(), rnf(), ROCK, ROCK_CLASS, Role_if, SACK, SCR_MAIL, SCROLL_CLASS, SHIELD_OF_REFLECTION, SLIME_MOLD, SPBOOK_CLASS, obj::spe, SPLINT_MAIL, start_corpse_timeout(), STATUE, TALLOW_CANDLE, TIN, TINFOIL_HAT, TINNING_KIT, TOOL_CLASS, TRUE, u, undead_to_corpse(), you::uz, VENOM_CLASS, verysmall, WAN_WISHING, WAND_CLASS, WAX_CANDLE, WEAPON_CLASS, weight(), obj::where, and zeroobj.

Referenced by arti_invoke(), bagotricks(), clonewiz(), cnv_trap_obj(), dokick(), done(), dosit(), dospit(), dotrap(), dowrite(), drop_boulder_on_monster(), drop_boulder_on_player(), final_level(), floorfood(), ini_inv(), level_tele(), lookat(), m_initinv(), m_initthrow(), m_initweap(), makedog(), mdamagem(), mineralize(), mintrap(), mk_artifact(), mk_mplayer(), mk_mplayer_armor(), mkbox_cnts(), mkcorpstat(), mkgoldobj(), mkobj(), mkroll_launch(), mksobj_at(), mongets(), monstone(), opentin(), poly_obj(), readobjnam(), repair_damage(), shkinit(), spelleffects(), spitmu(), and use_tinning_kit().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* mksobj_at ( int  otyp,
int  x,
int  y,
boolean  init,
boolean  artif 
) [read]
struct obj* obj_attach_mid ( struct obj obj,
unsigned  mid 
) [read]

References OATTACHED_M_ID, obj::oextra, ONAME, obj::onamelth, otmp, obj::oxlth, and realloc_obj().

Referenced by savebones().

Here is the call graph for this function:

Here is the caller graph for this function:

void obj_extract_self ( struct obj obj )
void obj_ice_effects ( int  x,
int  y,
boolean  do_buried 
)

References dlevel_t::buriedobjlist, level, obj::nobj, obj_timer_checks(), dlevel_t::objects, otmp, obj::ox, obj::oy, and obj::timed.

Referenced by melt_ice(), and zap_over_floor().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void obj_timer_checks ( struct obj otmp,
xchar  x,
xchar  y,
int  force 
)

References obj::age, CORPSE, FALSE, is_ice(), monstermoves, OBJ_BURIED, OBJ_FLOOR, ON_ICE, otmp, pline(), REVIVE_MON, ROT_CORPSE, ROT_ICE_ADJUSTMENT, start_timer(), stop_timer(), The(), TIMER_OBJECT, TRUE, and xname().

Referenced by obj_ice_effects(), place_object(), and remove_object().

Here is the call graph for this function:

Here is the caller graph for this function:

long peek_at_iced_corpse_age ( struct obj otmp )

References obj::age, CORPSE, doname(), monstermoves, ON_ICE, pline(), ROT_ICE_ADJUSTMENT, and s_suffix().

Referenced by doeat(), dogfood(), dosacrifice(), eatcorpse(), and edibility_prompts().

Here is the call graph for this function:

Here is the caller graph for this function:

void place_object ( struct obj otmp,
int  x,
int  y 
)
void remove_object ( struct obj otmp )

References BOULDER, extract_nexthere(), extract_nobj(), fobj, level, OBJ_FLOOR, obj_timer_checks(), dlevel_t::objects, obj::ox, and unblock_point().

Referenced by create_object(), move_bc(), move_gold(), movebubbles(), moverock(), movobj(), obj_extract_self(), repair_damage(), and set_bc().

Here is the call graph for this function:

Here is the caller graph for this function:

void replace_object ( struct obj obj,
struct obj otmp 
)

References extract_nexthere(), extract_nobj(), fobj, invent, level, obj::nobj, OBJ_CONTAINED, OBJ_FLOOR, OBJ_FREE, OBJ_INVENT, OBJ_MINVENT, dlevel_t::objects, otmp, obj::ox, obj::oy, and obj::where.

Referenced by poly_obj(), and realloc_obj().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* rnd_treefruit_at ( int  x,
int  y 
) [read]

References FALSE, mksobj_at(), rn2(), SIZE, and TRUE.

Referenced by dig(), dokick(), and mdig_tunnel().

Here is the call graph for this function:

Here is the caller graph for this function:

int rndmonnum (  )

References G_HELL, G_NOGEN, permonst::geno, Inhell, LOW_PM, mons, monsndx(), rn1, rndmonst(), and SPECIAL_PM.

Referenced by create_object(), fixup_special(), maketrap(), and mksobj().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct obj* save_mtraits ( struct obj obj,
struct monst mtmp 
) [static, read]

References monst::data, if(), monst::minvent, monst::mnum, monsndx(), monst::nmon, OATTACHED_MONST, obj::oextra, ONAME, otmp, obj::oxlth, and realloc_obj().

Referenced by mkcorpstat().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* splitobj ( struct obj obj,
long  num 
) [read]
void start_corpse_timeout ( struct obj body )
void unbless ( struct obj otmp )

References BAG_OF_HOLDING, carried, confers_luck(), set_moreluck(), and weight().

Referenced by cancel_item(), create_object(), dip(), doapply(), rndcurse(), and use_defensive().

Here is the call graph for this function:

Here is the caller graph for this function:

void uncurse ( struct obj otmp )

References BAG_OF_HOLDING, carried, confers_luck(), FIG_TRANSFORM, FIGURINE, otmp, set_moreluck(), stop_timer(), and weight().

Referenced by cancel_item(), create_object(), dip(), dipfountain(), dosacrifice(), fix_worst_trouble(), pleased(), priestini(), and seffects().

Here is the call graph for this function:

Here is the caller graph for this function:

int weight ( struct obj obj )

Variable Documentation

struct icp boxiprobs[]
Initial value:
 {
{18, GEM_CLASS},
{15, FOOD_CLASS},
{18, POTION_CLASS},
{18, SCROLL_CLASS},
{12, SPBOOK_CLASS},
{ 7, COIN_CLASS},
{ 6, WAND_CLASS},
{ 5, RING_CLASS},
{ 1, AMULET_CLASS}
}

Referenced by mkbox_cnts().

const char dknowns[] [static]
struct icp hellprobs[]
Initial value:
 {
{20, WEAPON_CLASS},
{20, ARMOR_CLASS},
{16, FOOD_CLASS},
{12, TOOL_CLASS},
{10, GEM_CLASS},
{ 1, POTION_CLASS},
{ 1, SCROLL_CLASS},
{ 8, WAND_CLASS},
{ 8, RING_CLASS},
{ 4, AMULET_CLASS}
}
struct icp mkobjprobs[]
Initial value:
 {
{10, WEAPON_CLASS},
{10, ARMOR_CLASS},
{20, FOOD_CLASS},
{ 8, TOOL_CLASS},
{ 8, GEM_CLASS},
{16, POTION_CLASS},
{16, SCROLL_CLASS},
{ 4, SPBOOK_CLASS},
{ 4, WAND_CLASS},
{ 3, RING_CLASS},
{ 1, AMULET_CLASS}
}

Referenced by mkobj().

struct obj* thrownobj
int treefruits[] = {APPLE,ORANGE,PEAR,BANANA,EUCALYPTUS_LEAF} [static]