summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 13:33:58 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 13:33:58 +0000
commitcbb4198487aa2b7a3e59d5ad42d29bed2058ebbd (patch)
tree0b07c8eaca284090c82c8794549e7e0c474ec793 /crawl-ref
parentd21e4e79c268f7ed72f3c60b2e566c07047f4bc8 (diff)
downloadcrawl-ref-cbb4198487aa2b7a3e59d5ad42d29bed2058ebbd.tar.gz
crawl-ref-cbb4198487aa2b7a3e59d5ad42d29bed2058ebbd.zip
Change butchering prompt to hopefully be less confusing (BR 2009022).
Also add a key to some kind of butchering help (may need tweaking) and 'b' is yet another synonym for 'c' but will allow Vampires to butcher a corpse they'd otherwise bottle. This only works while the prompt is given, i.e. if always_confirm_butcher is false Vampires will automatically attempt to bottle the blood in a single corpse (unless that is impossible, in which case they'll butcher it instead). Also fix corpses sometimes not being destroyed when drained by a Vampire. (Big oops!) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6366 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/command.cc7
-rw-r--r--crawl-ref/source/command.h1
-rw-r--r--crawl-ref/source/dat/database/help.txt22
-rw-r--r--crawl-ref/source/delay.cc4
-rw-r--r--crawl-ref/source/food.cc93
-rw-r--r--crawl-ref/source/stuff.cc18
6 files changed, 97 insertions, 48 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index b9c51b7449..5c4b37361d 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1688,7 +1688,6 @@ void show_targeting_help()
cols.add_formatted(1, targeting_help_2, true, true);
_show_keyhelp_menu(cols.formatted_lines(), false, true);
}
-
void show_interlevel_travel_branch_help()
{
show_specific_help( getHelpString("interlevel-travel.branch.prompt") );
@@ -1704,6 +1703,12 @@ void show_stash_search_help()
show_specific_help( getHelpString("stash-search.prompt") );
}
+void show_butchering_help()
+{
+ show_specific_help( getHelpString("butchering") );
+}
+
+
static void _add_formatted_keyhelp(column_composer &cols)
{
cols.add_formatted(
diff --git a/crawl-ref/source/command.h b/crawl-ref/source/command.h
index bd328903d3..850a9efad2 100644
--- a/crawl-ref/source/command.h
+++ b/crawl-ref/source/command.h
@@ -34,6 +34,7 @@ void show_targeting_help();
void show_interlevel_travel_branch_help();
void show_interlevel_travel_depth_help();
void show_stash_search_help();
+void show_butchering_help();
void list_commands(bool wizard, int hotkey = 0,
bool do_redraw_screen = false);
diff --git a/crawl-ref/source/dat/database/help.txt b/crawl-ref/source/dat/database/help.txt
index ee738be36e..69a4a889f5 100644
--- a/crawl-ref/source/dat/database/help.txt
+++ b/crawl-ref/source/dat/database/help.txt
@@ -109,3 +109,25 @@ interlevel-travel.depth.prompt
<w>$</w> : Change default to deepest visited level in this branch.
<w>^</w> : Change default to the entrance to the current level.
%%%%
+butchering
+
+<h>Butchering<h>
+<w>y, c</w>: Butcher the selected corpse.
+<w>a</w> : Butcher this corpse and all the ones following in the stack.
+<w>q</w> : Quit the prompt (don't butcher anything).
+<w>n</w> : Don't butcher this corpse, skip to the next one.
+ (This is the default behaviour if you answer with anything not
+ listed here.)
+
+<h>Special information for Vampires</h>
+<w>y, c</w>: Butcher or bottle the selected corpse, as applicable.
+<w>b</w> : Butcher this corpse even if you would normally bottle it.
+<w>a</w> : Butcher this corpse and all the ones following in the stack.
+ If the prompt is about bottling the blood, all bloodless corpses
+ will be skipped.
+
+<h>Notes for Tiles</h>
+If you are playing with Tiles you can butcher (or bottle) a single
+corpse on the ground by clicking the <w>left mouse button</w> while pressing
+<w>Shift</w>.
+%%%%
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 8e2ffa7230..65a4dd7b60 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1026,14 +1026,14 @@ static void _finish_delay(const delay_queue_item &delay)
: mitm[delay.parm2]);
vampire_nutrition_per_turn(corpse, 1);
- if (!mons_skeleton( corpse.plus ))
+ if (!mons_skeleton( corpse.plus ) || one_chance_in(4))
{
if (delay.parm1)
dec_inv_item_quantity( delay.parm2, 1 );
else
dec_mitm_item_quantity( delay.parm2, 1 );
}
- else if (!one_chance_in(4))
+ else
turn_corpse_into_skeleton(corpse, 90);
break;
}
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index d2c031861a..3683453987 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -30,6 +30,7 @@
#include "cio.h"
#include "clua.h"
+#include "command.h"
#include "debug.h"
#include "delay.h"
#include "initfile.h"
@@ -532,8 +533,11 @@ bool butchery(int which_corpse)
// Now pick what you want to butcher. This is only a problem
// if there are several corpses on the square.
- bool butcher_all = false;
- bool bottle_all = false; // for Vampires
+ bool butcher_all = false;
+ bool bottle_all = false; // for Vampires
+ bool force_butcher = false;
+ bool repeat_prompt = false;
+ int keyin;
for (stack_iterator si(you.pos()); si; ++si)
{
if (si->base_type != OBJ_CORPSES || si->sub_type != CORPSE_BODY)
@@ -565,52 +569,69 @@ bool butchery(int which_corpse)
}
// Shall we butcher this corpse?
- snprintf(info, INFO_SIZE, "%s %s?",
- (sacrifice
- || !can_bottle_blood_from_corpse(si->plus)) ?
- "Butcher" : "Bottle",
+ do
+ {
+ mprf(MSGCH_PROMPT, "%s %s? [yc/n/a/q/?]",
+ (sacrifice || !can_bottle_blood_from_corpse(si->plus)) ?
+ "Butcher" : "Bottle",
corpse_name.c_str());
+ repeat_prompt = false;
- const int result = yesnoquit(info, true, 'N', true, false,
- 'C', 'D');
-
- if (result == -1) // (q)uit
- {
- canned_msg(MSG_OK);
- _terminate_butchery(wpn_switch, removed_gloves, new_cursed,
- old_weapon, old_gloves);
- return (false);
- }
- else if (result == 0) // (n)o
- {
- continue;
- }
- else if (result == 1 || result == 2) // (y)es, (a)ll
- {
- if (!_prepare_butchery(can_butcher, barehand_butcher,
- wpn_switch, removed_gloves, new_cursed))
+ keyin = tolower(c_getch());
+ switch (keyin)
{
- return (false);
- }
- corpse_id = si->index();
+ case 'b':
+ force_butcher = true;
+ // intentional fall-through
+ case 'y':
+ case 'c':
+ case 'd':
+ case 'a':
+ if (!_prepare_butchery(can_butcher, barehand_butcher,
+ wpn_switch, removed_gloves,
+ new_cursed))
+ {
+ return (false);
+ }
+ corpse_id = si->index();
- if (result == 2) // (a)ll
- {
- if (can_bottle_blood_from_corpse(si->plus)
- && (!you.duration[DUR_PRAYER]
- || !god_likes_butchery(you.religion)))
+ if (keyin == 'a')
{
- bottle_all = true;
+ if (!force_butcher
+ && can_bottle_blood_from_corpse(si->plus)
+ && (!you.duration[DUR_PRAYER]
+ || !god_likes_butchery(you.religion)))
+ {
+ bottle_all = true;
+ }
+ else
+ butcher_all = true;
}
- else
- butcher_all = true;
+ break;
+
+ case 'q':
+ canned_msg(MSG_OK);
+ _terminate_butchery(wpn_switch, removed_gloves, new_cursed,
+ old_weapon, old_gloves);
+ return (false);
+
+ case '?':
+ show_butchering_help();
+ mesclr();
+ redraw_screen();
+ repeat_prompt = true;
+ break;
+
+ default:
+ break;
}
}
+ while (repeat_prompt);
}
if (corpse_id != -1)
{
- if (_butcher_corpse(corpse_id, butcher_all))
+ if (_butcher_corpse(corpse_id, force_butcher || butcher_all))
success = true;
if (!butcher_all && !bottle_all)
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index b21e99b2fa..17af5f072e 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -725,24 +725,24 @@ void redraw_screen(void)
{
if (!crawl_state.need_save)
{
- // if the game hasn't started, don't do much
+ // If the game hasn't started, don't do much.
clrscr();
return;
}
draw_border();
- you.redraw_hit_points = true;
+ you.redraw_hit_points = true;
you.redraw_magic_points = true;
- you.redraw_strength = true;
+ you.redraw_strength = true;
you.redraw_intelligence = true;
- you.redraw_dexterity = true;
+ you.redraw_dexterity = true;
you.redraw_armour_class = true;
- you.redraw_evasion = true;
- you.redraw_gold = true;
- you.redraw_experience = true;
- you.wield_change = true;
- you.redraw_quiver = true;
+ you.redraw_evasion = true;
+ you.redraw_gold = true;
+ you.redraw_experience = true;
+ you.wield_change = true;
+ you.redraw_quiver = true;
set_redraw_status(
REDRAW_LINE_1_MASK | REDRAW_LINE_2_MASK | REDRAW_LINE_3_MASK );