Commit Graph

5995 Commits

Author SHA1 Message Date
PatR
abb492007e praying on unaligned altar outside Gehennom
From a reddit thread, praying on the altar in orctown behaved like an
ordinary prayer directed at Moloch rather than being an exceptional
event.  Make it always be rejected.  The penalty is very trivial.
2020-03-20 19:01:34 -07:00
Pasi Kallinen
6227bdf438 Prevent setting boulder symbol to a control character 2020-03-20 21:04:16 +02:00
PatR
24f0aa2dc9 warning fix
This one is more interesting that most....

|sp_lev.c:3745:9: warning: declaration shadows a variable in the
|      global scope [-Wshadow]
|boolean ladder;
|        ^
|../include/rm.h:538:20: note: expanded from macro 'ladder'
|#define ladder     flags /* up or down */
|                   ^
|../include/flag.h:428:29: note: previous declaration is here
|extern NEARDATA struct flag flags;
|                            ^
2020-03-19 15:08:43 -07:00
Alex Smith
dd6ebbacea Correct timing when attaching lit candles to the candelabrum
Before this commit, attaching a lit candle would reduce the amount
of fuel in the candelabrum to 0, 15 or 75 turns due to a failure to
account for time stored in the candle's burn timer. Fixing this is
very important because a time of 0 turns on the candelabrum is not
supposed to be possible.
2020-03-19 19:56:16 +00:00
Pasi Kallinen
a142ac8140 Unify special level c code for stairways 2020-03-19 21:23:55 +02:00
Alex Smith
c698b5654c Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-03-18 23:02:04 +00:00
Alex Smith
564dd1db8d Safety valve against candelabrum's .age becoming 0
This may have happened in a 3.7 game on Hardfought. Even if it didn't,
I'm still uncomfortable with the potential for the game to potentially
become unwinnable as a consequence of age field corruption. Add an
impossible() for when this situation happens, and code after the
impossible() to repair the game by removing the candles.
2020-03-18 23:00:31 +00:00
Pasi Kallinen
9ab6994eae Make Juiblex resist magical digging from inside
Juiblex should be a little bit harder to beat than zapping a digging
wand once you've gotten swallowed and then whacking him once.

Make his HP halve every time you zap digging instead of setting it
to 1.

Change via UnNetHack.
2020-03-18 09:16:26 +02:00
Pasi Kallinen
750d2fe560 Alias "kirin" for "ki-rin" 2020-03-17 19:06:32 +02:00
PatR
40d19525c3 updating 'time' status
Handling botl updates for 'time' was inconsistent.  Set the flag to
do that when moves is incremented (where the update is suppressed if
running) or when running stops short.

losehp() would cancel running/traveling if called when in normal form
but not if called when polymorphed, so theoretically you could take
damage and keep on running.  I don't have a test case to verify that.
2020-03-16 17:32:12 -07:00
PatR
8ccc9773aa fix #K608 - ball and chain distance warning
This fixes the reported situation of recoiling from a throw while
levitating and carrying the ball not bringing the chain but it might
introduce other problems.  If it does, drag_ball() would be the place
to fix that, not hurtle_step().

Separate bug (not fixed):  throwing while the ball is on the floor
ought to let you recoil to as far as the chain will reach but it just
yields "you feel a tug from the ball" and you don't recoil at all.
2020-03-16 15:40:52 -07:00
Pasi Kallinen
15019248ae Fix pet location inconsistency
... if the pet attacked hero or another monster by eg.
swallowing them, the pet's location might've changed
during that attack. Count it as movement, so return
immediately.
2020-03-16 22:17:15 +02:00
Pasi Kallinen
44ba4a9e96 Don't flip column 0 2020-03-16 22:10:37 +02:00
Pasi Kallinen
712f545119 Move, rename, and comment out unused function 2020-03-16 11:46:08 +02:00
Patric Mueller
9862d2c934 Use correct archaic form for "thine audience"
Closes GitHub issue #313.
2020-03-16 10:33:31 +01:00
Pasi Kallinen
408321b4f7 Use TAINT_AGE for old corpses instead of hardcoded value 2020-03-16 11:28:09 +02:00
PatR
f6a282ec99 botl fixes
Add a couple of missing status updates.
2020-03-16 02:19:28 -07:00
Pasi Kallinen
04c59fff0a Major amnesia revamp
Instead of forgetting maps and objects, make amnesia forget skills.
Forgetting maps and objects could be circumvented with taking notes,
or by using an external tool to remember the forgotten levels.

Forgetting skills allows the player to optionally go down another
skill path, if they trained the wrong weapon in the early game.

Amnesia still forgets spells.

As a replacement for the deja vu messages when entering a forgotten
level, those messages will now indicate a ghost with your own name
existing on the level, given only when the level is entered for
the first time.

