diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-28 11:26:54 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-28 11:26:54 +0000 |
commit | 30972f8855a581f440406e7bc5880f18a489efb4 (patch) | |
tree | d9f5f7e5e7d7e6cbffb6d579704b6cf61961b17b /crawl-ref/source/spl-cast.cc | |
parent | 69d26de6e5bbfb0746e85fe5f620960578cd79bf (diff) | |
download | crawl-ref-30972f8855a581f440406e7bc5880f18a489efb4.tar.gz crawl-ref-30972f8855a581f440406e7bc5880f18a489efb4.zip |
Fix 2021696: allow_self_target = no even forbidding self-targetting for
area effect spells (now prompts)
Fix 2028704: spell view toggle 'I' preventing forgetting spell slot 'I'
Allow intelligent summoned monsters to equip themselves.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6703 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 33d31faeb5..dc0609259e 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -191,7 +191,7 @@ static std::string _spell_extra_description(spell_type spell) return desc.str(); } -int list_spells() +int list_spells(bool toggle_with_I) { ToggleableMenu spell_menu(MF_SINGLESELECT | MF_ANYPRINTABLE | MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING); @@ -203,12 +203,22 @@ int list_spells() " Hunger Level", MEL_TITLE)); spell_menu.set_highlighter(NULL); - spell_menu.set_more(formatted_string("Press '!' or 'I' to toggle spell view.")); spell_menu.add_toggle_key('!'); - spell_menu.add_toggle_key('I'); + if (toggle_with_I) + { + spell_menu.set_more( + formatted_string("Press '!' or 'I' to toggle spell view.")); + spell_menu.add_toggle_key('I'); + } + else + { + spell_menu.set_more( + formatted_string("Press '!' to toggle spell view.")); + } + spell_menu.set_tag("spell"); - for ( int i = 0; i < 52; ++i ) + for (int i = 0; i < 52; ++i) { const char letter = index_to_letter(i); const spell_type spell = get_spell_by_letter(letter); @@ -1037,7 +1047,10 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) const bool needs_path = (!testbits(flags, SPFLAG_GRID) && !testbits(flags, SPFLAG_TARGET)); - if (!spell_direction(spd, beam, dir, targ, needs_path, true, prompt, + const bool dont_cancel_me = testbits(flags, SPFLAG_AREA); + + if (!spell_direction(spd, beam, dir, targ, needs_path, true, + dont_cancel_me, prompt, testbits(flags, SPFLAG_NOT_SELF))) { return (SPRET_ABORT); |