From 7d9c2931b71d159f79d3b422bb891b5afdc2e641 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 27 Jun 2007 22:43:27 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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) -- cgit v1.2.3-54-g00ecf