Defines | Functions | Variables

makemon.c File Reference

#include "hack.h"
#include "epri.h"
#include "emin.h"
#include "edog.h"
Include dependency graph for makemon.c:

Defines

#define quest_mon_represents_role(mptr, role_pm)
#define m_initsgrp(mtmp, x, y)   m_initgrp(mtmp, x, y, 3)
#define m_initlgrp(mtmp, x, y)   m_initgrp(mtmp, x, y, 10)
#define toostrong(monindx, lev)   (monstr[monindx] > lev)
#define tooweak(monindx, lev)   (monstr[monindx] < lev)

Functions

STATIC_DCL boolean FDECL (uncommon,(int))
STATIC_DCL int FDECL (align_shift,(struct permonst *))
STATIC_DCL boolean FDECL (wrong_elem_type,(struct permonst *))
STATIC_DCL void FDECL (m_initgrp,(struct monst *, int, int, int))
STATIC_DCL void FDECL (m_initthrow,(struct monst *, int, int))
STATIC_DCL void FDECL (m_initweap,(struct monst *))
STATIC_DCL void FDECL (m_initinv,(struct monst *))
boolean is_home_elemental (struct permonst *ptr)
STATIC_OVL boolean wrong_elem_type (struct permonst *ptr)
STATIC_OVL void m_initgrp (struct monst *mtmp, int x, int y, int n)
STATIC_OVL void m_initthrow (struct monst *mtmp, int otyp, int oquan)
STATIC_OVL void m_initweap (struct monst *mtmp)
STATIC_OVL void m_initinv (struct monst *mtmp)
struct monstclone_mon (struct monst *mon, xchar x, xchar y)
boolean propagate (int mndx, boolean tally, boolean ghostly)
struct monstmakemon (struct permonst *ptr, int x, int y, int mmflags)
int mbirth_limit (int mndx)
boolean create_critters (int cnt, struct permonst *mptr)
STATIC_OVL boolean uncommon (int mndx)
STATIC_OVL int align_shift (struct permonst *ptr)
int min_monster_difficulty ()
int max_monster_difficulty ()
struct permonstget_override_mon (struct mon_gen_override *override)
struct permonstrndmonst ()
void reset_rndmonst (int mndx)
struct permonstmkclass (char class, int spc)
int adj_lev (struct permonst *ptr)
struct permonstgrow_up (struct monst *mtmp, struct monst *victim)
int mongets (struct monst *mtmp, int otyp)
int golemhp (int type)
boolean peace_minded (struct permonst *ptr)
void set_malign (struct monst *mtmp)
void set_mimic_sym (struct monst *mtmp)
int bagotricks (struct obj *bag)
void create_camera_demon (struct obj *camera, int x, int y)

Variables

STATIC_VAR NEARDATA struct monst zeromonst
const int monstr []
struct {
   int   choice_count
   char   mchoices [SPECIAL_PM]
rndmonst_state
static NEARDATA char syms []

Define Documentation

#define m_initlgrp (   mtmp,
  x,
 
)    m_initgrp(mtmp, x, y, 10)

Referenced by makemon().

#define m_initsgrp (   mtmp,
  x,
 
)    m_initgrp(mtmp, x, y, 3)

Referenced by makemon().

#define quest_mon_represents_role (   mptr,
  role_pm 
)
Value:
(mptr->mlet == S_HUMAN && Role_if(role_pm) && \
                  (mptr->msound == MS_LEADER || mptr->msound == MS_NEMESIS))

Referenced by m_initinv(), and m_initweap().

#define toostrong (   monindx,
  lev 
)    (monstr[monindx] > lev)

Referenced by mkclass(), and rndmonst().

#define tooweak (   monindx,
  lev 
)    (monstr[monindx] < lev)

Referenced by rndmonst().


Function Documentation

int adj_lev ( struct permonst ptr )

References mvitals::died, level_difficulty(), permonst::mlevel, mons, PM_WIZARD_OF_YENDOR, u, and you::ulevel.

Referenced by abon(), makemon(), mkclass(), and newcham().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int align_shift ( struct permonst ptr )

References ALIGNWEIGHT, AM_CHAOTIC, AM_LAWFUL, AM_NEUTRAL, AM_NONE, d_level::dnum, dungeons, dungeon::flags, Is_special(), moves, NEARDATA, u, and you::uz.

Referenced by rndmonst().

Here is the call graph for this function:

Here is the caller graph for this function:

int bagotricks ( struct obj bag )
struct monst* clone_mon ( struct monst mon,
xchar  x,
xchar  y 
) [read]
void create_camera_demon ( struct obj camera,
int  x,
int  y 
)

May create a camera demon emerging from camera around position x,y.

References An(), canspotmon, Hallucination, makemon(), mons, NO_MM_FLAGS, pline(), PM_HOMUNCULUS, rn2(), rndmonnam(), set_malign(), and Something.

