summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-08 21:41:35 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-08 21:41:35 +0000
commit970cd5283c2c84300dd1f309da53de2ab010ee9d (patch)
tree3a7c806a9e04ce02bfde67958d84742eadc77740 /crawl-ref/source/spells1.cc
parent8371272361c275f18e79eb6c223421f77286de94 (diff)
downloadcrawl-ref-970cd5283c2c84300dd1f309da53de2ab010ee9d.tar.gz
crawl-ref-970cd5283c2c84300dd1f309da53de2ab010ee9d.zip
Conjuring flame onto a fire cloud now makes the fire yours and lengthens
its duration. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1428 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 03351e2ff0..459c4e2c1f 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -401,7 +401,8 @@ void identify(int power)
while (id_used > 0);
} // end identify()
-int conjure_flame(int pow)
+// return whether the spell was actually cast
+bool conjure_flame(int pow)
{
struct dist spelld;
@@ -422,7 +423,7 @@ int conjure_flame(int pow)
if (!spelld.isValid)
{
canned_msg(MSG_OK);
- return (-1);
+ return false;
}
if (!see_grid(spelld.tx, spelld.ty))
@@ -431,15 +432,26 @@ int conjure_flame(int pow)
continue;
}
- if (grid_is_solid(grd[ spelld.tx ][ spelld.ty ])
- || mgrd[ spelld.tx ][ spelld.ty ] != NON_MONSTER
- || env.cgrid[ spelld.tx ][ spelld.ty ] != EMPTY_CLOUD)
+ const int cloud = env.cgrid[spelld.tx][spelld.ty];
+
+ if (grid_is_solid(grd[ spelld.tx ][ spelld.ty ]) ||
+ mgrd[ spelld.tx ][ spelld.ty ] != NON_MONSTER ||
+ (cloud != EMPTY_CLOUD && env.cloud[cloud].type != CLOUD_FIRE))
{
mpr( "There's already something there!" );
continue;
}
+ else if ( cloud != EMPTY_CLOUD )
+ {
+ // reinforce the cloud - but not too much
+ mpr( "The fire roars with new energy!" );
+ const int extra_dur = 2 + std::min(random2(pow) / 2, 20);
+ env.cloud[cloud].decay += extra_dur * 5;
+ env.cloud[cloud].whose = KC_YOU;
+ return true;
+ }
- break;
+ break;
}
int durat = 5 + (random2(pow) / 2) + (random2(pow) / 2);
@@ -448,8 +460,8 @@ int conjure_flame(int pow)
durat = 23;
place_cloud( CLOUD_FIRE, spelld.tx, spelld.ty, durat, KC_YOU );
- return (1);
-} // end cast_conjure_flame()
+ return true;
+}
int stinking_cloud( int pow, bolt &beem )
{