Commit Graph

793 Commits

Author SHA1 Message Date
cohrs
9b69eb43e5 rolling boulder hits an unmoving boulder 2002-11-18 22:37:38 +00:00
nethack.allison
abd3df2871 get_adjacent_loc()
use get_adjacent_loc() rather than getdir() directly for some things where
you want to ensure valid adjacent coordinates are returned

<email deleted> wrote:
>>> [...]
>>> I've noticed that the loot adjacent spot code doesn't have any
>>> isok(x,y) test, so will risk crashing if used at the edge of
>>> the screen (whether deliberately, or accidentally due to being
>>> confused or stunned when picking the direction).

>> Would this not be a problem elsewhere, such as use_leash() too?

> Yes, that looks like the same risk. getdir() doesn't validate
> that the <u.ux+u.dx, u.uy,u.dy> is safe and neither does m_at(),
> so their callers need to.
>
> I did manage to provoke a crash with #loot on the plane of earth,
> although an accidental case would be a lot less likely to happen.
2002-11-17 18:43:45 +00:00
cohrs
330bdb7d1a Wand of digging in a shop crash
From a bug report.  I haven't looked closely, but I think this bug is just
in the development code.  If you dig in a shop with a wand while carrying
unpaid stuff, the shopkeeper would grab your pack, including the wand but
w/o clearing current_wand.  It seems the right thing is to just not grab
the current_wand, since it's not in your pack while you're zapping it.
In 3.4.0, you lost the wand too.
2002-11-16 05:31:23 +00:00
cohrs
eb906b1b8f shopkeeper falling thru a hole left unpaid objects unpaid
Reported to the list.  Player breaks a wand of digging causing the
shopkeeper to fall.  This didn't clear unpaid items.  For now, this can
only occur due to player action, so added a call to make_angry_shk to
handle this situation.
2002-11-15 07:32:52 +00:00
cohrs
d2476b5151 level teleport and sleeping steed
If you level teleported while on a sleeping steed, a panic and possibly a
crash would occur.  I believe the same would occur by digging a hole.  This
was due to keepdogs avoiding keeping sleeping pets.  In these cases, it
seems there's no reason for the sleeping steed to _not_ accompany you.
Since other ways of changing level (eg stairs) don't allow this, just added
a check to keepdogs to allow the steed to go with you.
2002-11-15 04:58:28 +00:00
nethack.rankin
e3b20b8a9f de-sparkling explosions
From the newsgroup:  explosions handle their own shield effect
display for resisting monsters and it was ignoring user's negation
of the sparkle option to suppress shield effect.
2002-11-13 23:08:04 +00:00
nethack.rankin
a6d0e7f0b9 more unused code tweaking 2002-11-10 09:32:55 +00:00
nethack.rankin
1ca589adc0 fix up some unused code 2002-11-09 05:36:13 +00:00
nethack.rankin
e639c09f58 fix B14012 - polymorph of monster possessions
Forwarded from the newsgroup:  when a monster gets hit by wand or
spell of polymorph, any armor that fell off was protected from being
hit by that same zap, but a dropped weapon wasn't.  Nor was the whole
dropped inventory in the case where the monster is killed by system
shock rather than transformed.  Protect its entire inventory.
2002-11-08 12:45:58 +00:00
cohrs
52d1737294 teleport control, confusion and stunned
Being Stunned now disallows teleport control.  Confusion may affect ability
to control level teleports, but only after asking for the destination.
Made confused level teleport failures based on luck too.
2002-11-07 18:52:00 +00:00
cohrs
f2cc8a0dbf salamanders have no legs
However, they could ride.  Marilith is similar, but since it's MZ_LARGE,
that check disallowed riding.  Added a check for slithy(), like
canwearobj() already has.
2002-11-07 18:24:31 +00:00
nethack.rankin
836d600080 remove curse tweak
When reading an uncursed scroll of remove curse, don't uncurse
an item "worn" in the quiver slot unless it is actually ammo or other
missile weapon.
2002-11-07 03:55:51 +00:00
nethack.rankin
46db4cb5a4 high temple entry
From the newsgroup:  temples attended by high priests on the Astral
Plane (also in Moloch's Sanctum, although that one doesn't really matter)
give a different entry greeting than usual in order to conceal the altar's
alignment, but they were including the patron deity in the priest name
given as presenter of the message ("The high priest of Offler intones:").
2002-11-07 03:27:37 +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
cohrs
e3b9c00826 B13009 - Teleport Control and confusion
Only allow level teleports to be controlled when not confused, just like
regular teleports.
2002-11-04 22:11:35 +00:00
cohrs
4af82192bc B14010 - nausia and reading spellbooks
Pulled out the code that handles reading spellbooks while confused into a
new function that can be called from learn() to handle the timed onset of
confusion starting while you're reading.
2002-11-04 22:07:23 +00:00
arromdee
f7075b2cd2 cancelled yellow lights
Someone reported this one to us.
2002-11-04 06:55:55 +00:00
nethack.allison
7f65d67a2c bold titles on Options menu (from <Someone>) 2002-11-03 15:41:48 +00:00
warwick
d82393d891 Apelike creatures now have a sensible category. 2002-10-31 08:39:17 +00:00
cohrs
75f0c5db52 more cmdassist
Add the patch I suggested last week to show cmdassist help for the
various prefix commands.
2002-10-27 16:36:30 +00:00
cohrs
b4664e981f B14009 order of altar feeling messages
Special case the altar feeling messages to avoid saying you're feeling
the altar and then saying there's an altar here.
2002-10-27 16:30:35 +00:00
cohrs
afbfd72271 B14008 splash when dropping things in pools
Added code to flooreffects() to implement this suggestion from <Someone>.
It kicks in while blind, only affects objects of some bulk, and also only
things dropped at your location.  The map_background currently doesn't
do anything since the dropped object is remembered on top, but this will
avoid a bug if we ever add invisible objects.
2002-10-27 16:13:17 +00:00
cohrs
2c926521c1 consistent sokoban guilt for polymorphing boulders
Discussed a while back in the newsgroup.  casting Stone to Flesh on a
Sokoban boulder would affect luck, but simply polymorphing a boulder would not.
2002-10-24 05:43:40 +00:00
cohrs
ff8512b36b is_lminion should only match lawful minions
When Angels were introduced, they were always lawful.  Somewhere along the
line, non-lawful angels were added, but is_lminion and uses of it was never
updated to address this change.  Among other things, this resulted in
non-lawful angels delivering messages via #chat that are only appropriate
for lawful angels.  That is addressed simply by changing the definition of
is_lminion, which must take a struct monst, not a permonst, to return valid
results.  Also, non-lawful angels should summon appropriate monsters, not
lawful minions.
2002-10-24 04:13:56 +00:00
cohrs
71480033c6 B12010 - boulders in throw menu for giants
When the player is poly'd to a giant, it was a bit odd that boulders
weren't listed in the throw menu, especially since the usual check for them
is throws_rocks.  Since statues are not appropriate, I added this thru yet
another ugly check in getobj.
2002-10-24 01:40:58 +00:00
nethack.rankin
fc558bfff4 fix B14003 - "bashing" with mounted polearms
Attacking with a polearm while mounted behaves differently than
while on foot, so make mounting and dismounting when wielding one adjust
weapon status accordingly.  Don't give a bashing message on first attack
if you mount with a polearm already wielded; do give one on your next
hand-to-hand attack if you just dismounted with one wielded.
2002-10-21 10:20:29 +00:00
nethack.rankin
31259d35c9 wizard mode mapping
Override confusion and hallucination when revealing the map with
<ctrl/F> in wizard mode.  This also renames the `#poly' extended command
to `#polyself' and adds several one-line comments.
2002-10-21 08:57:39 +00:00
nethack.rankin
7870c96605 prayer result bits
You won't be hallucinating at the end of a prayer which reveals
the Castle passtune even if you were hallucinating before hand, so
there's no point in adding joke messages in that case.  Also, you
can't pray while unconscious, so ignore the soundok flag when dealing
with that tune; otherwise the player could toggle that option off in
order to bypass the tune result in favor of the golden glow effect.
2002-10-21 08:32:57 +00:00
nethack.rankin
810386390e eating mimic corpses
Don't mimic gold if you are Unchanging at the time you eat a
mimic corpse.
2002-10-21 08:19:17 +00:00
cohrs
1469d772ff U77 - pits in drawbridges
dighole dealt with holes in drawbridges, but digactualhole did not
2002-10-19 18:42:46 +00:00
nethack.rankin
7411e1daf5 fix U100 - vampire stoning buf
Fix the reported bug of a vampire that is wearing gloves being
able to bite a cockatrice without becoming petrified.
2002-10-18 06:49:34 +00:00
nethack.rankin
2f6d82dcc6 fix B14002 - Stinking clouds in bonefiles
More region fixes.  The region restore code wasn't updating monster
ID numbers for bones data, so monsters already inside stinking clouds
might or might not be affected by them depending on arbitrary mon->mid
assignments across the old and new games.

     This also flags stinking clouds in a way that lets the game keep
