Commit Graph

1129 Commits

Author SHA1 Message Date
Pasi Kallinen
e7d65a44cd TTY: Add compile-time option for tile data hinting
Several people have asked if 3.6.0 supports playing with tiles on
a public server. Because there's no way for the user's end to know
what that white @ is, this adds special console escape codes for
tile hinting.

The idea was originally a patch called TelnetTiles by Justin Hiltscher,
but this expanded version comes via NAO, where it's been in use for years.

This is basically an interim hack, which should go away when/if
we support actual client-server model.
2016-01-10 10:53:15 +02:00
Pasi Kallinen
befc6a65b5 TTY: Add menu_overlay option
This was a request from a blind player.  It's hard to find
the left edge of the menu when it's drawn on the map, so
clear the screen and align menus to the left edge of the screen
when this option is turned off.

Originally this was called the window edge patch.
2016-01-08 22:17:40 +02:00
PatR
db234f743d integrate 'msgtype' option and Norep()
Allow 'msgtype=show' for messages that nethack uses Norep() for.
I don't know whether anyone will ever want to do that, but if felt
strange to have two different message suppression mechanisms that
were completely disconnected from each other.

For a user with no msgtype filter, there'll be no difference in
behavior.
2016-01-08 00:38:34 -08:00
PatR
c8cd550a5a get_count() cleanup
Fix several warnings.  Accept ASCII RUBOUT (aka DELETE) in addition
to backspace.  [Should use erase_char (and add support for kill_char)
but that means pushing get_count() into the interface code.]  Guard
against user causing the count to wrap if someone ever adds a call to
get_count() which doesn't specifying a maximum value.
2016-01-06 15:37:46 -08:00
Pasi Kallinen
c740425a90 Use define for iron ball weight increment 2016-01-06 16:23:48 +02:00
Pasi Kallinen
237c4a2787 Allow dissolving iron bars with potion of acid
Force-fight iron bars with wielded potion of acid to dissolve them

This change comes via UnNetHack by Patric Mueller.
2016-01-06 15:49:06 +02:00
Pasi Kallinen
4c016853d4 Unify getting a count into single function 2016-01-06 13:54:09 +02:00
Pasi Kallinen
4aeb2913cf Only requiver pickup_thrown ammo and throwing weapons 2016-01-06 04:58:37 +02:00
Pasi Kallinen
f314fe87bd 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.
2016-01-06 03:35:58 +02:00
Pasi Kallinen
db4120012d Make mimics mimicing walls or trees also block light 2016-01-06 01:44:18 +02:00
PatR
e8e1673df7 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.
2016-01-04 16:51:24 -08:00
Pasi Kallinen
e9b0fa23d2 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.
2016-01-04 23:04:59 +02:00
Pasi Kallinen
89e4d5e9fa Add SIMPLE_MAIL compile-time option for public servers 2016-01-04 19:54:36 +02:00
Pasi Kallinen
34b45a2c10 Add an alternative paniclog format as compile-time option 2016-01-04 18:05:16 +02:00
nhmall
c4d45d6960 make some mextra guard macros available
Changes to be committed:
	modified:   doc/fixes36.1
	modified:   include/mextra.h
2016-01-03 10:48:47 -05:00
Pasi Kallinen
cb574aadcc Split wallification into two by function 2016-01-03 00:36:36 +02:00
nhmall
c70d466325 wizweight optional
Changes to be committed:
	modified:   include/flag.h
	modified:   include/hack.h
	modified:   src/objnam.c
	modified:   src/options.c
2016-01-01 16:17:46 -05:00
nhmall
fff3425de4 Happy New Year 2016
Changes to be committed:
	modified:   include/patchlevel.h
