]> granicus.if.org Git - nethack/log
nethack
3 years agolivelog revisions
PatR [Mon, 28 Feb 2022 21:46:59 +0000 (13:46 -0800)]
livelog revisions

Some changes to fix things I noticed in the dumplog referenced by
github issue #687 about showing all logged events under the header
"major events".  (This doesn't address that.  I figured it was
intentional while #chronicle is having any bugs worked out.)

Sequencing:  show the event corresponding to an achievement for
entering a dungeon branch before the livelog-specific event of
entering a level for the first time.  You enter the branch before
arriving at the new level.

Missing feedback:  the you-won achievement didn't produce any
"ascended" event.  That turned out to be a side-effect to suppressing
achievements that take place after the gameover flag has been set
(so blind-from-birth and/or nudist when applicable plus duplicate
obtained-amulet and ascended due to manipulation to reposition the
amulet achievement to be right before ascended so that the alternate
wording it has in the achievements listing looks better).  Instead of
just forcing the ascended achievement to produce an ascended event,
this adds a more general game-over event.

While in there, change the classification of attaining level 14 from
minor livelog event to major since questing keys off of it.

3 years agoUse macro for spell pw cost per spell level
Pasi Kallinen [Mon, 28 Feb 2022 20:21:37 +0000 (22:21 +0200)]
Use macro for spell pw cost per spell level

3 years agocmdcount_t
nhkeni [Mon, 28 Feb 2022 00:57:16 +0000 (19:57 -0500)]
cmdcount_t

Add a type to force g.{command_count,last_command_count,multi} to have the
same type (because cmd.c: g.multi = g.command_count;) and some resulting
cleanup.

3 years agodocument new 'tune' achievement
PatR [Sun, 27 Feb 2022 20:20:20 +0000 (12:20 -0800)]
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.

3 years agonew achievement: drawbridge tune
PatR [Sun, 27 Feb 2022 09:55:25 +0000 (01:55 -0800)]
new achievement: drawbridge tune

Use up the last available bit for achievements:
"You learned the tune to open and close the castle's drawbridge."
(More can still be added but xlogfile will need another field to
track a second set of 31 in order to keep its achievement bitmask(s)
within portable size.)

As achievements go, it's not very exciting, but players who normally
destroy the drawbridge have to choose whether to earn an achievement
first since once it's gone, there's no way to find out the tune
(either via prayer reward or successful Mastermind).  I'm guessing
that most will probably decide to ignore this achievement since it
has no effect on the outcome of the game.  However, that might not
be true for future tournament play.

There's no need to bump EDITLEVEL for this; room for recording one
additional achievement is already allocated.

3 years agoUsing magic portals and level teleporters stuns for a few turns
Pasi Kallinen [Sun, 27 Feb 2022 09:25:54 +0000 (11:25 +0200)]
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.

3 years agoUse more u_locomotion
Pasi Kallinen [Sun, 27 Feb 2022 09:06:41 +0000 (11:06 +0200)]
Use more u_locomotion

... and make it autocapitalize the first letter, just like locomotion

3 years agoMake rope golem have some death drops
Pasi Kallinen [Sat, 26 Feb 2022 21:46:55 +0000 (23:46 +0200)]
Make rope golem have some death drops

3 years agoUse find_mid finding the leashed mon
Pasi Kallinen [Sat, 26 Feb 2022 20:42:37 +0000 (22:42 +0200)]
Use find_mid finding the leashed mon

3 years agochoose_stairs() revisited
PatR [Sat, 26 Feb 2022 18:15:58 +0000 (10:15 -0800)]
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.

3 years agoUnify shopkeeper/guard/priest bit in m_move
Pasi Kallinen [Sat, 26 Feb 2022 16:05:43 +0000 (18:05 +0200)]
Unify shopkeeper/guard/priest bit in m_move

3 years agoMake m_move return defines instead of magic numbers
Pasi Kallinen [Sat, 26 Feb 2022 15:40:17 +0000 (17:40 +0200)]
Make m_move return defines instead of magic numbers

3 years agoformatting bits in end.c
PatR [Sat, 26 Feb 2022 08:24:17 +0000 (00:24 -0800)]
formatting bits in end.c

3 years agoFixes entry for pull request #685 - place_object
PatR [Sat, 26 Feb 2022 06:44:17 +0000 (22:44 -0800)]
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

3 years agomove validations before their first use
SHIRAKATA Kentaro [Tue, 22 Feb 2022 08:21:44 +0000 (17:21 +0900)]
move validations before their first use

3 years agofix github issue #686 - dead code
PatR [Sat, 26 Feb 2022 06:35:04 +0000 (22:35 -0800)]
fix github issue #686 - dead code

Reported by argrath:  the code in choose_stairs() intended as last
resort wouldn't do anything because the loop's test condition always
started out false.  Fix suggested by entrez.

Closes #686

3 years agoSplit escaping from sticking monster check out of domove
Pasi Kallinen [Fri, 25 Feb 2022 20:26:12 +0000 (22:26 +0200)]
Split escaping from sticking monster check out of domove

3 years agoUnify domove and lookaround trap/liquid avoidance code
Pasi Kallinen [Fri, 25 Feb 2022 19:49:38 +0000 (21:49 +0200)]
Unify domove and lookaround trap/liquid avoidance code

Nearly same code was in two places - the only difference was
how g.context.run == 1 was handled.  Previously, if you were
blind, and knew about the water or lava, you still ran into it.
Now, we always avoid the dunking if running/rushing.

3 years agoremove references to old Qt 'moc' timestamp files
PatR [Fri, 25 Feb 2022 18:39:45 +0000 (10:39 -0800)]
remove references to old Qt 'moc' timestamp files

src/moc.qt[56] existed briefly but got replaced by src/Qt[56].h-t
(controlled by hints/include/compiler.370).  The old names were
deliberately left in src/.gitignore and sys/unix/Makefile.src's
'clean' target to give some time for anyone who had generated them
to run 'make clean' to get rid of them.  That time is now up.  It's
only been about three weeks but if I wait any longer I'll probably
forget.

3 years agoMinor code clarification
Pasi Kallinen [Fri, 25 Feb 2022 17:48:17 +0000 (19:48 +0200)]
Minor code clarification

3 years agoSplit movement out of bounds check out of domove
Pasi Kallinen [Fri, 25 Feb 2022 16:33:50 +0000 (18:33 +0200)]
Split movement out of bounds check out of domove

3 years agoSplit carrying too much check out of domove
Pasi Kallinen [Fri, 25 Feb 2022 16:12:55 +0000 (18:12 +0200)]
Split carrying too much check out of domove

3 years agomore thrown object cleanup
PatR [Fri, 25 Feb 2022 15:10:30 +0000 (07:10 -0800)]
more thrown object cleanup

Handle thrown or kicked object that's in transit for hangup save and
panic save in addition to normal end of game.  Affects ball and chain
placement too, if they've been temporarily taken off the map.

3 years agoSplit impaired movement code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 15:06:25 +0000 (17:06 +0200)]
Split impaired movement code out of domove

