Commit Graph

4968 Commits

Author SHA1 Message Date
nhmall
ec9d3cb88e keep external identifiers under 31 characters length 2023-05-13 13:49:57 -04:00
Pasi Kallinen
f4f74b2e07 Purple worm burp wakes up monsters 2023-05-12 09:17:09 +03:00
Pasi Kallinen
91257e00c7 Werewolf howling wakes up monsters 2023-05-11 18:48:02 +03:00
PatR
92ca5dbf71 describe monster's size for stethoscope/probing
Monster size affects knockback but it wasn't provided anywhere within
the game.  Have wand of probing and stethscope feedback for monsters
include tiny|small|medium|large|huge|gigantic as applicable.
2023-05-10 02:23:57 -07:00
PatR
3f4634211f fix #K3918 - statue-to-boulder polymorph in water
'sanity_check' complains if it finds a boulder in water or lava.
Polymorphig a statue usually produces another statue but might
produce a boulder.  If done it water, keeping the boulder intact
would trigger the sanity warning.  Break it into rocks if object
polymorph produces a boulder at water or lava location.
2023-05-08 02:07:31 -07:00
nhmall
2de3409113 Guidebook change follow-up 2023-05-07 07:38:22 -04:00
nhmall
2986d03adc Guidebook fix 2023-05-07 07:33:18 -04:00
PatR
01df119ae6 Guidebook.tex catchup
Add Guidebook.mn's recent #genocided changes to Guidebook.tex.
Not tested.
2023-05-07 01:22:43 -07:00
PatR
b4b251b618 temporary blindness vs permanent blindness
While testing the fix for unicorn horn vs blindness, I noticed that
when 'blind from birth' (OPTIONS=blind) you would get "your vision
seems to dim for a moment but is normal now" when timed blindness
was added to persistent blindness.  That happened for both 3.6.x and
to-be-3.7.  Change it "you have a strange feeling for a moment".

In 3.7, having temporary blindness timeout while permanently blind
produced "your vision seems to brighten for a moment but is normal
now".  Change that to strange feeling too.  For some reason I haven't
tried to figure out, 3.6.x stayed silent when this took place.
2023-05-07 01:03:29 -07:00
PatR
76fbca7d25 fix github issue #1020 - unicorn horn vs blindness
Reported by argrath:  the test for whether blindness could be fixed
by applying a unicorn horn got broken by the recent change to the
Blinded macro.

While in there, undefine macros once they stop being useful.  I put
these #undef lines closer to their #define instead of at end of file.

Also, remove an out of date comment about encoding property troubles.
It became obsolete when unicorn horn stop fixing lost Str, Dex, &c.

Fixes #1020
2023-05-07 00:37:51 -07:00
PatR
ca02bc4898 fix #K3917 - fuzzer stuck in endless lifesave loop
Life-saving from being burned up in lava attempts to teleport the
hero to safely.  If that fails, hero immediately burns up again.
For fuzz testing, that results in an infinite loop.

While implementing a fix (in done(), not just lava-specific), I
noticed that hangup while running interactively in explore or
wizard mode could be subject to similar effect.

For the fuzzer, if hero dies 15 times without advancing the move
count (not 'moves', the turn count), don't life-save again.  With
hangup, don't prompt for "Die?" more than once.

Normal interactive declining to die still works.  The more exotic
situations aren't tested.
2023-05-06 16:51:59 -07:00
PatR
6de996971b fix #K3915 - "deleting worn obj" warning
Knocking a monster into lava triggering impossible warnig "deleting
worn object" for a wooden shield.  The monster had to be wearning
flammable armor and be fire resistant to survive instead dying and
dropping inventory, and it couldn't be a creature that can survive at
lava locations like a salamander and the armor needed to already be
thoroughly burnt.

It wasn't hard to figure out what needed to be fixed, but it was very
hard to reproduce the situation in order to verify that fix.  The
report was for monster vs monster knockback but I jousted with a lance
instead.  I still don't understand why burning up a worn wooden shield
triggered the warning but burning up a worn orcish cloak did not.
2023-05-06 00:08:35 -07:00
PatR
180042434e more engraving sanity feedback
Delete engravings made in a breach of a shop's wall or of a vault's
wall or in the guard's temporary corridor when the wall is repaired
or the corridor removed.  If 'sanity_check' was On, those would
trigger impossible warning "engraving sanity: illegal surface (x)"
where x was the terrain type code for solid rock or relevant walls.

Adding del_engr_at() calls to the shop code was straightforward.
The vault code is very complicated and I'm not sure that all the
calls I added were actually necessary.
2023-05-04 06:02:23 -07:00
PatR
c0441126b8 fix #K3912 - engraving sanity: closed doors
Engraving in an empty doorway and then using locking magic to create
a door there resulted in an impossible warning: "engraving sanity:
illegal surface (23)" if the 'sanity_check' option was On (wizard
mode only).  Engraving in an open doorway and then simply closing
the existing door produced the same effect.

