Commit Graph

16303 Commits

Author SHA1 Message Date
Michael Meyer
10a1befcf9 Teleport-control monsters resist being teleported
This makes sense to me, and further increases the challenge of erinyes
being summoned on astral after donning a helm of opposite alignment (if
the player has abused his alignment to the extent that erinyes have
teleport control), since they wouldn't be able to be banished across the
map simply by breaking a wand of teleport control.
2024-01-10 22:57:11 -08:00
Michael Meyer
6d29efcf04 Require a clear head to #offer
This will increase the potential challenge involved in donning a helm of
opposite alignment on Astral, now that it confuses the hero -- it means
that you must spend at least a turn after putting on the helm clearing
the confusion.  Since putting on the helm of opposite alignment may also
summon erinyes, this hopefully turns it from a situation where it's a
no-brainer to immediately ditch them by #offering the Amulet of Yendor
into one where the player must actually stop and think a little bit.
2024-01-10 22:57:11 -08:00
Michael Meyer
0c9e34832c Make HoOA confuse the hero, summon erinyes
A helmet psychically reaching inside your head and twiddling knobs in
your brain must be a confusing experience.  And the instant rejection of
your god (not to mention the vow that you made to find the amulet for
them), perhaps on the very cusp of their ascendance over the other gods,
is sort of the ultimate oathbreaking, so it interests the erinyes.
2024-01-10 22:57:10 -08:00
Michael Meyer
f930a12fba Make erinyes scale with alignment abuse
Consistent with their mythological role of punishing those who had
violated societal taboos -- oathbreakers, hosts who attacked their
guests, etc -- erinyes scale with the cumulative amount of alignment
abuse the hero has committed over the course of the game.  This is
tracked separately from the alignment record, and cannot be cleared by
the hero improving her favor with her god via "good deeds" as the normal
alignment record can.  Erinyes will gain abilities, levels, and attacks
as the hero's alignment abuse worsens.  They will also aggravate
monsters when near the hero.
2024-01-10 22:57:10 -08:00
PatR
32f3f7cf46 Forcefighting webs (when adjacent, not trapped)
ACURR(A_STR) can yield a value as high as 125.  Switch to acurrstr()-2
for a value of 1..19.

P_SKILL(skilltype) shouldn't be used unconditionally.  It yields a
different value for restricted than for unskilled and those two skill
levels only differ for training, not effectiveness.

Allow weaponless forcefight againsta webs.  The chance for success may
need to be tweaked.
2024-01-10 12:24:05 -08:00
Pasi Kallinen
9ab4d65431 Make force-fighting a web train the weapon
... and the skill matter a little bit for actually cutting the web.
2024-01-10 17:44:56 +02:00
PatR
3f3d5b7bda mktrap() flags
This started out as a fix for a comment typo, then morphed a bit....
2024-01-09 17:17:19 -08:00
PatR
d672ea3051 remove redundant mktrap() tests
The 'tm' and 'croom' ?: tests introduced to this sprintf() a couple
of days ago will both always yield their else clause because execution
will only get into the block when they're Null (due to
  if (!tm && !croom && ...) {}
that isn't visible in the diff's context).
2024-01-09 16:36:50 -08:00
PatR
3a8971cc17 more invocation handling
While testing the wall crumbling message TODO yesterday, I saw a
case where the top line of the moat around the invocation area was
truncated even through there were 3 lines of map (on a cavernous
level rather than maze one) above where it cut off.  This improves
things although it may not be 100% correct.

Picking the invocation position is unchanged, so there should be no
risk of it now being positioned too close to the map edge.  It's
possible that it has been farther away from the edge than necessary
though; if so, it will still be.
2024-01-09 12:07:24 -08:00
PatR
0333495b8b DO mkinvokearea() TODO
When performing the invocation, you would get
|The floor shakes violently under you!
|The walls around you begin to bend and crumble!
even if all the nearby walls had been dug away or the level's maze was
made of lava pools instead of walls.  Suppress the second message when
it isn't applicable.
2024-01-09 00:41:35 -08:00
PatR
9cb270d4ca mktrap() sanity-adjacent
Log an error if the argument combination passed to mktrap() will never
place a trap.  Based on the code being used in the latter part of the
routine.
2024-01-09 00:24:51 -08:00
PatR
86f4afa780 sp_lev.c lava tweaks
Some bits I noticed while looking for something else.
2024-01-09 00:04:43 -08:00
nhmall
52940a4620 inappropriate null sobj check - pull request 1173 2024-01-08 23:59:41 -05:00
nhmall
a764d4fd61 Merge branch 'fix-detect' of https://github.com/argrath/NetHack into NetHack-3.7 2024-01-08 23:45:53 -05:00
Mika Kuoppala
0ca1a1ca8e src/trap: Fix isclearpath out of bound access on levl array
Do isok check apriori to accessing the levl array to filter
out dx/dy that have grown too large.

