Commit Graph

105 Commits

Author SHA1 Message Date
nhmall
4d42d44c02 catch-up on some updates to fixes37.0
Side note: Here's a correction for the commit
message for 330287da42:

The original incorrectly stated 'CONDITION_SIZE' (which
doesn't exist) instead of CONDITION_COUNT in one of the
paragraphs.

--- snip ---

eliminate the uses of the manually maintained BL_MASK_BITS

Use CONDITION_COUNT which does not require manual updating.

Also attempts to adjust win32 graphics window port for
the new fields.

That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.

   struct conditions[CONDITION_COUNT];
   int cond_idx[CONDITION_COUNT];

The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.

The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
    int i;
    for (i = 0; i < CONDITION_COUNT; ++i) {
        ...conditons[i].enabled;
        ...condtions[i].text[0];
    }

you can use the ranked ordering like this:
    int i, ci;
    for (i = 0; i < CONDITION_COUNT; ++i) {
        ci = cond_idx[i];
        ...conditons[ci].enabled;
        ...condtions[ci].text[0];
    }
2020-02-08 21:07:04 -05:00
PatR
e198150ad8 more level teleport feedback
Level teleporting to current level doesn't give any feedback but
is usually done intentionally to abort the level teleport.  Being
on the bottom level of branch and attempting to teleport even lower
failed silently like choosing the current level.  Have it give some
feedback about not being able to go any lower.
2020-02-08 17:15:18 -08:00
nhmall
5116ad4eed Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 11:05:26 -05:00
nhmall
ffd9eedb2c condtests[bl_bareh] requires a couple of additional g.context.botl = 1 2020-02-08 11:03:46 -05:00
Pasi Kallinen
9e4319824d Fix digging through iron bars from adjacent pit
It was possible to create a pit on top of iron bars, by first creating
a pit next to the bars, going down into the pit, and then digging sideways
towards the bars. This did not destroy the iron bars.
2020-02-08 17:08:17 +02:00
nhmall
57d25ad826 fixes37.0 update for unexplored changes and new status conditions 2020-02-08 01:30:14 -05:00
PatR
84daf75981 'travel' option
Change '!travel' to only prevent travel-by-mouse and leave '_' alone.
2020-02-07 14:37:51 -08:00
Pasi Kallinen
eed37c9a84 Allow #wizgenesis quantity in the prompt
The #wizgenesis command can also accept a quantity in the input prompt,
previously it only accepted a command repeat prefix.

(via UnNetHack, originally from NetHack4)
2020-02-07 19:11:18 +02:00
Pasi Kallinen
b12ea03d11 Allow monsters to rummage through containers 2020-02-02 11:05:43 +02:00
PatR
2ebbe61f53 fix github issue #285 - spellcasting monster
After casting a spell, a monster got a chance to make a regular attack
despite the apparent attempt to set up a return value indicating that
it wouldn't move.

When looking over the return value situation, I noticed 'wormhitu()'
for the first time.  It gives worms additional attacks when the hero
is adjacent to some of the tail, that only works if the head is within
reach of a melee attack.  The hidden tail segment at head's location
always met that criterium so gave an extra attack that didn't make
sense; change wormhitu() to skip that segment.

Do some formatting in mcastu.c; no change in actual code there.

Fixes #285
2020-02-02 00:55:26 -08:00
nhmall
09d82164fc msdos fix from chasonr 2020-02-01 22:08:41 -05:00
PatR
158ea1a23f failing level change messsage confusion
While testing the changes to dungeon and special level handling, I got
|A mysterious force prevents you from descending!
|You materialize on a different level!
The mystery force is handled by goto_level() so level_tele() doesn't
know that the failure is going to happen when it sets up the message
for deferred delivery.  Suppress the message if you don't change levels.
2020-02-01 17:53:07 -08:00
PatR
625a9a7b79 fix 'Couldn't place lregion type 1' on Orc town
Stairs up from Orcish Town variation of Mine Town were being forced
to be near the bottom of the left side of the level due to a bogus
exclusion region in the level description.  If that small area was all
solid rock then a warning was issued and no stairs up were created.
2020-01-31 12:58:24 -08:00
PatR
fe664435dc royal jelly
Applying royal jelly listed all of inventory as likely candidates for
  what to rub it on, including itself.
Applying it to anything took no time.
After the "you smear royal jelly on <foo>" message,
  unsuccessfully applying it to non-eggs gave no other feedback;
  successfully applying it to eggs gave no additional feedback.

Allow #rub to use royal jelly too.

Also, require hands to apply or #rub anything.

Not done:  fumbling and/or slippery fingers should have a chance to
  drop the jelly or to drop whatever gets rubbed with it.
2020-01-31 05:10:00 -08:00
Pasi Kallinen
d44c83d45f Allow applying royal jelly on an egg
Royal jelly applied on an egg will change a killer bee egg to
a queen bee egg. Cursed jelly will kill the egg, uncursed and blessed
will revive it. Blessed jelly will also make the creature think
you're the parent.

Original patch was by Kenneth Call
2020-01-31 10:39:40 +02:00
PatR
1641c864a2 wands vs no-hands
Hero shouldn't be able to zap wands when polymorphed into a form which
lacks hands.

The other tweaks to dozap() shouldn't produce any change in behavior.
2020-01-29 10:35:02 -08:00
PatR
4e59f0ead9 level teleport "you materialize" mesg sequencing
If level teleport took you somewhere special, things like shop entry
or quest summons or valley atmosphere messages were being given first,
then "you materialize on a different level" after.  schedule_goto()
takes before-change-message and after-change-message arguments; it
ought to be extended to have a mid-change-message one too but I didn't
think of that until just now.
2020-01-28 15:28:31 -08:00
PatR
c9166bc00c black and white ice
Like lava when that looks the same as water with color Off, render ice
in inverse video if it looks the same as the floor of a room.  (I tried
bold first but the result didn't look very good.)

Done for tty and curses; others may want to follow suit.
2020-01-28 15:01:41 -08:00
PatR
2f0676c1b8 beauty no longer in eye of the beholder
There was a complaint that despite charisma of 13 being above average,
the character was described as "ugly".  The cut-off was actually >14
for "beautiful" or "handsome" vs <=14 for "ugly".  This adds several
more grades of appearance.
2020-01-28 12:49:38 -08:00
nhmall
033894d784 Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-27 08:52:17 -05:00
PatR
9b2c9e79d8 limit rate of long worm growth
Make long worms grow more slowly (although that didn't seem to make
as much a difference as expected) and limit the amount of HP they
acculate if they shrink and then re-expand.  Shrinking doesn't take
away max HP but growing used to always add to max.  Now it won't add
to max HP unless the number of segments is at that worm's peak, so
shrinking will inhibit the exhorbitant HP expansion that idle worms
have had.
2020-01-26 04:57:13 -08:00
Pasi Kallinen
ae843bc10a Allow wizmode wishing for cloud terrain 2020-01-26 14:05:11 +02:00
nhmall
b443dea158 Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-25 09:41:21 -05:00
PatR
a453215a06 disclose achievements
When disclosing conduct at end of game (but not during except in
wizard mode), display achievements too.  They're also included in
dumplog if it's enabled.  Previously they were only output as an
extra field in xlogfile.
2020-01-24 17:00:49 -08:00
nhmall
97b74e6f7b Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-24 17:27:48 -05:00
PatR
0166239a22 simplify achievement tracking for special objects
This turned out to be a lot more work than I anticipated, but it is
definitely simpler (other than having #wizmakemap take achievements
away if you replace the level that contains the 'prize', which wasn't
handled before).

I cheated and made Mine's End into a no-bones level because the new
flagging scheme for luckstone, bag, and amulet can't carry over from
one game to another.  It probably should have been no-bones all along.
Sokoban didn't have this issue because it's already no-bones.

Existing save files are invalidated.
2020-01-24 13:54:23 -08:00
PatR
b2fa6292db Lua error reporting buffer overflow
nhl_error() was clobbering the stack.  I assume that the 'source'
field in the Lua debugging structure is normally a file name, but
nethack loads an entire Lua script into one long string because it
usually comes out of the DLB container, and 'source' contained the
full string.  That would overflow the local buffer in nhl_error()
if nethack encountered a Lua problem and tried to report it. (In
my case, the problem was in a level description file modification.)

[Not something under user control unless user can modify dat/*.lua
and put the result into $HACKDIR/nhdat.]
2020-01-24 12:52:35 -08:00
PatR
3e18804371 half poison gas damage from wearing a wet towel
Make wearing a wet towel confer new attribute Half_gas_damage in
addition to the usual blindness.  It reduces damage from being inside
a gas cloud region and from being hit by poison gas breath attack.
It also fully blocks breathing of potion vapors.

Might make the Plane of Fire easier although overcoming its blindness
with telepathy won't reveal elementals.  Definitely has the potential
to make blind-from-birth conduct easier which wasn't the intent and
probably isn't significant.
2020-01-21 17:03:54 -08:00
PatR
a13d6c03c9 no more headless eyewear
Noticed while working on something else:  hero kept wearing a towel
after polymorphing into a form without any head.  And when not already
wearing one, could put on a blindfold/towel/lenses while in a headless
form.
2020-01-21 15:36:33 -08:00
nhmall
76dd55a7b0 fixes37.0 update 2020-01-18 11:43:12 -05:00
PatR
d19cab4d98 implicit_uncursed, mention_walls
Move 'implicit_uncursed' and 'mention_walls' from iflags to flags to
make their current setting persist across save/restore.  Invalidates
existing save files.
2020-01-17 04:03:14 -08:00
PatR
1a89e44e19 fix #K188 - trying to move past edge of level
Trying to move into a wall or solid rock fails and doesn't do anything
(unless the 'mention_walls' option is On) and doesn't use a turn, and
trying to move off the edge of the map window also doesn't do anything
(except for 'mention_walls') but that did use a turn.  Don't.
2020-01-17 02:43:32 -08:00
nhmall
fe4bdae740 closes #282
closes #282
2020-01-14 23:50:06 -05:00
PatR
2b1f8a1b43 fix #K166 - role selection filtering
pick_role() had a 5 year old copy+paste error where a pair of lines
were cloned multiple times but one of the resulting lines didn't get
the intended revision, preventing OPTIONS=align:!chaotic or !neutral
or !lawful from working as intended when letting the game choose role
randomly.  The bad line should have been calling ok_align() but that
routine turned out to have a bug too.

Fixing those lead to other less obvious problems with role selection,
particularly the tty menu version for picking manually.  Roles and/or
races which should have been excluded by partial specification weren't
always kept out.  Also, if any filtering was specified, trying to
disable all filters (via choosing 'reset filtering' and de-selecting
everything in the menu) was a no-op.  Once any filtering was in place
you had to leave at least one role or race or gender or alignment
flagged as not acceptable in order to change any of the filtering.
When that was fixed and it was possible to turn off all filtering,
there was no way to turn it back on because the menu choice to reset
the filters wasn't offered unless there was some filtering in place
(that was intentional but turned out not to be a good idea).

I checked curses and X11; they both offer less versatile selection
capability that don't seem to need the tty-specific fixes.
2020-01-13 12:34:01 -08:00
PatR
2d35668c63 update novel fixes entry 2020-01-12 22:15:37 -08:00
PatR
caaf1b375a randonly occurring Discworld novels
Give 'novel' a 1 in 1000 chance of being created in place of each
random spellbook (except for hero's initial inventory and NPC
priests' monster inventory and divine reward for prayer--those all
force regular spellbooks; statue contents aren't among the
exceptions--those books can now be novels).  Shop inventory (where
first book or scroll shop created is guaranteed one novel) hasn't
been touched.  If there is any other special spellbook handling
somewhere, I've overlooked it.
2020-01-12 11:00:38 -08:00
PatR
07a2c1c813 fix github issue #279 - boulder feedback
Polymophed into a giant and moving onto a boulder's location could
yield "you easily pick it up" (without actually doing so) followed
by "you see a boulder here".  It would happen if autopickup was Off,
or if the 'm' move-without-autopickup prefix was used, while either
boulder was included in pickup_types (including when that is set
for 'all') or hero had thrown that particular boulder and
pickup_thrown was On.  The check for whether auto-pick should try
on an object relied on its caller verifying that autopickup was On.
pickup() does that for
 pickup() -> autopick() -> autopick_testobj()
but moverock() wasn't doing that for
 moverock() -> autopick_testobj()
so the logic controlling moverock's message was subverted.

I first thought that logic itself was incorrect and changed the
message.  This keeps the new message even though it turned out not
to be cause of the problem.

Fixes #279
2020-01-12 05:05:24 -08:00
PatR
7c3ae74c27 hallucinatory water and lava terrain
When browsing the map while hallucinating and looking at a pool, a
moat, or 'other' water or at molten lava, report with hallucinatory
liquids rather than the ordinary substance.  Likewise when browsing
self on map or using ^X would report "sinking into lava".
2020-01-11 09:34:01 -08:00
PatR
92994f6d71 data.base lookup fix
Changing data.base lookup to accept leading spaces as an alternative
to the normal leading tab ended up adding an invalid integrity check.
Lines without any leading space or tab were considered to be in error
but empty lines are present so need to be accepted.
2020-01-11 08:45:45 -08:00
PatR
e27b6af856 fix github issue #277 - repeat door open failure
The change to make "ouch! you bump into a door" use up a turn didn't
end running, so when it happened while running useless turns took
place and that message was delivered repeatedly until some other
action interrupted the hero.  It didn't matter whether autoopen is
enabled.

Fixes #277
2020-01-10 13:13:36 -08:00
PatR
3a6e2a9802 escaping buried iron ball
Noticed while testing the look-at-self feedback for traps.  When
punished and the iron ball gets buried, hero becomes "tethered to a
buried object".  It is possible to simply walk away (like from a pit,
bear trap, web, stuck in floor by solidified lava or sinking into
molten lava) but that requires many tries.  Once the escape happens,
"you finally wrench the ball free" and are supposed to have it
reattached to a replacement chain.  However, buried_ball() wouldn't
look at buried objects if the trap countdown timer was 0 (which is
the case when finally wrenching free).  So hero got a new chain to
drag around but it had no heavy iron ball attached.

I didn't turn on sanity checking but that would have complained about
this.  Normal dragging didn't care but I wouldn't be surprised if
various actions that checked Punished and picked up the ball in order
to put it down again elsewhere would have had possibly serious trouble.
2020-01-10 04:36:28 -08:00
PatR
f6c547f376 randomized trap names
Use trapname() in several more places.  I wasn't systematic about it.

trapname() could generate a random value of 0 and attempt to use
"real trap #0" but 0 is NO_TRAP.  So it ended up with "water" from
the preceding block of entries in defsyms[].  Treat 0 as an extra
chance for the actual trap instead of an hallucinatory one.

Add a couple more hallucinatory traps.  "Roach Motel" is trademarked
but like Spam and Band-Aid, general usage has trampled over it.  I
included "(tm)" anyway.  Also, sometimes generate "<role> trap" or
"<rank> trap" on the fly.  Why should tourists get all the fun?
2020-01-09 18:45:06 -08:00
Patric Mueller
2965488525 Unpaid globs showed weight info unconditionally outside of wizmode
globwt() didn't check for wizmode, so unpaid globs would be shown with weight
information even for normal player.

Eliminated globwt() completely and consolidated the output of aum in one place
as we don't really care about the ordering of debug info in wizmode.
2020-01-08 11:34:53 +01:00
PatR
a49dcd1e12 tethered aklys description
Recent object formatting changes for wielded weapon put some pline
arguments in the wrong order.
 a - aklys (weapontethered  in hand)
or worse, when dual-wielding
 a - aklys (wieldedtethered  in right hand)
Change back to
 a - aklys (tethered weapon in hand)
or
 a - aklys (tethered weapon in right hand)

I considered (tethered weapon wielded in right hand) for the two-
weapon case, but I think that's too verbose.
2020-01-07 04:40:20 -08:00
PatR
2d0e7e0578 fix #K119 - wishing for Amulet of Yendor
Wizard mode wishing for "Amulet of Yendor" has a 50% chance of
yielding a cheap plastic imitation.  Allow asking for "real Amulet
of Yendor" and "fake Amulet of Yendor" to provide precise control.
Asking for "real Amulet of Yendor" in normal play will be accepted
but then overridden with the fake amulet as usual.

Without the prefix, there's still a 50:50 chance for either amulet.
"real fake amulet of yendor" and "fake real amulet of yendor" both
yield a fake one.

When handling "amulet of yendor", any of "cheap", "plastic",
"imitation", "cheap plastic", "cheap imitation", and "plastic
imitation" are now recognized to mean "cheap plastic imitation".
Unlike prefixes such as "blessed rustproof" vs "rustproof blessed",
these two-word ones (or the three-word whole thing) need to be in
specific order and after the general prefixes.  Also, any of those
force "fake" even if an explicit "real" prefix came before them.
2020-01-07 02:59:25 -08:00
PatR
bfa0f072f7 fix #K125 - autounlock vs touching artifacts
Apply makes a touch_artifact check on the tool being applied, but
autounlock would pick an unlocking tool to use without doing that.
Noticed while fixing that:  autounlock took no time.

Since picking an artifact unlocking tool might now blast the hero,
change the tool selection.  First choice: any key except another
role's quest artifact; second: any lock-pick except another role's
quest artifact; third: any credit card except another role's quest
artifact; fourth, fifth, sixth: other roles' quest artifact key,
lock-pick, or credit card.  The fifth category (artifact lock-picks)
is empty.  Rogues will pick non-cursed Master Key over any other
key (special case for first choice).  Tourists will pick a key or
a lock-pick over their PYEC (first and second choices over third).
2020-01-05 23:54:11 -08:00
copperwater
9e29b516de Remove Sokoban luck penalties for things you can't cheat with
Jumping, Newton's 3rd Law hurtling, and throwing an iron ball:
attempting to do any of these in such a way that you would diagonally
pass between boulders/walls causes the Luck penalty. However, none of
these actually get you through the diagonal gap, thus they can't be used
to cheat and the penalty doesn't make sense.
2020-01-06 01:00:29 +01:00
PatR
8853d0e566 wizard mode wishing for secret doors
Allow wishing for secret doors and secret corridors.  It's a bit
more strict about where the wish is performed than wishing for
furniture.  Implemented in order to test drum of earthquake effects.

I spent a lot of time figuring out SDOOR details that somebody
already knew at some point but evidently didn't document--you can't
specify D_CLOSED for them or the display code will issue impossible
warnings about wall mode angles.
2020-01-05 13:13:21 -08:00
PatR
52f4803a5a more earthquake
When a drum of earthquake targets a secret door, reveal it (which
is always followed by collapsing the door), and when it targets a
secret corridor, reveal that corridor.  Both situations also place
a pit at the location.
2020-01-05 11:30:38 -08:00
PatR
5292ab5de0 fix #K105 - earthquake chasms
Drum of earthquake can try to destroy fountains, thrones, altars,
sinks, and graves but it wouldn't do so because maketrap() had been
changed to prevent clobbering furniture with traps.  So you might get
"the throne falls into a chasm" but the throne would remain intact.

Change furniture to be floor before trying to create a pit.  The gist
of the patch is the 'if' after 'do_pit:' and also some changes to the
revealing of hidden monsters.  The rest is reformatting.
2020-01-05 01:20:15 -08:00