#include "vision.h"
#include "mondata.h"
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 canseemon | ( | mon ) |
((mon->wormno ? worm_known(mon) : \ (cansee(mon->mx, mon->my) || see_with_infrared(mon))) \ && mon_visible(mon))
Referenced by attack_checks(), awaken_soldiers(), bhitm(), breamu(), buzz(), buzzmu(), calm_nymphs(), cancel_monst(), cast_cleric_spell(), cast_wizard_spell(), castmu(), charm_snakes(), corpse_chance(), cursetxt(), damageum(), destroy_mitem(), digactualhole(), dochug(), dochugw(), dog_eat(), dogaze(), dosounds(), erode_obj(), explmu(), fig_transform(), flash_hits_mon(), gazemm(), gazemu(), ghitm(), grease_protect(), hatch_egg(), hitmu(), hmon_hitmon(), intemple(), keepdogs(), lookat(), m_dowear_type(), m_move(), m_throw(), m_unleash(), make_corpse(), make_happy_shk(), mattackm(), mattacku(), mdamagem(), meatmetal(), mintrap(), mon_adjust_speed(), mon_consume_unstone(), mon_to_stone(), mon_wield_item(), monflee(), mquaffmsg(), mreadmsg(), mtele_trap(), mzapmsg(), new_were(), passive(), passivemm(), pick_lock(), potionhit(), prisoner_speaks(), revive(), revive_corpse(), revive_cthulhu(), rust_dmg(), setmangry(), setmnotwielded(), spitmu(), tamedog(), tele_restrict(), thrwmu(), tmiss(), unturn_dead(), update_mon_intrinsics(), use_defensive(), use_mirror(), use_misc(), use_offensive(), use_pole(), were_change(), were_summon(), and x_monnam().
#define canseeself | ( | ) | (Blind || u.uswallow || (!Invisible && !u.uundetected)) |
Referenced by animate_statue(), attack(), attack_checks(), beg(), bhit(), bhitm(), buzz(), castmu(), corpse_chance(), create_camera_demon(), create_critters(), do_mname(), dochat(), dochugw(), dog_move(), dokick(), domonnoise(), domove(), done_in_by(), dopay(), dosearch0(), drop_boulder_on_monster(), explode(), findone(), flash_hits_mon(), gd_move(), hit(), hitmm(), hitmu(), hmon_hitmon(), invault(), mattackm(), Mb_hit(), mbhit(), mbhitm(), mdamagem(), miss(), missmm(), missmu(), missum(), monster_nearby(), moverock(), observe_quantum_cat(), obstructed(), ohitmon(), pronoun_gender(), rouse_shk(), shkcatch(), split_mon(), steal(), use_defensive(), use_leash(), use_magic_whistle(), use_offensive(), use_stethoscope(), use_whip(), x_monnam(), xkilled(), and you_aggravate().
#define cmap_to_glyph | ( | cmap_idx ) | ((int) (cmap_idx) + GLYPH_CMAP_OFF) |
Referenced by back_to_glyph(), bhit(), boomhit(), clear_level_structures(), create_gas_cloud(), display_monster(), docrt(), explode(), feel_location(), forget_map(), glyph_at(), magic_map_background(), movebubbles(), newsym(), row_refresh(), savebones(), setup_waterlevel(), shieldeff(), swallowed(), under_water(), unmap_object(), and zap_dig().
#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().
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_END (-5) |
Referenced by bhit(), boomhit(), buzz(), end_engulf(), explode(), launch_obj(), m_throw(), sho_obj_return_to_u(), throwit(), tmp_at(), and zap_dig().
#define DISP_FLASH (-2) |
Referenced by bhit(), boomhit(), launch_obj(), m_throw(), sho_obj_return_to_u(), throwit(), and tmp_at().
#define DISP_FREEMEM (-6) |
Referenced by freedynamicdata(), and tmp_at().
#define display_self | ( | ) |
show_glyph(u.ux, u.uy, \ maybe_display_usteed /* else */ \ youmonst.m_ap_type == M_AP_NOTHING ? \ hero_glyph : \ youmonst.m_ap_type == M_AP_FURNITURE ? \ cmap_to_glyph(youmonst.mappearance) : \ youmonst.m_ap_type == M_AP_OBJECT ? \ objnum_to_glyph(youmonst.mappearance) : \ /* else M_AP_MONSTER */ monnum_to_glyph(youmonst.mappearance))
Referenced by find_trap(), monster_detect(), newsym(), swallowed(), and you_aggravate().
#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)) |
Referenced by check_tutorial_farlook(), do_look(), getpos(), lookat(), show_map_spot(), and stumble_onto_mimic().
#define glyph_is_detected_monster | ( | glyph ) | ((glyph) >= GLYPH_DETECT_OFF && (glyph) < (GLYPH_DETECT_OFF+NUMMONS)) |
#define glyph_is_invisible | ( | glyph ) | ((glyph) == GLYPH_INVISIBLE) |
Referenced by attack(), attack_checks(), bhit(), buzz(), check_tutorial_farlook(), do_look(), dokick(), domove(), dosearch0(), explode(), feel_location(), findone(), kick_monster(), maybe_tutorial(), monstone(), moverock(), newsym(), use_stethoscope(), and use_whip().
#define glyph_is_monster | ( | glyph ) |
(glyph_is_normal_monster(glyph) \ || glyph_is_pet(glyph) \ || glyph_is_ridden_monster(glyph) \ || glyph_is_detected_monster(glyph))
Referenced by check_tutorial_farlook(), do_look(), lookat(), and maybe_tutorial().
#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 ) |
(glyph_is_normal_object(glyph) \ || glyph_is_body(glyph))
Referenced by check_map_spot(), check_tutorial_farlook(), do_look(), lookat(), show_map_spot(), and stumble_onto_mimic().
#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 ) |
((glyph) >= (GLYPH_CMAP_OFF+trap_to_defsym(1)) && \ (glyph) < (GLYPH_CMAP_OFF+trap_to_defsym(1)+TRAPNUM))
Referenced by check_tutorial_farlook(), check_tutorial_location(), do_look(), lookat(), see_traps(), and show_map_spot().
#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) |
Referenced by mapglyph(), show_glyph(), and swallow_to_glyph().
#define glyph_to_cmap | ( | glyph ) |
(glyph_is_cmap(glyph) ? ((glyph) - GLYPH_CMAP_OFF) : \ NO_GLYPH)
Referenced by do_look(), epathto(), getpos(), lookat(), show_map_spot(), and stumble_onto_mimic().
#define glyph_to_mon | ( | glyph ) |
(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 ) |
(glyph_is_body(glyph) ? CORPSE : \ glyph_is_normal_object(glyph) ? ((glyph)-GLYPH_OBJ_OFF) : \ NO_GLYPH)
Referenced by check_map_spot(), check_tutorial_farlook(), do_look(), lookat(), and stumble_onto_mimic().
#define glyph_to_swallow | ( | glyph ) |
(glyph_is_swallow(glyph) ? (((glyph) - GLYPH_SWALLOW_OFF) & 0x7) : \ 0)
Referenced by do_look().
#define glyph_to_trap | ( | glyph ) |
(glyph_is_trap(glyph) ? \ ((int) defsym_to_trap((glyph) - GLYPH_CMAP_OFF)) : \ NO_GLYPH)
#define glyph_to_warning | ( | glyph ) |
(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) |
Referenced by mapglyph(), show_glyph(), and zapdir_to_glyph().
#define hero_glyph |
#define is_safepet | ( | mon ) |
#define knowninvisible | ( | mon ) |
#define MAX_GLYPH (WARNCOUNT + GLYPH_WARNING_OFF) |
Referenced by show_glyph().
#define maybe_display_usteed |
Referenced by display_monster(), display_warning(), monster_detect(), start_engulf(), and you_aggravate().
#define mon_visible | ( | mon ) |
( /* 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 ) |
#define monnum_to_glyph | ( | mnum ) | ((int) (mnum) + GLYPH_MON_OFF) |
Referenced by detect_wsegs(), and display_monster().
#define NO_GLYPH MAX_GLYPH |
Referenced by arti_invoke(), choose_classes_menu(), display_pickinv(), doset(), doset_add_menu(), dospellmenu(), enhance_skill(), help_menu(), in_or_out_menu(), invdisp_nothing(), minimal_enlightenment(), query_category(), query_objlist(), special_handling(), tutorial_redisplay(), and use_grapple().
#define NUM_ZAP 8 |
Referenced by zapdir_to_glyph().
#define obj_to_glyph | ( | obj ) |
(Hallucination ? \ ((otg_temp = random_object()) == CORPSE ? \ random_monster() + GLYPH_BODY_OFF : \ otg_temp + GLYPH_OBJ_OFF) : \ ((obj)->otyp == CORPSE ? \ (int) (obj)->corpsenm + GLYPH_BODY_OFF : \ (int) (obj)->otyp + GLYPH_OBJ_OFF))
Referenced by bhit(), display_pickinv(), launch_obj(), m_throw(), map_object(), query_objlist(), sho_obj_return_to_u(), and throwit().
#define objnum_to_glyph | ( | onum ) | ((int) (onum) + GLYPH_OBJ_OFF) |
Referenced by feel_location().
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_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().
Referenced by attack_checks(), display_monster(), do_mname(), dochug(), dochugw(), domove(), dosearch0(), feel_location(), grow_up(), intemple(), make_corpse(), make_happy_shk(), mattackm(), mattacku(), restrap(), spoteffects(), and use_whip().
#define senseself | ( | ) | (canseeself() || Unblind_telepat || Detect_monsters) |
#define SHIELD_COUNT 21 |
Referenced by explode(), and shieldeff().
#define tp_sensemon | ( | mon ) |
( /* 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().
Referenced by find_trap(), and map_trap().
#define vobj_at | ( | x, | |
y | |||
) | (level.objects[x][y]) |
Referenced by its_dead(), lookat(), see_objects(), and slip_or_trip().
#define warning_to_glyph | ( | mwarnlev ) | ((mwarnlev)+GLYPH_WARNING_OFF) |
Referenced by display_warning().
Referenced by detect_wsegs(), display_monster(), and swallow_to_glyph().
#define what_trap | ( | trp ) | (Hallucination ? random_trap() : trp) |
Referenced by doidtrap(), find_trap(), lookat(), set_trap(), and use_trap().