Data Structures | Defines

obj.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  vptrs
struct  obj

Defines

#define nexthere   v.v_nexthere
#define ocontainer   v.v_ocontainer
#define ocarry   v.v_ocarry
#define STATUE_HISTORIC   0x01
#define STATUE_MALE   0x02
#define STATUE_FEMALE   0x04
#define OBJ_FREE   0
#define OBJ_FLOOR   1
#define OBJ_CONTAINED   2
#define OBJ_INVENT   3
#define OBJ_MINVENT   4
#define OBJ_MIGRATING   5
#define OBJ_BURIED   6
#define OBJ_ONBILL   7
#define NOBJ_STATES   8
#define greatest_erosion(otmp)   (int)((otmp)->oeroded > (otmp)->oeroded2 ? (otmp)->oeroded : (otmp)->oeroded2)
#define MAX_ERODE   3
#define orotten   oeroded
#define odiluted   oeroded
#define norevive   oeroded2
#define sokoprize   olocked
#define orecursive   olocked
#define opoisoned   otrapped
#define OATTACHED_NOTHING   0
#define OATTACHED_MONST   1
#define OATTACHED_M_ID   2
#define OATTACHED_UNUSED3   3
#define leashmon   corpsenm
#define spestudied   corpsenm
#define fromsink   corpsenm
#define newobj(xl)   (struct obj *)alloc((unsigned)(xl) + sizeof(struct obj))
#define ONAME(otmp)   (((char *)(otmp)->oextra) + (otmp)->oxlth)
#define is_blade(otmp)
#define is_axe(otmp)
#define is_pick(otmp)
#define is_sword(otmp)
#define is_pole(otmp)
#define is_spear(otmp)
#define is_launcher(otmp)
#define is_ammo(otmp)
#define ammo_and_launcher(otmp, ltmp)
#define is_missile(otmp)
#define is_weptool(o)
#define bimanual(otmp)
#define is_multigen(otmp)
#define is_poisonable(otmp)
#define uslinging()   (uwep && objects[uwep->otyp].oc_skill == P_SLING)
#define is_shield(otmp)
#define is_helmet(otmp)
#define is_boots(otmp)
#define is_gloves(otmp)
#define is_cloak(otmp)
#define is_shirt(otmp)
#define is_suit(otmp)
#define is_elven_armor(otmp)
#define is_orcish_armor(otmp)
#define is_dwarvish_armor(otmp)
#define is_gnomish_armor(otmp)   (FALSE)
#define MAX_EGG_HATCH_TIME   200
#define stale_egg(egg)   ((monstermoves - (egg)->age) > (2*MAX_EGG_HATCH_TIME))
#define ofood(o)   ((o)->otyp == CORPSE || (o)->otyp == EGG || (o)->otyp == TIN)
#define polyfodder(obj)
#define mlevelgain(obj)   (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
#define mhealup(obj)   (ofood(obj) && (obj)->corpsenm == PM_NURSE)
#define drainlevel(corpse)   (mons[(corpse)->corpsenm].cnutrit*4/5)
#define carried(o)   ((o)->where == OBJ_INVENT)
#define mcarried(o)   ((o)->where == OBJ_MINVENT)
#define Has_contents(o)
#define Is_container(o)   ((o)->otyp >= LARGE_BOX && (o)->otyp <= BAG_OF_TRICKS)
#define Is_box(otmp)
#define Is_mbag(otmp)
#define Is_sokoprize(otmp)   ((otmp)->sokoprize && !Is_box(otmp))
#define Is_dragon_scales(idx)
#define Is_dragon_mail(idx)
#define Is_dragon_armor(idx)   (Is_dragon_scales(idx) || Is_dragon_mail(idx))
#define Is_gold_dragon_armor(idx)
#define Dragon_scales_to_mail(idx)   (idx - GRAY_DRAGON_SCALES + GRAY_DRAGON_SCALE_MAIL)
#define Dragon_mail_to_scales(idx)   (idx - GRAY_DRAGON_SCALE_MAIL + GRAY_DRAGON_SCALES)
#define Dragon_scales_to_pm(obj)
#define Dragon_mail_to_pm(obj)
#define Dragon_to_scales(pm)   (GRAY_DRAGON_SCALES + (pm - mons))
#define is_elven_weapon(otmp)
#define is_elven_obj(otmp)   (is_elven_armor(otmp) || is_elven_weapon(otmp))
#define is_orcish_obj(otmp)
#define is_dwarvish_obj(otmp)
#define is_gnomish_obj(otmp)   (is_gnomish_armor(otmp))
#define Is_candle(otmp)
#define MAX_OIL_IN_FLASK   400
#define age_is_relative(otmp)
#define ignitable(otmp)
#define is_graystone(obj)
#define is_flimsy(otmp)   (objects[(otmp)->otyp].oc_material <= LEATHER)
#define is_plural(o)
#define CONTAINED_TOO   0x1
#define BURIED_TOO   0x2

