]> granicus.if.org Git - nethack/log
nethack
9 years agoFix bz66: Count number cannot be backspaced
Pasi Kallinen [Wed, 6 Jan 2016 09:50:07 +0000 (11:50 +0200)]
Fix bz66: Count number cannot be backspaced

... or at least partially fix it - ^H does now backspace.
I can't be bothered to dive into the (n)curses raw-mode stuff.

9 years agotribute: Equal Rites revisited
PatR [Wed, 6 Jan 2016 08:45:46 +0000 (00:45 -0800)]
tribute: Equal Rites revisited

The number of passages felt a little light, so split one of the
long-ish ones into two.  The punchline that now ends the first one was
being watered down by continuing the text, and an interesting bit that
was left out can be added to finish the second part.  They both lose
some context but I think they work ok separately.

9 years agoprovisional fix for bz239 - '[tty] Enter key...'
PatR [Wed, 6 Jan 2016 08:07:54 +0000 (00:07 -0800)]
provisional fix for bz239 - '[tty] Enter key...'

'... inconsistency in character creation menus'.

During role selection, the final 'is this ok?' menu has 'yes'
preselected so accepted <return> or <enter> to answer yes.  The
pick-role, pick-race, &c menus prior to getting to that stage didn't
have a default, so using <enter> meant nothing was chosen, and choosing
nothing was treated as a request to quit.  This changes that so it's a
request for 'random' instead.

'Provisional fix' because it ought to do this by making 'random' be a
pre-selected menu entry so that the default choice is visible.  But
that takes more effort than I'm inclined to expend on this.

9 years agofix getpos() m,M to move to next monster
PatR [Wed, 6 Jan 2016 07:19:14 +0000 (23:19 -0800)]
fix getpos() m,M to move to next monster

Fixing a couple of warnings led to discovery of a couple of real bugs.
Warnings:
1) -Wshadow warning for 'dist2' variable blocking access to dist2()
   function.
2) Declaration not at top of block not allowed for C89/C90 (let alone
   for pre-ANSI).
Bugs:
3) there might be 0 visible monsters, in which case the code prior to
   qsort will call alloc(0).  I think ANSI requires malloc(0) to return
   a unique pointer which can be freed, but pre-ANSI malloc might
   return Null to satisfy it, leading to panic from nethack's alloc().
4) visible monsters in direct line with hero horizontally or vertically
   were unintentionally skipped when collecting monster locations.

I think looking at monsters is the wrong way to implement this.  It
should be scanning the map for monster glyphs instead.  (Coin toss as
to whether it should also treat statues-shown-as-monsters as if they
were monsters while doing this.  I'm leaning towards yes.  And what
about warning glyphs and instances of the remembered-invisible monster
glyph?  They aren't interesting to look at but they might provide a
shortcut to positioning the cursor near something else.)

Using '^' to move to next trap moves from hero's position to end of
hero's line, then columns 1 to N of next line, and so on to bottom
right, then top left columns 1 to N, second line 1 to N, on down to
hero's line.  Having 'm' traverse monsters from nearest to farthest
feels like a noticeable inconsistency between the two.  Especially if
you move the cursor with direction or topology keystrokes prior to 'm'.

9 years agoOnly requiver pickup_thrown ammo and throwing weapons
Pasi Kallinen [Wed, 6 Jan 2016 02:58:37 +0000 (04:58 +0200)]
Only requiver pickup_thrown ammo and throwing weapons

9 years agoRedraw map when hilite_pile is toggled
Pasi Kallinen [Wed, 6 Jan 2016 02:41:57 +0000 (04:41 +0200)]
Redraw map when hilite_pile is toggled

9 years agoUpdate fixes entries
Pasi Kallinen [Wed, 6 Jan 2016 01:37:35 +0000 (03:37 +0200)]
Update fixes entries

9 years agoFix unmapped branch stairs on premapped levels
Pasi Kallinen [Wed, 6 Jan 2016 01:32:42 +0000 (03:32 +0200)]
Fix unmapped branch stairs on premapped levels

This happens when levelporting to the first Sokoban level in wizard mode
before visiting the level, causing the branch stairs to not appear until
the space it is in comes in sight of the player.

The issue was that levels flagged premapped would cause the special
level coder to call sokoban_detect() before fixup_special() had a chance
to place the branch stairs properly.

Fix from Dynahack by Tung Nguyen.

9 years agofix #H4179 - death reason for rotted globs
PatR [Wed, 6 Jan 2016 01:29:36 +0000 (17:29 -0800)]
fix #H4179 - death reason for rotted globs

'Poisoned by a rotted gray ooze corpse' should have been
'Poisoned by a rotted glob of gray ooze'.

eatcorpse() is called for non-corpse globs and then corpse_xname()
is called for them too to set up death reason for make_sick(), but
it didn't know anything about globs.  Now it does.  Blob size is
ignored since it's not relevant for cause of death.

9 years agoRemove double defines of hunger states
Pasi Kallinen [Wed, 6 Jan 2016 01:23:24 +0000 (03:23 +0200)]
Remove double defines of hunger states

