Commit Graph

15133 Commits

Author SHA1 Message Date
Pasi Kallinen
ba60bfac25 Themeroom: buried zombies
- add a themeroom with random buried zombifying corpses
- disturbing buried zombies makes them revive much faster
- lua des.object() now returns the object it created
2023-04-01 14:05:18 +03:00
copperwater
4542d14d23 Make "cookie-only" rumors explicit in rumors file
The prior behavior was an ugly kludge that treated rumors as
only-eligible-to-appear-from-fortune-cookies if they contained the
string "fortune" or "pity". This commit gets rid of that system and
introduces a system where each rumor can be specified as such by
prefixing it with "[cookie]".

In order to avoid changing existing behavior, I have applied the
[cookie] prefix to all the rumors which were affected under the old
rules. However, several rumors seem like they were misclassified under
the old rules, and I am in favor of changing them as follows:

Should be made cookie-only (they only really make sense in context of
eating a fortune cookie):
- "Ouch. I hate when that happens."
- "PLEASE ignore previous rumor."
- "Suddenly, the dungeon will collapse..."
- "Unfortunately, this message was left intentionally blank."

Should be made non-cookie-only (they make sense if they appear as
engravings, Oracle messages, or artifact whispers):
- "They say that a gypsy could tell your fortune for a price."
- "They say that fortune cookies are food for thought."
2023-04-01 10:13:01 +03:00
copperwater
4126eb3cbe Remove the manual 50% vertical swap of doors in Baalzebub level
This was added before level flipping, and its purpose effectively was to
randomize the interior secret door layout (and thus the entire level,
because the rest is vertically symmetric) by manually flipping it.
Now that the entire level can be flipped and produce this same effect,
this is no longer necessary.
2023-04-01 10:10:34 +03:00
copperwater
886394c9c7 Give a message when a monster is zapped with make invisible
Every other case I'm aware of where a visible monster that the hero can
see turns invisible has some associated message, but not when zapping it
with the wand of make invisible and lacking see invisible. This adds a
message "[monster] vanishes!" in this case, which is the same as the
most common message one gets for zapping a monster with teleportation,
by design to keep the wand's identity ambiguous.

Technically, prior to this commit, there was a leak of information if
one zapped a wand that made a monster disappear: the identity of the
want could be determined immediately by the presence or absence of a
vanishing message. Practically, though, it was easy to check if there
was a new invisible monster in the same spot or not.

Also, zapping teleportation at a monster and having it land somewhere
visible to the hero now has attention explicitly drawn to it with a
message (in prior versions it didn't, so it could potentially be a
different monster appearing by some other means), so I additionally made
the wand of teleportation automatically identify itself when the hero
sees the monster appear as a result of their zap.
2023-04-01 10:00:57 +03:00
PatR
82fc66da0e wands zapped by monsters
Reverse part of commit 4021a63bcf
"wand/spell/breath killer reason" so that wand of magic missile
zapped by a monster isn't ambiguous about who is responsible.
2023-03-31 10:59:48 -07:00
nhmall
9250d85eaa comment bit 2023-03-30 13:10:20 -04:00
Pasi Kallinen
dc12f4f86c Protection from shape changers via wizintrinsics
Setting protection from shape changers via wizintrinsics
caused a sanity error on the next turn, if any monsters affected
by it were in changed shaped on the level.

Call rescham after setting the timeout, so the monsters will
immediately revert to their own form.
2023-03-30 19:56:04 +03:00
nhmall
85feda8774 comment out WANT_ASAN=1 for now
encountered an error testing it on macOS
2023-03-29 22:09:19 -04:00
nhmall
d783afbda1 support WANT_ASAN=1 on make command line in linux.370 and macOS.370
When the address sanitizer is in use for gcc, clang, or visual studio,
(-fsanitize=address) define the NetHack preprocessor symbol USING_ADDRESS_SANITIZER.
2023-03-29 21:39:44 -04:00
PatR
cc2410e349 freeing objects and monsters
Making the zeroing out of memory used by an object that is about to
be freed unconditional, and do the same for monsters.  Should never
matter aside from an undetectable amount of extra overhead.
2023-03-29 15:18:25 -07:00
PatR
dad67436e6 fix #K3895 - 'o' at own spot during pass-walls
If standing at the location of a closed door while having Passes_walls
ability, attemping to open that door with 'o' reported "you don't find
anything here to loot".

