Commit Graph

32 Commits

Author SHA1 Message Date
PatR
7bbf292c92 mongone vs vault guard
mongone() would send away a vault guard, whether alive or already
dead and parked at <0,0>, losing the information needed to remove
the temporary vault corridor once whatever obstacle (ie, the hero)
that's keeping it in place has been cleared.  Have mongone() call
grddead() like mondead() does, so that a guard will just be moved
to <0,0> with 0 HP and kept there rather than being purged during
the next dead monster removal.

Move polearm context reset to m_detach() [and, unfortunately,
duplicated in grddead()] rather than in having it in dmonsfree()
since execution of the latter is deferred.  I'm not sure offhand
whether a fast hero could get a second move before end-of-turn
purging of dead monsters.
2015-04-20 19:45:13 -07:00
Sean Hunt
ac108cd365 Make GOLDOBJ unconditional. 2015-02-27 19:33:40 -05:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
30b3e5a2ea more vault guard (trunk only)
Fix several obscure bugs that can happen when a guard leads someone
out of a vault:
1) non-pit traps created in the temporary corridor would persist inside
   solid rock after the corridor was removed (pits dug by the hero were
   explicitly removed but several other trap types are possible);
2) lighting the corridor with scroll/wand/spell left the affected spots
   flagged as lit after they reverted to rock; tunneling through that
   area, either by digging or by teleporting back to the vault and having
   another guard appear, unearthed lit corridor there;
3) if you became encased in solid rock because you were in the temporary
   corridor when it was removed (which will happen if the guard is killed
   while you're in his corridor), you were only told so if you saw part of
   it revert to rock; when blind, you simply found yourself unable to move;
4) dragging an iron ball in the temporary corridor could result in part
   of that corridor becoming permanent if the guard was killed; in 3.4.3,
   it would only occur if the cause of death took away all the guard's
   hit points (which happens for most but not all deaths); in development
   code after my recent patch, that would be every cause of death.
#4 could also yield "dmonsfree: <N+1> removed doesn't match <N> pending"
warning in 3.4.3 when the fmon list was scanned and a guard at <0,0> with
no hit points was found but hadn't passed through to the end of mondead()
and m_detach().  The previous patch fixed that, I think/hope.  Most guard
deaths won't trigger that; grddead() moves the guard to <0,0> but then
removes the temp corridor on its second try, returns true, and mondead()
finishes normally.
2011-10-13 00:31:13 +00:00
nethack.rankin
bd172eb167 vault guard bug: dropping minvent at <0,0> (trunk only)
From the newsgroup:  after killing a vault guard on a level where
every object had been removed or was held by the hero, object detection
gave feedback about finding something but was unable to show anything.
It was finding the dead guard's inventory at <0,0>, a part of the map
which never gets shown.  A dying guard is sent to that location instead
of being killed and deleted, because the data for his temporary corridor
to/from the vault is kept in the egd structure attached to him.  That's
somewhat obscure but works; dying guards just need to drop inventory
before being transfered there rather than after.

     Depending upon how they're killed, it's possible that the umpteen
places in the code that loop over fmon might have been processing them
as if still in play.  This sets their mhp to 0 so such loops will ignore
them, and teaches dmonsfree() not to release them.  Once the temporary
corridor has been removed, their isgd flag is cleared and they become
ordinary dead monsters and get deleted from the fmon list the next time
it's purged.

     This also lets you throw gold to/at the guard when he tells you to
drop it.  He already would catch it, but now he won't treat the throw as
an attack.  Any gold he carries will eventually disappear when he does,
so dropping it remains a better option for the player.
2011-10-09 02:13:01 +00:00
nethack.rankin
0c0d68a631 fix #H2081 - named vault guard messages (trunk only)
From a bug report, assigning
a vault guard a name such as Marcel could result in messages like
|The Marcel, confused, disappears.
Many of the guard messages had article "the" hardcoded.  This gets rid
of g_monnam() and uses noit_mon_nam() instead.

     I haven't been able to test all the modified messages; it's a pain
