Commit Graph

1154 Commits

Author SHA1 Message Date
cohrs
252460c70a starvation killer message
Write "died of starvation" on the tombstone, not just "starvation".
Suggested by <Someone> a couple weeks ago, although his suggested
prefix was different and didn't work as well for the "exhaustion" case.
2003-05-17 22:03:27 +00:00
cohrs
775e4e0345 U442 - scroll of charging
<Someone> suggested a scroll to counteract an unknown scroll of charging
that had negative effects.  Scroll of punishment already costs the same,
so that unknown behavior is already covered.  Plus, a cursed scroll of
charging already has negative effects, except in the case where the player
was confused where no negative effect from reading a cursed scroll of
charging occured.  Added such an effect (since the curse should still cause
something bad, even though the reader is confused), to drain the player's
energy.
2003-05-17 21:12:16 +00:00
cohrs
ddb2f60171 message when eating a stalking
As suggested by <Someone> to the mailing list, display a message
when you eat a stalker and notice that you became invisible.
2003-05-17 20:51:11 +00:00
nethack.rankin
c4c1b064f7 fix B02004 and other projectile related killer reasons
1) killer reason for scattered land mine shrapnel used "a" or "an" prefix
   even when multiple projectiles hit as a group -- one of various things
   From a bug report.oextra field) --
   noticed while investigating #1 and later From a bug report.4.0 due to an unintentional side-effect of missile killer reason
   handling in 3.4.1 (removal of redundant "poisoned" prefix by m_throw()
   confused the poison handling routine) -- noticed while investigating #3.
2003-05-14 10:25:26 +00:00
nethack.allison
835c0ca499 Field is conditionally defined, code referring to it isn't 2003-05-12 04:49:20 +00:00
nethack.allison
a2249a4b0d Some altkeyhandler tweaking 2003-05-12 02:25:08 +00:00
cohrs
669c48dd04 polearms and infravision
Allow hero to apply a polearm against a monster seen only by infravision.
Reported to the mailing list.
2003-05-11 05:08:58 +00:00
cohrs
b8e61b8c47 B02003 - choking on unique monster corpse
Try harder to use the pronoun "the" when refering to a unique monster's corpse
2003-05-11 04:18:25 +00:00
cohrs
3f1f8c0b91 U455 - attacking disenchanter
When polymorphed, only attacks involving hands/feet/weapons should result
in damage to object.  Theoretically, hug and butt attacks should affect
objects too, but no forms with such attacks currently allow wearing armor.
2003-05-11 03:18:02 +00:00
nethack.allison
17ad4116b1 rollback one band
Rollback a band that shouldn't have been in recent patch at all.
2003-05-10 21:28:33 +00:00
nethack.allison
6f56da5261 final qbuf patch
This is my final src mod to ensure that a qbuf does not overflow due to
a lengthy named object.  These recent patches, coupled with the core yn_function() patch earlier, should make it much rarer for a QBUFSZ
buffer overflow to occur in a window port routine (unless the window
port routine has its own bugs, but that isn't the core's fault).
2003-05-10 21:11:16 +00:00
nethack.allison
0f7508090d safe_qbuf arguments
Pat's compiler triggered a warning because safe_qbuf
is declared as `char *' but might return `last_resort'
which is `const char *'.
2003-05-10 16:21:12 +00:00
nethack.allison
f32ad24709 ensure safe_qbuf gets initialized buffer as 1st arg 2003-05-10 15:25:33 +00:00
nethack.allison
8f66986300 Pat Rankin wrote:
> The `prompt' buffer in tty_yn_function still only holds QBUFSZ
> characters. But fixing the tty incarnation wouldn't be good enough;
> all the other interfaces would need to handle it too.  I think it
> should be fixed in the core instead.  Prompt strings simply should
> not be allowed to become so lengthy.

Another step in the fight against prompt sting buffer overflows.
The goes after the ones that may not have been found yet.

This makes yn_function a real core function and removes
the #define yn_function macro.

The yn_function validates the prompt string buffer being
passed prior to calling (*windowprocs.win_yn_function)(),
and if necessary, truncating it and adding "...".

This won't help if the overflow occurs in the core in
a buffer that is still QBUFSZ in size, but it will help if
a BUFSZ buffer is being passed to one of the query
functions.
2003-05-10 14:11:42 +00:00
nethack.allison
5353192bda next qbuf overflow
By naming the candelabrum as long a name as the game will allow, and by naming a candle the longest name also, a qbuf overflow and crash is
triggered when you attach the candle to the candelabrum.
2003-05-09 03:55:33 +00:00
nethack.allison
bba4872447 yet more qbuf 2003-05-09 01:19:29 +00:00
nethack.allison
50467a60b7 more qbuf
Pat pointed out to me that there are other potential
qbuf overflows, so this adds a function to assist in
weeding them out.
2003-05-08 11:19:16 +00:00
nethack.rankin
33d3c2581e bones fix
From the newsgroup:  leash found inside a bones level shop was flagged
as "in use".  3.4.0 had a fix for that which works for most cases, but not
when the shopkeeper has taken the dead character's inventory just before
saving the bones file.

     This also adds an entry to the branch copy of fixes34.2 to synchronize
