missile light sources

Throwing or kicking a lit lamp, lit candle, or lit potion of oil
wasn't giving off any light as it travelled to its destination.
Now it does, and dungeon features, objects, or monsters that are
temporarily seen as it moves from square to square till appear on
the map.  In the monster case, they go away as soon as the light
moves beyond range, but when it finishes moving the "remembered,
unseen monster" glyph will be drawn at their location.  I think that
part has some room for improvement, but mapping temporarily seen
terrain features is the primary impetus for this change.

Also, any message delivery while the "lit missile" travelled still
showed its light around the hero.  Noticeable for lamps or stacks
of sufficient candles if hero has no other light source.

This cannibalizes the monst->mburied bit for temporarily seeing a
monster.  It has been present but unused for ages.  I needed to
replace a couple of vision macros to make sure they didn't examine
it any more so that overloading for transient lighting doesn't
introduce any vision oddities.  For version $NEXT, monst->mtemplit
can be given its own bit.  It is only set during bhit() execution
and cleared by the time that returns, so has no effect on save files.
This commit is contained in:
PatR
2019-06-08 04:50:40 -07:00
parent fabfe276fe
commit c741d6c7c9
9 changed files with 158 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 display.h $NHDT-Date: 1546212620 2018/12/30 23:30:20 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.29 $ */
/* NetHack 3.6 display.h $NHDT-Date: 1559994621 2019/06/08 11:50:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.32 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -58,11 +58,18 @@
* vobj_at() returns a pointer to an object that the hero can see there.
* Infravision is not taken into account.
*/
#if 0
#define mon_visible(mon) \
(/* The hero can see the monster IF the monster */ \
(!mon->minvis || See_invisible) /* 1. is not invisible */ \
&& !mon->mundetected /* AND 2. not an undetected hider */ \
&& !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */
#else /* without 'mburied' and 'uburied' */
#define mon_visible(mon) \
(/* The hero can see the monster IF the monster */ \
(!mon->minvis || See_invisible) /* 1. is not invisible */ \
&& !mon->mundetected) /* AND 2. not an undetected hider */
#endif
/*
* see_with_infrared()