|
From: <dsh...@us...> - 2007-04-01 20:44:22
|
Revision: 1176
http://svn.sourceforge.net/crawl-ref/?rev=1176&view=rev
Author: dshaligram
Date: 2007-04-01 13:44:21 -0700 (Sun, 01 Apr 2007)
Log Message:
-----------
Fixed vampiric drain trying to get spell direction twice.
Modified Paths:
--------------
trunk/crawl-ref/source/spells2.cc
trunk/crawl-ref/source/spells2.h
trunk/crawl-ref/source/spl-cast.cc
Modified: trunk/crawl-ref/source/spells2.cc
===================================================================
--- trunk/crawl-ref/source/spells2.cc 2007-04-01 20:24:59 UTC (rev 1175)
+++ trunk/crawl-ref/source/spells2.cc 2007-04-01 20:44:21 UTC (rev 1176)
@@ -990,31 +990,14 @@
}
} // end drain_life()
-int vampiric_drain(int pow)
+int vampiric_drain(int pow, dist &vmove)
{
int inflicted = 0;
int mgr = 0;
struct monsters *monster = 0; // NULL
- struct dist vmove;
- dirc:
- mpr("Which direction?", MSGCH_PROMPT);
- direction( vmove, DIR_DIR, TARG_ENEMY );
-
- if (!vmove.isValid)
- {
- canned_msg(MSG_SPELL_FIZZLES);
- return -1;
- }
-
mgr = mgrd[you.x_pos + vmove.dx][you.y_pos + vmove.dy];
- if (vmove.dx == 0 && vmove.dy == 0)
- {
- mpr("You can't do that.");
- goto dirc;
- }
-
if (mgr == NON_MONSTER)
{
mpr("There isn't anything there!");
Modified: trunk/crawl-ref/source/spells2.h
===================================================================
--- trunk/crawl-ref/source/spells2.h 2007-04-01 20:24:59 UTC (rev 1175)
+++ trunk/crawl-ref/source/spells2.h 2007-04-01 20:44:21 UTC (rev 1176)
@@ -56,11 +56,12 @@
int summon_elemental(int pow, int restricted_type, unsigned char unfriendly);
+class dist;
// last updated 24may2000 {dlb}
/* ***********************************************************************
* called from: spell
* *********************************************************************** */
-int vampiric_drain(int pow);
+int vampiric_drain(int pow, dist &);
// last updated 24may2000 {dlb}
Modified: trunk/crawl-ref/source/spl-cast.cc
===================================================================
--- trunk/crawl-ref/source/spl-cast.cc 2007-04-01 20:24:59 UTC (rev 1175)
+++ trunk/crawl-ref/source/spl-cast.cc 2007-04-01 20:44:21 UTC (rev 1176)
@@ -880,6 +880,9 @@
testbits( flags, SPFLAG_GRID ) ? DIR_TARGET :
testbits( flags, SPFLAG_DIR ) ? DIR_DIR : DIR_NONE);
+ if (dir == DIR_DIR)
+ mpr("Which direction? ", MSGCH_PROMPT);
+
if (spell_direction( spd, beam, dir, targ,
get_spell_target_prompt(spc2) ) == -1)
return (SPRET_ABORT);
@@ -1315,7 +1318,7 @@
break;
case SPELL_VAMPIRIC_DRAINING:
- vampiric_drain(powc);
+ vampiric_drain(powc, spd);
break;
case SPELL_SUMMON_WRAITHS:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|