summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 10:28:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 10:28:10 +0000
commit22e375d42eabd760283d4e0d8ea42c65e66108af (patch)
treec960394e8309f301773b38212a679eab3d303747 /crawl-ref/source/spells1.cc
parentc48e3fbe888d67a5abf206614ca7655629840dda (diff)
downloadcrawl-ref-22e375d42eabd760283d4e0d8ea42c65e66108af.tar.gz
crawl-ref-22e375d42eabd760283d4e0d8ea42c65e66108af.zip
Modify Evaporate and Stinking Cloud to prompt when firing through
allies. Note: This does still not handle the actual clouds, just the basic beam. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5701 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc50
1 files changed, 34 insertions, 16 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index e151ef26bd..d4b474bd17 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -552,27 +552,45 @@ bool conjure_flame(int pow)
return true;
}
-int stinking_cloud( int pow, bolt &beem )
+bool stinking_cloud( int pow, bolt &beem )
{
- beem.name = "ball of vapour";
- beem.colour = GREEN;
- beem.range = 6;
- beem.rangeMax = 6;
- beem.damage = dice_def( 1, 0 );
- beem.hit = 20;
- beem.type = dchar_glyph(DCHAR_FIRED_ZAP);
- beem.flavour = BEAM_MMISSILE;
- beem.ench_power = pow;
+ beem.name = "ball of vapour";
+ beem.colour = GREEN;
+ beem.range = 6;
+ beem.rangeMax = 6;
+ beem.damage = dice_def( 1, 0 );
+ beem.hit = 20;
+ beem.type = dchar_glyph(DCHAR_FIRED_ZAP);
+ beem.flavour = BEAM_MMISSILE;
+ beem.ench_power = pow;
beem.beam_source = MHITYOU;
- beem.thrower = KILL_YOU;
+ beem.thrower = KILL_YOU;
+ beem.is_beam = false;
beem.aux_source.clear();
- beem.is_beam = false;
- beem.is_tracer = false;
+ // Fire tracer.
+ beem.source_x = you.x_pos;
+ beem.source_y = you.y_pos;
+ beem.can_see_invis = player_see_invis();
+ beem.smart_monster = true;
+ beem.attitude = ATT_FRIENDLY;
+ beem.fr_count = 0;
+ beem.is_tracer = true;
fire_beam(beem);
- return (1);
-} // end stinking_cloud()
+ if (beem.fr_count > 0)
+ {
+ // We don't want to fire through friendlies.
+ canned_msg(MSG_OK);
+ return (false);
+ }
+
+ // Really fire.
+ beem.is_tracer = false;
+ fire_beam(beem);
+
+ return (true);
+}
int cast_big_c(int pow, cloud_type cty, kill_category whose, bolt &beam)
{
@@ -590,7 +608,7 @@ void big_cloud(cloud_type cl_type, kill_category whose,
static bool _mons_hostile(const monsters *mon)
{
- // needs to be done this way because of friendly/neutral enchantments
+ // Needs to be done this way because of friendly/neutral enchantments.
return (!mons_friendly(mon) && !mons_neutral(mon));
}