track of whether they were created by the player, and clears that state
for bones data so that the current player doesn't get credit or blame
for clouds left by the former one.  File compatibility with 3.4.0 is
retained; if/when that eventually changes, this code can be simplified.

     Testing with current development code has been limited but seems
to be working correctly; testing with actual 3.4.0 files has not been
attempted.
2002-10-16 22:20:30 +00:00
cohrs
cb38d0882d B14001 - Stinking clouds in bonesfiles
Incorporate a fix from <Someone> that resets the timestamp on
stinking clouds left in bones files.  This does allow the cloud's ttl to
restart.  Extended it to reset the player_inside flag.

Then noticed that the only placed that called in_out_region was domove().
Added calls when changing levels (which causes player_inside to be set
correctly if the cloud covers the location where the player starts on the
bones level), teleporting, and inside hurtle_step.  There are still other
places that fail to call in_out_region, which others may choose to tackle.

I split out the remaining stinking cloud bug reported in the same e-mail
into a separate betabug.  That one probably cannot be addressed without
changing the level file format to track the creator.
2002-10-16 06:30:36 +00:00
cohrs
bb732e194a B13004 spellbook destruction
When reading a cursed or too-hard book that's covered in contact poison
(presumably in the too-hard case, reading it made the poison), and you die,
the book would not be in the bones.  remove in_use mark while assessing
damage.

