Commit Graph

7912 Commits

Author SHA1 Message Date
nhmall
d60cd7200e Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-01 08:37:01 -05:00
PatR
4fc49a22de tweak the Astral Plane level
Even out the difficulty (from one game to another) somewhat.  Instead
of a 75% chance that two large areas will be opened up on the left
and right sides of the arrival area plus 13.5 (avg) * 1.5 (avg) extra
monsters in that region, change to 60% chance that the left side will
be opened up with 7 (avg) * 1.5 (avg) extra monsters and a separate
60% chance that the right side will be opened up with 7 * 1.5 (avg)
extra monsters.  The chance that both sides get opened up drops to
36% but the chance that neither side gets opened drops to 16%, with
difference made up by 24% chance each for just one side or the other.

I was a little surprised that this actually worked.  I hope there's
a less clumsy way to have a loop index.
2018-12-31 16:48:14 -08:00
nhmall
c2777860e9 incorrect header 2018-12-30 22:02:42 -05:00
nhmall
af9d36b562 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-30 21:41:30 -05:00
PatR
3cc4db7950 Unix Makefile
Separate the compiler flags used for compiling X11 code from the rest
of CFLAGS.  Affects hints/macosx10.8 and later.

Add an explicit output argument to the generated compile rules.
2018-12-30 17:39:56 -08:00
PatR
da40f55a9f 'O' vs bouldersym
The 'O' handling for bouldersym was updating the display value for
boulder even if the value had been rejected, and if it still had the
default of '\0', the map would end up with <NUL> characters.  (When
examined via '//' or ';', those matched dummy monster class #0 and
led to the impossible "Alphabet soup: 'an("")'" that was suppressed
yesterday.)

Attempting to set bouldersym to ^@ or \0 would also be rejected as
duplicating a monster symbol.  That is now accepted and used to reset
the boulder symbol to default.  However, other control characters are
also accepted--not due to this patch, they already are, and from a
config file in addition to via 'O'--so bouldersym can still disrupt
the map.  But that's no different from putting control characters
into a symbol set or setting them from config file via S_foo:^C.
2018-12-30 15:30:38 -08:00
nhmall
31c4a3fca4 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-30 08:01:30 -05:00
nhmall
83e8033f72 remove curses date.h dependency in Windows Makefiles 2018-12-30 07:58:39 -05:00
PatR
adf64764f4 minor memory leak
I ran the fuzzer with MONITOR_HEAP enabled and heaputil found a dozen
or so un-free'd allocations, all made by the same dupstr() call in
special_handling() for "symset" and "roguesymset".  (Reproducible with
a few tens of thousands of fuzzer moves, although you have to take
over from the fuzzer and make a clean exit rather than just interrupt
it or there'll be lots of other un-free'd memory.)  I haven't actually
figured out how/why it was leaking, but reorganizing the code has made
the leak go away (according to a couple of even longer fuzzer runs) so
I'm settling for that.
2018-12-29 20:41:16 -08:00
PatR
39b6f7f462 alphabet sour warning
A recently added impossible to check for an(Null) and an("") was
triggered by the fuzzer:  Alphabet soup: 'an("")'.  I reproduced it a
couple of times and tracked it do_screen_description(for '/' command)
matching the symbol from mapglyph to monster class #0, a placeholder
with symbol value '\0'.  So mapglyph() returned a symbol of '\0', but
not necessary from showsyms[0 + SYM_OFF_M].

The pager lookup code's monster loop shouldn't have been attempting
to match against class #0, and since this fix I haven't been able to
reproduce the situation again.  But I also didn't trigger it with a
bunch of temporary checks in mapglyph() so don't know what is really
going on under the hood.
2018-12-29 20:39:11 -08:00
PatR
d418008b31 curses splash/copyright screen, role prompt
Back out '#include "date.h"' so that cursinit.c won't be recompiled
every time any other file(s) need to be compiled.  It doesn't need
patchlevel.h either.  There is already a straightforward way to fetch
the copyright banner lines from version.c.

The splash screen (ascii art spelling "NetHack" preceding the normal
copyright lines) was invisible when showing white text on white-ish
background.  Make it honor !guicolor.

