Commit Graph

14656 Commits

Author SHA1 Message Date
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
keni
3f3c581f65 make the 2 panic declarations fully match 2023-01-10 16:55:35 -05:00
keni
d1561f15c1 alloc.c: add missing NORETURN 2023-01-10 15:55:30 -05: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
PatR
1755d27bf8 allow full-line comments in tiles source files
Accept
<start of line><optional whitespace>#<anything>
as a comment in win/share/{monsters,objects,other}.txt.  Existing
<start of line><optional whitespace># tile <rest of line>
is grandfathered in as data.

It wouldn't take much more to accept
<data><optional whitespace>#<rest of line>
comments too but this hasn't gone that far.

Reading the colormap at the beginning of each of the three files
used "%[A-Za-z0-i]" to read one characer into a two-character array.
Change that to "%1[A-Za-z0-9]" so that it can't overflow the buffer
if the input data gets accidentally or maliciously mangled.  (Not a
security issue.)

Remove a spurious blank line from objects.txt.

Also, clean up some warnings when compiling gifread.c for gif2txt
although I ultimately didn't do anything with that.
2023-01-08 01:33:18 -08:00
PatR
f0f639f1fa fix for onefile FITSint, FITSuint
I assumed that the complaint about macro refinition was for the two
in alloc.c replacing two from hack.h from another file, but it could
be that those being defined by alloc.c were interferring with the
regular hack.h ones.  alloc.c doesn't need them, and was also skipping
an opportunity to use one of them.
2023-01-07 12:48:10 -08:00
Pasi Kallinen
48ae4f6d30 Another valgrind uninitialized bytes complaint 2023-01-07 17:28:14 +02:00
Pasi Kallinen
8eb3b3d8d1 Silence valgrind uninitialized bytes complaints
Just zero out the allocated memory.

Explicitly setting struct field values isn't enough, because field alignment
means there can be several unused bytes which are written to savefile.
2023-01-07 13:25:07 +02:00
Pasi Kallinen
c68b21d735 Fix lua selection logical-or bounds 2023-01-07 10:55:09 +02:00
Pasi Kallinen
27e2c79e12 Free command queues at end of game
At end of game, the disclose prompts put commands into the queue,
but those weren't freed.
2023-01-06 16:40:58 +02:00
Pasi Kallinen
030fc0036a Remove NO_VSNPRINTF
Affects only ancient VMS where vsnprintf wasn't available.
2023-01-06 15:53:06 +02:00
PatR
18fa85c681 show_glyph() impossible
After glyph expansion a while back, a few 'if's had tests of
|  else if ((offset = (foo - bar)))
which should be
|  else if ((offset = (foo - bar)) >= 0)
Only used if show_glyph() has been passed invalid map coordinates
so never seen.
2023-01-02 23:40:06 -08:00
PatR
c91f142bdb score feedback punctuation
"Killed by Ms. Manlobbi, the shopkeeper" has the comma changed to
a semi-colon prior to being stored in 'record'.  That's intentional,
but "Killed by Ms. Manlobbi; the shopkeeper" looks strange when shown
to the player.  Change semi-colon back to comma when writing scores
for display.
2023-01-02 23:25:38 -08:00
PatR
d20f670710 striking/force-bolt comment
I'm not sure whether newsym_force() is still necessary, but add a
comment about why it's being used in bhito().
2023-01-02 14:25:23 -08:00
nhmall
33c13d6fff static analyzer bit display.c
A static analyzer pointed out that the 'if' was checking
for null pointer, but the 'else' was not, yet they were
both then dereferencing the same variable.
2023-01-02 16:06:11 -05:00
PatR
dc6ad9266b nethack --windowtype=badchoice
If you used the commandline to ask for an interface that doesn't exist
or isn't available, you'd get complaints about it not being recognized
twice.  First before any other options, then again after regular
option processing has taken place.  Clear the command line setting if
the first attempt gets rejected so that it won't be retried later and
be rejected again.  Probably the game should just quit if setting the
interface fails.
2023-01-01 17:35:06 -08:00
nhmall
8755b3bb53 Guidebook update 2023-01-01 20:23:15 -05:00
nhmall
ff814326aa update for tilemap.c generated tile.c code 2023-01-01 20:05:59 -05:00
nhmall
095e4ffe31 add some curses support for coloring of map frame 2023-01-01 20:05:03 -05:00
nhmall
32a030c8c6 introduce X11 support for coloring map frame 2023-01-01 20:04:27 -05:00
nhmall
0a03ca1e99 introduce Qt support for color of map frame 2023-01-01 20:03:30 -05:00
nhmall
2fc0d25d45 introduce support for coloring the frame behind a map location
Also includes support by paxed for polearm targeting using the
frame color.