On the other hand, not From a bug report, the message in the "6" case says
the book explodes, but had a 1/3 chance of not disappearing in the normal
case, and 100% chance of remaining if cursed while reading - when the
player survives.  Return a flag to allow the book to be destroyed in this
case.  No work needed for the death case; in_use is set.
2002-10-16 05:46:20 +00:00
cohrs
2fa61ea7ee B12002 - displacing pets thru narrow openings
Add another check to domove to detect an attempt to displace a pet through
a narrow opening.
2002-10-14 16:08:07 +00:00
cohrs
db73f34150 debug commands: lightsources and monpolycontrol
Given no objections to Pat's suggestion, putting back in the change to make
the newest debug commands consistent with the others, removing the space
from the former and the underscore from the latter.
2002-10-14 00:20:38 +00:00
cohrs
a8f4069c30 B10005 fire traps under water
<Someone> reported that after pushing a boulder into a pool location which
contained a fire trap on the bottom, that the trap wasn't destroyed.  Added
missing delfloortrap call.
2002-10-14 00:10:44 +00:00
nethack.rankin
211f09b9ee sleep vs sounds
Handle sleeping consistently; of the nine places fall_asleep
is being called, only one of the them actually affected sounds.
The two cases where sleep is used to penalize overexertion aren't
affected.
2002-10-13 10:13:38 +00:00
cohrs
c3c11f9081 B12009 invisible nymph preposition consistency
<Someone> reported the messages "It seduces you and you take off your
robe. She stole a burnt +0 robe."  I noticed the 2 cases here only dealt
with blindness, not seeing the nymph in general.  Also, one case forced
"She", the other "It".  Now they both say "She", which is consistent with
the preposition in the 2nd message.  We'll continue to the assume the
gender of the seducer is obvious, even when unseen.
2002-10-13 06:54:01 +00:00
cohrs
299dfffc04 intones with sound option disabled
E-mail report from <Someone>.  Don't display the "intones:" prefix when
!soundok since the message suffix won't be displayed in this case due to
a check within verbalize().
2002-10-11 22:16:22 +00:00
cohrs
34f66394c2 bones while swallowed
Michael pointed out that bones will never occur while swallowed because
makemon of the ghost will always fail.  I suggested that the outcome made
sense, since your body may be digested, torn apart, whatever.  But, there
was no explicit check for this to make it obvious this was occuring.
2002-10-11 21:30:40 +00:00
cohrs
9de0ebd7a6 creating nasty monsters on boulders
<Someone> reported that a Titan summoning nasty monsters via a spell
resulted in various monsters being placed on locations containing boulders.
nasty() was using the summoning monster's type to decide where to place the
summoned monsters.  Note that this could theoretically also cause
inappropriate monsters to be placed in water, lava, walls, et al.
Rearranged the code to pick the monster type first.
2002-10-11 15:59:14 +00:00
nethack.allison
0fd9fd4873 beta 14 2002-10-11 01:50:01 +00:00
nethack.rankin
b81e3158e5 build fix
I used the wrong diff to update the files I checked in a little
while ago.
2002-10-11 01:31:16 +00:00
nethack.rankin
2c3964e619 #dipping from steed
Fix the reported bug of an unskilled rider who is unable to pick
items off the floor while mounted still being able to dip into water.
There might be other actions which need similar checking; this one only
handles the dip into pool/moat case.
2002-10-11 00:46:37 +00:00
cohrs
096ac17d8c back out accidental mod
In my previous patch, I accidentally included a change to wizard mode
commands I had not indented to apply at this time.
2002-10-10 21:16:33 +00:00
cohrs
84e3c1aac9 B13002 - negative protection
implement Michael's suggestion to tweak the protection message when your
protection is negative.
2002-10-10 21:13:05 +00:00
nethack.rankin
a0067f97e2 luck artifact dependencies
Instead of adding a new artifact.h to pray.c, remove the existing
ones from attrib.c, invent.c, and mkobj.c.  This also updates the Unix
and VMS editions of Makefile.src; having stale dependencies in those
for other ports could cause unnecessary recompilation but can't break
anything in this case.
2002-10-09 07:06:08 +00:00
nethack.allison
5a9550819c B13005 grammar: "A scrolls burns."
This was caused by taking a copy of the name
prior to a later delobj for use in the message.
The name would always be plural if there was
more than one, so that pluralized name would
be used even if only one of the stack was
destroyed.  Sometimes the name saved
was "scrolls labeled XXXX."

This patch simply saves a pluralized  name
and a single version and uses the
appropriate one in the message, rather
than introducing splitobj() complications.
2002-10-08 11:28:21 +00:00
nethack.rankin
95fc6f318c steed fixes
A relatively recent change to prevent #ride letting you move in
a way you could walk (squeeze through a tight a gap or enter doorway
diagonally) resulted in crashing due to access violation or segfault
if you tried to mount toward a spot that didn't contain any monster.
Noticed while testing saddle cursing; tried to mount while stunned....

     Also, if the character had a saddle "worn" in weapon, alternate
weapon, or quiver slot, it didn't get unworn when applying the saddle
to a mount.  The next time the player tried to equip something in the
same slot there'd be a warning message; I don't know whether any more
serious symptoms could occur.
2002-10-08 10:54:36 +00:00