#include "hack.h"#include "lev.h"
Data Structures | |
| struct | ttable |
Defines | |
| #define | VERBOSE_TIMER |
| #define | TTAB(a, b, c) {a,b,c} |
Functions | |
| STATIC_DCL void | NDECL (stoned_dialogue) |
| STATIC_DCL void | NDECL (vomiting_dialogue) |
| STATIC_DCL void | NDECL (choke_dialogue) |
| STATIC_DCL void | NDECL (slime_dialogue) |
| STATIC_DCL void | NDECL (slip_or_trip) |
| STATIC_DCL void | FDECL (see_lamp_flicker,(struct obj *, const char *)) |
| STATIC_DCL void | FDECL (lantern_message,(struct obj *)) |
| STATIC_DCL void | FDECL (cleanup_burn,(genericptr_t, long)) |
| STATIC_OVL void | stoned_dialogue () |
| STATIC_OVL void | vomiting_dialogue () |
| STATIC_OVL void | choke_dialogue () |
| STATIC_OVL void | slime_dialogue () |
| void | burn_away_slime () |
| void | nh_timeout () |
| void | fall_asleep (int how_long, boolean wakeup_msg) |
| void | attach_egg_hatch_timeout (struct obj *egg) |
| void | kill_egg (struct obj *egg) |
| void | hatch_egg (genericptr_t arg, long timeout) |
| void | learn_egg_type (int mnum) |
| void | attach_fig_transform_timeout (struct obj *figurine) |
| STATIC_OVL void | slip_or_trip () |
| STATIC_OVL void | see_lamp_flicker (struct obj *obj, const char *tailer) |
| STATIC_OVL void | lantern_message (struct obj *obj) |
| void | burn_object (genericptr_t arg, long timeout) |
| void | begin_burn (struct obj *obj, boolean already_lit) |
| void | end_burn (struct obj *obj, boolean timer_attached) |
| static void | cleanup_burn (genericptr_t arg, long expire_time) |
| void | do_storms () |
| STATIC_DCL void | FDECL (insert_timer,(timer_element *)) |
| STATIC_DCL timer_element * | FDECL (remove_timer,(timer_element **, SHORT_P, genericptr_t)) |
| STATIC_DCL void | FDECL (write_timer,(int, timer_element *)) |
| STATIC_DCL boolean | FDECL (mon_is_local,(struct monst *)) |
| STATIC_DCL boolean | FDECL (timer_is_local,(timer_element *)) |
| STATIC_DCL int | FDECL (maybe_write_timer,(int, int, BOOLEAN_P)) |
| void | run_timers () |
| boolean | start_timer (long when, short kind, short func_index, genericptr_t arg) |
| long | stop_timer (short func_index, genericptr_t arg) |
| void | obj_move_timers (struct obj *src, struct obj *dest) |
| void | obj_split_timers (struct obj *src, struct obj *dest) |
| void | obj_stop_timers (struct obj *obj) |
| STATIC_OVL void | insert_timer (timer_element *gnu) |
| STATIC_OVL timer_element * | remove_timer (timer_element **base, short func_index, genericptr_t arg) |
| STATIC_OVL void | write_timer (int fd, timer_element *timer) |
| boolean | obj_is_local (struct obj *obj) |
| STATIC_OVL boolean | mon_is_local (struct monst *mon) |
| STATIC_OVL boolean | timer_is_local (timer_element *timer) |
| STATIC_OVL int | maybe_write_timer (int fd, int range, boolean write_it) |
| void | save_timers (int fd, int mode, int range) |
| void | restore_timers (int fd, int range, boolean ghostly, long adjust) |
| void | relink_timers (boolean ghostly) |
Variables | |
| static NEARDATA const char *const | stoned_texts [] |
| static NEARDATA const char *const | vomiting_texts [] |
| static NEARDATA const char *const | choke_texts [] |
| static NEARDATA const char *const | choke_texts2 [] |
| static NEARDATA const char *const | slime_texts [] |
| static timer_element * | timer_base |
| static unsigned long | timer_id = 1 |
| static const ttable | timeout_funcs [NUM_TIME_FUNCS] |
| #define TTAB | ( | a, | |
| b, | |||
| c | |||
| ) | {a,b,c} |
| #define VERBOSE_TIMER |
| void attach_egg_hatch_timeout | ( | struct obj * | egg ) |
References HATCH_EGG, MAX_EGG_HATCH_TIME, rnd(), start_timer(), stop_timer(), and TIMER_OBJECT.
Referenced by create_object(), dosit(), hatch_egg(), mksobj(), poly_obj(), readobjnam(), and revive_egg().