Referenced by breakobj(), and hmon_hitmon().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean create_critters ( int  cnt,
struct permonst mptr 
)

References canspotmon, enexto(), FALSE, known, makemon(), mon, mons, NO_MM_FLAGS, PM_GIANT_EEL, TRUE, u, you::ux, you::uy, wizard, nhcoord::x, and nhcoord::y.

Referenced by seffects(), and zapnodir().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL int FDECL ( align_shift  ,
(struct permonst *)   
)
STATIC_DCL void FDECL ( m_initgrp  ,
(struct monst *, int, int, int)   
)
STATIC_DCL void FDECL ( m_initthrow  ,
(struct monst *, int, int)   
)
STATIC_DCL boolean FDECL ( uncommon  ,
(int)   
)
STATIC_DCL void FDECL ( m_initweap  ,
(struct monst *)   
)
STATIC_DCL boolean FDECL ( wrong_elem_type  ,
(struct permonst *)   
)
STATIC_DCL void FDECL ( m_initinv  ,
(struct monst *)   
)
struct permonst* get_override_mon ( struct mon_gen_override override ) [read]

References mon_gen_tuple::freq, G_GENOD, mon_gen_tuple::is_sym, mkclass(), mon_gen_tuple::monid, mons, mvitals::mvflags, mon_gen_tuple::next, rnd(), and mon_gen_override::total_mon_freq.

Referenced by rndmonst().

Here is the call graph for this function:

Here is the caller graph for this function:

int golemhp ( int  type )
struct permonst* grow_up ( struct monst mtmp,
struct monst victim 
) [read]

References an(), G_GENOD, if(), is_golem, is_home_elemental(), is_mplayer, little_to_big(), max, mhe, permonst::mlevel, permonst::mname, mon_nam(), mondied(), mons, monsndx(), newsym(), nonliving, pline(), PM_PRIEST, PM_PRIESTESS, rn2(), rnd(), sensemon, and set_mon_data().

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

Here is the call graph for this function:

Here is the caller graph for this function:

boolean is_home_elemental ( struct permonst ptr )

References FALSE, Is_airlevel, Is_earthlevel, Is_firelevel, Is_waterlevel, monsndx(), PM_AIR_ELEMENTAL, PM_EARTH_ELEMENTAL, PM_FIRE_ELEMENTAL, PM_WATER_ELEMENTAL, S_ELEMENTAL, u, and you::uz.

Referenced by grow_up(), makemon(), mlevel_tele_trap(), polymon(), and wrong_elem_type().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void m_initgrp ( struct monst mtmp,
int  x,
int  y,
int  n 
)

References enexto(), FALSE, makemon(), mon, NO_MM_FLAGS, peace_minded(), pline(), rnd(), set_malign(), u, you::ulevel, nhcoord::x, and nhcoord::y.

Here is the call graph for this function:

STATIC_OVL void m_initinv ( struct monst mtmp )
STATIC_OVL void m_initthrow ( struct monst mtmp,
int  otyp,
int  oquan 
)

References FALSE, mksobj(), mpickobj(), ORCISH_ARROW, otmp, obj::owt, obj::quan, rn1, TRUE, and weight().

Referenced by m_initweap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void m_initweap ( struct monst mtmp )

