From 14f96d4f59e4c91915bb15d2f4ca845e6e2e459e Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 12 Jun 2008 09:03:37 +0000 Subject: Remove unneeded methods (including the old resistance screen), rename debugging functions, and some other clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5757 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/Kills.cc | 52 ++++----- crawl-ref/source/acr.cc | 41 ++++--- crawl-ref/source/beam.cc | 10 +- crawl-ref/source/branch.cc | 3 +- crawl-ref/source/branch.h | 13 ++- crawl-ref/source/chardump.cc | 20 ---- crawl-ref/source/chardump.h | 1 - crawl-ref/source/cloud.h | 7 +- crawl-ref/source/command.cc | 4 +- crawl-ref/source/command.h | 29 +---- crawl-ref/source/database.h | 2 +- crawl-ref/source/debug.cc | 139 ++++++++-------------- crawl-ref/source/debug.h | 123 +++++++------------- crawl-ref/source/delay.cc | 20 ++-- crawl-ref/source/delay.h | 3 - crawl-ref/source/describe.cc | 11 +- crawl-ref/source/describe.h | 17 ++- crawl-ref/source/directn.cc | 4 +- crawl-ref/source/directn.h | 4 +- crawl-ref/source/dungeon.cc | 49 +++----- crawl-ref/source/dungeon.h | 3 +- crawl-ref/source/monstuff.cc | 2 +- crawl-ref/source/output.cc | 271 ------------------------------------------- crawl-ref/source/output.h | 2 - 24 files changed, 202 insertions(+), 628 deletions(-) diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc index 7831568323..64b175fb4a 100644 --- a/crawl-ref/source/Kills.cc +++ b/crawl-ref/source/Kills.cc @@ -31,9 +31,9 @@ static void kill_lua_filltable(std::vector &v); /////////////////////////////////////////////////////////////////////////// // KillMaster -// +// -const char *kill_category_names[] = +const char *kill_category_names[] = { "you", "collateral kills", @@ -82,7 +82,7 @@ void KillMaster::load(reader& inf) { unsigned char major = unmarshallByte(inf), minor = unmarshallByte(inf); - if (major != KILLS_MAJOR_VERSION || + if (major != KILLS_MAJOR_VERSION || (minor != KILLS_MINOR_VERSION && minor > 0)) { return; @@ -98,7 +98,7 @@ void KillMaster::load(reader& inf) void KillMaster::record_kill(const monsters *mon, int killer, bool ispet) { - const kill_category kc = + const kill_category kc = YOU_KILL(killer)? KC_YOU : ispet? KC_FRIENDLY : KC_OTHER; @@ -111,7 +111,7 @@ std::string KillMaster::kill_info() const return (""); std::string killtext; - + bool needseparator = false; int categories = 0; long grandtotal = 0L; @@ -122,7 +122,7 @@ std::string KillMaster::kill_info() const int targ = Options.kill_map[i]; catkills[targ].merge( categorized_kills[i] ); } - + for (int i = KC_YOU; i < KC_NCATEGORIES; ++i) { if (catkills[i].empty()) @@ -133,8 +133,8 @@ std::string KillMaster::kill_info() const long count = catkills[i].get_kills(kills); grandtotal += count; - add_kill_info( killtext, - kills, + add_kill_info( killtext, + kills, count, i == KC_YOU? NULL : category_name((kill_category) i), @@ -192,7 +192,7 @@ void KillMaster::add_kill_info(std::string &killtext, lua_pushboolean(clua, separator); - unwind_var lthrottle(clua.throttle_unit_lines, 500000); + unwind_var lthrottle(clua.throttle_unit_lines, 500000); if (!clua.callfn("c_kill_list", 3, 0)) #endif { @@ -219,7 +219,7 @@ void KillMaster::add_kill_info(std::string &killtext, } { char numbuf[100]; - snprintf(numbuf, sizeof numbuf, + snprintf(numbuf, sizeof numbuf, "%ld creature%s vanquished." "\n", count, count > 1? "s" : ""); killtext += numbuf; @@ -307,7 +307,7 @@ void Kills::save(writer& outf) const // How many ghosts do we have? marshallShort(outf, ghosts.size()); - for (ghost_vec::const_iterator iter = ghosts.begin(); + for (ghost_vec::const_iterator iter = ghosts.begin(); iter != ghosts.end(); ++iter) { iter->save(outf); @@ -359,10 +359,10 @@ std::string apostrophise(const std::string &name) // For monster names ending with these suffixes, we pluralise directly without // attempting to use the "of" rule. For instance: -// +// // moth of wrath => moths of wrath but // moth of wrath zombie => moth of wrath zombies. -// +// // This is not necessary right now, since there are currently no monsters that // require this special treatment (no monster with 'of' in its name is eligible // for zombies or skeletons). @@ -462,7 +462,7 @@ std::string kill_def::base_name(const kill_monster_desc &md) const name = "spectral " + name; break; default: - // Silence compiler warning about not handling M_NORMAL and + // Silence compiler warning about not handling M_NORMAL and // M_SHAPESHIFTER break; } @@ -509,14 +509,14 @@ std::string kill_def::info(const kill_monster_desc &md) const return append_places(md, name); } -std::string kill_def::append_places(const kill_monster_desc &md, +std::string kill_def::append_places(const kill_monster_desc &md, const std::string &name) const { if (Options.dump_kill_places == KDO_NO_PLACES) return name; int nplaces = places.size(); if ( nplaces == 1 || mons_is_unique(md.monnum) - || Options.dump_kill_places == KDO_ALL_PLACES ) + || Options.dump_kill_places == KDO_ALL_PLACES ) { std::string augmented = name; augmented += " ("; @@ -554,9 +554,7 @@ void kill_def::load(reader& inf) places.clear(); short place_count = unmarshallShort(inf); for (short i = 0; i < place_count; ++i) - { places.push_back((unsigned short) unmarshallShort(inf)); - } } kill_ghost::kill_ghost(const monsters *mon) @@ -568,14 +566,14 @@ kill_ghost::kill_ghost(const monsters *mon) // Check whether this is really a ghost, since we also have to handle // the Pandemonic demons. if (mon->type == MONS_PLAYER_GHOST) - ghost_name = "The ghost of " + ghost_description(*mon, true); + ghost_name = "The ghost of " + get_ghost_description(*mon, true); } std::string kill_ghost::info() const { - return ghost_name + - (Options.dump_kill_places != KDO_NO_PLACES? - " (" + short_place_name(place) + ")" : std::string("")); + return ghost_name + + (Options.dump_kill_places != KDO_NO_PLACES? + " (" + short_place_name(place) + ")" : std::string("")); } void kill_ghost::save(writer& outf) const @@ -664,10 +662,10 @@ KILLEXP_ACCESS(base_name, string, base_name.c_str()) KILLEXP_ACCESS(desc, string, desc.c_str()) KILLEXP_ACCESS(monnum, number, monnum) KILLEXP_ACCESS(isghost, boolean, - monnum == -1 && + monnum == -1 && ke->desc.find("The ghost of") != std::string::npos) KILLEXP_ACCESS(ispandemon, boolean, - monnum == -1 && + monnum == -1 && ke->desc.find("The ghost of") == std::string::npos) KILLEXP_ACCESS(isunique, boolean, monnum != -1 && mons_is_unique(ke->monnum)) @@ -744,7 +742,7 @@ static int kill_lualc_place_name(lua_State *ls) static bool is_ghost(const kill_exp *ke) { - return ke->monnum == -1 + return ke->monnum == -1 && ke->desc.find("The ghost of") != std::string::npos; } @@ -796,7 +794,7 @@ static int kill_lualc_symbol(lua_State *ls) kill_exp *ke = static_cast( lua_touserdata(ls, 1) ); if (ke) { - unsigned char ch = ke->monnum != -1? + unsigned char ch = ke->monnum != -1? mons_char(ke->monnum) : is_ghost(ke)? 'p' : '&'; @@ -868,7 +866,7 @@ static int kill_lualc_write(lua_State *ls) return 0; } - std::string *skill = static_cast( + std::string *skill = static_cast( lua_touserdata(ls, -1) ); // Pop the userdata off the stack. lua_settop(ls, -2); diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index b935f664e1..2ec9fb0cce 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -508,7 +508,7 @@ static void _handle_wizard_command( void ) break; case CONTROL('X'): - debug_set_xl(); + wizard_set_xl(); break; case 'O': @@ -521,11 +521,11 @@ static void _handle_wizard_command( void ) break; case 'S': - debug_set_skills(); + wizard_set_skill_level(); break; case 'A': - debug_set_all_skills(); + wizard_set_all_skills(); break; case '$': @@ -694,16 +694,15 @@ static void _handle_wizard_command( void ) break; case 'g': - debug_add_skills(); + wizard_exercise_skill(); break; case 'G': - debug_dismiss_all_monsters(); + wizard_dismiss_all_monsters(); break; case 'c': - // draw a card - debug_card(); + wizard_draw_card(); break; case 'h': @@ -746,21 +745,21 @@ static void _handle_wizard_command( void ) case 'd': case 'D': - level_travel(true); + wizard_level_travel(true); break; case 'u': case 'U': - level_travel(false); + wizard_level_travel(false); break; case '%': case 'o': - create_spec_object(); + wizard_create_spec_object(); break; case 't': - tweak_object(); + wizard_tweak_object(); break; case 'T': @@ -784,15 +783,15 @@ static void _handle_wizard_command( void ) break; case 'm': - create_spec_monster(); + wizard_create_spec_monster(); break; case 'M': - create_spec_monster_name(); + wizard_create_spec_monster_name(); break; case 'r': - debug_change_species(); + wizard_change_species(); break; case '>': @@ -920,12 +919,12 @@ static void _handle_wizard_command( void ) break; case 'z': - cast_spec_spell(); - break; /* cast spell by number */ + wizard_cast_spec_spell(); // Cast spell by number. + break; case 'Z': - cast_spec_spell_name(); - break; /* cast spell by name */ + wizard_cast_spec_spell_name(); // Cast spell by name. + break; case '(': mpr( "Create which feature (by number)? ", MSGCH_PROMPT ); @@ -988,7 +987,7 @@ static void _handle_wizard_command( void ) break; case ']': - if (!debug_add_mutation()) + if (!wizard_add_mutation()) mpr( "Failure to give mutation." ); break; @@ -1032,7 +1031,7 @@ static void _handle_wizard_command( void ) break; case '@': - debug_set_stats(); + wizard_set_stats(); break; case '^': @@ -1086,7 +1085,7 @@ static void _handle_wizard_command( void ) break; case '_': - debug_get_religion(); + wizard_get_religion(); break; case '\'': diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 78b0e01d71..fa521d8d17 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2766,7 +2766,7 @@ void fire_tracer(const monsters *monster, bolt &pbolt) pbolt.foe_helped = pbolt.foe_hurt = 0; pbolt.foe_ratio = 80; // default - see mons_should_fire() - // Foe ratio for summoning gtr. demons & undead -- they may be + // Foe ratio for summoning greater demons & undead -- they may be // summoned, but they're hostile and would love nothing better // than to nuke the player and his minions. if (mons_att_wont_attack(pbolt.attitude) @@ -2775,22 +2775,22 @@ void fire_tracer(const monsters *monster, bolt &pbolt) pbolt.foe_ratio = 25; } - // fire! + // Fire! fire_beam(pbolt); // Unset tracer flag (convenience). pbolt.is_tracer = false; -} // end tracer_f() +} bool check_line_of_sight( int sx, int sy, int tx, int ty ) { const int dist = grid_distance( sx, sy, tx, ty ); - // can always see one square away + // Can always see one square away. if (dist <= 1) return (true); - // currently we limit the range to 8 + // Currently we limit the range to 8. if (dist > MONSTER_LOS_RANGE) return (false); diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 87ed88e193..9fd09b3e7e 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -28,10 +28,9 @@ bool at_branch_bottom() branch_type str_to_branch(const std::string &branch, branch_type err) { for (int i = 0; i < NUM_BRANCHES; ++i) - { if (branches[i].abbrevname && branches[i].abbrevname == branch) return (static_cast(i)); - } + return (err); } diff --git a/crawl-ref/source/branch.h b/crawl-ref/source/branch.h index 08abfaaa14..94222fc689 100644 --- a/crawl-ref/source/branch.h +++ b/crawl-ref/source/branch.h @@ -43,7 +43,7 @@ struct Branch const char* entry_message; bool has_shops; bool has_uniques; - char floor_colour; // Zot needs special handling + char floor_colour; // Zot needs special handling. char rock_colour; int (*mons_rarity_function)(int); int (*mons_level_function)(int); @@ -51,16 +51,21 @@ struct Branch trap_type (*rand_trap_function)(int); int (*num_fogs_function)(int); void (*rand_fog_function)(int,fog_machine_data&); - int altar_chance; // in percent - int travel_shortcut; // which key to press for travel - bool any_upstair_exits; // any upstair exits the branch (Hell branches) + int altar_chance; // in percent + int travel_shortcut; // Which key to press for travel. + bool any_upstair_exits; // any upstair exits the branch (Hell branches) bool dangerous_bottom_level; // bottom level is more dangerous than normal }; extern Branch branches[]; Branch& your_branch(); + +/* *********************************************************************** + * called from: dungeon + * *********************************************************************** */ bool at_branch_bottom(); + branch_type str_to_branch(const std::string &branch, branch_type err = NUM_BRANCHES); diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index ee4a0b3c9b..9a1eb2f921 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -1262,26 +1262,6 @@ void display_notes() redraw_screen(); } -void resists_screen() -{ -#ifdef USE_TILE - mouse_control mc(MOUSE_MODE_MORE); -#endif - - std::vector vfs = get_full_detail(false); - clrscr(); - cgotoxy(1,1); - textcolor(LIGHTGREY); - - formatted_scroller scr; - scr.set_tag("resists"); - for ( unsigned i = 0; i < vfs.size(); ++i ) - scr.add_item_formatted_string(vfs[i]); - - scr.show(); - redraw_screen(); -} - #ifdef DGL_WHEREIS /////////////////////////////////////////////////////////////////////////// // whereis player diff --git a/crawl-ref/source/chardump.h b/crawl-ref/source/chardump.h index 311b934a99..b793b21b76 100644 --- a/crawl-ref/source/chardump.h +++ b/crawl-ref/source/chardump.h @@ -39,7 +39,6 @@ bool dump_char(const std::string &fname, const scorefile_entry *se = NULL); void dump_map(const char* fname); void dump_map(FILE *fp); -void resists_screen(); void display_notes(); std::string munge_description(const std::string &inStr); const char *hunger_level(void); diff --git a/crawl-ref/source/cloud.h b/crawl-ref/source/cloud.h index ae0bd5dd79..931a94aee2 100644 --- a/crawl-ref/source/cloud.h +++ b/crawl-ref/source/cloud.h @@ -42,8 +42,8 @@ void move_cloud( int cloud, int new_x, int new_y ); void check_place_cloud( cloud_type cl_type, int x, int y, int lifetime, kill_category whose, int spread_rate = -1 ); -void place_cloud(cloud_type cl_type, int ctarget_x, int ctarget_y, - int cl_range, kill_category whose, int spread_rate = -1 ); +void place_cloud( cloud_type cl_type, int ctarget_x, int ctarget_y, + int cl_range, kill_category whose, int spread_rate = -1 ); void manage_clouds(void); @@ -59,6 +59,7 @@ std::string cloud_name(cloud_type type); bool is_damaging_cloud(cloud_type type, bool temp = false); +// fog generator void place_fog_machine(fog_machine_type fm_type, cloud_type cl_type, int x, int y, int size, int power); @@ -69,7 +70,7 @@ bool valid_fog_machine_data(fog_machine_data data); int num_fogs_for_place(int level_number = -1, const level_id &place = level_id::current()); fog_machine_data random_fog_for_place(int level_number = -1, - const level_id &place = level_id::current()); + const level_id &place = level_id::current()); int fogs_pan_number(int level_number = -1); fog_machine_data fogs_pan_type(int level_number = -1); diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index f9c1650513..8f086eebea 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -210,7 +210,7 @@ static std::string _get_version_changes(void) return (result); } -void print_version(void) +static void _print_version(void) { formatted_scroller cmd_version; @@ -1441,7 +1441,7 @@ static int _keyhelp_keyfilter(int ch) case 'v': case 'V': { - print_version(); + _print_version(); return -1; } } diff --git a/crawl-ref/source/command.h b/crawl-ref/source/command.h index fa963f90f9..bd328903d3 100644 --- a/crawl-ref/source/command.h +++ b/crawl-ref/source/command.h @@ -16,40 +16,17 @@ #include "enum.h" -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void print_version(void); - - -// last updated 12may2000 {dlb} /* *********************************************************************** * called from: acr * *********************************************************************** */ void adjust(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ void list_weapons(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ void list_armour(void); +void list_jewellery(void); - -// last updated 12may2000 {dlb} /* *********************************************************************** - * called from: acr + * called from: clua * *********************************************************************** */ -void list_jewellery(void); - void swap_inv_slots(int slot1, int slot2, bool verbose); void show_levelmap_help(); @@ -60,7 +37,7 @@ void show_stash_search_help(); void list_commands(bool wizard, int hotkey = 0, bool do_redraw_screen = false); -// Actually defined in acr.cc; we may want to move this to command.cc +// XXX: Actually defined in acr.cc; we may want to move this to command.cc. void process_command(command_type cmd); #endif diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h index 94471a4803..138a7fe0b2 100644 --- a/crawl-ref/source/database.h +++ b/crawl-ref/source/database.h @@ -56,7 +56,7 @@ std::string getLongDescription(const std::string &key, std::vector getLongDescKeysByRegex(const std::string ®ex, db_find_filter filter = NULL); std::vector getLongDescBodiesByRegex(const std::string ®ex, - db_find_filter filter = NULL); + db_find_filter filter = NULL); std::string getShoutString(const std::string &monst, const std::string &suffix = ""); diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 6a19fc1014..c7de4261f4 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -232,13 +232,8 @@ static int _debug_prompt_for_skill( const char *prompt ) } #endif -//--------------------------------------------------------------- -// -// debug_change_species -// -//--------------------------------------------------------------- #ifdef WIZARD -void debug_change_species( void ) +void wizard_change_species( void ) { char specs[80]; int i; @@ -406,13 +401,9 @@ static int _debug_prompt_for_int( const char *prompt, bool nonneg ) // Some debugging functions, accessible in wizard mode. -//--------------------------------------------------------------- -// -// cast_spec_spell -// -//--------------------------------------------------------------- #ifdef WIZARD -void cast_spec_spell(void) +// Casts a specific spell by number. +void wizard_cast_spec_spell(void) { int spell = _debug_prompt_for_int( "Cast which spell by number? ", true ); @@ -427,13 +418,9 @@ void cast_spec_spell(void) #endif -//--------------------------------------------------------------- -// -// cast_spec_spell_name -// -//--------------------------------------------------------------- #ifdef WIZARD -void cast_spec_spell_name(void) +// Casts a specific spell by name. +void wizard_cast_spec_spell_name(void) { char specs[80]; @@ -464,7 +451,7 @@ void cast_spec_spell_name(void) #ifdef WIZARD // Creates a specific monster by mon type number. -void create_spec_monster(void) +void wizard_create_spec_monster(void) { int mon = _debug_prompt_for_int( "Create which monster by number? ", true ); @@ -484,7 +471,7 @@ void create_spec_monster(void) #ifdef WIZARD // Creates a specific monster by name. Uses the same patterns as // map definitions. -void create_spec_monster_name() +void wizard_create_spec_monster_name() { char specs[100]; mpr( "Which monster by name? ", MSGCH_PROMPT ); @@ -708,13 +695,8 @@ void wizard_place_stairs( bool down ) } #endif -//--------------------------------------------------------------- -// -// level_travel -// -//--------------------------------------------------------------- #ifdef WIZARD -void level_travel( bool down ) +void wizard_level_travel( bool down ) { dungeon_feature_type stairs = _find_appropriate_stairs(down); @@ -1117,7 +1099,7 @@ static bool _book_from_spell(const char* specs, item_def &item) // create_spec_object // //--------------------------------------------------------------- -void create_spec_object() +void wizard_create_spec_object() { static int max_subtype[] = { @@ -1601,7 +1583,7 @@ static void _tweak_randart(item_def &item) } } -void tweak_object(void) +void wizard_tweak_object(void) { char specs[50]; char keyin; @@ -1703,21 +1685,16 @@ void tweak_object(void) #endif -//--------------------------------------------------------------- -// -// stethoscope -// -//--------------------------------------------------------------- -#if DEBUG_DIAGNOSTICS - -void stethoscope(int mwh) +#ifdef DEBUG_DIAGNOSTICS +// Prints a number of useful (for debugging, that is) stats on monsters. +void debug_stethoscope(int mon) { struct dist stth; int steth_x, steth_y; int i; - if (mwh != RANDOM_MONSTER) - i = mwh; + if (mon != RANDOM_MONSTER) + i = mon; else { mpr( "Which monster?", MSGCH_PROMPT ); @@ -1754,7 +1731,7 @@ void stethoscope(int mwh) i = mgrd[steth_x][steth_y]; } - // print type of monster + // Print type of monster. mprf(MSGCH_DIAGNOSTICS, "%s (id #%d; type=%d loc=(%d,%d) align=%s)", menv[i].name(DESC_CAP_THE, true).c_str(), i, menv[i].type, menv[i].x, menv[i].y, @@ -1764,7 +1741,7 @@ void stethoscope(int mwh) (menv[i].attitude == ATT_GOOD_NEUTRAL) ? "good neutral" : "unknown alignment") ); - // print stats and other info + // Print stats and other info. mprf(MSGCH_DIAGNOSTICS, "HD=%d (%lu) HP=%d/%d AC=%d EV=%d MR=%d SP=%d " "energy=%d%s%s num=%d flags=%04lx", @@ -1779,8 +1756,7 @@ void stethoscope(int mwh) get_monster_data(menv[i].base_monster)->name : "", menv[i].number, menv[i].flags ); - // print behaviour information - + // Print habitat and behaviour information. const habitat_type hab = mons_habitat( &menv[i] ); mprf(MSGCH_DIAGNOSTICS, @@ -1806,7 +1782,7 @@ void stethoscope(int mwh) menv[i].target_x, menv[i].target_y, god_name(menv[i].god).c_str() ); - // print resistances + // Print resistances. mprf(MSGCH_DIAGNOSTICS, "resist: fire=%d cold=%d elec=%d pois=%d neg=%d", mons_res_fire( &menv[i] ), mons_res_cold( &menv[i] ), @@ -1826,15 +1802,10 @@ void stethoscope(int mwh) "Ghost damage: %d; brand: %d", ghost.damage, ghost.brand ); } -} // end stethoscope() +} #endif #if DEBUG_ITEM_SCAN -//--------------------------------------------------------------- -// -// dump_item -// -//--------------------------------------------------------------- static void _dump_item( const char *name, int num, const item_def &item ) { mpr( name, MSGCH_ERROR ); @@ -2414,7 +2385,7 @@ void debug_item_statistics( void ) // //--------------------------------------------------------------- #ifdef WIZARD -void debug_add_skills(void) +void wizard_exercise_skill(void) { int skill = _debug_prompt_for_skill( "Which skill (by name)? " ); @@ -2425,16 +2396,11 @@ void debug_add_skills(void) mpr("Exercising..."); exercise(skill, 100); } -} // end debug_add_skills() +} #endif -//--------------------------------------------------------------- -// -// debug_set_skills -// -//--------------------------------------------------------------- #ifdef WIZARD -void debug_set_skills(void) +void wizard_set_skill_level(void) { int skill = _debug_prompt_for_skill( "Which skill (by name)? " ); @@ -2498,17 +2464,12 @@ void debug_set_skills(void) } } } -} // end debug_add_skills() +} #endif -//--------------------------------------------------------------- -// -// debug_set_all_skills -// -//--------------------------------------------------------------- #ifdef WIZARD -void debug_set_all_skills(void) +void wizard_set_all_skills(void) { int i; int amount = @@ -2546,7 +2507,7 @@ void debug_set_all_skills(void) you.redraw_armour_class = 1; you.redraw_evasion = 1; } -} // end debug_add_skills() +} #endif @@ -2654,7 +2615,7 @@ static const char *mutation_type_names[] = "patterned scales" }; -bool debug_add_mutation(void) +bool wizard_add_mutation(void) { bool success = false; char specs[80]; @@ -2812,17 +2773,12 @@ bool debug_add_mutation(void) } return (success); -} // end debug_add_mutation() +} #endif -//--------------------------------------------------------------- -// -// debug_get_religion -// -//--------------------------------------------------------------- #ifdef WIZARD -void debug_get_religion(void) +void wizard_get_religion(void) { char specs[80]; @@ -3558,7 +3514,7 @@ void debug_make_shop() mprf("Done."); } -void debug_set_stats() +void wizard_set_stats() { char buf[80]; mprf(MSGCH_PROMPT, "Enter values for Str, Int, Dex (space separated): "); @@ -3568,19 +3524,20 @@ void debug_set_stats() int sstr = you.strength, sdex = you.dex, sint = you.intel; + sscanf(buf, "%d %d %d", &sstr, &sint, &sdex); you.max_strength = you.strength = cap_stat(sstr); you.max_dex = you.dex = cap_stat(sdex); you.max_intel = you.intel = cap_stat(sint); - you.redraw_strength = true; - you.redraw_dexterity = true; + you.redraw_strength = true; + you.redraw_dexterity = true; you.redraw_intelligence = true; - you.redraw_evasion = true; + you.redraw_evasion = true; } -void debug_card() +void wizard_draw_card() { msg::streams(MSGCH_PROMPT) << "Which card? " << std::endl; char buf[80]; @@ -3626,7 +3583,7 @@ static void debug_downtick_xl(int newxl) lose_level(); } -void debug_set_xl() +void wizard_set_xl() { mprf(MSGCH_PROMPT, "Enter new experience level: "); char buf[30]; @@ -3721,7 +3678,9 @@ void debug_place_map() debug_load_map_by_name(what); } -void debug_dismiss_all_monsters(bool force_all) +// Dismisses all monsters on the level or all monsters that match a user +// specified regex. +void wizard_dismiss_all_monsters(bool force_all) { char buf[80]; if (!force_all) @@ -3761,7 +3720,7 @@ void debug_dismiss_all_monsters(bool force_all) } } -void debug_kill_traps() +static void _debug_kill_traps() { for (int y = 0; y < GYM; ++y) for (int x = 0; x < GXM; ++x) @@ -3771,7 +3730,7 @@ void debug_kill_traps() } } -static int debug_time_explore() +static int _debug_time_explore() { viewwindow(true, false); start_explore(false); @@ -3801,17 +3760,15 @@ static int debug_time_explore() return (you.num_turns - start); } -static void debug_destroy_doors() +static void _debug_destroy_doors() { for (int y = 0; y < GYM; ++y) - { for (int x = 0; x < GXM; ++x) { const dungeon_feature_type feat = grd[x][y]; if (feat == DNGN_CLOSED_DOOR || feat == DNGN_SECRET_DOOR) grd[x][y] = DNGN_FLOOR; } - } } // Turns off greedy explore, then: @@ -3823,16 +3780,16 @@ static void debug_destroy_doors() // f) Counts number of turns needed to explore the level. void debug_test_explore() { - debug_dismiss_all_monsters(true); - debug_kill_traps(); - forget_map(100); + wizard_dismiss_all_monsters(true); + _debug_kill_traps(); + _debug_destroy_doors(); - debug_destroy_doors(); + forget_map(100); // Remember where we are now. const coord_def where = you.pos(); - const int explore_turns = debug_time_explore(); + const int explore_turns = _debug_time_explore(); // Return to starting point. you.moveto(where); @@ -3908,7 +3865,7 @@ static bool _force_suitable(const monsters *mon) return (mon->alive()); } -void debug_apply_monster_blessing(monsters* mon) +void wizard_apply_monster_blessing(monsters* mon) { mpr("Apply blessing of (B)eogh, The (S)hining One, or (R)andomly?", MSGCH_PROMPT); diff --git a/crawl-ref/source/debug.h b/crawl-ref/source/debug.h index 700fce055f..27c1272eba 100644 --- a/crawl-ref/source/debug.h +++ b/crawl-ref/source/debug.h @@ -67,108 +67,63 @@ inline void __DUMMY_TRACE__(...) #endif -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void cast_spec_spell(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void cast_spec_spell_name(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void create_spec_monster(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void create_spec_monster_name(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: ( this does not seem to be used at all ... {dlb} ) - * *********************************************************************** */ -void create_spec_object(void); -void tweak_object(void); - -// last updated 12say2001 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void debug_add_skills(void); -void debug_set_skills(void); -void debug_set_all_skills(void); - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -void debug_add_skills(void); - -// last updated 17sep2001 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ -bool debug_add_mutation(void); - - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: direct - food - items - * *********************************************************************** */ -void error_message_to_player(void); - - -// last updated 12may2000 {dlb} +// last updated 12 Jun 2008 {jpeg} /* *********************************************************************** * called from: acr * *********************************************************************** */ +void wizard_cast_spec_spell(void); +void wizard_cast_spec_spell_name(void); +void wizard_create_spec_monster(void); +void wizard_create_spec_monster_name(void); +void wizard_create_spec_object(void); +void wizard_tweak_object(void); +void wizard_exercise_skill(void); +void wizard_set_skill_level(void); +void wizard_set_all_skills(void); +bool wizard_add_mutation(void); +void wizard_change_species( void ); +void wizard_set_xl(); +void wizard_get_religion( void ); +void wizard_set_stats( void ); +void wizard_draw_card(); +void wizard_dismiss_all_monsters(bool force_all = false); void wizard_place_stairs( bool down ); -void level_travel( bool down ); +void wizard_level_travel( bool down ); void wizard_interlevel_travel(); - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - direct - * *********************************************************************** */ -void stethoscope(int mwh); - +void debug_make_trap( void ); +void debug_make_shop( void ); +void debug_place_map(); +// Honest debugging functions. void debug_item_scan( void ); void debug_item_statistics( void ); -void debug_get_religion( void ); -void debug_change_species( void ); void debug_fight_statistics( bool use_init_defaults, bool defence = false ); -void debug_make_trap( void ); -void debug_make_shop( void ); -void debug_set_stats( void ); void debug_list_monsters(); - -void debug_card(); -void debug_set_xl(); -void debug_place_map(); void debug_test_explore(); -void debug_dismiss_all_monsters(bool force_all = false); + + +// last updated 12 Jun 2008 {jpeg} +/* *********************************************************************** + * called from: directn + * *********************************************************************** */ +void error_message_to_player(void); +#if DEBUG_DIAGNOSTICS +void debug_stethoscope(int mon); +#endif class monsters; -void debug_make_monster_shout(monsters* mon); -void debug_apply_monster_blessing(monsters* mon); +void wizard_apply_monster_blessing(monsters* mon); void wizard_give_monster_item(monsters* mon); void wizard_move_player_or_monster(int x, int y); +void debug_make_monster_shout(monsters* mon); void debug_pathfind(int mid); + #ifdef DEBUG_DIAGNOSTICS +/* *********************************************************************** + * called from: acr + * *********************************************************************** */ void generate_map_stats(); + class map_def; void mapgen_report_map_try(const map_def &map); void mapgen_report_map_use(const map_def &map); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index abbada9668..d038ce7c9a 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1583,6 +1583,14 @@ static int _userdef_interrupt_activity( const delay_queue_item &idelay, return (false); } +static void _block_interruptions(bool block) +{ + if (block) + _interrupts_blocked++; + else + _interrupts_blocked--; +} + // Returns true if the activity should be interrupted, false otherwise. static bool _should_stop_activity(const delay_queue_item &item, activity_interrupt_type ai, @@ -1606,12 +1614,12 @@ static bool _should_stop_activity(const delay_queue_item &item, if (ai == AI_FULL_HP || ai == AI_FULL_MP) { // No recursive interruptions from messages (AI_MESSAGE) - block_interruptions(true); + _block_interruptions(true); if (ai == AI_FULL_HP) mpr("HP restored."); else mpr("Magic restored."); - block_interruptions(false); + _block_interruptions(false); if (Options.rest_wait_both && curr == DELAY_REST && (you.magic_points < you.max_magic_points @@ -1872,11 +1880,3 @@ const char *delay_name(int delay) return delay_names[delay]; } - -void block_interruptions(bool block) -{ - if (block) - _interrupts_blocked++; - else - _interrupts_blocked--; -} diff --git a/crawl-ref/source/delay.h b/crawl-ref/source/delay.h index 1c92b96065..bffb1b8a8c 100644 --- a/crawl-ref/source/delay.h +++ b/crawl-ref/source/delay.h @@ -88,10 +88,7 @@ activity_interrupt_type get_activity_interrupt(const std::string &); const char *delay_name(int delay); delay_type get_delay(const std::string &); -void perform_activity(); bool interrupt_activity( activity_interrupt_type ai, const activity_interrupt_data &a = activity_interrupt_data() ); - -void block_interruptions(bool block); #endif diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 158d8191da..120f9de79c 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2283,7 +2283,8 @@ void describe_monsters(monsters& mons) break; } case MONS_PLAYER_GHOST: - description << "The apparition of " << ghost_description(mons) << ".$"; + description << "The apparition of " << get_ghost_description(mons) + << ".$"; break; case MONS_PANDEMONIUM_DEMON: @@ -2366,16 +2367,10 @@ void describe_monsters(monsters& mons) getch(); } // end describe_monsters -//--------------------------------------------------------------- -// -// ghost_description -// // Describes the current ghost's previous owner. The caller must // prepend "The apparition of" or whatever and append any trailing // punctuation that's wanted. -// -//--------------------------------------------------------------- -std::string ghost_description(const monsters &mons, bool concise) +std::string get_ghost_description(const monsters &mons, bool concise) { ASSERT(mons.ghost.get()); std::ostringstream gstr; diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h index 4736239849..fd17f3a834 100644 --- a/crawl-ref/source/describe.h +++ b/crawl-ref/source/describe.h @@ -45,12 +45,16 @@ bool is_dumpable_artefact( const item_def &item, bool verbose ); std::string get_item_description( const item_def &item, bool verbose, bool dump = false ); -// last updated 12may2000 {dlb} +// last updated 12 Jun 2008 {jpeg} /* *********************************************************************** * called from: acr - religion * *********************************************************************** */ void describe_god( god_type which_god, bool give_title ); +// last updated 12 Jun 2008 {jpeg} +/* *********************************************************************** + * called from: directn + * *********************************************************************** */ void describe_feature_wide(int x, int y); /* *********************************************************************** @@ -59,22 +63,23 @@ void describe_feature_wide(int x, int y); void describe_item( item_def &item, bool allow_inscribe = false ); void inscribe_item( item_def &item ); +// last updated 12 Jun 2008 {jpeg} /* *********************************************************************** - * called from: direct + * called from: command - direct * *********************************************************************** */ void describe_monsters(monsters &mons); -// last updated 12may2000 {dlb} +// last updated 12 Jun 2008 {jpeg} /* *********************************************************************** - * called from: item_use + * called from: item_use - spl-cast * *********************************************************************** */ void describe_spell(spell_type spelled); // last updated 13oct2003 {darshan} /* *********************************************************************** - * called from: describe_monsters - describe, kill_ghost - Kills + * called from: Kills - monstuff * *********************************************************************** */ -std::string ghost_description(const monsters &mons, bool concise = false); +std::string get_ghost_description(const monsters &mons, bool concise = false); void print_description( const std::string &d ); diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 05e767730a..0c2b554d62 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -883,7 +883,7 @@ void direction(dist& moves, targeting_type restricts, if (mid == NON_MONSTER) // can put in terrain description here break; - debug_apply_monster_blessing(&menv[mid]); + wizard_apply_monster_blessing(&menv[mid]); break; case CMD_TARGET_WIZARD_MAKE_SHOUT: @@ -2329,7 +2329,7 @@ static void _describe_cell(int mx, int my) monster_described = true; #if DEBUG_DIAGNOSTICS - stethoscope(i); + debug_stethoscope(i); #endif if (Options.tutorial_left && tutorial_monster_interesting(&menv[i])) { diff --git a/crawl-ref/source/directn.h b/crawl-ref/source/directn.h index e968d82926..a4cc637df2 100644 --- a/crawl-ref/source/directn.h +++ b/crawl-ref/source/directn.h @@ -111,7 +111,7 @@ class targeting_behaviour public: targeting_behaviour(bool just_looking = false); virtual ~targeting_behaviour(); - + // Returns a keystroke for the prompt. virtual int get_key(); virtual command_type get_command(int key = -1); @@ -171,7 +171,7 @@ std::string feature_description(int mx, int my, bool bloody = false, bool add_stop = true); std::string raw_feature_description(dungeon_feature_type grid, trap_type tr = NUM_TRAPS); -std::string feature_description(dungeon_feature_type grid, +std::string feature_description(dungeon_feature_type grid, trap_type trap = NUM_TRAPS, bool bloody = false, description_level_type dtype = DESC_CAP_A, bool add_stop = true); diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 53af68600b..5914db26f3 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -902,32 +902,31 @@ static void _fixup_branch_stairs() } } - // Bottom level of branch - replaces down stairs with up ladders: - if (player_branch_depth() == your_branch().depth - && you.level_type == LEVEL_DUNGEON - && you.where_are_you != BRANCH_VESTIBULE_OF_HELL ) + // Branches that consist of only 1 level (Hall of Blades). + // No down staircases, thanks! + if (player_branch_depth() == 1) { for (int x = 1; x < GXM; x++) for (int y = 1; y < GYM; y++) if (grd[x][y] >= DNGN_STONE_STAIRS_DOWN_I - && grd[x][y] <= DNGN_ESCAPE_HATCH_DOWN) + && grd[x][y] <= DNGN_ESCAPE_HATCH_UP) { - grd[x][y] = DNGN_ESCAPE_HATCH_UP; + grd[x][y] = DNGN_FLOOR; } } - - // Hall of blades (1 level deal) - no down staircases, thanks! - // XXX XXX why the special-casing? - if (player_in_branch( BRANCH_HALL_OF_BLADES )) + else if (at_branch_bottom() + && you.level_type == LEVEL_DUNGEON) { + // Bottom level of branch - replaces down stairs with up ladders. for (int x = 1; x < GXM; x++) for (int y = 1; y < GYM; y++) if (grd[x][y] >= DNGN_STONE_STAIRS_DOWN_I - && grd[x][y] <= DNGN_ESCAPE_HATCH_UP) + && grd[x][y] <= DNGN_ESCAPE_HATCH_DOWN) { - grd[x][y] = DNGN_FLOOR; + grd[x][y] = DNGN_ESCAPE_HATCH_UP; } } + } static bool _fixup_stone_stairs(bool preserve_vault_stairs) @@ -1529,11 +1528,9 @@ static void _prepare_shoals(int level_number) // water, but this is much cooler. Right? const int margin = 6; - const bool at_bottom = (your_branch().depth == player_branch_depth()); - int num_islands = player_branch_depth() + 1; - if ( at_bottom ) + if (at_branch_bottom()) num_islands += random2(3); const int estradius = 50 / num_islands - (num_islands == 2 ? 5 : 0); @@ -1617,9 +1614,9 @@ static void _prepare_shoals(int level_number) _replace_in_grid(margin, margin, GXM-margin, GYM-margin, DNGN_WATER_STUCK, DNGN_SHALLOW_WATER); - if ( at_bottom ) + if (at_branch_bottom()) { - // Put all the stairs on one island + // Put all the stairs on one island. grd[centres[0].x ][centres[0].y] = DNGN_STONE_STAIRS_UP_I; grd[centres[0].x+1][centres[0].y] = DNGN_STONE_STAIRS_UP_II; grd[centres[0].x-1][centres[0].y] = DNGN_STONE_STAIRS_UP_III; @@ -6499,25 +6496,9 @@ static void _labyrinth_level(int level_number) static bool _is_wall(int x, int y) { - unsigned char feat = grd[x][y]; - - switch (feat) - { - case DNGN_ROCK_WALL: - case DNGN_STONE_WALL: - case DNGN_METAL_WALL: - case DNGN_GREEN_CRYSTAL_WALL: - case DNGN_WAX_WALL: - case DNGN_CLEAR_ROCK_WALL: - case DNGN_CLEAR_STONE_WALL: - case DNGN_CLEAR_PERMAROCK_WALL: - return (true); - default: - return (false); - } + return grid_is_wall(grd[x][y]); } - static int _box_room_door_spot(int x, int y) { // If there is a door near us embedded in rock, we have to be a door too. diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index 3fbfc3b481..fccda76c9f 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -312,7 +312,7 @@ bool dgn_place_map(int map, bool generating_level, bool clobber, const coord_def &pos = coord_def(-1, -1)); void level_clear_vault_memory(); void level_welcome_messages(); -bool is_wall(int feature); + bool place_specific_trap(int spec_x, int spec_y, trap_type spec_type); void place_spec_shop(int level_number, int shop_x, int shop_y, int force_s_type, bool representative = false); @@ -321,7 +321,6 @@ void replace_area_wrapper(dungeon_feature_type old_feat, bool unforbidden(const coord_def &c, unsigned mask); coord_def dgn_find_nearby_stair(dungeon_feature_type stair_to_find, coord_def base_pos, bool find_closest); -int count_neighbours(int x, int y, dungeon_feature_type feat); class mons_spec; bool dgn_place_monster(mons_spec &mspec, diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 9b3bdbba94..313444e743 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -379,7 +379,7 @@ static void _check_kill_milestone(const monsters *mons, if (mons->type == MONS_PLAYER_GHOST) { std::string milestone = _milestone_kill_verb(killer) + "the ghost of "; - milestone += ghost_description(*mons, true); + milestone += get_ghost_description(*mons, true); milestone += "."; mark_milestone("ghost", milestone); } diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 14dc57e16e..1774818fc4 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1561,277 +1561,6 @@ static const char* _determine_color_string( int level ) } } -// Old overview screen, now only used for dumping. -std::vector get_full_detail(bool calc_unid, long sc) -{ - char buf[1000]; - // 3 columns, splits at columns 32, 52 - column_composer cols(3, 33, 52); - char god_colour_tag[20]; - god_colour_tag[0] = 0; - std::string godpowers(god_name(you.religion)); - if ( you.religion != GOD_NO_GOD ) - { - if ( player_under_penance() ) - strcpy(god_colour_tag, "*"); - else - { - snprintf(god_colour_tag, sizeof god_colour_tag, "<%s>", - colour_to_str(god_colour(you.religion))); - // piety rankings - int prank = piety_rank() - 1; - if ( prank < 0 ) - prank = 0; - // Careful about overflow. We erase some of the god's name - // if necessary. - godpowers = godpowers.substr(0, 17 - prank) + - std::string(prank, '*'); - } - } - - const std::string score = - (sc > -1? make_stringf(" (%ld points)", sc) : ""); - - snprintf(buf, sizeof buf, - "%s the %s%s\n\n" - "Race : %s\n" - "Class : %s\n" - "Worship : %s%s\n" - "Level : %7d\n" - "Exp : %7lu\n", - you.your_name, - player_title().c_str(), - score.c_str(), - species_name(you.species,you.experience_level).c_str(), - you.class_name, - god_colour_tag, - godpowers.c_str(), - you.experience_level, - you.experience); - cols.add_formatted(0, buf, false); - - if (you.experience_level < 27) - { - int xp_needed = (exp_needed(you.experience_level+2)-you.experience)+1; - snprintf(buf, sizeof buf, - "Next Level : %7lu\n" - "Exp Needed : %7d\n", - exp_needed(you.experience_level + 2) + 1, - xp_needed); - cols.add_formatted(0, buf, false); - } - else - cols.add_formatted(0, "\n\n", false); - - snprintf(buf, sizeof buf, - "Spls.Left : %7d\n" - "Gold : %7d\n", - player_spell_levels(), - you.gold); - cols.add_formatted(0, buf, false); - - if (!player_rotted()) - { - if (you.hp < you.hp_max) - snprintf(buf, sizeof buf, "HP : %3d/%d",you.hp,you.hp_max); - else - snprintf(buf, sizeof buf, "HP : %3d", you.hp); - } - else - { - snprintf(buf, sizeof buf, "HP : %3d/%d (%d)", - you.hp, you.hp_max, you.hp_max + player_rotted() ); - } - cols.add_formatted(0, buf, true); - - if (you.magic_points < you.max_magic_points) - snprintf(buf, sizeof buf, "MP : %3d/%d", - you.magic_points, you.max_magic_points); - else - snprintf(buf, sizeof buf, "MP : %3d", you.magic_points); - cols.add_formatted(0, buf, false); - - if (you.strength == you.max_strength) - snprintf(buf, sizeof buf, "Str : %3d", you.strength); - else - snprintf(buf, sizeof buf, "Str : %3d (%d)", - you.strength, you.max_strength); - cols.add_formatted(0, buf, false); - - if (you.intel == you.max_intel) - snprintf(buf, sizeof buf, "Int : %3d", you.intel); - else - snprintf(buf, sizeof buf, "Int : %3d (%d)", - you.intel, you.max_intel); - cols.add_formatted(0, buf, false); - - if (you.dex == you.max_dex) - snprintf(buf, sizeof buf, "Dex : %3d", you.dex); - else - snprintf(buf, sizeof buf, "Dex : %3d (%d)", - you.dex, you.max_dex); - cols.add_formatted(0, buf, false); - - snprintf(buf, sizeof buf, - "AC : %3d\n" - "Evasion : %3d\n" - "Shield : %3d\n", - player_AC(), - player_evasion(), - player_shield_class()); - cols.add_formatted(0, buf, false); - - if (you.real_time != -1) - { - const time_t curr = you.real_time + (time(NULL) - you.start_time); - snprintf(buf, sizeof buf, - "Play time : %10s\n" - "Turns : %10ld\n", - make_time_string(curr, true).c_str(), you.num_turns ); - cols.add_formatted(0, buf, true); - } - - const int rfire = player_res_fire(calc_unid); - const int rcold = player_res_cold(calc_unid); - const int rlife = player_prot_life(calc_unid); - const int rpois = player_res_poison(calc_unid); - const int relec = player_res_electricity(calc_unid); - - snprintf(buf, sizeof buf, "\n\n" - "%sRes.Fire : %s\n" - "%sRes.Cold : %s\n" - "%sLife Prot.: %s\n" - "%sRes.Poison: %s\n" - "%sRes.Elec. : %s\n", - _determine_color_string(rfire), itosym3(rfire), - _determine_color_string(rcold), itosym3(rcold), - _determine_color_string(rlife), itosym3(rlife), - _determine_color_string(rpois), itosym1(rpois), - _determine_color_string(relec), itosym1(relec)); - cols.add_formatted(1, buf, false); - - const int rsust = player_sust_abil(calc_unid); - const int rmuta = wearing_amulet(AMU_RESIST_MUTATION, calc_unid); - const int rslow = wearing_amulet(AMU_RESIST_SLOW, calc_unid); - const int rclar = wearing_amulet(AMU_CLARITY, calc_unid); - - snprintf(buf, sizeof buf, - "%sSust.Abil.: %s\n" - "%sRes.Mut. : %s\n" - "%sRes.Slow : %s\n" - "%sClarity : %s\n \n", - _determine_color_string(rsust), itosym1(rsust), - _determine_color_string(rmuta), itosym1(rmuta), - _determine_color_string(rslow), itosym1(rslow), - _determine_color_string(rclar), itosym1(rclar)); - cols.add_formatted(1, buf, true); - - { - const int e_order[] = - { - EQ_WEAPON, EQ_BODY_ARMOUR, EQ_SHIELD, EQ_HELMET, EQ_CLOAK, - EQ_GLOVES, EQ_BOOTS, EQ_AMULET, EQ_RIGHT_RING, EQ_LEFT_RING - }; - - for (int i = 0; i < NUM_EQUIP; i++) - { - int eqslot = e_order[i]; - const char *slot = equip_slot_to_name( eqslot ); - - if ( you.equip[ e_order[i] ] != -1) - { - const item_def& item = you.inv[you.equip[e_order[i]]]; - const char* colname = colour_to_str(item.colour); - snprintf(buf, sizeof buf, "%-7s: <%s>%s", - slot, colname, - item.name(DESC_PLAIN).substr(0,38).c_str(), colname); - } - else - { - if (e_order[i] == EQ_WEAPON) - { - if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS) - snprintf(buf, sizeof buf, "%-7s: Blade Hands", slot); - else if (you.skills[SK_UNARMED_COMBAT]) - snprintf(buf, sizeof buf, "%-7s: Unarmed", slot); - else - snprintf(buf, sizeof buf, "%-7s:", slot); - } - else - { - snprintf(buf, sizeof buf, "%-7s:", slot); - } - } - cols.add_formatted(1, buf, false); - } - } - - const int rinvi = player_see_invis(calc_unid); - const int rward = (wearing_amulet(AMU_WARDING, calc_unid) - || you.religion == GOD_VEHUMET && !player_under_penance() - && you.piety >= piety_breakpoint(2)); - const int rcons = wearing_amulet(AMU_CONSERVATION, calc_unid); - const int rcorr = wearing_amulet(AMU_RESIST_CORROSION, calc_unid); - - snprintf(buf, sizeof buf, "\n\n" - "%sSee Invis. : %s\n" - "%sWarding : %s\n" - "%sConserve : %s\n" - "%sRes.Corr. : %s\n", - _determine_color_string(rinvi), itosym1(rinvi), - _determine_color_string(rward), itosym1(rward), - _determine_color_string(rcons), itosym1(rcons), - _determine_color_string(rcorr), itosym1(rcorr)); - cols.add_formatted(2, buf, false); - - int saplevel = player_mutation_level(MUT_SAPROVOROUS); - const char* pregourmand; - const char* postgourmand; - if ( wearing_amulet(AMU_THE_GOURMAND, calc_unid) ) - { - pregourmand = "Gourmand : "; - postgourmand = itosym1(1); - saplevel = 1; - } - else - { - pregourmand = "Saprovore : "; - postgourmand = itosym3(saplevel); - } - snprintf(buf, sizeof buf, "%s%s%s", - _determine_color_string(saplevel), pregourmand, postgourmand); - cols.add_formatted(2, buf, false); - - cols.add_formatted(2, " \n", false); - - if ( scan_randarts(RAP_PREVENT_TELEPORTATION, calc_unid) ) - { - snprintf(buf, sizeof buf, "%sPrev.Telep.: %s", - _determine_color_string(-1), itosym1(1)); - } - else - { - const int rrtel = !!player_teleport(calc_unid); - snprintf(buf, sizeof buf, "%sRnd.Telep. : %s", - _determine_color_string(rrtel), itosym1(rrtel)); - } - cols.add_formatted(2, buf, false); - - const int rctel = player_control_teleport(calc_unid); - const int rlevi = player_is_airborne(); - const int rcfli = wearing_amulet(AMU_CONTROLLED_FLIGHT, calc_unid); - snprintf(buf, sizeof buf, - "%sCtrl.Telep.: %s\n" - "%sLevitation : %s\n" - "%sCtrl.Flight: %s\n", - _determine_color_string(rctel), itosym1(rctel), - _determine_color_string(rlevi), itosym1(rlevi), - _determine_color_string(rcfli), itosym1(rcfli)); - cols.add_formatted(2, buf, false); - - return cols.formatted_lines(); -} - static std::string _status_mut_abilities(void); // helper for print_overview_screen diff --git a/crawl-ref/source/output.h b/crawl-ref/source/output.h index 5510548074..c8f1aa9312 100644 --- a/crawl-ref/source/output.h +++ b/crawl-ref/source/output.h @@ -55,8 +55,6 @@ std::string mpr_monster_list(bool past = false); void redraw_skill(const std::string &your_name, const std::string &class_name); void update_monster_pane(void); -std::vector get_full_detail(bool calc_unid, long score = -1); - const char *equip_slot_to_name(int equip); int equip_name_to_slot(const char *s); -- cgit v1.2.3-54-g00ecf