| void attach_fig_transform_timeout | ( | struct obj * | figurine ) |
References FIG_TRANSFORM, rnd(), start_timer(), stop_timer(), and TIMER_OBJECT.
Referenced by carry_obj_effects(), and curse().


References artifact_light(), BRASS_LANTERN, BURIED_TOO, BURN_OBJECT, CANDELABRUM_OF_INVOCATION, candle_light_range(), carried, CONTAINED_TOO, FALSE, get_obj_location(), Is_gold_dragon_armor, LS_OBJECT, MAGIC_LAMP, new_light_source(), OIL_LAMP, POT_OIL, start_timer(), TALLOW_CANDLE, TIMER_OBJECT, TRUE, update_inventory, WAX_CANDLE, and xname().
Referenced by Armor_on(), burn_object(), catch_lit(), create_object(), dorub(), light_cocktail(), mon_wield_item(), readobjnam(), ready_weapon(), update_mon_intrinsics(), use_candelabrum(), and use_lamp().


| void burn_away_slime | ( | ) |
References flag::botl, flags, and Slimed.
Referenced by artifact_hit(), boulder_hits_pool(), cast_cleric_spell(), castmu(), dofiretrap(), dosit(), explmu(), explode(), gazemu(), gulpmu(), hitmu(), lava_effects(), seffects(), use_offensive(), zapyourself(), and zhitu().

| void burn_object | ( | genericptr_t | arg, |
| long | timeout | ||
| ) |
References obj::age, an(), begin_burn(), Blind, BRASS_LANTERN, BUFSZ, CANDELABRUM_OF_INVOCATION, cansee, end_burn(), FALSE, get_obj_location(), Hallucination, Is_candle, lantern_message(), monstermoves, newsym(), obfree(), obj_extract_self(), OBJ_FLOOR, OBJ_INVENT, OBJ_MINVENT, OIL_LAMP, obj::otyp, pline(), POT_OIL, obj::quan, see_lamp_flicker(), Shk_Your(), obj::spe, TALLOW_CANDLE, TRUE, WAX_CANDLE, obj::where, and xname().

| STATIC_OVL void choke_dialogue | ( | ) |
References A_STR, body_part(), Breathless, exercise(), FALSE, hcolor(), index, NECK, NH_BLUE, pline(), rn2(), SIZE, Strangled, and TIMEOUT.
Referenced by nh_timeout().


| static void cleanup_burn | ( | genericptr_t | arg, |
| long | expire_time | ||
| ) | [static] |
References obj::age, del_light_source(), LS_OBJECT, monstermoves, OBJ_INVENT, update_inventory, obj::where, and xname().

| void do_storms | ( | ) |
References artifact_light(), BURN_OBJECT, del_light_source(), FALSE, LS_OBJECT, MAGIC_LAMP, OBJ_INVENT, stop_timer(), update_inventory, and xname().
Referenced by Armor_gone(), Armor_off(), burn_object(), bury_an_obj(), drop_upon_death(), light_cocktail(), monstone(), obj_merge_light_sources(), recharge(), resetobjs(), savebones(), setmnotwielded(), setuwep(), snuff_candle(), snuff_light_source(), snuff_lit(), update_mon_intrinsics(), use_candelabrum(), use_candle(), use_lamp(), and uwepgone().


| void fall_asleep | ( | int | how_long, |
| boolean | wakeup_msg | ||
| ) |
References flags, Hear_again(), monstermoves, multi, nomovemsg, nomul(), flag::soundok, stop_occupation(), u, you::usleep, and You_can_move_again.
Referenced by domove(), dotrap(), gazemu(), hitmu(), moveloop(), nh_timeout(), peffects(), zapyourself(), and zhitu().


