fail-safe mechanism for any transformation to abort if it would cause death by stat loss. (For other transformations this could happen because of the auto-removal of statboosting equipment.) Note that the Flight card already has a chance of turning you into a bat (or a spider). Of course the same applies here, as well as when casting spells.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5791 c06c8d41-db1a-0410-9941-cceddc491573
DTOROKIMAOTTZ42ZYBWV6BBABEFW64G33UXGW334TXIG3W3MBTEAC
WQ2GFFH6HN7G2LS7UGO23E6PWWT5QV2XULW6RMAYTE4SGF2HRTLAC
UEI5JAVCMN7Y2SACTEZPZSNFJWOJTC55G24Q6LKQCT4XNDH5ZQIAC
5KTPCJG42MF2B34CEH6VXAJIOZR6QOS2BWYNW7DXM3WA7N3GH4HQC
H5BVKRORNXTCJKFXQPTFWDURKSUFW24CGSJXBGZCJUP4DHMSVDBQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
6CZYPP67SB2M3SQS3QIPJWHZY7PJIRTTBH5CLORV3AALVTJIL5MQC
JCWJWGMQIKQGSSFJUQRKNIWW3HBOJSHYDTOPPE5BWOJTIJTDYUTAC
J7KCPTGASQNRAKVKQ5FCXZ75E75PK7I2BB6MFSI3COWU6HRKTWSAC
P2ZCF3BBG523ZEOD6XQA4X5YEHBTWH3IM33YVHXP2SQ5POXZIH4QC
BZMLXBTB63CXPZZPFXM4VLE7IBXPBEZ6YLM4MSNQGJR4L5IBM3OAC
7YUGK5Q64KG5O7GJGTUBRRLHAHBCJ5YOE23YUPT6UBKUSB67CYAQC
VXMRWJ2CPHIB2NAHMZKUV7DAFA7GLVA32WDS53WNT3BIDHK6GOZQC
3KAINFIXO7WNWGUGZB43EUNFRS2ZPBLQZDTY456QACMRHYIJ7WDAC
Y2CHAC4BULOT2UHD47F7JTSLUGGMVHYOJZB4W76AXMSLIDVHULEQC
DH3YTI6VVI727SQXO4CXSDCSBG2UN3UAWLFULBGRLBVH22ACRXIAC
B7MSPF6X2RLGWN4M6ZZF3WSOPKGYPTTD7LIJVST7DXN27DG6JHNAC
if (check_for_cursed_equipment( rem_stuff ))
if (check_for_cursed_equipment(rem_stuff, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
if (check_transformation_stat_loss(rem_stuff, quiet))
if (check_for_cursed_equipment( rem_stuff ))
return false;
if (check_for_cursed_equipment(rem_stuff, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
if (check_transformation_stat_loss(rem_stuff, quiet))
return (false);
if ( power_level == 0 )
transform(random2(power/4), coinflip() ? TRAN_SPIDER : TRAN_BAT);
if ( power_level >= 1 )
// Assume something _will_ happen.
bool success = true;
if (power_level == 0)
{
if (!transform(random2(power/4), coinflip() ? TRAN_SPIDER : TRAN_BAT,
true))
{
// Oops, something went wrong here (either because of cursed
// equipment or the possibility of stat loss).
success = false;
}
}
else if (power_level >= 1)
transform(random2(power/4), trans);
// Might fail, e.g. because of cursed equipment or potential death by
// stat loss. Aren't we being nice?
if (!transform(random2(power/4), trans, true))
canned_msg(MSG_NOTHING_HAPPENS);