summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-08 15:26:25 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-08 15:57:59 +0100
commit19c3c95b8dba465b3efacf8eb96798af69c170fc (patch)
tree5bb6ca79a2db28f1358b6a22451ef3784982d1c0 /crawl-ref/source/losparam.cc
parente0fbec4e41274e1e67ec8d8b74ff5c374c6e8867 (diff)
downloadcrawl-ref-19c3c95b8dba465b3efacf8eb96798af69c170fc.tar.gz
crawl-ref-19c3c95b8dba465b3efacf8eb96798af69c170fc.zip
Add opc_no_trans and use that for see_cell_no_trans.
The difference between no_trans and solid is whether granite statues are considered opaque. Granite statues are somewhat weird in that they behave completely differently from other statues: You can't shoot missiles at or past them, no items can be in their cell, etc.
Diffstat (limited to 'crawl-ref/source/losparam.cc')
-rw-r--r--crawl-ref/source/losparam.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index 68e6aa2e18..0c8f41cead 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -37,8 +37,24 @@ opacity_type opacity_fullyopaque::operator()(const coord_def& p) const
return OPC_CLEAR;
}
+// Make transparent walls block in addition to normal LOS.
+opacity_type opacity_no_trans::operator()(const coord_def& p) const
+{
+ dungeon_feature_type f = env.grid(p);
+ if (feat_is_opaque(f) || feat_is_wall(f))
+ return OPC_OPAQUE;
+ else if (is_opaque_cloud(env.cgrid(p)))
+ return OPC_HALF;
+ else if (f == DNGN_TREES)
+ return OPC_HALF;
+ else if (monster_at(p) && monster_at(p)->type == MONS_BUSH)
+ return OPC_HALF;
+ else
+ return OPC_CLEAR;
+}
+
// Make anything solid block in addition to normal LOS.
-// XXX: Are trees, bushes solid?
+// That's just granite statues in addition to opacity_no_trans.
opacity_type opacity_solid::operator()(const coord_def& p) const
{
dungeon_feature_type f = env.grid(p);