summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 19:57:56 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 19:57:56 +0000
commitda9c4accf8c06831d99a0c1a6e66d20b480c26b0 (patch)
tree2172758653068e6d80a96a723ed332d518056b53 /crawl-ref/source/spells4.cc
parent9b41135da821d07d54c7a6ee75ed6dcbd19e9322 (diff)
downloadcrawl-ref-da9c4accf8c06831d99a0c1a6e66d20b480c26b0.tar.gz
crawl-ref-da9c4accf8c06831d99a0c1a6e66d20b480c26b0.zip
Added the Portaled Projectile spell, following 1686312.
Hopefully I didn't break the fsim_ranged code in the process. PP is now arbitrarily stuck into Spatial Translocations; it will be moved out when we add a Book of Archery. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1670 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index dc389c983f..0f25c9dee1 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -30,6 +30,7 @@
#include "dungeon.h"
#include "effects.h"
#include "it_use2.h"
+#include "item_use.h"
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
@@ -2707,6 +2708,28 @@ void cast_twist(int pow)
return;
} // end cast_twist()
+bool cast_portaled_projectile(int pow, bolt& beam)
+{
+ if ( pow > 50 )
+ pow = 50;
+
+ if ( grid_is_solid(beam.target_x, beam.target_y) )
+ {
+ mpr("You can't shoot at gazebos.");
+ return false;
+ }
+
+ const int idx = get_fire_item_index();
+ if ( idx == ENDOFPACK )
+ {
+ mpr("No suitable missiles.");
+ return false;
+ }
+
+ throw_it( beam, idx, true, random2(pow/4) );
+ return true;
+}
+
//
// This version of far strike is a bit too creative for level one, in
// order to make it work we needed to put a lot of restrictions on it