diff options
author | gammafunk <gammafunk@gmail.com> | 2014-03-04 18:53:58 -0600 |
---|---|---|
committer | gammafunk <gammafunk@gmail.com> | 2014-03-06 11:42:35 -0600 |
commit | 4a7354f52e5f00663930a651e6502de5a8a8fb26 (patch) | |
tree | 59ece0838a119114249c1b2e86d34115829f7e0d /crawl-ref/source/tag-version.h | |
parent | 465263a558223b22c6597894e5a0dacdb376d401 (diff) | |
download | crawl-ref-4a7354f52e5f00663930a651e6502de5a8a8fb26.tar.gz crawl-ref-4a7354f52e5f00663930a651e6502de5a8a8fb26.zip |
Fix various issues with invisible monster indicators.
Currently if a monster enters LOS and goes invisible on the same turn,
it can disappear from the screen before the player has a proper
indication of where it was. This commit makes the following changes:
1. Fixes invisible monster indicators so that they can reliably be set
in the monster map knowledge update code at locations that of the
current monster being processed in this loop. The previous code tried
to set this indicator, but due to how the old loop cleared all flags
other than MAP_SEEN_FLAG and did tiles cell draws in the same pass as
map knowledge updates, these wouldn't work. This commit adds a
MAP_INVISIBLE_UPDATE flag to help retain MAP_INVISIBLE_MONSTER when
necessary, as well as a second loop in show_init that loops over a
vector of the updated cells found in the radius_iterator loop. This
second loop should be fast enough that it doesn't significantly affect
performance.
2. Add 'bool went_unseen_this_turn' and 'coord_def unseen_pos' to the
monster class (with the necessary save compat code) to allow monsters
that go invisible in LOS to always get an invisible indicator. The
code prefers to use indicators arising from the monster failing
stealth checks if those occur; they are based on the monster's true
position and hence are usually more accurate.
3. Somewhat simplify the stealth check code for invis indicators, and
only ever allow one invis indicator per monster. The stealth check
logic perhaps could be simplified further (there are multiple checks),
but I've preserved the existing checks for now. Also turned a
coinflip() in one of the secondary checks into a seeded/hashed
coinflip so it won't change over screen updates.
This commit lets players with antennae always see the location of an
invisible monster through an invis indicator, and sets the invis
indicator on the monster's last position whenever a monster becomes
unseen (e.g. going invis or already being invis but the player removes
sinv). If the monster fails a stealth check, that potentially more
accurate information is favored over the unseen position.
Diffstat (limited to 'crawl-ref/source/tag-version.h')
-rw-r--r-- | crawl-ref/source/tag-version.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/tag-version.h b/crawl-ref/source/tag-version.h index 08c6ddff13..98aabf47f4 100644 --- a/crawl-ref/source/tag-version.h +++ b/crawl-ref/source/tag-version.h @@ -84,6 +84,7 @@ enum tag_minor_version TAG_MINOR_MISC_SHOP_CHANGE, // Wand and gadget shops merged TAG_MINOR_HORN_GERYON_CHANGE, // Horn of geryon changed to an xp-evoker TAG_MINOR_NEMELEX_WEIGHTS, // Nemelex deck weighting removed + TAG_MINOR_UNSEEN_MONSTER, // Invis indicators for monsters going from seen to unseen #endif NUM_TAG_MINORS, TAG_MINOR_VERSION = NUM_TAG_MINORS - 1 |