| STATIC_DCL void FDECL | ( | see_lamp_flicker | , |
| (struct obj *, const char *) | |||
| ) |
| STATIC_DCL boolean FDECL | ( | timer_is_local | , |
| (timer_element *) | |||
| ) |
| STATIC_DCL int FDECL | ( | maybe_write_timer | , |
| (int, int, BOOLEAN_P) | |||
| ) |
| STATIC_DCL void FDECL | ( | cleanup_burn | , |
| (genericptr_t, long) | |||
| ) |
| STATIC_DCL void FDECL | ( | lantern_message | , |
| (struct obj *) | |||
| ) |
| STATIC_DCL void FDECL | ( | insert_timer | , |
| (timer_element *) | |||
| ) |
| STATIC_DCL timer_element* FDECL | ( | remove_timer | , |
| (timer_element **, SHORT_P, genericptr_t) | |||
| ) |
| STATIC_DCL void FDECL | ( | write_timer | , |
| (int, timer_element *) | |||
| ) |
| void hatch_egg | ( | genericptr_t | arg, |
| long | timeout | ||
| ) |
References a_monnam(), an(), attach_egg_hatch_timeout(), big_to_little(), BUFSZ, cansee, canseemon, carried, obj::corpsenm, monst::data, enexto(), FALSE, flag::female, flags, G_EXTINCT, G_GENOD, G_UNIQ, get_obj_location(), HATCH_EGG, is_pool(), learn_egg_type(), locomotion(), m_monnam(), makemon(), makeplural(), permonst::mlet, monst::mnum, mon, mons, monstermoves, monst::mtame, monst::mx, monst::my, newsym(), NO_MINVENT, NON_PM, obfree(), obj_extract_self(), OBJ_FLOOR, OBJ_INVENT, OBJ_MIGRATING, OBJ_MINVENT, pline(), obj::quan, rn2(), rnd(), S_DRAGON, s_suffix(), something, obj::spe, Sprintf, start_timer(), stop_timer(), Strcpy, tamedog(), obj::timed, TIMER_OBJECT, TRUE, useup(), obj::where, nhcoord::x, and nhcoord::y.

| STATIC_OVL void insert_timer | ( | timer_element * | gnu ) |
References fe::next.
Referenced by restore_timers(), and start_timer().

| void kill_egg | ( | struct obj * | egg ) |
References HATCH_EGG, and stop_timer().
Referenced by create_object(), kill_eggs(), poly_obj(), and readobjnam().


| STATIC_OVL void lantern_message | ( | struct obj * | obj ) |
References Hallucination, Monnam(), OBJ_FLOOR, OBJ_INVENT, OBJ_MINVENT, pline(), and s_suffix().
Referenced by burn_object().


| void learn_egg_type | ( | int | mnum ) |
References little_to_big(), monst::mnum, MV_KNOWS_EGG, mvitals::mvflags, and update_inventory.
Referenced by fully_identify_obj(), hatch_egg(), and polymon().


| STATIC_OVL int maybe_write_timer | ( | int | fd, |
| int | range, | ||
| boolean | write_it | ||
| ) |
References fe::next, RANGE_GLOBAL, timer_is_local(), and write_timer().
Referenced by save_timers().


References FALSE, migrating_mons, mydogs, monst::nmon, and TRUE.
Referenced by obj_is_local(), and timer_is_local().

