summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ray.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 14:29:42 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 14:29:42 +0000
commit596223a14698390d7eb422e80939f460a5f32a2f (patch)
tree5195a0ce5820b1a2da8f52aac6bfab27caf94919 /crawl-ref/source/ray.h
parentf437c6820cd1eb8803b06000020451614af903d9 (diff)
downloadcrawl-ref-596223a14698390d7eb422e80939f460a5f32a2f.tar.gz
crawl-ref-596223a14698390d7eb422e80939f460a5f32a2f.zip
Chaos beams now bounce off walls at a completely random angle.
NOTE: This uses a weird hack to prevent a bug which sometimes happens when a chaos beam is fired into the corner of a room. I think it's caused by ray.advance(true) and ray.regress() not being symmetrical. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7783 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ray.h')
-rw-r--r--crawl-ref/source/ray.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/ray.h b/crawl-ref/source/ray.h
index 17a2547e8a..015b8ef723 100644
--- a/crawl-ref/source/ray.h
+++ b/crawl-ref/source/ray.h
@@ -34,6 +34,11 @@ public:
void advance_and_bounce();
void regress();
+ // Gets/sets the slope in terms of degrees, with 0 = east, 90 = north,
+ // 180 = west, 270 = south, 360 = east, -90 = south, etc
+ double get_degrees() const;
+ void set_degrees(double deg);
+
private:
int raw_advance();
double reflect(bool x, double oldc, double newc) const;