Commit Graph

16928 Commits

Author SHA1 Message Date
PatR
4217eee07b wizard mode #migratemons fixes
Noticed while doing rudimentary testing of the mnearto() fix for
mimics.  #migratemons wouldn't add monsters to migrating_mons if
getlin() was compiled with EDIT_GETLIN defined unless you manually
deleted the invisible default value that wiz_migrate_mons() was
passing.  It took a while to puzzle that one out.

The command list has conditional description of what #migratemons
does and it was using the wrong spelling of the macro used to
control that.  So '# ?' described the behavior of #migratemons as
it operates without DEBUG_MIGRATING_MONS enabled even when that is
enabled, adding to the getlin() confusion.
2024-05-24 16:23:15 -07:00
PatR
3a49b4c463 fix #K4179 - failed sanity check for mimic
When mnearto() places a monster, it might remove another one to make
room, then try to put that second one back.  If it can't do that, it
puts that other monster onto the migrating monsters list.  But having
it already be off the map interferred with regular take-mon-off-map
handling that happens when setting up a migration.

If the other monster was a hider or concealed mimic, it wouldn't be
brought out of hiding.  With 'sanity_check' enabled, that triggers
a warning when the occupants of migrating_mons get checked.

Testing this requires more effort than I'm willing to expend so there
might be unexpected consequences.
2024-05-24 16:21:10 -07:00
PatR
c623ddf2e2 fix github issue #1246 - fading spellbook
Issue reported by chadministratorwastaken:  persistent inventory
window didn't update if reading a spellbook caused that book to fade
to blank paper.

Issue was reported for 'curses' but it was general.  The core made
the possibly-revised book type become discovered but that wouldn't
update perm_invent unless the type of book hadn't been discovered.
So if plain spellbook wasn't known yet, the persistent inventory
window did update as intended, but if spellbook of blank paper was
already discovered, the window continued to show the old book type
instead of changing to reflect the revised type (until subsequent
activity triggered another perm_invent update).

Fixes #1246
2024-05-22 22:22:59 -07:00
PatR
f634bb863f refine context-sensitive inventory action 'w'
|w - wield this item in your hands
is "suboptimal" when poly'd into some form which lacks hands.  Don't
offer 'w' as a choice if in a form what can't wield anything, and
substitute "claws" for "hands" when in forms that warrant it.

Include iron ball as a type of item leading to 'w - wield as weapon'
instead of falling through to 'w - wield in hands'.
2024-05-21 14:27:49 -07:00
PatR
a1692a8061 update context-sensitve inventory actions
Since inventory actions can be used as teaching aids for regular
command usage, change picking a potion in inventory from
|q - Quaff this potion
to
|q - Quaff (drink) this potion

When picking the uquiver item in inventory, add
|f - {Shoot|Throw} this item
and for the shoot case, tack on "with wielded <launcher>".

That makes 't - {Shoot|Throw} this item' nearly redundant (but only
for an item in uquiver slot) so tack on "(same as 'f')".

For the 'Q' choice (only offered for weapons or rocks/gems), have it
mention what the quiver is for rather than just that choosing that
menu entry would put the stack in the quiver slot.

For 'E - Write on the floor with this object', change the verb to
"Engrave" when the object is a bladed weapon, hard gem, hard gem
ring, or wand.  It also changes 'floor' to surface() which might
need some refinement.

For non-weapons, change 'w - Hold this tin opener...' and 'w - Hold
this item in your hands' to 'w - Wield this...'.  The concept of
holding an item in hero's hands isn't applicable in general, and in
particular any "held" item replaces wielded weapon.

For a bunch of instances of "this item", when the quantity of the
selected inventory entry is more than 1, change to "one of these
items" or "this stack" depending on how the specified action deals
with stacks.
2024-05-21 11:28:12 -07:00
Pasi Kallinen
38a5dac08c Tutorial: add farlooking 2024-05-20 17:51:56 +03:00
PatR
d0bc457279 Perseus's statue location on medusa-3 and medusa-4
Coming up to medusa-3 from the level below revealed that Perseus's
statue was not there.  It was placed randomly in one of the three
chambers where Medusa might be rather than in the one where she
actually was.  Medusa-4 behaved similarly.

