Defines

display.h File Reference

#include "vision.h"
#include "mondata.h"
Include dependency graph for display.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define vobj_at(x, y)   (level.objects[x][y])
#define tp_sensemon(mon)
#define sensemon(mon)   (tp_sensemon(mon) || Detect_monsters || MATCH_WARN_OF_MON(mon))
#define mon_warning(mon)
#define mon_visible(mon)
#define see_with_infrared(mon)   (!Blind && Infravision && infravisible(mon->data) && couldsee(mon->mx, mon->my))
#define canseemon(mon)
#define canspotmon(mon)   (canseemon(mon) || sensemon(mon))
#define knowninvisible(mon)
#define is_safepet(mon)
#define canseeself()   (Blind || u.uswallow || (!Invisible && !u.uundetected))
#define senseself()   (canseeself() || Unblind_telepat || Detect_monsters)
#define random_monster()   rn2(NUMMONS)
#define random_object()   rn1(NUM_OBJECTS-1,1)
#define random_trap()   rn1(TRAPNUM-1,1)
#define what_obj(obj)   (Hallucination ? random_object() : obj)
#define what_mon(mon)   (Hallucination ? random_monster() : mon)
#define what_trap(trp)   (Hallucination ? random_trap() : trp)
#define covers_objects(xx, yy)   ((is_pool(xx,yy) && !Underwater) || (levl[xx][yy].typ == LAVAPOOL))
#define covers_traps(xx, yy)   covers_objects(xx,yy)
#define DISP_BEAM   (-1)
#define DISP_FLASH   (-2)
#define DISP_ALWAYS   (-3)
#define DISP_CHANGE   (-4)
#define DISP_END   (-5)
#define DISP_FREEMEM   (-6)
#define SHIELD_COUNT   21
#define maybe_display_usteed
#define display_self()
#define NUM_ZAP   8
#define GLYPH_MON_OFF   0
#define GLYPH_PET_OFF   (NUMMONS + GLYPH_MON_OFF)
#define GLYPH_INVIS_OFF   (NUMMONS + GLYPH_PET_OFF)
#define GLYPH_DETECT_OFF   (1 + GLYPH_INVIS_OFF)
#define GLYPH_BODY_OFF   (NUMMONS + GLYPH_DETECT_OFF)
#define GLYPH_RIDDEN_OFF   (NUMMONS + GLYPH_BODY_OFF)
#define GLYPH_OBJ_OFF   (NUMMONS + GLYPH_RIDDEN_OFF)
#define GLYPH_CMAP_OFF   (NUM_OBJECTS + GLYPH_OBJ_OFF)
#define GLYPH_EXPLODE_OFF   ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF)
#define GLYPH_ZAP_OFF   ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF)
#define GLYPH_SWALLOW_OFF   ((NUM_ZAP << 2) + GLYPH_ZAP_OFF)
#define GLYPH_WARNING_OFF   ((NUMMONS << 3) + GLYPH_SWALLOW_OFF)
#define MAX_GLYPH   (WARNCOUNT + GLYPH_WARNING_OFF)
#define NO_GLYPH   MAX_GLYPH
#define GLYPH_INVISIBLE   GLYPH_INVIS_OFF
#define warning_to_glyph(mwarnlev)   ((mwarnlev)+GLYPH_WARNING_OFF)
#define mon_to_glyph(mon)   ((int) what_mon(monsndx((mon)->data))+GLYPH_MON_OFF)
#define detected_mon_to_glyph(mon)   ((int) what_mon(monsndx((mon)->data))+GLYPH_DETECT_OFF)
#define ridden_mon_to_glyph(mon)   ((int) what_mon(monsndx((mon)->data))+GLYPH_RIDDEN_OFF)
#define pet_to_glyph(mon)   ((int) what_mon(monsndx((mon)->data))+GLYPH_PET_OFF)
#define obj_to_glyph(obj)
#define cmap_to_glyph(cmap_idx)   ((int) (cmap_idx) + GLYPH_CMAP_OFF)
#define explosion_to_glyph(expltype, idx)   ((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF)
#define trap_to_glyph(trap)   cmap_to_glyph(trap_to_defsym(what_trap((trap)->ttyp)))
#define objnum_to_glyph(onum)   ((int) (onum) + GLYPH_OBJ_OFF)
#define monnum_to_glyph(mnum)   ((int) (mnum) + GLYPH_MON_OFF)
#define detected_monnum_to_glyph(mnum)   ((int) (mnum) + GLYPH_DETECT_OFF)
#define ridden_monnum_to_glyph(mnum)   ((int) (mnum) + GLYPH_RIDDEN_OFF)
#define petnum_to_glyph(mnum)   ((int) (mnum) + GLYPH_PET_OFF)
#define hero_glyph
#define glyph_to_mon(glyph)
#define glyph_to_obj(glyph)
#define glyph_to_trap(glyph)
#define glyph_to_cmap(glyph)
#define glyph_to_swallow(glyph)
#define glyph_to_warning(glyph)
#define glyph_is_monster(glyph)
#define glyph_is_normal_monster(glyph)   ((glyph) >= GLYPH_MON_OFF && (glyph) < (GLYPH_MON_OFF+NUMMONS))
#define glyph_is_pet(glyph)   ((glyph) >= GLYPH_PET_OFF && (glyph) < (GLYPH_PET_OFF+NUMMONS))
#define glyph_is_body(glyph)   ((glyph) >= GLYPH_BODY_OFF && (glyph) < (GLYPH_BODY_OFF+NUMMONS))
#define glyph_is_ridden_monster(glyph)   ((glyph) >= GLYPH_RIDDEN_OFF && (glyph) < (GLYPH_RIDDEN_OFF+NUMMONS))
#define glyph_is_detected_monster(glyph)   ((glyph) >= GLYPH_DETECT_OFF && (glyph) < (GLYPH_DETECT_OFF+NUMMONS))
#define glyph_is_invisible(glyph)   ((glyph) == GLYPH_INVISIBLE)
#define glyph_is_normal_object(glyph)   ((glyph) >= GLYPH_OBJ_OFF && (glyph) < (GLYPH_OBJ_OFF+NUM_OBJECTS))
#define glyph_is_object(glyph)
#define glyph_is_trap(glyph)
#define glyph_is_cmap(glyph)   ((glyph) >= GLYPH_CMAP_OFF && (glyph) < (GLYPH_CMAP_OFF+MAXPCHARS))
#define glyph_is_swallow(glyph)   ((glyph) >= GLYPH_SWALLOW_OFF && (glyph) < (GLYPH_SWALLOW_OFF+(NUMMONS << 3)))
#define glyph_is_warning(glyph)   ((glyph) >= GLYPH_WARNING_OFF && (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))