Define Documentation

#define age_is_relative (   otmp )
Value:
((otmp)->otyp == BRASS_LANTERN\
                                || (otmp)->otyp == OIL_LAMP\
                                || (otmp)->otyp == CANDELABRUM_OF_INVOCATION\
                                || (otmp)->otyp == TALLOW_CANDLE\
                                || (otmp)->otyp == WAX_CANDLE\
                                || (otmp)->otyp == POT_OIL)

Referenced by in_container(), out_container(), and restobjchn().

#define ammo_and_launcher (   otmp,
  ltmp 
)
Value:
(is_ammo(otmp) && (ltmp) && \
                         objects[(otmp)->otyp].oc_skill == -objects[(ltmp)->otyp].oc_skill)

Referenced by autoquiver(), hmon_hitmon(), hold_another_object(), noisy_hit(), thitmonst(), throw_obj(), throwit(), and thrwmu().

#define bimanual (   otmp )
#define BURIED_TOO   0x2
#define carried (   o )    ((o)->where == OBJ_INVENT)
#define CONTAINED_TOO   0x1
#define Dragon_mail_to_pm (   obj )
#define Dragon_mail_to_scales (   idx )    (idx - GRAY_DRAGON_SCALE_MAIL + GRAY_DRAGON_SCALES)
#define Dragon_scales_to_mail (   idx )    (idx - GRAY_DRAGON_SCALES + GRAY_DRAGON_SCALE_MAIL)
#define Dragon_scales_to_pm (   obj )
#define Dragon_to_scales (   pm )    (GRAY_DRAGON_SCALES + (pm - mons))
#define drainlevel (   corpse )    (mons[(corpse)->corpsenm].cnutrit*4/5)
#define fromsink   corpsenm
#define greatest_erosion (   otmp )    (int)((otmp)->oeroded > (otmp)->oeroded2 ? (otmp)->oeroded : (otmp)->oeroded2)
#define Has_contents (   o )
#define ignitable (   otmp )
Value:
((otmp)->otyp == BRASS_LANTERN\
                                || (otmp)->otyp == OIL_LAMP\
                                || (otmp)->otyp == CANDELABRUM_OF_INVOCATION\
                                || (otmp)->otyp == TALLOW_CANDLE\
                                || (otmp)->otyp == WAX_CANDLE\
                                || (otmp)->otyp == POT_OIL)

Referenced by catch_lit(), and obj_is_burning().

#define is_ammo (   otmp )
Value:
((otmp->oclass == WEAPON_CLASS || \
                         otmp->oclass == GEM_CLASS) && \
                         objects[otmp->otyp].oc_skill >= -P_CROSSBOW && \
                         objects[otmp->otyp].oc_skill <= -P_BOW)

Referenced by autoquiver(), dip(), hmon_hitmon(), ini_inv(), m_throw(), readobjnam(), setuwep(), thitmonst(), and throwit().

#define is_axe (   otmp )
Value:
((otmp->oclass == WEAPON_CLASS || \
                         otmp->oclass == TOOL_CLASS) && \
                         objects[otmp->otyp].oc_skill == P_AXE)

Referenced by dig(), dig_check(), dmgval(), doapply(), dog_move(), getobj(), m_move(), and mfndpos().

#define is_blade (   otmp )
Value:
(otmp->oclass == WEAPON_CLASS && \
                         objects[otmp->otyp].oc_skill >= P_DAGGER && \
                         objects[otmp->otyp].oc_skill <= P_SABER)

Referenced by cutworm(), doforce(), engrave(), and throwing_weapon().

#define is_boots (   otmp )
#define Is_box (   otmp )
#define Is_candle (   otmp )
#define is_cloak (   otmp )
#define Is_container (   o )    ((o)->otyp >= LARGE_BOX && (o)->otyp <= BAG_OF_TRICKS)
#define Is_dragon_armor (   idx )    (Is_dragon_scales(idx) || Is_dragon_mail(idx))

