Commit Graph
345 Commits
Author SHA1 Message Date
nhmall df495c2ce6 Merge branch 'NetHack-3.6' 2019-05-27 16:38:09 -04:00
PatR 6c0f92a264 end of game oddities: thrownobj, ball&chain
If you died while Punished but with attached ball and chain temporarily
off the map (changing levels and when swallowed are the cases I looked
at; there may be others), the ball and chain objects would not appear
in bones (for the falling-down-stairs case; bones are never saved if
hero dies while swallowed) and they weren't being freed.  Put them
back on the map so that they'll be included in bones and also freed as
part of normal map cleanup.

This caused a problem if the attached ball had state OBJ_FREE due to
being thrown rather than being temporarily off the map.  'thrownobj'
was being deallocated without first cancelling punishment, so uball
object was freed via thrownobj pointer but stale uball pointer still
referenced it.  Unpunishing would introduce sequencing issues because
that would need to be after attribute disclosure.  So instead of
deallocating thrown or kicked object, put it/them (can't actually have
both at the same time) back on the map.  This has a side-effect of
saving thrown Mjollnir in bones if it kills hero when failing to be
caught upon return.  (I thought that that had been fixed ages ago?)
2019-05-26 18:44:25 -07:00
nhmall db25fe56a8 Merge branch 'NetHack-3.6.2' 2019-05-05 23:30:50 -04:00
PatR 6127c10848 comment/formatting tidbits
Some miscellaneous stuff I don't want to discard of lose track of.
No change it actual code.
2019-05-05 15:20:09 -07:00
nhmall d15496ba31 Merge branch 'NetHack-3.6.2' 2019-04-22 14:36:58 -04:00
nhmall dcf4da2150 preserve dknown field between fakeobj instances
Preserve temporary fake object's previous dknown value by storing it
as a flag value within the m_ap_type field of the posing monster, and
recalling it when it is needed.

This is intended to help eliminate observable differences in price display
between real objects and mimics posing as objects.

98% of this is just switching the code to utilize macro M_AP_TYPE(mon)
everywhere to ensure that the flag bits are stripped off when needed.
2019-04-22 14:17:18 -04:00
nhmall ea1f04959f Merge branch 'NetHack-3.6.2' 2019-04-06 21:08:01 -04:00
PatR 0e425d645f curses vs !HILITE_STATUS
The curses interface wouldn't build with HILITE_STATUS disabled.  I
started adapting it to handle genl_status_update() but that was taking
too much effort with each niggling detail leading to another.  This
goes the opposite direction:  forcing the old STATUS_VIA_WINDOWPORT
behavior without having that #define available.  That dragged along a
bunch of unexpected changes too.
2019-04-06 15:53:51 -07:00
nhmall abfd80d3d7 Merge branch 'NetHack-3.6.2' 2019-04-02 12:25:16 -04:00
PatR 0a847f46f9 streamlined status update for 'time'
When the 'time' option is on and context.botl isn't already set,
call a simpler status update routine that ignores all other fields.
When that flag is already set, full status update takes care of time
along with the other fields.