These changes based on fiqhack, with some adjustments.
2020-03-15 11:57:34 +02:00
Pasi Kallinen
dc9fe0d8bc Tone down scare monster by excluding humans and uniques
Scroll of scare monster completely shut down most of the actual
challenging monsters, such as uniques. Tone it down, so you can
use it to ignore the smaller threats while dealing with uniques,
or get most of the effect in the early game when you're usually
dealing with normal monsters.
2020-03-14 21:04:08 +02:00
Pasi Kallinen
55bfc8115a Flip timed effects
In wizard mode, freezing some water on the ground, then
flipping the level did not flip the coordinate of the ice
thawing timed effect. This could cause an impossible complaint.
2020-03-14 11:28:32 +02:00
Pasi Kallinen
961b2a11ff Fix vault guard leaving monsters encased in stone
For some reason the vault guard fake corridor code checked
if the hero was outside the corridor before removing monsters.
But the vault end of the corridor usually gets sealed off
even while you're still in the corridor. This left monsters
stuck in solid rock.
2020-03-13 19:32:47 +02:00
Pasi Kallinen
2ff8523481 Fix priest generated inside temple wall
In a rare case, a random room's width can be 2 tiles, and if
that room was converted into a temple, the priest ended up
inside the wall. Try to put the priest on a random valid position
around the altar, or on it.
2020-03-12 19:17:06 +02:00
Pasi Kallinen
a6c600fd61 Handle gone portal for migrating monsters
If the quest portal was gone, due to hero expulsion, migrating monsters
caused an impossible.
2020-03-11 19:52:12 +02:00
Pasi Kallinen
9adb11238a Flip locations only if inside the flip area
Objects and hero outside the level area (embedded in undiggable
rock by eg. polying into earth elemental) cannot be flipped.
2020-03-11 19:25:52 +02:00
PatR
e7b301537f fountain vs perm_invent
From a reddit thread.  Quaffing from a fountain can curse some of
hero's inventory, but when doing so it wasn't updating the persistent
inventory window if that was enabled.

It could also set the cursed flag on goid pieces; so could dipping.
2020-03-11 04:40:51 -07:00
PatR
5d2f719b02 ball and chain panic when teleporting
"remove_obj: obj not on floor" when trying to move the iron ball.
For the circumstances involved, the ball wasn't supposed to be
moved anyway, just the chain.

I could reproduce the problem using the steps specified.  I didn't
track down the precise point of failure but after this fix the
panic can't be reproduced anymore.
2020-03-10 15:59:01 -07:00
Pasi Kallinen
f664e83070 Handle gone portal when going back in quest 2020-03-10 21:49:38 +02:00
Pasi Kallinen
ae471e71b2 Make sure random doors don't open into solid wall
When making a random door into a random wall or random position
in a room, keep trying harder to find a location that doesn't
have solid wall behind it.

Fixes the Wizard tower door.
2020-03-10 18:11:30 +02:00
Pasi Kallinen
67d3cd31f8 Prevent wizmode panic
In wizard mode, if you angered your quest leader and got expelled from
the quest (which removes the quest portal from the dungeon), then used
the wizmode level teleport menu to teleport back to the quest start and
talked with the angry leader, you would get booted back to the dungeon,
and the game panicked because the dungeon end of the portal didn't
exist anymore.
2020-03-10 08:02:12 +02:00
PatR
debeadfbbe minor #wizmakemap fix - revoked achievements
When replacing Mines' End or top of Sokoban, the achievement for
finding the special prize there is reset.  But the code to do so was
accidentally inside the monster processing loop and got repeated for
each monster on the old instance of the level (essentially a no-op
after the first one though).  That code had been updated more than
once without noticing.  Move it out of the loop.
2020-03-08 14:51:22 -07:00
Pasi Kallinen
9ea2fb7422 Fix flipping some monsters
Don't flip the guard waiting to be disposed of.
Don't flip the occasional monster (usually an earth elemental)
outside the level bounds.
2020-03-08 20:01:41 +02:00
PatR
feb85ad83c ^G limit
Relax the count limit from 255 to ROWNO*(COLNO-1) so that it can
be big enough to fill an entire level yet remain small enough to
not churn away seemingly forever if an absurd amount is specified
for 'random' or for a class rather than a type.  (By-type already
gives up as soon as failure occurs, so is implicitly limited to a
count matching the available space on the level.)  Also impose the
same limit on 'count ^G monster' as '^G count monster'.
2020-03-08 10:29:39 -07:00
Pasi Kallinen
f18b5bb59b Make special levels generate objects with genocided monster classes
If a special level explicitly requests eg. a statue with a genocided
monster class, allow generating it.

