Commit Graph

4336 Commits

Author SHA1 Message Date
PatR
d2ae45984e fix github issue #38 - indentation vs `if {}'
Fixes #38

In 3.6.1, some code in mfind0(detect.c) was mis-indented in a way
which suggested that the grouping within braces might not be what was
intended, and that was right--there was a pair of braces missing when
compared with older versions of the code involved.  A previous patch
(post-#38) had changed the indentation to match the surrounding braces
without really addressing the issue.  But it turned out not to make
any difference either way since mundetected is only used by hiders
and eels.  This reorganizes the relevant code to make it simpler to
understand, I hope.
2018-10-18 17:15:42 -07:00
PatR
e0f5cfe0b3 fix #H7453 - 'bonesknown' for dead hero
Dead hero's map coordinates are set to <0,0> part way through bones
creation, then were being used to record grave location for overview
feedback with "final resting place for <dead hero>" if/when another
character got those bones and found the grave (actually, spotted the
location where first hero died regardless of whether a grave gets
placed there).  Record dead hero's pre-<0,0> coordinates as intended.

Not previously noticed because in wizard mode the final resting place
becomes part of overview info as soon as bones are loaded rather than
waiting for the death location to be reached.
2018-10-15 18:26:49 -07:00
PatR
239c3cef55 fix github pull request #144 - uswapwep vs shield
Fixes #144

While giving a new character his/her starting equipment, don't clear
alternate weapon when putting on a shield since that weapon should
still be available to swap with primary.  Affected knight's lance
and valkyrie's dagger.

Also, guard against wearing an initial shield if already wielding a
two-handed weapon, or wielding such a weapon if already wearing a
shield.  Both situations are hypothetical with current starting gear.
2018-10-14 02:47:09 -07:00
PatR
e4db2b4721 Elbereth tweaks
Don't "feel like a hypocrite" when on Elberth and attacking a monster
which isn't scared by Elbereth (exception:  peaceful creatures aren't
scared but attacking them in such situation is hypocritical anyway).
This means that players can use Elbereth to scare away some creatures
while continuing to fight others.  Elbereth won't be automatically
erased, but weapon attacks will scuff the engraving; wand zaps don't.

Reduce the -5 alignment penalty when alignment is 5 or less.  Reduced
amount is -(1..5), so -3 average.
2018-10-13 18:14:34 -07:00
nhmall
c6a5ec1ab6 ensure tmp_at() structures are initialized for all code paths when swallowed 2018-10-04 22:02:28 -04:00
nhmall
8ce1f88f53 Revert "ensure tmp_at() structures are initialized for all code paths when swallowed"
This reverts commit 39074d29fc.

