Commit Graph

2415 Commits

Author SHA1 Message Date
Mak Kolybabi
60ea2874ed Fix other spelling issues. 2018-09-19 21:46:07 -05:00
nhmall
0a1c908503 fixes36.2 entry for the orctown changes 2018-09-18 20:19:06 -04:00
PatR
4336427745 fix #H7396 - wishing for "orange"
Wishing for "orange" might grant an orange, but it might give an
orange gem, orange potion, or orange spellbook instead (but never
orange dragon scales or orange dragon scale mail).  Force the food
object to be an exact match so wishing always produces an orange.
2018-09-18 16:30:58 -07:00
PatR
b34400094b fix #H7060 - polymorph zap vs long worm
A polymoprh zap which creates a long worm can hit and transform the
same monster again depending upon tail segment placement.  Similar
behavior occurs if monpolycontrol is set in wizard mode and player
chooses 'long worm' for what to transform an existing one into (in
which case polymorph fails and zap might hit that same worm again
in another segment, prompting player to choose its new shape again).

Simplest fix would be to make tail segments be immune to polymorph,
but that would prevent players from deliberately attacking the tail
(for polymorph attacks only).  Next simplest would be to make long
worms M2_NOPOLY so that polymorph can't create them, then just live
with multiple promptings when monpolycontrol is set.  This fix
tracks whether a long worm has just been created via polymorph (or
explicitly retained its shape via monpolycontrol) and makes further
hits on same creature on same zap have no effect.  It does so by
setting mon->mextra->mcorpsenm to PM_LONG_WORM when a long worm is
result of polymorph, and setting context.bypasses to get end-of-zap
cleanup.  (It doesn't bother discarding mon->mextra if reset of
mcorpsenm leaves mextra empty.)
2018-09-17 18:28:49 -07:00
PatR
89237fc96d fix #H7157 - cancel self as clay golem
The report was "doesn't kill even if unchanging", but it does cause
rehumanize() when not Unchanging, the same thing that happens when
you die due to loss of hit points.  But losing the activating word(s)
and then having Unchanging retain the clay golem shape does seem
wrong, so make losing the word(s) while being unable to revert to
normal form be fatal.

Poly'd hero (without Unchanging) reverts to normal when cancelled,
so make monsters behave that way.  Previously, only werecritters in
beast form were forced to human form.  This changes cancellation to
make shapechangers and hiding mimics take on normal form too.

Cancelled shapechangers now behave as if the hero has the
Protection_from_shape_changes attribute and will be unable to change
their shape (after having been forced into normal form).  Getting
polymorphed in any fashion uncancels them prior to giving new shape.
[There may be some newcham() situations that should be disallowed
when cancelled rather proceeding and consequently uncancelling.]
2018-09-15 19:23:29 -07:00
PatR
3eded06669 fix #H7156 - perm_invent
Bug report #H7156 listed three items, all relating to perm_invent:
1) it shouldn't persist across save/restore since restore might be
   on a system which doesn't have enough room to display it (report
   actually complained that config file setting was ignored when
   restoring old games, which is an expected side-effect for options
   that persist across save/restore);
2) permanent inventory wasn't updated when using scroll of charging;
3) attempts to update permanent inventory during restore could lead
   to crash if it tries to access shop cost for unpaid items.
Items (2) and (3) have already been fixed.  This fixes (1).

Replace 'flags.perm_invent' with a dummy flag, preserving save files
while removing it from flags.  Add 'iflags.perm_invent' to hold the
value of the perm_invent option.

The win32 files that are updated here haven't been tested.  Whichever
branch contains the curses interface needs to be updated; ditto for
any other pending/potential interfaces which support perm_invent.
2018-09-14 17:34:33 -07:00
PatR
2c231f57bd git pull request #133 - reassess worn equipment
Fixes #133

Monsters who lost an amulet of life saving while having their life
saved wouldn't attempt to put on another amulet unless/until they
picked up some object.  Likewise if they had a worn item stolen.
(There are probably other events which should re-check worn gear.)