Define Documentation

#define canseemon (   mon )
#define canseeself (  )    (Blind || u.uswallow || (!Invisible && !u.uundetected))
#define canspotmon (   mon )    (canseemon(mon) || sensemon(mon))
#define cmap_to_glyph (   cmap_idx )    ((int) (cmap_idx) + GLYPH_CMAP_OFF)
#define covers_objects (   xx,
  yy 
)    ((is_pool(xx,yy) && !Underwater) || (levl[xx][yy].typ == LAVAPOOL))
#define covers_traps (   xx,
  yy 
)    covers_objects(xx,yy)

Referenced by unmap_object().

#define detected_mon_to_glyph (   mon )    ((int) what_mon(monsndx((mon)->data))+GLYPH_DETECT_OFF)

Referenced by display_monster(), and monster_detect().

#define detected_monnum_to_glyph (   mnum )    ((int) (mnum) + GLYPH_DETECT_OFF)

Referenced by detect_wsegs(), and display_monster().

#define DISP_ALWAYS   (-3)

Referenced by start_engulf(), and tmp_at().

#define DISP_BEAM   (-1)

Referenced by bhit(), buzz(), explode(), tmp_at(), and zap_dig().

#define DISP_CHANGE   (-4)

Referenced by boomhit(), buzz(), explode(), and tmp_at().

#define DISP_END   (-5)
#define DISP_FLASH   (-2)
#define DISP_FREEMEM   (-6)

Referenced by freedynamicdata(), and tmp_at().

