Defines | Functions | Variables

pray.c File Reference

#include "hack.h"
#include "epri.h"
Include dependency graph for pray.c:

Defines

#define Cursed_obj(obj, typ)   ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
#define PIOUS   20
#define DEVOUT   14
#define FERVENT   9
#define STRIDENT   4
#define TROUBLE_STONED   13
#define TROUBLE_SLIMED   12
#define TROUBLE_STRANGLED   11
#define TROUBLE_LAVA   10
#define TROUBLE_SICK   9
#define TROUBLE_STARVING   8
#define TROUBLE_HIT   7
#define TROUBLE_LYCANTHROPE   6
#define TROUBLE_COLLAPSING   5
#define TROUBLE_STUCK_IN_WALL   4
#define TROUBLE_CURSED_LEVITATION   3
#define TROUBLE_UNUSEABLE_HANDS   2
#define TROUBLE_CURSED_BLINDFOLD   1
#define TROUBLE_PUNISHED   (-1)
#define TROUBLE_FUMBLING   (-2)
#define TROUBLE_CURSED_ITEMS   (-3)
#define TROUBLE_SADDLE   (-4)
#define TROUBLE_BLIND   (-5)
#define TROUBLE_POISONED   (-6)
#define TROUBLE_WOUNDED_LEGS   (-7)
#define TROUBLE_HUNGRY   (-8)
#define TROUBLE_STUNNED   (-9)
#define TROUBLE_CONFUSED   (-10)
#define TROUBLE_HALLUCINATION   (-11)
#define ugod_is_angry()   (u.ualign.record < 0)
#define on_altar()   IS_ALTAR(levl[u.ux][u.uy].typ)
#define on_shrine()   ((levl[u.ux][u.uy].altarmask & AM_SHRINE) != 0)
#define a_align(x, y)   ((aligntyp)Amask2align(levl[x][y].altarmask & AM_MASK))
#define SATIATED   0
#define NOT_HUNGRY   1
#define HUNGRY   2
#define WEAK   3
#define FAINTING   4
#define FAINTED   5
#define STARVED   6
#define MAXVALUE   24

Functions

STATIC_PTR int NDECL (prayer_done)
STATIC_DCL struct objNDECL (worst_cursed_item)
STATIC_DCL void FDECL (fix_worst_trouble,(int))
STATIC_DCL void FDECL (angrygods,(ALIGNTYP_P))
STATIC_DCL void FDECL (at_your_feet,(const char *))
STATIC_DCL void FDECL (pleased,(ALIGNTYP_P))
STATIC_DCL void FDECL (godvoice,(ALIGNTYP_P, const char *))
STATIC_DCL void FDECL (god_zaps_you,(ALIGNTYP_P))
STATIC_DCL void FDECL (fry_by_god,(ALIGNTYP_P))
STATIC_DCL void FDECL (gods_angry,(ALIGNTYP_P))
STATIC_DCL void FDECL (gods_upset,(ALIGNTYP_P))
STATIC_DCL void FDECL (consume_offering,(struct obj *))
STATIC_DCL boolean FDECL (water_prayer,(BOOLEAN_P))
STATIC_DCL boolean FDECL (blocked_boulder,(int, int))
int in_trouble ()
STATIC_OVL struct objworst_cursed_item ()
STATIC_OVL void fix_worst_trouble (int trouble)
STATIC_OVL void god_zaps_you (aligntyp resp_god)
STATIC_OVL void fry_by_god (aligntyp resp_god)
STATIC_OVL void angrygods (aligntyp resp_god)
static void at_your_feet (char *str) const
STATIC_OVL void pleased (aligntyp g_align)
STATIC_OVL boolean water_prayer (boolean bless_water)
STATIC_OVL void godvoice (aligntyp g_align, const char *words)
STATIC_OVL void gods_angry (aligntyp g_align)
STATIC_OVL void gods_upset (aligntyp g_align)
STATIC_OVL void consume_offering (struct obj *otmp)
int dosacrifice ()
boolean can_pray (boolean praying)
int dopray ()
STATIC_PTR int prayer_done ()
int doturn ()
const char * a_gname ()
const char * a_gname_at (xchar x, xchar y)
const char * u_gname ()
const char * align_gname (aligntyp alignment)
const char * halu_gname (aligntyp alignment)
const char * rnd_gname (int role)
const char * align_gtitle (aligntyp alignment)
void altar_wrath (int x, int y)
STATIC_OVL boolean blocked_boulder (int dx, int dy)

