diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2011-08-30 17:47:20 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2011-09-05 23:20:16 +0200 |
commit | 91f958751568cd00aa8bd0df8ce47f56c5edf7ba (patch) | |
tree | 4640898fcedc93d7d046171e1e37f390afab133a /crawl-ref/source/los.cc | |
parent | 8385fdb8f0862ae32c9d2a5bcdde1f80934ff590 (diff) | |
download | crawl-ref-91f958751568cd00aa8bd0df8ce47f56c5edf7ba.tar.gz crawl-ref-91f958751568cd00aa8bd0df8ce47f56c5edf7ba.zip |
Merge all the feature mimics into a single monster type.
It's now possible to create any kind of feature mimic using &M.
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r-- | crawl-ref/source/los.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 847e9a459f..0b32304536 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -895,6 +895,17 @@ void losight(los_grid& sh, const coord_def& center, losight(sh, los_param_funcs(center, opc, bounds)); } +opacity_type mons_opacity(const monster* mon) +{ + if (mon->type == MONS_BUSH) + return OPC_HALF; + + if (mons_is_feat_mimic(mon->type) && feat_is_opaque(get_mimic_feat(mon))) + return OPC_OPAQUE; + + return OPC_CLEAR; +} + ///////////////////////////////////// // A start at tracking LOS changes. @@ -907,7 +918,7 @@ static void _handle_los_change() static bool _mons_block_sight(const monster* mons) { - return (mons->type == MONS_BUSH || mons->type == MONS_DOOR_MIMIC); + return mons_opacity(mons) != OPC_CLEAR; } void los_actor_moved(const actor* act, const coord_def& oldpos) |