Referenced by knows_class(), and readobjnam().

#define Is_dragon_mail (   idx )
#define Is_dragon_scales (   idx )
#define is_dwarvish_armor (   otmp )
Value:
#define is_dwarvish_obj (   otmp )
#define is_elven_armor (   otmp )
Value:
((otmp)->otyp == ELVEN_LEATHER_HELM\
                                || (otmp)->otyp == ELVEN_MITHRIL_COAT\
                                || (otmp)->otyp == ELVEN_CLOAK\
                                || (otmp)->otyp == ELVEN_SHIELD\
                                || (otmp)->otyp == ELVEN_BOOTS)

Referenced by racial_exception(), and seffects().

#define is_elven_obj (   otmp )    (is_elven_armor(otmp) || is_elven_weapon(otmp))
#define is_elven_weapon (   otmp )
Value:
((otmp)->otyp == ELVEN_ARROW\
                                || (otmp)->otyp == ELVEN_SPEAR\
                                || (otmp)->otyp == ELVEN_DAGGER\
                                || (otmp)->otyp == ELVEN_SHORT_SWORD\
                                || (otmp)->otyp == ELVEN_BROADSWORD\
                                || (otmp)->otyp == ELVEN_BOW)

Referenced by chwepon().

#define is_flimsy (   otmp )    (objects[(otmp)->otyp].oc_material <= LEATHER)
#define is_gloves (   otmp )
#define is_gnomish_armor (   otmp )    (FALSE)
#define is_gnomish_obj (   otmp )    (is_gnomish_armor(otmp))
#define Is_gold_dragon_armor (   idx )
Value:
(Is_dragon_armor(idx) && \
                                         (OBJ_DESCR(objects[idx])) && \
                                         (!strncmp(OBJ_DESCR(objects[idx]), "gold ", 5)))

Referenced by Armor_gone(), Armor_off(), Armor_on(), begin_burn(), savebones(), and update_mon_intrinsics().

#define is_graystone (   obj )
Value:
((obj)->otyp == LUCKSTONE || \
                                 (obj)->otyp == LOADSTONE || \
                                 (obj)->otyp == FLINT     || \
                                 (obj)->otyp == TOUCHSTONE)

Referenced by dorub(), getobj(), ini_inv(), uhave_graystone(), and use_stone().

#define is_helmet (   otmp )
#define is_launcher (   otmp )
Value:
(otmp->oclass == WEAPON_CLASS && \
                         objects[otmp->otyp].oc_skill >= P_BOW && \
                         objects[otmp->otyp].oc_skill <= P_CROSSBOW)

Referenced by hmon_hitmon(), and setuwep().

#define Is_mbag (   otmp )
#define is_missile (   otmp )
Value:
((otmp->oclass == WEAPON_CLASS || \
                         otmp->oclass == TOOL_CLASS) && \
                         objects[otmp->otyp].oc_skill >= -P_BOOMERANG && \
                         objects[otmp->otyp].oc_skill <= -P_DART)

Referenced by autoquiver(), hmon_hitmon(), hold_another_object(), ini_inv(), readobjnam(), setuwep(), and throwing_weapon().

#define is_multigen (   otmp )
Value:
(otmp->oclass == WEAPON_CLASS && \
                         objects[otmp->otyp].oc_skill >= -P_SHURIKEN && \
                         objects[otmp->otyp].oc_skill <= -P_BOW)

Referenced by drop_throw(), and mksobj().

#define is_orcish_armor (   otmp )
Value:
((otmp)->otyp == ORCISH_HELM\
                                || (otmp)->otyp == ORCISH_CHAIN_MAIL\
                                || (otmp)->otyp == ORCISH_RING_MAIL\
                                || (otmp)->otyp == ORCISH_CLOAK\
                                || (otmp)->otyp == URUK_HAI_SHIELD\
                                || (otmp)->otyp == ORCISH_SHIELD)
#define is_orcish_obj (   otmp )
Value:
(is_orcish_armor(otmp)\
                                || (otmp)->otyp == ORCISH_ARROW\
                                || (otmp)->otyp == ORCISH_SPEAR\
                                || (otmp)->otyp == ORCISH_DAGGER\
                                || (otmp)->otyp == ORCISH_SHORT_SWORD\
                                || (otmp)->otyp == ORCISH_BOW)
#define is_pick (   otmp )
#define is_plural (   o )
Value:
((o)->quan > 1 || \
                         (o)->oartifact == ART_EYES_OF_THE_OVERWORLD)

