Data Structures | Defines | Functions | Variables

muse.c File Reference

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

Data Structures

struct  musable

Defines

#define POTION_OCCUPANT_CHANCE(n)   (13 + 2*(n))
#define MUSE_SCR_TELEPORTATION   1
#define MUSE_WAN_TELEPORTATION_SELF   2
#define MUSE_POT_HEALING   3
#define MUSE_POT_EXTRA_HEALING   4
#define MUSE_WAN_DIGGING   5
#define MUSE_TRAPDOOR   6
#define MUSE_TELEPORT_TRAP   7
#define MUSE_UPSTAIRS   8
#define MUSE_DOWNSTAIRS   9
#define MUSE_WAN_CREATE_MONSTER   10
#define MUSE_SCR_CREATE_MONSTER   11
#define MUSE_UP_LADDER   12
#define MUSE_DN_LADDER   13
#define MUSE_SSTAIRS   14
#define MUSE_WAN_TELEPORTATION   15
#define MUSE_BUGLE   16
#define MUSE_UNICORN_HORN   17
#define MUSE_POT_FULL_HEALING   18
#define MUSE_LIZARD_CORPSE   19
#define MUSE_POT_VAMPIRE_BLOOD   20
#define nomore(x)   if(m.has_defense==x) continue;
#define m_flee(m)
#define MUSE_WAN_DEATH   1
#define MUSE_WAN_SLEEP   2
#define MUSE_WAN_FIRE   3
#define MUSE_WAN_COLD   4
#define MUSE_WAN_LIGHTNING   5
#define MUSE_WAN_MAGIC_MISSILE   6
#define MUSE_WAN_STRIKING   7
#define MUSE_SCR_FIRE   8
#define MUSE_POT_PARALYSIS   9
#define MUSE_POT_BLINDNESS   10
#define MUSE_POT_CONFUSION   11
#define MUSE_FROST_HORN   12
#define MUSE_FIRE_HORN   13
#define MUSE_POT_ACID   14
#define MUSE_POT_SLEEPING   16
#define MUSE_SCR_EARTH   17
#define MUSE_WAN_CANCELLATION   18
#define nomore(x)   if(m.has_offense==x) continue;
#define MUSE_POT_GAIN_LEVEL   1
#define MUSE_WAN_MAKE_INVISIBLE   2
#define MUSE_POT_INVISIBILITY   3
#define MUSE_POLY_TRAP   4
#define MUSE_WAN_POLYMORPH   5
#define MUSE_POT_SPEED   6
#define MUSE_WAN_SPEED_MONSTER   7
#define MUSE_BULLWHIP   8
#define MUSE_POT_POLYMORPH   9
#define nomore(x)   if(m.has_misc==x) continue;

Functions

STATIC_DCL struct permonstFDECL (muse_newcham_mon,(struct monst *))
STATIC_DCL int FDECL (precheck,(struct monst *, struct obj *))
STATIC_DCL void FDECL (mzapmsg,(struct monst *, struct obj *, BOOLEAN_P))
STATIC_DCL void FDECL (mreadmsg,(struct monst *, struct obj *))
STATIC_DCL void FDECL (mquaffmsg,(struct monst *, struct obj *))
STATIC_PTR int FDECL (mbhitm,(struct monst *, struct obj *))
STATIC_DCL void FDECL (mbhit,(struct monst *, int, int FDECL((*),(MONST_P, OBJ_P)), int FDECL((*),(OBJ_P, OBJ_P)), struct obj *))
STATIC_DCL void FDECL (you_aggravate,(struct monst *))
STATIC_DCL void FDECL (mon_consume_unstone,(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P))
STATIC_OVL int precheck (struct monst *mon, struct obj *obj)
STATIC_OVL void mzapmsg (struct monst *mtmp, struct obj *otmp, boolean self)
STATIC_OVL void mreadmsg (struct monst *mtmp, struct obj *otmp)
STATIC_OVL void mquaffmsg (struct monst *mtmp, struct obj *otmp)
boolean find_defensive (struct monst *mtmp)
int use_defensive (struct monst *mtmp)
int rnd_defensive_item (struct monst *mtmp)
boolean find_offensive (struct monst *mtmp)
STATIC_PTR int mbhitm (struct monst *mtmp, struct obj *otmp)
STATIC_OVL void mbhit (struct monst *mon, int range, fhitm, fhito, struct obj *obj)
int use_offensive (struct monst *mtmp)
int rnd_offensive_item (struct monst *mtmp)
boolean find_misc (struct monst *mtmp)
static struct permonstmuse_newcham_mon (struct monst *mon)
int use_misc (struct monst *mtmp)
STATIC_OVL void you_aggravate (struct monst *mtmp)
int rnd_misc_item (struct monst *mtmp)
boolean searches_for_item (struct monst *mon, struct obj *obj)
boolean mon_reflects (struct monst *mon, const char *str)
boolean ureflects (char *fmt, char *str) const
boolean munstone (struct monst *mon, boolean by_you)
STATIC_OVL void mon_consume_unstone (struct monst *mon, struct obj *obj, boolean by_you, boolean stoning)