#define display_self (  )
#define explosion_to_glyph (   expltype,
  idx 
)    ((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF)

Referenced by explode().

#define GLYPH_BODY_OFF   (NUMMONS + GLYPH_DETECT_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_CMAP_OFF   (NUM_OBJECTS + GLYPH_OBJ_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_DETECT_OFF   (1 + GLYPH_INVIS_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_EXPLODE_OFF   ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_INVIS_OFF   (NUMMONS + GLYPH_PET_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_INVISIBLE   GLYPH_INVIS_OFF

Referenced by map_invisible(), and peffects().

#define glyph_is_body (   glyph )    ((glyph) >= GLYPH_BODY_OFF && (glyph) < (GLYPH_BODY_OFF+NUMMONS))
#define glyph_is_cmap (   glyph )    ((glyph) >= GLYPH_CMAP_OFF && (glyph) < (GLYPH_CMAP_OFF+MAXPCHARS))
#define glyph_is_detected_monster (   glyph )    ((glyph) >= GLYPH_DETECT_OFF && (glyph) < (GLYPH_DETECT_OFF+NUMMONS))
#define glyph_is_invisible (   glyph )    ((glyph) == GLYPH_INVISIBLE)
#define glyph_is_monster (   glyph )
#define glyph_is_normal_monster (   glyph )    ((glyph) >= GLYPH_MON_OFF && (glyph) < (GLYPH_MON_OFF+NUMMONS))
#define glyph_is_normal_object (   glyph )    ((glyph) >= GLYPH_OBJ_OFF && (glyph) < (GLYPH_OBJ_OFF+NUM_OBJECTS))
#define glyph_is_object (   glyph )
#define glyph_is_pet (   glyph )    ((glyph) >= GLYPH_PET_OFF && (glyph) < (GLYPH_PET_OFF+NUMMONS))

Referenced by check_tutorial_farlook().

#define glyph_is_ridden_monster (   glyph )    ((glyph) >= GLYPH_RIDDEN_OFF && (glyph) < (GLYPH_RIDDEN_OFF+NUMMONS))

Referenced by check_tutorial_farlook().

#define glyph_is_swallow (   glyph )    ((glyph) >= GLYPH_SWALLOW_OFF && (glyph) < (GLYPH_SWALLOW_OFF+(NUMMONS << 3)))

Referenced by do_look().

#define glyph_is_trap (   glyph )
#define glyph_is_warning (   glyph )    ((glyph) >= GLYPH_WARNING_OFF && (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))

Referenced by attack_checks(), and do_look().

#define GLYPH_MON_OFF   0
#define GLYPH_OBJ_OFF   (NUMMONS + GLYPH_RIDDEN_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_PET_OFF   (NUMMONS + GLYPH_MON_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_RIDDEN_OFF   (NUMMONS + GLYPH_BODY_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_SWALLOW_OFF   ((NUM_ZAP << 2) + GLYPH_ZAP_OFF)
#define glyph_to_cmap (   glyph )
#define glyph_to_mon (   glyph )
Value:
(glyph_is_normal_monster(glyph) ? ((glyph)-GLYPH_MON_OFF) :     \
        glyph_is_pet(glyph) ? ((glyph)-GLYPH_PET_OFF) :                 \
        glyph_is_detected_monster(glyph) ? ((glyph)-GLYPH_DETECT_OFF) : \
        glyph_is_ridden_monster(glyph) ? ((glyph)-GLYPH_RIDDEN_OFF) :   \
        NO_GLYPH)

Referenced by do_look().

#define glyph_to_obj (   glyph )
#define glyph_to_swallow (   glyph )
Value:
(glyph_is_swallow(glyph) ? (((glyph) - GLYPH_SWALLOW_OFF) & 0x7) : \
        0)

Referenced by do_look().

#define glyph_to_trap (   glyph )
Value:
(glyph_is_trap(glyph) ?                                         \
                ((int) defsym_to_trap((glyph) - GLYPH_CMAP_OFF)) :      \
        NO_GLYPH)

Referenced by do_look(), and lookat().

#define glyph_to_warning (   glyph )
Value:
(glyph_is_warning(glyph) ? ((glyph) - GLYPH_WARNING_OFF) :      \
        NO_GLYPH);

Referenced by do_look().

#define GLYPH_WARNING_OFF   ((NUMMONS << 3) + GLYPH_SWALLOW_OFF)

Referenced by mapglyph(), and show_glyph().

#define GLYPH_ZAP_OFF   ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF)
#define hero_glyph
#define is_safepet (   mon )
Value:

Referenced by attack(), and domove().

#define knowninvisible (   mon )
Value:
(mtmp->minvis && \
            ((cansee(mon->mx, mon->my) && (See_invisible || Detect_monsters)) || \
                (!Blind && (HTelepat & ~INTRINSIC) && \
                    distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM) \
                ) \
            ) \
        )