Rationale is that those objects were generated before the monsters
became extinct. Also fixes a lua error.
2020-03-08 14:08:32 +02:00
Pasi Kallinen
aca240c928 Limit wizgenesis to max 255 monsters 2020-03-08 00:15:28 +02:00
Pasi Kallinen
f5d9324f28 Fix wizmakemap to consider monster birth counts and uniques
Also add a new wizmode command #wizborn to show those.
2020-03-07 21:35:26 +02:00
PatR
2a37fe5a3b remove mhitm.c's 'otmp'
Get rid of a couple of variables that were file scope and then
incorporated into 'g'.  This should prevent the situation where
attacking a shade gave bogus feedback about glorkum although I
never did reproduce that.

This eliminates g.otmp and g.dieroll but leaves a couple of others.
g.vis really should go away....
2020-03-07 11:20:45 -08:00
nhmall
d2009bc8d0 Merge NetHack 3.6 updates into NetHack-3.7 2020-03-07 14:08:40 -05:00
PatR
44b6612fdc mon's glorkum pass harmlessly through the shade
I couldn't reproduce the problem; it appears to depend upon whether
the file-scope variable 'otmp' has a stale value, and that might
happen after a monster has tried to steal mon's saddle.  However,
the code pointed out in the report is clearly wrong.  This prevents
feedback of "glorkum" (with plural verb since quantity of 0 isn't 1),
but the potential stale value hasn't been dealt with.
2020-03-07 10:47:51 -08:00
Pasi Kallinen
8b6ae1642d Fix flipping non-existent stairs
If the stair or ladder x coord is 0, it doesn't exist.
Flipping it, caused "u_on_newpos: trying to place hero off map <80,0>"
when coming back up from the valley into the castle, and the
castle was flipped.

Fixes #331
2020-03-07 17:07:10 +02:00
Pasi Kallinen
2fc9c02f88 lua special level feature flags
Allow des.feature() to set rm flags for the special features.
2020-03-06 20:30:15 +02:00
PatR
3f377b9405 fix #H4545 - stack of scrolls of scare monster
Reported 3.5 years ago.  Specifying a count for pickup to pick up a
subset of a stack was processed after scrolls of scare monster were
handled, so a whole stack of those got picked up or crumbled to dust
whether you gave a count or not.  Also, if you were too encumbered to
pick up the full stack, they still all crumbled or all changed state
to crumble next time, then for the latter case you picked up as big a
subset as you could handle.
2020-03-06 09:24:33 -08:00
nhmall
94f06d629a merge bits 2020-03-06 11:30:39 -05:00
nhmall
2af37f44d4 Merge March 2020 changes into NetHack 3.7 2020-03-06 10:59:50 -05:00
PatR
32b69f5c33 avoid #wizrumorcheck crash on bad rumor input
If either rumors.tru or rumors.fal was empty when makedefs made
'rumors', init_rumors() will set true_rumor_size to -1 to indicate
that rumors aren't available.  It also closes the input file, and
then #wizrumorcheck closed that again, triggering a crash in the
dlb code.

Fortune cookies and oracles work ok (just not very interesting)
when rumors aren't available.  Only the check command had trouble
with that.
2020-03-05 13:55:45 -08:00
PatR
60bc28154a fix github issue #302 - divide by 0 crash
The traceback points directly to the problem:  divide by 0 happens
if the 'bogusmon' file only contains the "do not edit" line, which
would happen if 'bogusmon.txt' is empty.  makedefs probably ought to
complain about that.

There is now one hardcoded bogus monster to fall back to:  'bogon'.

Random tombstone epitaphs report divide by 0 if their text source is
empty, but it is done by rn2() rather than rn2_for_display_rng() so
is just a warning for pre-release code.  It would crash for release
version though.

I tried placing an empty engravings file and expected similar results
but didn't see any response.  Not sure what that means.

After the fix, empty epitaph file yields blank result so graves that
want a random epitaph won't have any epitaph.

Fixes #302
2020-03-04 15:57:33 -05:00
Pasi Kallinen
a6dfbfca2f Lua: Add contents function to room and map
The function will get the map/room width and height as a parameter.
2020-03-04 20:05:15 +02:00
nhmall
abdd3254ae updates for 3.6 March 2020 2020-03-04 10:41:57 -05:00
PatR
12c2f84f64 corpse_xname() fix
Potential write out of bounds, in front of the block of obufs.
Not exploitable but could conceivably trigger a crash.
2020-03-04 01:58:22 -08:00
PatR
cb18f60331 match_str2clr() fix
Integrity fix.  Make sure color values obtained via atoi() are sane
so that use as array indices can't go out of bounds.
2020-03-03 16:46:04 -08:00
nhmall
7902bacf70 build fix for vs2019
src\nhlsel.c(604) : error C4703: potentially uninitialized local pointer variable 'mf' used
2020-03-03 18:34:27 -05:00