git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@722 c06c8d41-db1a-0410-9941-cceddc491573
MBBPLL4SZUB3JUUYQYLZW7S5OXRCEGJX3WWADOQXGHWQ7BIKCY5QC
EIFQHCRHD4FFW7KO7UKHI7OQV2O7PENRYEXAW6R24UVLNHQYUGKQC
7QF6YAAIN737OSU2DHH6ASELV6YXBR4CKOEYFURGHIVBWJ4GGIPAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
FT5TINI5SOYBAVF6UJAAESSTXKTUIPLOSPZOOZY2DOBK5RNM6TKQC
547JREUJXTZNYVGHNNAET5F5O5JYYGNTDQB6ABZNT7YX5EY64OHAC
if ( (mitm[objl].base_type != OBJ_CORPSES) ||
(mitm[objl].sub_type != CORPSE_BODY) )
continue;
// offer the possibility of butchering
it_name(objl, DESC_NOCAP_A, str_pass);
snprintf(info, INFO_SIZE, "Butcher %s?", str_pass);
int answer = yesnoquit( info, true, 'n', false );
if ( answer == -1 )
break;
if ( answer == 0 )
continue;
// offer the possibility of butchering
it_name(objl, DESC_NOCAP_A, str_pass);
snprintf(info, INFO_SIZE, "Butcher %s?", str_pass);
int answer = yesnoquit( info, true, 'n', false );
if ( answer == -1 )
break;
if ( answer == 0 )
continue;
if ( Options.easy_butcher && !can_butcher ) {
// try to find a butchering implement
wpn_switch = find_butchering_implement();
const int wpn = you.equip[EQ_WEAPON];
if ( wpn_switch ) {
new_cursed =
(wpn != -1) &&
(you.inv[wpn].base_type == OBJ_WEAPONS) &&
item_cursed( you.inv[wpn]);
}
if ( Options.easy_butcher && !can_butcher )
{
// try to find a butchering implement
wpn_switch = find_butchering_implement();
const int wpn = you.equip[EQ_WEAPON];
if ( wpn_switch )
{
new_cursed =
(wpn != -1) &&
(you.inv[wpn].base_type == OBJ_WEAPONS) &&
item_cursed( you.inv[wpn]);
}
// note that barehanded butchery would not reach this
// stage, so if wpn == -1 the user selected '-' when
// switching weapons
// note that barehanded butchery would not reach this
// stage, so if wpn == -1 the user selected '-' when
// switching weapons
if (!wpn_switch || wpn == -1 || !can_cut_meat(you.inv[wpn])) {
// still can't butcher. Early out
if ( wpn == -1 ) {
if (you.equip[EQ_GLOVES] == -1)
mpr("What, with your bare hands?");
else
mpr("Your gloves aren't that sharp!");
}
else
mpr("Maybe you should try using a sharper implement.");
if (!wpn_switch || wpn == -1 || !can_cut_meat(you.inv[wpn]))
{
// still can't butcher. Early out
if ( wpn == -1 ) {
if (you.equip[EQ_GLOVES] == -1)
mpr("What, with your bare hands?");
else
mpr("Your gloves aren't that sharp!");
}
else
mpr("Maybe you should try using a sharper implement.");
// we actually butcher now
if ( barehand_butcher )
mpr("You start tearing the corpse apart.");
else
mpr("You start hacking away.");
if (you.duration[DUR_PRAYER] &&
(you.religion == GOD_OKAWARU || you.religion == GOD_MAKHLEB ||
you.religion == GOD_TROG)) {
offer_corpse(objl);
destroy_item(objl);
}
else {
int work_req = 3 - mitm[objl].plus2;
if (work_req < 0)
work_req = 0;
if (you.duration[DUR_PRAYER] &&
(you.religion == GOD_OKAWARU || you.religion == GOD_MAKHLEB ||
you.religion == GOD_TROG))
{
offer_corpse(objl);
destroy_item(objl);
}
else
{
int work_req = 4 - (++mitm[objl].plus2);
if (work_req < 0)
work_req = 0;
switch (delay.type)
{
case DELAY_AUTOPICKUP:
{
const int estop =
you.running == RMODE_EXPLORE_GREEDY?
ES_GREEDY_PICKUP : ES_PICKUP;
if ((Options.explore_stop & estop) && prompt_stop_explore(estop))
stop_delay();
break;
}
finish_delay(delay);
}
}
case DELAY_WEAPON_SWAP:
weapon_switch( delay.parm1 );
break;
static void finish_delay(const delay_queue_item &delay)
{
char str_pass[ ITEMNAME_SIZE ];
switch (delay.type)
{
case DELAY_AUTOPICKUP:
{
const int estop =
you.running == RMODE_EXPLORE_GREEDY?
ES_GREEDY_PICKUP : ES_PICKUP;
if ((Options.explore_stop & estop) && prompt_stop_explore(estop))
stop_delay();
break;
}
case DELAY_ARMOUR_OFF:
{
in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass );
snprintf( info, INFO_SIZE, "You finish taking off %s.", str_pass );
mpr(info);
case DELAY_ARMOUR_ON:
armour_wear_effects( delay.parm1 );
break;
if (slot == EQ_BODY_ARMOUR)
{
you.equip[EQ_BODY_ARMOUR] = -1;
}
else
{
switch (slot)
{
case EQ_SHIELD:
if (delay.parm1 == you.equip[EQ_SHIELD])
you.equip[EQ_SHIELD] = -1;
break;
const equipment_type slot =
get_armour_slot( you.inv[delay.parm1] );
case EQ_CLOAK:
if (delay.parm1 == you.equip[EQ_CLOAK])
you.equip[EQ_CLOAK] = -1;
break;
if (slot == EQ_BODY_ARMOUR)
{
you.equip[EQ_BODY_ARMOUR] = -1;
}
else
{
switch (slot)
{
case EQ_SHIELD:
if (delay.parm1 == you.equip[EQ_SHIELD])
you.equip[EQ_SHIELD] = -1;
break;
case DELAY_PASSWALL:
{
mpr( "You finish merging with the rock." );
more(); // or the above message won't be seen
you.redraw_armour_class = 1;
you.redraw_evasion = 1;
break;
}
case DELAY_EAT:
mpr( "You finish eating." );
// For chunks, warn the player if they're not getting much
// nutrition.
if (delay.parm1)
chunk_nutrition_message(delay.parm1);
break;
switch (grd[ pass_x ][ pass_y ])
{
case DNGN_ROCK_WALL:
case DNGN_STONE_WALL:
case DNGN_METAL_WALL:
case DNGN_GREEN_CRYSTAL_WALL:
case DNGN_WAX_WALL:
case DNGN_SILVER_STATUE:
case DNGN_ORANGE_CRYSTAL_STATUE:
ouch(1 + you.hp, 0, KILLED_BY_PETRIFICATION);
break;
const int pass_x = delay.parm1;
const int pass_y = delay.parm2;
default:
break;
}
switch (grd[ pass_x ][ pass_y ])
{
case DNGN_ROCK_WALL:
case DNGN_STONE_WALL:
case DNGN_METAL_WALL:
case DNGN_GREEN_CRYSTAL_WALL:
case DNGN_WAX_WALL:
case DNGN_SILVER_STATUE:
case DNGN_ORANGE_CRYSTAL_STATUE:
ouch(1 + you.hp, 0, KILLED_BY_PETRIFICATION);
break;
// move any monsters out of the way:
int mon = mgrd[ pass_x ][ pass_y ];
if (mon != NON_MONSTER)
{
// one square, a few squares, anywhere...
if (!shift_monster(&menv[mon])
&& !monster_blink(&menv[mon]))
{
monster_teleport( &menv[mon], true, true );
}
}
case DNGN_SECRET_DOOR: // oughtn't happen
case DNGN_CLOSED_DOOR: // open the door
grd[ pass_x ][ pass_y ] = DNGN_OPEN_DOOR;
break;
break;
case DELAY_BUTCHER:
snprintf(info, INFO_SIZE, "You finish %s the corpse into pieces.",
(you.species == SP_TROLL ||
you.species == SP_GHOUL) ? "ripping" : "chopping" );
mpr(info);
turn_corpse_into_chunks( mitm[ delay.parm1 ] );
case DELAY_DROP_ITEM:
// Note: checking if item is droppable is assumed to
// be done before setting up this delay... this includes
// quantity (delay.parm2). -- bwr
move_player_to_grid(pass_x, pass_y, false, true, true);
redraw_screen();
}
break;
}
// Make sure item still exists.
if (!is_valid_item( you.inv[ delay.parm1 ] ))
break;
case DELAY_BUTCHER:
snprintf(info, INFO_SIZE, "You finish %s the corpse into pieces.",
(you.species == SP_TROLL ||
you.species == SP_GHOUL) ? "ripping" : "chopping" );
mpr(info);
// Must handle unwield_item before we attempt to copy
// so that temporary brands and such are cleared. -- bwr
if (delay.parm1 == you.equip[EQ_WEAPON])
{
unwield_item( delay.parm1 );
you.equip[EQ_WEAPON] = -1;
canned_msg( MSG_EMPTY_HANDED );
}
turn_corpse_into_chunks( mitm[ delay.parm1 ] );
if (!copy_item_to_grid( you.inv[ delay.parm1 ],
you.x_pos, you.y_pos, delay.parm2,
true ))
{
mpr("Too many items on this level, not dropping the item.");
}
else
{
quant_name( you.inv[ delay.parm1 ], delay.parm2,
DESC_NOCAP_A, str_pass );
if (you.berserker && you.berserk_penalty != NO_BERSERK_PENALTY)
{
mpr("You enjoyed that.");
you.berserk_penalty = 0;
}
break;
case DELAY_ASCENDING_STAIRS:
up_stairs();
untag_followers();
break;
// Must handle unwield_item before we attempt to copy
// so that temporary brands and such are cleared. -- bwr
if (delay.parm1 == you.equip[EQ_WEAPON])
{
unwield_item( delay.parm1 );
you.equip[EQ_WEAPON] = -1;
canned_msg( MSG_EMPTY_HANDED );
}
case DELAY_DESCENDING_STAIRS:
down_stairs( false, delay.parm1 );
untag_followers();
break;
if (!copy_item_to_grid( you.inv[ delay.parm1 ],
you.x_pos, you.y_pos, delay.parm2,
true ))
{
mpr("Too many items on this level, not dropping the item.");
}
else
{
quant_name( you.inv[ delay.parm1 ], delay.parm2,
DESC_NOCAP_A, str_pass );
you.wield_change = true;
print_stats(); // force redraw of the stats
you.turn_is_over = true;
pop_delay();
case DELAY_ASCENDING_STAIRS:
up_stairs();
untag_followers();
break;
case DELAY_DESCENDING_STAIRS:
down_stairs( false, delay.parm1 );
untag_followers();
break;
case DELAY_INTERRUPTIBLE:
case DELAY_UNINTERRUPTIBLE:
// these are simple delays that have no effect when complete
break;
default:
mpr( "You finish doing something." );
break;