Accept engravings at closed doors.  Presumably hero will be using
Passes_walls to attempt that so treat closed doors same as open ones.
Update the engraving sanity check to deal with that.

Bonus fix: engraving sanity checking stopped after the first problem
instead of checking every engraving.  Have it continue instead.

Not fixed:  vault wall repair and temporary corridor removal does
not delete engravings and can trigger the illegal surface warning if
player engraves before the repairs.  I didn't test shop wall repair
but it doesn't have any engr references so probably has the same bug.
2023-05-03 14:29:03 -07:00
PatR
7778d91193 fix for breaking a crystal helm
Avoid impossible warning "breaking odd object?" when throwing a helm
of brilliance causes it to break.  Presumably dropping one while
levitating or zapping one of the floor with striking/force bolt would
yield similar result.

While in there, reduce the chance of breakage from 99% to 5% for both
helm of brilliance and crystal plate mail.
2023-05-03 05:30:51 -07:00
PatR
e48c6bdc00 \#genocided revision
The #genocided command was revealing extinct monster species when used
during normal play.  That was not intended, so stop.  Change to only
reveal them in wizard or explore modes and also during end-of-game
disclosure but suppress them during normal play.

The full description of #genocided is now dynamically updated for '# ?'
during normal play to remove its reference to extinctions.  Also, check
for skipping wizard mode commands before doing description searching.

\#genocided was out of alphabetical order in the full commands list.
Both it and #vanquished should have had the GENERALCMD flag; they
don't affect game state.

Change #genocided to use the sort order currently set for #vanquished,
and allow 'm #genocided' to put up the same menu as 'm #vanquished'.
(Not quite the same.  Sorting by count of monster deaths isn't
appropriate for listing genocides where an arbitrary number may have
been killed before the genocide occurred.  If the preferred order for
vanquished is set that way, alphabetical will be used for genocided.)

Setting the order via menu for either command sets the order for both,
but doing so via #genocided doesn't offer the count-high-to-low and
count-low-to-high choices.  During disclosure, you can answer 'a' when
asked whether to disclose genocided and extinct monster types and like
for vanquished monsters, that lets you choose an order at end-of-game.
Doing so won't affect disclosing of vanquished monsters--it'll be too
late for them.

A chunk of this diff is due to moving the #wizborn code out of the
middle of #vanquished handling.

Guidebook.ms has been updated but Guidebook.tex is lagging.
2023-05-03 04:58:39 -07:00
PatR
654b7d41b2 fix #K3907 - reviving buried corpse
Burying an olog-hai corpse with a boulder resulted in a panic when
its time to revive occurred.  I was able to reproduce this once but
failed with "you feel less hassled" several times (using same save
file for multiple tests) so I'm not quite sure what was happening.

A buried corpse was allowed to revive if it was for a zombie.  This
fix extends that to auto-revivers (trolls and Riders).  The corpse
keeps its revive_mon timer rather than changing that to zombify_mon.

If/when revival of a buried troll or Rider happens while in view, it
will "claw itself out of the ground" like zombies do.
2023-05-02 18:02:02 -07:00
PatR
7a18387ff2 Fix github issue #1016 - buried zombie theme room
Reported by vultur-cadens:  it was possible to encounter ettin zombies
and giant zombies at shallow levels if those levels were generated
with the "buried zombies" theme room.

This uses a simpler fix than the suggestion(s); it's only applicable
to the zombie room though.

Also, vary the zombify_mon timeout.  If the hero happened to be in
the room at the time that that expired, they would all claw their way
out of the ground at once.  The new variation is quite small so they
still escape burial as a group, but over the span of 21 turns rather
than all on one turn.

Fixes #1016
2023-05-01 15:37:30 -07:00
PatR
b3580289be fix github issue #1017 - webs in/on water
Reported by copperwater, it was possible for a web to be created
at a water or lava location.  It would not be displayed even after
being discovered; showing the terrain superseded showing the trap.
But it functioned normally and could trap the hero.  Webs pull the
victim to the floor so hero would drown or burn up on next move
even if the spot had been reached while floating or flying.

A monster spider couldn't survive at a water or lava location, but
a poly'd hero could.  Creating a web via #monster or wizard mode
wish could result in it affecting some unsuspecting player via bones.

