From 970cd5283c2c84300dd1f309da53de2ab010ee9d Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 8 May 2007 21:41:35 +0000 Subject: 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 --- crawl-ref/source/spells1.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/spells1.cc') 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 ) { -- cgit v1.2.3-54-g00ecf