Variables

const int monstr []
boolean m_using = FALSE
static struct musable m
static int trapx
static int trapy
static boolean zap_oseen

Define Documentation

#define m_flee (   m )
Value:
if (fleetim && !m->iswiz) \
                        { monflee(m, fleetim, FALSE, FALSE); }

Referenced by use_defensive().

#define MUSE_BUGLE   16

Referenced by find_defensive(), and use_defensive().

#define MUSE_BULLWHIP   8

Referenced by find_misc(), and use_misc().

#define MUSE_DN_LADDER   13

Referenced by find_defensive(), and use_defensive().

#define MUSE_DOWNSTAIRS   9

Referenced by find_defensive(), and use_defensive().

#define MUSE_FIRE_HORN   13

Referenced by find_offensive(), and use_offensive().

#define MUSE_FROST_HORN   12

Referenced by find_offensive(), and use_offensive().

#define MUSE_LIZARD_CORPSE   19

Referenced by find_defensive(), and use_defensive().

#define MUSE_POLY_TRAP   4

Referenced by find_misc(), and use_misc().

#define MUSE_POT_ACID   14

Referenced by find_offensive(), and use_offensive().

#define MUSE_POT_BLINDNESS   10

Referenced by find_offensive(), and use_offensive().

#define MUSE_POT_CONFUSION   11

Referenced by find_offensive(), and use_offensive().

#define MUSE_POT_EXTRA_HEALING   4

Referenced by find_defensive(), and use_defensive().

#define MUSE_POT_FULL_HEALING   18

Referenced by find_defensive(), and use_defensive().

#define MUSE_POT_GAIN_LEVEL   1

Referenced by find_misc(), and use_misc().

#define MUSE_POT_HEALING   3

Referenced by find_defensive(), and use_defensive().

#define MUSE_POT_INVISIBILITY   3

Referenced by find_misc(), and use_misc().

#define MUSE_POT_PARALYSIS   9

Referenced by find_offensive(), and use_offensive().

#define MUSE_POT_POLYMORPH   9

Referenced by find_misc(), and use_misc().

#define MUSE_POT_SLEEPING   16

Referenced by find_offensive(), and use_offensive().

#define MUSE_POT_SPEED   6

Referenced by find_misc(), and use_misc().

#define MUSE_POT_VAMPIRE_BLOOD   20

Referenced by find_defensive(), and use_defensive().

#define MUSE_SCR_CREATE_MONSTER   11

Referenced by find_defensive(), and use_defensive().

#define MUSE_SCR_EARTH   17

Referenced by find_offensive(), and use_offensive().

#define MUSE_SCR_FIRE   8

Referenced by find_offensive(), and use_offensive().

#define MUSE_SCR_TELEPORTATION   1

Referenced by find_defensive(), and use_defensive().

#define MUSE_SSTAIRS   14

Referenced by find_defensive(), and use_defensive().

#define MUSE_TELEPORT_TRAP   7

Referenced by find_defensive(), and use_defensive().