| STATIC_DCL void NDECL | ( | slime_dialogue | ) |
| STATIC_DCL void NDECL | ( | vomiting_dialogue | ) |
| STATIC_DCL void NDECL | ( | choke_dialogue | ) |
| STATIC_DCL void NDECL | ( | slip_or_trip | ) |
| STATIC_DCL void NDECL | ( | stoned_dialogue | ) |
| void nh_timeout | ( | ) |
References BInvis, Blind, Blinded, BLINDED, carrying(), choke_dialogue(), CONFUSION, monst::data, delayed_killer, DETECT_MONSTERS, DIED, done(), fall_asleep(), FALSE, Fast, FAST, find_ac(), flags, float_down(), flag::friday13, FROMOUTSIDE, FULL_MOON, Fumbling, FUMBLING, G_UNIQ, HALLUC, hcolor(), HConfusion, heal_legs(), HFumbling, HHallucination, HSleeping, HStun, I_SPECIAL, prop::intrinsic, inv_weight(), Invis, INVIS, KILLED_BY, KILLED_BY_AN, killer, killer_format, Levitation, LEVITATION, LOW_PM, LUCKSTONE, make_blinded(), make_confused(), make_hallucinated(), make_stunned(), make_vomiting(), permonst::mlevel, Monnam(), mons, flag::moonphase, moves, you::mtimedone, name_to_mon(), newsym(), NH_GOLDEN, NO_KILLER_PREFIX, nomovemsg, nomul(), pline(), POISONING, rehumanize(), rnd(), run_timers(), SEE_INVIS, See_invisible, see_monsters(), set_mimic_blocking(), SICK, SIZE, Sleep_resistance, Sleeping, SLEEPING, slime_dialogue(), SLIMED, Slimed, slip_or_trip(), stone_luck(), STONED, Stoned, stoned_dialogue(), STONING, stop_occupation(), STRANGLED, Strangled, Strcpy, STUNNED, the(), TIMEOUT, TRUE, TURNED_SLIME, type_is_pname, u, you::ucreamed, you::ugangr, you::uhave, you::uluck, you::umoved, Unchanging, unconscious(), you::uprops, you::usick_cause, you::uspellprot, you::uspmtime, you::usptime, you::ux, you::uy, Very_fast, VOMITING, Vomiting, vomiting_dialogue(), wake_nearby(), WOUNDED_LEGS, and youmonst.
Referenced by moveloop().


References FALSE, mon_is_local(), OBJ_BURIED, OBJ_CONTAINED, OBJ_FLOOR, OBJ_INVENT, OBJ_MIGRATING, OBJ_MINVENT, and TRUE.
Referenced by maybe_write_ls(), save_light_sources(), and timer_is_local().


References fe::arg, fe::kind, fe::next, and TIMER_OBJECT.
Referenced by realloc_obj().

References fe::arg, fe::func_index, fe::kind, monstermoves, fe::next, start_timer(), fe::timeout, and TIMER_OBJECT.
Referenced by splitobj().


| void obj_stop_timers | ( | struct obj * | obj ) |
References fe::arg, ttable::cleanup, fe::func_index, fe::kind, fe::next, fe::timeout, and TIMER_OBJECT.
Referenced by add_to_billobjs(), dealloc_obj(), food_disappears(), hmon_hitmon(), merged(), mkcorpstat(), readobjnam(), and tt_oname().

| void relink_timers | ( | boolean | ghostly ) |
References fe::arg, find_oid(), fe::kind, lookup_id_mapping(), fe::next, TIMER_MONSTER, and TIMER_OBJECT.
Referenced by getlev(), and restgamestate().


| STATIC_OVL timer_element* remove_timer | ( | timer_element ** | base, |
| short | func_index, | ||
| genericptr_t | arg | ||
| ) |
| void restore_timers | ( | int | fd, |
| int | range, | ||
| boolean | ghostly, | ||
| long | adjust | ||
| ) |
References insert_timer(), mread(), and RANGE_GLOBAL.
Referenced by getlev(), and restgamestate().


| void run_timers | ( | ) |
References fe::arg, ttable::f, fe::func_index, fe::kind, monstermoves, fe::next, obj::timed, fe::timeout, timer_base, and TIMER_OBJECT.
Referenced by dorecover(), goto_level(), and nh_timeout().

| void save_timers | ( | int | fd, |
| int | mode, | ||
| int | range | ||
| ) |
References bwrite(), FALSE, maybe_write_timer(), fe::next, perform_bwrite, RANGE_GLOBAL, RANGE_LEVEL, release_data, timer_is_local(), and TRUE.
Referenced by savegamestate(), and savelev().


| STATIC_OVL void see_lamp_flicker | ( | struct obj * | obj, |
| const char * | tailer | ||
| ) |
References an(), OBJ_FLOOR, OBJ_INVENT, OBJ_MINVENT, pline(), xname(), and Yname2().
Referenced by burn_object().


| STATIC_OVL void slime_dialogue | ( | ) |
References A_DEX, an(), Blind, exercise(), FALSE, Hallucination, hcolor(), HFast, index, multi, NH_GREEN, nomul(), pline(), rndmonnam(), SIZE, Slimed, stop_occupation(), and TIMEOUT.
Referenced by nh_timeout().