Initially I was forcing the statue to be adjacent to Medusa rather
than on her spot, but medusa-1 and medusa-2 don't do that so I've
gone with a simplified revision.
2024-05-19 14:44:10 -07:00
PatR
1f86001e27 chain lightning vs sleeping monster
Wake up a sleeping target that gets hit by chain lightning.  Also,
bring mimics and hiders out of hiding.

Don't let chain lightning pass into the water on Plane of Water (or
water-wall elsewhere); not sure whether that makes sense physics-wise
but it would have feedback problems due to visibility issues.  Do let
it pass over lava.
2024-05-17 16:10:22 -07:00
PatR
d5546d3384 revise curses_raw_print()
For curses, behave like tty by keeping a count of messages issued via
raw_print, then if that is non-zero issue a prompt and require the
player to acknowledge them before it erases the screen.  Mainly so
that complaints during RC file processing will be seen.

For tty, force getret() to be an unconditional routine instead of
sometimes a routine, sometimes a macro which calls another routine.
2024-05-17 14:38:17 -07:00
PatR
80fb8c77d3 shop annotation refinement
Give alternate shop type names for most of the shop types that didn't
already have such.  "General store" is the last remaining exception.
Only matters for automatically generated annotations for #overview.
2024-05-17 12:47:01 -07:00
PatR
178d6b2abe makedefs.6 bit
Noticed in a recent update of doc/makedefs.txt, The man page for
makedefs an unwanted space in front of the comma in its description
of "makedefs -s".
2024-05-16 23:38:54 -07:00
PatR
6aa42750ad Sunsword vs <u.ux,u.uy>
Using #invoke on wielded or carried Sunsword and picking direction
'>' or '<' lights the hero's spot.  But setting levl[u.ux][u.uy].lit
was too simplistic.  Lighting on the Rogue Level operates on full
rooms when done inside a room and doesn't to anything with done in a
corridor.

