diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-28 09:11:01 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-28 09:11:01 +0000 |
commit | 7fcff825615a8def009ee469f0cf5a4610785a57 (patch) | |
tree | 7de9a99b2e91b765e47db1850419201ee3e6edb0 /crawl-ref/source/beam.cc | |
parent | 41cdec798a900c65d1941d3f0ad011569abccc71 (diff) | |
download | crawl-ref-7fcff825615a8def009ee469f0cf5a4610785a57.tar.gz crawl-ref-7fcff825615a8def009ee469f0cf5a4610785a57.zip |
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
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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); } } |