Data Structures | Defines | Functions | Variables

end.c File Reference

#include "hack.h"
#include "eshk.h"
#include <signal.h>
#include "dlb.h"
Include dependency graph for end.c:

Data Structures

struct  valuable_data
struct  val_list

Defines

#define NEED_VARARGS
#define FIRST_GEM   DILITHIUM_CRYSTAL
#define FIRST_AMULET   AMULET_OF_ESP
#define LAST_AMULET   AMULET_OF_YENDOR
#define nethack_exit   exit
#define done_stopprint   program_state.stopprint
#define NH_abort()   abort()
#define DUMP_DATE_FORMAT   "%Y-%m-%d %H:%M:%S"

Functions

STATIC_PTR void FDECL (done_intr,(int))
STATIC_DCL void FDECL (disclose,(int, BOOLEAN_P))
STATIC_DCL void FDECL (get_valuables,(struct obj *))
STATIC_DCL void FDECL (sort_valuables,(struct valuable_data *, int))
STATIC_DCL void FDECL (artifact_score,(struct obj *, BOOLEAN_P, winid))
STATIC_DCL void FDECL (savelife,(int))
void FDECL (list_vanquished,(CHAR_P, BOOLEAN_P))
STATIC_DCL void FDECL (list_genocided,(int, BOOLEAN_P, BOOLEAN_P))
STATIC_DCL boolean FDECL (should_query_disclose_option,(int, char *))
void done1 (int sig_unused)
int done2 ()
STATIC_PTR void done_intr (int sig_unused)
void done_in_by (struct monst *mtmp)
void panic VA_DECL (const char *, VA_INIT(str)
 raw_print (program_state.gameover?"Postgame wrapup disrupted.":!program_state.something_worth_saving?"Program initialization has failed.":"Suddenly, the dungeon collapses.")
 done (PANICKED)
STATIC_OVL boolean should_query_disclose_option (int category, char *defquery)
STATIC_OVL void disclose (int how, boolean taken)
STATIC_OVL void savelife (int how)
STATIC_OVL void get_valuables (struct obj *list)
STATIC_OVL void sort_valuables (list, int size)
STATIC_OVL void artifact_score (struct obj *list, boolean counting, winid endwin)
void done (int how)
 if (!done_stopprint) putstr(endwin
 dump_line ("", pbuf)
 Sprintf (pbuf,"Killer: %s", killer)
 Sprintf (pbuf,"You were level %d with a maximum of %d hit point%s when you %s.", u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how])
 dump_blockquote_end ()
 if (endwin!=WIN_ERR)
void container_contents (struct obj *list, boolean identified, boolean all_containers, boolean want_disp)
void terminate (int status)
void list_vanquished (char defquery, boolean ask)
int num_genocides ()
STATIC_OVL void list_genocided (int defquery, boolean ask, boolean want_disp)

Variables

static struct valuable_data gems [LAST_GEM+1-FIRST_GEM+1]
static struct valuable_data amulets [LAST_AMULET+1-FIRST_AMULET]
static struct val_list valuables []
static NEARDATA const char * deaths []
static NEARDATA const char * ends []
const char *const killed_by_prefix []
 pbuf
 TRUE

Define Documentation

#define done_stopprint   program_state.stopprint
#define DUMP_DATE_FORMAT   "%Y-%m-%d %H:%M:%S"

Referenced by done().

#define FIRST_AMULET   AMULET_OF_ESP

Referenced by get_valuables().

#define FIRST_GEM   DILITHIUM_CRYSTAL

Referenced by get_valuables().

#define LAST_AMULET   AMULET_OF_YENDOR
#define NEED_VARARGS
#define nethack_exit   exit

Referenced by terminate().

#define NH_abort (  )    abort()

Referenced by done2().


Function Documentation

STATIC_OVL void artifact_score ( struct obj list,
boolean  counting,
winid  endwin 
)
void container_contents ( struct obj list,
boolean  identified,
boolean  all_containers,
boolean  want_disp 
)
STATIC_OVL void disclose ( int  how,
boolean  taken 
)
done ( PANICKED   )
void done ( int  how )

References A_CON, Race::adj, Gender::adj, Align::adj, adjattrib(), aligns, AMULET_OF_LIFE_SAVING, an(), artifact_score(), ASCENDED, ASTRAL_ESCAPE, Blind, BUFSZ, BURNING, can_make_bones(), carrying(), check_tutorial_message(), CHOKING, clearlocks(), clearpriests(), CORPSE, valuable_data::count, create_nhwindow, currency(), deepest_lev_reached(), DEFIED, depth(), destroy_nhwindow, DIED, disclose(), discover, DISINTEGRATED, display_nhwindow, d_level::dlevel, dungeon::dname, d_level::dnum, done_intr(), done_stopprint, dump(), dump_blockquote_end(), dump_blockquote_start(), DUMP_DATE_FORMAT, dump_header_html(), dump_html(), dump_line(), dump_title(), DUMPMSGS, dungeons, dunlev(), flag::end_disclose, eos(), ESCAPED, RoleName::f, FAKE_AMULET_OF_YENDOR, FALSE, flag::female, Race::femalenum, finish_paybill(), flags, G_NOCORPSE, sinfo::gameover, GEM_CLASS, genders, GENOCIDED, get_formatted_time(), get_valuables(), Goodbye(), hidden_gold(), iflags, In_endgame, In_quest(), IN_SIGHT, inven_inuse(), invent, Is_astralevel, Is_knox, is_playermon_genocided(), iso8601_duration(), keepdogs(), KILLED_BY, KILLED_BY_AN, killer, killer_format, LAST_GEM, Lifesaved, val_list::list, LOW_PM, RoleName::m, make_grave(), makeknown, Race::malenum, MAX_SURVIVABLE_DEATH, monst::mhp, mk_named_object(), mksobj(), mon_nam(), mons, moves, monst::mtame, mvitals::mvflags, mydogs, Role::name, NHW_TEXT, monst::nmon, NO_KILLER_PREFIX, NON_PM, obfree(), objects, objclass::oc_cost, obj::onamelth, otmp, obj::otyp, outrip, PANICKED, paniclog(), instance_flags::paranoid_quit, paranoid_yn(), paybill(), paygd(), pbuf, pline(), plname, plur, PM_GREEN_SLIME, program_state, putstr, QT_T_DEATH, obj::quan, QUIT, rn2(), savebones(), savelife(), SIG_RET_TYPE, val_list::size, sinfo::something_worth_saving, sort_valuables(), Sprintf, STARVING, STONING, Strcat, Strcpy, surface(), time(), flag::tombstone, TRICKED, TRUE, TURNED_SLIME, valuable_data::typ, align::type, u, you::ualign, uamul, you::ubirthday, you::udeathday, you::ugold, you::ugold0, you::ugrave_arise, you::uhave, you::uhp, you::uhpmax, you::ulevel, you::umonnum, you::umortality, Upolyd, urace, urole, you::urscore, useup(), you::ux, you::uy, you::uz, valuables, instance_flags::vision_inited, viz_array, wait_synch, where, WIN_ERR, WIN_MAP, WIN_MESSAGE, WIN_STATUS, instance_flags::window_inited, WIZARD, wizard, xname(), and yn.

Here is the call graph for this function:

void done1 ( int  sig_unused )

References clear_nhwindow, curs_on_u(), done2(), flags, flag::ignintr, multi, nomul(), SIG_RET_TYPE, wait_synch, and WIN_MESSAGE.

Referenced by done2(), and newgame().

Here is the call graph for this function:

Here is the caller graph for this function:

int done2 (  )

References clear_nhwindow, curs_on_u(), done(), done1(), done_stopprint, exit_nhwindows, FALSE, iflags, killer, multi, NH_abort, nomul(), instance_flags::paranoid_quit, paranoid_yn(), QUIT, SIG_RET_TYPE, u, you::usleep, wait_synch, WIN_MESSAGE, wizard, and ynq.

Referenced by done1().

Here is the call graph for this function:

Here is the caller graph for this function:

void done_in_by ( struct monst mtmp )
STATIC_PTR void done_intr ( int  sig_unused )

References done_stopprint.

Referenced by done().

Here is the caller graph for this function:

dump_blockquote_end (  )

Ends a blockquote in the dump.

References dump_html(), and dump_text().

Referenced by done().

Here is the call graph for this function:

Here is the caller graph for this function:

dump_line ( ""  ,
pbuf   
)
STATIC_DCL void FDECL ( sort_valuables  ,
(struct valuable_data *, int)   
)
STATIC_PTR void FDECL ( done_intr  ,
(int)   
)
STATIC_DCL void FDECL ( list_genocided  ,
(int, BOOLEAN_P, BOOLEAN_P)   
)
STATIC_DCL boolean FDECL ( should_query_disclose_option  ,
(int, char *)   
)
STATIC_DCL void FDECL ( artifact_score  ,
(struct obj *, BOOLEAN_P, winid  
)
STATIC_DCL void FDECL ( disclose  ,
(int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( savelife  ,
(int)   
)
STATIC_DCL void FDECL ( get_valuables  ,
(struct obj *)   
)
void FDECL ( list_vanquished  ,
(CHAR_P, BOOLEAN_P)   
)
STATIC_OVL void get_valuables ( struct obj list )
if ( endwin!  = WIN_ERR )
if ( done_stopprint )
STATIC_OVL void list_genocided ( int  defquery,
boolean  ask,
boolean  want_disp 
)
void list_vanquished ( char  defquery,
boolean  ask 
)

Referenced by disclose().

Here is the caller graph for this function:

int num_genocides (  )

References G_GENOD, LOW_PM, and NUMMONS.

Referenced by list_genocided(), show_conduct(), and successful_cdt().

Here is the caller graph for this function:

raw_print ( program_state.gameover?"Postgame wrapup disrupted.":!program_state.something_worth_saving?"Program initialization has failed.":"  Suddenly,
the dungeon collapses."   
)

Referenced by if(), lock_file(), prscore(), topten(), topten_print(), and VA_DECL().

Here is the caller graph for this function:

STATIC_OVL void savelife ( int  how )

References flag::botl, CHOKING, curs_on_u(), FALSE, flags, HUnchanging, init_uhunger(), flag::move, multi, newuhs(), nomovemsg, NON_PM, Sick, TIMEOUT, TT_LAVA, u, you::ugrave_arise, you::uhp, you::uhpmax, you::uhunger, you::uswldtim, you::utrap, and you::utraptype.

Referenced by done().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean should_query_disclose_option ( int  category,
char *  defquery 
)
STATIC_OVL void sort_valuables ( list  ,
int  size 
)

References valuable_data::count.

Referenced by done().

Here is the caller graph for this function:

Sprintf ( pbuf  ,
"You were level %d with a maximum of %d hit point%s when you %s."  ,
u.  ulevel,
u.  uhpmax,
plur(u.uhpmax)  ,
ends  [how] 
)
Sprintf ( pbuf  ,
"Killer: %s"  ,
killer   
)
void terminate ( int  status )

References dlb_cleanup, freedynamicdata(), nethack_exit, sinfo::panicking, and program_state.

Referenced by bwrite(), choose_windows(), dosave(), Fread(), and restlevelfile().

Here is the call graph for this function:

Here is the caller graph for this function:

void warning VA_DECL ( const char *  ,
VA_INIT(  str 
)

References exit_nhwindows, iflags, raw_print(), wait_synch, and instance_flags::window_inited.

Here is the call graph for this function:


Variable Documentation

struct valuable_data amulets[LAST_AMULET+1-FIRST_AMULET]

Referenced by get_valuables().

NEARDATA const char* deaths[] [static]
Initial value:
 {              
        "died", "choked", "poisoned", "starvation", "drowning",
        "burning", "dissolving under the heat and pressure",
        "crushed", "turned to stone", "turned into slime",
        "genocided", 



        "panic", "trickery",



}
NEARDATA const char* ends[] [static]
Initial value:
 {              
        "died", "choked", "were poisoned", "starved", "drowned",
        "burned", "dissolved in the lava",
        "were crushed", "turned to stone", "turned into slime",
        "were genocided", 



        "panicked", "were tricked",



}
struct valuable_data gems[LAST_GEM+1-FIRST_GEM+1] [static]

Referenced by get_valuables().

const char* const killed_by_prefix[]

Referenced by able_to_loot(), abuse_dog(), add_branch(), add_room(), adjattrib(), alchemy_init(), allow_all(), allow_category(), angry_guards(), angry_shk_exists(), animate_statue(), arti_invoke(), arti_reflects(), arti_speak(), artifact_hit(), artitouch(), assigninvlet(), at_dgn_entrance(), attack(), attack_checks(), attacktype(), autopick(), awaken_monsters(), b_trapped(), backfire(), bagotricks(), begin_burn(), bhit(), bhitm(), bhito(), bhitpile(), bill_dummy_object(), bite(), bite_monster(), Blindf_off(), Blindf_on(), block_door(), block_entry(), blocked_boulder(), Boots_off(), Boots_on(), boulder_hits_pool(), bound_digging(), break_statue(), breakobj(), bufon(), burn_object(), burnarmor(), bury_an_obj(), bydoor(), bypass_obj(), can_blnd(), can_carry(), can_make_bones(), can_ooze(), can_pray(), can_reach_location(), can_track(), can_twoweapon(), cancel_monst(), canletgo(), cant_create(), carry_obj_effects(), cast_cleric_spell(), catch_lit(), chat_with_leader(), check_map_spot(), check_room(), check_tutorial_command(), check_tutorial_farlook(), check_tutorial_location(), check_tutorial_message(), check_unpaid_usage(), check_version(), checkfile(), chest_trap(), choose_classes_menu(), chwepon(), clear_fcorr(), clear_stale_map(), clonewiz(), close_drawbridge(), cnv_trap_obj(), common_prefix_options_parser(), confers_luck(), confused_book(), consume_offering(), container_contents(), container_impact_dmg(), corpse_chance(), could_reach_item(), count_buc(), count_categories(), coyotename(), cpostfx(), cprefx(), create_altar(), create_critters(), create_drawbridge(), create_gas_cloud(), create_object(), create_room(), create_subroom(), curse(), cursed(), cursed_book(), cursed_object_at(), cutoff(), damageum(), deadbook(), delfloortrap(), deliver_by_window(), demonpet(), destroy_drawbridge(), dev_name(), dig(), dig_check(), dig_corridor(), digactualhole(), dighole(), dip(), dipfountain(), disarm_squeaky_board(), disclose(), discover_object(), diseasemu(), display_inventory(), display_pickinv(), distant_monnam(), distfleeck(), djinni_from_bottle(), dmgtype(), do_break_wand(), do_class_genocide(), do_earthquake(), do_entity(), do_flood(), do_improvisation(), do_look(), do_mapping(), do_osshock(), do_play_instrument(), do_vicinity_map(), doapply(), doattributes(), docall(), doclose(), doconduct(), doconsult(), dodiscovered(), dodown(), dodrink(), doeat(), doengrave_elbereth(), doextversion(), dofindgem(), dofiretrap(), dog_hunger(), dog_invent(), dog_move(), dohelp(), dohistory(), dokick(), doloot(), domonability(), domove(), doname_base(), doname_with_price(), done(), done_eating(), doorlock(), dooverview(), dopay(), dopotion(), dopray(), doputon(), doquickwhatis(), doread(), dorecover(), dorub(), dosacrifice(), dosave(), dosdoor(), dosearch0(), dosit(), dosounds(), dospellmenu(), dospinweb(), dospit(), dosummon(), dotele(), dotrap(), dotravel(), doturn(), dotypeinv(), dounpaid(), doup(), dowear(), dowrite(), dozap(), drag_ball(), drain_item(), drinkfountain(), drop(), drop_ball(), drop_boulder_on_monster(), drop_upon_death(), dropy(), drown(), dump_weapon_skill(), duplicate_opt_detection(), e_jumps(), e_missed(), e_survives_at(), eatcorpse(), eatfood(), eatspecial(), emergency_disrobe(), enexto_core_range(), engrave(), enhance_skill(), enlightenment(), enter_explore_mode(), epathto(), erode_obj(), exerper(), expels(), expire_gas_cloud(), explode(), fall_through(), feature_alert_opts(), fig_transform(), figurine_location_checks(), fill_empty_maze(), fill_room(), fill_zoo(), final_level(), find_defensive(), find_drawbridge(), find_misc(), find_trap(), findtravelpath(), finish_map(), finish_quest(), fix_attributes_and_properties(), fix_worst_trouble(), fixup_special(), flash_hits_mon(), float_down(), float_up(), flooreffects(), floorfood(), food_detect(), forcelock(), forget_map(), fpostfx(), fprefx(), free_dungeons(), fruitadd(), gainstr(), gazemu(), gd_move(), gem_accept(), get_mon_location(), get_obj_location(), get_uchars(), get_wet(), getbones(), gethungry(), getobj(), getpos(), getpos_help(), getspell(), ggetobj(), ghitm(), Gloves_off(), gold_detect(), goodpos(), goto_level(), grddead(), gulpmu(), gulpum(), gush(), has_dnstairs(), has_upstairs(), hatch_egg(), have_lizard(), healup(), help_dir(), help_menu(), help_monster_out(), hero_breaks(), hitfloor(), hitmu(), hits_bars(), hitum(), hmon_hitmon(), home_shk(), hurtarmor(), hurtle_step(), hurtmarmor(), impact_drop(), in_container(), in_fcorridor(), in_out_region(), in_town(), inherits(), ini_inv(), init_dungeons(), initoptions(), inside_gas_cloud(), inside_region(), intended_cdt(), intersect(), intrinsic_possible(), is_chargeable(), is_digging(), is_edible(), is_ice(), is_lava(), is_ok_location(), is_pool(), is_swallow_sym(), is_undirected_spell(), is_wc2_option(), is_wc_option(), isclearpath(), iswall_or_stone(), its_dead(), itsstuck(), join_map(), jump(), keepdogs(), kick_monster(), kick_object(), kickdmg(), kill_eggs(), known_hitum(), knows_object(), l_monnam(), launch_obj(), lava_effects(), leader_speaks(), learn(), lesshungry(), level_tele(), levl_follower(), light_cocktail(), linedup(), list_genocided(), load_special(), lock_file(), look_here(), lookup_id_mapping(), loot_mon(), losedogs(), losehp_how(), losestr(), m_dowear_type(), m_in_out_region(), m_initinv(), m_initthrow(), m_initweap(), m_move(), m_slips_free(), m_throw(), make_confused(), make_corpse(), make_engr_at(), make_hallucinated(), make_happy_shk(), make_sick(), make_stunned(), makecorridors(), makedog(), makelevel(), makemaz(), makemon(), makeniche(), makerooms(), maketrap(), makewish(), mattacku(), maybe_cannibal(), maybe_finished_meal(), Mb_hit(), mb_trapped(), mbag_explodes(), mbag_item_gone(), mbhitm(), mdamagem(), mdamageu(), mdig_tunnel(), mdrop_obj(), meatmetal(), melt_ice(), menu_drop(), menu_loot(), menu_remarm(), mergable(), mfndpos(), mhurtle_step(), migrate_to_level(), mineralize(), minstapetrify(), mintrap(), mk_artifact(), mk_bubble(), mk_knox_portal(), mk_mplayer(), mk_roamer(), mk_split_room(), mkbox_cnts(), mkcavearea(), mkcavepos(), mkgarden(), mkgold(), mkgrave(), mkinvokearea(), mkinvpos(), mklev(), mkmap(), mkobj(), mkpoolroom(), mkroll_launch(), mkshobj_at(), mksobj(), mktemple(), mkundead(), mnearto(), mon_adjust_speed(), mon_arrive(), mon_beside(), mon_in_region(), mon_is_local(), mon_reflects(), monflee(), mongets(), monster_detect(), monstinroom(), monstone(), montraits(), morehungry(), move_into_trap(), moveloop(), movemon(), moverock(), mpickobj(), mpickstuff(), mrustm(), mungspaces(), munstone(), mv_bubble(), nameshk(), nemdead(), nemesis_speaks(), newcham(), newexplevel(), newgame(), newsym(), newuhs(), next_to_u(), nexttodoor(), nh_timeout(), not_fully_identified(), obfree(), obj_here(), obj_is_local(), obj_merge_light_sources(), obj_resists(), obj_timer_checks(), object_detect(), obstructed(), ok_align(), ok_gend(), ok_race(), ok_role(), okay(), on_locate(), on_start(), oname(), onlyspace(), open_drawbridge(), openit(), opentin(), out_container(), outentry(), outoracle(), outrumor(), pacify_shk(), parse(), parse_config_line(), parse_monster_color(), parseoptions(), passive(), passive_obj(), passiveum(), pay_for_damage(), peace_minded(), peffects(), pick_animal(), pick_obj(), picking_lock(), picklock(), pickup(), pickup_object(), place_branch(), place_level(), place_lregion(), pleased(), pmatch(), poly_obj(), polyman(), polymon(), possible_places(), potionbreathe(), potionhit(), prayer_done(), pri_move(), price_quote(), priest_talk(), prinv(), propagate(), prscore(), punish(), put_lregion_here(), query_category(), query_classes(), query_objlist(), random_engraving(), ranged_attk(), read_config_file(), readobjnam(), ready_weapon(), recharge(), relobj(), remove_boundary_syms(), remove_damage(), remove_worn_item(), reorder_invent(), repair_damage(), reset_eat(), resetobjs(), resists_blnd(), resists_magm(), restdamage(), restgamestate(), restmonchn(), restore_waterlevel(), restrap(), restricted_spell_discipline(), resurrect(), revive(), revive_corpse(), revive_egg(), rhack(), rile_shk(), Ring_gone(), rloc(), rloc_pos_ok(), rm_waslit(), rnd_treefruit_at(), rndcurse(), rob_shop(), role_init(), root_plselection_prompt(), rust_dmg(), safe_teleds(), saleable(), same_price(), save_light_sources(), save_timers(), savebones(), scatter(), search_door(), searches_for_item(), seffects(), select_off(), sellobj(), set_artifact_intrinsic(), set_cost(), set_moreluck(), setuwep(), shade_aware(), ship_object(), shk_has_leather_jackets(), shk_names_obj(), shkcatch(), shkgone(), shkinit(), should_query_disclose_option(), show_conduct(), shrink_worm(), shuffle_all(), simple_look(), singular(), slip_or_trip(), snuff_candle(), snuff_lit(), somexy(), sp_level_coder(), sp_level_free(), sp_level_loader(), special_handling(), spell_would_be_useless(), spelleffects(), spill_terrain(), spitmu(), spo_end_moninvent(), spo_level_flags(), spo_region(), spo_room(), spoteffects(), start_eating(), start_engulf(), start_timer(), steal(), steal_it(), stealamulet(), still_chewing(), stock_room(), stop_occupation(), study_book(), successful_cdt(), summon_minion(), superfluous_cdt(), switch_graphics(), tactics(), tamedog(), tele(), tele_jump_ok(), tele_restrict(), teleds(), teleok(), teleport_pet(), test_move(), the(), the_unique_obj(), thitm(), thitmonst(), throw_obj(), throwit(), throwspell(), thrwmu(), timer_is_local(), tool_in_use(), topologize(), topten(), toss_up(), trap_detect(), u_entered_shop(), u_init(), u_slip_free(), u_teleport_mon(), ugolemeffects(), uhave_graystone(), uncommon(), uncompress(), under_ground(), under_water(), undiscover_object(), undiscovered_artifact(), unpaid_cost(), untrap(), unturn_dead(), update_mon_intrinsics(), uptodate(), ureflects(), urustm(), use_bell(), use_candelabrum(), use_candle(), use_container(), use_cream_pie(), use_crystal_ball(), use_defensive(), use_grapple(), use_grease(), use_lamp(), use_leash(), use_mirror(), use_misc(), use_offensive(), use_pick_axe2(), use_pole(), use_stone(), use_tinning_kit(), use_towel(), use_trap(), use_whip(), uwepgone(), violated(), vision_reset(), vomit(), walk_path(), wallify_vault(), wand_explode(), wary_dog(), watch_dig(), water_friction(), water_prayer(), wc2_supported(), wc_supported(), weffects(), welded(), wield_tool(), will_feel_cockatrice(), wipeoff(), wishymatch(), wizdead(), worm_known(), wormgone(), wrong_elem_type(), x_monnam(), xkilled(), xname(), you_aggravate(), zap_dig(), zap_over_floor(), zap_updown(), zapnodir(), zapyourself(), zhitm(), and zhitu().

struct val_list valuables[] [static]

Referenced by done().