trying to get some of them to occur.
2010-02-06 01:58:33 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
01f954a855 fix #H1378 - vault guard interaction while swallowed
From a bug report, if you're swallowed
while in a vault and the guard arrives, he'll ask your name even though
you're hidden within the engulfer.  This makes him give a message and
then leave, as is already done if you're mimicking an object or unable to
speak.

     This also suppresses his repeated "Move along!" message if you're
swallowed or held since it's silly to keep telling you to move when you
obviously can't.
2007-09-01 01:12:34 +00:00
nethack.allison
f139b67e43 build warning
- remove an unreferenced variable
- continue with recent code trend towards having DEADMONSTER()
  check in its own if/continue statement in a few more places
2006-06-11 18:27:55 +00:00
nethack.allison
ecb98e019c eating gold in front of the vault guard (trunk only)
<email deleted> wrote:
> Eating gold in a vault (or polymorphing a pile of gold into 1 gold piece)
> doesn't anger the guard.

This addresses the eating part of that report, but the hero
has to get caught doing it.
2006-03-26 05:23:46 +00:00
nethack.allison
280823536c clear pits in temporary corridor
From a bug report, then leave the corridor (causing it to
> vanish), the pit will be embedded in rock instead of being removed.

clear any pits that the hero digs in the vault guard's temporary corridor
2006-03-26 03:52:46 +00:00
nethack.allison
0dc071bee8 mextra changes
Note: The CVS repository was tagged with NETHACK_PRE_MEXTRA
prior to application of this patch to allow easy withdrawal if necessary.

Adds a new mextra structure type that has a set
of pointers to various types of monster structures
including:
   mname, egd, epri, eshk, emin, edog

Replaces the mextra bits in the monst structure
with a single pointer called mtmp->mextra of type
(struct mextra *).
The pointer can be null if there are no additional
structures attached. The mextra structure is not
adjacent to the monst structure.

Reduces the in-memory footprint of the monst that
has no other structures attached, at the cost
of adding 6 extra long ints per monster to
the save file

The new mextra structure has the mextra fields
independent of each other, not overlapping as was
the case with previous NetHack versions.
This patch doesn't do anything to capitalize on
that difference however.

Consolidates vault.h, epri.h, eshk.h, emin.h and edog.h
into mextra.h

Adds a macro for checking for whether a monster has
a name:
	has_name(monst)

This fixes the magic trap panic
   expels() -> spoteffects() -> dotrap() ->
	domagictrap() -> tamedog()
because the monst no longer varies in size so no
replacement is required.
2006-01-06 05:46:03 +00:00
nethack.rankin
90a9978c33 fix #Q221 - inappropriate vault guard message when embedded gold reached
From a bug report:  when a guard who's
leading the character out of a vault comes across gold (from mineralize()
usually, but a player could deliberately seed the area in xorn form), the
message "the guard calms down and picks up the gold" was given even though
the guard wasn't angry.  Pick up such gold as soon as temporary corridor
reaches it so that on his next move the guard won't mistakenly think that
the hero has just dropped it.
2005-11-12 03:19:22 +00:00
nethack.rankin
0defd00b4b fix #Q211 - inappropriate vault feedback
From a bug report, you'd get the message
"the corridor disappears" whenever a vault guard was killed, even if the
temporary vault corridor was already gone due to leaving its vicinity.  This
fix seems to work ok, but I don't pretend to understand how the convoluted
vault code actually works.
2005-10-29 04:07:21 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00
kmhugo
e1f5ddd820 sound cleanup
+ Separate the two uses of flags.soundok.
+ Player-settable option is now called "acoustics".
+ Deafness is now handled as a full-fledged attribute.
+ Check for deafness in You_hear(), rather than caller.
+ Check for deafness in caller, rather than verbalize(),
  because gods can speak to characters in spite of deafness.
+ Since changes are being made to prop.h, reorder it to the
  same order as youprop.h and enlightenment.

There are still some extraneous checks and missing checks
for deafness, which will be followed up in a future patch.