Using 'o' to loot for direction ./>/< is intentional but it ignored
the possibility of there also being a closed door present.  When the
latter applies, only switch from open to loot for direction '>' so
that '.' (and '<') will open the door.  Doesn't matter for creatures
that can ooze under a closed door--trying to use 'o' gets rejected for
them because they lack hands.

Also allow hero in Passes_walls form to use 'c' when at open door spot.
(For creatures that ooze under doors, 'c' is rejected just like 'o'.)

Unrelated:  fix a typo in a recently added comment.
2023-03-29 13:48:42 -07:00
Pasi Kallinen
4194b01c17 Tutorial: run prefix 2023-03-28 20:30:53 +03:00
Pasi Kallinen
5c39096fd4 Prevent infinite loop making Medusa statues
While fuzzing, the game got stuck here trying to generate
a random stoneable monster for a Medusa level statue.
I didn't investigate deeper why it failed to find a matching
monster type.
2023-03-28 19:55:39 +03:00
PatR
0532eae7d2 feedback when escaping lava
Fix the duplicate feedback given when landing on one or more items
after teleporting out of lava.

This also avoids "you find yourself back on solid water" if you are
able to survive at a water location and safe_teleds() puts you on one.
2023-03-27 17:08:18 -07:00
nhmall
2855f71764 ceiling and surface relocations and adjustments
relocate surface(), ceiling(), and avoid_ceiling() to dungeon.c
adjacent to has_ceiling() etc.

astral and fire, like airlevel and waterlevel return FALSE
for has_ceiling()

if a caller does happen to call ceiling() on fire level,
return "flames above"

if a caller does happen to call ceiling() on quest level,
return a more-generic "expanse above", instead of the
word "ceiling"

add "stairs" return to surface()

remove recent update to engrave.c to special-case "stairs"
since surface() will return that now
2023-03-27 18:09:58 -04:00
PatR
f74628b9d1 shrieker summoning purple worm
Consolidate a couple of makemon() calls.  I thought that this would
end up being clearer but it isn't actually much of an improvement.
Should be no change in behavior.
2023-03-26 22:56:50 -07:00
nhmall
be3659d731 restrict where the engraving symbol shows up
rooms and corridor locations that have been seen
don't hide stairs
2023-03-26 17:32:54 -04:00
PatR
a3d8557ea6 pet->meating doesn't imply helplessness
The overly simplistic fix to prevent pets from picking up objects
while they were busy eating had unwanted side-effects, making them
seem to be paralyzed in some situations such as #chat.  Reverse the
recent change done in commit 754e9333f5
("fix pet picking something up while eating") and handle it in the
pet pick-up code instead.
2023-03-25 12:47:17 -07:00
nhmall
c70c9ec793 Guidebook datestamp to most recent Guidebook commit 2023-03-25 12:12:20 -04:00
nhmall
de64ae538c update tested versions of Visual Studio 2023-03-25 2023-03-25 11:38:36 -04:00
nhmall
106d6ec406 capitalization bit 2023-03-25 10:57:58 -04:00
nhmall
ddd6cfdf96 catch up on some fixes3-7-0.txt updates 2023-03-25 10:51:05 -04:00
PatR
aa821006de curses: message window border again
This is a better workaround for the missing message window border when
when restoring with align_status:left.  Unlike the previous hack, this
may even be the correct way to handle it in the first place.

I haven't tracked down when the problem started.
2023-03-25 00:57:28 -07:00
PatR
e0e9d1d8b2 curses: message window border w/ align_status:left
This fixes the missing message window border when restoring with
align_status:left (which narrows and forces that window to the right).
It can't possibly be the correct way to fix things but does work.

