diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-15 22:06:31 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-15 22:06:31 +0000 |
commit | f286cbea0ccc47a5d9c6a113f1d40460f7197a78 (patch) | |
tree | e93fcf6d8ab858364ba512e82a96a1e0e533a689 | |
parent | 4a08b83f96c0579682fd9e9ec4e64eac0e4d854f (diff) | |
download | crawl-ref-f286cbea0ccc47a5d9c6a113f1d40460f7197a78.tar.gz crawl-ref-f286cbea0ccc47a5d9c6a113f1d40460f7197a78.zip |
Added an option, always_confirm_butcher.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2857 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/docs/crawl_options.txt | 10 | ||||
-rw-r--r-- | crawl-ref/init.txt | 1 | ||||
-rw-r--r-- | crawl-ref/source/clua.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/initfile.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/makeitem.cc | 1 |
8 files changed, 23 insertions, 11 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt index d35c4461f4..5291418193 100644 --- a/crawl-ref/docs/crawl_options.txt +++ b/crawl-ref/docs/crawl_options.txt @@ -50,8 +50,9 @@ The contents of this text are: stash_tracking, stash_filter 4-i Command Enhancements. auto_list, lowercase_invocations, easy_open, easy_butcher, - easy_unequip, easy_confirm, easy_quit_item_prompts, - easy_exit_menu, default_autoprayer, sort_menus + always_confirm_butcher, easy_unequip, easy_confirm, + easy_quit_item_prompts, easy_exit_menu, default_autoprayer, + sort_menus 4-j Message and Display Improvements. hp_warning, mp_warning, hp_colour, mp_colour, always_greet, terse_hand, delay_message_clear, menu_colour, @@ -746,6 +747,11 @@ easy_butcher = true For such tools any special messages are ignored. If false, you have to wield the tool manually. +always_confirm_butcher = false + If true, always request confirmation before butchering. If false, + butchering will proceed automatically if there is exactly one + corpse on the square. + easy_unequip = true Allows auto removal of armour and jewellery when dropping it. diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt index 3664f03972..862878b965 100644 --- a/crawl-ref/init.txt +++ b/crawl-ref/init.txt @@ -154,6 +154,7 @@ stab_brand = hi:blue # lowercase_invocations = false # easy_open = false # easy_butcher = false +# always_confirm_butcher = true # easy_unequip = false # easy_confirm = (none | safe | all) # easy_quit_item_prompts = false diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 3f9c7b55b9..81f5f0cb83 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -2083,6 +2083,7 @@ static option_handler handlers[] = { "easy_armour", &Options.easy_unequip, option_hboolean }, { "easy_unequip", &Options.easy_unequip, option_hboolean }, { "easy_butcher", &Options.easy_butcher, option_hboolean }, + { "always_confirm_butcher", &Options.always_confirm_butcher, option_hboolean }, { "terse_hand", &Options.terse_hand, option_hboolean }, { "increasing_skill_progress", &Options.increasing_skill_progress, option_hboolean }, { "confirm_self_target", &Options.confirm_self_target, option_hboolean }, diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 9332c8c16f..08744ffc78 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1514,6 +1514,7 @@ public: bool easy_open; // open doors with movement bool easy_unequip; // allow auto-removing of armour / jewelry bool easy_butcher; // open doors with movement + bool always_confirm_butcher; // even if only one corpse bool increasing_skill_progress; // skills go from 0-10 or 10-0 bool confirm_self_target; // require confirmation before selftarget bool default_target; // start targeting on a real target diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index e132835e88..50b5869f77 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -111,7 +111,7 @@ bool test_melee_hit(int to_hit, int ev) if (to_hit >= AUTOMATIC_HIT) return (true); - else if (random2(1000) < 10 * MIN_HIT_MISS_PERCENTAGE) + else if (random2(100) < MIN_HIT_MISS_PERCENTAGE) margin = (coinflip() ? 1 : -1) * AUTOMATIC_HIT; else { @@ -123,12 +123,11 @@ bool test_melee_hit(int to_hit, int ev) float miss; if (to_hit < ev) - miss = 100.0 - static_cast<float>( MIN_HIT_MISS_PERCENTAGE ) / 2.0; + miss = 100.0 - MIN_HIT_MISS_PERCENTAGE / 2.0; else { - miss = static_cast<float>( MIN_HIT_MISS_PERCENTAGE ) / 2.0 - + static_cast<float>( (100 - MIN_HIT_MISS_PERCENTAGE) * ev ) - / static_cast<float>( to_hit ); + miss = MIN_HIT_MISS_PERCENTAGE / 2.0 + + ((100.0 - MIN_HIT_MISS_PERCENTAGE) * ev) / to_hit; } mprf( MSGCH_DIAGNOSTICS, diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index aa8b2893fd..8170b31665 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -264,8 +264,9 @@ bool butchery() mpr("There isn't anything to dissect here."); return false; } - else if ( num_corpses > 1 ) + else if ( num_corpses > 1 || Options.always_confirm_butcher ) { + corpse_id = -1; for (int o=igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link) { if ( (mitm[o].base_type != OBJ_CORPSES) || @@ -273,8 +274,7 @@ bool butchery() continue; // offer the possibility of butchering - std::string prompt = "Butcher " + mitm[o].name(DESC_NOCAP_A); - prompt += '?'; + std::string prompt = "Butcher " + mitm[o].name(DESC_NOCAP_A) + '?'; const int answer = yesnoquit( prompt.c_str(), true, 'n', false ); if ( answer == 1 ) { diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 86d7c1c10a..2704b3efe6 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -604,6 +604,7 @@ void game_options::reset_options() easy_open = true; easy_unequip = true; easy_butcher = true; + always_confirm_butcher = false; easy_confirm = CONFIRM_SAFE_EASY; easy_quit_item_prompts = true; hp_warning = 10; @@ -1684,6 +1685,10 @@ void game_options::read_option_line(const std::string &str, bool runscript) // automatic knife switching easy_butcher = read_bool( field, easy_butcher ); } + else if (key == "always_confirm_butcher") + { + always_confirm_butcher = read_bool( field, always_confirm_butcher ); + } else if (key == "lua_file" && runscript) { #ifdef CLUA_BINDINGS diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index dcacf7a15f..633db77418 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2533,7 +2533,6 @@ static void generate_jewellery_item(item_def& item, bool allow_uniques, item.sub_type = (one_chance_in(4) ? get_random_amulet_type() : get_random_ring_type()); - // everything begins as uncursed, unenchanted jewellery {dlb}: item.plus = 0; item.plus2 = 0; |