The suggested commit had a life-saved monster re-check equipment
during life-saving which might have led to reports about them
effectively getting extra moves, especially if two-weapon fighting
or zap rebound with sequence of kill/life-save/kill-again allowed
the target to put on a replacement amulet of life-saving prior to
the second kill.  It also wasn't amenable to dealing with stolen
equipment.  This alternate fix sets a flag to have monster check
its equipment on its next move.
2018-09-14 15:08:22 -07:00
Pasi Kallinen
e37087e999 Handle monsters inside the invocation area 2018-09-14 21:49:02 +03:00
Pasi Kallinen
97b2ba2e54 Mimics created by #wizgenesis blocked vision incorrectly 2018-09-14 21:07:08 +03:00
PatR
37f8d0edb3 fix #H7385 - double trap activation when jumping
Jumping performs the placement of the last step after using hurtle()
to move to the destination, so if hurtle() triggered a trap then it
would happen twice.  Report was for a Sokoban pit but it would happen
for fire traps too.  Other traps would yield "you pass over <trap>"
while hurtling and then trigger the trap when landing.  Have
hurtle_step() ignore a trap for the last step of a jump, leaving it
to the jump's landing to handle.

Also, give feedback when hurtling over water or lava, similar to what
happens when passing over a previously seen trap which doesn't
activate.
2018-09-13 17:10:25 -07:00
nhmall
7d4a7a1f42 tty column placement of BL_HUNGER and BL_CAP could collide
Change the placement of the code that makes a replica of the
current status fields for later comparison.

A loop shortcut was causing it to be skipped under some
circumstances and that was negatively impacting the placement
of status field values that were further to the right.
2018-09-12 19:42:45 -04:00
Pasi Kallinen
b33b66aa29 Qt: Remember the tile and font size
The QT_TILEWIDTH and QT_TILEHEIGHT read from NetHack config file
override the remembered settings.
Also set the smallest tile size to 6x6
2018-09-12 18:43:10 +03:00
nhmall
59019910b5 heed OPTIONS=symset:default in config file in windows and msdos 2018-09-10 15:27:05 -04:00
Pasi Kallinen
8210f81618 fixes update 2018-09-10 21:33:41 +03:00
nhmall
4be2467cc9 win32 gui bits
fix an index out-of-bounds
status hitpoint bar behavior at zero hp to match tty
2018-09-08 08:54:35 -04:00
Pasi Kallinen
2122506ebe Spiders will occasionally spin webs
Idea and code inspired by aosdict
2018-09-07 20:26:18 +03:00
PatR
4ce6d81d60 hilite_status type 'up' or 'down' vs strings
The temporary highlight types 'goes-up' and 'goes-down' aren't useful
for the three string status fields (title, dungeon-level, alignment)
since the string values might go up when the underlying value goes up
or might go down instead (and similarly for down, down, up).  The code
involved can compare strings but the values are effectively arbitrary
so the comparison is only really useful for same vs changed.  This
treats types 'up' and 'down' for strings as 'changed' when coming from
config file and no longer offers them as choices when using 'O'.

Config file parsing perhaps ought to treat them as errors instead.
2018-09-06 05:26:21 -07:00
nhmall
ec43a80e9e stop tty hitpointbar from jumping to 100% health at zero hit points 2018-09-05 20:21:59 -04:00
nhmall
a417d67572 status_update distinguish new BL_RESET from BL_FLUSH
This adds BL_RESET to status_update to send a flag to a window
port that every field should be updated because something has
happened in the core to make current values shown to be
untrustworthy or potentially obliterated.

That is now distinguished from BL_FLUSH, which now has no
bearing on whether every field needs to be redone, and instead
can be used by a window port indicator that it is time to render
any buffered status field changes to the display.

tty port now sets WC2_FLUSH_STATUS indicator for BL_FLUSH support
and now does one rendering per bot() call, instead of up to 22.

Side note: The tty hitpoint bar code was relying on the old
behavior of redrawing everything upon BL_FLUSH apparently, so it
initially had some color change lag issues, corrected by marking
BL_STATUS as dirty (in need of updating) in tty_status_update()
whenever BL_HP was marked as dirty.
2018-09-03 08:18:18 -04:00
nhmall
0b32735ff8 ensure BL_FLUSH always sent when context.botlx is set
ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:26:42 -04:00
nhmall
6594805811 transformation message when you apply a figurine
make the transformation message of a deliberate apply of a figurine seem
a bit less definite when blind. Put 'I' unseen monster marker at the spot
you expect it to be.
2018-09-02 18:20:40 -04:00
nhmall
7bc0ce66e6 Revert "transformation message when you apply a figurine"
This reverts commit e2b187f2f1.
2018-09-02 18:11:03 -04:00
nhmall
9323f074f7 Revert "ensure BL_FLUSH always gets sent down to the window port whenever bot() is"
This reverts commit ee4c12b238.
2018-09-02 18:10:40 -04:00
nhmall
ee4c12b238 ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:05:16 -04:00
nhmall
e2b187f2f1 transformation message when you apply a figurine
make transformation message of a deliberate apply of a figurine seem a bit
less definite when blind. Put 'I' unseen monster marker at the spot you
expect it to be.
2018-09-02 17:54:00 -04:00
nhmall
1462f69f54 reports on windows of partial status lines after level change
tty: turn off an optimization that is the suspected cause of Windows reported
	partial status lines following level changes. It was turned on for
        non-unix platforms only