9 years agoUse appropriate place description for drum of earthquake shake
Pasi Kallinen [Wed, 6 Jan 2016 01:17:32 +0000 (03:17 +0200)]
Use appropriate place description for drum of earthquake shake

Fix via Dynahack by Tung Nguyen

9 years agoAllow quickly moving cursor on monsters
Pasi Kallinen [Wed, 6 Jan 2016 01:04:13 +0000 (03:04 +0200)]
Allow quickly moving cursor on monsters

Original patch was mine, but this implementation took
ideas from Dynahack by Tung Nguyen

9 years agofix #H4179 - lava vs boots
PatR [Wed, 6 Jan 2016 00:17:38 +0000 (16:17 -0800)]
fix #H4179 - lava vs boots

Stepping onto lava destroyed water walking boots if they weren't
fireproof but didn't do that for other types of boots unless hero
was not fire resistant and got killed by the lava.  Burn up all
non-fireproof leather boots when stepping onto lava.

9 years agoClear mimic vision blocking after genocide
Pasi Kallinen [Tue, 5 Jan 2016 23:53:44 +0000 (01:53 +0200)]
Clear mimic vision blocking after genocide

Fix via Dynahack by Tung Nguyen

9 years agoMake mimics mimicing walls or trees also block light
Pasi Kallinen [Tue, 5 Jan 2016 23:44:18 +0000 (01:44 +0200)]
Make mimics mimicing walls or trees also block light

9 years agoNever route a travel path through boulders in Sokoban
Pasi Kallinen [Tue, 5 Jan 2016 23:04:56 +0000 (01:04 +0200)]
Never route a travel path through boulders in Sokoban

Change via Dynahack by Tung Nguyen

9 years agoRequiver pickup_thrown objects if quiver is empty
Pasi Kallinen [Tue, 5 Jan 2016 22:52:51 +0000 (00:52 +0200)]
Requiver pickup_thrown objects if quiver is empty

Change via Dynahack by Tung Nguyen

9 years agoAdd mtrack changes to fixes file
Pasi Kallinen [Tue, 5 Jan 2016 10:59:54 +0000 (12:59 +0200)]
Add mtrack changes to fixes file

9 years agotribute: Equal Rites
PatR [Tue, 5 Jan 2016 10:39:46 +0000 (02:39 -0800)]
tribute: Equal Rites

9 years agoMake (level) teleporting clear monster movement tracking
Pasi Kallinen [Tue, 5 Jan 2016 10:32:18 +0000 (12:32 +0200)]
Make (level) teleporting clear monster movement tracking

9 years agoFix bz276,H4172: Fleeing monsters don't actually flee
Pasi Kallinen [Tue, 5 Jan 2016 10:09:40 +0000 (12:09 +0200)]
Fix bz276,H4172: Fleeing monsters don't actually flee

This fix comes via DynaHack by Tung Nguyen.

9 years agoFix bz270, H4166: Finding a secret corridor shows it unlit with lit_corridor
Pasi Kallinen [Tue, 5 Jan 2016 08:00:27 +0000 (10:00 +0200)]
Fix bz270, H4166: Finding a secret corridor shows it unlit with lit_corridor

Also #terrain command with dark_room on showed lit room floor on places with
objects or traps. We don't want to show dark room symbol anyway, because
the dark room symbols are only for line-of-sight, and #terrain should
override that...

9 years agoCapitalize Linux in guidebook
Pasi Kallinen [Tue, 5 Jan 2016 07:11:42 +0000 (09:11 +0200)]
Capitalize Linux in guidebook

9 years agoFinish splitting wallification into two
Pasi Kallinen [Tue, 5 Jan 2016 05:42:28 +0000 (07:42 +0200)]
Finish splitting wallification into two

9 years agotribute catch-up
PatR [Tue, 5 Jan 2016 01:30:05 +0000 (17:30 -0800)]
tribute catch-up

9 years agotribute: The Light Fantastic
PatR [Tue, 5 Jan 2016 01:19:56 +0000 (17:19 -0800)]
tribute: The Light Fantastic

9 years agobuild fix for ck_server_admin_msg()
PatR [Tue, 5 Jan 2016 00:51:24 +0000 (16:51 -0800)]
build fix for ck_server_admin_msg()

ck_server_admin_msg() is only available for '#if (UNIX && MAIL)' but
moveloop() tried to call it unconditionally.  Call if from the UNIX
edition of ckmailstatus() instead.

9 years agoAdd the compile-time options to fixes-file
Pasi Kallinen [Mon, 4 Jan 2016 21:19:49 +0000 (23:19 +0200)]
Add the compile-time options to fixes-file

9 years agoAdd server admin messaging functionality
Pasi Kallinen [Mon, 4 Jan 2016 21:04:56 +0000 (23:04 +0200)]
Add server admin messaging functionality

It's occasionally important for public servers to notify
all the players. Sending a mail is not reliable, as not everyone
wants to break conduct, or have mail on.

