Commit Graph

3485 Commits

Author SHA1 Message Date
PatR
68b7693d98 crash fix
After the recent shopkeeper fix, I wanted to find out what happens if
you turn to stone in the spot inside the shop door.  It didn't go too
well--a change of mine from three weeks ago caused a crash due to
passing a null pointer to strcmp().  Death from being turned to stone
or from starvation when there was no while-helpless reason (probably
not possible for starving) triggered it.  This fixes that.

As far as the test goes, the shopkeeper takes your inventory and moves
it all the way into the shop, and a statue of the petrified hero is
left without contents in the spot in front of the door.  That shk was
awfully quick....

Post-3.6.0 bug, so no fixes entry.
2016-01-29 17:14:42 -08:00
Pasi Kallinen
d591ebaa46 Fix bz58: Inheritance dispute between shk and risen undead
Prevent shopkeeper from "gratefully inheriting all your possessions"
when your corpse rises as undead.
2016-01-29 16:59:27 +02:00
PatR
b606aea919 more globs... much more globs
Fix a bunch of glob bugs, probably introduce one or two new ones.
2016-01-29 02:07:09 -08:00
David Cohrs
288ac4b07c avoid crash for long lines in nethackrc
read_config_file() has used a buffer of size (4 * BUFSZ) since 3.4.x
so parse_config_line() needs a buffer of the same size to avoid
buffer overrun. Allows my old .nethackrc to work again.
2016-01-28 18:40:59 -08:00
PatR
b632247a74 revisit #H4083 - glob ID and merging
Globs on the floor used different criteria (anything goes) than globs
in inventory (mostly requiring same ownership when in shops and same
curse/bless state--other stuff generally isn't applicable) when
deciding whether two globs should merge.  That was okay as long as
the globs on the floor were from being left behind when a pudding or
ooze was killed, but not if the player had picked some up, dipped
them in holy or unholy water, and dropped them again.  This changes
things so that globs on the floor use the same criteria as globs in
inventory when deciding whether to coallesce.

Also, my earlier fix was modifying globs in the mergeable() test (to
make bknown and rknown match) rather than during actual merge, which
would be a problem if the merger didn't take place for some reason.
2016-01-28 18:13:25 -08:00
PatR
09ebe44ae9 fix #4206 - feedback for pet's weapon
The report that a tame Archon got two "<pet>'s long sword is not
affected" messages thought there was some duplication error when a
flaming sphere exploded, which was incorrect.  Since an Archon has
two weapon attacks, getting that message twice just meant that both
attacks hit.  However, the player has only 1/6 chance to suffering
passive fire damage to weapon, where monster-on-monster or monster-
on-polyd-hero was inflicting that for every successful hit, so
there was a bug here after all.  Give monsters the same 1/6 chance.
Also, add even more verbosity to that message--now that it won't be
delivered so often--to mention what didn't affect the item.

While investigating this, I noticed that hitting a steam vortex
with a flammable weapon was doing fire damage to that weapon.  Fire
damage in the steam vortex definition makes some sense in that it
allows fire resistance to give protection, but dishing out actual
fire damage makes no sense and is now prevented for passive counter-
effects.
2016-01-27 17:51:02 -08:00
PatR
90c4898c9a fix 2nd part of #H4188 - monst fleeing up on lvl 1
The code to handle monsters fleeing up the upstairs on level 1 was
expecting those stairs to be normal upstairs but they are actually
sstairs like the ones down into the mines.  So monsters fled to the
Plane of Earth instead of escaping the dungeon as intended.
2016-01-26 19:25:21 -08:00
PatR
9085dc2d7e fix #4189 - burning glob of green slime
When destroy_item() or destroy_mitem() burned up a glob of green slime,
they had the message index and damage amount reversed.  This could give
a nonsense message ("the glob of green slime freezes and shatters") or
go out of array bounds and wreak havoc.  Even if the message index had
been correct, fatal damage would have produced an incorrect cause of
death since it would have used a potion or scroll string.

Now globs will boil and explode like potions, and damage will be
proportional to the size (weight) of the glob, which seems to be the
original intent.
2016-01-26 18:32:17 -08:00
PatR
149139a25d prompting for #dip
I noticed that my paniclog had a "Query truncated" entry from testing
the post-3.6.0 changes to #dip prompting.  For
"What do you want to dip <the object> into? [xyz or ?*] "
the use of safe_qbuf() didn't account for getobj() appending the list
of choices, so wasn't ensuring that the formatted object name combined
with the other text couldn't overflow QBUFSZ.

I had a more elaborate fix than this that still used safe_qbuf(), but
the extra complexity just wasn't worth it.  This potentially truncates
the formatted object description more severely than necessary but is
simple enough to be comprehensible.

No fixes36.1 entry.  This is updating a post-3.6.0 revision.
2016-01-26 17:32:05 -08:00
PatR
489445da02 fix part of #H2343 - youmonst.movement vs poly
From a July 2011 report listing multiple movement anomalies, fix one
of the easier ones.  If you polymorph from a fast from into a slow
one, pending movement points can let the slow form get in some moves
it shouldn't.

I've deliberately avoided adjusting pending movement when you change
into a faster form, which will get it's own movement boost on the
next turn.
2016-01-25 18:18:35 -08:00
PatR
5a9e00d0dd mind flayer's damage
From a followup to #H2247, April 2011...  Physical damage from a mind
flayer attack was inflicted in the AD_DRIN case for hitmu(), then
being inflicted again in the common code after the switch statement.
The new comment explaining the reason for non-standard damage is just
a guess.
2016-01-24 16:23:33 -08:00
PatR
49cbcdb137 fix #4191 - flags.verbose vs level change messages
Suppress the "you climb/fly up the stairs/ladder" message if the
'verbose' option is off (unless punishment is going to augment the
message by "with great effort").
2016-01-23 20:16:37 -08:00
PatR
853efee661 fix #H4205 - take-off of covered items
Bug report subject was "menu interface things" but this isn't related
to menus, just getobj().  Make the requested change to not list worn
suit as a likely candidate for T (and R) if a worn cloak is going to
prevent it from being removed.  (Suit can still be picked, but the
take-off operation for it will be refused, same as when it was being
listed as a candidate.)

In discussion about the request, there was a separate suggestion that
cloaks shouldn't interfere with removing things underneath since
they're generally sleeveless.  I haven't done that; I think it is
better to keep the layering as it is.

The bug report also asked for the likely candidates when writing with
a magic marker to exclude non-blank scrolls and books.  That has been
implemented already (post-3.6.0).
2016-01-23 19:38:28 -08:00
PatR
45ba0addf2 another vampire shape-shifting bit
Chameleon impersonating a vampire and vampire subject to protection
from shape changers weren't the only ways to have a vampire monster
which isn't a vampshifter.  One-shot polymorph could produce that too.
2016-01-23 19:15:38 -08:00
PatR
e619e5f66e formatting for 'O' commmand menu
For !menu_tab_sep, the boolean options were formatted with a different
width than the compound and 'other' options when the menu for 'O' was
active.  Use the same format string for all of them, consider them all
when constructing it, and construct it just once instead of every time.
2016-01-23 16:16:36 -08:00
PatR
a21894cc39 tipped ice box corpses
Reported directly to devteam, with patch:  tipping corpses out of an
ice box wasn't restarting their rot timers, producing corpses that
would last indefinitely.
2016-01-23 15:23:45 -08:00
PatR
7e86003367 tty role selection - 'random' default
Instead of just using 'random' as the default choice if the user hits
<return> when picking role, race, gender, or alignment, flag it as
pre-selected in the menu so that it can be seen to be the default.

Someday somebody is going to have to fix up the interaction between
PICK_ONE menu and pre-selected choice....
2016-01-22 18:09:05 -08:00
karnov
93f7df6848 Added anagrams for new team members 2016-01-21 21:38:35 -05:00
PatR
885de116e1 fix #H4204 - shapeshifter taking vampire form
When a chameleon/doppelganger/sandestin took vampire or vampire lord
shape, it stopped taking on new shapes.  Vampire shapeshifting was
being applied to all vampires rather than just to is_vampshifter().
When is_vampshifter() is false, the vampire is some other shapeshifter
or Protection_from_shape_changers is in effect, so vampire shifting
doesn't apply.

While testing, I noticed that vampires/lords only turned into bats/
wolves during initial creation.  They did turn into fog clouds in
order to pass closed doors but the other alternate forms were ignored.
That's fixed too.
2016-01-21 02:12:47 -08:00
PatR
2e2b54e548 overriding message suppression, revisited
This is more robust than the previous hack.  The issue of whether to
use it in other places is still unexplored.  Ultimately it's the user's
fault if overzealous message suppression hides something important.
[For an eerie game, try 'MSGTYPE=hide .'.]
2016-01-19 18:16:13 -08:00
PatR
0544b998de fix #H4028 - ':' sometimes doesn't work
User had
MSGTTYPE=norep "You see here"
and complained that once the message had been given while walking
over an object, using ':' to intentionally look at something would
end up doing nothing if its feedback was a repeat of "You see here".

Trying to classify which actions should deliberately override
no-repeat (or no-show) will be an ordeal.  This fixes the case for
the ':' command where the user obviously expects feedback.  I think
it could be done better but am settling for something quick and easy.
2016-01-19 07:13:18 -08:00
PatR
ea35773192 more getpos() help
Explain the what-is response types in the help provided when typing '?'
during getpos operation.
2016-01-19 02:19:33 -08:00
PatR
83a4234292 whatis_coord - rename 'getpos_coord' option
Rename the option for adding coordinates to autodescribe feedback for
the '/' and ';' commands from 'getpos_coord' to 'whatis_coord', after
the '/' command that uses it instead of after the internal routine
that implements it.  The 'whatis' name was only in dat/hh as far as I
could find, so this changes it to 'what-is' and also updates dat/help
and the Guidebook to mention the name too.

Add a 'screen' choice to the option to show coordinates as row,column
rather than x,y or compass direction(s).  Revise the /m, /M, /o, /O
operations of 'what-is' to honor the whatis_coord option (mostly; a
value of 'none' gets overridden by 'map' to force coordinates).

Also, update the description of the functionality of the '/' command
in the Guidebook.  The .mn version is tested, the .tex one isn't.
2016-01-18 19:27:53 -08:00
PatR
8cd65daf39 Death misquotes 2016-01-17 15:05:34 -08:00
PatR
350dcf067b tribute streamlining
Chatting with Death doesn't always deliver a tribute Death Quote but
when it does, it wasn't giving each of them once before reusing them
even though they should have been treated the same as passage
selections from a novel.  I'm still not sure why it wasn't working
as intended, but after some revision to the tribute parsing code, now
it is.  If you #chat with Death enough times to get 20 tribute quotes,
you will see each of the 20 quotes once (in random order), then
further chatting will give them again (in different random order).
2016-01-16 17:36:48 -08:00
Pasi Kallinen
04bc048073 Limit aggravate to inside or outside of the Wizard's tower
There have been several comments on IRC how the Wizard is a very
light sleeper now; aggravate cast by monsters makes him wake up
and come out of the tower.  So, lets limit aggravate to either
outside or inside of the tower, depending on which side the player is.
2016-01-16 09:45:12 +02:00
PatR
cd2f4ac225 another status bit
Accept four digits for spell power rather than hide the amount
exceeding 999.
2016-01-15 21:05:58 -08:00
David Cohrs
7ce5225501 fix whitespace of previous commit 2016-01-15 20:50:46 -08:00
David Cohrs
4d2c82e482 Only print giant snatching boulder message when cansee pos.
Reported by a couple times directly to devteam, no bz.
2016-01-15 20:35:15 -08:00
Pasi Kallinen
9b4d52397c Fix bz51: Revived unique inherits corpse name 2016-01-15 22:02:46 +02:00
Pasi Kallinen
8efec0a547 Allow crawling out of water on Plane of Water after hurtling 2016-01-15 15:40:29 +02:00
Pasi Kallinen
c038522b9d Fix bz65: Water behaves strangely when hurtling out of air bubble
When levitating on the plane of water, get an unattached iron ball,
and throw it. You'll hurtle in the opposite direction, out of the air
bubble and into water, but don't drown.
2016-01-15 13:47:19 +02:00
PatR
60b166aad8 more new status - update genl_status_update
Make genl_status_update behave approximately the same as basic bot2
when processing the second status line.  Preferred order:
Dlvl  Gold  Hp(HpMax) Pw(PwMax) AC  Xp  Time  Conditions
Alternate orders if above exceeds COLNO (note several extra spaces
get sequeezed out).  First one is used if everything except time fits,
second one is used if everything except experience (which can be wide
if 'showexp' option is on) and time fits, third is last resort:
Dlvl Gold Hp(HpMax) Pw(PwMax) AC Xp Conditions Time
Dlvl Gold Hp(HpMax) Pw(PwMax) AC Conditions Xp Time
Hp(HpMax) Pw(PwMax) AC Conditions Dlvl Gold Xp Time

Basic bot2 currently has Conditions as
Stone Slime Strngl FoodPois TermIll <hunger> <encumbrance> Blind Deaf
 Stun Conf Hallu Lev Fly Ride
genl_status_update has
<hunger> <encumbrance> Stone Slime Strngl FoodPois TermIll Blind Deaf
 Stun Conf Hallu Lev Fly Ride
which is as close as it can get with the current field organization.

Tested by temporarily changing tty_procs.status_init and .status_update
to use genl_* instead of tty_*.
2016-01-15 03:30:40 -08:00
Pasi Kallinen
4d866a2217 bz24: Wrong floor descriptions on Planes when levitating and going down 2016-01-15 13:15:13 +02:00
Pasi Kallinen
17a4fc4492 Minor formatting fix 2016-01-15 13:02:42 +02:00
Pasi Kallinen
9f4d8d9301 Warning glyph description is wrong when trap symbol is same
This fixes bz23: Warning glyph info wrong with TRAPS=50, even
though you don't set the trap symbols via TRAPS anymore, the
bug still existed. To trigger it, use SYMBOL=S_arrow_trap:2
and look at monster that appears as warning '2'.
2016-01-15 12:38:02 +02:00
PatR
fa20ef382d status line update
Adding deafness to the status line spurred me on to something I've
wanted to do for a long time.  This adds 'Stone' and 'Strngl' as
new status conditions, and moves the five fatal ones: "Stone Slime
Strngl FoodPois TermIll" to the front of the status list since
information about them is more important than any of the others.
"Ill" has been renamed "TermIll"; "Df" has been renamed "Deaf";
"Lev", "Fly", and "Ride" are three additional new conditions, with
Lev and Fly being mutually exclusive.  After the fatal ones, the
order of the rest is now
<hunger> <encumbrance> Blind Deaf Stun Conf Hallu Lev Fly Ride

To handle the longer potential status line, the basic bot2() is now
smarter.  If the line is wider than the map, 'T:moves' is moved from
the middle to the end.  If the line without time is still wider than
the map, then experience (HD if polyd, Xp:M/nnnnnn is showexp is on,
or Exp:M) is moved in front of time at the end.  If the line without
experience and time is still wider than the map, dungeon level plus
gold is moved from the beginning to be in front of experience.  The
fields are just reordered, not truncated, so if the interface code
can display lines wider than the map they'll retain the extra info.
The gist is than health and associated fields (Hp, Pw, Ac) get first
priority, status conditions get second priority, then the rest.  In
the usual case where there aren't many conditions, status display is
the same as it has been in the past.

STATUS_VIA_WINDOWPORT has been updated too, and it builds for tty
and X11.  But the bot2() revision to reorder sections has not been
implemented for that.

win/win32/mswproc.c has been updated but not tested.

STATUS_VIA_WINDOWPORT without STATUS_HILITES had several compile
problems; now fixed for core and tty.  STATUS_VIA_WINDOWPORT with
STATUS_HILITES has not been tested.
2016-01-13 19:13:10 -08:00
Pasi Kallinen
5acb659076 Add more color aliases for menucolors and statushilites 2016-01-13 20:35:06 +02:00
Pasi Kallinen
1dd37b7fca Make status hilites use same color string matching as menucolors 2016-01-13 20:27:21 +02:00
Pasi Kallinen
c49490dfd4 Rename getpos_coord values to "compass" and "map" 2016-01-13 12:21:27 +02:00
Pasi Kallinen
ef3ce49dd4 Make getpos monster/object coord picker deterministic
...and make it pick coordinates top-left to bottom-right.
2016-01-13 10:22:44 +02:00
PatR
5f6c0bd04a getpos autodescribe
Move the details of autodescribe out of getpos into a separate
routine.

I think 'cartesian' mode should be renamed 'compass' mode, and
'absolute' mode perhaps should be 'map' mode.  And we should have
a new 'screen' mode which shows rows,columns (1..N rather than
0..N-1).  For tty, row is line+2; message and prompting "window"
is row 1, line 0 of map is row 2.  Columns are straightforward
since column 0 of the map isn't used for map display:  column 1
of map is column 1 of screen.  Non-tty mostly shouldn't care and
might as well use the same conversion.
2016-01-12 23:10:31 -08:00
nhmall
32a4859e5b show deafness indicator on status line
May as well show a deafness indicator.
2016-01-12 23:43:28 -05:00
PatR
04c39f9e91 silly thing bit
Simplify some conditionally excluded, obsolete but not yet
discarded code.

This is something else I thought I'd checked in a long time ago.
I must have clobbered pending changes to invent.c at some point.
2016-01-12 18:00:43 -08:00
PatR
7e01237dce getobj() magic marker candidate items
When applying a magic marker, only list known blank scrolls and known
blank spellbooks as likely candidates to write on.  Accepts any scroll
or book (but non-blank ones will get rejected by the writing code).
Attempting to choose some other class of item yields "that is a silly
thing to write on", same as before.

This was requested during beta testing and I'd swear that I checked it
in a long time ago, but it wasn't here.
2016-01-12 17:50:32 -08:00
Pasi Kallinen
99ee354637 Fix get_count: ^H should go left instead of backspacing a count 2016-01-12 08:20:13 +02:00
Pasi Kallinen
0ee5d8ce47 Add getpos_coord option
Allows showing the coordinate when picking a position on the
map with '/' and autodescribe is on.

This is another blind player request
2016-01-11 21:10:51 +02:00
PatR
9cfc0ac5d7 getpos() 'm','M' and 'o','O'
Always include the hero's location in the set of spots for 'm',&c to
cycle through.  This way the set will never be empty so checks for that
can be dropped, and choosing initial index becomes trivial (set to 0,
then increment to reach nearest spot of interest or decrement to reach
farthest).  Also, it makes it easier for player to see when successive
'm's,&c have been through all the interesting locations if there are
multiple monsters or objects clumped near the last one in the cycle.
2016-01-10 14:42:06 -08:00
Pasi Kallinen
854fe40609 Fix bz175: Pile mark is shown when potion is destroyed
Original bug report:

> When killing something that's carrying a potion, or death-drops a potion,
> or stands on top of a potion, with a force bolt or a wand of striking,
> "you hear something shatter" or "a potion of foo shatters" but the corpse
> is inverse as if it's (still) a pile.

Unfortunately the newsym() checks for already existing glyph, and
the gbuf doesn't distinguish between object piles and single items,
so newsym doesn't mark the location for update.

This is a dirty hack to force the newsym to update the glyph.
The glyph buffering should be revisited in a future version.
2016-01-10 18:33:41 +02:00
Pasi Kallinen
c6bf49f647 Small code cleanup 2016-01-10 14:47:06 +02:00