3 years agoSplit water turbulence code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 14:59:52 +0000 (16:59 +0200)]
Split water turbulence code out of domove

3 years agoSplit ice fumbling code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 14:43:09 +0000 (16:43 +0200)]
Split ice fumbling code out of domove

3 years agoWizard-mode wishing for (melting) ice
Pasi Kallinen [Fri, 25 Feb 2022 14:42:08 +0000 (16:42 +0200)]
Wizard-mode wishing for (melting) ice

3 years agoSplit air turbulence code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 14:13:27 +0000 (16:13 +0200)]
Split air turbulence code out of domove

3 years agoSplit force-fighting empty square out of domove
Pasi Kallinen [Fri, 25 Feb 2022 13:19:51 +0000 (15:19 +0200)]
Split force-fighting empty square out of domove

3 years agoSplit swapping places with pet code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 13:09:56 +0000 (15:09 +0200)]
Split swapping places with pet code out of domove

3 years agoChange unknown mintrap result into impossible
Pasi Kallinen [Fri, 25 Feb 2022 12:57:03 +0000 (14:57 +0200)]
Change unknown mintrap result into impossible

3 years agoSplit force-fight iron bars code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 12:54:33 +0000 (14:54 +0200)]
Split force-fight iron bars code out of domove

3 years agoSplit some code out of domove
Pasi Kallinen [Fri, 25 Feb 2022 12:46:38 +0000 (14:46 +0200)]
Split some code out of domove

