summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/areas.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-01-09 15:17:35 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-01-10 11:27:23 -0700
commit01b9f1c5106c320d26b96b4ac6bf6e9c4f95e357 (patch)
tree5f2708ba8439c4abd24c1625cddcfa81970c6ed0 /crawl-ref/source/areas.cc
parentd9cdcdccebdd896afc67071724d77559d8edb0cd (diff)
downloadcrawl-ref-01b9f1c5106c320d26b96b4ac6bf6e9c4f95e357.tar.gz
crawl-ref-01b9f1c5106c320d26b96b4ac6bf6e9c4f95e357.zip
Shadow god - umbra.
This works exactly like TSO's halo, only it's an umbra.
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r--crawl-ref/source/areas.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc
index a0d2f59192..c77f0b9887 100644
--- a/crawl-ref/source/areas.cc
+++ b/crawl-ref/source/areas.cc
@@ -707,10 +707,20 @@ bool actor::umbraed() const
return ::umbraed(pos());
}
-// Stub for player umbra.
int player::umbra_radius2() const
{
- return -1;
+ int size = -1;
+
+ if (religion == GOD_DSOMETHING && piety >= piety_breakpoint(0)
+ && !penance[GOD_DSOMETHING])
+ {
+ // Preserve the middle of old radii.
+ const int r = piety - 10;
+ // The cap is 64, just less than the LOS of 65.
+ size = min(LOS_RADIUS*LOS_RADIUS, r * r / 400);
+ }
+
+ return size;
}
int monster::umbra_radius2() const