Also, when transforming voluntarily (i.e. not via Xom or by drawing a card) you get prompted for the loss of safe-inscribed equipment. If you opt out, it costs neither turn nor mana. There's an edge case when you change from one transformation to another one: if that fails for whatever reason you lose the turn (due to untransforming) and the spell fizzles (including mana loss).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9588 c06c8d41-db1a-0410-9941-cceddc491573
PIBNVCEVSIEQ25EYX7IZ3YEXDSOCTLUWRVFT3AUDESGZC7N3XIXQC
EXWYMMTGSYZNPI5W33IWJ3W6YVHW3CZMJAMSFRVKGBX43DG7X3IQC
QK7YLIH7SWBSL3OEBQJYVFNTW4XT5FF6U3GPKW7PEGHBLPV3TVQAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
4EZVKDQA5GM3QDTNTCKEKGH4F6LGAYNLBT756PXODKZ2B7C4ZVHAC
H5BVKRORNXTCJKFXQPTFWDURKSUFW24CGSJXBGZCJUP4DHMSVDBQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
DTOROKIMAOTTZ42ZYBWV6BBABEFW64G33UXGW334TXIG3W3MBTEAC
NDP5ANTLTYSDYLBHZPEJLO6IDU6OKA6UQHYWSBUXEEPYHZLRTYNQC
X2AT73U3LOWYTSLNNVIKOWFTV5YVTR5XW22RST7F6DAMIBQBF3XQC
HVNEDQRIUCCAUXUYVAGIUUKPUPU6JFA2PJ5LHPMIBICCCAAVVJEQC
JCWJWGMQIKQGSSFJUQRKNIWW3HBOJSHYDTOPPE5BWOJTIJTDYUTAC
LSHXZJPD44PGUAKWSZTTUGOSBFANXYZZRNTUSVDUXVWVKFDADZLQC
NCPEO4I5DFISIAOOERCB5BN3VQMBGKTYUSASWRFZAH6N3TVRWI4AC
B47JR5HJJPDKC7TIHP4BDT536J6MZNOJK36MQJNPAIH7OFYFCXSAC
BINKDWGFGUPTOA7IE5KK4ZIELGU5WC3X47MYXOWU4X43EGAC5DUAC
P3BAFR6LTI7HANQCRLZWJ7LRJYFPFYIG7OVZV4RZM5EAMODRJKZAC
TXXTMCDBT5IXMP2MRC23P3DVL4BCKBRUPTWSIG5XSQ7YOMFGBR7AC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
ASLW3Z5PAVZSWJEMMMVZT226P44EKSAD47QS72JIFJESAI3RPN3AC
3PBG6FJ6WGSR4UM3I7UQUYYCSYU3UBCKCIKYKUEEANIK72TUL4XAC
// Returns true if the player got prompted by an inscription warning and
// chose to opt out.
bool _check_transformation_inscription_warning(
const std::set<equipment_type> &remove)
{
// Check over all items to be removed or melded.
std::set<equipment_type>::const_iterator iter;
for (iter = remove.begin(); iter != remove.end(); ++iter)
{
equipment_type e = *iter;
if (you.equip[e] == -1)
continue;
const item_def& item = you.inv[you.equip[e]];
operation_types op = OPER_WEAR;
if (e == EQ_WEAPON)
op = OPER_WIELD;
else if (item.base_type == OBJ_JEWELLERY)
op = OPER_PUTON;
if (!check_old_item_warning(item, op))
return (true);
}
return (false);
}
// Transforms you into the specified form. If quiet is true, fails silently
static bool _abort_or_fizzle()
{
if (you.turn_is_over)
{
canned_msg(MSG_SPELL_FIZZLES);
return (true); // pay the necessary costs
}
return (false); // SPRET_ABORT
}
// Transforms you into the specified form. If force is true, checks for
// inscription warnings are skipped, and the transformation fails silently
untransform();
{
bool skip_wielding = false;
switch (which_trans)
{
case TRAN_STATUE:
case TRAN_LICH:
break;
default:
skip_wielding = true;
break;
}
// Skip wielding weapon if it gets unwielded again right away.
untransform(skip_wielding);
}