summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/spells1.cc28
-rw-r--r--crawl-ref/source/spells1.h2
-rw-r--r--crawl-ref/source/spl-cast.cc2
3 files changed, 22 insertions, 10 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 )
{
diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h
index 62f9ae37cb..77e32371dd 100644
--- a/crawl-ref/source/spells1.h
+++ b/crawl-ref/source/spells1.h
@@ -79,7 +79,7 @@ int cast_fire_storm(int powc, bolt &beam);
bool cast_revivification(int power);
void cast_berserk(void);
void cast_ring_of_flames(int power);
-int conjure_flame(int pow);
+bool conjure_flame(int pow);
void extension(int pow);
int fireball(int power, bolt &beam);
int stinking_cloud(int pow, bolt &beam);
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 64c56ff9fb..6314f979a8 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -998,7 +998,7 @@ spret_type your_spells( spell_type spc2, int powc, bool allow_fail )
break;
case SPELL_CONJURE_FLAME:
- if (conjure_flame(powc) == -1)
+ if (!conjure_flame(powc))
return (SPRET_ABORT);
break;