diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-08 12:34:34 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-08 12:34:34 +0000 |
commit | 1688c6756463c584f8130785a7f84dfece538fdf (patch) | |
tree | dca3df0dd0848272b94eaefa1fc5db6fa9f686b8 /crawl-ref/source/spl-cast.cc | |
parent | 98ffb74e5af50771a94e1b92a0bd97dc804ab8cf (diff) | |
download | crawl-ref-1688c6756463c584f8130785a7f84dfece538fdf.tar.gz crawl-ref-1688c6756463c584f8130785a7f84dfece538fdf.zip |
The accuracy of dragon breath is now halved if you're wielding
a weapon of dragon slaying (with the somewhat weak reasoning that
a dragon will try to avert its eyes from your awful weapon).
From how I read the code this function is only called if you
are attacked as monsters will not breathe at other monsters, so
that the above check is valid.
Also fix
1865179: Airstrike now wakes (and annoys) monsters.
1861118: Evaporate now can be cancelled during potion or direction choice.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3223 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 3fed232a04..40dde8443a 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -30,6 +30,7 @@ #include "food.h" #include "format.h" #include "initfile.h" +#include "invent.h" #include "it_use2.h" #include "item_use.h" #include "itemname.h" @@ -864,12 +865,15 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) const int flags = get_spell_flags(spell); + int potion = -1; + // XXX: This handles only some of the cases where spells need targeting... // there are others that do their own that will be missed by this // (and thus will not properly ESC without cost because of it). // Hopefully, those will eventually be fixed. -- bwr if (flags & SPFLAG_TARGETING_MASK) { + mpr("targeting mask is true"); targ_mode_type targ = (testbits(flags, SPFLAG_HELPFUL) ? TARG_FRIEND : TARG_ENEMY); @@ -890,6 +894,20 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) mprf(MSGCH_PROMPT, "Where do you want to aim %s?", you.inv[idx].name(DESC_NOCAP_YOUR).c_str()); } + else if (spell == SPELL_EVAPORATE) + { + potion = prompt_invent_item( "Throw which potion?", + MT_INVLIST, OBJ_POTIONS ); + if (potion == -1) + return (SPRET_ABORT); + else if (you.inv[potion].base_type != OBJ_POTIONS) + { + mpr( "This spell works only on potions!" ); + return (SPRET_ABORT); + } + mprf(MSGCH_PROMPT, "Where do you want to aim %s?", + you.inv[potion].name(DESC_NOCAP_YOUR).c_str()); + } else if (dir == DIR_DIR) mpr(prompt? prompt : "Which direction? ", MSGCH_PROMPT); @@ -1813,7 +1831,8 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) break; case SPELL_EVAPORATE: - cast_evaporate(powc); + if ( !cast_evaporate(powc, beam, potion) ) + return SPRET_ABORT; break; case SPELL_FULSOME_DISTILLATION: |