This was not a problem with 3.6.4 (the most recent pre-3.7 playground
I have on hand) but I don't have the energy to use 'git bisect' to
track done when it started to whether the cause is discernable.  The
message history is put into place without going through putstr() so
differs from normal message handling.
2023-03-24 17:51:21 -07:00
PatR
8a0484321e add flags.silent handling to X11_nhbell() 2023-03-24 14:23:30 -07:00
nhmall
07ba3904fd window-ports should respect flags.silent setting
Like tty_nhbell() in termcap.c, window-ports really should
respect the flags.silent setting.
2023-03-24 12:23:19 -04:00
nhmall
a136dbac06 comment update in win/curses/cursmisc.c 2023-03-24 11:54:47 -04:00
PatR
3fcd56e6e3 curses: resize vs beep
Dynamically resizing the terminal window during play by dragging its
edges was beeping (a lot if you dragged slowly).  Recogize the key
code sent for that instead of complaining about unrecognized input.
2023-03-23 12:47:56 -07:00
PatR
f5d400be75 fix github issue #1002 - curses screen flash
Reported by jeremyhetzler:  with recently revised curses interface,
when dismissing a menu or prompt with ESC the screen flashed.

This was caused by calling beep() when the terminal is set for
'visible bell' (of flagged as incapable of 'audible bell'); the
curses library flashed the screen deliberately.  We don't want that.

Change the function key handling to not call beep() when an ESC
is typed by itself rather than being the leading part of a
multi-character escape sequence.  beep() will still be called if
you type an arrow key (or other function key) when nethack is
expecting text input.  That's what the recent change intended.

This also removes an early return from parse_escape_sequence()
when a number pad key generates an escape sequence.  I don't have
a number pad to verify that this bit works as intended.