Should have no change in behaviour.

3 years agoplace_object() bit: panic/impossible decl
PatR [Fri, 25 Feb 2022 02:15:48 +0000 (18:15 -0800)]
place_object() bit: panic/impossible decl

3 years agolost objects thrown by monsters
PatR [Fri, 25 Feb 2022 02:10:52 +0000 (18:10 -0800)]
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.

3 years agotrap followup
PatR [Thu, 24 Feb 2022 20:17:21 +0000 (12:17 -0800)]
trap followup

Make the flags argument to dotrap() and mintrap() and the constants
passed to them all have consistent type: unsigned int.

3 years agoMove output delay from walk_path to mhurtle_step
Pasi Kallinen [Thu, 24 Feb 2022 17:50:27 +0000 (19:50 +0200)]
Move output delay from walk_path to mhurtle_step

... in case walk_path is ever used for something that
doesn't need the delay.  The hero hurtling already had
delay, so it was done twice.

3 years agoMoving a monster with telekinesis hurles it through the air
Pasi Kallinen [Thu, 24 Feb 2022 17:27:56 +0000 (19:27 +0200)]
Moving a monster with telekinesis hurles it through the air

... and at the end of the flight, it can't avoid a trap, if it
lands on one.

3 years agoMost traps now require touching the floor to trigger
Pasi Kallinen [Thu, 24 Feb 2022 16:55:11 +0000 (18:55 +0200)]
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.

3 years agoGet rid of force_mintrap, allow passing flags to mintrap
Pasi Kallinen [Thu, 24 Feb 2022 15:13:20 +0000 (17:13 +0200)]
Get rid of force_mintrap, allow passing flags to mintrap

It uses the same flags as dotrap, so simulate force_mintrap
by passing FORCETRAP flag.

3 years agoMake trap return values more consistent
Pasi Kallinen [Thu, 24 Feb 2022 14:23:56 +0000 (16:23 +0200)]
Make trap return values more consistent

Instead of returning monster's mtrapped-state, return specific
trap return values.
Add one extra trap return value, for when a monster was
moved by the trap.

3 years agoRemove forced trap activation from mhurtle
Pasi Kallinen [Thu, 24 Feb 2022 13:18:00 +0000 (15:18 +0200)]
Remove forced trap activation from mhurtle

3 years agoAllow using #wiztelekinesis on yourself
Pasi Kallinen [Thu, 24 Feb 2022 13:10:39 +0000 (15:10 +0200)]
Allow using #wiztelekinesis on yourself

3 years agoFix: monster hurtling and liquid
Michael Meyer [Wed, 23 Feb 2022 17:58:43 +0000 (12:58 -0500)]
Fix: monster hurtling and liquid

A monster hurtling over liquid would drown immediately the instant it
touched the first square of water, even if normally it would have kept
moving (e.g. hurtling over a short moat).  Additionally, its placement
on liquid would not take into consideration other monsters, so it could
overwrite an existing monster on that spot and lead to an impossible,
and/or two monsters occupying a single position.

Fix these issues, so that liquid effects like drowning only happen if
the monster ends up in liquid at the end of the hurtle, and so that
other monsters in the way will stop it early even if they're floating
over or swimming on a pool/water/lava square.

Also use canspotmon instead of canseemon for the wiztelekinesis debug
command.

3 years agoUse u_at macro
Pasi Kallinen [Wed, 23 Feb 2022 18:28:35 +0000 (20:28 +0200)]
Use u_at macro

3 years agofix #K3529 - perm_invent not IDing blank scroll
PatR [Wed, 23 Feb 2022 17:50:25 +0000 (09:50 -0800)]
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.

