Commit Graph

1085 Commits

Author SHA1 Message Date
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
nhmall
24099c50b2 suppress an MSC warning in cppregex.cpp
Changes to be committed:
	modified:   include/ntconf.h
2015-11-13 09:14:50 -05:00
PatR
a14b1f9992 fix PATCHLEVEL
> Somebody has changed versioning so that the game incorrectly states
> 3.6.1 in messages. It looks like someone updated patchlevel instead of
> editlevel?

Yes, that was me.  I meant to increment EDITLEVEL and nobody noticed
the mistake until now....

This changes PATCHLEVEL back to the correct value of 0, and implicitly
resets EDITLEVEL to 0 for release (by not changing it to 1 as it was
supposed to have been for the past 3-4 weeks).

Data files from Oct. 18 through today are actually compatible but will
be rejected once anyone rebuilds with this fix, same as would happen
when EDITLEVEL changs.  Data files from before Oct. 18 will be
incompatible but be accepted by nethack but not work correctly due to
a change in the 'context' structure.
2015-11-11 22:56:57 -08:00
PatR
85b234e1fc tiny symset memory leak
Symbol set names weren't being freed upon exit.
2015-11-09 19:11:41 -08:00
Pasi Kallinen
2c0f24896f Unify blind feel_location or newsym info single func 2015-11-09 21:37:28 +02:00
Pasi Kallinen
99925ff155 Update version numbers in source comments 2015-11-06 16:05:36 +02:00
PatR
69b13d574d releasing inventory window(s)
This should address the issue that the problem patch to display_pickinv()
was trying to deal with:  releasing the inventory window before exiting
the program so Pasi's memory checker doesn't think it's a memory leak.

Not related, but in the same file:
The older qsort comparison routines are tagged with CFDECLSPEC to deal
with some C vs C++ interaction issue.  I added that to the relatively
recently added 'sortloot' qsort compare callback.

I also changed worn_wield_only(), although it isn't actually called.
(display_minventory() has provisions to call it, but both of the latter's
callers pass in MINV_ALL so allow_all() gets used instead.)
2015-11-02 18:14:57 -08:00
Pasi Kallinen
9181f06dab Fix crystal ball use after being destroyed
Crystal ball can be destroyed when used, so pass the object parameter
back as null in that case.
2015-11-01 18:49:43 +02:00
PatR
68cb45c9fd str_end_is()
Move this small utility routine to hacklib.c where other such things
live and where it's feasible to find them if you need the functionality
elsewhere.
2015-10-31 17:13:26 -07:00
Pasi Kallinen
530ba8e3d3 Add sanity checking for light sources 2015-10-27 18:36:07 +02:00
PatR
2c20805b16 unsplitting split object stack
Replace the code that Dean objected to with something a little bit more
robust.  It doesn't rely on the two stacks being adjacent or having the
same inventory letter.  It is still vulnerable to having another
splitobj() occur between the offending split and its attempted unsplit,
or to either of the two halves of a split being extracted from their
object chain.  As before, failure to unsplit only results in the two
halves of the split remaining separate stacks, not anything more drastic
like the panic() that prompted all this.

Simplification of hallucinated currency names got mixed in with this
patch.  I haven't bothered separating it back out.

Whoever reset PATCHLEVEL to 0 jumped the gun.  This patch increments it
since change to the 'context' structure breaks save file compatibility,
so it will need to undergo another reset before release.
2015-10-18 17:37:15 -07:00
Pasi Kallinen
95983f6ae6 Use macros for monster appearances 2015-10-18 13:55:11 +03:00
PatR
4b8db661dd wet towel enhancements
Flesh out wet towels a bit:
1) wielding a wet towel--or a dry one which becomes wet--won't give a
   "you begin bashing with your wet towel" message when attacking;
2) if a formerly wet towel dries out completely while wielded, *do* give
   "you begin bashing with your towel" on the next attack;