"Shall I pick a character's role, race, gender and alignment for you?
 [ynaq] (y) " was too wide to accept the answer on the same line on
an 80-column display so "(y) " was placed on the second line.  That's
constructed in the core; change the construction to omit " a" when
using "character" rather than a role name.  (tty shortens it by omitting
the default " (y)"; with " a" gone, it could revert to normal prompt.)

Also a bit of lint cleanup and some reformatting of cursinit.c....
2018-12-29 18:38:30 -08:00
keni
9a9f76bf5c fix typos in header line so expansion works 2018-12-29 19:19:30 -05:00
nhmall
367ad8de51 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-29 12:36:19 -05:00
nhmall
eed7c4bdd1 nttty topten output processing
switch back to using the safe routines
after tty port exits on Windows console
tty port.

Fixes H7758
1613
2018-12-29 12:26:33 -05:00
nhmall
f1bce74af6 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-29 08:46:43 -05:00
PatR
5882832ef0 X11 on OSX
The change to Makefile.src for X11+XPM on linux broke linking X11 on
OSX.  This updates the hints files (except for the -qt one) so that
 make WANT_WIN_X11=1
and
 make WANT_WIN_X11=1 USE_XPM=1
work correctly.

The comment in macosx10.14 about what version(s) it's intended for
and been tested on is just cloned from 10.10 and should be updated.
2018-12-29 03:28:07 -08:00
Pasi Kallinen
45e06d638f Curses: Remove useless inventory label
The inventory window used a line to say "Inventory:", which is pretty
useless, and that was the only window showing such a label.

Also don't duplicate the "Not carrying anything" text from core.
2018-12-29 13:16:51 +02:00
PatR
4cbfb7d05f X11 USE_XPM lint 2018-12-29 03:02:07 -08:00
Pasi Kallinen
6ac681b5fa X11: default to XPM-format tile file and rip screen
People have been wondering how to change the tiles on the X11
version, and the old default of NetHack-specific binary tile data
isn't directly editable with image editing tools.

Also show in the #version info if xpm and graphic rip are enabled.
2018-12-29 07:19:24 +02:00
PatR
c4bda6a6a8 create_particular 'I' vs mkclass
The revised mkclass() [actually new mkclass_aligned()] has an extra
check which didn't used to be there, and attempting to create a
monster of class 'I' with ^G triggered impossible "mkclass found no
class 35 monsters" which the fuzzer escalates to panic.
2018-12-28 19:10:54 -08:00
PatR
5846aee283 memory #stats
obj->oextra->omonst might contain monst->mextra plus mextra->edog, &c.
That was being ignored when summing up memory allocated for objects.
2018-12-28 15:06:45 -08:00
nhmall
8235825883 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-28 12:56:44 -05:00
nhmall
fc504dfa89 yet more Windows Makefile
Now that the dependency lines are corrected for the
correct output files in the Makefile, it revealed a
dependency on a non-existent file.
2018-12-28 12:51:11 -05:00
nhmall
f3004a8973 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-28 12:37:56 -05:00
nhmall
be67656932 More Windows Makefile corrections 2018-12-28 12:34:41 -05:00
nhmall
1cdb9c561c Windows Makefile updates 2018-12-28 12:29:12 -05:00
nhmall
599d4f3063 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-28 10:20:47 -05:00
nhmall
a5f154d925 a couple of source spelling consistencies for /*FALLTHRU*/ 2018-12-28 10:08:56 -05:00
Tangles
9fd28fb852 curses - fix count selection not working for PICK_ONE menus.
eg: d2b would drop 2 of item b, but using d* to pick from a menu
and then selecting 2b would ignore the count and just drop the
whole stack.
2018-12-28 15:42:32 +01:00
nhmall
47ef36c3d8 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-28 09:42:20 -05:00
Patric Mueller
19f0a2d3ba Fix missing compilation dependency for cursinit.c 2018-12-28 15:21:33 +01:00
nhmall
067379b896 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-28 08:29:26 -05:00
Pasi Kallinen
ca336bbf4b curses: include date.h
This way the curses port will show the version and compile date
on the startup banner, just like tty does.
2018-12-28 11:34:01 +02:00
nhmall
50f55e92c0 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-27 22:44:16 -05:00
PatR
c056ca1b35 fix github issue #170 - stacks of non-missiles
Fixes #170

