Commit Graph

2547 Commits

Author SHA1 Message Date
nhmall
6ff9753029 back out some spider changes
After consultation with the original committer, this
is being pulled out, possibly revisited later. There was
originally meant to be a follow-up piece to this that he
never had a chance to integrate for various reasons.
2018-12-07 19:12:56 -05:00
nhmall
89d165b501 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-12-07 09:40:38 -05:00
nhmall
a1c1acdd24 add MM_NOGRP makemon() flag
add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
a couple places that warrant it when a specific monster type isn't
specified on the call to makemon()
2018-12-07 09:29:01 -05:00
PatR
f3c4a52e36 menucolors
In the 'special options' section at the end of 'O's menu, change the
spelling for the menucolors entry to "menu colors" so that it isn't
spelled exactly the same as the 'menucolors' boolean option.  Only
affects what the player sees when reading that menu.

If player uses 'O' to add any menu colors and 'menucolors' boolean is
Off at the time, give a reminder to toggle it to On in order to have
those menu colorings become active.  (Adding hilite_status entries has
a similar reminder for 'statushilites' if done while that is 0.)
2018-12-07 01:20:20 -08:00
PatR
9e170baecc fix #H7655 - highlighting gold
With options along the line of
 OPTIONS=statushilites:4
 HILITE_STATUS=gold/always/yellow
gold started out unhighlighted (unhighlit?).  I didn't try to figure
out why, just changed things to force a full status update when gold
requires internal changes (different \G encoding or different glyph)
which is something that happens when session first enters moveloop().
2018-12-07 00:36:38 -08:00
nhmall
150d01a965 add MM_ASLEEP makemon() flag and honor it for fill_zoo 2018-12-06 22:30:15 -05:00
PatR
e9624f2583 fix #H7686 - destroy_item()'s inventory traversal
Inventory traversal can be disrupted when items being traversed are
able to change inventory.  I've lost track of how many times this
sort of thing has been discovered.

Report claimed that boiled potion of polymorph caused transformation
which resulted in dropped weapon and dropped or destroyed worn armor.
That was evidently a guess; potionbreathe() for that potion only
abuses constitution.  The traceback showed 'you_were()' was involved.
Boiled potion of unholy water triggers human-to-beast transformation
of hero inflicted with lycanthropy, yielding similar situation.

I didn't notice anything unusual when reproducing this but inventory
was definitely vulnerable.  My 'one line' fixes entries are steadily
getting to be more verbose; I may have to go back to 'fix bug'.  :-}
2018-12-06 17:27:36 -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
36c2aec2ff fix #H7667 - maybe_reset_pick(), other bad context
When deciding whether to discard interrupted lock/unlock context while
changing levels, maybe_reset_pick() checks whether xlock.box is being
carried.  But it was doing so after the old level had been saved and
memory for non-carried container there had been freed.

That led to a couple of other issues.  context.travelcc was using -1
for 'no cached value', but the fields of travelcc have type 'xchar' and
shouldn't be given negative values.  0 should be fine for 'no cache'.

Failed partial restore which occurred after old game's context had been
loaded would begin a new game with old game's stale context.  Restoring
goes out of its way to avoid that for 'flags' but didn't for 'context'.
2018-12-04 17:10:15 -08:00
nhmall
f6b7ce02d8 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-12-04 11:46:19 -05:00
nhmall
ec8f002d81 bit-use collision on WC2_TERM_SIZE, WC2_RESET_STATUS 2018-12-04 11:45:41 -05:00
PatR
285023acf6 fix #H7659 - accessing freed memory by cutworm()
hmon() can destroy the weapon being used, and known_hitum() would
still pass the pointer to the freed object to cutworm().  Remember the
relevant weapon attribute before using and maybe freeing the object,
then pass that attribute instead of the whole weapon.  Also pass
'more-likely-to-cut' for axes in addition to blades.

thimonst() behaved similarly, although due to much different code
paths none of the objects that might get to hmon() were then passed to
cutworm(), so it wasn't vulnerable.  But pass 'more-likely-to-cut'
for axes instead of for blades when thrown.
2018-12-03 18:57:01 -08:00
PatR
13ef86488a command handling for !SHELL and !SUSPEND
Change the command list to always include #shell and #suspend so that
a user's preferred key bindings can span platforms without worrying
about whether those exist or not.  They're still effectively no-ops
when compiled out.

'#?' suppresses them from the list of displayed commands.  Interface-
specific extended command handling may want to check new extcmd.flag
value CMD_NOT_AVAILABLE to do the same, but failing to do so shouldn't
pose a problem.  They behave sanely if executed when not supported.
2018-12-02 16:43:53 -08:00
PatR
26a3a53786 Sting revisited
Replace recent "(light blue aura)" with
"(flickering light blue)" if there are 1..4 orcs,
"(glimmering light blue)" if 5..12, or
"(gleaming light blue)" if there are 13 or more, and move its place
in the formatted name.
_3.6.1_: Sting (weapon in hand) (glowing light blue)
_recent: Sting (weapon in hand) (light blue aura)
_now___: Sting (weapon in hand, flickering light blue)

