Commit Graph

4853 Commits

Author SHA1 Message Date
nhmall
90425082ca counting to 10 2023-01-27 17:01:17 -05:00
nhmall
afb4d90989 typo fix 2023-01-27 16:58:45 -05:00
nhmall
f57f31335c document doc/sound.txt 2023-01-27 16:48:37 -05:00
nhmall
446044e1d5 1st of a few sequencing changes
rename display_gamewindows() to init_sound_and_display_gamewindows()
(I know that's getting pretty long-named).

move activate_chosen_soundlib() into init_sound_and_display_gamewindows()
from moveloop_preamble().

Also included was a missing break in a switch related to sounds.
2023-01-26 17:15:59 -05:00
Pasi Kallinen
f61e1e8e23 Tiny chance of breaking iron bars with war hammer
Also add some different sounds to hitting the iron bars,
and make it noisy.
2023-01-26 18:21:53 +02:00
Pasi Kallinen
d19c92281a Give gremlin the property it stole, if possible 2023-01-25 21:55:11 +02:00
Pasi Kallinen
ed7e344f00 Giants occasionally have a weapon 2023-01-24 20:54:39 +02:00
Pasi Kallinen
fd25cb177f Lua doc bits 2023-01-24 09:37:32 +02:00
Pasi Kallinen
1d8c944c5a Eating garlic makes some monsters flee 2023-01-24 06:17:17 +02:00
PatR
c5aad9fe56 reimplement pull request #944 - grave contents
Pull request from entrez:  if bones left dead hero's corpse on top
of a new grave, don't find a corpse or summon a zombie when digging
the grave up.  It also removed the chance that a ghoul might be
summoned when engraving on a headstone, switching to zombie or mummy
instead.

Rather than adopting the pull request, this retains summoning a
ghoul via engraving and adds the possibly of doing so when kicking
a headstone.  Having a ghoul prowl around the grave is independent
of whether there is a corpse or zombie inside the grave.  To achieve
this, another flag in 'struct rm' is needed; the single bit for
'disturbed' isn't sufficient.  The bigger 'flags' field wasn't in
use for graves so commandeer that for new 'emptygrave'.  'disturbed'
still uses the 'horizontal' bit in order to have engraving and/or
kicking summon at most one ghoul.

Closes #944
2023-01-23 11:38:15 -08:00
Pasi Kallinen
83eaa85dd8 Fix ancient subroom location bug
Randomly placed subrooms were never generated touching
the right or bottom walls of the parent room.

This bug has been present since at least 3.1.0
2023-01-23 19:50:37 +02:00
Pasi Kallinen
a99c473762 Intelligent peacefuls avoid digging shop or temple walls 2023-01-22 13:28:24 +02:00
Pasi Kallinen
8ec84ea7ff Higher chance of demon gating in Gehennom 2023-01-22 13:03:10 +02:00
Pasi Kallinen
677b32c2a7 Hit and wake sleeping monster makes it growl
Unless you kill the monster with one hit, it'll wake up
cranky and make noise - waking up other sleeping monsters.

This was a bit tricky with all the message sequencing; I tested
all the hit/throw/fire/zap combos I could think of, and it took
a while to get things looking right.
2023-01-21 16:52:23 +02:00
Pasi Kallinen
b1fd7344e3 Poly into fire elemental, eat flammable items 2023-01-20 18:56:01 +02:00
Pasi Kallinen
e260aa5877 Digging is noisy 2023-01-19 19:55:47 +02:00
PatR
8952ea9bb5 add Japanese item names to discoveries list
When playing as a Samurai, add things like "osaku" to the discoveries
list even though they don't have separate descriptions to be used
when not yet discovered.  Non-magic ones are pre-discovered and
players can now use the '\' command to figure out what things like
"tanko" mean without resorting to '/?'.

"wooden harp" has been getting changed to "koto (harp)"; make that be
| koto [wooden harp] (koto)
"magic harp" has been staying as "magic harp (harp)"; add it to the
list of Japanese item names.  Since it's magic it isn't pre-discovered.
Once discovered it becomes
| magic koto [magic harp] (koto)

Those two needed special case handling, none of the other items did
aside from forcing them to be discoverable when lacking descriptions.
The discoveries list now has things like
| wakizashi [short sword]
| naginata [glaive] (single-edged polearm)
| gunyoki [food ration]
if--and only if--the hero is a Samurai.
2023-01-18 22:00:57 -08:00
Pasi Kallinen
bb8c144809 Level temperature
Allow setting a per-level "temperature": hot, cold, or temperate
via special level flags. Currently it only affects some messages
in Gehennom, but it could be expanded to ice melting, water freezing,
or monster generation, for example.

Invalidates saves and bones.
2023-01-17 20:11:45 +02:00
Pasi Kallinen
b5fe7415cf fixes entry 2023-01-16 10:45:23 +02:00
PatR
68d8b5376a generic object fix
When hallucinating, random object selection for objects was including
the new generic objects.  It was already excluding 'strange object'
by using 'rn2(NUM_OBJECTS - 1) + 1' to skip objects[0]; changing that
to be 'rn2(NUM_OBJECTS - MAXOCLASSES) + MAXOCLASSES' will skip the
first 18 objects, 'strange object' plus the 17 generic objects.

(I'm trying to convince myself that there's no off-by-1 or off-by-N
error and think I've succeeded.)
2023-01-15 11:04:35 -08:00
Pasi Kallinen
6abb12aee0 Lua: Persistent variables
Add a way for the lua scripts to set and retrieve variables
that are persistent - saved and restored with the game.

Invalidates saves.
2023-01-15 10:34:45 +02:00
Pasi Kallinen
9bf6d837ad More Gehennom filler level variance 2023-01-12 12:37:08 +02:00
PatR
85c908cb03 displaying generic objects
Add 17 fake objects to objects[], one for each object class.  All
specific color as gray.  They're grouped at the start--actually near
the start since "strange object" is still objects[0]--rather than
being among the objects for each class.  init_object() knows to start
at [MAXOCLASSES] instead of [0]; other code that loops through every
object might need adjusting.

For potions, non-stone gems, and non-novel/non-Book_of_the_Dead
spellbooks that don't have obj->dknown set, display the corresponding
generic object rather the object itself.  Fixes the longstanding bug
of seeing color for not-yet-seen objects whose primary distinguishing
characteristic is their color.  Walking next to a generic object
while able to see its spot will set dknown and redraw as specific.
It's slightly disconcerting to have objects change as you reach them;
I hope it's just a matter of becoming used to that.  (If there is any
code still changing the hero's location manually instead of using
u_on_newpos(), it should be changed to use that routine.)

Most of the new tiles are just a big rendering of punctuation
characters.  The potion, gem, and spellbook ones could be cloned from
a specific object in their class and then have the color removed.  I
started out that way but wasn't happy with the result.  I'm not
artisticly inclined; hopefully someone else will do better.  Each of
them is preceded by a comment beginning with "#_"; the underscore
isn't required, just being used to make the comments stand out a bit.

Invalidates existing save and bones files.
2023-01-10 14:33:21 -08:00
Pasi Kallinen
4af086be73 More interesting Gehennom levels
Instead of just plain old boring mazes, spice up Gehennom by
occasionally adding lava, iron bars, or even mines-style levels
(with lava, of course).

Of the fixed Gehennom levels, only Asmodeus' lair has been changed
to add some random lava pools.

Also some lua fixes and changes:
- Fixed a selection negation bounding box being wrong.
- Fixed a selection negated and ORed returning wrong results.
- des.map now returns a selection of the map grids it touched.
- When using des.map contents-function the commands following the
  map are not relative to it.
2023-01-10 12:20:21 +02:00
PatR
7c72c1f141 identifying via menu
From the newsgroup:  identifying by menu pops up multiple menus in
succession if the player picks fewer invent entries than are being
granted, but the second and subsequent ones could cover up the
message window and hide the feedback from prior ones.

If multiple popup menus are needed when identifying, issue --More--
before each menu after the first.  The code seemed to be trying to
do this already, but it should have used wait_synch() rather than
mark_synch(), or perhaps used display_nhwindow(WIN_MESSAGE, TRUE)
instead of either one of those.  For curses, both mark_synch() and
wait_synch() were no-ops.  Now they do something.  X11's behavior
wasn't right either; it seemed to be lagging one message behind
(something I had noticed recently and then forgotten about; I still
don't remember the context then so don't know whether this fixes
that earlier situation).
2023-01-09 23:34:32 -08:00
Pasi Kallinen
030fc0036a Remove NO_VSNPRINTF
Affects only ancient VMS where vsnprintf wasn't available.
2023-01-06 15:53:06 +02:00
nhmall
8755b3bb53 Guidebook update 2023-01-01 20:23:15 -05:00
PatR
b3b7e8c19c fixes entry for pull request #920 - paralyzed hero
Pull request from entrez:  hero needs to be able to move in order to
help a nymph or succubus or incubus to remove worn armor.

Closes #920
2022-12-31 11:28:13 -08:00
PatR
11b72eb18b Guidebook typo
Fix misspelling of recently added "sortvanquished" option.
Copy+paste propagated it to from Guidebook.mn to Guidebook.tex.
2022-12-28 11:37:14 -08:00
nhmall
57dc8891d6 Guidebook datestamp 2022-12-27 21:03:41 -05:00
PatR
fcf2685cc3 'sortvanquished' option in Guidebook.tex
Not tested, but I tried to be more careful than last time....
2022-12-27 14:15:49 -08:00
PatR
249e431e46 new 'sortvanquished' option
Allow the preferred sort order for the vanquished monsters list to
be specified in the run-time config file
|OPTIONS=sortvanquished:X
where X is t, d, a, c, n, or z.  It can also be set to 'A' or 'C'
but those aren't documented and aren't offered as choices when
setting the value interactively, which can be done via 'm O' or by
using 'm #vanquished'.

Guidebook.mn has been updated but Guidebook.tex is lagging again.
2022-12-26 14:56:12 -08:00
nhmall
a4c9073a7c Guidebook datestamp; updated Guidebook.txt 2022-12-25 10:12:47 -05:00
nhmall
ca716c831b make some corrections to Guidebook.tex 2022-12-25 10:09:43 -05:00
PatR
4436d1eb4a doc update: 'role' changes for Guidebook.tex
Catch the LaTex Guidebook up with the nroff one for the role, race,
gender, and alignment options.

For both formats, comment out the decription of 'altmeta' on Amiga.
2022-12-24 14:29:58 -08:00
PatR
657f0de5f8 sequencing issue: dismounting from dying steed
Reported by entrez:   if a trap killed hero's steed and dismounting
was fatal for the hero (probably by falling onto the same trap),
impossible "dmonsfree: 1 removed doesn't match 0 pending" warning
occurred during game-over cleanup.

Move the dismount calls in mondead() and mongone() from before their
m_detach() call to the end of m_detach() itself.  This led to a
cascade of problems and attempted fixes until finally zeroing in on
place_monster()'s sanity checks and dismount_steed()'s attempts to
work-around one of them.

This reverts the convoluted hack from four years ago in commit
be327d9822 and deals with the issue in
a simpler way.  After that, the new dismount_steed() placement at
end of m_detach() works cleanly.
2022-12-21 14:02:05 -08:00
Michael Meyer
96343924ae Guidebook: formatting for '#repeat' heading
Minuscule change.  #repeat was not monospaced like the other extended
commands.
2022-12-20 23:38:33 -08:00
PatR
53a4e3f80a unconscious hero vs Medusa
Reported directly to devteam by entrez:  a sleeping or unconscious
hero would still meet a monster's gaze attack even though those are
supposed to be eye-to-eye rather than just the monster looking at
you.  Don't meet the gaze when Unaware, despite the fact that the
hero isn't blind and vision remains in operation.

Initially being Unaware also blocked Medusa's gaze being reflected
but I changed things so that that still affects her.  It contradicts
the eye-to-eye aspect but is more consistent with her looking at a
blind hero who has reflection.
2022-12-20 14:44:19 -08:00
Pasi Kallinen
32bbf84ee1 Add strangled to safe_wait
... and ignore vomiting from sickness.
2022-12-18 12:36:34 +02:00
Pasi Kallinen
d7e90fbae2 Expand safe_wait to deadly status afflictions
Searching or waiting with safe_wait on will now consider
sliming, stoning, or deadly illness to be hazardous and prevent
the command.
2022-12-18 00:40:38 +02:00
PatR
dfa5bb5941 role,race,&c options: environment vs config file
Due to the unorthodox values for role, race, gender, and alignment,
specifying a negated value or set of values in NETHACKOPTIONS wasn't
overriding a specific value set in the run-time config file.  The
command line should take priority, then environment, then config file,
lastly builtin defaults.

This could probably use some improvement.  It now treats role:!val
as if there was no val role and the entry was role:random rather than
previous role:none (affects prompting).

[I've just realized that role:!foo in environment will be combined
with role:!bar in config file rather than replacing it.  I'm not sure
how to deal with that.]
2022-12-15 15:56:52 -08:00
PatR
df7e575500 fix issue #949 - dropping welded iron ball
If punished and the attached iron ball was both cursed and wielded,
falling while going down stairs would drop it instead of leaving it
welded to hero's hand. ( Didn't happen for iron ball that wasn't
chained to hero's leg.)

I thought that this was going to be a one or two line fix but ball
and chain stuff is never that simple.

Fixes #949
2022-12-15 13:48:59 -08:00
PatR
96f5f03287 revise the role, race, gender, align options
Using role:!wizard to limit which roles would be candidates for
random selection didn't work as I expected.  It required a separate
option setting for role to exclude.  This implements how I thought
it worked:
|OPTIONS=role:!ranger !samurai !wizard
will exclude multiple roles with a space-separated list in a single
option setting.  It also adds support for
|OPTIONS=!role:ranger samurai wizard
to do the same thing.  (OPTIONS=!role:!ranger isn't allowed.)

I thought 'OPTIONS=role:barbarian caveman knight' could be used to
limit random selection to those choices, but that doesn't work and
I haven't attempted to implement it.

This also renames the 'align' option to 'alignment'.  That made the
truncation to 'align' become ambiguous, so it got added back as an
alias for the full name.

Guidebook.tex is lagging; I'm burned out.
2022-12-14 13:14:54 -08:00
PatR
7096c68492 more interactive role selection
This ended up combining several unrelated changes.

Add missing 'fixes' entry for curses-specific item in New Features.

When answering "Shall I pick ... for you? [ynaq]", accept \m as well
as \n and space for choosing the default of 'y', same as normal
ynaq() would.  Also add '*' to '@' as not-shown potential answers;
they force 'random'.

When tty tore down any of the menus, things were reasonable if they
were short enough for corner windows, but tall ones that switch to
full screen weren't fully erased.  The parts of those outside of the
map window stayed behind when the tall menu was closed and cleared.
Mainly affects picking the "~ - reset filtering" choice but also
affected the role menu on 24 line tty screens.  (Didn't affect curses
because it tracks and refreshes its base window when some overlaying
window goes away.)

The role menu used 25 lines so required a second page for the case
of a 24 line screen on tty.  Dealing with that is a bit ugly but it
wasn't an issue when this form of role selection was tty-only (because
the info about choices made so far was displayed on the base window
rather than in an extra menu line back then) so I added a hack for it.
If the role menu will take one more line than the screen height, the
separator between 'random' (below 'Wizard') and 'pick race first' gets
squeezed out.  If the menu needs two more lines (doesn't happen now,
except by changing screen size to 23 lines for testing), a second line
gets squeezed out.  (Not attempted for curses because it wouldn't
help.  'windowborders' and one or two extra separators it adds make
menus taller.  I doubt if many players use curses on 24-line screens
but if they do, they'll be using something new rather than going from
something that used to fit on one page with 3.6.x.)
2022-12-13 15:59:05 -08:00
nhmall
092068495b fixes update 2022-12-11 21:55:15 -05:00
nhmall
4c32ca571a doc update 2022-12-08 10:46:36 -05:00
PatR
bf5a089389 revise man page yet again
Rewrite much of the paragraph about the run-time config file.

Remove mention of '-p @' since it doesn't actually work.

Expand 'nethack -s' a bit.

Revise --showpaths.

Shuffle --scores, --version, --showpaths, and --usage into the same
order as usage feedback lists them, primarily scores first and usage
last.
2022-12-07 12:22:49 -08:00
PatR
e724034995 unpaid sanity_check: leaving shop via recoil
Throwing while levitating or getting hit for knockback effect could
move hero carrying unpaid items out of a shop.  If that happened,
sanity_check complained that unpaid items weren't in a tended shop.

Check for entering and leaving special rooms during recoil same as
gets done for ordinary movement.  Leaving a shop via recoil or
knockback while owing a bill now gets treated as robbery immediately
rather than waiting until hero voluntarily moves to another spot
after recoil has finished.
2022-12-06 10:57:14 -08:00
PatR
be9e1f31af man page and usage: -D
Mention the changed character name that happens when running in wizard
mode.
2022-12-04 00:17:50 -08:00
PatR
7e33da788c another manpage update
Split some lines that began with one sentence and then continued with
another so that each sentence has its own line as per 'roff guidelines.

Change the continuation lines in the files and environment sections
to begin with <backslash><space><tab> instead of just <tab>, again to
meet the guidelines (don't begin lines with whitespace).  This had a
side-effect of suppressing some space insertion for justifying right
margin of right-hand column on some of the lines.  That hadn't looked
very good anyway.

Add new file 'usagehlp' to the files section.

Also add previously unmentioned Guidebook[.txt], but it's hard to
explain why it probably won't be present....

Update the bones file entry.

'cmdhelp' isn't used anymore.  Should it be moved to outdated/dat and
the Makefile install steps be updated to stop bothering with it?
2022-11-30 16:32:43 -08:00