it with the trunk copy.
2003-05-08 07:23:11 +00:00
nethack.allison
24f9f56006 fix prompt string overflow in lift_object()
<email deleted> wrote:
> The game crashed badly when I made some experiments with items
> with very long names:
>
> You have much trouble lifting a blessed greased thoroughly rusty  >thoroughly corroded +3 plate mail named terribly long killer longer than my
>ong long-worm called long.  Continue? [ynq] (q)

  tty_yn_function(const char * 0x0012fa50,
      const char * 0x00572ddc _ynqchars, char 113) line 379 + 6 bytes
  lift_object(obj * 0x009e8970, obj * 0x00000000,
      long * 0x0012fcd0, char 0) line 1131 + 20 bytes
  pickup_object(obj * 0x009e8970, long 1, char 0) line 1258 + 19 bytes
  pickup(int 0) line 474 + 28 bytes
  dopickup() line 1853 + 11 bytes
  rhack(char * 0x005c0d50 in_line) line 1908 + 3 bytes
  moveloop() line 406 + 7 bytes
  main(int 3, char * * 0x009e2ac0) line 102
2003-05-08 02:25:19 +00:00
nethack.rankin
25d6335de9 two land mine bits
Noticed when investigating one of the killer reason bugs recently
reported:  a land mine explosion shouldn't create a concealed pit trap;
make a revealed pit instead.  And while testing that, I noticed that the
"Kaboom" message given when pushing a boulder onto a land mine was given
while the map still showed the boulder at its original location even
though it had actually been moved already.  It's a little odd that you
get hit by shrapnel at your original position--as if you're shoving the
boulder ahead of you and then pausing a moment before stepping into its
former location--but that's trickier to fix; sometimes you won't advance
due to there being multiple boulders present (in that case you evidently
do shove the boulder instead of performing a steady push, so maybe the
current behavior is fine as it is).
2003-05-03 02:08:34 +00:00
nethack.rankin
9672d39e13 fix U438 - text formatting
"List of game options" from `? f' misaligns the entries for runmode
and scroll_amount (at least for tty display).  Shorten their descriptions
so that they fit without squeezing out spaces.
2003-04-30 23:27:31 +00:00
cohrs
492bdb672b yet another spelling error
"undigestable" -> "indigestible"
2003-04-27 15:10:46 +00:00
nethack.rankin
a16ba92a01 magic bag explosion
Make exploding bags of holding be less mysterious, and perhaps cut
done on the number of claims that they've vanished for no reason.  There
wasn't any feedback other than the explosion message itself; in particular,
the message about putting something into the bag didn't occur since that's
handled by the didn't-explode case.
2003-04-27 11:05:22 +00:00
nethack.rankin
eabc4f4a4f comment typo 2003-04-27 10:38:00 +00:00
nethack.rankin
de2c772a11 Castle trap doors fix
Recently discussed in the newsgroup, and it sounded familiar so may
have been reported directly earlier:

  You fly through the trap door.  You fly down along the stairs.

when polymorphed into a flying creature or riding a flying steed.  It
only happens at the castle, and only happens because the go-down code is
explicitly setting the arrival point to be the Valley stairs.  That's how
the castle trap doors used to work as traps too, but they were changed to
dump you randomly near the stairs quite some time ago.  Fix it by making
intentional triggering work the same now; this also prevents the false
feedback (even if you happen to arrive on the stairs by coincidence).
2003-04-27 10:32:55 +00:00
warwick
4bebf0624b Avoid using NAME_MAX. What we really wanted was PL_NSIZ. 2003-04-22 06:54:45 +00:00
cohrs
a2a8c0f86c gauntlets of power removal encumbrance feedback
<Someone> reported that encumbrance feedback when removing GoP
was delayed until the next turn.  Several other places call encumber_msg()
to provide immediate feedback.  Call it in Gloves_off() too.
2003-04-20 22:29:25 +00:00
cohrs
cb56f6fd2d B02002 - Monster werechange messages
Change the monster constants to match the current position of the switch
statement.  Also test canseemon(), since the message isn't needed if you
see the change.  I didn't make any other change to the message frequency.
If it's too frequent, then perhaps the changes themselves are too frequent.
2003-04-20 18:00:12 +00:00
cohrs
3d7d2f569e U423 - uninitialized memory access in dolookup
fix a case where "cc", which is only set when looking from_screen,
in a case where from_screen is not set.
2003-04-17 03:44:02 +00:00
arromdee
d4c9baa644 wishing for magenta potions
Reported on the net.
2003-04-17 02:21:16 +00:00
cohrs
83ffd8077a U406 - running and mimic mimicking closed doors
If running in a way that stops at closed doors, you should stop when coming
across a mimic mimicking a closed door too.
2003-04-14 05:10:06 +00:00
cohrs
b53cdee210 U409 - hiding and eating bugs
Three related bug fixed, two reported in U409.
+ If you zapped a wand of cold downward while hiding underwater, the uundetected
flag was not reset (but the monster case was code correctly), resulting in
an impossible error on the next attack
+ If you finished eating something you were hiding under and were attacked,
another impossible would occur
+ While checking the eating gold case, I noticed that several cases would lose
gold on the floor if the attempt to eat it failed

The first case is fixed by resetting the flag just like the monster case.
The other cases are fixed by adding code to useupf to deal with this.
eatspecial and floorfood were modified to allow useupf to be called, and
fix the 3rd bug in the process.
2003-04-14 01:09:30 +00:00
cohrs
86253d5602 unpaid tinning kit usage
<Someone> reported that shopkeepers don't charge for using tinning kits.
2003-04-13 04:18:36 +00:00
cohrs
f6bb38f22b compilation bit
quiet a new gcc warning
2003-04-13 04:09:32 +00:00
nethack.allison
e1aa6d5148 GOLDOBJ compat (main trunk only)
This patch gives game and savefile compatibility
whether GOLDOBJ is defined or not.

You can build with GOLDOBJ defined or not, and
still load your saved games. Rebuild with the
opposite, and load the same game.

That way GOLDOBJ can be experimented with
more easily.

1. Leave the "you" struct and the "monst"
   struct the same under the hood between
   GOLDOBJ and !GOLDOBJ.

2. Always write out gold as an
   object on the player and monster
   inventory chains.

On a restore of the savefile with GOLDOBJ
not defined,  take the gold objects out of
the inventory chains and put it into u.ugold
or mtmp->mgold as appropriate.

On a restore of the savefile with GOLDOBJ
defined, nothing special is done.
2003-04-11 22:32:08 +00:00
nethack.rankin
d0e4d1e31b #tip command - container access
Another fix to address the complaints about two-handed weapons being
rendered useless by 3.4.1's change to require free hands in order to apply
containers.  Some players now fear to wield two-handed weapons because a
curse would make accessing their bag impossible, which is doubly nasty if
that's where they have scrolls of remove curse or potions of holy water
intended to deal with cursed items.  The same situation applies for cursed
one-handed weapon combined with cursed shield, so some are now claiming
that 3.4.1 has made two-weapon combat be even more attractive than before.

     This implements #tip, a new command that causes a container at the
current location or carried in inventory to have its contents emptied
onto the floor.  Hero's hands don't need to be free at the time but tipping
a floor container requires limbs; tipping an inventory container doesn't
need hands or even limbs.  The contained items don't pass through inventory
during the process, so don't cause objects (loadstones, crysknives, scrolls
of scare monster?) to go through their special handling unless it's part of
normally dropping to the floor.  Tipping a bag of tricks behaves the same
as applying it (one monster is released, and it only becomes empty if
that happened to be the last charge) and items tipped out of a cursed bag
of holding have their normal cursed bag chance (1/13) of being destroyed.
Tipping an inventory container while levitating or during unskilled riding
behaves similar to normal drop--from a height, so some fragile items break.

     Players have wanted this feature to get gray stones out of chests or
heavy corpses out of ice boxes but I didn't care much about that; losing
access to your bag is more significant.  I'm pretty sure that there was a
user patch to do something like this floating around at one time, but I
couldn't find it when I looked, so I implemented #tip totally from scratch.

     Bug?  Extended commands which lack meta-key shortcuts are not listed
in the help files displayed by the '?' command....
2003-04-03 10:56:46 +00:00
nethack.rankin
dd2ff34d0c pickup bit
Lint removal necessitated by accidental omission of a band from the
earlier "container groundwork" patch.
2003-04-03 10:05:42 +00:00
nethack.rankin
9ee9c9f8b3 container groundwork
Move a couple of instances of container contents manipulation into
their own routines.  Behavior for items disappearing from cursed bags of
holding isn't quite identical but is effectively the same.  I think its
use of stolen_value (or simply the behavior of the latter) is buggy, but
I haven't tried to fix that.  (Cursed bag of holding destroying a player
owned bag containing shopped owned items definitely doesn't work well.)
2003-04-03 09:28:28 +00:00
warwick
02fba50b34 Allow both UNIX and MacOSX conventions for configfile. 2003-04-03 04:21:57 +00:00
nethack.rankin
c8c7a463ff fix B02001 - WIZKIT artifacts
Fix the reported bug of artifacts created via wizard mode WIZKIT
being "forgotten" and possibly duplicated during play.  Perform artifact
initialization before $WIZKIT processing; role info needed by the former
is already sufficiently set up by that point.
2003-04-03 03:59:40 +00:00
nethack.rankin
b3d8161353 magicbane message grammar
> "The magic-absorbing blade scares the erinys!  The erinys resist!
> The erinys are stunned.  You kill the erinys!"

     vtense() already has code to handle "erinys", but it didn't work as
intended when the caller uses "the erinys" for the subject string.
2003-03-31 08:02:30 +00:00
cohrs
66ece5d870 B01006 - containers hitting the floor
<Someone> noted that if you dropped a box while levitating, nothing would
break.  This is true for sacks too, which shouldn't be immune either.
Throwing didn't break contained objects either, not mentioned in his report.

Refactored out the code in kick_object that handled damage for objects
contained in normal containers and added calls in hitfloor and throwit.
kick_object still only calls it for boxes, but other callers will call it
for any object letting it decide if damage is required.  BoH objects aren't
affected, since traditionally the inside of the BoH is "somewhere else".
2003-03-29 03:31:51 +00:00
cohrs
18f39cfcdd B01005 - infinite objects from traps
Added a random factor to arrow, dart and rock traps so they'll eventually
stop producing new objects.  Also fixed a bug in mklev that set the trap
"once" flag even for traps where it wasn't currently appropriate.
2003-03-27 03:01:38 +00:00
cohrs
345ffcfaec B01003 - blindfold vs dust vortex
This started out as a change to address the strange sequence of messages if
you remove a blindfold while engulfed in a dust vortex.  That is addressed
by a new function that can be called in such situations.  Calls to this
function were added in all the cases where the can_blnd() engulfing
conditions end as a result of player action.  There are some other cases
that end ucreamed or usleep, but they happen between turns and shouldn't
need extra handling.

While I was at it, I noticed that a unicorn horn or prayer would cure
blindness even while engulfed in a dust vortex.  This is useless, because
you immediately get blind again the next turn.  So, I added checks to avoid
doing this.  Finally, it didn't make sense for eating a carrot to cure your
blindness in these situations either, only for it to return immediately.
2003-03-26 05:10:22 +00:00
cohrs
7fa28ea693 jumping over sokoban pits
reported to the list.  The code in hurtle_step was returning FALSE one
step too early, resulting in the player not actually ending up in the pit.
2003-03-24 21:56:59 +00:00
nethack.rankin
213bd793fd fix U382 - missing map display update
> Receiving Excalibur from a fountain while blind doesn't update the
> display (i.e. the missing fountain) immediately.

     Various other topology changes had the same problem.  The display
was only being updated if the hero was invisible on the assumption that
it wouldn't matter otherwise, but a blind character who moved off the
affected location would still have the old map info (fountain, trap, &c)
shown--until he walked back onto that spot or searched next to it or
regained sight--even though the player is told about the map change as
it happens.
2003-03-24 08:58:45 +00:00
cohrs
cff0fb7870 B01002 - tame dwarf won't eat
<Someone> reported that a tame dwarf wouldn't eat food tossed at it.
He also reported that it wouldn't eat off the ground, which I couldn't
reproduce nor see in a problem in the code.  The code in thitmonst didn't
allow for sharing food with non-domestic, already tame monsters.
2003-03-24 07:30:49 +00:00
cohrs
2ec40201f4 U384 - dopay impossible
If you zapped a WoStriking while outside a shop and broke the door and 2
separate objects, the shopkeeper would come out to get paid but if you
tried, it would result in "dopay: not to shopkeeper?" due to stolen_value
not adding the cost of the 2nd object to the right accumulator.
2003-03-24 02:15:49 +00:00
arromdee
b7fea371b6 statue gender
Reported on the newsgroup (a few weeks ago in the middle of a post about
something else): someone turned Perseus to flesh and found out he was female.
2003-03-24 02:02:08 +00:00
cohrs
310d1d53fd B01001 - locking/unlocking a door while in a pit
Since you can't reach a door to open it while in a pit, it makes sense you
can't lock/unlock it either.
2003-03-23 20:22:00 +00:00