3 years agoFix the force_mintrap
Pasi Kallinen [Wed, 23 Feb 2022 17:11:32 +0000 (19:11 +0200)]
Fix the force_mintrap

3 years agoHurtling monster always triggers a trap
Pasi Kallinen [Wed, 23 Feb 2022 16:59:57 +0000 (18:59 +0200)]
Hurtling monster always triggers a trap

3 years agoWall of water stops monster hurtling
Pasi Kallinen [Wed, 23 Feb 2022 11:54:07 +0000 (13:54 +0200)]
Wall of water stops monster hurtling

3 years agoGive message trying to hurtle immovable monster
Pasi Kallinen [Wed, 23 Feb 2022 11:42:05 +0000 (13:42 +0200)]
Give message trying to hurtle immovable monster

If the monster is too big, stuck to hero, or trapped.

3 years agoUse IS_WATERWALL and is_waterwall
Pasi Kallinen [Wed, 23 Feb 2022 10:53:09 +0000 (12:53 +0200)]
Use IS_WATERWALL and is_waterwall

3 years agoFix comment, mhurtle now handles pools and lava
Pasi Kallinen [Wed, 23 Feb 2022 09:34:35 +0000 (11:34 +0200)]
Fix comment, mhurtle now handles pools and lava

3 years agoMake minliquid handle walls of water
Pasi Kallinen [Wed, 23 Feb 2022 09:30:51 +0000 (11:30 +0200)]
Make minliquid handle walls of water

3 years agoSome spell code reorg
Pasi Kallinen [Wed, 23 Feb 2022 08:45:14 +0000 (10:45 +0200)]
Some spell code reorg

Keep the internal spell array index inside spell.c,
and refer to spells outside of it with the otyp id.

3 years agoupdates from cron job
nhmall [Wed, 23 Feb 2022 01:14:44 +0000 (20:14 -0500)]
updates from cron job

3 years agomore sleeping monster
PatR [Tue, 22 Feb 2022 20:12:13 +0000 (12:12 -0800)]
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.

3 years agowhitelist a new warning in cmd.c
nhmall [Tue, 22 Feb 2022 20:10:33 +0000 (15:10 -0500)]
whitelist a new warning in cmd.c

src/cmd.c(1253): warning: conditional expression is constant

3 years agopull request #660 from NullCGT - sleeping monsters
Kestrel Gregorich-Trevor [Thu, 20 Jan 2022 16:24:10 +0000 (10:24 -0600)]
pull request #660 from NullCGT - sleeping monsters

Indicate to players that monsters are sleeping.

Closes #660

3 years agoHandle water and lava when hurtling a monster
Pasi Kallinen [Tue, 22 Feb 2022 14:51:13 +0000 (16:51 +0200)]
Handle water and lava when hurtling a monster

Also delay the output, showing the hurtle animation.

3 years agoAdd #wiztelekinesis for testing purposes
Pasi Kallinen [Tue, 22 Feb 2022 13:54:02 +0000 (15:54 +0200)]
Add #wiztelekinesis for testing purposes

For testing mhurtle, which is used for jousting or
bare-handed combat.

Improve mhurtle_step to handle bumping into another monster,
and when the monster gets killed or stuck in a trap.

3 years agoMake wood golem death drops more varied
Pasi Kallinen [Tue, 22 Feb 2022 12:57:41 +0000 (14:57 +0200)]
Make wood golem death drops more varied

3 years agoChange kitchen sink glyph and color
Pasi Kallinen [Tue, 22 Feb 2022 12:41:15 +0000 (14:41 +0200)]
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.

3 years agoHuge monsters easily climb out of pits
Pasi Kallinen [Tue, 22 Feb 2022 11:07:59 +0000 (13:07 +0200)]
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.

3 years agoStart with a level 1 spell and enough power
Pasi Kallinen [Tue, 22 Feb 2022 10:26:03 +0000 (12:26 +0200)]
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.

3 years agoCasting a forgotten spell uses some random amount of power
Pasi Kallinen [Tue, 22 Feb 2022 09:32:04 +0000 (11:32 +0200)]
Casting a forgotten spell uses some random amount of power