Monsters never throw athames or scalpels but some fake player monsters
on the Astral Plane are given those.  Since they're stackable the
quantity usually gets boosted but there's no point in having more than
one if they won't be thrown.

This could have been fixed by letting monsters throw those two items,
but I prevented the quantity from being boosted instead.
2018-12-27 18:36:26 -08:00
PatR
96eaca731a stack merging vs shop pricing
When merging one stack into another and they have different obj->o_id
price adjustments, keep the o_id of whichever one commands the higher
shop price.
2018-12-27 15:37:06 -08:00
PatR
9e0d945961 stack splitting vs shop prices
I misread part of the original code and the revision introduced a bug
based on that.  obj->o_id price variations are used for all types of
non-IDed items, not just non-glass gems.
2018-12-27 15:01:15 -08:00
nhmall
57ff5c179d Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-27 17:37:34 -05:00
nhmall
ae02682cd1 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-27 17:26:56 -05:00
PatR
a6b4322034 fix #H7103 - shop pricing
Player came across a stack of 2 gray stones in a shop and kicked one.
That one ended up with a different (in his case, lower) price once it
was separate.  This behavior only applies to non-glass gems which add
a price variation derived from internal ID (obj->o_id) number.  Make
splitting stacks always yield the same price per item in the new stack
as was being charged in the old stack by choosing a similar o_id.  Do
it for all splits (that can vary price by ID, so just non-glass gems),
not just ones performed inside shops.

He picked up the lower priced one and dropped it back on the original
higher priced one; the combined stack took on the lower price.  That
will no longer happen if they come from splitting a stack, but this
fix doesn't address merging with different prices when they start out
as separate stacks.  (Unpaid items won't merge in inventory if prices
are different, but shop-owned items will merge on floor.)
2018-12-27 14:12:48 -08:00
PatR
f8b4ad3fdc mines luckstone as achievement marker
It was possible to have the guaranteed luckstone at Mines' End become
merged with a random one and lose its specialness for achievement
tracking.  Mark it 'nomerge' when created and clear that if/when the
achievement is recorded.
2018-12-27 13:31:42 -08:00
nhmall
43906fe70b Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-26 12:20:14 -05:00
PatR
ceb446eaea curses lint 2018-12-26 01:45:17 -08:00
nhmall
ed6ff9ce82 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-25 22:06:23 -05:00
PatR
cae50298b6 container_contents() vs show goods
Fix another inconsistency with containers in shops:  prices shown when
looking inside.  Apply had them (because shop goods in containers are
flagged as 'unpaid' when hero carries the container), and loot did not
(because they aren't flagged that way).
2018-12-25 17:07:45 -08:00
PatR
96eebc1955 bill hero for magic bag explosion
Exploding a bag of holding on a shop floor didn't bill for shop-owned
contents which got destroyed.  This puts them on the 'Ix' used up list.
2018-12-25 16:52:33 -08:00
PatR
5f5f7f63f1 stolen_value() vs containers
stolen_value() treated hero-owned container holding shop-owned goods
as free for the taking.

The fix I'm working on which led to discovering this first added
stolen_value() then eventually stopped using it so I don't have an
example of where it is giving the wrong result.
2018-12-25 16:45:41 -08:00
nhmall
54fef9e737 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-25 16:53:40 -05:00
PatR
3aca92215c prices of items on shop floor
get_cost_of_item() was giving different information from shop #chat
when dealing with containers owned by hero containing objects owned
by the shop.  And when it was legitimately reporting a price of 0,
doname_with_price() wasn't reporting 'no charge' for items inside a
shop that were owned by hero or that shopkeeper didn't care about.

Extend the shop price reveal to far-look, but only when hero and item
being examined are inside the same shop.
2018-12-25 13:48:51 -08:00
nhmall
fcfb748876 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-25 16:26:49 -05:00