Commit Graph

4514 Commits

Author SHA1 Message Date
Pasi Kallinen
bdc81ab389 Lua: allow obj chain iteration 2022-03-15 18:24:49 +02:00
Pasi Kallinen
e33dd11e99 Document the lua object class 2022-03-15 14:17:46 +02:00
Pasi Kallinen
957c0fbee0 Lua: location-specific timers
Expose map-location specific timers to lua scripts. For example:

  nh.start_timer_at(x,y, "melt-ice", 10);

Currently only available timer type is "melt-ice".
2022-03-15 13:46:56 +02:00
copperwater
1483778e96 Reduce eucalyptus leaf nutrition to 1
Eucalyptus leaves are famously inedible except by certain animals such
as koalas. I consider it very strange that a single leaf in NetHack
gives you six meatballs' worth of calories.

I considered making it 0 nutrition, but am not sure if a 0-nutrition
comestible would end up violating some assumption that all food is at
least 1 nutrition.
2022-03-15 07:41:53 +02:00
copperwater
b4a460f81b Implement selection addition and difference
Selection difference is something I have found myself wanting a lot when
working on levels, and have had to defer to a clunkier xor-then-and
approach. This commit implements the TODO-ed addition and subtraction
operators on two sets.

I don't see how the addition operator would be any different from
logical or, so it just calls l_selection_or rather than implement a new
function.
2022-03-14 18:42:28 +02:00
Pasi Kallinen
4be6fb0df9 Rolling boulder launch coordinates
Allow defining rolling boulder launching location in special level
lua scripts:

 des.trap({ type="rolling boulder", coord={7, 5}, launchfrom={-2, -2} });

launchfrom is relative to the trap coord.
2022-03-12 18:34:44 +02:00
PatR
d4cec7d947 discovered objects within class for a and u
If any artifacts are discovered and menustyle traditional is in use,
the player can type `a to get the artifact subset of discovered items.
Likewise with `u to for unique items (the invocation tools and the
real Amulet).  For normal object classes, `<class> works for every
class, even when there aren't any discoveries for it (where you get
told "you haven't discovered any yet" if you pick such).  But `a
and `u were only allowed if at least one thing in the corresponding
category had been discovered.  Change to allow it even when none have
been.  The feedback of "you haven't discovered any {unique items,
artifacts} yet" was already in place.

Doesn't apply for picking the class via menu.  Menus don't have any
concept of "allowed as a response even though not listed as a choice".
2022-03-10 14:57:15 -08:00
PatR
0effaf529a fix github issue #691 - non-lawful Angels \
get lawful artifacts

Reported by vultur-cadens, Angels can be given Sunsword or Demonbane
for starting equipment even when they aren't lawful so won't attempt
to use those.

This should fix it but it's a pain to test.

Closes #691
2022-03-07 15:12:12 -08:00
PatR
17469a62b9 fixes3-7-0 entry for PR #692, typos in dat/tribute
Pull request #692 from zomGreg.  One comment misspells "transcription"
and Death quote #29 coming from Reaper Man misspells "metaphor".  Fixed
by separate commits.

Closes #692
2022-03-07 14:38:26 -08:00
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