2018-09-01 14:52:47 -04:00
nhmall
5a44a34420 wizidentify suppress unnecessary prompt; allow individual items for perm ID
Don't display the selection to identify all items if there are none.

Complete an item marked ToDo in cmd.c: allow selection of one or more
particular items to permanently identify rather than just all or nothing.
2018-09-01 10:43:26 -04:00
PatR
111cfa0ff4 Guidebook update
I noticed that the description of ^O still referred to the 3.6.0
behavior (either #wizwhere or #overview depending upon play mode)
rather than the 3.6.1 behavior (unconditional #overview).

While updating that I changed a bunch of "Wizard-mode" references
to "Debug mode" which is the proper end-user name.

I slightly expanded the descriptions of #wizdetect, #wizgenesis,
\#wizintrinsic, WIZKIT, and Debug mode, and removed at least one
out of date reference to debug mode being a conditional feature.

And for most of the stuff I was looking at, I changed the nroff
source to honor the roff guideline of having each sentence start
on its own line (and also the latex source to use those same line
breaks even though they don't need it).

Not done:  a lot of quoted single characters use 'c' instead of `c'
(pair of ticks rather than back-tick and normal tick).  One form
or the other should be changed so that they're all consistent.
I'm pretty this was mentioned the last time it was formatted for
the web site.

Guidebook.mn has been tested, Guidebook.tex has not.
2018-08-30 15:42:06 -07:00
PatR
f1d0636ba0 fix wiz identify bugs
Fixes #124

Fix github pull request #124 which was also reported directly (but not
through the contact form so #Hxxx number).  Using ^I or #wizidentify
displays inventory with everything ID'd for that command only and adds
a menu entry "_ - use '^I' to identify" that can be chosen to make
those ID's persistent.  Picking underscore would work but picking the
alternate '^I' wouldn't work if the platform had unsigned characters
for plain 'char'.  Switch the return value from magic number -1 to
magic number ^I which isn't a valid inventory letter and isn't subject
to sign conversion.  Casting -1 to '(char) -1' would have worked too
despite some confusion expressed in discussion of the pull request.

If ^I has been bound to some other command and #wizidentify hasn't
been bound to any keystroke, temporary ID didn't disclose any extra
information (ie, acted like ordinary inventory display) and the extra
menu entry to make temporary ID become persistent wasn't available.
This fixes that too.
2018-08-29 19:19:49 -07:00
Pasi Kallinen
9457fde9fc Document windowcolors option 2018-08-29 19:39:30 +03:00
Pasi Kallinen
599edde94d Fix monsters not wielding digging implements
My change to unify the pet and monster digging weapon choosing
made monsters not actually wield the chosen weapon, even though
they could still dig as if they did. Pets behaved properly.

Also add an explicit check for IS_STWALL so they won't keep
switching away from their current weapon until needed.
2018-08-28 18:15:46 +03:00
PatR
95b9205168 fix #H7354 - incorrect material
for parchment and vellum spellbooks.  Parchment and vellum are made
from animal skin rather than from plants, so classifying spellbooks
with those descriptions as paper is inaccurate.  Changing them to be
made out of leather has a couple of side-effects:  eating them while
polymorphed will break vegetarian conduct and polymorphing them might
result in a leather golem rather than a paper one.

I left "leathery spell book" as paper since that directly refers to
the cover.  The composition shouldn't be changed--the pages of such
a book are still made out of paper--but the effect of eating one
possibly should.  (That description originally was "leather" and got
changed.  I don't remember the details and assumed it was due to odd
wishing behavior, but there's a commented-out routine in eat.c which
suggests it was related to eating instead.  Anyway, "leathery" is
still non-leather.)
2018-08-27 19:13:54 -07:00
Pasi Kallinen
bf10a70de0 Make it clear when a leprechaun dodges your attack
It was not obvious what was happening when a leprechaun dodged
your attack. Add a message to explicitly spell it out.
Code by aosdict.
2018-08-26 18:43:25 +03:00
Pasi Kallinen
43dc3bdf5f Hallu YAFM for stumbling onto an undetected monster
Pokemon reference. Based on an idea by aosdict.
2018-08-26 17:55:16 +03:00
Pasi Kallinen
6b79355494 Make wish prompts not remember the input
With EDIT_GETLIN, the wish prompt remembered the previous input,
but this isn't actually useful.
2018-08-26 12:18:16 +03:00
PatR
083e0904db another fix fox "killed, while helpless"
Augmented death reason with appended "while <helpless-reason>" was
broken in 3.6.0 and got fixed shortly after release (too late to
prevent high-score files from being corrupted).  Then within a
couple of weeks it got broken again, and doesn't work in 3.6.1
either (but in this case, it is omitted instead of being cloned
to all following score entries).  The problem is in both record
and logfile, but not xlogfile, so we could create a fix up routine
that would use the last to repair record (and perhaps logfile).
But having two fixup routines would probably lead to confusion.

The problem this time was bad logic in the fix for
|alter name of monster causing hero's death if name contains
|    characters that could cause confusion when using record,
|    logfile, or xlogfile later
killerformat() was going out of bounds of the input string and
using up all of 'siz' so that there was never room to append the
", while helpless" suffix.
2018-08-23 18:01:00 -07:00
PatR
78c5173cd1 shop damage repair
Fixes #121

Fix githib issue #121 - shopkeepers don't charge for consecutive
acts of vandalism on the same square.  pay_for_damage() keys its
action on the 'when' field of the damage structure, and when a
second type of damage gets added to existing damage, that wasn't
being updated.  Both bits of damage (broken door or dug wall plus
trap created at same spot) get repaired together but shopkeeper
wasn't challanging hero to pay for the second one (trap).

The repair process had issues too.  If you broke a shop door, paid
off the shopkeeper, then left the level before the repair took
place and came back after (or rather, catching up for lost time
repaired it when you returned to the level), it didn't actually
get fixed and remained a doorless doorway that was considered to
have been successfully repaired (record of damage discarded).
Unless there was also a trap there; then the door did get properly
fixed when the trap was removed.

Object scattering during wall repair was bypassed if trap removal
took place.

Also, trap removal while off level still gave messages when it took
place after you returned.  I didn't try to verify that; it's possible
that vision is in a state where you can't see the repair even if you
return to a spot where it would be visible.  But the return value
from the repair routine was one which wanted a message instead of
the one to suppress messages.

Not addressed:  digging a pit inside a shop (aside from in doorway
or breached wall) is not treated as damage which should be repaired.
This includes the case of digging up a grave which converts the spot
into ordinary floor (plus pit trap).
2018-08-22 17:41:54 -07:00
PatR
320d592dfd fix github issue #125 - grave gold not buried
Fixes #125

When a random grave included some gold among whatever treasure was
generated, that gold was left on top of the grave instead of being
buried inside it like other treasure.

I'm sure this was intentional but only because mkgold() puts the
gold on the ground and merges it with other gold if there is already
some present.  Keeping an existing stack of gold distinct from the
new one in order to bury the latter is feasible but clumsy.  Just
make a new gold object directly, bypassing mkgold(), and bury that.
2018-08-15 18:33:37 -07:00
PatR
854155dfa9 git pull request #123 - wallification vs map edge
Fixes #123

Make sure wallification doesn't go out of bounds when operating
near the map edge.  The top and left edges were ok (although the
left edge could uselessly try to wallify unused column 0) but the
right and bottom ones weren't validating the map boundary.  None
of the 3.6.x levels were affected.

I've done this a little differently from the suggested commit in
the pull request.
2018-08-14 18:06:59 -07:00
PatR
34c1d30370 fix #H7352 - panic when floodfilling large areas
Special levels with FLAGS:inaccessibles could trigger a panic if
a large enough area was subjected to floodfill handling.  The buffer
intended to be enough to hold an entire level wasn't big enough when
individual coordinates were being added multiple times.  I don't
really understand what this code is doing but the recommended fix
does work to prevent the panic.

None of the levels included with 3.6.x were affected.
2018-08-13 18:33:15 -07:00
nhmall
a105df7320 inconsistency going down a hole/trapdoor accidentally vs deliberately
Noted on rgrn, after being told that you don't fit upon discovery
of a hole or trap door you could then immediately use '>' to
proceed down.

The deliberate situation remains possible and has some
inherent risk.
2018-08-12 08:40:55 -04:00
PatR
baf9c706b4 fix github issue #122 - #turn takes 0 time
Fixes #122

When #turn won't work due to angry god or being in Gehennom, it
aggravates monsters instead.  But that was taking no time.
2018-08-11 16:07:43 -07:00
PatR
007aa040b0 fix #H7342 - seduction sequencing
Interrupt seduction if the hero gets moved away from the seducer, or
if both of them move to another level.  Loss of levitation can drop
the hero onto a trap which sends him/her somewhere else, but seduction
was continuing as if nothing had happened.  In theory it could continue
despite level change because succubus and incubus are level followers,
but there's no way of knowing whether seducer and victim will arrive
next to each other until they get delivered and that doesn't happen
until long after the attack needs to finish.

I don't think theft has the same problem because it is a multi-turn
activity operating on one item at a time, but I didn't check it out.
2018-08-03 20:18:21 -07:00
PatR
77ad700801 fix #H7334 - hearing seduction msgs while deaf
Various seduction messages with a verbal component were being given
to hero even when deaf.  This uses alternate messages if some cases
and bypasses the message in others.  In particular, if hero is deaf
then he or she will not be given the choice to decline removing a
piece of armor--or taking off or putting on a ring of adornment--
that can ordinarily occur (based on die roll against Charisma).

The seduction code was also using '!Blind' to test whether the hero
could see his/her seducer, ignoring the possibility that it might be
invisible.  I think the only ramification is that "It" would appear
in messages instead of the "She" or "He" that are explicitly used
when not seen due to blindness.
2018-08-02 18:44:41 -07:00
PatR
4dabfb5c3c fix github issue #120 - quest message typo
Fixes #120

The one-line summary [for inclusion in message history] of the priest
quest's block message when bringing the quest artifact back to leader
misspelled "congratulations".
2018-08-01 17:39:02 -07:00
PatR
6d3760b923 github pull request #102 - Popeye vs Fixed_abil
Fixes #102

This is a simplified version of the code in pull request #102,
which replaces "You feel like Popeye!" with "You feel like {Olive
Oyl or Bluto}!" if eating spinach fails to provide a strength gain.
I think you should still feel like Popeye if the lack of gain is
due to already being at maximum, so I left out the change to make
gainstr() return a value which indicates whether a change took place.

Unfortunately, if you're both already at maximum and have attribute
changes suppressed by Fixed_abil, the latter overrides and you'll
feel like Olive Oyl or Bluto.  I think that situation is too obscure
to bother with the complexity of figuring out if you're at maximum
for the purpose of a silly message.
2018-07-10 17:14:36 -07:00
PatR
e9ee20bc18 fix github issue #116 - farlook at corpse
Fixes #116

Farlook in 3.4.3 used xname() and just described any corpse as
"corpse" whether you knew the monster type or not.  3.6.x switched
to doname() and describes it as "<mon-type> corpse", but if it isn't
there anymore, the fake object contructed for it would have a random
corpse type.

For corpses and statues, the map glyph provides enough information
to give the fake object the same type as the original.  For other
items that have a monster component (figurines, tins, eggs) it does
not, nor for other doname attributes of objects in general (which
might be picked up by monsters rather than rot away).  So this fixes
the rotted-away-corpse-seems-to- become-random-corpse issue but not
the general case of the details for a remembered item which isn't
there anymore.
2018-07-10 16:35:50 -07:00
PatR
777d9d922d restore vs perm_invent
Redo how updates of permanent inventory window are suppressed during
restore.  Reverses part of e9f1e03271
which included a simpler attempt to deal with this.

It looks like we should have been getting impossible "unpaid_cost:
object wasn't on any bill" but segfault was reported; I haven't tried
to figure out why.  The band in xname() ought to be redundant now but
is included for bulletproofing.
2018-07-05 16:06:31 -07:00
PatR
2596052c39 github pull request #113 - shopkeeper placement
Fixes #113

Incorporate the contents of pull request #113 to fix shopkeeper setup
for irregularly shaped shop rooms.  Code intending to adjust the Y
coordinate was erroneously incrementing the X one instead.  (I'm not
sure whether we have any irregular shops at all but if so, they don't
have the necessary orientation to trigger this bug.)

And add a couple of formatting tweaks in the vicinity....
2018-07-04 19:26:59 -07:00
PatR
faa85e23b4 fix #H7256 - bug WRT eating rings
Wearing a negatively enchanted ring of increase <foo> would enhance
the bonus gained from eating another ring of the same type when you
got "the magic spreads through your body" effect so could be eploited.
Conversely, wearing a positively enchanted one would make you lose
that worn amount when gaining any bonus from eating one.
2018-07-03 16:39:34 -07:00