From 78c738241ffd14b14ea6f7579bb827a617c2187e Mon Sep 17 00:00:00 2001 From: haranp Date: Sat, 27 Jan 2007 15:07:07 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 14 +++++++++++--- 1 file changed, 11 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 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; } -- cgit v1.2.3-54-g00ecf