diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-27 15:07:07 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-27 15:07:07 +0000 |
commit | 78c738241ffd14b14ea6f7579bb827a617c2187e (patch) | |
tree | a7db588a67d6462fa302a71e2f96206c5e4e75a8 /crawl-ref/source/beam.cc | |
parent | c6e44918d2d662a753265e7852a3cb538b034300 (diff) | |
download | crawl-ref-78c738241ffd14b14ea6f7579bb827a617c2187e.tar.gz crawl-ref-78c738241ffd14b14ea6f7579bb827a617c2187e.zip |
Beam-cycling in direction().
You can use SPACE to cycle between beams, ':' to hide the beam.
Will probably need a future rewrite...getting this in for testing.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@893 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 38a2000978..00f8aaea03 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1263,8 +1263,11 @@ void fire_beam( struct bolt &pbolt, item_def *item ) ray_def ray; - find_ray( pbolt.source_x, pbolt.source_y, pbolt.target_x, pbolt.target_y, - true, ray); + if ( pbolt.chose_ray ) + ray = pbolt.ray; + else + find_ray( pbolt.source_x, pbolt.source_y, + pbolt.target_x, pbolt.target_y, true, ray); if ( !pbolt.aimed_at_feet ) ray.advance(); @@ -4398,7 +4401,8 @@ bolt::bolt() : range(0), rangeMax(0), type(SYM_ZAP), colour(BLACK), fr_power(0), foe_power(0), is_tracer(false), aimed_at_feet(false), msg_generated(false), in_explosion_phase(false), smart_monster(false), - can_see_invis(false), is_friendly(false), foe_ratio(0) + can_see_invis(false), is_friendly(false), foe_ratio(0), + chose_ray(false) { } void bolt::set_target(const dist &d) @@ -4409,6 +4413,10 @@ void bolt::set_target(const dist &d) target_x = d.tx; target_y = d.ty; + chose_ray = d.choseRay; + if ( d.choseRay ) + ray = d.ray; + if (d.isEndpoint) aimed_at_spot = true; } |