The thresholds for intensity may need to be tweaked.  The start
message has been changed from "glows" to "flickers/glimmers/gleams"
and is given when the intensity changes (up or down) as well as when
first glowing.  Stop message will usually be "stops flickering" but
some form of mass kill (genocide for sure, maybe explosion, probably
not wand zap) might result in stopping directly from higher intensity.

It still "quivers" if hero is blind when there are orcs on the level,
but no name augmentation shows in inventory for that situation;
describing it as "(weapon in hand, quivering)" would be too silly.
Also, the quiver or glow intermediate message if blindness is toggled
while Sting is active only worked for make_blinded(), not for putting
on and taking off a blindfold.  Now fixed.  I think becoming blind due
to polymorphing into an eyeless form is still not handled, but there
are no eyeless creatures capable of wielding weapons so that can wait.
Polymorphing from eyeless to sighted is handled but moot for Sting.
2018-12-02 02:09:22 -08:00
PatR
028efc7342 X11 text popup fix
Text popups on OSX could be dismissed with <space> or <return> or
<esc> if user's X resources had 'NetHack*autofocus' set to True, but
for the default of False they ignored all keystrokes even if you
clicked inside the popup window to set focus explicitly.  Clicking
on the Close Window button of the popup's title bar was the only way
to get the popup to go away.  Fix suggested by Pasi.
2018-11-30 16:02:55 -08:00
PatR
351c731e06 downgrade Sting's glow
Change "(glowing light blue)" to "(light blue aura)" so that there's
less suggestion that it might function as a light source.
2018-11-29 18:19:20 -08:00
PatR
b113aa7439 more steed dismount
By creating a spot of lava, filling up the whole level, and creating
a lurker above, I managed to trigger the impossible "Dismount: can't
place former steed on map" that was added earlier today.  I also was
told that my god was displeased even though the engulfer's attack was
responsible.  This addresses both situations.  I can't trigger that
impossible any more, and only voluntary dismount blames the hero if
it's killed because there's nowhere to place it.  Hero is still blamed
for any dismount that kills the steed while flying or levitating over
dangerous terrain--hero took steed into jeopardy.
2018-11-29 18:02:52 -08:00
PatR
be327d9822 steed vs "no monster to remove"
Noticed whlie testing the steed-in-pit fix.  The EXTRA_SANITY_CHECKS
for remove_monster() are being tripped if riding hero has steed killed
out from under him because the steed is not on the map.  This started
out simple but got a bit complicated.  It seems to be sufficient but
I'm not very confident about it.

Being engulfed while mounted gave "placing monster over another?" due
to a change made along with EXTRA_SANITY_CHECKS but not conditional on
it.  (The change was to issue a warning about an actual problem which
was previously undiagnosed.)  I think bumping the engulfer off the map
in favor of the former steed only worked because some u.uswallow code
eventually used the hero's location to put the engulfer back.  I didn't
pursue that to try to figure what really happened, just prevent it.

The DISMOUNT_BONES handling was being executed even if the steed was
dead.  DISMOUNT_BONES only happens if the hero is dead.  Since I don't
know whether it's possible for dead hero and dead steed to happen at
the same time, move it inside the steed-not-dead block just in case.
2018-11-29 12:15:14 -08:00
PatR
4ab1c12f03 fix github issue #164 - lack of steed-in-pit mesg
Fixes #164

No message was shown when riding a steed into a pit or spiked pit.
Setup for the message was done, but post-3.4.3 insertion of else-if
into the previous if/else/endif cut off its delivery.
2018-11-29 10:24:50 -08:00
PatR
c318841363 fix #H7631 - wielding cursed weptool via 'apply'
Applying a non-wielded cursed pick-axe first wielded it, then dug,
but it didn't report "pick-axe is welded to your hand".  (Attempting
to drop it or wield something else did report that, after the fact.)
The same thing happened if you used a pole-arm rather than pick-axe.
2018-11-29 03:49:16 -08:00
nhmall
99891455d3 earlier Guidebook change neglected to update the date 2018-11-29 00:24:35 -05:00
nhmall
c35c2df14d Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-11-28 21:47:34 -05:00
nhmall
3db1e42dc8 dungeoneers update - Karl Garrison 2018-11-28 21:46:52 -05:00
PatR
234bf7b1b6 fix #H7618 - gas cloud affects underwater monsters
Stinking cloud placed near water or poison gas breathed across it
would affect and potentially kill underwater monsters.  Most swimmers
are on the surface and should be affected, but eels and other fish
shouldn't be.