Disallow creation of webs at water, lava, and air or cloud spots.
(They're already disallowed at furniture spots.)

Fixes #1017
2023-05-01 01:54:35 -07:00
PatR
14e35ce419 fix #K3890 - "wall_angle: unknown hwall mode 4"
When lastseentyp[x][y] is different from levl[x][y].typ and #terrain
tries to show <x,y>, the value of levl[x][y].flags might not have an
approrpriate value for the remembered terrain type.  The reported
problem was an impossible() about wall mode.

rm.wall_info == 4 corresponds to rm.doormask == D_OPEN and both of
them are overloaded on rm.flags.  A spot remembered as a wall but
actually a secret door might cause this if it has become discovered
('wall' changed to closed door) and then opened (with door intact)
while out of view.  [I'm not sure how that could happen though.]

I was unable to reproduce it so haven't verified that the fix works.
2023-04-30 00:38:40 -07:00
PatR
70949a787e mplayer creation bestowing 0 gold pieces
Reported directly to devteam:  a fake player monster was petrified
and when creating its statue yielded "Calculating weight of 0 gold
pieces?".

Fake player monsters on the Astral Plane level were being created
with rn2(1000) gold pieces so had a 1 in 1000 chance of that being 0.
Gold gets created with a non-zero amount but the routine that gives
it to a monster sets the amount to the requested value.  That didn't
update the weight so didn't notice the 0.  Putting it into a container
(the statue) did recalculate the weight and did notice.

There was a choice between forcing a non-zero amount or allowing 0
and bypassing its creation and placement in monster's inventory.
I went with the latter.
2023-04-29 05:30:14 -07:00
PatR
f9a35132d6 crystal helmet
Discussed a long time ago, change helm of brilliance from iron to
crystal so that it doesn't need to be a special case for metallic
armor's affect on spell casting.  It now has a fixed description of
"crystal helmet" but is not pre-discovered.

Add new helm of caution to retain the "etched helmet" description
among the shuffled helms.  Wearing it confers the Warning attribute.
That's fairly lame but not necessarily useless.  It's iron and gets
half the former probability for a random piece of armor being helm
of brilliance so is not likely to be popular.

Helm of caution keeps the old helm of brilliance tile and new helm
of brilliance is basically the same image with different color and
pointed on the top.

Not changed:  the etched helmet was marked as green and is drawn
that way for text but the tile doesn't actually use green for it.
Crystal helmet started as hi_glass (rendered as 'bright cyan') but
has been changed to clr_white to match crystal plate mail.

Old save and bones files are invalidated.
2023-04-29 02:18:29 -07:00
PatR
1c94bdac89 blindness overhaul
I was working on this at the time 3.6.0 was released and set it aside
until later.  Later has finally arrived.  Redo the Blind, Blinded,
Blindfolded,&c macros to make more complete use of intrinsic property
handling.  Blinded was being treated as a number which could be added
to or subtracted from; now that has to be done via TIMEOUT mask
because it has FROMOUTSIDE (OPTIONS:blind) and FROMFORM (poly'd into
!haseyes() form) bits included.  Object definitions for blindfold and
towel now specify the BLINDED property; overriding blindness via the
Eyes of the Overworld is accomplished via props[BLINDED].blocked.

Code generated for the scores of Blind and !Blind tests throughout
the program should be smaller.

One bug that has been fixed is that putting on the Eyes of the
Overworld cured permanent blindness (from OPTIONS:blind).  The
u.uroleplay.blind flag was cleared and stayed so after taking them
off.  Putting the Eyes on still breaks blind-from-birth conduct but
now blindness will resume when they are removed.

This was untested at the time it was set aside and is only lightly
tested now.  A large number of the changes here are just to switch
from Blinded to BlindedTimeout for current timed value and to call
set_itimeout() for setting a new value.
2023-04-27 14:53:28 -07:00
PatR
57ff993352 optimize pline("%s",string)
pline() already skips sprintf/vsnprintf if the format doesn't contain
any percent signs.  Do the same if the entire format is "%s".

Also, if ESC is used to suppress messages for the rest of the current
move, the text for any impossible warnings issued during that time
would be suppressed too so not be seen.
2023-04-24 16:34:48 -07:00
PatR
71decafefd Qt menu fix
Noticed when working on the add_menu() crash earlier, using a mouse
rather than the keyboard to pick an entry in the sub-sub menus for
'm O' -> 'disclose' -> {any disclosure category} didn't work properly.
The problem was in post-3.6.x menu code for the Qt interface.
2023-04-21 00:44:50 -07:00
Pasi Kallinen
a725447d65 Corpse-eating monsters will home in on corpses
Also allow non-tame ghouls to eat corpses.
2023-04-20 18:56:26 +03:00
Pasi Kallinen
200cc21fb3 Allow some monsters to break boulders
... if the boulder is in a position they want to move to.
Shopkeepers, priests, and the quest leader can break one boulder
and then need to take several turns before being able to break
another.  Riders can break a boulder every turn.
2023-04-19 14:37:55 +03:00
PatR
4d681eed46 new #overview menu
Require the 'm' prefix to treat #overview as a menu with selectable
entries.  During end-of-game disclosure it shows every level that was
visited, but during play it only shows levels which have annotations
(typically automatically generated ones).  The menu wasn't offering
any chance to add an annotation to levels without such, so force
'm #overview' to show every visited level.  Continue to avoid that
(and also avoid the clutter introduced by menu entry selector letters)
for normal #overview.
2023-04-19 02:30:32 -07:00
Pasi Kallinen
83ed647a3e Fixes entry 2023-04-16 09:46:37 +03:00
PatR
a93ee09d1a fix github issue #1011 - monster imagination
Issue reported by AndrioCelos:  if hero was killed by a wand zapped
by a monster, the cause of death was "killed by <wand damage>
imagined by <the monster>" instead of intended "killed by <wand
damage> zapped by <the monster>".  Report mentioned that the monster
was unseen but that wasn't relevant.

This worked when monster wand zaps were briefly changed to use
-9..-0 but got broken when that was reverted to using -39..-30 (due
to -0 being the same as 0 so making zapper of wands of magic missile
ambiguous).

Fixes #1011
2023-04-15 12:34:27 -07:00
PatR
1a2d844a22 fix #K3902 - hug attacks against unsolid targets
Prevent hug attacks (owlbear, python, pit fiend, several others),
attacks for wrap damage (eel and kraken, trapper and lurker above),
attacks for stick-to damage (mimic, lichen), and attacks for digestion
damage (purple worm) from succeeding against unsolid monsters (ghosts,
lights, vortices, most elementals).

Polymorph of an engulf or hold target into unsolid form has been
addressed by a couple of previous updates.
2023-04-14 13:27:33 -07:00
PatR
ced75cb88e polyself u.ustuck fixes
More towards not being able to swallow or hold an non-solid creature.
When engulfed, expel hero if the new form is unsolid or too big.
Give a message if hero is being held (rather than engulfed) and has
to be released.

Adding a call to expels() required some code reordering because it
calls spoteffects().

Give the hint about using '#monster' at the very end of polymon().
2023-04-13 16:47:42 -07:00
PatR
9718181322 shapechanger dropping boulders
Something I noticed while looking over the recent report about hug
attacks.  If a monster carrying one or more boulders (picked up while
in giant form) polymorphs into a non-giant, it will drop them.  If
that happens while it's trapped, it could be killed.  newcham() would
use a stale pointer to continue traversing its inventory after it was
dead and its possessions had been dropped.

I managed to get a chameleon-as-giant carrying boulders and some other
stuff trapped in a bear trap and then transform, but the few attempts
I made never killed off its next form so I wasn't able to induce a
crash to verify that a problem would actually occur.
2023-04-12 03:03:17 -07:00
Pasi Kallinen
8b32ae98e9 Add petless conduct
Breaks saves.
2023-04-11 14:21:06 +03:00
Pasi Kallinen
ffb61612e3 Option to create the character deaf
Allows creating your character permanently deaf,
for that added challenge.

Breaks saves.
2023-04-11 13:23:30 +03:00
Pasi Kallinen
3a3be46624 Bigrm-5 may have patches of ice or cloud 2023-04-09 11:56:35 +03:00
Pasi Kallinen
82bb61532c Bigrm-4 fix and variation
The "butterfly" shaped bigroom was missing the four fountains
in the corners of the room - this was due to my copy-paste error
when converting the bigrooms from des to lua.

Also add some variation to the bigroom.
2023-04-09 11:09:53 +03:00
Pasi Kallinen
b61aa235c7 Items thrown by monsters landing on an altar 2023-04-08 21:24:10 +03:00
PatR
14d003c4ba fix github issue #1003 - anti-magic field energy
Issue reported by vultur-cadens:  when trap effect of an anti-magic
field reduced maximum energy, the result might end up with current
energy being one point higher than new maximum.

Fixes #1003
2023-04-07 23:34:19 -07:00
Pasi Kallinen
697ef9760c Curses: partial stack unselecting
In curses, selecting a partial stack, then unselecting the entry,
and then selecting it normally, the entry still kept the quantity
from the partial selection. Make it behave like all the other
windowports by resetting the quantity when the entry is unselected.
2023-04-05 19:50:43 +03:00
Pasi Kallinen
12dd5323c8 Tutorial: eating food
Also document the lua timers a bit more.
2023-04-04 13:04:39 +03:00
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
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
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
c70c9ec793 Guidebook datestamp to most recent Guidebook commit 2023-03-25 12:12:20 -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
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
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
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