summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-15 20:32:51 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-15 20:32:51 +0000
commit89162833bce0a3fc8d4b75dd3300dc6db24e4666 (patch)
treeca071c4a8690e06699305f91aa1853448af82150 /crawl-ref/source/spl-cast.cc
parent5991be809a9b206d7450cdf455157e40d98d40e2 (diff)
downloadcrawl-ref-89162833bce0a3fc8d4b75dd3300dc6db24e4666.tar.gz
crawl-ref-89162833bce0a3fc8d4b75dd3300dc6db24e4666.zip
Applied Enne's fix to 1795522: "show_beam shouldn't work
when just looking..." While I was at it, I also added another parameter needs_path that is set to false for spells that can be applied directly to a target (SPFLAG_GRID, SPFLAG_TARGET) such as Smiting, Conjure Flame or Freezing Cloud, so for these the initial beam path doesn't show, even if the option should be set to true. Note "initial beam path" - you can still toggle it to show the path anyway. For cases such as this we might enforce not drawing the path but there would have to be some kind of feedback, so the player doesn't go crazy trying to toggle the option. ;) I'll probably do it later, once I've found a way to give the information. Or would that be too spoily, in any case? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2091 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index dbbc362fae..1a5f611d69 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -31,6 +31,7 @@
#include "format.h"
#include "initfile.h"
#include "it_use2.h"
+#include "item_use.h"
#include "itemname.h"
#include "itemprop.h"
#include "macro.h"
@@ -859,10 +860,24 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail )
testbits( flags, SPFLAG_DIR ) ? DIR_DIR : DIR_NONE);
const char *prompt = get_spell_target_prompt(spell);
- if (dir == DIR_DIR)
+ if (spell == SPELL_PORTALED_PROJECTILE)
+ {
+ const int idx = get_fire_item_index();
+ if ( idx == ENDOFPACK )
+ {
+ mpr("No suitable missiles.");
+ return (SPRET_ABORT);
+ }
+ mprf(MSGCH_PROMPT, "Where do you want to aim %s?",
+ you.inv[idx].name(DESC_NOCAP_YOUR).c_str());
+ }
+ else if (dir == DIR_DIR)
mpr(prompt? prompt : "Which direction? ", MSGCH_PROMPT);
-
- if ( !spell_direction( spd, beam, dir, targ, prompt ) )
+
+ bool needs_path =
+ !(testbits(flags, SPFLAG_GRID) || testbits(flags, SPFLAG_TARGET));
+
+ if ( !spell_direction( spd, beam, dir, targ, needs_path, prompt ) )
return (SPRET_ABORT);
if (testbits( flags, SPFLAG_NOT_SELF ) && spd.isMe)