litroom() gave inappropriate messages in a couple of special cases.
2024-05-16 13:26:46 -07:00
nhmall
26b12f83fe update tested versions of Visual Studio 2024-05-16 2024-05-16 12:27:56 -04:00
PatR
f881eb85b1 new Ixoth tile
Replace the recently revised tile for Ixoth (knight's quest nemesis)
for github issue #1239.  Contributed by veenkeralexschool.
2024-05-13 23:48:35 -07:00
nhmall
38d2294257 revert 184c9e3b and re-commit partial
Reason: The following concern was raised:
"The trademark indicators were not out of sync.  The Guidebook
uses footnotes for that, 'history' uses "(tm)" in the text which
works better when nethack displays the text."
2024-05-13 14:12:38 -04:00
nhmall
5e765679c8 Revert "Merge branch 'update-history' of https://github.com/argrath/NetHack into"
This reverts commit 184c9e3b92, reversing
changes made to 8e6f3ccc7d.
2024-05-13 14:09:01 -04:00
nhmall
86bb71ef76 merge pr #1213
@Umbire wrote:
Very simple change code-wise - if he's gonna use a yumi a hunter of his expertise should presumably have the projectiles match.

Closes #1213.
2024-05-13 12:58:02 -04:00
nhmall
184c9e3b92 Merge branch 'update-history' of https://github.com/argrath/NetHack into
NetHack-3.7

@argrath reported that some of the text had fallen out of sync.

Closes #1225.
2024-05-13 12:52:07 -04:00
nhw_cron
8e6f3ccc7d This is cron-daily v1-Apr-1-2024. 005manpages updated: makedefs.txt 2024-05-13 10:16:03 -04:00
nhmall
68169708dc follow-up
replace dependency that was removed but should not have been
2024-05-13 08:54:56 -04:00
nhmall
29bf3646e0 add makedefs options for producing individual files
This may be useful for some build environments to avoid parallel make
issues, and artificially-concocted order dependencies, leaving the ordering
up to that specified in the Makefile.

The related makedefs options are now:

       ‐s     Generate the bogusmon , engrave and epitaph files.

       ‐1     Generate the epitaph file.

       ‐2     Generate the engrave file.

       ‐3     Generate the bogusmon file.

Also resolves an existing issue encountered in doc/makedefs.6 where "and epitaphfiles"
was being produced in the result.
2024-05-13 08:45:11 -04:00
nhmall
97916007ef restrict font fallback to legacy Windows console
It was misbehaving with ENHANCED_SYMBOLS so restrict the font fallback
to the legacy Windows console for now.
2024-05-12 08:12:30 -04:00
nhmall
329ffae7df simple O menu requires clear screen for symset 2024-05-12 08:10:36 -04:00
nhmall
38e8e99565 Windows symbols copying
Avoid leaving outdated symbols file in place when there is a newer one.
2024-05-12 08:06:41 -04:00
Pasi Kallinen
016ff166c0 Slightly more variance to hellfill maze v5 2024-05-11 10:02:23 +03:00
PatR
ec016f9956 deferred obj deletion bit
I've no idea whether there are any cases where this matters.
2024-05-09 14:17:43 -07:00
PatR
9994f186ec magic map shops and temples
Have magic mapping add special rooms to known overview data.  Only
affects shops and temples because they're the only rooms tracked.

Most other special rooms revert to normal rooms as soon as they're
entered so there wasn't any point in tracking them.  That might no
longer be the case.

Wand of probing zapped at or through a shop door or even at a shop
wall will add the shop annotation to the overview data.  That works
differently for normal shops than for subrooms in the twin business
theme rooms.  I'm not sure whether any fixing is needed there since
the shop type information gets suppressed as soon as more than one
shop becomes known on a level.
2024-05-09 12:54:29 -07:00
PatR
71cfcc6229 simplify simplify #overview shop handling 2024-05-09 11:43:01 -07:00
PatR
4927b2cc1b simplify #overview shop handling
Add the shop type variations used for automatically generated
annotations to the shop structure and get rid of the switch that
has been being used to pick them.
2024-05-08 14:17:11 -07:00
Pasi Kallinen
ed5c7114ab Untrapping containers or doors gives some experience 2024-05-08 20:10:32 +03:00
PatR
236ea3b99e fix #4131 - medusa-4 level layout
The medusa-3 and medusa-4 levels each have four possible locations
for Medusa.  medusa-3 forced the downstairs to have the same location
but medusa-4 was choosing Medusa's location independently from the
stair location.  So it was likly that the hero could go down to the
next level without having to deal with her.
2024-05-08 07:56:42 -07:00
PatR
0f2897c704 deleted object sanity checking revisited
Give a different message from "obj not free" if attempting to delete
an already deleted object.  Also, skip sanity checking of in_use/
bypass/nomerge bits for deleted objects instead of clearing them when
going onto the objs_deleted list.
2024-05-08 07:34:22 -07:00
PatR
82c9e9b737 fix #K4166 - touchfood() can return destroyed obj
Eating from a stack while inventory is full drops the partly eaten
food.  If over lava and it is flammable it gets used up without the
eating code being aware of that.  (Dropping into a hole or trap door
shouldn't have the same problem because the dropped object is still
accessible via the migrating objects list.)

Have touchfood() return NULL if the food item gets used up due to
being dropped.  By itself, that wasn't enough.  Callers needed to be
updated to handle that.

I didn't look at other callers of dropx/dropy/dropz; they might have
similar issues.  Perhaps they should return the dropped object or
take a pointer to an obj pointer so that there can be just one check
for obj->where==OBJ_DELETED after dropping, but their callers would
still need to updated to cope with that.
2024-05-08 07:15:29 -07:00
PatR
8d9b26e26d sanity check of objs_deleted
Teach obj_sanity_check() and clear_bypasses() about the new obj list.
It should always be empty when sanity checks are performed.  That
might not be the case when obj bypasses are cleared, although failing
to clear bypasses for deleted objects wouldn't make any difference,
so this is mainly cosmetic.
2024-05-07 12:19:43 -07:00
PatR
c8b8f8767e MUSE wand of striking
Some code to stop a monster's zap of a wand of striking short if it
gets destroyed by hitting and destroying a drawbridge is no longer
needed with the new deferred obj deletion.
2024-05-07 12:14:54 -07:00
disperse
2ce432657c fix shop automatic annotation for #overview
[PR #1243.  Cherry picked with new commit log message.  PatR]

Fixes issue where room_discovered was never called for shops
unless #overview was called while inside the shop, fixes #1241.

Issue #1241 reported by mark-mcknight-oncorps.

Triggered by commit e4026d55fb
last December:  Lazy evaluation of overview info.

Closes #1243
Closes #1241
2024-05-07 10:31:40 -07:00
nhmall
389a17bf02 Merge branch 'hardware-shop-string' of https://github.com/nethackathon/NetHack into NetHack-3.7 2024-05-07 12:30:08 -04:00
nhmall
93a44c05d1 let the compiler -Wswitch catch unhandled shop_string types 2024-05-07 12:24:57 -04:00
disperse
c955b086b2 Add missing hardware shop string 2024-05-07 11:57:46 -04:00
nhmall
fce82ac0f3 Merge branch 'patch-4' of https://github.com/nikolas/NetHack into NetHack-3.7 2024-05-07 10:15:17 -04:00
Pasi Kallinen
a6c5d967d2 Fix bhit/mbhit hitting destroyed objects
A monster zapped a wand of striking, hitting a burning potion
of oil, which destroyed items in the same square, and the ray was
checking destroyed item.  Similar thing with a ray done by hero.

The code currently stops checking the objects in the location
if a next object in the chain was destroyed - an improvement
would be to gather all the objects into an array and iterate
over that instead of relying on the nexthere pointer.
2024-05-07 16:05:00 +03:00
PatR
f5cde4cfd6 PR #1242 - paranoid_confirm:trap vs doorways
Pull request from disperse:  moving diagonally from an intact doorway
isn't allowed but if there was a known trap at the destination and
parnoid_confirm:trap was set, player would be asked whether to move
onto the trap before not being allowed to move diagonally.

There was similar misbehavior if a trap had been armed or web spun
in a doorway and you tried to move diagonally into that doorway, not
just out of one.  The pull request's one-line change fixes that too.

I modified the file manually rather than keep the PR's commit.  This
also adds a couple of unrelated reformatting bits.

Closes #1242
2024-05-06 12:08:17 -07:00
Pasi Kallinen
7139ee7446 Move light source and timer types so zero means none
Breaks saves and bones.
2024-05-06 19:58:21 +03:00
Pasi Kallinen
dba37fa768 Zero out freed timers and light sources 2024-05-06 19:17:07 +03:00
Pasi Kallinen
1a58ed8de9 Rework object deletion
Make object deletion work similarly to monster deletion:
it's marked for deletion (by setting the where-field to OBJ_DELETED
and moved to specific deleted-objects chain), but they're actually
freed at the beginning of turn.

This may need some more tweaking, especially in places that iterate
over object chains, but fuzzing did not find any obvious problems.

Fix a case of accessing freed memory: a monster breathed at hero,
destroying some items.  The code stored the next item in the chain
(a cloak), but a ring of levitation was destroyed, causing hero to
plop down into lava, destroying the cloak.  The item destruction
code then tried to access the destroyed cloak object.
Make the code check the object where-field - which will be different
if the object was marked for deletion.  Also removed an extra loop
going through the whole object chain looking for the items to
destroy.
2024-05-06 17:57:47 +03:00
Pasi Kallinen
312a4bcd26 Fix weight of merged partially eaten food
Due to integer rounding, merging two partially eaten food rations
will have wrong weight if we add the old weights together.
Recalculate the weight instead.

quan = 1, weight = 6  (6.675)
quan = 2, weight = 13 (13.35)
2024-05-06 12:06:33 +03:00
Pasi Kallinen
cc6d04519c Fix mind flayer missing wildly impossible
A mind flayer blasted a polyed hero on a pool, who reverted back
to human.  The hero teleported to safety, but the mind flayer was
still thinking hero was at the old location, and tried to attack there.
2024-05-03 17:57:21 +03:00
Patric Mueller
edaf4ac438 Remove doubled definitive article from Monk quest texts 2024-05-03 13:19:32 +02:00
PatR
5abd1be175 fix github issue #1239 - incorrect tile for Ixoth
Issue reported by Shrigis1:  the tile for Ixoth depicts a demon that
resembles Nalzok but it ought to be a red dragon.

The issue entry included a binary tile attachment.  Rather than try
to deal with that, I've cloned red dragon and included the old tile's
eyes.  The issue describes them as green but they look gray to me.
(Ordinary red dragon has white eyes.)

3.4.3 had same issue.  I don't remember whether Ixoth was originally
a demon but his tile seems to have always shown one.

Fixes #1239
2024-05-02 11:16:25 -07:00
PatR
8a1c745515 leash sanity checking refinement 2024-05-01 06:10:39 -07:00