References AKLYS, ARROW, ART_DEMONBANE, ART_SUNSWORD, artiname(), AXE, BATTLE_AXE, BEC_DE_CORBIN, bless(), BOULDER, BOW, BROADSWORD, BULLWHIP, CLUB, CREAM_PIE, CROSSBOW, CROSSBOW_BOLT, CRYSTAL_BALL, curse(), DAGGER, DART, DWARVISH_CLOAK, DWARVISH_IRON_HELM, DWARVISH_MATTOCK, DWARVISH_MITHRIL_COAT, DWARVISH_ROUNDSHIELD, DWARVISH_SHORT_SWORD, ELVEN_ARROW, ELVEN_BOOTS, ELVEN_BOW, ELVEN_BROADSWORD, ELVEN_CLOAK, ELVEN_DAGGER, ELVEN_LEATHER_HELM, ELVEN_MITHRIL_COAT, ELVEN_SHIELD, ELVEN_SHORT_SWORD, ELVEN_SPEAR, extra_nasty, FALSE, FLAIL, GLAIVE, in_mklev, IRON_SHOES, is_demon, is_dwarf, Is_earthlevel, is_elf, is_lord, is_mercenary, is_prince, Is_rogue_level, KNIFE, LARGE_SHIELD, LEATHER_ARMOR, LONG_SWORD, LUCERN_HAMMER, m_initthrow(), MACE, max, mksobj(), permonst::mlet, mongets(), mons, monsndx(), mpickobj(), MS_PRIEST, permonst::msound, oname(), ORCISH_ARROW, ORCISH_BOW, ORCISH_CHAIN_MAIL, ORCISH_CLOAK, ORCISH_DAGGER, ORCISH_HELM, ORCISH_SHIELD, ORCISH_SHORT_SWORD, otmp, PARTISAN, PICK_AXE, PM_BALROG, PM_CAPTAIN, PM_DISPATER, PM_ELVENKING, PM_ETTIN, PM_FOREST_CENTAUR, PM_GOBLIN, PM_HOBBIT, PM_HORNED_DEVIL, PM_LIEUTENANT, PM_MORDOR_ORC, PM_OGRE_KING, PM_OGRE_LORD, PM_ORC_CAPTAIN, PM_ORC_SHAMAN, PM_PRIEST, PM_SALAMANDER, PM_SERGEANT, PM_SOLDIER, PM_URUK_HAI, PM_WATCH_CAPTAIN, PM_WATCHMAN, PM_YEENOGHU, quest_mon_represents_role, RANSEUR, rn1, rn2(), rnd(), rnd_offensive_item(), RUBBER_HOSE, S_ANGEL, S_CENTAUR, S_DEMON, S_GIANT, S_HUMAN, S_HUMANOID, S_KOBOLD, S_KOP, S_LIZARD, S_OGRE, S_ORC, S_TROLL, S_WRAITH, S_ZOMBIE, SCIMITAR, SHIELD_OF_REFLECTION, SHORT_SWORD, SILVER_SABER, SLING, obj::spe, SPEAR, SPETUM, STILETTO, strongmonst, TRIDENT, TRUE, TWO_HANDED_SWORD, u, URUK_HAI_SHIELD, you::uz, and WAN_STRIKING.

Referenced by makemon().

Here is the call graph for this function:

Here is the caller graph for this function:

struct monst* makemon ( struct permonst ptr,
int  x,
int  y,
int  mmflags 
) [read]

References adj_lev(), ART_EXCALIBUR, cansee, CHAM_ORDINARY, christen_monst(), COLNO, count_wsegs(), d(), monst::data, discard_minvent(), flag::djinni_count, emits_light, enexto_core(), FALSE, flags, fmon, G_EXTINCT, G_GENOD, G_LGROUP, G_SGROUP, get_wormno(), flag::ghost_count, golemhp(), goodpos(), hides_under, HOLE, flag::ident, if(), In_endgame, in_mklev, In_sokoban, Inhell, initworm(), is_armed, is_bat, is_dprince, Is_earthlevel, is_female, is_golem, is_home_elemental(), is_male, is_ndemon, is_pool(), is_rider, is_unicorn, q_score::leader_m_id, LS_MONSTER, M3_CLOSE, M3_WAITFORU, M3_WAITMASK, m_dowear(), monst::m_id, m_initinv(), m_initlgrp, m_initsgrp, m_initweap(), monst::m_lev, MAGIC_PORTAL, monst::mextra, monst::mhp, monst::mhpmax, mindless, monst::minvent, mkobj_at(), MM_ADJACENTOK, MM_ANGRY, MM_EDOG, MM_EMIN, MM_IGNOREWATER, MM_NOCOUNTBIRTH, MM_NONAME, MM_NOWAIT, monst::mnum, mon_adjust_speed(), MON_AT, mongets(), mons, monsndx(), MS_BRIBE, MS_LEADER, permonst::msound, monst::mstrategy, monst::mtame, monst::mtrapseen, monst::mx, monst::mxlth, monst::my, new_light_source(), newcham(), newmonst, newsym(), monst::nmon, NO_MINVENT, flag::no_of_wizards, obj::oartifact, OBJ_AT, peace_minded(), PIT, place_worm_tail_randomly(), pline(), PM_BLACK_LIGHT, PM_DJINNI, PM_ELF, PM_GHOST, PM_GIANT_EEL, PM_GRAY_DRAGON, PM_LONG_WORM, PM_STALKER, pm_to_cham(), PM_WIZARD_OF_YENDOR, PM_WUMPUS, propagate(), Protection_from_shape_changers, quest_status, Race_if, rn1, rn2(), rnd(), rndghostname(), rndmonst(), ROWNO, S_BAT, S_DRAGON, S_EEL, S_ELEMENTAL, S_JABBERWOCK, S_LEPRECHAUN, S_LIGHT, S_MIMIC, S_NYMPH, S_ORC, S_SNAKE, S_SPIDER, S_UNICORN, set_apparxy(), set_malign(), set_mimic_sym(), set_mon_data(), sgn(), SPE_DIG, STRAT_CLOSE, STRAT_WAITFORU, TRUE, align::type, u, you::ualign, you::uhave, uwep, you::ux, you::uy, you::uz, wizard, nhcoord::x, nhcoord::y, and zeromonst.

