From 7fcff825615a8def009ee469f0cf5a4610785a57 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sat, 28 Jun 2008 09:11:01 +0000 Subject: Bug 2004889: hack to make beam.fr_count negative if the player answered "no" to a "really fire beam" prompt; this allows fr_count to be used to also actaully count how many friends would be hit when firing a player tracer, instead of only indicating if a beam was canceled. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6179 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index b1a3c9d533..77b38da599 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -703,7 +703,7 @@ bool player_tracer( zap_type ztype, int power, bolt &pbolt, int range) // Should only happen if the player answered 'n' to one of those // "Fire through friendly?" prompts. - if (pbolt.fr_count > 0) + if (pbolt.fr_count < 0) { canned_msg(MSG_OK); you.turn_is_over = false; @@ -4335,7 +4335,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) { if (beam.thrower == KILL_YOU_MISSILE || beam.thrower == KILL_YOU) { - if (!beam.fr_count && !_beam_is_harmless(beam, mon)) + if (beam.fr_count == 1 && !_beam_is_harmless(beam, mon)) { const bool target = (beam.target_x == mon->x && beam.target_y == mon->y); @@ -4343,7 +4343,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) if (stop_attack_prompt(mon, true, target)) { mpr("Test2"); - beam.fr_count = 1; + beam.fr_count = INT_MIN; return (BEAM_STOP); } } @@ -4504,14 +4504,14 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) { if (beam.thrower == KILL_YOU_MISSILE || beam.thrower == KILL_YOU) { - if (!beam.fr_count && !_beam_is_harmless(beam, mon)) + if (beam.fr_count == 1 && !_beam_is_harmless(beam, mon)) { const bool target = (beam.target_x == mon->x && beam.target_y == mon->y); if (stop_attack_prompt(mon, true, target)) { - beam.fr_count = 1; + beam.fr_count = INT_MIN; return (BEAM_STOP); } } -- cgit v1.2.3-54-g00ecf