This fixes:
trap.c:3455:19: runtime error: index 80 out of bounds for type 'rm [80][21]'
2024-01-09 01:18:17 +02:00
PatR
eec2abcc96 more PR #1193 - doors
The old default allocation of space for 120 doors on a level seems
excessive.  Reduce that to 20.  Code for expanding the allocation
when needed is already in place.

Pull request from #1193 from mkuoppal was superseded by commits
132d642504 and
3786b2c1d0 so mark it closed.

Closes #1193
2024-01-07 12:03:45 -08:00
nhmall
3786b2c1d0 follow-up to restore.c 2024-01-07 14:38:03 -05:00
nhmall
132d642504 avoid alloc(0), read(fd,NULL,0), write(fd,NULL,0) 2024-01-07 14:30:53 -05:00
PatR
e7d97e3a47 pull request #1159 - new hand and sink rumors
Pull request from entrez:  add some rumors hinting at being able to
wash hands at a sink and about dropping rings down sinks.

There's already a major oracularity about sinks and rings but nobody
ever buys those.  The sink rumor might actually be misleading because
"down the drain" suggests something bad rather than something useful.
Put it in anyway.

Closes #1159
2024-01-06 15:53:01 -08:00
Michael Meyer
cad800337d Add rumors related to sink, hand-washing changes
These can hint at some of the changes that make it possible to dip
potions in sinks to potentially get a hint to their identity, and wash
your hands in sinks, pools, and fountains.  I also mentioned rings in
the potion/sink rumor since there didn't seem to be a rumor about the
sink ring ID mechanic already (though there may be one in coded language
that my grepping didn't catch).  The false rumor about hand-washing felt
to me like a good spot for a Macbeth reference.
2024-01-06 15:51:46 -08:00
PatR
9487b0e56d pull request #1148 - remove old wall_angle() code
Pull request from argrath:  "These codes have been commented out
since 3.4.3, at least."

The two "#if 0 /* older method, fixed */" blocks were present in
3.2.0.  wall_angle() itself wasn't present yet in 3.1.0 so the "older
method" couldn't have been in use for very long.  I examined sources
hosted by nethackwiki.com, which doesn't offer 3.1.1 through 3.1.3.

git log only goes back far enough to include the second cvs repository,
so not far enough.  I'm not sure but 3.1.x might not have even used
the first cvs repository.

Go ahead and get rid of this dead code now rather than wait for some
potential future purge.

Closes #1148
2024-01-06 15:29:50 -08:00
SHIRAKATA Kentaro
ea62674621 delete ancient commented out codes
These codes have been commented out since 3.4.3, at least.
2024-01-06 15:29:11 -08:00
PatR
83bdf71932 pull request #1175 - obj->corpsenm fixes
Pull request by mkuoppal:  some objects which use the corpsenm field
to access the mons[] array can have a corpsenm value of NON_PM (-1)
and weren't avoiding array access in those cases.

In addition to a fixes entry for it, this makes some revisions to the
commited code, handling a few of the cases differently.

Closes #1175
2024-01-06 15:13:31 -08:00
Mika Kuoppala
4669676fc0 src/weapon: Avoid touch_petrifies with invalid corpsenm
Filter out unset (-1) corpsenm before calling touch_petrifies.
While here, cleanup the oselect by doing excluding loop
and use can_touch_safely for filtering (suggested by entrez).
2024-01-06 12:06:56 -08:00
Mika Kuoppala
83fba62152 src/uhitm: Avoid touch_petrifies with invalid corpsenm
Before checking with touch_petrifies, check that corpsenm
is valid (>= LOW_PM)
2024-01-06 12:06:55 -08:00
Mika Kuoppala
c4d3ca00ce src/muse: Avoid touch_petrifies check if bad corpsenm
EGGs can have non permanent monster based corpsenm assigned
(-1). Before doing the touch_petrifies check, make sure
that we have valid corpsenm.
2024-01-06 12:06:55 -08:00
Mika Kuoppala
4f15e134fc src/mon: Avoid addressing with invalid corpsenm in mstoning
corpsenm can be -1 (for EGGs and TINs) so touch_petrifies
using this as index would point to bad entry.

Fix this by making mstoning as helper function and bailing
out early if corpsenm <= LOW_PM (while keeping MEDUSA as is)
2024-01-06 12:06:54 -08:00
Mika Kuoppala
6a085955ea src/eat: Check for valid corpsenm before checking is_rider
corpsenm can be -1 so limit checking is_rider with only
>= LOW_PM corpse numbers.
2024-01-06 12:06:54 -08:00
Mika Kuoppala
5cfa4cd9f6 src/dog: Fix TIN or EGG based corpsenm
TIN or EGG can have the corpsenm not assigned into a
proper monster and instead have an value of -1.

Take this into account in assigning the monster (fptr)
pointer to only point into >= LOW_PM monste entries.
2024-01-06 12:06:54 -08:00
PatR
21068b05c5 fix github issue #1192 - engulfers vs iron bars
Issue reported by Umbire:  an engulfing monster capable of passing
through iron bars (vortices and air elemental) could do so while
carrying the hero.

Prevent an engulfer from doing that unless the hero happens to be
polymorphed into a subset of the types of monsters that can move to
iron bar locations.

Fixes #1192
2024-01-05 16:15:30 -08:00
nhkeni
2c26176de8 blind attempt to satisfy MS-DOS compile 2024-01-05 18:23:55 -05:00
nhkeni
0745d3fbe5 Free user data when destroying a lua state. 2024-01-05 17:26:18 -05:00
Pasi Kallinen
8ee7b11ed6 Use TRUE or FALSE for booleans 2024-01-05 17:00:04 +02:00
nhmall
3e1eeced1a CI update - take 4 2024-01-05 08:15:37 -05:00
nhmall
2b3938e45b CI update - take 3 2024-01-05 07:57:04 -05:00
nhmall
9cc5f54e96 CI update - take 2 2024-01-05 07:34:41 -05:00
nhmall
9b87881f0e update some builds in CI
- attempt build using ncurses6
- attempt build using qt6
2024-01-05 06:59:19 -05:00
nhmall
c3ffc284ad uudecode follow-up 2024-01-05 06:25:47 -05:00
nhmall
4e19221e55 variable 'display' causes shadow variable warnings in X11 build
display.botl      -> disp.botl
display.botlx     -> disp.botlx
display.time_botl -> disp.time_botl
2024-01-05 05:58:51 -05:00
nhmall
f8230eff4b quiet compiler warnings building sys/share/uudecode.c 2024-01-05 00:33:47 -05:00
nhmall
49a5d043c0 consistent use of TRUE vs 1 with botl and botlx 2024-01-04 23:48:38 -05:00
nhmall
22e52ee905 bundle the display-related hints, that tell bot() and others
that an update is required, into a struct. Remove it from
context since there is no reason to save those.
2024-01-04 23:16:27 -05:00
nhkeni
9bcff7b896 Merge branch 'keni-luabits2' into NetHack-3.7 2024-01-04 10:40:27 -05:00
nhkeni
c7ab9a0565 Some lua catchup and cleanup
- add nhl_pcall_handle() to wrap all nhl_pcall calls that didn't check
  return value and either panic() or impossible()
- add --loglua (unix only) to dump Lua memory and steps info to livelog
- remove old logging
- set memory and step limits on all Lua VMs
2024-01-04 10:37:38 -05:00
Pasi Kallinen
7353bf0e69 Message location for monster throwing or shooting at hero 2024-01-04 11:43:13 +02:00
nhmall
1cc90d740f replace a wav file that was acting differently than rest 2024-01-04 00:10:44 -05:00
PatR
c6897bf331 fix github issue #1191 - obj->age of oil potions
Issue reported by AmyBSOD:  several actions change the object type of
a potion rather than force creation of a replacement one, and if/when
the type was changed to oil, the age wasn't converted from absolute
to relative.  Relative age is the amount available and/or the number
of turns it will burn if applied.  The later in a game a potion got
converted into oil, the longer it would burn.  Not mentioned:  reverse
situation was also the case, although that didn't have any noticeable
effect since incorrect absolute age of former oil doesn't matter.

Not thoroughly tested.  I got a potion of oil from a horn of plenty
and it burned for 400 turns, but it might have been created directly
rather than be a rejected magic potion that was converted into oil.

Closes #1191
2024-01-03 13:29:15 -08:00
Pasi Kallinen
db4a44735e Message locations for Monster creation and teleporting 2024-01-03 10:28:16 +02:00
nhmall
6db79b9f18 Guidebook update 2024-01-02 12:34:05 -05:00
Pasi Kallinen
dc8d9d6cd0 Accessibility: Add location info to messages
Adds a new boolean option, accessiblemsg.  If on, some game messages
are prefixed with direction or location information, for example:

   (west): The newt bites!
   (northwest): You find a hidden door.

I added the info to the most common messages, but several are
still missing it.
2024-01-02 18:59:25 +02:00