Commit Graph

4505 Commits

Author SHA1 Message Date
PatR
80e7fbe8ec Guidebook tweaks (mainly DUMPLOG)
In the sysconf section, "the following options affect the score file:"
had some score options and then several non-score options.  Change to
"following four options" which reads a little strange but is precise.
Some other inserted line after those four options describing what
follows would read better but the stuff that follows is essentially
random based on the order that support for them was implemented.

Guidebook.mn:  the 'placeholders' for DUMPLOG file name substitution
had the description column line up but the proportional font for the
'%x' column looked bad.  Force fixed-width font there.  Also add some
indentation.  I wasn't sure whether '.in' should in inside .PS ... .PE
or outside.  The final result looks the same either way.

Guidebook.tex:  the new LIVELOG entry was accidentally placed after
the \elist line when it should come before that.  (Not tested.)
2022-03-04 06:51:40 -08:00
PatR
013bb8a112 mention sysconf entry LIVELOG in Guidebook
It's description is minimal since it isn't relevant to most people,
even ones playing on servers who have live-logging enabled.
2022-03-04 06:02:32 -08:00
PatR
e6f1b5c0ce clear_bypasses() should operate on buried objects
Fix an object sanity check failure:  a buried object with its bypass
bit set.

clear_bypasses() was supposed to be clearing the bypass bit on every
object but was neglecting the buried objects list and the billed
objects list (and inventory of the mydogs list, but that is expected
to always be empty at the time when clear_bypasses() gets called).

We already had an issue with billed objects, revealed by the fuzzer
soon after sanity checking was extended to test bypass/in_use/nomerge
bits.  That one was fixed by clearing the bypass bit of specific
objects as they are being added to a shop bill.  This fix should make
that earlier one become obsolete, but isn't removing it.
2022-03-02 14:43:12 -08:00
PatR
2f273eb70b Guidebook typo 2022-03-01 06:48:42 -08:00
PatR
77bd50fd77 fix github issue #687 - logging of major events
Reported by k21971, the dumplog section labeled "major events" showed
all logged events rather than just the ones classified as major.
Filter out the non-major ones when writing dumplog.

At the moment only a couple of ones other than achievements are major.
Probably various other types should be too.

The #chronicle command still lists all logged events unless they're
flagged as 'spoiler'.  So far the mines' end luckstone is the only
one flagged that way.  Unfortunately a player with access to live
logging could still learn whether or not the gray stone that has just
been picked up on the last mines level is the target luckstone by
viewing the log from outside of the game.

The #chronicle command would be more useful if it gathered all the
categories of events present and put up a menu allowing the player to
choose which ones to view.  I haven't attempted to implement that.

Closes #687
2022-03-01 04:15:55 -08:00
PatR
eeee725bf9 document new 'tune' achievement
Add /tune/ to the achievement section of the Guidebook.

The 'note' part is a bit of a spoiler and risks making the prayer
boon of "Hark!  To enter the castle you must play the right tune."
redundant for players who actually read the Guidebook (so hardly
anybody).  Since that's the first stage of a two-stage reward I've
left it alone.
2022-02-27 12:20:20 -08:00
Pasi Kallinen
6a65b41270 Using magic portals and level teleporters stuns for a few turns
It's taxing to teleport long distances.

Yes, this makes the entrance to the planes and the quest more
dangerous, and nerfs portal dancing Fort Ludios.
2022-02-27 11:25:58 +02:00
Pasi Kallinen
9e666b75f6 Make rope golem have some death drops 2022-02-26 23:46:55 +02:00
PatR
020d3f76d5 choose_stairs() revisited
Rewrite choose_stairs().  Use of '&& !builds_up()' was a no-op in
normal branches and forced picking the down stairs/ladder in Vlad's
Tower (or Sokoban) rather than reversing the usual up/down choice.

Also, the logic used was backwards:  Kops always surrounded the up
stairs instead of the down stairs as intended.  Non-Kops picked the
opposite direction of what the arguments asked for but since they based
their choice of up versus down on hidden mon->m_id, the reversal wasn't
noticeable.

Extend the choosing so that if nothing in the requested direction can
be found, it tries the opposite direction.  Otherwise when Vlad's m_id
happens to force the direction to be 'up', he has nowhere to teleport
to now that being in his Tower doesn't force 'down' anymore.  He goes
to down ladder when on the top level but if you level teleport to the
next level down and he accompanies you, he might go to either the down
ladder or the up ladder when he tries to get away from you to heal.
2022-02-26 10:15:58 -08:00
PatR
b1d59665d8 Fixes entry for pull request #685 - place_object
From argrath:  in place_object(object, x, y), validate <x,y> before
using them as indices into level.objects[][] instead of after.