Referenced by bhitm().

#define MAX_GLYPH   (WARNCOUNT + GLYPH_WARNING_OFF)

Referenced by show_glyph().

#define maybe_display_usteed
#define mon_to_glyph (   mon )    ((int) what_mon(monsndx((mon)->data))+GLYPH_MON_OFF)
#define mon_visible (   mon )
Value:
(               /* The hero can see the monster     */\
                                        /* IF the monster                   */\
    (!mon->minvis || See_invisible) &&  /* 1. is not invisible AND          */\
    (!mon->mundetected) &&              /* 2. not an undetected hider       */\
    (!(mon->mburied || u.uburied))      /* 3. neither you or it is buried   */\
)

Referenced by dog_eat(), domove(), explmu(), gd_move(), lookat(), mswings(), mswingsm(), and newsym().

#define mon_warning (   mon )
Value:
(Warning && !(mon)->mpeaceful &&                                \
                         (distu((mon)->mx, (mon)->my) < 100) &&                         \
                         (((int) ((mon)->m_lev / 4)) >= flags.warnlevel))

Referenced by display_warning(), and newsym().

#define monnum_to_glyph (   mnum )    ((int) (mnum) + GLYPH_MON_OFF)

Referenced by detect_wsegs(), and display_monster().

#define NO_GLYPH   MAX_GLYPH
#define NUM_ZAP   8

Referenced by zapdir_to_glyph().

#define obj_to_glyph (   obj )
#define objnum_to_glyph (   onum )    ((int) (onum) + GLYPH_OBJ_OFF)

Referenced by feel_location().

#define pet_to_glyph (   mon )    ((int) what_mon(monsndx((mon)->data))+GLYPH_PET_OFF)

Referenced by display_monster().

#define petnum_to_glyph (   mnum )    ((int) (mnum) + GLYPH_PET_OFF)

Referenced by display_monster().

#define random_monster (  )    rn2(NUMMONS)

Referenced by poly_obj(), and sense_trap().

#define random_object (  )    rn1(NUM_OBJECTS-1,1)

Referenced by sense_trap().

#define random_trap (  )    rn1(TRAPNUM-1,1)
#define ridden_mon_to_glyph (   mon )    ((int) what_mon(monsndx((mon)->data))+GLYPH_RIDDEN_OFF)
#define ridden_monnum_to_glyph (   mnum )    ((int) (mnum) + GLYPH_RIDDEN_OFF)
#define see_with_infrared (   mon )    (!Blind && Infravision && infravisible(mon->data) && couldsee(mon->mx, mon->my))

Referenced by do_mname(), lookat(), and newsym().

#define sensemon (   mon )    (tp_sensemon(mon) || Detect_monsters || MATCH_WARN_OF_MON(mon))
#define senseself (  )    (canseeself() || Unblind_telepat || Detect_monsters)

Referenced by lookat(), and newsym().

#define SHIELD_COUNT   21

Referenced by explode(), and shieldeff().

#define tp_sensemon (   mon )
Value:
(       /* The hero can always sense a monster IF:  */\
    (!mindless(mon->data) &&    /* 1. the monster has a brain to sense AND  */\
     (!which_armor(mon, W_ARMH) || which_armor(mon, W_ARMH)->otyp != TINFOIL_HAT)) && \
      ((Blind && Blind_telepat) ||      /* 2a. hero is blind and telepathic OR      */\
                                /* 2b. hero is using a telepathy inducing   */\
                                /*       object and in range                */\
                                /* FALSE if monster is wearing a tinfoil hat*/\
      (Unblind_telepat &&                                             \
        (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))                  \
)

Referenced by feel_location(), lookat(), and newsym().

#define trap_to_glyph (   trap )    cmap_to_glyph(trap_to_defsym(what_trap((trap)->ttyp)))

Referenced by find_trap(), and map_trap().

#define vobj_at (   x,
 
)    (level.objects[x][y])
#define warning_to_glyph (   mwarnlev )    ((mwarnlev)+GLYPH_WARNING_OFF)

Referenced by display_warning().

#define what_mon (   mon )    (Hallucination ? random_monster() : mon)
#define what_obj (   obj )    (Hallucination ? random_object() : obj)
#define what_trap (   trp )    (Hallucination ? random_trap() : trp)