3) successfully hitting with a wet towel no longer always loses wetness;
4) water damage to dry towel always confers at least 1 point of wetness;
5) taking fire damage (via burnarmor() which is used for most types of
   fire damage) has a chance to partially or fully dry a wet towel
   (regardless of whether it's wielded at the time; applies to monsters
   as well as hero; each towel being carried is checked until one is
   affected, then any others escape drying.

Not done:
-) attacking with a wielded wet towel perhaps ought to be treated as a
   weapon attack using whip skill rather than an augmented arbitrary-
   junk-by-weight attack;
-) throwing a wet towel should probably ignore wetness--it's just a wet
   piece of cloth when not finishing with a whip snap; right now, it
   loses a point of wetness when thrown and usually--#3 above--another
   point if it hits...;
-) hitting burning creatures is no different than hitting anything else;
-) likewise for hitting wet creatures.
2015-10-17 17:00:53 -07:00
Pasi Kallinen
af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
Pasi Kallinen
66dd87454b Comment typofixes, pt 3 2015-10-17 13:47:25 +03:00
Pasi Kallinen
f056bdb429 Comment typofixes, pt 2 2015-10-17 13:15:46 +03:00
Pasi Kallinen
f8b48490aa Comment typofixes 2015-10-17 12:28:52 +03:00
Pasi Kallinen
65a30d2ba7 Fix C343-341: Stuck in minetown room
Bustling Town can be generated with inaccessible areas outside the
top edge of the fixed town map.  If you end up in one of those area
without any way to dig or teleport, you're stuck.

This adds a new level flag "inaccessibles" to force checking for
such inaccessible areas, and add secret doors, holes/trapdoors,
or some random escape item into the areas.
2015-10-13 19:00:22 +03:00
Pasi Kallinen
f0220c4203 Add monster data sanity checking 2015-10-11 20:36:28 +03:00
Pasi Kallinen
d9bc2fb621 Add paranoid option for breaking a wand
Add OPTION=paranoid_confirm:wand to prevent accidental
wand breaking - suggested by scorchgeek
2015-09-27 19:13:20 +03:00
PatR
96f9997164 unicorn horn vs deafness
Implement the suggestion that applying a non-cursed unicorn horn can
cure deafness like other similar troubles.  Also, applying a cursed one
can cause deafness, although I made the chance be half of what it is
for the other troubles since they tend to be more significant.

This is entry #2 on the bugzilla list, but I haven't figured out how to
update that yet.
2015-08-20 18:31:12 -07:00
PatR
9034e2a7e5 W_WEAPON, W_ACCESSORY
Add macros W_WEAPON and W_ACCESSORY, similar to existing W_ARMOR, bitmask
of all the relevant worn bits.  Just for code readability; there should
be no change in behavior.

Also, reformat the "ugly checks" portion of getobj().  Slightly better
readability and fewer continuation lines, but only a modest improvement.
2015-07-25 19:19:58 -07:00
PatR
c64036c97b \#overview quest feedback
Implement the requested feature to have an automatic annotation on the
dungeon level with the quest entry portal where you sense the leader
summoning you.  It stays even after entering the portal (which results
in another automatic annotation of "portal to quest"), up until you
return to that level after having completed the quest.

Add a second one for the quest home level once the leader has given
you the go ahead to start the quest.  After completing the quest that
one remains but its wording is changed.

This ought to haved incremented EDITLEVEL but I decided to risk leaving
current save files viable.  That should work ok for anyone who isn't
overriding the default definition of Bitfield(), although odd behavior
could conceivably occur.  New games have nothing to worry about.
2015-07-04 20:06:31 -07:00
nhmall
5df350d548 separate option to toggle hilite_pile
Beta tester report.

The use of use_inverse meant that you couldn't selectively
choose to hilite pets but not piles. Add its own option.
2015-06-22 15:51:43 -04:00
Derek S. Ray
2224df66f0 Slight improvement to handless pets' pickup changes
Allow one item to be taken out of a pile, and leave framework in place
for partial splits so that all monsters will take up to their capacity,
rather than leaving the whole pile if it's too big to take all at once.
2015-06-21 15:16:22 -04:00
Pasi Kallinen
1df377b951 Lights are floaters
From Boudewijn:
> y a light (tame yellow light called Snertkat) [seen: normal vision,
> infravision]
> Snertkat deliberately jumps onto a polymorph trap!

