when casting the spell (as opposed to using the god ability.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8360 c06c8d41-db1a-0410-9941-cceddc491573
Z4GIMEXHU6YMHSULVXDODCADGM6S2QOG6N7D6J6W36HYXZHPXV2AC DVQMYOEH2UDXRU6254CIXZLCNPZD2ENZTBXXSHBDOHRIG6DZNRTQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC KX6HOBTF5OBZLH2VNEFHH6YAX66FSE6JGBY5I2WIAW5IEJUGNL6AC SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC JJULXW764V5C2HJKZNWQAEWB6QM5YZADD7ZCE35LYTBFEM6PMYCAC QKGDOYIYKE6B36ION5O2DRW65DWWPZMYNWJVH7LJJ7FPGGM2MYAQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC OFH2B2UZBK43QLFQBZ54FOCFLFNE54BZVDNCEUGDTBCUGNVZULIQC DDU4A3JGN5IUIPP5IASOODKPR2WBHSDSV4FITZ6HNXNSXXQACWAQC FIYBXLWALQINNQTHG2KNDUUTAQAZRDDLXW2XOVSKDKBADJ3XCJ4AC NG53L53MSFQZAIVKHG54IEMXNJ33AYVPF2OZM4MMJFDKEJCGPBSAC // query - conditional ordering is important {dlb}:while (true){mpr( "Forget which spell ([?*] list [ESC] exit)? ", MSGCH_PROMPT );
mpr("You don't know any spells.");return (false);}
redraw_screen();}
if (keyin == '?' || keyin == '*'){keyin = list_spells(false);redraw_screen();}if (!isalpha(keyin))mesclr(true);elsebreak;}const spell_type spell = get_spell_by_letter(keyin);const int slot = get_spell_slot_by_letter(keyin);
// Actual handling begins here {dlb}:const spell_type spell = get_spell_by_letter( keyin );const int slot = get_spell_slot_by_letter( keyin );
if (!force &&random2(you.skills[SK_SPELLCASTING]) < random2(spell_difficulty(spell))){mpr("Oops! This spell sure is a blunt instrument.");forget_map(20 + random2(50));}else{const int ep_gain = spell_mana(spell);del_spell_from_memory_by_slot(slot);
if (!force && you.religion != GOD_SIF_MUNA&& random2(you.skills[SK_SPELLCASTING])< random2(spell_difficulty( spell ))){mpr("Oops! This spell sure is a blunt instrument.");forget_map(20 + random2(50));}else{ep_gain = spell_mana( spell );del_spell_from_memory_by_slot( slot );if (ep_gain > 0){inc_mp(ep_gain, false);mpr( "The spell releases its latent energy back to you as ""it unravels." );}}
inc_mp(ep_gain, false);mpr("The spell releases its latent energy back to you as ""it unravels.");