From 19c3c95b8dba465b3efacf8eb96798af69c170fc Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sun, 8 Nov 2009 15:26:25 +0100 Subject: 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. --- crawl-ref/source/losparam.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/losparam.cc') 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); -- cgit v1.2.3-54-g00ecf