on the square.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2852 c06c8d41-db1a-0410-9941-cceddc491573
7Q4H6B62UZACQOUDHCHPMPBYEBXM5GVQINIHVHM4KLRENSH6VGTAC
VXWHZPSSJAOUIBJVCYGYOHILZFVDDVKUY5JMFFCQSYCXL3NAZIKAC
LUNOTEIMYZJ7JL5P55GEHUVSDEZMYX3TWYUB2ABRHAYJEWQSSXIAC
WZNB427K3EUNV3FMVXLQTM4UIHER4FIKQXWLUUXRNQC3OQ33VQYAC
DLVXY6DBP65B3RGWW4PNBEBPBNHNM3LSRYD36F3XDARFY7SPSJYAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
MBBPLL4SZUB3JUUYQYLZW7S5OXRCEGJX3WWADOQXGHWQ7BIKCY5QC
CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC
ARVJY7XPMCHI4IAQMD2VUWTAXQLCRNVSM2MK3YT4S4WHQYFTLEMAC
74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC
MMND435BVG6KUGRUEMSHBQX27FRASBK5HJ6OSKLPON2LOG63L75QC
5R4WV4H5SNIM5WU2X33JJ63HIEGKCXN2HELZ6FRRKKANPLMRLF3QC
264FLET5STFALEWUDOEFCR273Y5CY2WZDHL56WHZUAQ635RUN6MAC
bool canceled_butcher = false;
bool found_nonzero_corpses = false;
for (int objl = igrd[you.x_pos][you.y_pos]; objl != NON_ITEM;
objl = mitm[objl].link)
// First determine how many things there are to butcher.
int num_corpses = 0;
int corpse_id = -1;
for (int o = igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link)
if ( (mitm[objl].base_type != OBJ_CORPSES) ||
(mitm[objl].sub_type != CORPSE_BODY) )
continue;
found_nonzero_corpses = true;
// offer the possibility of butchering
snprintf(info, INFO_SIZE, "Butcher %s?",
mitm[objl].name(DESC_NOCAP_A).c_str());
const int answer = yesnoquit( info, true, 'n', false );
if ( answer == -1 )
if (mitm[o].base_type == OBJ_CORPSES &&
mitm[o].sub_type == CORPSE_BODY)
// Now pick what you want to butcher. This is only a problem
// if there are several corpses on the square.
if ( num_corpses == 0 )
{
mpr("There isn't anything to dissect here.");
return false;
}
else if ( num_corpses > 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) ||
(mitm[o].sub_type != CORPSE_BODY) )
continue;
// offer the possibility of butchering
std::string prompt = "Butcher " + mitm[o].name(DESC_NOCAP_A);
prompt += '?';
const int answer = yesnoquit( prompt.c_str(), true, 'n', false );
if ( answer == 1 )
{
corpse_id = o;
break;
}
else if ( answer == -1 )
{
canceled_butcher = true;
corpse_id = -1;
break;
}
}
}
// Do the actual butchery, if we found a good corpse.
if ( corpse_id != -1 )
{
if (coinflip())
simple_god_message(" refuses to accept that mouldy "
"sacrifice!", you.religion);
else
simple_god_message(" demands fresh blood!", you.religion);
simple_god_message(coinflip() ?
" refuses to accept that mouldy "
"sacrifice!" :
" demands fresh blood!", you.religion);