Variables

static const char * Moloch = "Moloch"
static const char * godvoices []
static aligntyp p_aligntyp
static int p_trouble
static int p_type
static NEARDATA const char sacrifice_types [] = { FOOD_CLASS, AMULET_CLASS, 0 }

Define Documentation

#define a_align (   x,
 
)    ((aligntyp)Amask2align(levl[x][y].altarmask & AM_MASK))
#define Cursed_obj (   obj,
  typ 
)    ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
#define DEVOUT   14

Referenced by pleased().

#define FAINTED   5
#define FAINTING   4
#define FERVENT   9
#define HUNGRY   2
#define MAXVALUE   24

Referenced by dosacrifice().

#define NOT_HUNGRY   1
#define on_altar (  )    IS_ALTAR(levl[u.ux][u.uy].typ)
#define on_shrine (  )    ((levl[u.ux][u.uy].altarmask & AM_SHRINE) != 0)

Referenced by pleased().

#define PIOUS   20

Referenced by pleased().

#define SATIATED   0
#define STARVED   6
#define STRIDENT   4

Referenced by angrygods(), and pleased().

#define TROUBLE_BLIND   (-5)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_COLLAPSING   5

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_CONFUSED   (-10)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_CURSED_BLINDFOLD   1

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_CURSED_ITEMS   (-3)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_CURSED_LEVITATION   3

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_FUMBLING   (-2)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_HALLUCINATION   (-11)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_HIT   7

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_HUNGRY   (-8)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_LAVA   10

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_LYCANTHROPE   6

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_POISONED   (-6)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_PUNISHED   (-1)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_SADDLE   (-4)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_SICK   9

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_SLIMED   12

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_STARVING   8

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_STONED   13

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_STRANGLED   11

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_STUCK_IN_WALL   4

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_STUNNED   (-9)

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_UNUSEABLE_HANDS   2

Referenced by fix_worst_trouble(), and in_trouble().

#define TROUBLE_WOUNDED_LEGS   (-7)

Referenced by fix_worst_trouble(), and in_trouble().

#define ugod_is_angry (  )    (u.ualign.record < 0)

Referenced by angrygods(), and dosacrifice().

#define WEAK   3

Function Documentation

const char* a_gname (  )

References a_gname_at(), u, you::ux, and you::uy.

Referenced by dfeature_at(), and dosacrifice().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* a_gname_at ( xchar  x,
xchar  y 
)

References a_align, align_gname(), IS_ALTAR, and levl.

Referenced by a_gname(), and ghod_hitsu().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* align_gname ( aligntyp  alignment )
const char* align_gtitle ( aligntyp  alignment )

References A_CHAOTIC, A_LAWFUL, A_NEUTRAL, Role::cgod, Role::lgod, Role::ngod, and urole.

Referenced by convert_arg().

Here is the caller graph for this function:

void altar_wrath ( int  x,
int  y 
)

References a_align, A_WIS, adjattrib(), align_gname(), change_luck(), FALSE, godvoice(), pline(), and u_gname().

Referenced by dig(), dokick(), dosit(), and engrave().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void angrygods ( aligntyp  resp_god )
static void at_your_feet ( char *  str ) const [static]

References Blind, body_part(), FOOT, Levitation, makeplural(), mbodypart(), mon_nam(), pline(), s_suffix(), Something, STOMACH, u, you::ustuck, and vtense().

Referenced by dosacrifice(), and pleased().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean blocked_boulder ( int  dx,
int  dy 
)