This adds a compile-time defined filename, which NetHack
will monitor. The contents of the file are in the same
format as SIMPLE_MAIL: "sender:message" on one line.

9 years agoAdd SIMPLE_MAIL compile-time option for public servers
Pasi Kallinen [Mon, 4 Jan 2016 17:52:34 +0000 (19:52 +0200)]
Add SIMPLE_MAIL compile-time option for public servers

9 years agoAdd an alternative paniclog format as compile-time option
Pasi Kallinen [Mon, 4 Jan 2016 16:05:16 +0000 (18:05 +0200)]
Add an alternative paniclog format as compile-time option

9 years agofix reformatting typo in monmove.c
PatR [Mon, 4 Jan 2016 00:22:22 +0000 (16:22 -0800)]
fix reformatting typo in monmove.c

Fix the vault guard error in dochug() discovered by Alex K.  The
behavior of a vault guard ignoring Conflict when confronting the
hero in the vault and escorting him through the temporary corridor
isn't affected.  3.4.3 already behaved that way.  (I didn't track
the cause of that down so don't know whether it's intentional.)

9 years agoshk segfault diagnostic workaround but not fix
nhmall [Sun, 3 Jan 2016 16:33:03 +0000 (11:33 -0500)]
shk segfault diagnostic workaround but not fix

 Changes to be committed:
modified:   src/shk.c

9 years agomake some mextra guard macros available
nhmall [Sun, 3 Jan 2016 15:48:47 +0000 (10:48 -0500)]
make some mextra guard macros available

 Changes to be committed:
modified:   doc/fixes36.1
modified:   include/mextra.h

9 years agoFix bz241, H4143: LoS still blocked after mimic hit by force bolt
Pasi Kallinen [Sun, 3 Jan 2016 14:26:25 +0000 (16:26 +0200)]
Fix bz241, H4143: LoS still blocked after mimic hit by force bolt

9 years agofix #H4153 - killed by kicking something weird
PatR [Sun, 3 Jan 2016 08:36:31 +0000 (00:36 -0800)]
fix #H4153 - killed by kicking something weird

Steps to make sure 'kickedobj' didn't end up as a stale pointer
prevented it from being around to format the reason for death when
a kicking attempt was fatal.

9 years agoSplit wallification into two by function
Pasi Kallinen [Sat, 2 Jan 2016 22:36:36 +0000 (00:36 +0200)]
Split wallification into two by function

9 years agoMove and reorder ap exc, menucolor and msgtype entries in options
Pasi Kallinen [Sat, 2 Jan 2016 11:40:47 +0000 (13:40 +0200)]
Move and reorder ap exc, menucolor and msgtype entries in options

Move autopickup exception, menucolor, and message type entries
in the options menu under "Other settings" -header, and reorders
them into alphabetical order.

Also use enums instead of hardcoded values.

9 years agoFiles update
nhmall [Sat, 2 Jan 2016 03:04:15 +0000 (22:04 -0500)]
Files update

9 years agowindows visual studio 2013 build updates
nhmall [Sat, 2 Jan 2016 03:01:25 +0000 (22:01 -0500)]
windows visual studio 2013 build updates

9 years agoMerge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Sat, 2 Jan 2016 01:37:12 +0000 (20:37 -0500)]
Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0

9 years agoSYSCF_FILE corrections for windows
nhmall [Sat, 2 Jan 2016 01:33:14 +0000 (20:33 -0500)]
SYSCF_FILE corrections for windows

 Changes to be committed:
modified:   src/files.c
modified:   sys/share/pcmain.c

Related to #H4170, bz274

The current startup code seeks out the SYSCONFPREFIX using:
envp = nh_getenv("COMMONPROGRAMFILES");
which is fine and usually translates to something like
"C:\\Program Files (x86)\\Common Files\\
NetHack then tacks on the NetHack subfolder to the path
"C:\\Program Files (x86)\\Common Files\\NetHack\\"

That should always be the definitive location.

However, in the event that there is no SYSCF_FILE actually
located at that system-wide spot (and ONLY in that event),
fall back to a secondary location of HACKDIR for locating
the SYSCF_FILE.

Also, there's some explicit tweaking added for the Microsoft
visual studio compiler debug execution to all a debug
session to correctly locate things. By default, on a
visual studio build, the executables are linked down in
subfolders of the build directory (Release, or Debug,
depending on visual studio build configuration options).

9 years agoAllow scrolling X11 extended cmd menu with cursors
Pasi Kallinen [Fri, 1 Jan 2016 22:47:10 +0000 (00:47 +0200)]
Allow scrolling X11 extended cmd menu with cursors

9 years agowizweight optional
nhmall [Fri, 1 Jan 2016 21:17:46 +0000 (16:17 -0500)]
wizweight optional

 Changes to be committed:
modified:   include/flag.h
modified:   include/hack.h
modified:   src/objnam.c
modified:   src/options.c

9 years agoEnable scroll bar in X11 menu windows
Pasi Kallinen [Fri, 1 Jan 2016 19:24:55 +0000 (21:24 +0200)]
Enable scroll bar in X11 menu windows

