Defines | Functions | Variables

artifact.c File Reference

#include "hack.h"
#include "artifact.h"
#include "artilist.h"
Include dependency graph for artifact.c:

Defines

#define get_artifact(o)   (((o)&&(o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0)
#define FATAL_DAMAGE_MODIFIER   200
#define MB_MAX_DIEROLL   8
#define MB_INDEX_PROBE   0
#define MB_INDEX_STUN   1
#define MB_INDEX_SCARE   2
#define MB_INDEX_CANCEL   3

Functions

STATIC_DCL int FDECL (spec_applies,(const struct artifact *, struct monst *))
STATIC_DCL int FDECL (arti_invoke,(struct obj *))
STATIC_DCL boolean FDECL (Mb_hit,(struct monst *magr, struct monst *mdef, struct obj *, int *, int, BOOLEAN_P, char *))
STATIC_DCL void NDECL (hack_artifacts)
STATIC_DCL boolean FDECL (attacks,(int, struct obj *))
STATIC_OVL void hack_artifacts ()
void init_artifacts ()
void save_artifacts (int fd)
void restore_artifacts (int fd)
const char * artiname (int artinum)
struct objmk_artifact (struct obj *otmp, aligntyp alignment)
const char * artifact_name (char *name, short *otyp) const
boolean exist_artifact (int otyp, const char *name)
void artifact_exists (struct obj *otmp, const char *name, boolean mod)
int nartifact_exist ()
boolean spec_ability (struct obj *otmp, unsigned long abil)
boolean confers_luck (struct obj *obj)
boolean arti_reflects (struct obj *obj)
boolean restrict_name (struct obj *otmp, const char *name, boolean restrict_typ)
STATIC_OVL boolean attacks (int adtyp, struct obj *otmp)
boolean defends (int adtyp, struct obj *otmp)
boolean protects (int adtyp, struct obj *otmp)
void set_artifact_intrinsic (struct obj *otmp, boolean on, long wp_mask)
int touch_artifact (struct obj *obj, struct monst *mon)
STATIC_OVL int spec_applies (const struct artifact *weap, struct monst *mtmp)
long spec_m2 (struct obj *otmp)
int spec_abon (struct obj *otmp, struct monst *mon)
int spec_dbon (struct obj *otmp, struct monst *mon, int tmp)
void discover_artifact (xchar m)
boolean undiscovered_artifact (xchar m)
int disp_artifact_discoveries (winid tmpwin)
STATIC_OVL boolean Mb_hit (struct monst *magr, struct monst *mdef, struct obj *mb, int *dmgptr, int dieroll, boolean vis, char *hittee)
boolean artifact_hit (struct monst *magr, struct monst *mdef, struct obj *otmp, int *dmgptr, int dieroll)
int doinvoke ()
STATIC_OVL int arti_invoke (struct obj *obj)
boolean artifact_light (struct obj *obj)
void arti_speak (struct obj *obj)
boolean artifact_has_invprop (struct obj *otmp, uchar inv_prop)
long arti_cost (struct obj *otmp)

Variables

boolean notonhead
STATIC_OVL int spec_dbon_applies = 0
static boolean artiexist [1+NROFARTIFACTS+1]
STATIC_OVL xchar artidisco [NROFARTIFACTS]
static const char *const mb_verb [2][4]
static NEARDATA const char recharge_type [] = { ALLOW_COUNT, ALL_CLASSES, 0 }
static NEARDATA const char invoke_types [] = { ALL_CLASSES, 0 }
boolean struct monstmon

Define Documentation

#define FATAL_DAMAGE_MODIFIER   200

Referenced by artifact_hit().

#define get_artifact (   o )    (((o)&&(o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0)
#define MB_INDEX_CANCEL   3

Referenced by Mb_hit().

#define MB_INDEX_PROBE   0

Referenced by Mb_hit().

#define MB_INDEX_SCARE   2

Referenced by Mb_hit().

#define MB_INDEX_STUN   1

Referenced by Mb_hit().

#define MB_MAX_DIEROLL   8