Closes #1002
2023-03-23 11:12:34 -07:00
nhmall
8f142020a1 some Windows fixes
remove a couple of extraneous files from visual studio project
remove several trailing whitespace at end of line
remove an address sanitizer bounds error during player dialog init
rework fix for darkened lit tiles (fix issue #997)
2023-03-22 11:29:10 -04:00
PatR
a77aef09d7 wornarm_destroyed() vs destroy_arm()
Refine the fix #K3888 by moving multiple instances of the check for
cancel_don() from destroy_arm() to one instance in wornarm_destroyed().
Should be no change in behavior.
2023-03-20 22:59:16 -07:00
PatR
3ce02acbc5 fix #K3888 - object lost panic cased by lava
Report was for spell-casting monster using the destroy armor spell on
hero's levitation boots while hero was floating over lava.  The boots
became unworn but still in inventory, hero dropped into lava, the
boots happened to be an inventory item which got burned up, then the
call stack unwound back to the destroy armor routine which tried to
finish by deleting them but they were already gone by then.  Could
also happen for black dragon breath, hero reading scroll of destroy
armor, or overenchanting the boots with scroll of enchant armor, so
not so unlikely that nobody would be expected to notice.

Initially I couldn't reproduce the object lost panic.  It only happens
if the memory used by the boots is cleared or clobbered during first
time it's freed, otherwise second free doesn't notice any problem.

The 'wornarm_destroyed()' portion of this commit is sufficient to fix
this.  The other bits are things I tried before figuring out how to
reproduce it, plus zeroing out any object passed to dealloc_obj().
2023-03-20 17:05:02 -07:00
Pasi Kallinen
5d3bebd0aa Fix shop closed engraving on secret corridor
The fuzzer stopped due to the "Closed for inventory" shop engraving
being on a secret corridor; ensure that location is either corridor
or room floor.
2023-03-20 11:09:05 +02:00
Pasi Kallinen
fa0ae08f94 Lua object generation didn't obey locked state
Defining des.object({ id="large box", locked=false })
was the same as random locked state. Make it actually mean unlocked,
and not defining locked at all means random.
2023-03-19 20:13:47 +02:00
Pasi Kallinen
59fd05dd5e Fix the prot from shape changers test 2023-03-19 19:36:52 +02:00
nhmall
5f69dc6228 make attack result macros more distinguishable from makemon macros
Use the MM_ prefix only for the makemon macros, and change these five as follows:

 MM_MISS 0x0     -> M_ATTK_MISS      /* aggressor missed */
 MM_HIT 0x1      -> M_ATTK_HIT       /* aggressor hit defender */
 MM_DEF_DIED 0x2 -> M_ATTK_DEF_DIED  /* defender died */
 MM_AGR_DIED 0x4 -> M_ATTK_AGR_DIED  /* aggressor died */
 MM_AGR_DONE 0x8 -> M_ATTK_AGR_DONE  /* aggressor is done with their turn */

include/hack.h:#define NO_MM_FLAGS     0x000000L /* use this rather than plain 0 */
include/hack.h:#define MM_NOWAIT       0x000002L /* don't set STRAT_WAITMASK flags */
include/hack.h:#define MM_NOCOUNTBIRTH 0x000004L /* don't increment born count (for revival) */
include/hack.h:#define MM_IGNOREWATER  0x000008L /* ignore water when positioning */
include/hack.h:#define MM_ADJACENTOK   0x000010L /* acceptable to use adjacent coordinates */
include/hack.h:#define MM_ANGRY        0x000020L /* monster is created angry */
include/hack.h:#define MM_NONAME       0x000040L /* monster is not christened */
include/hack.h:#define MM_EGD          0x000100L /* add egd structure */
include/hack.h:#define MM_EPRI         0x000200L /* add epri structure */
include/hack.h:#define MM_ESHK         0x000400L /* add eshk structure */
include/hack.h:#define MM_EMIN         0x000800L /* add emin structure */
include/hack.h:#define MM_EDOG         0x001000L /* add edog structure */
include/hack.h:#define MM_ASLEEP       0x002000L /* monsters should be generated asleep */
include/hack.h:#define MM_NOGRP        0x004000L /* suppress creation of monster groups */
include/hack.h:#define MM_NOTAIL       0x008000L /* if a long worm, don't give it a tail */
include/hack.h:#define MM_MALE         0x010000L /* male variation */
include/hack.h:#define MM_FEMALE       0x020000L /* female variation */
include/hack.h:#define MM_NOMSG        0x040000L /* no appear message */

include/hack.h:#define MM_NOEXCLAM     0x400000L /* more sedate "<mon> appears." mesg for ^G */
include/hack.h:#define MM_IGNORELAVA   0x800000L /* ignore lava when positioning */
2023-03-19 12:19:34 -04:00
Pasi Kallinen
e29bfcab54 Split eating non-food into separate function 2023-03-19 15:12:08 +02:00
Pasi Kallinen
bf3e784798 Swamp rooms did not delete engravings on pools 2023-03-19 13:03:22 +02:00
Pasi Kallinen
083676e21b Protection from shape changers and the Wizard 2023-03-19 13:01:44 +02:00
Pasi Kallinen
f3d457dbd4 Split trap victim generation into separate function 2023-03-19 10:06:50 +02:00
PatR
0e761c3e30 talking artifact inconsistency
To get the Magic Mirror of Merlin to speak, you could apply it in
any direction (or wield it).  To get the Master Key of Thievery to
speak, you had to apply it toward an adjacent doorway or down while
on a container (or wield it).  Make the key behave like the mirror.
2023-03-18 21:47:34 -07:00
Pasi Kallinen
73f1dd2aee Tutorial: blacklist commands
Just block saving.
2023-03-18 19:02:25 +02:00
Pasi Kallinen
c4265fb80c Tutorial: add yet another hidden portal 2023-03-18 16:53:26 +02:00
Pasi Kallinen
2a7be0b050 Tutorial: hunger and eating food
Reset hunger when exiting the tutorial.
Add an optional second parameter to lua pline, forcing a more-prompt.
2023-03-18 14:08:13 +02:00
Pasi Kallinen
633487849b Tutorial: looting containers, zapping wands 2023-03-18 12:07:46 +02:00
Pasi Kallinen
20dbd989f1 Tutorial: Firing missiles and quiver 2023-03-18 11:48:19 +02:00
Pasi Kallinen
3f3c275ed5 Tutorial: throwing items 2023-03-18 11:04:27 +02:00
Pasi Kallinen
5ca4e166b1 More fuzzer branch teleporting 2023-03-18 10:46:10 +02:00
Pasi Kallinen
9340197c4c Remove extra full stop 2023-03-18 09:11:18 +02:00
Pasi Kallinen
e37428d5cd Fix fuzzer teleporting out of Fort Ludios 2023-03-18 08:51:37 +02:00