Also renames USE_TILES to TILES_IN_GLYPHMAP which is a more
accurate description.

Not all window interfaces have full support for the color framing
of the background square yet.

MS-DOS needs further work (to bring it to both VESA and VGA, with
and without tiles.

Windows GUI is missing support.

X11 and Qt have been started, but may require further refinement.
2023-01-01 19:55:02 -05:00
nhmall
1972c8447f update year in copyright 2023-01-01 17:31:34 -05:00
PatR
21b9506d3f comment fix in display.c
A comment in front of unmap_object() was missing the end of a
sentence in the middle of a short paragraph.  That has been the case
as far back as 3.3.0.  I found the sentence's full text in 3.2.0
(without checking 3.2.[123]).  The rest of the paragraph got changed,
presumably at the same time as the missing part got lost.

While in there, change "any more" to "anymore".  According to a
dictionary, the one-word form is the more commonly usage.
2023-01-01 00:21:51 -08:00
PatR
e1a2432233 fix tilemap - no panic()
tilemap isn't linked with util/panic.o so doesn't have access to
panic().  Despite that, linking on OSX found panic() somewhere.
(It doesn't do format argument substitution, just prints out the
argument we pass as format string, then aborts.)

Instead of calling panic(), print a message to stderr, delete the
incomplete tile.c whose construction has failed, and exit with
failure status.  Linking with panic.o wouldn't handle the message
and final failure but not help with the incomplete output file part,
so this hasn't done that.
2022-12-31 13:35:17 -08:00
PatR
765c853a5a pull request #942 - shopkeeper chat changes
Pull request from entrez:  change some pline() messages to verbalize()
and re-enable some chat feedback given when a shopkeeper is poly'd
into some form that can't speak.

Closes #942
2022-12-31 12:42:52 -08:00
Michael Meyer
ee270bfbe0 Use verbalize for shopkeeper price-check #chatting
The shopkeeper is speaking out loud, so use verbalize for consistency
with other types of speech.

I couldn't figure out a way to wrap the multiline version in quotes in a
way that actually worked and looked good, so I restricted this to the
pline responses.
2022-12-31 12:22:13 -08:00
Michael Meyer
f38a40fafd Tweaks to chatting with mute shopkeeper
A mute shopkeeper shouldn't be able to verbally tell you the prices of
objects.  For normal chatting, on the other hand, shk_chat can handle a
mute shopkeeper (by changing from speech to "indications" -- hand signs,
body language, etc), so allow execution to reach that even if the
shopkeeper is mute (in a silent polyform).

Also more generally allow a shopkeeper to continue chatting with normal
shopkeeper responses if polymorphed into another creature, since they
apparently retain their minds (are able to tell you prices, can
transact, etc).

This is mostly inspired by the fact shk_chat has extensive handling for
mute shopkeepers, but it was unreachable as far as I can tell.  It is
also funny to think of a newt or something wriggling around to indicate
it's been making a lot of money lately.
2022-12-31 12:22:13 -08:00
PatR
459b185a98 pull request #939 - revise #wizsmell command
Pull request from entrez:  add a funny message if player targets hero
with #wizsmell command.

I've modified it to put a "remembered, unseen monster" symbol on the
map if sniffing a non-monster location reports a monster's smell and
to remove that symbol if sniffing it reports "no monster there".

Closes #939
2022-12-31 12:13:41 -08:00
PatR
dcd3fe8437 smelling an unseen monster puts 'I' on map 2022-12-31 12:11:28 -08:00
Michael Meyer
be810f3ede Remove canspotmon() requirement from #wizsmell
You can attempt to smell a monster at particular coordinates even if you
can't see it.  Revert the message for the 'can't find a monster there to
smell' case to "That is not a monster", as it was before, since the
change makes it so that you only reach that line if there genuinely is
no monster there (previously it would be reached if there was a hidden
or undetected monster on the specified spot).
2022-12-31 11:37:06 -08:00
Michael Meyer
8c831fcad0 Add a funny message for smelling yourself
I know this is inane, especially for a little-used debug-mode-only
command, but I can't get it out of my head...

The use of the actual monster data instead of the glyph as a proxy ought
to make it somewhat more consistent as well (e.g. hallucination and
'showrace' won't affect the results), though I think that'd hardly be
worth it were it not for the incredibly funny message.
2022-12-31 11:37:06 -08: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
Michael Meyer
15274fcca1 Make paralysis intefere with seduction attempts
tinklebear on IRC noticed that a hero paralyzed by a floating eye was
still "charmed" and capable of "removing her armor" as part of a nymph's
theft attack.  The same thing was true of foocubus seduction: a
paralyzed hero was still able to respond to the questions about whether
particular pieces of armor should be removed (and also do whatever else
may be involved in a successful attack...).

I think paralysis should prevent both those things.  Nymph theft will
still work, unless she needs the hero's active cooperation in removing a
bulky piece of armor.  Foocubus attacks will be prevented entirely by
paralysis, making it interfere like unconsciousness already does.

Apply a similar constraint to hero vs monster seduction, as well.
2022-12-31 11:25:53 -08:00
PatR
8397b15d83 some tilemap.c cleanup
I'm headed back to the drawing board for some tiles changes I was
attempting, but before tossing what I had I've extracted a modest
amount of cleanup for the code in win/share/tilemap.c.  Some
formatting, a bit of generated formatting, make ENHANCED_SYMBOLS
less intrusive, and an error check to prevent a crash in tilemap
I triggered.  Also avoid one in nethack caused by an object (not
included here) which had a description but no name.
2022-12-30 12:45:02 -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
PatR
077fdcfaac followup for miscellaneous objects[] macros
The DUMP_ENUMS definition of 'MARKER()' had the expansion of its
arguments backwards but isn't even needed, so get rid of it rather
than reverse them.  nethack --dumpenums handles them separately
from object definitions.
2022-12-28 11:33:39 -08:00
PatR
ddd358aa03 miscellaneous objects[] macros
Replace FIRST_GEM and LAST_GEM with FIRST_REAL_GEM, LAST_REAL_GEM,
FIRST_GLASS_GEM, and LAST_GLASS_GEM and define those along with
objects[] rather than separately.  Do the latter for FIRST_AMULET
and LAST_AMULET too.  Also new FIRST_SPELL and LAST_SPELL used to
compute MAXSPELLS.  (That value looks wrong to me, but this defines
it with the same value as before.  If it gets fixed, EDITLEVEL will
need to be incremented.)

This started as just proof of concept that extra information could
be collected as objects[] gets initialized at compile time.
2022-12-28 01:50:24 -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
PatR
a294fdf179 boomerang bits
Refine the recent throw-and-return catching routine.
2022-12-25 13:28:02 -08:00
PatR
c380234325 {freez,flam,shock}ing spheres difficulty ratings
Adjust mstrength() so it generates difficulty assessments matching
the mons[].difficulty values for freezing spheres, flaming spheres,
and shocking spheres.  #wizmodiff now reports "no discrepancies".
2022-12-25 13:21:56 -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
9a9f2d596d fix boomerang equiped in multiple slots
Reported directly to devteam:  with one quivered boomerang and a
compatable stack of one or more boomerangs either wielded or in the
alternate weapon slot, throwing the quivered one, failing to hit any
target or obstacle, and catching the returning boomerang would empty
the quiver, merge the caught boomerang with the wielded weapon or
swap-weapon slot, then re-quiver and yield
|x - 2 boomerangs (wielded) (at the ready)
or
|y - 2 boomerangs (alternate weapon; not wielded) (at the ready)
If 'sanity_check' was On, complaints would ensue.

'autoquiver' may need to be On in addition to the thrown boomerang
being the last item in the quiver.

The unsplit portion of the fix feels unclean.  There's bound to be a
better way.
2022-12-24 00:27:59 -08:00
PatR
9657b78359 dismount tidbit
I just noticed a couple of direction manipulaton macros that I hadn't
been aware of.  Change recenlty added DISMOUNT_KNOCKED to use them.
2022-12-23 15:42:08 -08:00