Referenced by artifact_hit(), and Mb_hit().


Function Documentation

long arti_cost ( struct obj otmp )

References artilist, artifact::cost, objects, and objclass::oc_cost.

Referenced by artifact_score(), and getprice().

Here is the caller graph for this function:

STATIC_OVL int arti_invoke ( struct obj obj )
boolean arti_reflects ( struct obj obj )

References artifact::cspfx, FALSE, get_artifact, artifact::spfx, SPFX_REFLECT, TRUE, and W_ART.

Referenced by mon_reflects().

Here is the caller graph for this function:

void arti_speak ( struct obj obj )

References bcsign(), BUFSZ, get_artifact, getrumor(), pline(), artifact::spfx, SPFX_SPEAK, Tobjnam(), and TRUE.

Referenced by doapply(), and ready_weapon().

Here is the call graph for this function:

Here is the caller graph for this function:

void artifact_exists ( struct obj otmp,
const char *  name,
boolean  mod 
)

References artilist, m, artifact::name, artifact::otyp, and RIN_INCREASE_DAMAGE.

Referenced by makewish(), oname(), readobjnam(), and resetobjs().

Here is the caller graph for this function:

boolean artifact_has_invprop ( struct obj otmp,
uchar  inv_prop 
)

References get_artifact, and artifact::inv_prop.

Referenced by dodown().

Here is the caller graph for this function:

boolean artifact_hit ( struct monst magr,
struct monst mdef,
struct obj otmp,
int *  dmgptr,
int  dieroll 
)
boolean artifact_light ( struct obj obj )
const char* artifact_name ( char *  name,
short *  otyp 
) const

References artilist, artifact::name, artifact::otyp, strcmpi, and strncmpi().

Referenced by artifact_score(), do_oname(), and readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* artiname ( int  artinum )

References artilist, name, and NROFARTIFACTS.

Referenced by convert_arg(), dipfountain(), disp_artifact_discoveries(), m_initweap(), and shkinit().

Here is the caller graph for this function:

STATIC_OVL boolean attacks ( int  adtyp,
struct obj otmp 
)

References FALSE, and get_artifact.

Referenced by artifact_hit().

Here is the caller graph for this function:

boolean confers_luck ( struct obj obj )

References LUCKSTONE, spec_ability(), SPFX_LUCK, and TRUE.

Referenced by addinv_core2(), bless(), curse(), freeinv_core(), stone_luck(), unbless(), uncurse(), and worst_cursed_item().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean defends ( int  adtyp,
struct obj otmp 
)

References FALSE, and get_artifact.

Referenced by cpostfx(), explmu(), gazemu(), hitmu(), resists_blnd(), resists_drli(), resists_magm(), and spec_applies().

Here is the caller graph for this function:

void discover_artifact ( xchar  m )

References m, and NROFARTIFACTS.

Referenced by dipfountain(), dosacrifice(), and fully_identify_obj().

Here is the caller graph for this function:

int disp_artifact_discoveries ( winid  tmpwin )

References align_str(), artifact::alignment, artilist, artiname(), BUFSZ, iflags, m, instance_flags::menu_headings, NROFARTIFACTS, artifact::otyp, putstr, simple_typename(), and Sprintf.

Referenced by dodiscovered().

Here is the call graph for this function:

Here is the caller graph for this function:

int doinvoke (  )

References arti_invoke(), getobj(), obj::oartifact, touch_artifact(), and youmonst.

Here is the call graph for this function:

boolean exist_artifact ( int  otyp,
const char *  name 
)

References artilist, FALSE, artifact::name, and artifact::otyp.

Referenced by dipfountain(), do_oname(), oname(), and resetobjs().

Here is the caller graph for this function:

STATIC_DCL int FDECL ( spec_applies  ,
(const struct artifact *, struct monst *)   
)
STATIC_DCL boolean FDECL ( attacks  ,
(int, struct obj *)   
)
STATIC_DCL int FDECL ( arti_invoke  ,
(struct obj *)   
)
STATIC_DCL boolean FDECL ( Mb_hit  ,
(struct monst *magr, struct monst *mdef, struct obj *, int *, int, BOOLEAN_P, char *)   
)
STATIC_OVL void hack_artifacts (  )
void init_artifacts (  )