9 years agoimprove messaging on vampire bat to fog cloud transition in Vlad's
nhmall [Fri, 1 Jan 2016 16:17:57 +0000 (11:17 -0500)]
improve messaging on vampire bat to fog cloud transition in Vlad's

Bug 271 - #H4167: vampires being fog clouds show up as bats on telepathy

A bug reporter wrote:
> In top level of Vlad's, the vampires hiding as fog clouds in the closets show
> up on telepathy as B, when far-looked as vampire bat.  once the door opens they
> are fog clouds.
>
> I currently have telepathy from the PYEC.

The vampire /was/ shapeshifted into a vampire bat, but once the secret door
was revealed, it shifted into a fog cloud in order to pass under the door.

If you were to blast the door with a wand of striking from a distance,
you would have encountered the vampire bat.

This clarifies the situation through better messaging.

--------
Original debug call stack trace:
     NetHack.exe!newcham(monst * mtmp, permonst * mdat, char polyspot, char msg) Line 3140
     NetHack.exe!vamp_shift(monst * mon, permonst * ptr) Line 1598
     NetHack.exe!m_move(monst * mtmp, int after) Line 1219
     NetHack.exe!dochug(monst * mtmp) Line 566
     NetHack.exe!dochugw(monst * mtmp) Line 100
     NetHack.exe!movemon(...) Line 707
     NetHack.exe!moveloop(char resuming) Line 105
     NetHack.exe!main(int argc, char * * argv) Line 105

9 years agowindows: fix undefined reference in release build
nhmall [Fri, 1 Jan 2016 01:26:47 +0000 (20:26 -0500)]
windows: fix undefined reference in release build

 Changes to be committed:
modified:   win/win32/mswproc.c

9 years agowindows: PDB files in Debug and Release
nhmall [Fri, 1 Jan 2016 01:16:48 +0000 (20:16 -0500)]
windows: PDB files in Debug and Release

9 years agotribute: The Colour of Magic
PatR [Thu, 31 Dec 2015 23:07:06 +0000 (15:07 -0800)]
tribute: The Colour of Magic

9 years agoHappy New Year 2016
nhmall [Thu, 31 Dec 2015 22:26:25 +0000 (17:26 -0500)]
Happy New Year 2016

 Changes to be committed:
modified:   include/patchlevel.h

9 years agofix bz265 - accessibility fix for reluctant pet
PatR [Thu, 31 Dec 2015 07:38:11 +0000 (23:38 -0800)]
fix bz265 - accessibility fix for reluctant pet

Requested by a blind player.  The message "Fido moves only reluctantly"
didn't convey enough information to be useful.  Describe the reason why
the move is reluctant:  "Fido steps reluctantly over <some object>."

If there is a pile, it will describe the top item rather than whichever
cursed item the pet doesn't want to step on.

9 years agoAnother tiny formatting fix
Pasi Kallinen [Wed, 30 Dec 2015 15:41:48 +0000 (17:41 +0200)]
Another tiny formatting fix

9 years agoTiny formatting fix
Pasi Kallinen [Wed, 30 Dec 2015 15:29:44 +0000 (17:29 +0200)]
Tiny formatting fix

9 years agofix #H4147 - "unlockable chest" desc is misleading
PatR [Wed, 30 Dec 2015 10:33:42 +0000 (02:33 -0800)]
fix #H4147 - "unlockable chest" desc is misleading

Change "unlockable" to "broken" so that it won't be misunderstood to
mean "capable of being unlocked".  The accompanying suggestion to omit
"broken" unless/until a lock or unlock attempt is made is no good since
the main reason for describing the broken lock is to avoid unnecessary
attempts to lock or unlock a container that the hero knows to be broken
but the player may have forgotten.

I also changed remote look-at for objects to use distant_name(doname)
instead of distant_name(xname) so that qualifiers like "empty" and
"broken" will show up on chests you've investigated before but aren't
standing on now.  Monster type for corpse also gets shown, instead of
just 'food (corpse)'.  Other remote items will become more verbose,
but only those that the hero has already seen up close.

9 years agouse explicit int sizes in win/share/tile2bin.c
nhmall [Wed, 30 Dec 2015 02:21:05 +0000 (21:21 -0500)]
use explicit int sizes in win/share/tile2bin.c

64-bit longs caused tile2bin to write an invalid bmp file.

9 years agofix 'doterrain menu bug'
PatR [Tue, 29 Dec 2015 23:09:50 +0000 (15:09 -0800)]
fix 'doterrain menu bug'

From a report sent directly to devteam:  the #terrain command had the
same bug as the '`' command (which was one of the very first ones
reported):  impossible("add_menu called before start_menu").  Only X11
notices.

9 years agofix 'blind sink behavior'
PatR [Tue, 29 Dec 2015 01:32:31 +0000 (17:32 -0800)]
fix 'blind sink behavior'

Reported directly to devteam:  teleporting or polymorphing a sink when
dropping the relevant ring into it was suppressed if the hero couldn't
see it happen.