2015-12-31 17:26:25 -05:00
Pasi Kallinen
7be8e1f8bb Another tiny formatting fix 2015-12-30 17:41:48 +02:00
Pasi Kallinen
e29c21f367 Tiny formatting fix 2015-12-30 17:29:44 +02:00
PatR
901317f57c 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.
2015-12-28 14:35:23 -08:00
Pasi Kallinen
a5ed69288f Split get_rnd_toptenentry from tt_oname 2015-12-28 18:06:48 +02:00
nhmall
6117eddc62 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!"
2015-12-26 19:08:08 -05:00
PatR
c4a9d6a45c 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.
2015-12-25 21:54:01 -08:00
PatR
1c80503938 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.
2015-12-25 16:46:02 -08:00
Pasi Kallinen
69e7f4e29b 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
2015-12-24 12:33:17 +02:00
Pasi Kallinen
9a2eb370e7 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.
2015-12-21 17:36:14 +02:00
Pasi Kallinen
43bf9c978d Improve the tin opener 2015-12-19 14:44:39 +02:00
PatR
4604777c16 suppression of while-helpless for tombstone
Avoid the possibility of a user-supplied name interfering with killer
reason truncation.  A monster named ", while" that killed the hero
would result in "killed by <mon-type> called " being displayed on the
tombstone after stripping while-helpless reason to shorten the text.
2015-12-18 01:59:36 -08:00
Pasi Kallinen
f02253dbbb Fix bz189 H4092: Broken qt_xpms.h 2015-12-17 08:46:04 +02:00
nhmall
bc83f28e46 compatibility macro correction
3.6.0 went out with editlevel at 2, not 0
2015-12-16 17:59:10 -05:00
nhmall
fa092f5fe9 housekeeping for 3.6.1
Changes to be committed:
	modified:   Files
	modified:   README
	modified:   dat/history
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/global.h
	modified:   include/obj.h
	modified:   include/patchlevel.h
	modified:   src/invent.c
	modified:   src/objnam.c
	modified:   src/shknam.c
	modified:   src/sounds.c
	modified:   src/spell.c
	modified:   sys/winnt/Install.nt
	modified:   sys/winnt/nethack.def
	modified:   win/macosx/NetHackGuidebook.applescript
	modified:   win/macosx/NetHackTerm.applescript
	modified:   win/win32/mswproc.c
2015-12-16 17:52:34 -05:00
Pasi Kallinen
929be769ec Add option to have autodescribe on by default 2015-12-16 21:42:43 +02:00
PatR
8f96d4b9ef fix bz157, #H4075 - 'realtime' had strange units
A couple of reports asked what weird unit of measure was used for the
'realtime' value in xlogfile.  It was just seconds, but was accumulating
incorrectly whenever game-state got saved for the checkpoint option.
Now it really is seconds, or rather whatever unit you get for the delta
of two time_t values; usually seconds but not guaranteed to be that.
2015-12-15 17:59:42 -08:00
PatR
9f6f3f5180 PANICTRACE option parsing
Fix the situation where disabling PANICTRACE, which happened implicitly
when BETA  got disabled, caused SYSCF option processing to complain and
quit if the 'sysconf' file contained any PANICTRACE settings.

Now accept all the PANICTRACE options (assuming SYSCF is defined) even
if PANICTRACE is not defined.  Their values are recorded in the 'sysopt'
struct, but only validated when the appropriate macros (PANICTRACE,
PANICTRACE_LIB) are defined.
2015-12-04 22:18:17 -08:00
PatR
171fb90746 !DEBUG warnings
With DEBUG suppressed, I started getting
16      warning: empty body in an if-statement
and 2   warning: empty body in an else-statement
from gcc.

Using braces for an empty block instead of just ';' avoids the warning:
    if (foo)
        debugpline("foo");
is bad,
    if (bar) {
        debugpline("bar");
    }
is good.  ;-)

The changes to lint.h are just precautionary.

modified:
    include/lint.h
    src/attrib.c, bones.c, dbridge.c, dig.c, eat.c,
        makemon.c, mkmaze.c, mon.c, sp_lev.c
2015-12-04 14:58:49 -08:00
PatR
3c5cb6ae5c malloc/realloc for makedefs
Use of malloc() and realloc() has been added to makedefs but they
weren't being declared anywhere if <stdlib.h> is not available.
2015-12-04 14:56:14 -08:00
nhmall
8bd70be165 windows build without DEBUG defined in global.h
Changes to be committed:
	modified:   include/global.h
	modified:   sys/share/pcmain.c
	modified:   win/win32/mswproc.c
2015-12-02 23:19:04 -05:00
nhmall
ad50501872 Release prep 1
Changes to be committed:
	modified:   include/global.h
	modified:   include/patchlevel.h