References artidisco, artiexist, and hack_artifacts().

Referenced by newgame().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean Mb_hit ( struct monst magr,
struct monst mdef,
struct obj mb,
int *  dmgptr,
int  dieroll,
boolean  vis,
char *  hittee 
)
struct obj* mk_artifact ( struct obj otmp,
aligntyp  alignment 
) [read]

References A_NONE, artifact::alignment, artilist, FALSE, m, mksobj(), mons, artifact::name, NON_PM, NROFARTIFACTS, objects, oname(), otmp, artifact::otyp, artifact::race, race_hostile, rn2(), artifact::role, Role_if, artifact::spfx, SPFX_NOGEN, TRUE, u, and you::ugifts.

Referenced by dosacrifice(), mk_mplayer(), and mksobj().

Here is the call graph for this function:

Here is the caller graph for this function:

int nartifact_exist (  )

References SIZE.

Referenced by dosacrifice(), and readobjnam().

Here is the caller graph for this function:

STATIC_DCL void NDECL ( hack_artifacts   )
boolean protects ( int  adtyp,
struct obj otmp 
)

References attack::adtyp, artifact::cary, FALSE, and get_artifact.

Referenced by resists_blnd(), and resists_magm().

Here is the caller graph for this function:

void restore_artifacts ( int  fd )

References hack_artifacts(), and mread().

Referenced by restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean restrict_name ( struct obj otmp,
const char *  name,
boolean  restrict_typ 
)

References artilist, FALSE, artifact::name, artifact::otyp, artifact::spfx, SPFX_NOGEN, SPFX_RESTR, strcmpi, and strncmpi().

Referenced by chwepon(), and do_oname().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_artifacts ( int  fd )

References bwrite().

Referenced by savegamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_artifact_intrinsic ( struct obj otmp,
boolean  on,
long  wp_mask 
)
boolean spec_ability ( struct obj otmp,
unsigned long  abil 
)

References get_artifact, and artifact::spfx.

Referenced by artifact_hit(), confers_luck(), dochugw(), dosearch0(), and rndcurse().

Here is the caller graph for this function:

int spec_abon ( struct obj otmp,
struct monst mon 
)

References get_artifact, rnd(), and spec_applies().

Referenced by hitval(), and thitmonst().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int spec_applies ( const struct artifact weap,
struct monst mtmp 
)
int spec_dbon ( struct obj otmp,
struct monst mon,
int  tmp 
)

References AD_PHYS, FALSE, get_artifact, max, rnd(), and spec_applies().

Referenced by artifact_hit(), dmgval(), and dochugw().

Here is the call graph for this function:

Here is the caller graph for this function:

long spec_m2 ( struct obj otmp )

References get_artifact, and artifact::mtype.

Referenced by set_artifact_intrinsic().

Here is the caller graph for this function:

int touch_artifact ( struct obj obj,
struct monst mon 
)
boolean undiscovered_artifact ( xchar  m )

References FALSE, NROFARTIFACTS, and TRUE.

Referenced by not_fully_identified().

Here is the caller graph for this function:


Variable Documentation

STATIC_OVL xchar artidisco[NROFARTIFACTS]

Referenced by init_artifacts().

boolean artiexist[1+NROFARTIFACTS+1] [static]

Referenced by init_artifacts().

NEARDATA const char invoke_types[] = { ALL_CLASSES, 0 } [static]
const char* const mb_verb[2][4] [static]
Initial value:
 {
        { "probe", "stun", "scare", "cancel" },
        { "prod", "amaze", "tickle", "purge" },
}
boolean struct monst* mon
NEARDATA const char recharge_type[] = { ALLOW_COUNT, ALL_CLASSES, 0 } [static]
STATIC_OVL int spec_dbon_applies = 0