This also changes minliquid() to not treat flying and levitating as
ways to survive water when on the Plane of Water.

I think goodpos() needs to be taught about that Plane (where many ways
of existing at a water location don't apply).  This doesn't do that.
2018-11-28 17:43:53 -08:00
nhmall
8d1aa429ca catch up on some fixes36.2 entries 2018-11-28 20:39:09 -05:00
nhmall
478b53b4c2 Merge branch 'mouse_support' into NetHack-3.6.2-beta01 2018-11-27 22:58:42 -05:00
nhmall
cc0e7a8750 mouse_support docs 2018-11-27 22:56:19 -05:00
PatR
5d2686e7c1 lev_comp int vs long
Fix lev_comp's variable argument usage by changing it to make
add_opvars() expect an int rather than a long when given the "i"
indicator, and add "l" for really passing a long.  The ints are
conveted to longs when setting up the interpreter.  I think I changed
just about all the integer opvars to int, although there is one use
of "l" in lev_main.c just to make sure it works.  There could be
arguments that really do need to be 'long'; if so, the add_opvars()
calls for them will have to have its indicator string updated and
possibly add or remove some casts.

There's a lot of reformatting included but it's not consistent about
tab replacement.  Some of the changes are due to renaming long-named
'variable_definitions' to 'vardefs' to shorten a bunch of lines.

Updated sys/share/*_yacc.c will be checked in separately.  The ones
currently in the repository won't work with patched lev_main.c due to
that renamed variable.
2018-11-27 18:21:58 -08:00
nhmall
ccd6f1cf22 more orctown-related follow-up
Under some circumstances, when all the marauding orcs belonging to the
horde operating within the gnomish mines had been provided with their
spoils and placed appropriately, there could still be some pillaged stuff
left-over on the migrating obj chain. Orcs created by regular monster
generation elsewhere would then be susceptable to receiving that stuff
until it was used up. That part is fine, except that the orcs were then
being named as part of the same horde operating within the mines. Now
they will no longer be named as part of the Gnomish Mines horde.

Mythos: There's a good chance that these particular orcs received the
stolen goods from the Gnomish Mines horde.
2018-11-25 12:47:53 -05:00
PatR
e5c488b15e fix github pull request #161 - scatter()
Fixes #161

Report states that scattering objects might leave a 'pile' glyph when
no longer appropriate.  I didn't try to reproduce that, just took it
on faith.  The fix tried to be too efficient and might have missed
fixing the display if breaks() or ohitmon() destroyed the objects
being scattered and left 'total' at 0.
2018-11-24 15:22:33 -08:00
PatR
bb08a46480 fix #H7596 - magic trap 'deafening roar' outcome
doesn't wake monsters.  Now it does.
2018-11-24 15:01:30 -08:00
PatR
cc5bb44a9a fix #H7591 - migrating monsters vs full levels
During level change, when a monster from mydogs (monsters accompaying
hero, usually pets) couldn't be placed because the level was full, it
was set to migrate to that level (in order to get another chance to
arrive if hero left and returned).  The code sequence
 mon_arrive()-> mnexto()-> m_into_limbo()-> migrate_to_level()-> relmon()
tried to remove the monster from the map, but it wasn't necessarily on
the map (depending upon whether it couldn't arrive at all, or arrived
at the hero's spot and couldn't be moved out of the hero's way).  The
EXTRA_SANITY_CHECKS for remove_monster() issued impossible "no monster
to remove".  relmon() now checks whether monster is already off the map.

While investigating that, I discovered that pets set to re-migrate
to the same level to try again on hero's next visit didn't work at all.
migrating_mons gets processed after mydogs so moving something from
the latter to the former after arrival failure just resulted in
immediate second failure when the more general list was handled during
the hero's current arrival.  And failure to arrive from migrating_mons
would kill the monster instead of scheduling another attempt.

The sanest fix for that turned out to be to have all monsters who
can't arrive be put back on the migrating_mons list to try again upon
hero's next visit.  Pets still fail twice but are no longer discarded
during the second time, and now do arrive when hero leaves and comes
back provided he or she has opened up some space before leaving.  If
there's still no space on the next visit, monsters who can't arrive
then are scheduled to try again on the visit after that.

Recent fix for invalid corpses becomes moot.  Monsters aren't killed
during arrival failure so there are no resulting corpses to deal with.
2018-11-24 01:45:09 -08:00
PatR
ac9bdc8aa7 fix #H7585 - can't untrap from edge of pit
Attempting to untrap an adjacent location failed if you had escaped a
pit, claiming that you couldn't reach.  You can't reach the bottom of
the pit if you're not in it, but you should be able to reach adjacent
spots normally.
2018-11-21 19:16:23 -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
nhmall
03ef9da591 Merge branch 'macosx-curses-fall2018' into NetHack-3.6.2-beta01 2018-11-20 21:01:48 -05:00
nhmall
f295b00ad1 fixes updates for curses and Xcode 2018-11-20 21:00:03 -05:00
PatR
d15dacc44c fix #H7530 - corpse from corpseless monster
Migrating monster attempting to arrive on a level which is already
full of monsters gets killed off.  It was leaving a corpse without
regard for whether it was a type of of monster which should never
leave corpses.

I'd prefer that it be put back on the migrating_mons list rather
than be killed off, but this just suppresses impossible corpses.
2018-11-20 13:13:23 -08:00
nhmall
7ee4fa3c3f some curses window-port doc bits 2018-11-19 10:40:51 -05:00
nhmall
923e1c5854 Merge branch 'NetHack-3.6.2-beta01' into win-curses 2018-11-19 09:57:58 -05:00
PatR
40ce977522 fix #H7573 - impossible zero payment in money2mon
When paying for shop door or wall damage, if the entire amount was
covered by shop credit then impossible "zero payment in money2mon"
would occur as the shop code tried to transfer 0 zorkmids from hero
to shopkeeper after using credit to pay.
2018-11-18 18:48:59 -08:00
nhmall
cb43061076 curses changes to existing files 2018-11-16 20:51:22 -05:00
PatR
6ecf97f6e3 vms build/install update
New-ish files 'engrave', 'epitaph', and 'bogusmon' added for 3.6.0
were not handled by playground setup.  NetHack runs without them so
limited testing didn't notice.

Add 'makedefs -s' to build them and include them in installed files.

Also, remove 'makedefs -m' and obsolete monstr.c.
2018-11-16 09:16:48 -08:00
nhmall
a9dcb37ca7 augment codepage850-to-Unicode mappings in nttty 2018-11-16 08:09:18 -05:00
nhmall
acdc62a861 stale gold symbol displayed after symset change
a stale gold symbol could be displayed on the status line following a switch
to a new symset, as observed and reported for Windows RogueEpyx symset.

An update is required for gold in the status line for a change to
any of the following:
    context.rndencode value
    the encoded glyph value for COIN_CLASS
    the gold amount
2018-11-15 02:34:45 -05:00
PatR
bd4cacbc52 fix #H7536 - pet vampire behavior
Vampires tend to take vampire bat form and stay that way, unless/until
there's a closed door they want to pass in which case they change to
fog cloud form.  Those shifted forms are weak, so pet vampires tend
not to attack other monsters, and if they don't take damage, they
won't change to vampire form.  So, when comparing relative strength of
self and foe while deciding whether to attack another monster, treat
their own strength in weak form as if in vampire form, making them be
more aggressive.

Hostile vampires shouldn't need any comparable change.  They don't use
relative strengths when deciding whether to attack something.
2018-11-13 16:29:48 -08:00
PatR
a97d0b7270 fix github issue #159 - eating nurse corpses
Fixes #159

The nurse monster definition is flagged to be able to convery poison
resistance when a corpse or tin is eaten, but the post-corpse code
for nurse healed HP and cured blindness then skipped the intrinsic
handling.
2018-11-13 15:05:54 -08:00
PatR
ab7fb9360e fix #H7065 - clairvoyance shows trap over monsters
and over the hero.  3.6.0's clairvoyance tried to show things in
a non-standard sequence, which was intentional but had unintended
side-effects like the disappearing monsters complained about in the
report.  To make it work as intended would have required --More--
whenever it kicked in, which is much too intrusive when it happens
every N turns rather than when explicitly casting the spell.

Redo it substantially, and give preference to monsters over objects,
objects over traps, and traps over underlying terrain like normal
vision-based display does.  It now detects all monsters within its
bounding box but shows ones which aren't directly in view as
"unseen monster" unless via spell cast at skilled or expert, or at
basic when also having intrinsic clairvoyance.
2018-11-11 14:28:54 -08:00
nhmall
a0b53ee391 merge 2018-11-11 10:29:52 -05: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
PatR
e8a8f142ae otransit_msg() fixes
Fixes #156

githib issue #156 complains that "The Excalibur falls down the stairs,"
is using poor grammar despite the fact that the usual drop message is
"You drop the +0 Excalibur."  I agree.  Change it to be "Excalibur
falls down the stairs."  (Drop message remains unchanged.)

While looking at that, I noticed that when knocking other items down
stairs, text was being appended to the formatted object name.  It was
probably safe due to the space reserved for inserting a prefix while
formatting an object's name, which becomes available for a suffix
after that name has been copied into otransit_msg()'s local buffer,
but using a separate buffer is safer.
2018-11-10 01:37:23 -08:00