Because of the size of this patch and its savefile incompatibilities,
it is only being applied to the trunk code.  Portions of this patch
were written by Michael Allison.
2003-09-28 03:42:50 +00:00
nethack.allison
cc830fb311 buglist - full level triggers impossible() from migrating mons
<email deleted> wrote:
> If more monsters fall through a trap door than can fit on the
> level below, when you go down the stairs, you get the following
> message:
>  "Program in disorder - perhaps you'd better #quit.
>  rloc(): couldn't relocate monster"
> This message seems to appear once for every monster-too-many that
> fell through the hole. I originally found this while
> intentionally completely filling a level with black puddings
> (there was a trap door I didn't know about). I also confirmed it
> in a wiz-mode test using gremlins and water.

[confirmed: moveloop -> deferred_goto -> goto_level ->
 losedogs -> mon_arrive -> rloc -> impossible]

This patch:
- causes rloc() to return TRUE if successful,
  or FALSE if it wasn't.
- adds code to mon_arrive() in dog.c to deal with
  the failed rloc()
- allows the x,y parameters to mkcorpstat() to
  be 0,0 in order to trigger random placement of the
  corpse on the level
- if you define DEBUG_MIGRATING_MONS when you build cmd.c
  then you'll have a debug-mode command #migratemons to
  store the number of random monsters that you specify
  on the migrating monsters chain.
2003-09-13 05:30:43 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
fd5339768c typo fix 2003-01-21 11:30:42 +00:00
nethack.rankin
e9c25be839 fix B17001 - Still no "the guard disappears" message
A change I made last August broke this; it was checking whether you
could see the guard after having removed him from the map.
2003-01-15 21:25:02 +00:00
nethack.allison
5336419465 more mimic follow-up bits
Address some complaints about an earlier patch.
2003-01-09 02:37:03 +00:00
nethack.allison
601b3b56d3 mimic follow-up bit 2003-01-06 11:51:48 +00:00
nethack.allison
886749e21b mimic orange follow-up 2003-01-04 16:28:21 +00:00
nethack.rankin
4d145fac06 fix B14011: vault wall repair
From the newsgroup:  traps created on the location of dug out vault
walls would be left in place when/if the vault guard repaired the walls.
Since known traps get precedence over walls when drawing the map, this
produced a display oddity in addition to the topological one.

     It also appears that monsters in affected spots wouldn't be handled
correctly if they happened to be in a direct horizontal or vertical line
with the guard.  I don't know whether that matches any of the assorted
unresolved old vault bugs.

     This eliminates a chunk of redundant code by merging two loops.
2002-11-07 02:56:19 +00:00
nethack.rankin
24c2d465a3 blindness vs vault guards
I implemented this before seeing <Someone>'s forwarded report.
It makes guards come to vaults when you can't see them, but does
have one odd side-effect:  if the vault has boulders in the way
then you might not be able to follow the guard out.  (Usually you
can alternately search and step in order to successfully follow
him out when unable to see.)
2002-08-09 02:35:30 +00:00
nethack.allison
40940991bb change GOLD_CLASS to COIN_CLASS 2002-07-08 23:25:53 +00:00
nethack.rankin
8bcec06645 vault guard behavior
From the newsgroup:  vault guards would ask your name--and you'd
be able to respond--even when you were unconscious (for any reason
besides fainting from lack of food) or paralyzed.  (The code already
made the guard be forgiving when you failed to promptly follow him
out due to that situation, but it would repeatedly say "move along!"
even though you were unable to move.)
2002-04-19 06:03:01 +00:00
cohrs
fcf8af733b vault guard message on the wrong level
if vault guard leaves his original level and is killed, clear_fcorr
was still attempted on the wrong level.
2002-02-24 06:56:02 +00:00
nethack.allison
742e1e8c90 3.3.2 to 3.4.0 2002-02-04 16:11:00 +00:00
nethack.allison
f2fe0a3d5c The word "zorkmid" was hard-coded in format strings all
over the place.

Often they would use
	"%ld zorkmid%s", amt, plur(amt)
but not consistently, so some of the hard-coded usage
could result in "1 zorkmids"

This adds the function
	currency(long)
to return the name of the currency, either plural
or singular depending on the argument passed to it.
That eliminates the need for the extra %s in the
format string and the use of the plur() macro.
2002-01-21 03:35:04 +00:00
jwalz
368f51cf75 *** empty log message *** 2002-01-05 21:05:53 +00:00