Closes #685
2022-02-25 22:44:17 -08:00
Pasi Kallinen
1cc79b7156 Wizard-mode wishing for (melting) ice 2022-02-25 16:42:08 +02:00
PatR
20eccf8ead lost objects thrown by monsters
Reported by entrez:  if a monster or explosion kills the hero with an
object that has timers or is a light source, it could trigger a panic
when end of game cleanup can't find it because it has been removed
from the map or monster's inventory and not placed back on the map
yet.  This isn't much different from something thrown by hero which
had a similar situation dealt with a long time ago.  Fix by setting
'thrownobj' for monster-launched and explosion-launched missiles.
That way done_object_cleanup() called from really_done() will place the
missile on the map where saving bones or general cleanup can find it.

It doesn't bother dealing with exploding a lit potion of oil that
kills the hero by missile damage before the potion explodes.  If that
ends up in bones, it should still be lit and might blow up before the
new character reaches it.  (Not verified.)

The code for a hero polymorphed into a unicorn and catching a thrown
gem has been moved into its own routine.  No change in behavior, just
less clutter in the thrown-object-hits-hero section of the monster
throwing routine.
2022-02-24 18:10:52 -08:00
Pasi Kallinen
9ae2ec1f98 Most traps now require touching the floor to trigger
It was silly how some clearly mechanical traps didn't consider
flight or levitation when to trigger.  Do those checks in dotrap/mintrap
making hero and monster trap triggering match more closely.
2022-02-24 18:55:14 +02:00
PatR
2635c60280 fix #K3529 - perm_invent not IDing blank scroll
Report was for curses but issue is in the core so any interface
that supports persistent inventory is affected.  Reading a not-yet-
discovered scroll of blank paper wasn't always updating perm_invent
to show change in formatted description when it became discovered.

Would only happen on turn #1 (so the scroll needed to be acquired
via autopickup at starting location or via wizard mode wish so that
it could be read before any game time elapsed) when the object
discovery routine deliberately avoided updating perm_invent.  Fix
by using a different way than moves==1 to decide whether an object
is being discovered because it is part of hero's initial inventory.
2022-02-23 09:50:25 -08:00
nhmall
108dc2d262 updates from cron job 2022-02-22 20:14:44 -05:00
PatR
82accf9169 more sleeping monster
Extend the PR#660 change that shows whether a monster is asleep when
examined by farlook/quicklook/autodescribe to monsters that aren't
moving due to timed sleep as well as those that are asleep for an
unspecified amount of time.  Unfortunately 'mfrozen' isn't specific
about why a monster can't move so the phrasing is less than ideal.
2022-02-22 12:12:13 -08:00
Kestrel Gregorich-Trevor
355ed43a29 pull request #660 from NullCGT - sleeping monsters
Indicate to players that monsters are sleeping.

Closes #660
2022-02-22 11:36:40 -08:00
Pasi Kallinen
e5c73d01fe Make wood golem death drops more varied 2022-02-22 14:57:41 +02:00
Pasi Kallinen
4866182a02 Change kitchen sink glyph and color
The default sink glyph is already used for many other things:
iron bars, trees, corridors, drawbridges, and clouds.