2015-12-02 19:10:12 -05:00
PatR
df415b4c35 sp_lev.c update
Shorten a function name in sp_lev.c that exceeded 31 characters.
That's a limit imposed by the VMS linker and the compiler complains
that it will be truncated.

Make all sp_lev.c functions which aren't listed in extern.h be static
and give all of them a declaration at the top of the file.  I reordered
the ones already declared there in the same order as they occur in the
source, so the diff is quite a bit bigger than the actual changes.
(Once the one with the long name became static, the length of its name
no longer mattered, but I've shortened it anyway.)

Indent a couple of #pragma directives.  Some pre-ANSI compiler didn't
like '#' in column 1 followed by something it didn't understand, even
when that occurred in a conditional block which was in the midst of
being excluded.  (util/*_comp.y recently reminded me of that.  files.c
should get a fix like this too.)
2015-12-02 02:18:24 -08:00
PatR
3edfcffccc SYSCF WIZARDS
Preformat SYSCF entry 'WIZARDS' so that it can be displayed during panic
feedback without allocating memory for the formatted list at that time.
It also gets displayed for help's "support information" ('?k').

For panic(), push "it may be possible to rebuild" to a second line since
the formatted usernames might make the line long.
2015-11-22 17:23:11 -08:00
PatR
b30fce4f88 flag panic() and terminate() as "no return"
Mark panic() as never returning so that code analysis might be able
to do a smarter job.  It required splitting done() into two routines
since the first part really can return (but not if PANICKED was the
reason it got called).  done() is now much shorter and ends with a
call to new really_done(), and panic() skips done()'s might-return
part by calling really_done() directly.

Noticed in passing:  the "report error to <list of SYSCF WIZARDS>"
code calls a routine which uses alloc(), which won't work very well
if the reason for panic was because malloc() ran out of memory.
2015-11-22 08:33:42 -08:00
Pasi Kallinen
7063488621 Pacify some clang compile warnings 2015-11-21 23:40:06 +02:00
Pasi Kallinen
dc09a991fe Fix some warnings from clang's static code analyzer 2015-11-18 22:54:28 +02:00
PatR
2d284b0907 include/*.h formatting
I tracked down the widest lines, which sometimes occur due to mis-indent
of block comments (see tradstdc.h for an example), and fixed those up.
For the files affected, I also converted tabs to spaces.
2015-11-17 02:26:17 -08:00
PatR
1f3253541a display.h reformatting
A couple of macros with comments in the midst of their expansions got
badly mangled by the automated reformat and one ended up with a line
that was over 150 characters wide.
2015-11-16 18:57:11 -08:00
PatR
fa8ac8a2ce update config.h
Some reformatting (replacing tabs with spaces), but mostly updating some
of the comments, particularly about SYSCF.

Shouldn't GENERIC_USERNAMES be controllable via SYSCF?
2015-11-16 18:55:15 -08:00
PatR
c40982eb23 tribute enhancement
When reading a novel, select a random passage which hasn't been shown
already.  Once you've run through all the passages, it resets to get
them all again (with new random order that might happen to the be same
order if there aren't many passages).  Switching to a different novel--
even another copy of the same one--will cause the previous passage
selection to be discarded and restarted from scratch if the prior book
is read again.  Passage tracking for the most recently read novel is
kept across save and restore.  (That means I needed to bump EDITLEVEL,
so it will need to be reset to 0 again before release.)
2015-11-15 21:57:15 -08:00
Pasi Kallinen
ffcc6f1bc2 Remove the useless FUN STUFF section
The fun stuff section in config.h contains nothing fun anymore,
so let's remove it. Move SCORE_ON_BOTL to the next section,
and add couple other defines there too.
2015-11-14 10:29:50 +02:00
PatR
95772261dc fix memory leak: obj->oextra->omonst->mextra
The memory leak (monst->mextra->edog, monst->mextra->mname,
monst->mextra for some monster were not released) I noticed recently
was due to recording a pet's full monster attributes with its corpse.
During save and restore, obj->oextra->omonst was being treated as a
full-fledged monster so worked as intended, but when freed, omonst
was treated as a black box and its mextra details weren't handled.
2015-11-13 20:39:10 -08:00