Expected to reduce bottom lines processing time but not screen I/O.
Only lightly tested.
2019-03-31 08:23:36 -07:00
nhmall 773e896e60 Merge branch 'NetHack-3.6.2' 2019-03-27 07:22:04 -04:00
PatR 42cb4ac3e8 disclosure fix
Back in December, a change was made to suppress status when u.uhp == -1.
But if the hero died with exactly that amount, the status display would
be blanked out during end of game disclosure.  Force u.uhp to be 0 when
dying.  That was already happening if death occurred while hero still
had positive HP, but not when damage took him/her to negative.
2019-03-26 19:16:01 -07:00
nhmall fc9dde7ae1 Merge branch 'NetHack-3.6.2' 2019-03-13 20:21:56 -04:00
nhmall 13c0428721 even more mingw 2019-03-13 19:59:57 -04:00
nhmall 4f679352b7 Merge branch 'NetHack-3.6.2' 2019-02-27 08:20:38 -05:00
nhmall 587a51bee7 include isaac64 in xcode build 2019-02-24 14:35:49 -05:00
nhmall 9bb43c39fb Merge branch 'NetHack-3.6.2' 2019-02-13 15:09:02 -05:00
PatR 4bb5560961 more #H8167 - late messages
Do late message suppression in a different fashion.  Also, there are
more messages than shk taking hero's possessions and guard taking
hero's gold that need to be suppressed if regular message delivery
is no longer possible:  "do not pass Go", "you arise from the grave
as a foo", "the corridor disappears", "you are encased in the rock".
Those last two are from vault handling but take place in a convoluted
manner:  paygd -> mongone -> grddead -> clear_fcorr.
2019-02-11 13:39:34 -08:00
nhmall 58f2218c4e Merge branch 'NetHack-3.6.2' 2019-01-09 07:24:18 -05:00
nhmall 1894832e0f Merge branch 'NetHack-3.7' 2018-12-25 22:15:02 -05:00
nhmall 656e18786e Merge branch 'NetHack-3.6.2' 2018-12-25 22:12:44 -05:00
Bart House 06f8450be1 Merge branch 'win-wip3.7' into win-wip3.7-bart 2018-12-25 18:35:09 -08: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
Bart House 769ad91cc3 mthrowu, nhlan, options, regions, rip and role globals moved to g. 2018-12-25 16:26:27 -08:00
nhmall 7974533eab Merge branch 'NetHack-3.7' into win-wip3.7 2018-12-25 16:35:45 -05:00
nhmall eb1f430ff5 Merge branch 'NetHack-3.6.2' 2018-12-25 16:34:07 -05:00
PatR 99cd9ea264 simplify container_contents()
iflags.in_dumplog is accessible even when DUMPLOG is not enabled.
2018-12-25 13:05:35 -08:00
Bart House b1ab64db43 program_state moved to g. 2018-12-25 10:09:04 -08:00
Bart House 0763046c38 zeroX, tc_gbl_data and fqn_prefix moved to instance globals. 2018-12-25 08:09:37 -08:00
Bart House 1c65e6afe0 context to g.context 2018-12-25 07:29:38 -08:00
Bart House 8c1a4d9a97 invent, youmonst, hackdir moved to g. 2018-12-24 21:04:15 -08:00
Bart House 90547edb83 moves, monstermoves, wailmsg, migrating_objs and billobjs moved to g. 2018-12-24 20:22:33 -08:00
Bart House be5cdcf77a killer, level and rooms move to instance globals. 2018-12-24 19:50:08 -08:00
Bart House 572ee347b9 Another round of instance globals changes. 2018-12-24 16:43:50 -08:00
Bart House 62e1a45b60 Merge branch 'win-wip3.7' into win-wip3.7-bart
Conflicts:
	src/end.c
2018-12-24 12:09:42 -08:00
nhmall a229a8a56d Merge branch 'NetHack-3.6.2' 2018-12-24 06:44:27 -05:00
PatR e2852f25fd fix temporary strength loss that was permanent
Watching the fuzzer, I saw hero's strength plummet to 3 again and not
rise above 5 after that.  It turns out to be due to life-saving, which
was fixing severe hunger but was not restoring the point of strength
that's lost when you go from hungry to weak.

I'm not sure whether this was caused by 3.6.1's commit
024e9e1225 or already behaved that way.