References BOULDER, FALSE, IS_ROCK, isok(), level, levl, dlevel_t::objects, otmp, obj::otyp, obj::quan, sobj_at(), TRUE, u, you::ux, and you::uy.

Referenced by in_trouble().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean can_pray ( boolean  praying )

References a_align, A_CHAOTIC, A_LAWFUL, A_NEUTRAL, align_gname(), monst::data, FALSE, in_trouble(), Inhell, is_demon, is_undead, Luck, on_altar, align::record, rn2(), TRUE, align::type, u, you::ualign, you::ublesscnt, you::ugangr, you::ux, you::uy, and youmonst.

Referenced by dopray(), enlightenment(), and maybe_tutorial().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void consume_offering ( struct obj otmp )

References A_LAWFUL, A_WIS, Blind, carried, exercise(), Hallucination, rn2(), TRUE, align::type, u, you::ualign, useup(), and useupf().

Referenced by dosacrifice().

Here is the call graph for this function:

Here is the caller graph for this function:

int dopray (  )
int dosacrifice (  )

References a_align, A_CHAOTIC, A_CURRENT, a_gname(), A_LAWFUL, a_monnam(), A_NONE, A_ORIGINAL, A_WIS, Race::adj, adjalign(), adjattrib(), Align2amask, align_str(), ALIGNLIM, AM_CHAOTIC, AM_SHRINE, AMULET_OF_YENDOR, Amulet_off(), an(), angry_priest(), angrygods(), ASCENDED, at_your_feet(), Blind, body_part(), flag::botl, carried, change_luck(), conducts, consume_offering(), CORPSE, obj::corpsenm, monst::data, discover_artifact(), display_nhwindow, dlord(), doname(), done(), dropy(), eaten_stat(), eos(), ESCAPED, exercise(), FAKE_AMULET_OF_YENDOR, FALSE, feel_cockatrice(), flag::female, findpriest(), FIRST_CONDUCT, flags, FOOT, FROMOUTSIDE, get_mtraits(), getobj(), u_conduct::gnostic, god_zaps_you(), gods_upset(), godvoice(), HAggravate_monster, Hallucination, hcolor(), HELM_OF_OPPOSITE_ALIGNMENT, Inhell, Is_astralevel, is_demon, Is_sanctum, is_undead, is_unicorn, killer, killer_format, LAST_CONDUCT, level, levl, LUCKMAX, makeknown, makemon(), makeplural(), permonst::maligntyp, MAXVALUE, mk_artifact(), mons, monstermoves, monstr, monst::mtame, nartifact_exist(), newsym(), NH_BLACK, NH_WHITE, NO_KILLER_PREFIX, NO_MM_FLAGS, nomul(), NON_PM, nothing_happens, obj::oartifact, OATTACHED_MONST, dlevel_t::objects, obj::oeaten, on_altar, otense(), otmp, obj::otyp, obj::oxlth, p_coaligned(), peek_at_iced_corpse_age(), pline(), pm, PM_ACID_BLOB, QBUFSZ, obj::quan, align::record, rn2(), rnd(), rnl(), rnz(), ROOM, sgn(), something, flag::soundok, obj::spe, Sprintf, successful_cdt(), summon_minion(), superfluous_cdt(), temple_occupied(), TRUE, align::type, u, u_gname(), you::ualign, you::ualignbase, uamul, uarmh, you::ublesscnt, you::ublessed, you::uconduct, you::uevent, you::ugangr, you::ugifts, ugod_is_angry, you::ulevel, you::uluck, uncurse(), unrestrict_weapon_skill(), update_inventory, urace, you::urooms, useup(), useupf(), you::ux, you::uy, you::uz, weapon_type(), WIN_MESSAGE, yn_function(), ynqchars, youmonst, and your_race.

Here is the call graph for this function:

