summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 22:43:27 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 22:43:27 +0000
commit7d9c2931b71d159f79d3b422bb891b5afdc2e641 (patch)
tree01e056817e77ba8fac38a12068cf177674ea497c /crawl-ref/source/beam.cc
parentc9a8094eec1acb94149980937c60d8c05f8d901b (diff)
downloadcrawl-ref-7d9c2931b71d159f79d3b422bb891b5afdc2e641.tar.gz
crawl-ref-7d9c2931b71d159f79d3b422bb891b5afdc2e641.zip
Beams now get -2 to-hit for every smoke square they pass through.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1674 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index cd972897b5..ca65e46336 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1334,6 +1334,10 @@ void fire_beam( bolt &pbolt, item_def *item )
tx = ray.x();
ty = ray.y();
+ // shooting through clouds affects accuracy
+ if ( env.cgrid[tx][ty] != EMPTY_CLOUD )
+ pbolt.hit = std::max(pbolt.hit - 2, 0);
+
// see if tx, ty is blocked by something
if (grid_is_solid(grd[tx][ty]))
{
@@ -2977,8 +2981,6 @@ static std::string beam_zapper(const bolt &beam)
// return amount of extra range used up by affectation of the player
static int affect_player( bolt &beam )
{
- int beamHit;
-
// digging -- don't care.
if (beam.flavour == BEAM_DIGGING)
return (0);
@@ -3008,7 +3010,7 @@ static int affect_player( bolt &beam )
beam.msg_generated = true;
// use beamHit, NOT beam.hit, for modification of tohit.. geez!
- beamHit = beam.hit;
+ int beamHit = beam.hit;
// Monsters shooting at an invisible player are very inaccurate.
if (you.duration[DUR_INVIS] && !beam.can_see_invis)