So make yellow and black lights floaters.
2015-06-17 13:44:02 +03:00
nhmall
b33c3381e6 update master's version of display.c
Incorporate a few pieces of in-progress code into master
so that it isn't left in an odd state, thus prompting
patches.
2015-06-16 06:23:28 -04:00
nhmall
0353207f02 a couple more tribute easter eggs
Changes to be committed:
	modified:   include/context.h
	modified:   include/extern.h
	modified:   src/files.c
	modified:   src/invent.c
	modified:   src/sounds.c
	modified:   src/spell.c

Add a couple more tribute easter eggs.

 - can lead to a remark by Death if you happen to have a pratchett book on
   your person, as suggested by M. Stephenson (fat chance you will, or
   think to #chat if you do, but it could be a tournament novelty or something
   obscure to strive for).
 - can draw some additional Death quotes from the tribute file. (There's two
   in there right now. If anyone wants to add or suggest some more, please go
   ahead. The Death quotes are at the end of the tribute file. One-liners
   only please or the code will only pull the last line.
2015-06-15 22:22:56 -04:00
PatR
29f9a8a33d #overview, level difficulty
Three fixes, the first leading to the need to fix the second, and that
fix making dealing with the third be straightforward.

First, make the furthest level reached in any given branch be considered
interesting by #overview, even if no interesting features have been
encountered.  This will result in listing Gnomish Mines and their first
level when someone goes down the stairs and immediately back up.  It will
also produce a reminder of how far you've been--in each branch--after
retreating for any reason, without the need to manually add an annotation.

Second, #overview was suppressing the range of level numbers for Sokoban
because the author realized that the values were wrong.  The record of
the furthest level reached was incorrect for builds-up branches, always
sticking with the deepest level even though it was the entrance.  The
overview patch neglected to do the same suppression for Vlad's Tower and
the level range ("36 to 38" or similar) there was wrong.  This fixes the
furthest level reached problem and also fixes #overview's level range
handling for builds-up branches.

Third and last, a long-standing issue which I don't think has ever been
formally reported:  the level difficulty calculation used for monster
creation treated the upper (harder to get to) levels of builds-up branches
as if they were easier since they're closer to the surface as the gopher
burrows.  So sokoban generated easier monsters on its final level than on
the ones leading up to that.  Make depth for difficulty purposes account
for descent to the entrance and then ascent to the level of interest.

There was a distressing amount of trial and error involved.  The dungeon
layout structures are not exactly easy to work with, and I never managed
to get builds_up() based on branch data to work correctly.  Basing it on
dungeon data works as intended provided the branch has more than one
level, but it will yield incorrect result if we ever add a single-level
branch reached via stairs up rather than stairs down.
2015-06-14 18:14:14 -07:00
PatR
12c013ee28 more menustyle
Make the list of menustyle values in the game match their order in the
revised documentation:  traditional, combination, full, partial.
2015-06-11 14:09:17 -07:00
nhmall
00d25adab2 actual field is always around anyway
Changes to be committed:
	modified:   include/flag.h
2015-06-10 20:48:29 -04:00
Pasi Kallinen
b4cc349a46 X11: Hilight piles of objects 2015-06-09 19:59:38 +03:00
Pasi Kallinen
174e6f47b3 TTY: Hilight piles of objects
Add MG_OBJPILE flag, which windowports can use to check if a location
has more than one object stack. If use_inverse is on, TTY will use
inverse to show such piles.  If a boulder is the topmost item on a pile,
then the object pile flag is not used; mainly because boulders are "solid",
boulders dropped by monsters are nearly always over other objects, and so
that special levels such a Sokoban can "hide" items under the boulders.

TODO: a "pilemark", analogous to "petmark", perhaps a green plus sign,
which can be used by windowports with tiles.
2015-06-09 16:54:48 +03:00
nhmall
c3a77914a9 Modify the window interface for print_glyph
Changes to be committed:
	modified:   doc/window.doc
	modified:   include/qt_win.h
	modified:   include/trampoli.h
	modified:   include/winX.h
	modified:   include/wingem.h
	modified:   include/winprocs.h
	modified:   include/wintty.h
	modified:   src/display.c
	modified:   src/windows.c
	modified:   sys/amiga/winami.p
	modified:   sys/amiga/winfuncs.c
	modified:   sys/amiga/winproto.h
	modified:   sys/wince/mswproc.c
	modified:   sys/wince/winMS.h
	modified:   win/Qt/qt_win.cpp
	modified:   win/X11/winmap.c
	modified:   win/chain/wc_chainin.c
	modified:   win/chain/wc_chainout.c
	modified:   win/chain/wc_trace.c
	modified:   win/gem/wingem.c
	modified:   win/gem/wingem1.c
	modified:   win/gnome/gnbind.c
	modified:   win/tty/wintty.c
	modified:   win/win32/mswproc.c
	modified:   win/win32/winMS.h

print_glyph now takes a second parameter.

Tiles on tiled ports always looked odd on places like the plane of air
where the background color of the tile didn't match the general background
of the surrounding area.

3.6 made that even worse and more glaringly noticeable with the introduction
of darkened room tiles.

The code to actually send something useful through the new parameter
for window ports to take advantage if they want will follow.
2015-06-08 19:37:26 -04:00
PatR
a1aebc336c blind-from-birth fix
The Blindfolded_only macro didn't track u.uroleplay.blind so would
give a false positive if wearing a blindfold, not able to see due to
the blind option, and not afflicted with any other blindness factors.
Dipping a worn blindfold into holy or unholy water is supposed to
reveal a glow if that blindfold is the only reason for blindness but
the glow was described even when blind-from-birth.

There's no feedback at all when the glow isn't seen.  I'm punting on
that one.  (This change didn't introduce that, just added one extra
situation where it happens.)
2015-06-02 17:30:16 -07:00
nhmall
856b59d8e9 status conditional code commented oout for merge 2015-06-02 17:09:39 -04:00
nhmall
66ae23a77e option name change to statushilites
Changes to be committed:
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/flag.h
	modified:   src/options.c
	modified:   win/tty/wintty.c

example:
OPTIONS=statushilites
OPTIONS=hilite_status:hitpoints/30%/bright-magenta/normal
2015-06-01 22:30:04 -04:00
nhmall
9999ba9700 Merge branch 'master' into status_hilite
Conflicts:
	include/extern.h
	win/tty/wintty.c
2015-06-01 22:13:41 -04:00
nhmall
c7c5895ad3 ready for testing
Changes to be committed:
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/config.h
	modified:   win/tty/wintty.c
2015-06-01 21:41:00 -04:00
PatR
f0904157c5 tty role selection when filter by options
Honor things like OPTIONS:role=!tourist and NETHACKOPTIONS='race=!orc'
when performing interactive role selection.  I don't think it was
completely correct when players let the program choose, but it must
have been close enough because we haven't gotten any complaints.
The post-3.4.3 interactive selection was ignoring options-base filtering
entirely and did get complaints for the pre-beta.

Role selection has a ton of code which bloats the program without doing
anything useful for actual game play.  It ought to be split off into a
separate front end.
2015-06-01 18:18:47 -07:00
nhmall
ec92c2007a Merge branch 'master' into status_hilite
Conflicts:
	include/extern.h
	src/options.c
2015-06-01 09:09:44 -04:00
nhmall
ca8f25d4b6 more updates and on/off option 2015-06-01 08:33:17 -04:00
nhmall
3cb2c66f35 more work on the tty status_hilite code
Changes to be committed:
	modified:   include/wintty.h
	modified:   src/botl.c
	modified:   win/tty/wintty.c
2015-05-31 19:39:28 -04:00
nhmall
1c00f3b8f3 yet more updates
Changes to be committed:
	modified:   include/botl.h
	modified:   include/extern.h
	modified:   include/wintty.h
	modified:   src/botl.c
	modified:   src/options.c
	modified:   src/windows.c
	modified:   win/tty/wintty.c

get the tty versions started
2015-05-31 16:50:08 -04:00
nhmall
40f1dc8bc3 more updates
Changes to be committed:
	modified:   include/botl.h
	modified:   src/botl.c
	modified:   src/windows.c
	modified:   win/tty/wintty.c
2015-05-31 15:18:59 -04:00