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 monst.h $NHDT-Date: 1559422218 2019/06/01 20:50:18 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.31 $ */
/* NetHack 3.6 monst.h $NHDT-Date: 1559994623 2019/06/08 11:50:23 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.32 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -97,11 +97,13 @@ struct monst {
Bitfield(perminvis, 1); /* intrinsic minvis value */
Bitfield(mcan, 1); /* has been cancelled */
Bitfield(mburied, 1); /* has been buried */
#define mtemplit mburied /* since buried isn't implemented, use bit for
* monsters shown by transcient light source;
* only valid during bhit() execution */
Bitfield(mundetected, 1); /* not seen in present hiding place;
* implies one of M1_CONCEAL or M1_HIDE,
* but not mimic (that is, snake, spider,
* trapper, piercer, eel)
*/
* trapper, piercer, eel) */
Bitfield(mcansee, 1); /* cansee 1, temp.blinded 0, blind 0 */
Bitfield(mspeed, 2); /* current speed */