Being unable to see the sink transform or vanish shouldn't stop that
from happening.  Since the hero is known to not be levitating (because
of the sink), it can be assumed that he can feel the transformation or
vanishment (is that a real word?), so use the same messages regardless
of blindness.

9 years agooccupation vs running
PatR [Mon, 28 Dec 2015 23:10:22 +0000 (15:10 -0800)]
occupation vs running

Noticed while testing a potential change to running while confused:
when confusion timed out, I kept running even though I was headed in
the wrong direction.  Timeout calls stop_occupation() but running is
not an occupation.

Make stop_occupation() also stop counted activity under control of
the player (ie, multi > 0).  Some places in the code use both
stop_occuation() and nomul(0), some just use one or the other.  But
most of those probably intend for both.

9 years agoforce TIMED_DELAY for OSX
PatR [Mon, 28 Dec 2015 22:35:23 +0000 (14:35 -0800)]
force TIMED_DELAY for OSX

Outputing extra characters to induce a delay is useless on OSX, so set
TIMED_DELAY by default instead of relying on user to do it.

9 years agoAdd config file examples to Guidebook
Pasi Kallinen [Mon, 28 Dec 2015 17:56:20 +0000 (19:56 +0200)]
Add config file examples to Guidebook

9 years agoSplit get_rnd_toptenentry from tt_oname
Pasi Kallinen [Mon, 28 Dec 2015 16:06:48 +0000 (18:06 +0200)]
Split get_rnd_toptenentry from tt_oname

9 years agoPrevent minotaur in mines end and bigroom mazes
Pasi Kallinen [Mon, 28 Dec 2015 15:42:55 +0000 (17:42 +0200)]
Prevent minotaur in mines end and bigroom mazes

9 years agodeath-reason sanitizing
PatR [Mon, 28 Dec 2015 01:43:58 +0000 (17:43 -0800)]
death-reason sanitizing

Prevent commas, equal signs, and tabs in reason for death.  Comma
can make while-helpless reason ambiguous in record and basic logfile.
Equal sign can do the same for fixrecord.awk, the awk program that
can be used to fix up corrupted 3.6.0 record files, if it resorts to
constructing logfile records out of xlogfile records.  And tab could
break parsing of xlogfile (it should already be excluded though; the
code that lets players assign names to monsters uses mungspaces(), and
one of the things that does is to convert any tab into a space before
squeezing consecutive spaces down to one).

The name alteration shows up for tombstone as well as for file entries.
That could be changed but hardly seems worth the effort.  Perhaps the
name sanitizing ought to be moved to the initial naming?  At least then
it would be pretty obvious that it was intentional rather by mistake.

9 years agotribute: Snuff
PatR [Sun, 27 Dec 2015 09:46:12 +0000 (01:46 -0800)]
tribute: Snuff

9 years agoremove extraneous bit from cut and paste
nhmall [Sun, 27 Dec 2015 00:35:58 +0000 (19:35 -0500)]
remove extraneous bit from cut and paste

9 years agomeant to be part of previous commit
nhmall [Sun, 27 Dec 2015 00:27:15 +0000 (19:27 -0500)]
meant to be part of previous commit

 Changes to be committed:
modified:   src/trap.c

9 years agoone statue from single vampire via cockatrice corpse
nhmall [Sun, 27 Dec 2015 00:08:08 +0000 (19:08 -0500)]
one statue from single vampire via cockatrice corpse

 Changes to be committed:
modified:   doc/fixes36.1
modified:   include/extern.h
modified:   src/mon.c

Fixes H4148 (bz246) and H4150 (bz248)

comments:
I wielded a c-corpse against a shapeshifting vampire bat (checked with a
stethoscope, it said "shapeshifter".) The bat turned to stone and spawned a
vampire.  I hit the vampire and it also turned to stone, so I had two statues
from one monster (vampire bat and vampire.)  Not sure if this is a bug or a
feature...

comments:
Engulfed by a fog cloud that was actually a Vampire,
and got the message: "You break out of the vampire!"

9 years agoFix prot from shape changers at level generation
Pasi Kallinen [Sat, 26 Dec 2015 19:40:17 +0000 (21:40 +0200)]
Fix prot from shape changers at level generation

Mimics and other shape changers created at level generation
did not obey protection from shape changers.

9 years agoAdd alternate spelling of prot from shape changers
Pasi Kallinen [Sat, 26 Dec 2015 11:12:59 +0000 (13:12 +0200)]
Add alternate spelling of prot from shape changers

9 years agofix #H4144 - rejecting named monster's own name
PatR [Sat, 26 Dec 2015 07:36:44 +0000 (23:36 -0800)]
fix #H4144 - rejecting named monster's own name

Some monsters can't be named, but if the user tried to assign them a
name that matched what they were already called, the rejection message
could be silly.  Reported case was "I'm Izchak, not Izchak!".  The fix
is more general than just for shopkeepers, although their reject
message was silliest when complaining about the name already in use.
For the cited case, feedback will now be 'He is already called Izchak.'