... in addition to the confusion/stunning it does.

3 years agoElves and rangers get alignment penalty for cutting down trees
Pasi Kallinen [Tue, 22 Feb 2022 09:13:59 +0000 (11:13 +0200)]
Elves and rangers get alignment penalty for cutting down trees

3 years agoHobbits getting a sling also get some ammo
Pasi Kallinen [Tue, 22 Feb 2022 08:01:55 +0000 (10:01 +0200)]
Hobbits getting a sling also get some ammo

3 years agoFlint and hard gems break less often when thrown
Pasi Kallinen [Tue, 22 Feb 2022 08:01:17 +0000 (10:01 +0200)]
Flint and hard gems break less often when thrown

3 years agoAdjust sleep spell, and monk starting spell
Pasi Kallinen [Tue, 22 Feb 2022 07:13:28 +0000 (09:13 +0200)]
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.

3 years agoChargeable rings may get charged when hit with electricity
Pasi Kallinen [Mon, 21 Feb 2022 19:04:50 +0000 (21:04 +0200)]
Chargeable rings may get charged when hit with electricity

... instead of being destroyed. Normal charging limits apply.

3 years agoUnix command line bit
PatR [Mon, 21 Feb 2022 18:59:42 +0000 (10:59 -0800)]
Unix command line bit

For the !SYSCF configuration, the command line processing still checks
for a value for maximum number of simultaneous players.  The recent
revisions would have accepted a negative value.  I don't know whether
anything interesting would have happened if someone did that.

3 years agoAdjust enchantment spell levels
Pasi Kallinen [Mon, 21 Feb 2022 17:30:52 +0000 (19:30 +0200)]
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.

3 years agonethack.6 bits
nhkeni [Mon, 21 Feb 2022 16:18:58 +0000 (11:18 -0500)]
nethack.6 bits

Restore hard-coded author name.
Fix overlong line causing wrapping error.

3 years agoupdates from cron job
nhmall [Mon, 21 Feb 2022 15:16:44 +0000 (10:16 -0500)]
updates from cron job

3 years agofixes entry for pull request #683 - just picked
PatR [Sun, 20 Feb 2022 22:46:59 +0000 (14:46 -0800)]
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

3 years agoadd missing initializer of jcp
SHIRAKATA Kentaro [Sun, 20 Feb 2022 21:18:46 +0000 (06:18 +0900)]
add missing initializer of jcp

3 years agomakedefs exit control
PatR [Sun, 20 Feb 2022 21:52:18 +0000 (13:52 -0800)]
makedefs exit control

Have makedefs do through a common point when exiting, in case it ever
needs extra memory or scratch file cleanup.

While testing, I discovered that the reference use of 'makedefs -o' to
build obsolete onames.h didn't work anymore because of the change to
not require object probabilities to add up to 1000 within classes.
I think fixing that is the only change besides new 'makedefs_exit()'.

3 years agomemory management for 'nomakedefs'
PatR [Sun, 20 Feb 2022 21:47:31 +0000 (13:47 -0800)]
memory management for 'nomakedefs'

The nomakedefs struct starts out with static values, then if/when
populate_nomakedefs() is called, the fields are given dynamic values.
free_nomakedefs() needs to know what state it's in.

A big chunk of this if just formatting for indentation.

3 years agoIlliterate hero will learn spells directly from deity
Pasi Kallinen [Sun, 20 Feb 2022 20:05:30 +0000 (22:05 +0200)]
Illiterate hero will learn spells directly from deity

... instead of receiving a spellbook.

3 years agoFix old-style function def
Pasi Kallinen [Sun, 20 Feb 2022 19:18:03 +0000 (21:18 +0200)]
Fix old-style function def

3 years agoClean up some spell-related code
Pasi Kallinen [Sun, 20 Feb 2022 19:12:23 +0000 (21:12 +0200)]
Clean up some spell-related code

Add two helper functions and use those outside of spell.c,
instead of iterating through all the spells.