Another fuzzer bit:  the monk I was watching was bitten by a wererat
early on and was still inflicted with lycanthropy when he reached
level 19.  (I've no idea how his level got to be so high; it jumped
from 14 to 19 while I wasn't paying attention.)  Extend the earlier
hack for drinking a blessed potion of restore ability to recover lost
characteristcs to sometimes drink a potion of holy water instead.
2018-12-24 02:08:44 -08:00
Bart House 74edf42f1c Moved decl.c globals into instance globals. 2018-12-22 18:44:22 -08:00
Bart House 576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House e4ab048c90 Even more globals moved to instance_globals.c 2018-12-19 20:01:55 -08:00
Bart House 3645e415e3 Moved more globals to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House 912886a73f First set of changes to move globals to instance_globals. 2018-12-19 20:00:35 -08:00
PatR 1813865dc8 warn_unused_result in end.c
There is only one warn_unused_result warning from gcc in end.c;
change the code a little to use it.
2018-12-18 14:30:31 -08:00
PatR 27a515a4cc get_hilite_color()
Stop pretending that long and int are the same size when picking status
highlight rule for gold or time or experience-points.

Also, K&R compilation might lack <limits.h>, so let XXXconf.h define the
necessary macro(s) (currently just LONG_MAX) so that it can be skipped.
2018-12-15 15:46:49 -08:00
PatR a63b9f29a5 fuzzing hero boost
I watched the fuzzer run for a bit and noticed that Str and most other
characteristics were steadily dropping until they hit 3 and not being
recovered, so I gave the defenseless hero a chance to benefit from
blessed restore ability occasionally.  It hasn't helped much.  Str and
Con both still drop to 3.  [If I had to guess, I'd go with side-effect
of polymorphing, but not an intended one.]
2018-12-12 17:55:43 -08:00
PatR 95a6c458bc fix #H6292 - green slime & genocide
Report suggested that if hero is turning into green slime, genociding
green slime should cure it.  I went another direction:  if life-saved
while dying due to turning into green slime, you survive polymorphed
into green slime form.  If green slimes have been genocided (probably
after becoming infected with slime or hero wouldn't have faced any
slimes to cause infection, but that could be from eating a glob of
green slime created prior to genocide, or from #wizintrinsic), you'll
immediately die again, this time from genocide.
2018-12-05 01:45:16 -08:00
PatR 2beb36fc61 Schroedinger's Cat
If hero was carrying Schroedinger's Box at end of game, disclosing
inventory converted it into an ordinary box.  That interferred with
subsequent disclosure when writing DUMPLOG, which saw an empty box
if inventory had been shown or the special box with newly-determined
contents if not.  I tried a couple of ways to fix it and decided
that redoing it was better in the long run.

Schroedinger's box is still flagged with box->spe = 1, but instead
of having that affect the box's weight, now there is always a cat
corpse in the box.  When opened, that will already be in place for
a dead cat or be discarded for a live one, but the weight will be
standard for container+contents and when box->cknown is set it will
always be "containing 1 item" (which might turn out to be a monster).

Some temporary code fixes up old save/bones files to stay compatible.

TODO:  food detection used to skip Schroedinger's Box; now it will
always find a corpse, so some fixup like the ridiculous probing code
is needed.
2018-11-21 03:10:49 -08:00
PatR ffac5f1a65 life-saving vs sickness
Replace an old instance of direct manipulation of an intrinsic.
If life-saving occurs 1 turn before sickness will kill the hero,
the sickness if cured.  But it was leaving delated_killer for SICK
allocated.  Harmless but a bug none the less.
2018-11-19 16:24:10 -08:00
PatR e486d941ed couple of #wizintrinsic fixes
When #wizinstrinsic was expanded to be able to set any timed attribute,
some that need more than just a timeout counter were left inconsistent.
1) Timed Flying wasn't blocked by levitation, and existing flight
   wasn't becoming blocked by timed levitation.  Also, eventual flight
   timeout wasn't updating the status line, so false 'Fly' condition
   remained shown until a status update happened for some other reason.
2) Setting timer for Warn_of_mon didn't set up any type of monster to
   warn about so wouldn't do anything.  This sets that to grid bug
   unless already set due to polymorph form or artifact that warns.

The end.c portion is just a bit of formatting.
2018-11-10 18:22:38 -08:00
Pasi Kallinen 0bb6754998 Fuzz testing debug tool
Add code to run a fuzz tester, simulating (more-or-less) random
keyboard mashing. There's no option to turn it on, you need to
set iflags.debug_fuzzer on via a debugger or something along
those lines.
2018-11-08 15:55:49 +02:00