9 years agomore attribute from-what
PatR [Sat, 26 Dec 2015 06:25:56 +0000 (22:25 -0800)]
more attribute from-what

A change earlier today resulted in infravision being described by
enlightenment (wizard mode only) as "from current creature form" when
it was actually due to hero's non-human race.  Now it'll be "innately".

9 years agonewline handling
PatR [Sat, 26 Dec 2015 05:54:01 +0000 (21:54 -0800)]
newline handling

In light of the recent 'bad options' feedback issue where \r messed
up message display, try to to make newline handling be more consistent.
I'm sure there are lots of places that still handle \n manually, but
it's a start.

9 years agofix #H4146 - more enlightenment vs drain resistance
PatR [Sat, 26 Dec 2015 00:46:02 +0000 (16:46 -0800)]
fix #H4146 - more enlightenment vs drain resistance

Duplicate of another recent report as far as drain resistance from
Excalibur/Stormbringer/Staff of Aesculapius not being shown by
enlightenment goes, but this one mentioned that it also wasn't being
shown for lycanthropy.  Being inflicted by that does confers level-
drain resistance.  were_change() wasn't calling set_uasmon() since
it isn't changing youmonst.data, but set_uasmon() is were intrinsics
conferred by creature form are set up.  So call it when changing
were-form.  Direct access to u.ulycn wasn't calling it either, so add
a new routine to assign the value to that instead doing so directly.

9 years agofix #4040:2 - message typo for pet mind flayer
PatR [Fri, 25 Dec 2015 23:33:56 +0000 (15:33 -0800)]
fix #4040:2 - message typo for pet mind flayer

Mentioned in a completely unrelated report (about energy drain for
vortex attack):  the message given if a tame mind flayer is killed by
attempting to eat Medusa's brains had "then is passes" where "then it
passes" was intended.

9 years ago"fix" #H4040 - energy vortex power drain
PatR [Fri, 25 Dec 2015 23:00:28 +0000 (15:00 -0800)]
"fix" #H4040 - energy vortex power drain

Reporter thought the fact that two different DREN cases had different
chances to inflict energy drain was an inconsistency, but it was
intentional.  Attack for DREN damage has 25% chance to drain energy,
and is never used since no monster has such an attack.  Engulf for
DREN damage has 75% chance to drain energy; energy vortices have this,
and the higher chance to be drained while engulfed was intentional.
So add comments explicitly spelling out the 25% and 75% chances.

During beta testing there was a complaint that the energy drain was
much too severe:  once hero's current energy drops to 0, excess drain
for current attack and future drains come out of max-energy instead.
That's survivable for caster-type characters with really high energy,
but drained low energy characters to 0 max energy very quickly.
I agreed with the complaint but didn't implement a fix until too late
for 3.6.0.  I've since thrown that one out and done this one instead.
Change base drain amount from 4d6 to 2d6, and weaken it more to 1d6
when energy is low or strengthen it to 3d6 when energy is high.  It
almost certainly will need further tuning.

9 years agoinappropriately sensing humans and elves
PatR [Fri, 25 Dec 2015 22:24:18 +0000 (14:24 -0800)]
inappropriately sensing humans and elves

Discovered while testing the from-what enhancements to enlightenment.
Polymorphing into a vampire confers the ability to sense humans and
elves without having telepathy or being triggered by blindness.  That
would be taken away if you polymorphed into something else, but was
being left in effect if polymorph just timed out and hero returned to
normal form.

Same thing occurred for sensing shriekers if you poly'd into a purple
worm and then reverted to normal (something much less likely to get
noticed and not really subject to abuse if it ever did).

Bonus fix:  the code involved was using 0 to mean that Warn_of_mon
from polymorph wasn't in effect, but 0 is also giant ant.  This makes
it use NON_PM for that instead.

9 years agofrom_what()
PatR [Fri, 25 Dec 2015 22:15:00 +0000 (14:15 -0800)]
from_what()

Enlightenment/attribute disclosure while in wizard mode shows reasons
for some of the intrinsics.  This adds some more of those:  innately
due to polymorph for lots of things, and innately due to role for
knight's jumping.  (Drain_resistance from equipped item came with the
'resistance from Excalibur' patch.)

9 years agofix #H4142 - resistance from Excalibur
PatR [Fri, 25 Dec 2015 22:13:05 +0000 (14:13 -0800)]
fix #H4142 - resistance from Excalibur

Enlightenment and end of game disclosure didn't report level-drain
resistance if that was obtained via wielding Excalibur (or Stormbringer
or Staff of Aesculapius).  Drain_resistance wasn't one of the attributes
set for intrinsics/extrinsics when wielding or unwielding weapon or
wearing/unwearing other equipment.  loseexp() checks resists_drli()
which does check for items in use, so level drain would be aborted,
possibly after messages claimed that it was taming place.  I didn't try
to untangle any of that, just changed set_artifact_intrinsic to include
a test for DRAIN_RES.

