Defines | Functions | Variables

eat.c File Reference

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

Defines

#define SATIATED   0
#define NOT_HUNGRY   1
#define HUNGRY   2
#define WEAK   3
#define FAINTING   4
#define FAINTED   5
#define STARVED   6
#define CANNIBAL_ALLOWED()   (Role_if(PM_CAVEMAN) || Race_if(PM_ORC) || Race_if(PM_VAMPIRE))
#define ROTTEN_TIN   4
#define HOMEMADE_TIN   5
#define SZECHUAN_TIN   10
#define FRENCH_FRIED_TIN   11
#define TTSZ   SIZE(tintxts)

Functions

STATIC_PTR int NDECL (eatmdone)
STATIC_PTR int NDECL (eatfood)
STATIC_PTR void FDECL (costly_tin,(const char *))
STATIC_PTR int NDECL (opentin)
STATIC_PTR int NDECL (unfaint)
STATIC_DCL const char * FDECL (food_xname,(struct obj *, BOOLEAN_P))
STATIC_DCL void FDECL (choke,(struct obj *))
STATIC_DCL void NDECL (recalc_wt)
STATIC_DCL struct objFDECL (touchfood,(struct obj *))
STATIC_DCL void NDECL (do_reset_eat)
STATIC_DCL void FDECL (done_eating,(BOOLEAN_P))
STATIC_DCL void FDECL (cprefx,(int))
STATIC_DCL int FDECL (intrinsic_possible,(int, struct permonst *))
STATIC_DCL void FDECL (givit,(int, struct permonst *))
STATIC_DCL void FDECL (cpostfx,(int))
STATIC_DCL void FDECL (start_tin,(struct obj *))
STATIC_DCL int FDECL (eatcorpse,(struct obj *))
STATIC_DCL void FDECL (start_eating,(struct obj *))
STATIC_DCL void FDECL (fprefx,(struct obj *))
STATIC_DCL void FDECL (accessory_has_effect,(struct obj *))
STATIC_DCL void FDECL (fpostfx,(struct obj *))
STATIC_DCL int NDECL (bite)
STATIC_DCL int FDECL (edibility_prompts,(struct obj *))
STATIC_DCL int FDECL (rottenfood,(struct obj *))
STATIC_DCL void NDECL (eatspecial)
STATIC_DCL void FDECL (eataccessory,(struct obj *))
STATIC_DCL const char * FDECL (foodword,(struct obj *))
STATIC_DCL boolean FDECL (maybe_cannibal,(int, BOOLEAN_P))
boolean is_edible (struct obj *obj)
void init_uhunger ()
STATIC_PTR int eatmdone ()
STATIC_OVL const char * food_xname (struct obj *food, boolean the_pfx)
STATIC_OVL void choke (struct obj *food)
STATIC_OVL void recalc_wt ()
void reset_eat ()
STATIC_OVL struct objtouchfood (struct obj *otmp)
void food_disappears (struct obj *obj)
void food_substitution (struct obj *old_obj, struct obj *new_obj)
STATIC_OVL void do_reset_eat ()
STATIC_PTR int eatfood ()
STATIC_OVL void done_eating (boolean message)
STATIC_OVL boolean maybe_cannibal (int pm, boolean allowmsg)
STATIC_OVL void cprefx (int pm)
boolean bite_monster (struct monst *mon)
void fix_petrification ()
STATIC_OVL int intrinsic_possible (int type, struct permonst *ptr)
STATIC_OVL void givit (int type, struct permonst *ptr)
STATIC_OVL void cpostfx (int pm)
void violated_vegetarian ()
STATIC_PTR void costly_tin (char *verb) const
STATIC_PTR int opentin ()
STATIC_OVL void start_tin (struct obj *otmp)
int Hear_again ()
STATIC_OVL int rottenfood (struct obj *obj)
STATIC_OVL int eatcorpse (struct obj *otmp)
STATIC_OVL void start_eating (struct obj *otmp)
STATIC_OVL void fprefx (struct obj *otmp)
STATIC_OVL void accessory_has_effect (struct obj *otmp)
STATIC_OVL void eataccessory (struct obj *otmp)
STATIC_OVL void eatspecial ()
STATIC_OVL const char * foodword (struct obj *otmp)
STATIC_OVL void fpostfx (struct obj *otmp)
STATIC_OVL int edibility_prompts (struct obj *otmp)
int doeat ()
STATIC_OVL int bite ()
void gethungry ()
void morehungry (int num)
void lesshungry (int num)
STATIC_PTR int unfaint ()
boolean is_fainted ()
void reset_faint ()
void newuhs (boolean incr)
struct objfloorfood (char *verb, int corpsecheck) const
void vomit ()
int eaten_stat (int base, struct obj *obj)
void consume_oeaten (struct obj *obj, int amt)
boolean maybe_finished_meal (boolean stopping)