Referenced by can_twoweapon(), do_oname(), dokick(), dowieldquiver(), mon_wield_item(), otense(), and use_misc().

#define is_poisonable (   otmp )
Value:
(otmp->oclass == WEAPON_CLASS && \
                         objects[otmp->otyp].oc_skill >= -P_SHURIKEN && \
                         objects[otmp->otyp].oc_skill <= -P_BOW)

Referenced by dip(), hmon_hitmon(), m_throw(), mksobj(), ohitmon(), poly_obj(), readobjnam(), and xname().

#define is_pole (   otmp )
Value:
((otmp->oclass == WEAPON_CLASS || \
                        otmp->oclass == TOOL_CLASS) && \
                         (objects[otmp->otyp].oc_skill == P_POLEARMS || \
                         objects[otmp->otyp].oc_skill == P_LANCE))

Referenced by doapply(), getobj(), hmon_hitmon(), setuwep(), thrwmu(), and xkilled().

#define is_shield (   otmp )
#define is_shirt (   otmp )
Value:
(otmp->oclass == ARMOR_CLASS && \
                         objects[otmp->otyp].oc_armcat == ARM_SHIRT)

Referenced by can_ooze(), canwearobj(), dowear(), ini_inv(), and m_dowear_type().

#define Is_sokoprize (   otmp )    ((otmp)->sokoprize && !Is_box(otmp))
#define is_spear (   otmp )
Value:
(otmp->oclass == WEAPON_CLASS && \
                         objects[otmp->otyp].oc_skill >= P_SPEAR && \
                         objects[otmp->otyp].oc_skill <= P_JAVELIN)

Referenced by hitval(), throwing_weapon(), and xkilled().

#define is_suit (   otmp )
Value:
(otmp->oclass == ARMOR_CLASS && \
                         objects[otmp->otyp].oc_armcat == ARM_SUIT)

Referenced by canwearobj(), ini_inv(), and m_dowear_type().

#define is_sword (   otmp )
#define is_weptool (   o )
#define leashmon   corpsenm
#define MAX_EGG_HATCH_TIME   200
#define MAX_ERODE   3
#define MAX_OIL_IN_FLASK   400

Referenced by mksobj().

#define mcarried (   o )    ((o)->where == OBJ_MINVENT)

Referenced by curse(), erode_obj(), and merged().

#define mhealup (   obj )    (ofood(obj) && (obj)->corpsenm == PM_NURSE)

Referenced by dog_eat(), meatmetal(), and meatobj().

#define mlevelgain (   obj )    (ofood(obj) && (obj)->corpsenm == PM_WRAITH)

Referenced by dog_eat(), meatmetal(), and meatobj().

#define newobj (   xl )    (struct obj *)alloc((unsigned)(xl) + sizeof(struct obj))
#define nexthere   v.v_nexthere
#define NOBJ_STATES   8
#define norevive   oeroded2
#define OATTACHED_M_ID   2
#define OATTACHED_MONST   1
#define OATTACHED_NOTHING   0
#define OATTACHED_UNUSED3   3
#define OBJ_BURIED   6
#define OBJ_CONTAINED   2
#define OBJ_FLOOR   1
#define OBJ_FREE   0
#define OBJ_INVENT   3
#define OBJ_MIGRATING   5
#define OBJ_MINVENT   4
#define OBJ_ONBILL   7
#define ocarry   v.v_ocarry
#define ocontainer   v.v_ocontainer
#define odiluted   oeroded
#define ofood (   o )    ((o)->otyp == CORPSE || (o)->otyp == EGG || (o)->otyp == TIN)
#define ONAME (   otmp )    (((char *)(otmp)->oextra) + (otmp)->oxlth)
#define opoisoned   otrapped
#define orecursive   olocked
#define orotten   oeroded
#define polyfodder (   obj )
Value:

Referenced by dog_eat(), dropy(), meatmetal(), and meatobj().

#define sokoprize   olocked
#define spestudied   corpsenm
#define stale_egg (   egg )    ((monstermoves - (egg)->age) > (2*MAX_EGG_HATCH_TIME))

Referenced by doname_base(), fprefx(), and hmon_hitmon().

#define STATUE_FEMALE   0x04

Referenced by animate_statue().

#define STATUE_HISTORIC   0x01
#define STATUE_MALE   0x02

Referenced by animate_statue().

#define uslinging (  )    (uwep && objects[uwep->otyp].oc_skill == P_SLING)