Bad commit of do_throw
2018-10-04 22:00:51 -04:00
nhmall
67c80b2e4b Revert "fix up a bad commit"
This reverts commit 2eb8436db2.
2018-10-04 22:00:08 -04:00
nhmall
2eb8436db2 fix up a bad commit 2018-10-04 21:55:01 -04:00
nhmall
39074d29fc ensure tmp_at() structures are initialized for all code paths when swallowed 2018-10-04 21:49:16 -04:00
PatR
14bef9a02d formatting cleanup src/*.c
Remove trailing spaces, and remove tabs from the files that had
trailing spaces.

Also, rndorcname() was using a random value to terminate a loop
and was recalculating a new one each iteration.
2018-10-02 16:53:22 -07:00
PatR
1110786ec2 change default for 'autodescribe' to 'on'
This was discussed two years ago then nothing happened.  Make
autodescribe for feedback when moving the cursor to pick something
default to on instead of off.
2018-10-01 15:08:33 -07:00
PatR
053880c149 untrap downwards while over trap
Force trap to activate during failed untrap attempt if done while
already at the trap's location, to match the recent change in
behavior when failed attempt occurs while adjacent to the trap.

Most noticeable while flying over bear traps, but affects all
failed untrap attempts.
2018-09-30 16:37:32 -07:00
nhmall
d9ecc42566 a couple of steed Flying messages 2018-09-30 10:01:43 -04:00
nhmall
85aef136d5 comment typo in music.c 2018-09-30 08:45:49 -04:00
PatR
3e19858edd fix #H6925 - being trapped vs Levitation/Flying
Make being trapped in/on/over floor block Levitation and Flying, the
way that being inside solid rock already does, and the way levitating
blocks flight.

Blocked levitation still provides enhanced carrying capacity since
magic is attempting to make the hero's body be bouyant.  I think that
that is appropriate but am not completely convinced.

One thing that almost certainly needs fixing is digging a hole when
trapped in the floor or tethered to a buried iron ball, where the
first part of digactualhole() releases the hero from being trapped.
If being released re-enables blocked levitation, the further stages
of digging might not make sense in some circumstances.

I recently realized that being held by a grabbing monster is similar
to being trapped so should also interfere with levitation and flying.
Nothing here attempts to address that.

Save files change, but in a compatible fashion unless trapped at the
time of saving.  If someone saves while trapped prior to this patch,
then applies it and restores, the game will behave as if the patch
wasn't in place--until escape from trap is achieved.  (Not verified.)
2018-09-30 01:06:59 -07:00
PatR
21db5a3ae6 alternate bear trap fix
Fix the situation of Flying hero failing to untrap a bear trap that
was resulting in the trap becoming hidden.  Previous fix prevented
hero from moving onto the trap's location so that the reason for
hiding it didn't occur.  This moves the hero and forces the trap,
so it will become unhidden again before there's any chance to notice
that it had been hidden.

Status 'Flying' conflicts with being trapped at floor level, but that
is a separate, known issue.  I'll have to resurrect my unfinished fix
for that sooner rather than later.
2018-09-27 18:42:12 -07:00
PatR
dc3f497d56 more extended command help
For the searching capability offered by '# ?', use ':' instead of 's'
to activate it.  Otherwise, if the player typed ':', menu processing
would handle that and would search the few menu entries (for selectors
'a', 's'--now ':', and maybe 'z') when we're interested in searching
the data displayed via many separator lines.

I left 's' as the selector for "show all, clear search" once a search
has been performed, but perhaps that ought to be switched to ':' too.
2018-09-27 03:52:23 -07:00
PatR
e0b7d2f5a9 monpolycontrol, wizdebug_*
Demote #monpolycontrol and #wizdebug_traveldisplay from commands to
simple boolean options.  The former has the same name, the latter
is called travel_debug.  Rename #wizdebug_bury to #wizbury; it
shouldn't matter that it goes away when compiled without DEBUG.

There are now five wizard-mode boolean options:  monpolycontrol,
sanity_check, and wizweight are documented in the Guidebook;
menu_tab_sep and travel_debug are commented out there.

Guidebook.mn has been tested; Guidebook.tex has not.
2018-09-26 18:40:13 -07:00
nhmall
74b7829957 engr follow-up bit 2018-09-26 01:35:48 -04:00
nhmall
0fecf19789 wand of polymorph engrave for blind writers
Don't provide any discerning feedback on the blind player's turn
but do allow the wand to exercise its magic in a manner reflective
of blind writers
2018-09-26 01:10:27 -04:00
nhmall
cd0a29eae8 Merge branch 'flyif_fix' of https://github.com/copperwater/NetHack into copperwater-flyif_fix 2018-09-25 23:22:11 -04:00
copperwater
bab350f355 Fix "would flyif you weren't levitating" - missing space 2018-09-25 23:14:45 -04:00
nhmall
039ad51660 don't impact player stats with wizard mode ^T 2018-09-25 23:08:09 -04:00
PatR
64ebb9ceba fix #7414 - bug with Japanese names for Samurai
Description for use when an item hasn't been seen up close yet falls
back to real name if there is no separate description, but was doing
so before real name substitution for samurai.
 actualn = foo;
 dn = description ? description : actualn;
 if (Samurai)
  actualn = bar;
So player saw a flail (via 'dn') until dknown bit got set, then
nunchaku (via 'actualn' after it got set to samurai-specific value).

Wait until after substitution of Japanese real names before falling
back to real name when there's no description.
2018-09-25 18:01:44 -07:00
PatR
3a62075070 fix #H7136 - iron bars vs non-diggable walls
Iron bars can be destroyed in some circumstances (hit by yellow
dragon breath or thrown potion of acid, being eaten by rust monser
or black pudding, or by poly'd hero in those forms) and should act
like walls for diggable/non-diggable purposes.  But they aren't
walls, so the non-diggable flag was not being set for them by the
special level loader.  Even once that was changed, they weren't
being handled consistently.  Some places checked for non-diggable
directly (zap_over_floor of acid breath, potion of acid hitting bars)
and started working as intended, others used may_dig() to check
non-diggable (poly'd hero attempting to eat iron bars) but it doesn't
handle iron bars, and still others didn't check at all (bars-eating
monster who moved onto bars location in expectation of eating those
next).
2018-09-25 16:43:06 -07:00
PatR
d86e9eaec4 extended commands revision
Reorganize the logic for showing or suppressing an extended command
to avoid a slightly hairy 'foo || bar && quux' expression.

When searching and not finding anything, report "no matches" rather
just waiting for another menu selection.

Plus miscellaneous reformatting.
2018-09-25 03:44:24 -07:00
PatR
d119eca297 simplify #wizidentify
Get rid of bold/non-bold distinction in #wizidentify inventory menu
by only showing items which aren't yet fully identified instead of
full inventory with bold for unID'd.  Support for bold text might
be lacking.

I was considering this even before the report that X11 menus ignore
attribute.  The "_ - (use ^I for all)" menu entry is still present,
but it could be discarded in favor of '.' to pick everything via
ordinary menu selection.
2018-09-24 17:06:04 -07:00
PatR
8ce81a27ef fix #H7397 - pronoun for unseen shopkeeper
Most shop messages accurately identify the shopkeeper even when he
or she can't be seen, but some also include a pronoun reference that
ended up as "it" or "its" when not seen.  Extend pronoun selection
so that visibility can be ignored:  noit_mhe(mon), noit_mhim(mon),
and noit_mhis(mon).  Note that despite being called noit_foo(),
those will still return "it" if mon is neuter.

"Accurately identify shopkeeper" is misleading if the hero is
hallucinating; a random shopkeeper name is used then.  noit_foo()
yields the pronoun applicable to the actual shopkeeper and might
not match the gender of a hallucinatory name.  That could be fixed
in a couple of ways (add shk_mhe()/shk_mhim()/shk_mhis() and either
pass them the randomly chosen name so that they can figure out the
appropriate gender, or just have them use a random gender whenever
hallucinating) but I don't think that's worth bothering with.

A bunch of shop messages needed noit_foo(); only a couple of those
have actually been tested.  A bunch more were using shkname() at
the beginning of a sentence where Shknam() should be used instead.
(All the existing shk names are already capitalized so there's no
noticeable difference.)

The three places outside shk.c and vault.c which directly use
pronoun_gender() have been successfully tested.
2018-09-24 15:15:04 -07:00
nhmall
3f5ef9bdf3 make long extended commands list be more navigable 2018-09-24 16:45:38 -04:00
nhmall
02b1ce2d9a no leash-related message is given when leashed pet yellow light explodes
mondead() -> m_detach() -> m_unleash() suppresses
the m_unleash() slack message, so deliver it in
the caller explmm() in those circumstances.

(The issue of whether it should be possible to leash light
is side-stepped.)

bug H7406, 1548
2018-09-23 14:06:18 -04:00
nhmall
2813e42b22 known bear trap forgotton by player polymorphed into a flyer
The original report stated:

     "I located a bear trap as a human and just ignored it
     for the time. I polymporphed into a Vampire Lord, then
     went to #untrap the bear trap.  On the first attempt,
     I stood beside the trap and attempted to #untrap.  I
     received the 'Whoops!' message and automatically moved
     onto the trap square as a result. The bear trap vanished!
     I obviously wasn't trapped since I'm polymorphed into a
     flying monster, but the trap glyph was no longer present.
     The glyph looked like regular floor - as if I had
     untrapped the bear trap and taken the trap with me."

The trap was actually still there but became hidden intentionally
for other valid scenarios, but was an unintended side-effect for
this scenario.

Fix it by failing the #untrap operation for a Flyer earlier on,
and in a more benign manner, since the Flyer ultimately doesn't
end up in the trap anyway.  You'll still get the "Whoops!",
followed by a message, but that's as far as the "failed" #untrap
attempt will go under the circumstances.
2018-09-23 11:16:09 -04:00
nhmall
76bffe5ba4 drum of earthquake causing deafness inappropriately
Address a drum of earthquake inconsistency reported 2017-03-23:
"Drum of earthquake does not make you deaf.  Leather drum or depleted
drum of earthquake does."

bug 1099
2018-09-23 10:11:02 -04:00
nhmall
21a81d0294 BL_RESET usage for window port status line updating
Like BL_FLUSH, only send BL_RESET if the window port has
indicated it wants them via setting the appropriate WC2
bits in its window_procs structure. Update documentation.
2018-09-22 22:41:02 -04:00
PatR
18d56724f9 'unbreak' wishing probabilities
Fixing rnd_otyp_by_namedesc() for use by get_shiny() broke its use
by readobjnam().  Make the chance for 0% generation objects to have
non-zero chance of being selected be a parameter.
2018-09-22 16:46:27 -07:00
PatR
4f61e9697c fix github issue #134 - display of migrated objects
Fixes #134

An invisible hero (who can't see invisible and doesn't have autopickup
enabled) going down stairs to an object which fell down those stairs
will see the stairs instead of the object on them.  Missing newsym()
in obj_delivery() when objects aren't being passed through scatter().
2018-09-22 15:18:38 -07:00
PatR
b6e3f01855 shiny object probabilities
The wishing code uses 'oc_prob + 1' so that probability 0 (never
random) objects are eligible to be selected if their name matches
a wish; collecting 'shiny' objects shouldn't do that.  (No effect
on play since there aren't any shiny objects with 0% random chance.)

rn2() takes int, and total oc_prob for entire objects[] array is
15000, so don't accumulate the target probability in a long.
2018-09-22 14:57:55 -07:00
nhmall
bbb81700f5 sunsword vs gremlin
The original report complained that gremlins seemed impervious to
Sunsword's light yet a flash from a camera caused them to cry out in pain
despite "The long sword named Sunsword begins to shine brilliantly!"

This commit does two things:
1. A dmg bonus is applied against gremlins using a lit Sunsword.
2. Gremlins will generally avoid the light emitted by Sunsword.
There's a few minor flavor bits thrown in also.

It is understood that this effectively makes Sunsword provide
"gremlin-proofing", but the gremlin myth and Sunsword's characteristic
feature pretty much demand it.

bug 42
2018-09-22 14:08:28 -04:00
nhmall
faf1a83fd0 follow-up bit 2018-09-22 09:24:20 -04:00
nhmall
fe68925100 another BL_CHARACTERISTICS fix
With the code as it stood, receipt of BL_CHARACTERISTICS would
trigger a flush of output which may not have been the
intention.

Ensure the flush code is only on BL_FLUSH (or BL_RESET).
2018-09-22 09:11:51 -04:00
nhmall
0aa9e00099 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-09-22 09:01:37 -04:00
nhmall
0a52543076 avoid illegal array indexes now that the enum treads beyond BL_FLUSH 2018-09-22 08:58:38 -04:00
Pasi Kallinen
39d10d96df Prevent leash showing unseen monster as "it" 2018-09-22 15:55:26 +03:00
nhmall
8e4ce066c9 fix C343-331 mirrors & sleeping mon
This outstanding bug was complicated slightly because the same
code was used for a sleeping mon as for a paralyzed mon so
message phrasing was called into question.

Just flip the phrasing to be about what you are able to discern
under those circumstances, which is very little, and don't have
the sleeping or paralyzed monster react to the mirror.
2018-09-21 23:34:00 -04:00
nhmall
25fcaa614c another orctown follow-up tuning bit 2018-09-21 11:54:43 -04:00
nhmall
a18ae517f8 some orctown follow-up bits, fix Bad fruit #0 and some minor tuning 2018-09-21 11:31:01 -04:00
PatR
dbf3816cc4 do_name.c cleanup
Some formatting and several things that warrant being 'static'.
2018-09-20 16:16:58 -07:00
PatR
49e4330cb2 special levels 'grow selection'
Fixes #132

This is based on the commit for github pull request #132, which
indicates that the 'grow' pattern is reversed from what the .des
file specifies.  I don't understand how this is really supposed
to work and the only place nethack uses it is on the Valkyrie Home
level, which seems to be created roughly the same both before and
after this change.
2018-09-20 15:19:50 -07:00
nhmall
672e28d294 Merge branch 'fix-grammar-and-punctuation' of https://github.com/mogigoma/NetHack into mogigoma-fix-grammar-and-punctuation 2018-09-20 18:01:32 -04:00
nhmall
9c6fe0b377 initialize a supplement buffer 2018-09-20 17:58:10 -04:00
PatR
4abaccfc34 missile launching traps
Factor some common code for missile launching traps into a seprate
routine.

Reorder the prototypes for static routines in trap.c into the same
order as theose functions appear in the file.
2018-09-20 14:18:30 -07:00