9 years agocreate 'games' group from the postinstall script of Mac binary package
Haoyang Wang [Fri, 25 Dec 2015 00:13:45 +0000 (16:13 -0800)]
create 'games' group from the postinstall script of Mac binary package

9 years agofix "Patch for dos mode nethackrc file on linux"
PatR [Fri, 25 Dec 2015 00:00:50 +0000 (16:00 -0800)]
fix "Patch for dos mode nethackrc file on linux"

Reported directly to devteam (12 Dec), user had a config file originally
from MSDOS or Windows and used it on a linux system.  That works as-is
except when it contained an invalid option line.  Feedback was
"ad option line: "whatever-the-line-was
because of the carriage return character staying in the option buffer
after linefeed was stripped off from CR+LF line end.

He included a patch which replaced this existing fixup after fgets()
if ((p = index(buf, '\n')) != 0) *p = '\0';
with a loop over the whole string changing either '\n' or '\r' to '\0'.
This uses
if ((p = index(buf, '\n')) != 0) {
if (p > buf && *(p - 1) == '\r') --p;
*p = '\0';
}
instead.  Ordinarily I would have just cloned the original line and then
substituted \r for \n in the copy, but the report mentioned "I couldn't
get index to work with carriage return".  I don't know what he tried to
do or why simple index(buf,'\r') might not work as intended on his
platform, so I went with something that will work even if index()
behaves as strangely as the report suggested.

(We already have a couple of index(string,'\r') calls in use, but I'm
not going to change those unless someone complains about a problem.)

9 years agoFix bz210, H4114: Castle chest can be trapped
Pasi Kallinen [Thu, 24 Dec 2015 12:07:35 +0000 (14:07 +0200)]
Fix bz210, H4114: Castle chest can be trapped

9 years agoAllow defining symbols with OPTIONS
Pasi Kallinen [Thu, 24 Dec 2015 10:29:27 +0000 (12:29 +0200)]
Allow defining symbols with OPTIONS

Some people are confused by the boulder -option, and
SYMBOLS=S_boulder, so allow defining symbols with
OPTION-lines in addition to the SYMBOLS.

So these are the same thing:

  SYMBOLS=S_boulder:0
  OPTIONS=S_boulder:0

9 years agoAllow optional parameter for boolean config options
Pasi Kallinen [Thu, 24 Dec 2015 09:24:09 +0000 (11:24 +0200)]
Allow optional parameter for boolean config options

Some people try to set boolean options in the config file
by giving the option a parameter, so allow that:

OPTIONS=color:true

Allowed parameters are "true", "yes", "false", and "no".
Negating an option and giving it a parameter is an error.

9 years agofix #H4041 - implicit declaration of has_colors()
PatR [Thu, 24 Dec 2015 00:25:06 +0000 (16:25 -0800)]
fix #H4041 - implicit declaration of has_colors()

_M_UNIX (SCO UNIX) and __linux__ (all flavors of linux?) both call
has_colors() for TTY_GRAPHICS+TEXTCOLOR configuration, but neither
declared it.  The new declaration is just a guess based on usage.

9 years agofix "killed by a died"
PatR [Thu, 24 Dec 2015 00:05:45 +0000 (16:05 -0800)]
fix "killed by a died"

Explosion caused by an unseen gas spore resulted in messages about
"explosion" instead of "gas spore's explosion", which is intended, but
followed that with a death reason of "killed by a died" which isn't.

9 years agofix #H4082: create games group from package postinstall script
Haoyang Wang [Wed, 23 Dec 2015 12:53:28 +0000 (04:53 -0800)]
fix #H4082: create games group from package postinstall script

9 years agodata.base formatting
PatR [Wed, 23 Dec 2015 01:36:11 +0000 (17:36 -0800)]
data.base formatting

Give all the attribution lines more indentation than a single tab so
that they never line up exactly the same as the text which precedes them.

Combine some attribution lines that had been split across two or three
lines but could reasonably fit on one or two.

Include a second boomerang quote from Pratchett--currently commented out
since the first boomerang quote is also from him.

9 years agoDo not autopickup unpaid items in shops
Pasi Kallinen [Tue, 22 Dec 2015 20:36:27 +0000 (22:36 +0200)]
Do not autopickup unpaid items in shops

This is overridden by pickup_thrown and autopickup
exceptions.

9 years agoSome shopkeepers are always stingier
Pasi Kallinen [Tue, 22 Dec 2015 19:44:53 +0000 (21:44 +0200)]
Some shopkeepers are always stingier

This prevents the "drop the item few times, just to see if
the sell price changes"

9 years agoDisplace a pet rather than stop travel
Pasi Kallinen [Mon, 21 Dec 2015 17:12:02 +0000 (19:12 +0200)]
Displace a pet rather than stop travel

... and stop travel if you take damage from any source.

Original patch via Acehack by Alex Smith

9 years agoFix findtravelpath buffer overflow
Pasi Kallinen [Mon, 21 Dec 2015 16:18:28 +0000 (18:18 +0200)]
Fix findtravelpath buffer overflow