int doturn (  )
STATIC_DCL void FDECL ( god_zaps_you  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( gods_angry  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( fry_by_god  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( angrygods  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( fix_worst_trouble  ,
(int)   
)
STATIC_DCL void FDECL ( at_your_feet  ,
(const char *)   
)
STATIC_DCL void FDECL ( gods_upset  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( pleased  ,
(ALIGNTYP_P)   
)
STATIC_DCL void FDECL ( consume_offering  ,
(struct obj *)   
)
STATIC_DCL boolean FDECL ( water_prayer  ,
(BOOLEAN_P)   
)
STATIC_DCL boolean FDECL ( blocked_boulder  ,
(int, int)   
)
STATIC_DCL void FDECL ( godvoice  ,
(ALIGNTYP_P, const char *)   
)
STATIC_OVL void fix_worst_trouble ( int  trouble )
STATIC_OVL void fry_by_god ( aligntyp  resp_god )

References align_gname(), DIED, done(), KILLED_BY, killer, killer_format, and Sprintf.

Referenced by god_zaps_you().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void god_zaps_you ( aligntyp  resp_god )
STATIC_OVL void gods_angry ( aligntyp  g_align )

References godvoice().

Referenced by angrygods().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void gods_upset ( aligntyp  g_align )

References angrygods(), align::type, u, you::ualign, and you::ugangr.

Referenced by dosacrifice(), and prayer_done().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void godvoice ( aligntyp  g_align,
const char *  words 
)

References align_gname(), rn2(), and SIZE.

Referenced by altar_wrath(), angrygods(), dosacrifice(), god_zaps_you(), gods_angry(), pleased(), and prayer_done().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* halu_gname ( aligntyp  alignment )

References align_gname(), Hallucination, rnd_gname(), and ROLE_RANDOM.

Referenced by priestname().

Here is the call graph for this function:

Here is the caller graph for this function:

int in_trouble (  )
STATIC_DCL struct obj* NDECL ( worst_cursed_item   ) [read]
STATIC_PTR int NDECL ( prayer_done   )
STATIC_OVL void pleased ( aligntyp  g_align )
STATIC_PTR int prayer_done (  )

References A_CON, A_LAWFUL, align_gname(), angrygods(), change_luck(), exercise(), FALSE, gods_upset(), godvoice(), Inhell, KILLED_BY_AN, losehp(), on_altar, p_aligntyp, pleased(), pline(), align::record, rehumanize(), rnd(), rnl(), rnz(), TRUE, align::type, u, you::ualign, you::ublesscnt, and water_prayer().

Referenced by dopray().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* rnd_gname ( int  role )

References Role::cgod, Role::lgod, Moloch, Role::ngod, randrole(), rn2(), roles, and validrole().

Referenced by halu_gname(), and priestname().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* u_gname (  )

References align_gname(), align::type, u, and you::ualign.

Referenced by altar_wrath(), dosacrifice(), doturn(), enlightenment(), and pleased().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean water_prayer ( boolean  bless_water )

References Blind, FALSE, Hallucination, hcolor(), level, NH_BLACK, NH_LIGHT_BLUE, dlevel_t::objects, obj::oclass, otmp, obj::otyp, pline(), POT_WATER, POTION_CLASS, obj::quan, TRUE, u, you::ux, and you::uy.

Referenced by prayer_done().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct obj* worst_cursed_item (  ) [read]

References bimanual, confers_luck(), Cursed_obj, HVY_ENCUMBER, invent, LOADSTONE, near_capacity(), obj::nobj, otmp, obj::otyp, you::twoweap, u, uamul, uarm, uarmc, uarmf, uarmg, uarmh, uarms, ublindf, uleft, uright, uswapwep, uwep, and welded().

Referenced by fix_worst_trouble(), and in_trouble().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* godvoices[] [static]
Initial value:
 {
    "booms out",
    "thunders",
    "rings out",
    "booms",
}
const char* Moloch = "Moloch" [static]

Referenced by align_gname(), and rnd_gname().

aligntyp p_aligntyp [static]

Referenced by prayer_done().

int p_trouble [static]
int p_type [static]
NEARDATA const char sacrifice_types[] = { FOOD_CLASS, AMULET_CLASS, 0 } [static]