Referenced by animate_statue(), bagotricks(), bhito(), cast_cleric_spell(), cloneu(), clonewiz(), create_camera_demon(), create_critters(), create_monster(), create_object(), create_polymon(), deadbook(), demonpet(), dig(), dig_up_grave(), djinni_from_bottle(), do_break_wand(), do_genocide(), dokick(), doloot(), domagictrap(), dosacrifice(), dosdoor(), dosit(), dowaterdemon(), dowaternymph(), dowatersnakes(), engrave(), fill_empty_maze(), fill_zoo(), ghost_from_bottle(), hatch_egg(), intemple(), invault(), m_initgrp(), m_respond(), make_familiar(), makedog(), makelevel(), makemaz(), maketrap(), mk_mplayer(), mk_roamer(), mkgarden(), mkshobj_at(), mkswamp(), mktrap(), mkundead(), montraits(), moveloop(), msummon(), nasty(), observe_quantum_cat(), precheck(), priestini(), resurrect(), revive(), revive_cthulhu(), savebones(), shkinit(), summon_minion(), use_bell(), use_defensive(), violated(), and were_summon().

Here is the call graph for this function:

Here is the caller graph for this function:

int max_monster_difficulty (  )

Returns the level of the strongest monster to make.

References level_difficulty(), PM_DEMOGORGON, u, you::uevent, and you::ulevel.

Referenced by enlightenment(), and rndmonst().

Here is the call graph for this function:

Here is the caller graph for this function:

int mbirth_limit ( int  mndx )

References MAXMONNO, PM_ERINYS, and PM_NAZGUL.

Referenced by make_familiar(), and propagate().

Here is the caller graph for this function:

int min_monster_difficulty (  )

Returns the level of the weakest monster to make.

References level_difficulty(), u, and you::uevent.

Referenced by enlightenment(), and rndmonst().

Here is the call graph for this function:

Here is the caller graph for this function:

struct permonst* mkclass ( char  class,
int  spc 
) [read]
int mongets ( struct monst mtmp,
int  otyp 
)

References obj::age, ARMOR_CLASS, CANDELABRUM_OF_INVOCATION, curse(), FALSE, is_lminion, is_mplayer, is_prince, is_sword, mksobj(), mpickobj(), obj::oclass, otmp, obj::otyp, rn2(), S_DEMON, obj::spe, SPE_BOOK_OF_THE_DEAD, TRUE, and WEAPON_CLASS.

Referenced by final_level(), m_initinv(), m_initweap(), makemon(), mk_mplayer(), and shkinit().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean peace_minded ( struct permonst ptr )

References A_NEUTRAL, always_hostile, always_peaceful, FALSE, is_minion, permonst::maligntyp, MS_GUARDIAN, MS_LEADER, MS_NEMESIS, race_hostile, race_peaceful, align::record, rn2(), sgn(), TRUE, align::type, u, you::ualign, and you::uhave.

Referenced by getlev(), m_initgrp(), and makemon().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean propagate ( int  mndx,
boolean  tally,
boolean  ghostly 
)

References mvitals::born, FALSE, G_EXTINCT, G_GONE, G_NOGEN, G_UNIQ, permonst::geno, makeplural(), mbirth_limit(), mons, mvitals::mvflags, pline(), reset_rndmonst(), TRUE, and wizard.

Referenced by makemon(), and restmonchn().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_rndmonst ( int  mndx )

References NON_PM, rndmonst_state, and SPECIAL_PM.

Referenced by do_class_genocide(), do_genocide(), goto_level(), losexp(), newman(), pluslvl(), and propagate().

Here is the caller graph for this function:

struct permonst* rndmonst (  ) [read]
void set_malign ( struct monst mtmp )
void set_mimic_sym ( struct monst mtmp )
STATIC_OVL boolean uncommon ( int  mndx )

References A_NEUTRAL, G_GONE, G_HELL, G_NOGEN, G_UNIQ, Inhell, mons, and TRUE.

Referenced by rndmonst().

Here is the caller graph for this function:

STATIC_OVL boolean wrong_elem_type ( struct permonst ptr )

References amorphous, FALSE, Is_airlevel, Is_earthlevel, Is_firelevel, is_floater, is_flyer, is_home_elemental(), is_swimmer, Is_waterlevel, is_whirly, MR_FIRE, noncorporeal, pm_resistance, S_ELEMENTAL, S_TRAPPER, TRUE, u, and you::uz.

Referenced by rndmonst().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char mchoices[SPECIAL_PM]
const int monstr[]
NEARDATA { ... } rndmonst_state [static]

Referenced by reset_rndmonst(), and rndmonst().

NEARDATA char syms[] [static]
STATIC_VAR NEARDATA struct monst zeromonst

Referenced by makemon().