3 years agoAlways give a message when monster changes form via polytrap
Pasi Kallinen [Sun, 20 Feb 2022 17:40:52 +0000 (19:40 +0200)]
Always give a message when monster changes form via polytrap

... if the hero can see it.  This was an accessibility issue.

3 years agoMake looting less tedious
Pasi Kallinen [Sun, 20 Feb 2022 16:27:23 +0000 (18:27 +0200)]
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.

3 years agoSplit sitting code into smaller parts
Pasi Kallinen [Sun, 20 Feb 2022 15:28:48 +0000 (17:28 +0200)]
Split sitting code into smaller parts

Split sitting on a throne and laying an egg into their
own functions.  No changes to behaviour.

3 years agoEngraving with Fire Brand burns the text on the floor
Pasi Kallinen [Sun, 20 Feb 2022 13:58:20 +0000 (15:58 +0200)]
Engraving with Fire Brand burns the text on the floor

3 years agoThrown items can get stuck in webs
Pasi Kallinen [Sun, 20 Feb 2022 10:23:00 +0000 (12:23 +0200)]
Thrown items can get stuck in webs

3 years agofixes entry for pull request 682 - ravens lay eggs
PatR [Sun, 20 Feb 2022 01:32:52 +0000 (17:32 -0800)]
fixes entry for pull request 682 - ravens lay eggs

Pull request by entrez:  make ravens oviparous.

Closes #682

3 years agoMake ravens oviparous
Michael Meyer [Fri, 18 Feb 2022 22:33:00 +0000 (16:33 -0600)]
Make ravens oviparous

Ravens are birds, so they should be able to lay eggs.

3 years agosome formatting bits in dogmove.c
PatR [Sat, 19 Feb 2022 22:55:01 +0000 (14:55 -0800)]
some formatting bits in dogmove.c

3 years agogamelog: hit with wielded weapon for first time
PatR [Sat, 19 Feb 2022 19:24:28 +0000 (11:24 -0800)]
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".

3 years agoImps and others cussing the hero wake up nearby monsters
Pasi Kallinen [Sat, 19 Feb 2022 15:18:07 +0000 (17:18 +0200)]
Imps and others cussing the hero wake up nearby monsters

3 years agoMake killer bee - queen bee transformation apply to hero
Pasi Kallinen [Sat, 19 Feb 2022 15:06:33 +0000 (17:06 +0200)]
Make killer bee - queen bee transformation apply to hero

if they've polyformed to a killer bee and eat royal jelly.

3 years agoReading a magic marker shows the specific red ink color
Pasi Kallinen [Sat, 19 Feb 2022 11:11:20 +0000 (13:11 +0200)]
Reading a magic marker shows the specific red ink color

3 years agoAllow creating unhidden traps in special levels
Pasi Kallinen [Sat, 19 Feb 2022 10:38:24 +0000 (12:38 +0200)]
Allow creating unhidden traps in special levels

des.trap({ type = "rust", seen = true });

3 years agoKnight quest home level has some saddled warhorses
Pasi Kallinen [Sat, 19 Feb 2022 09:51:06 +0000 (11:51 +0200)]
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.

3 years agoTowels should weigh more than blindfolds
Pasi Kallinen [Sat, 19 Feb 2022 08:32:54 +0000 (10:32 +0200)]
Towels should weigh more than blindfolds

There's more cloth in a towel than in a blindfold.

3 years agoCandy bars are bright blue in text mode
Pasi Kallinen [Sat, 19 Feb 2022 08:24:50 +0000 (10:24 +0200)]
Candy bars are bright blue in text mode

There's lots of brown comestibles, but no bright blue.

3 years agoUnix command line parsing
PatR [Fri, 18 Feb 2022 22:38:24 +0000 (14:38 -0800)]
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.

3 years agoKnights get no caitiff penalty against undead
Pasi Kallinen [Fri, 18 Feb 2022 19:29:31 +0000 (21:29 +0200)]
Knights get no caitiff penalty against undead

3 years agoMartial arts users never deal no damage with a clumsy kick
copperwater [Mon, 13 Apr 2020 00:56:44 +0000 (20:56 -0400)]
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.