#define MUSE_TRAPDOOR   6

Referenced by find_defensive(), and use_defensive().

#define MUSE_UNICORN_HORN   17

Referenced by find_defensive(), and use_defensive().

#define MUSE_UP_LADDER   12

Referenced by find_defensive(), and use_defensive().

#define MUSE_UPSTAIRS   8

Referenced by find_defensive(), and use_defensive().

#define MUSE_WAN_CANCELLATION   18

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_COLD   4

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_CREATE_MONSTER   10

Referenced by find_defensive(), and use_defensive().

#define MUSE_WAN_DEATH   1

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_DIGGING   5

Referenced by find_defensive(), and use_defensive().

#define MUSE_WAN_FIRE   3

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_LIGHTNING   5

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_MAGIC_MISSILE   6

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_MAKE_INVISIBLE   2

Referenced by find_misc(), and use_misc().

#define MUSE_WAN_POLYMORPH   5

Referenced by find_misc(), and use_misc().

#define MUSE_WAN_SLEEP   2

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_SPEED_MONSTER   7

Referenced by find_misc(), and use_misc().

#define MUSE_WAN_STRIKING   7

Referenced by find_offensive(), and use_offensive().

#define MUSE_WAN_TELEPORTATION   15
#define MUSE_WAN_TELEPORTATION_SELF   2

Referenced by find_defensive(), and use_defensive().

#define nomore (   x )    if(m.has_defense==x) continue;
#define nomore (   x )    if(m.has_offense==x) continue;
#define nomore (   x )    if(m.has_misc==x) continue;
#define POTION_OCCUPANT_CHANCE (   n )    (13 + 2*(n))

Referenced by dodrink(), and precheck().


Function Documentation

