diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-12-11 17:06:46 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-12-11 17:06:46 +0100 |
commit | d09b4f16275a05d49ed29aef992ecb85212f287c (patch) | |
tree | ce744de21bb6e49405ba2b44d62bb28517071bf8 /crawl-ref/source/losparam.cc | |
parent | 00c8f8cc5f9aa9d7904908fa6590781b75220898 (diff) | |
download | crawl-ref-d09b4f16275a05d49ed29aef992ecb85212f287c.tar.gz crawl-ref-d09b4f16275a05d49ed29aef992ecb85212f287c.zip |
Disambiguate the LOS_SOLID confusion.
Its name suggests it's about line of effect, while in fact it's both effect
and sight. Thus, I've split its uses into LOS_SOLID and LOS_SOLID_SEE -- the
former is what LOS_SOLID was usually understood to mean, the latter is what it
actually was (being targettable with an arrow/beam).
The difference is: LOS_SOLID_SEE obeys clouds.
The name of the latter is abysmal -- if you have a better idea, please sed.
Diffstat (limited to 'crawl-ref/source/losparam.cc')
-rw-r--r-- | crawl-ref/source/losparam.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc index 93518ce1e2..866d17b147 100644 --- a/crawl-ref/source/losparam.cc +++ b/crawl-ref/source/losparam.cc @@ -84,17 +84,24 @@ opacity_type opacity_immob::operator()(const coord_def& p) const return base; } +opacity_type opacity_solid::operator()(const coord_def& p) const +{ + dungeon_feature_type f = env.grid(p); + if (feat_is_solid(f)) + return OPC_OPAQUE; + + return OPC_CLEAR; +} + // Make anything solid block in addition to normal LOS. // That's just granite statues in addition to opacity_no_trans. -opacity_type opacity_solid::operator()(const coord_def& p) const +opacity_type opacity_solid_see::operator()(const coord_def& p) const { dungeon_feature_type f = env.grid(p); if (feat_is_solid(f)) return OPC_OPAQUE; else if (is_opaque_cloud(env.cgrid(p))) return OPC_HALF; - else if (f == DNGN_TREE || f == DNGN_SWAMP_TREE) - return OPC_HALF; else if (const monster *mon = monster_at(p)) return mons_opacity(mon); |