Variables

char msgbuf [BUFSZ]
STATIC_OVL NEARDATA const char comestibles [] = { FOOD_CLASS, 0 }
STATIC_OVL NEARDATA const char allobj []
STATIC_OVL boolean force_save_hs = FALSE
const char * hu_stat []
struct {
   const char *   txt
   int   nut
tintxts []
struct {
   struct obj *   piece
   int   usedtime
   int   reqtime
   int   nmod
victual
static char * eatmbuf = 0
static const char * foodwords []

Define Documentation

#define CANNIBAL_ALLOWED (  )    (Role_if(PM_CAVEMAN) || Race_if(PM_ORC) || Race_if(PM_VAMPIRE))

Referenced by cprefx(), fprefx(), and maybe_cannibal().

#define FAINTED   5

Referenced by is_fainted(), and newuhs().

#define FAINTING   4

Referenced by newuhs(), and unfaint().

#define FRENCH_FRIED_TIN   11

Referenced by opentin().

#define HOMEMADE_TIN   5

Referenced by opentin().

#define HUNGRY   2

Referenced by newuhs().

#define NOT_HUNGRY   1

Referenced by init_uhunger(), and newuhs().

#define ROTTEN_TIN   4

Referenced by opentin().

#define SATIATED   0

Referenced by choke(), doeat(), and newuhs().

#define STARVED   6

Referenced by newuhs().

#define SZECHUAN_TIN   10

Referenced by opentin().

#define TTSZ   SIZE(tintxts)

Referenced by opentin().

#define WEAK   3

Referenced by newuhs().


Function Documentation

STATIC_OVL void accessory_has_effect ( struct obj otmp )

References pline(), and RING_CLASS.

Referenced by eataccessory().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int bite (  )

References choke(), consume_oeaten(), do_reset_eat(), FALSE, lesshungry(), recalc_wt(), TRUE, u, you::uhunger, and victual.

Referenced by eatfood(), and start_eating().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean bite_monster ( struct monst mon )

Called when a vampire bites a monster. Returns TRUE if hero died and was lifesaved.

References acidic, monst::data, done_in_by(), FALSE, fix_petrification(), mons, monsndx(), pline(), PM_DEATH, PM_FAMINE, PM_FIRE_ELEMENTAL, PM_FIRE_VORTEX, PM_GREEN_SLIME, PM_LIZARD, PM_PESTILENCE, Slimed, Stoned, TRUE, Unchanging, and youmonst.

Referenced by passive().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void choke ( struct obj food )
void consume_oeaten ( struct obj obj,
int  amt 
)

References obj::oeaten, and victual.

Referenced by bite(), doeat(), eatcorpse(), and readobjnam().

Here is the caller graph for this function:

STATIC_PTR void costly_tin ( char*  verb ) const

References bill_dummy_object(), carried, costly_spot(), obj::ox, obj::oy, obj::quan, splitobj(), and tin.

Referenced by opentin().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void cpostfx ( int  pm )
STATIC_OVL void cprefx ( int  pm )
STATIC_OVL void do_reset_eat (  )

References FALSE, newuhs(), recalc_wt(), stop_occupation(), touchfood(), and victual.

Referenced by bite(), and eatfood().

Here is the call graph for this function:

Here is the caller graph for this function:

int doeat (  )
STATIC_OVL void done_eating ( boolean  message )

References carried, CORPSE, cpostfx(), FALSE, food_xname(), fpostfx(), newuhs(), nomovemsg, pline(), PM_VAMPIRE, Race_if, rn2(), TRUE, useup(), useupf(), and victual.

Referenced by eatfood(), and start_eating().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void eataccessory ( struct obj otmp )
STATIC_OVL int eatcorpse ( struct obj otmp )
int eaten_stat ( int  base,
struct obj obj 
)

References permonst::cnutrit, CORPSE, mons, objects, objclass::oc_nutrition, and obj::oeaten.

Referenced by dog_nutrition(), dosacrifice(), revive(), and weight().

Here is the caller graph for this function:

STATIC_PTR int eatfood (  )

References bite(), carried, monst::data, do_reset_eat(), done_eating(), drainlevel, is_vampiric, lesshungry(), obj_here(), TRUE, u, you::ux, you::uy, victual, and youmonst.

Referenced by eatspecial(), lesshungry(), maybe_finished_meal(), newuhs(), and start_eating().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int eatmdone (  )

References M_AP_NOTHING, monst::m_ap_type, newsym(), nomovemsg, u, you::ux, you::uy, and youmonst.

Referenced by cpostfx().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void eatspecial (  )
STATIC_OVL int edibility_prompts ( struct obj otmp )
STATIC_DCL void FDECL ( start_tin  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( eatcorpse  ,
(struct obj *)   
)
STATIC_DCL struct obj* FDECL ( touchfood  ,
(struct obj *)   
) [read]
STATIC_DCL void FDECL ( start_eating  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( fprefx  ,
(struct obj *)   
)
STATIC_DCL const char* FDECL ( foodword  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( done_eating  ,
(BOOLEAN_P)   
)
STATIC_DCL void FDECL ( accessory_has_effect  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( fpostfx  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( edibility_prompts  ,
(struct obj *)   
)
STATIC_PTR void FDECL ( costly_tin  ,
(const char *)   
)
STATIC_DCL int FDECL ( rottenfood  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( cprefx  ,
(int)   
)
STATIC_DCL void FDECL ( eataccessory  ,
(struct obj *)   
)
STATIC_DCL int FDECL ( intrinsic_possible  ,
(int, struct permonst *)   
)
STATIC_DCL boolean FDECL ( maybe_cannibal  ,
(int, BOOLEAN_P)   
)
STATIC_DCL const char* FDECL ( food_xname  ,
(struct obj *, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( givit  ,
(int, struct permonst *)   
)
STATIC_DCL void FDECL ( choke  ,
(struct obj *)   
)
STATIC_DCL void FDECL ( cpostfx  ,
(int)   
)
void fix_petrification (  )

References A_CHA, ACURR, delayed_killer, Hallucination, pline(), and Stoned.

Referenced by bite_monster(), cprefx(), peffects(), and zapyourself().

Here is the call graph for this function:

Here is the caller graph for this function:

struct obj* floorfood ( char *  verb,
int  corpsecheck 
) const [read]
void food_disappears ( struct obj obj )

References obj_stop_timers(), and victual.

Referenced by obfree(), and saveobjchn().

Here is the call graph for this function:

Here is the caller graph for this function:

void food_substitution ( struct obj old_obj,
struct obj new_obj 
)

References tin, and victual.

Referenced by realloc_obj().

Here is the caller graph for this function:

STATIC_OVL const char* food_xname ( struct obj food,
boolean  the_pfx 
)

References CORPSE, obj::corpsenm, G_UNIQ, permonst::geno, mons, s_suffix(), singular(), Sprintf, the(), type_is_pname, and xname().

Referenced by choke(), done_eating(), eatcorpse(), and start_eating().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL const char* foodword ( struct obj otmp )

References FOOD_CLASS, GEM_CLASS, GLASS, makeknown, and objects.

Referenced by choke(), doeat(), and rottenfood().

Here is the caller graph for this function:

STATIC_OVL void fpostfx ( struct obj otmp )
STATIC_OVL void fprefx ( struct obj otmp )
void gethungry (  )
STATIC_OVL void givit ( int  type,
struct permonst ptr 
)
int Hear_again (  )

References flags, and flag::soundok.

Referenced by fall_asleep(), rottenfood(), and unfaint().

Here is the caller graph for this function:

void init_uhunger (  )

References NOT_HUNGRY, u, you::uhs, and you::uhunger.

Referenced by fix_worst_trouble(), pleased(), savelife(), and u_init().

Here is the caller graph for this function:

STATIC_OVL int intrinsic_possible ( int  type,
struct permonst ptr 
)
boolean is_edible ( struct obj obj )
boolean is_fainted (  )

References FAINTED, u, and you::uhs.

Referenced by gd_move(), hitmu(), newuhs(), outrumor(), reset_faint(), and steal().

Here is the caller graph for this function:

void lesshungry ( int  num )

References choke(), eatfood(), FALSE, multi, newuhs(), nomovemsg, opentin(), pline(), reset_eat(), tin, TRUE, u, you::uhunger, victual, yn_function(), and ynchars.

Referenced by bite(), damageum(), eatfood(), eatspecial(), opentin(), and peffects().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean maybe_cannibal ( int  pm,
boolean  allowmsg 
)

References CANNIBAL_ALLOWED, change_luck(), FALSE, FROMOUTSIDE, HAggravate_monster, mons, rn1, TRUE, Upolyd, and your_race.

Referenced by cprefx(), and eatcorpse().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean maybe_finished_meal ( boolean  stopping )

References eatfood(), FALSE, TRUE, and victual.

Referenced by steal(), and stop_occupation().

Here is the call graph for this function:

Here is the caller graph for this function:

void morehungry ( int  num )

References newuhs(), TRUE, u, and you::uhunger.

Referenced by choke(), damageum(), dosit(), dotele(), drinkfountain(), hitmu(), jump(), spelleffects(), and vomiting_dialogue().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int NDECL ( unfaint   )
STATIC_DCL void NDECL ( recalc_wt   )
STATIC_PTR int NDECL ( opentin   )
STATIC_PTR int NDECL ( eatfood   )
STATIC_DCL int NDECL ( bite   )
STATIC_DCL void NDECL ( eatspecial   )
STATIC_PTR int NDECL ( eatmdone   )
STATIC_DCL void NDECL ( do_reset_eat   )
void newuhs ( boolean  incr )
STATIC_PTR int opentin (  )
STATIC_OVL void recalc_wt (  )

References obj::owt, piece, victual, and weight().

Referenced by bite(), and do_reset_eat().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_eat (  )

References TRUE, and victual.

Referenced by lesshungry(), and moveloop().

Here is the caller graph for this function:

void reset_faint (  )

References is_fainted(), and nomul().

Referenced by invault().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int rottenfood ( struct obj obj )

References Blind, body_part(), d(), FALSE, flags, foodword(), Hallucination, HConfusion, Hear_again(), Is_airlevel, Is_waterlevel, Levitation, LIGHT_HEADED, make_blinded(), make_confused(), nomovemsg, nomul(), pline(), rn2(), rnd(), flag::soundok, surface(), u, you::ux, you::uy, you::uz, vision_clears, what, and where.

Referenced by doeat(), and eatcorpse().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void start_eating ( struct obj otmp )

References bite(), CORPSE, cprefx(), done_eating(), eatfood(), FALSE, food_xname(), objects, objclass::oc_delay, set_occupation(), Sprintf, TRUE, and victual.

Referenced by doeat().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void start_tin ( struct obj otmp )

References A_DEX, ACURR, ACURRSTR, aobjnam(), ATHAME, AXE, body_part(), carried, CRYSKNIFE, DAGGER, monst::data, dropx(), ELVEN_DAGGER, FINGER, Glib, makeplural(), metallivorous, nolimbs, opentin(), ORCISH_DAGGER, otmp, obj::otyp, PICK_AXE, pline(), rn1, set_occupation(), SILVER_DAGGER, splitobj(), stackobj(), tin, TIN_OPENER, uwep, and youmonst.

Referenced by doeat().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct obj* touchfood ( struct obj otmp ) [read]

References addinv(), bill_dummy_object(), carried, permonst::cnutrit, CORPSE, costly_spot(), dropy(), freeinv(), inv_cnt(), mons, objects, objclass::oc_nutrition, SELL_DONTSELL, SELL_NORMAL, sellobj_state(), and splitobj().

Referenced by do_reset_eat(), doeat(), and eatcorpse().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_PTR int unfaint (  )

References flag::botl, FAINTING, flags, Hear_again(), stop_occupation(), u, and you::uhs.

Referenced by newuhs().

Here is the call graph for this function:

Here is the caller graph for this function:

void violated_vegetarian (  )
Deprecated:
violated(CONDUCT_VEGETARIAN) replaces violated_vegetarian()

References CONDUCT_VEGETARIAN, and violated().

Referenced by peffects().

Here is the call graph for this function:

Here is the caller graph for this function:

void vomit (  )

References make_sick(), nomul(), SICK_VOMITABLE, and TRUE.

Referenced by choke(), drinkfountain(), and vomiting_dialogue().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

STATIC_OVL NEARDATA const char allobj[]
STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 }
char* eatmbuf = 0 [static]

Referenced by cpostfx().

const char* foodwords[] [static]
Initial value:
 {
        "meal", "liquid", "wax", "food", "meat",
        "paper", "cloth", "leather", "wood", "bone", "scale",
        "metal", "metal", "metal", "silver", "gold", "platinum", "mithril",
        "plastic", "glass", "rich food", "stone"
}
STATIC_OVL boolean force_save_hs = FALSE
const char* hu_stat[]
Initial value:
 {
        "Satiated",
        "        ",
        "Hungry  ",
        "Weak    ",
        "Fainting",
        "Fainted ",
        "Starved "
}

Referenced by bot2().

char msgbuf[BUFSZ]

Referenced by fall_through(), and gulpum().

int nmod
int nut

Referenced by opentin().

struct obj* piece

Referenced by recalc_wt().

int reqtime
static { ... } tin
struct { ... } tintxts[] [static]

Referenced by opentin().

const char* txt
int usedtime
NEARDATA { ... } victual [static]