STATIC_DCL struct permonst* FDECL ( muse_newcham_mon  ,
(struct monst *)   
) [read]
STATIC_DCL int FDECL ( precheck  ,
(struct monst *, struct obj *)   
)
STATIC_DCL void FDECL ( mreadmsg  ,
(struct monst *, struct obj *)   
)
STATIC_DCL void FDECL ( you_aggravate  ,
(struct monst *)   
)
STATIC_DCL void FDECL ( mon_consume_unstone  ,
(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( mquaffmsg  ,
(struct monst *, struct obj *)   
)
STATIC_DCL void FDECL ( mzapmsg  ,
(struct monst *, struct obj *, BOOLEAN_P)   
)
STATIC_PTR int FDECL ( mbhitm  ,
(struct monst *, struct obj *)   
)
STATIC_DCL void FDECL ( mbhit  ,
(struct monst *, int, int FDECL((*),(MONST_P, OBJ_P)), int FDECL((*),(OBJ_P, OBJ_P)), struct obj *)   
)
boolean find_defensive ( struct monst mtmp )

References BEAR_TRAP, BOULDER, BUGLE, Can_fall_thru(), CORPSE, obj::corpsenm, monst::data, musable::defensive, dist2(), FALSE, dlevel_t::flags, musable::has_defense, haseyes, HOLE, if(), immobile, In_endgame, In_sokoban, In_V_tower(), inhishop(), is_animal, Is_botlevel(), is_floater, is_ice(), is_lava(), is_mercenary, is_pool(), is_unicorn, is_vampire, isok(), LADDER, ledger_no(), level, levl, m, m_at, m_carrying(), mindless, mon, mon_has_amulet(), mons, dlevel_t::monsters, MUSE_BUGLE, MUSE_DN_LADDER, MUSE_DOWNSTAIRS, MUSE_LIZARD_CORPSE, MUSE_POT_EXTRA_HEALING, MUSE_POT_FULL_HEALING, MUSE_POT_HEALING, MUSE_POT_VAMPIRE_BLOOD, MUSE_SCR_CREATE_MONSTER, MUSE_SCR_TELEPORTATION, MUSE_SSTAIRS, MUSE_TELEPORT_TRAP, MUSE_TRAPDOOR, MUSE_UNICORN_HORN, MUSE_UP_LADDER, MUSE_UPSTAIRS, MUSE_WAN_CREATE_MONSTER, MUSE_WAN_DIGGING, MUSE_WAN_TELEPORTATION, MUSE_WAN_TELEPORTATION_SELF, obj::nobj, nohands, nomore, onscary(), obj::otyp, passes_walls, PIT, PM_GRID_BUG, PM_GUARD, PM_LIZARD, PM_PESTILENCE, PM_VLAD_THE_IMPALER, POT_EXTRA_HEALING, POT_FULL_HEALING, POT_HEALING, POT_SICKNESS, POT_VAMPIRE_BLOOD, rn2(), SCR_CREATE_MONSTER, SCR_TELEPORTATION, sobj_at(), obj::spe, SPIKED_PIT, sstairs, STAIRS, stairway::sx, stairway::sy, t_at(), TELEP_TRAP, throws_rocks, TRAPDOOR, TRUE, u, you::ulevel, UNICORN_HORN, you::ustuck, you::ux, you::uy, you::uz, verysmall, W_NONDIGGABLE, WAN_CREATE_MONSTER, WAN_DIGGING, WAN_TELEPORTATION, WEB, trap::x, xdnladder, xdnstair, xupladder, xupstair, trap::y, ydnladder, ydnstair, yupladder, and yupstair.

Referenced by dochug().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean find_misc ( struct monst mtmp )
boolean find_offensive ( struct monst mtmp )
STATIC_OVL void mbhit ( struct monst mon,
int  range,
fhitm  ,
fhito  ,
struct obj obj 
)
STATIC_PTR int mbhitm ( struct monst mtmp,
struct obj otmp 
)
STATIC_OVL void mon_consume_unstone ( struct monst mon,
struct obj obj,
boolean  by_you,
boolean  stoning 
)
boolean mon_reflects ( struct monst mon,
const char *  str 
)
STATIC_OVL void mquaffmsg ( struct monst mtmp,
struct obj otmp 
)

References canseemon, doname(), flags, Monnam(), pline(), singular(), and flag::soundok.

Referenced by precheck(), use_defensive(), and use_misc().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mreadmsg ( struct monst mtmp,
struct obj otmp 
)

References ARTICLE_A, BUFSZ, canseemon, doname(), FALSE, flags, mhe, mon_nam(), Monnam(), pline(), PM_PRIEST, Role_if, Role_switch, singular(), flag::soundok, Strcpy, SUPPRESS_INVISIBLE, SUPPRESS_IT, SUPPRESS_SADDLE, and x_monnam().

Referenced by use_defensive(), and use_offensive().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean munstone ( struct monst mon,
boolean  by_you 
)

References acidic, CORPSE, obj::corpsenm, FALSE, mon_consume_unstone(), mons, obj::nobj, obj::otyp, PM_GREEN_SLIME, PM_LIZARD, POT_ACID, resists_ston, and TRUE.

Referenced by damageum(), hmon_hitmon(), and mdamagem().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct permonst* muse_newcham_mon ( struct monst mon ) [static, read]

References Dragon_mail_to_pm, Dragon_scales_to_pm, Is_dragon_mail, Is_dragon_scales, obj::otyp, rndmonst(), W_ARM, and which_armor().

Referenced by use_misc().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mzapmsg ( struct monst mtmp,
struct obj otmp,
boolean  self 
)

References an(), BOLT_LIM, canseemon, distu, doname(), flags, mhim, Monnam(), monst::mx, monst::my, pline(), flag::soundok, stop_occupation(), and xname().

Referenced by use_defensive(), use_misc(), and use_offensive().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int precheck ( struct monst mon,
struct obj obj 
)
int rnd_defensive_item ( struct monst mtmp )
int rnd_misc_item ( struct monst mtmp )
int rnd_offensive_item ( struct monst mtmp )
boolean searches_for_item ( struct monst mon,
struct obj obj 
)
boolean ureflects ( char *  fmt,
char *  str 
) const

References AMULET_OF_REFLECTION, monst::data, EReflecting, FALSE, makeknown, mons, pline(), PM_SILVER_DRAGON, SHIELD_OF_REFLECTION, TRUE, W_AMUL, W_ARM, W_ARMS, W_WEP, and youmonst.

Referenced by buzz(), cast_cleric_spell(), gazemu(), god_zaps_you(), and passive().

Here is the call graph for this function:

Here is the caller graph for this function:

int use_defensive ( struct monst mtmp )

References awaken_soldiers(), bcsign(), bhito(), Can_dig_down(), cansee, canseemon, canspotmon, CORR, d(), musable::defensive, depth(), docall(), doname(), dunlev(), dunlevs_in_dungeon(), enexto(), FALSE, dlevel_t::flags, flags, get_level(), musable::has_defense, HOLE, In_endgame, Inhell, inhishop(), Is_botlevel(), IS_DRAWBRIDGE, is_drawbridge_wall(), is_flyer, IS_FURNITURE, is_pool(), known, ledger_no(), level, levl, locomotion(), m, m_flee, m_useup(), m_using, makeknown, makemon(), makeplural(), maketrap(), mbhit(), mbhitm(), mhim, MIGR_LADDER_DOWN, MIGR_LADDER_UP, MIGR_RANDOM, MIGR_SSTAIRS, MIGR_STAIRS_DOWN, MIGR_STAIRS_UP, migrate_to_level(), mon, mon_consume_unstone(), mon_has_amulet(), mon_has_special(), mon_nam(), mongone(), Monnam(), mons, mquaffmsg(), mreadmsg(), MUSE_BUGLE, MUSE_DN_LADDER, MUSE_DOWNSTAIRS, MUSE_LIZARD_CORPSE, MUSE_POT_EXTRA_HEALING, MUSE_POT_FULL_HEALING, MUSE_POT_HEALING, MUSE_POT_VAMPIRE_BLOOD, MUSE_SCR_CREATE_MONSTER, MUSE_SCR_TELEPORTATION, MUSE_SSTAIRS, MUSE_TELEPORT_TRAP, MUSE_TRAPDOOR, MUSE_UNICORN_HORN, MUSE_UP_LADDER, MUSE_UPSTAIRS, MUSE_WAN_CREATE_MONSTER, MUSE_WAN_DIGGING, MUSE_WAN_TELEPORTATION, MUSE_WAN_TELEPORTATION_SELF, mzapmsg(), newsym(), NO_MM_FLAGS, objects, On_W_tower_level(), otmp, obj::otyp, pline(), pm, PM_ACID_BLOB, PM_CROCODILE, PM_GIANT_EEL, POT_EXTRA_HEALING, POT_HEALING, POT_SICKNESS, POT_VAMPIRE_BLOOD, precheck(), random_teleport_level(), remove_monster(), rloc(), rn1, rn2(), rnd(), SCORR, SCR_CREATE_MONSTER, SCR_TELEPORTATION, seetrap(), something, flag::soundok, obj::spe, sstairs, surface(), stairway::sx, stairway::sy, t_at(), tele_restrict(), TELEP_TRAP, stairway::tolev, TRAPDOOR, trapx, trapy, TRUE, u, unbless(), unblock_point(), stairway::up, you::uz, vis, WAN_CREATE_MONSTER, WAN_DIGGING, WAN_TELEPORTATION, worm_move(), nhcoord::x, and nhcoord::y.

Referenced by dochug().

Here is the call graph for this function:

Here is the caller graph for this function:

int use_misc ( struct monst mtmp )
int use_offensive ( struct monst mtmp )
STATIC_OVL void you_aggravate ( struct monst mtmp )

References canspotmon, cls(), display_nhwindow, display_self, docrt(), map_invisible(), mon_to_glyph, multi, newsym(), noit_mon_nam(), nomovemsg, pline(), s_suffix(), show_glyph(), TRUE, unconscious(), and WIN_MAP.

Referenced by use_misc().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct musable m [static]
boolean m_using = FALSE
const int monstr[]
int trapx [static]

Referenced by use_defensive().

int trapy

Referenced by use_defensive().

boolean zap_oseen [static]

Referenced by mbhitm().