| STATIC_OVL void slip_or_trip | ( | ) |
References ARTICLE_NONE, ARTICLE_THE, Blind, body_part(), BUFSZ, doname(), FALSE, FOOT, Hallucination, highc(), is_ice(), is_pool(), makeplural(), otmp, pline(), obj::quan, rn2(), ROCK, sobj_at(), something, STEED, SUPPRESS_SADDLE, TRUE, u, upstart(), you::ux, you::uy, vobj_at, what, and x_monnam().
Referenced by nh_timeout().


| boolean start_timer | ( | long | when, |
| short | kind, | ||
| short | func_index, | ||
| genericptr_t | arg | ||
| ) |
References fe::arg, fe::func_index, insert_timer(), fe::kind, monstermoves, fe::next, NUM_TIME_FUNCS, fe::tid, fe::timeout, TIMER_OBJECT, and TRUE.
Referenced by attach_egg_hatch_timeout(), attach_fig_transform_timeout(), begin_burn(), bury_an_obj(), fig_transform(), hatch_egg(), obj_split_timers(), obj_timer_checks(), revive_mon(), and start_corpse_timeout().


| STATIC_OVL void stoned_dialogue | ( | ) |
References A_DEX, exercise(), FALSE, HFast, nomul(), pline(), SIZE, Stoned, and TIMEOUT.
Referenced by nh_timeout().


| long stop_timer | ( | short | func_index, |
| genericptr_t | arg | ||
| ) |
References ttable::cleanup, fe::func_index, fe::kind, remove_timer(), fe::timeout, and TIMER_OBJECT.
Referenced by attach_egg_hatch_timeout(), attach_fig_transform_timeout(), bless(), end_burn(), freeinv_core(), hatch_egg(), in_container(), kill_egg(), mkbox_cnts(), obj_timer_checks(), uncurse(), unearth_objs(), and use_figurine().


| STATIC_OVL boolean timer_is_local | ( | timer_element * | timer ) |
References FALSE, mon_is_local(), obj_is_local(), TIMER_GLOBAL, TIMER_LEVEL, TIMER_MONSTER, TIMER_OBJECT, and TRUE.
Referenced by maybe_write_timer(), and save_timers().


| STATIC_OVL void vomiting_dialogue | ( | ) |
References A_CON, d(), exercise(), FALSE, HConfusion, HStun, make_confused(), make_stunned(), morehungry(), SIZE, TIMEOUT, vomit(), and Vomiting.
Referenced by nh_timeout().


| STATIC_OVL void write_timer | ( | int | fd, |
| timer_element * | timer | ||
| ) |
References bwrite(), fe::kind, obj::o_id, TIMER_GLOBAL, TIMER_LEVEL, TIMER_MONSTER, and TIMER_OBJECT.
Referenced by maybe_write_timer().


NEARDATA const char* const choke_texts[] [static] |
{
"You find it hard to breathe.",
"You're gasping for air.",
"You can no longer breathe.",
"You're turning %s.",
"You suffocate."
}
NEARDATA const char* const choke_texts2[] [static] |
{
"Your %s is becoming constricted.",
"Your blood is having trouble reaching your brain.",
"The pressure on your %s increases.",
"Your consciousness is fading.",
"You suffocate."
}
NEARDATA const char* const slime_texts[] [static] |
{
"You are turning a little %s.",
"Your limbs are getting oozy.",
"Your skin begins to peel away.",
"You are turning into %s.",
"You have become %s."
}
NEARDATA const char* const stoned_texts[] [static] |
{
"You are slowing down.",
"Your limbs are stiffening.",
"Your limbs have turned to stone.",
"You have turned to stone.",
"You are a statue."
}
const ttable timeout_funcs[NUM_TIME_FUNCS] [static] |
{
TTAB(rot_organic, (timeout_proc)0, "rot_organic"),
TTAB(rot_corpse, (timeout_proc)0, "rot_corpse"),
TTAB(revive_mon, (timeout_proc)0, "revive_mon"),
TTAB(burn_object, cleanup_burn, "burn_object"),
TTAB(hatch_egg, (timeout_proc)0, "hatch_egg"),
}
timer_element* timer_base [static] |
Referenced by run_timers().
unsigned long timer_id = 1 [static] |
NEARDATA const char* const vomiting_texts[] [static] |
{
"are feeling mildly nauseated.",
"feel slightly confused.",
"can't seem to think straight.",
"feel incredibly sick.",
"suddenly vomit!"
}
1.7.2