Change the glyph to {, and change the color to white.
The glyph is only used for fountains, so it makes "safe"
water-related glyphs match.
2022-02-22 14:41:20 +02:00
Pasi Kallinen
cf58d09fa6 Huge monsters easily climb out of pits
Also, give a message when a monster trapped in a pit, a web,
or a bear trap frees itself.
2022-02-22 13:08:03 +02:00
Pasi Kallinen
33556788c3 Start with a level 1 spell and enough power
Ensure the first spell - if any - given to the hero in initial
inventory is level 1 - otherwise you can end up with a situation
where the hero knows level 3 spells, but won't have enough power
to cast them.

If the hero starts out with a spell, ensure enough power (5)
to cast that level 1 spell.
2022-02-22 12:26:06 +02:00
Pasi Kallinen
78f7df9a51 Casting a forgotten spell uses some random amount of power
... in addition to the confusion/stunning it does.
2022-02-22 11:32:08 +02:00
Pasi Kallinen
d1dbed95f3 Elves and rangers get alignment penalty for cutting down trees 2022-02-22 11:13:59 +02:00
Pasi Kallinen
51a5550a51 Hobbits getting a sling also get some ammo 2022-02-22 10:01:55 +02:00
Pasi Kallinen
733fc84934 Flint and hard gems break less often when thrown 2022-02-22 10:01:17 +02:00
Pasi Kallinen
d452242af4 Adjust sleep spell, and monk starting spell
Tone down sleep level to 3 (hitting a monster does tend to wake
it up), and replace the random monk starting sleep spell with
confuse monster, which fits nicely with monk's bare-handed
fighting style.
2022-02-22 09:13:32 +02:00
Pasi Kallinen
ef6a88e1e1 Chargeable rings may get charged when hit with electricity
... instead of being destroyed. Normal charging limits apply.
2022-02-21 21:06:29 +02:00
Pasi Kallinen
c73595cc96 Adjust enchantment spell levels
The enchantment spells were skewed towards lower spell levels,
and didn't seem to correspond with the spell effectiveness or
power.  Adjust the spell levels:

- Confuse monster is probably the least powerful enchantment, and
  also requires touch to work, so make it the new level 1 spell.

- Sleep is quite powerful, and ray, bump it to level 4.

- Charm monster is even more powerful so make it level 5.
  (Considering that create familiar is level 6)

                 old   new
sleep             1     4
confuse monster   2     1
slow monster      2     2
cause fear        3     3
charm monster     3     5

Also swap sleep and confuse monster generation probability.
2022-02-21 19:49:04 +02:00
nhkeni
ae28e259ab nethack.6 bits
Restore hard-coded author name.
Fix overlong line causing wrapping error.
2022-02-21 11:18:58 -05:00
nhmall
86c444d1ac updates from cron job 2022-02-21 10:16:44 -05:00
PatR
87ba905107 fixes entry for pull request #683 - just picked
Pull request from argrath:  the code that decides whether to add 'B'
for blessed items, 'X' for unknown bless/curse state and so forth
when setting up prompting for the 'I' command was counting up the
recently introduced "just picked up" category using an uninitialized
variable.  So it might erroneously include 'P' as a choice when no
such items were present.

Closes #683
2022-02-20 14:46:59 -08:00
Pasi Kallinen
4a61602436 Illiterate hero will learn spells directly from deity
... instead of receiving a spellbook.
2022-02-20 22:05:33 +02:00
Pasi Kallinen
041a07468a Always give a message when monster changes form via polytrap
... if the hero can see it.  This was an accessibility issue.
2022-02-20 19:40:55 +02:00
Pasi Kallinen
fc19d1b453 Make looting less tedious
I've seen complaints how looting containers is tedious, and
since multiple containers in the same location are now (and have
been for a while) handled with a menu, the yes-no-quit prompt
for a single container doesn't really mean anything.

Remove that prompt, and remove the "open carefully" message too,
so when you're looting a location with a single container, the
command will drop straight into the loot-in-out -menu.  Also
adjust one looting message to explicitly mention the container
if there are other objects on top of it.

Removing the prompt means you can't loot a saddle from a tame
monster with plain loot when standing on a container - you need
to prefix the loot command with 'm' prefix in that case.
2022-02-20 18:39:52 +02:00
Pasi Kallinen
928677c810 Engraving with Fire Brand burns the text on the floor 2022-02-20 15:59:33 +02:00
Pasi Kallinen
a78419c52a Thrown items can get stuck in webs 2022-02-20 12:23:00 +02:00
PatR
ad32a114a3 fixes entry for pull request 682 - ravens lay eggs
Pull request by entrez:  make ravens oviparous.

Closes #682
2022-02-19 17:32:52 -08:00
PatR
e972d0b965 gamelog: hit with wielded weapon for first time
Reordering "killed for the first time" and "hit with a wielded weapon
for the first time" was done by moving the latter to hmon().  Hitting
with an applied polearm also gave the first-hit message since it
bypassed the routine that had been doing so.  But the throwing code
that handles applied polearms calls hmon() for damage, so after that
reordering, the first-hit log message became duplicated if triggered
by polearm usage.

Also, fix a quibble with the wizard mode conduct message given after
never-hit-with-wielded-weapon conduct has been broken.  The message
said "used a wielded weapon N times" when it meant "hit with a wielded
weapon N times".  "Used" is misleading if that wielded weapon happens
to be a pick-axe, so change the message to say "hit with".
2022-02-19 11:24:28 -08:00
Pasi Kallinen
70dafd658d Imps and others cussing the hero wake up nearby monsters 2022-02-19 17:18:07 +02:00
Pasi Kallinen
26ea5824c1 Reading a magic marker shows the specific red ink color 2022-02-19 13:11:24 +02:00
Pasi Kallinen
c434236f1e Allow creating unhidden traps in special levels
des.trap({ type = "rust", seen = true });
2022-02-19 12:38:28 +02:00
Pasi Kallinen
a1d5464fa7 Knight quest home level has some saddled warhorses
Also, when creating a saddle in a monster inventory in special
level lua code, automatically saddle the monster, if possible.
2022-02-19 11:51:10 +02:00
Pasi Kallinen
04756b5d34 Towels should weigh more than blindfolds
There's more cloth in a towel than in a blindfold.
2022-02-19 10:32:57 +02:00
Pasi Kallinen
41ae240cad Candy bars are bright blue in text mode
There's lots of brown comestibles, but no bright blue.
2022-02-19 10:28:06 +02:00
PatR
45bc2dafa9 Unix command line parsing
Move a bunch of stuff out of main() into new early_options(): '-dpath'
playground directory handling, '-s ...' show scores instead of playing,
and the 'argcheck()' options:  --version, --showpaths, --dumpenums,
and --debug (not to be confused with -D).  Also introduce
| --nethackrc=filename
| --no-nethackrc
to control RC file without using NETHACKOPTIONS so that that is still
available for setting other options.  They can start with either one
or two dashes.  --no-nethackrc is just --nethackrc=/dev/null under the
hood.  '-dpath' can now be '--directory=path' or '--directory path'
but the old syntax should still work.  '-s ...' can be '--scores ...'.

Basic call sequence in unixmain relating to options is now
|main() {
|  early_options(argc, argv[]);
|  initoptions(); /* process sysconf, .nethackrc, NETHACKOPTIONS */
|  process_options(possibly_modified_argc, possibly_modified_argv[]);
|}
Options processed by early_options() that don't terminate the program
are moved to the end of argv[], with argc reduced accordingly.  Then
process_options() only sees the ones that early_options() declines to
handle.

Most early options were using plain exit() instead of nh_terminate()
so not performing any nethack-specific cleanup.  However, since they
run before the game starts, there wasn't much cleanup being overlooked.

chdirx() takes a boolean as second argument but all its callers were
passing int (with value of 1 or 0, so it still worked after being
implicitly fixed by prototype).  Change them to pass TRUE or FALSE.

argcheck() was refusing (argc,argv[]) with count of 1 but then it was
checking 0..N-1 rather than 1..N-1, so it tested whether argv[0] was
an argument instead of skipping that as the program name.  Change to
allow count of 1 with modified argv that has an option name in argv[0].
That happens to fit well with how early_options() wanted to use it.
2022-02-18 14:38:24 -08:00
Pasi Kallinen
cd14456b02 Knights get no caitiff penalty against undead 2022-02-18 21:29:31 +02:00
copperwater
d1b5b39e6d Martial arts users never deal no damage with a clumsy kick
From EvilHack, under the basis that anyone trained in martial arts (or
is in a powerful kicking polyform or wearing kicking boots) should be
immune from landing such a poor kick. This bypass used to happen only
50% of the time; now it happens all the time.

Note that this only averts the "Your clumsy kick does no damage" case:
it remains possible for a powerfully kicking player to kick clumsily and
have the monster evade or block, for example if they are fumbling or
wearing bulky armor.

Also, documentation: I added a comment explaining what the incredibly
dense and confusing logic is with i and j happening here, for the next
poor soul that has to read that code.
2022-02-18 08:12:31 +02:00
Pasi Kallinen
b25138e6d9 Zombies groan 2022-02-16 23:04:02 +02:00
Pasi Kallinen
122634ec9e Hallucinatory rays
When hallucinating, use nonsensical names for the rays
(wands, spells, and breath weapons), and random ray glyphs.

Original code from xNetHack by copperwater <aosdict@gmail.com>,
inspired by a YANI by Kahran042.
2022-02-16 21:09:23 +02:00
Pasi Kallinen
d958d032a0 Looting will fall through to force
If you have autounlock on, and don't have unlocking tool, but
are wielding a weapon usable for forcing the lock.
2022-02-16 08:49:16 +02:00