Test case: Bigroom, full of boulders, with a single
path from travel start to travel end. Boulders (and
doors) are added to the travelstep[xy] arrays multiple
times, and will overflow the arrays.

Original patch via Acehack by Alex Smith

9 years agoMake travel consider traps like closed doors
Pasi Kallinen [Mon, 21 Dec 2015 15:31:04 +0000 (17:31 +0200)]
Make travel consider traps like closed doors

Test case: U-shaped corridor, with a known trap in it.
Before this change, travel would try to move straight at
the target, bumping the wall or walking into a dead-end.
After this, travel will go along the corridor and then stop
right before the trap.

Original patch via AceHack by Alex Smith.

9 years agotribute: more Raising Steam
PatR [Mon, 21 Dec 2015 10:06:23 +0000 (02:06 -0800)]
tribute: more Raising Steam

The number of passages felt a bit light, so add a few more.

9 years agoH4047 revisited - dipping prompts
PatR [Mon, 21 Dec 2015 03:11:36 +0000 (19:11 -0800)]
H4047 revisited - dipping prompts

Shorten the dip-into-fountain, dip-into-pool, and dip-into-potion prompts
when flags.verbose is off.  For non-verbose, use "it" (or "them") instead
of the formatted object name of the item being dipped.

Also, the "What do you want to dip <object> into?? [xyz or ?*]" prompt
for dipping into a potion had an extra question mark.  I must have seen
that umpteen times before it actually registered.

No fixes entry; these are changes to post-3.6.0 changes....

9 years agofix #H4072 - alchemy bugs
PatR [Mon, 21 Dec 2015 01:17:48 +0000 (17:17 -0800)]
fix #H4072 - alchemy bugs

The 3.6.0 feature of dipping only a subset when attempting to dip a large
stack of potions into another potion (other than water) was calculating
the size of the subset poorly.  Dipping 9 non-magic potions would always
dip the whole stack, but attempting to dip 10 would split the stack and
dip 2..9, so manually splitting off 9 in advance let the player always
get maximum yield.  This anomaly didn't extend to dipping magic potions,
where dipping 2 always dipped "all" 2 and attempting to dip 3..N dipped
2..min(N,9) regardless of N.  Also, the decision about whether what you
were dipping was magic was based on the potion being dipped even though
most alchemy formulas yield the same outcome when dipping magic potion
into non-magic or vice versa.

Change the splitting calculation to yield 3..min(N,8) for magic and 7..N
for non-magic, with no extra threshold that can produce anomalies in the
result.  Also, the determination of magic vs non-magic is based on the
outcome rather than either of the inputs--unless the outcome is random,
in which case it will be treated as magic if either of the input potions
is magic.

9 years agofix #H4105 - credit cloning
PatR [Sun, 20 Dec 2015 09:44:19 +0000 (01:44 -0800)]
fix #H4105 - credit cloning

Putting gold into a hero-owned container on a shop's floot gave credit
for the amount of the gold but also set the gold object no_charge, so
it could be taken out without taking away the credit.  Then put back
in and taken out as many times as the player liked, doubling the gold
each time until the shopkeeper was out of cash.

I think the proper fix would be to avoid giving credit instead of not
marking the gold no_charge, but that would require multiple additional
changes so I took the easy way out.

Most of the changes to pickup.c are reformatting that it escaped prior
to release.  The changes to shk.c are cosmetic and not part of the fix.

9 years agofix "spellbook of novel" on discoveries list
PatR [Sun, 20 Dec 2015 04:07:51 +0000 (20:07 -0800)]
fix "spellbook of novel" on discoveries list

Avoid "spellbook of novel" after novel becomes discovered.  Now it will
just be "novel".  Prior to discovery, it might be on the list as "book
called whatever" if the player assigns a type name.

Also, make novel become discovered after reading one instead of only via
object identification.  It already shows up as "novel" in inventory, but
changing its definition to designate it as not-interesting-to-discover
feels disrespectful to the tribute.

9 years agohave #jump cast "jumping"
PatR [Sun, 20 Dec 2015 03:39:20 +0000 (19:39 -0800)]
have #jump cast "jumping"

Requested during beta testing:  if hero can't jump, have #jump command
attempt to cast the jumping spell.  This is similar to how #unturn and
^T cast spells when used while lacking the innate ability.

9 years agomore tin opener
PatR [Sun, 20 Dec 2015 02:14:39 +0000 (18:14 -0800)]
more tin opener

Reading a non-cursed scroll of enchant weapon has a side-effect of
uncursing a weapon welded to hand(s).  Make it do the same thing for
cursed tin opener, the only non-weapon/non-weptool that welds to hand.

9 years agotin opener fix
PatR [Sun, 20 Dec 2015 01:11:33 +0000 (17:11 -0800)]
tin opener fix

Applying a non-wielded tin opener and then declining to pick a tin to
open would wield the opener without having any time elapse.

Reformat the new tin opener code.

Remove a no-longer-used label in doapply() in order to avoid a warning
from gcc.