Commit Graph

11344 Commits

Author SHA1 Message Date
Pasi Kallinen
dba9aaf424 Unify ad_curs 2020-12-04 09:30:16 +02:00
Pasi Kallinen
d325e2cc60 Unify ad_blnd 2020-12-04 09:30:16 +02:00
Pasi Kallinen
607d1bcd96 Unify ad_tlpt 2020-12-04 09:30:16 +02:00
Pasi Kallinen
bfe773812e Unify ad_sgld 2020-12-04 09:30:16 +02:00
Pasi Kallinen
b7899ee014 Unify ad_acid 2020-12-04 09:30:15 +02:00
Pasi Kallinen
8a78c49fea Unify ad_elec 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6abfe7e548 Unify ad_cold 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6712876801 Unify ad_fire 2020-12-04 09:30:14 +02:00
Pasi Kallinen
cfd819f1c1 Unify ad_drli 2020-12-04 09:30:14 +02:00
Pasi Kallinen
518798d0d2 Unify ad_dren 2020-12-04 09:30:14 +02:00
Pasi Kallinen
6436ea1532 Unify ad_dcay 2020-12-04 09:30:14 +02:00
Pasi Kallinen
0d445a7a7c Unify monster-hits-monster 2020-12-04 09:30:14 +02:00
nhmall
f543763695 stairway save/restore bit
The logic surrounding stairway saves and restores should not be within
a block reserved for deliminating external file structure.
2020-12-03 10:05:31 -05:00
Pasi Kallinen
cf88808285 Fix stairs on oracle level bones
Recent change to the stairs structure now lets each stair keep
the destination level number and dungeon where the stairs go to.

When a level that can be on different depth (such as the Oracle)
became a bones level, and it was loaded in another game at different
depth, the stairs were still pointing to the old level number.

Save it as relative to the current level instead of absolute.
2020-12-03 16:38:20 +02:00
nhmall
a03cce0505 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-12-02 22:02:30 -05:00
nhmall
cfc4612338 correct coding typo: nx instead of ny
Prevented proper migration of obj dropped down the stairs.

Also, don't include your attached chain when counting drop impacts.
2020-12-02 21:59:26 -05:00
PatR
3e7283e8fd Qt fix for typing "#version"
The #version command is a leading substring of the #versionshort
command and for Qt, it couldn't be executed by typing, only via
mouse click or one of the Qt-specific menus.  #version<return>
or #version<space> now works for that.

The #versionshort command ought to be renamed to something else.
2020-12-02 16:11:53 -08:00
PatR
5e570b181f saving followup
If attempting to checkpoint when changing levels discovered that
the alock.0 or 123wizard.0 file was missing and the game was
running in wizard mode, play continued after reporting trickery
but screen updating was left disabled.  An early return in
savegamestateinlock() wasn't resetting the program_state.saving
flag to revert to normal screen updates.

I added a few return statements at the ends of void routines,
where they're optional, because it makes searching for early
returns easier.  (Without these then when no early return is
present between current point and end of routine, the search
would move past the routine looking for 'return' later in the
file.)

save_stairs() was placed in between saveobj() and saveobjchn()
so I've moved it.  (Has no effect on the recently reported stair
anomalies.)  It was also accumulating the total stairway data
size in 'len' and never using that for anything, so I got rid
of it.  (Ditto about anomalies.)
2020-12-02 14:49:09 -08:00
PatR
4d6a140d34 saving vs ball&chain
I started activating new program_state.saving and discovered that
saving of ball and chain could access freed memory.  The change
for the former and fix for the latter are mixed together here (but
easily distinguishable).

The saving flag inhibits status updating and perm_invent updating,
also map updating that goes through flush_screen().  That should
fix the exception triggered after an impossible warning was issued
during a save operation.  impossible() goes through pline() which
tries to bring the screen up to date before issuing a message.
During save, data for that update can be in an inconsistent state.

The code to save ball and/or chain when not on floor or in invent
(I think swallowed is the only expected case) was examining the
memory pointed to by uball and uchain even if saving the level had
just freed floor objects and saving invent had just freed carried
objects.  So for the usual cases, stale pointer values for uball
and uchain would be present and checking their obj->where field
was not reliable.
2020-12-02 06:29:58 -08:00
Bart House
1360e63644 Fix build issue when building project for the first time. 2020-12-01 21:32:52 -08:00
Pasi Kallinen
d79b5388ce Remove dealloc_obj b&c sanity checking 2020-12-01 22:18:48 +02:00
nhmall
2c19db61aa daily cron update doc/Guidebook.txt 2020-11-30 20:22:18 -05:00
PatR
516af11dc7 reduce the number of #seeXYZ commands
Noticed while working on Qt's extended command handling, there
are an awful lot of "seeXYZ" commands.  Keep the inventory display
ones (named versions of ')' to show wielded weapon(s), '[' for
worn armor, '"' for worn amulet, &c) and rename the others:
| #seenv     -> #wizseenv     debugging command
| #seespells -> #showspells   '+' command
| #seetrap   -> #showtrap     '^' command

Also, expand the descriptions of #shell and #suspend a bit in
the Guidebook.  LaTeX version is untested.
2020-11-30 16:16:14 -08:00
PatR
f8fcab3400 move 'g.restoring' to 'g.program_state.restoring'
Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place.  Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)

The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.

Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in.  Removes some trailing
whitespace in sfstruct.c too.

Only lightly tested...
2020-11-30 11:40:21 -08:00
Pasi Kallinen
30b59acc40 More wish tests 2020-11-30 15:07:44 +02:00
PatR
de8337f402 Qt extended commands
When responding to '#', the Qt interface puts up a grid of buttons
labelled with the names of commands.  Then if the user types
instead of clicking on a button, buttons which can no longer match
are removed rather than grayed out.  The remaining ones keep their
same relative positions.  Once whole rows or whole columns were
gone, it looked awful.  With rows gone, the size of the grid
shrank but the popup stayed the same size, so the one-line prompt
area expanded to fill up the vacated vertical space.  That caused
the prompt and partial response to move as they stayed centered in
their growing area.  With columns gone, the width of the buttons
in remaining columns expanded and they spread out to take up
vacated horizontal space.  Once the candidate commands were all
in one column, the buttons spanned the width of the grid.  (That's
mostly my fault due to changing the grid from being row-oriented
[a b c]
[d e  ]
to column oriented
[a d]
[b e]
[c  ]
which resulted in columns going away a lot faster and possibly down
to one when the old layout always had at least two.  But old layout
could drop to one row; the current layout always has at least two.)

Also, accept ^[ as ESC.  Typing ESC when partial input is present
kills that input but keeps prompting.  Typing ESC when no input
is present (none entered yet or a second of two consecutive ESCs)
cancels the operation.

Allow ^U to kill partial input.  If used when no input is present,
nothing happens, similar to backspace.  Unlike tty and curses, it's
hardcoded here.  That shouldn't be a problem because ESC can be
used as a substitute if ^U isn't what the player normally uses.
2020-11-30 03:18:45 -08:00
Pasi Kallinen
a8ed1ab5fd Test wishing "bags of tricks" 2020-11-30 12:06:37 +02:00
PatR
69dd0485fb Qt message window: horizontal scrolling
Multiple stints of flailing about without a clue finally led to
a breakthrough.  When writing a new message to the multi-line
message window, force the view back to showing the starts of
lines if player has scrolled it to the side and left it that way.
Put another way, if it has been scrolled to the right, scroll it
as far as possible back to the left.
2020-11-29 16:58:56 -08:00
Pasi Kallinen
74565c890d Split readobjnam into multiple functions
Also add several new tests for it
2020-11-29 19:08:30 +02:00
Pasi Kallinen
f2218839a3 Move some function names to start of line 2020-11-29 14:10:25 +02:00
PatR
df8e2dcd74 -Wshadow fix
Not caused by a hidden macro this time...

|mon.c:1549:10: warning: declaration shadows a variable in the
|      global scope [-Wshadow]
|    long flags = 0L;
|         ^
|../include/flag.h:392:29: note: previous declaration is here
|extern NEARDATA struct flag flags;
2020-11-28 20:15:30 -08:00
nhmall
0d6481ad8c spelling correction tidbit
Closes #415
2020-11-28 08:59:03 -05:00
Pasi Kallinen
fb188dc1aa Unify mfndpos monster movement flags 2020-11-28 12:49:18 +02:00
PatR
5361958bdc more "golem rust in peace"
Be prepared for life-saving to contradict "<mon> falls to pieces".
Purely hypothetically at present (with no plans to change) since
golems don't benefit from amulets of life-saving.
2020-11-28 02:19:28 -08:00
PatR
9ecbee4a4c remove unused variable from getobj() split
and do a bit of reformatting.
2020-11-27 17:59:46 -08:00
Pasi Kallinen
36d977f61f Unify HP loss and passing out from overexertion 2020-11-27 23:43:59 +02:00
PatR
daf1381cc2 autodescribe vs MSGTYPE
I was baffled about why moving the cursor across a fire elemental
kept putting up --More-- until I remembered that I once used
 MSGTYPE=stop "[Ff]ire"
to test Qt's handling for that.  Turns out that I left it in my
config file.  autodescribe feedback should not be honoring that;
honoring MSGTYPE=norepeat is not as clear-cut but this disables
it too.

User sounds were also kept enabled during autodescribe but I have
no way to test them.  Like norepeat, disabling just falls into
place.

The pline.c change is unrelated.  It just eliminates a wide line
(from adding 'g.') in the source by using a shorter variable name.
2020-11-27 11:10:44 -08:00
Pasi Kallinen
bbb3d35252 Unify enlightenment self-knowledgeable effect 2020-11-27 19:59:16 +02:00
Pasi Kallinen
2a7cb3c4b6 Split some parts of getobj into functions 2020-11-27 18:10:47 +02:00
PatR
bb9df368af fix github issue #401 - roast/rust/rot in peace
This tries to fix the problem of the extra message when a tame
golem is completely destroyed (paper or straw golem burned, iron
golem rusted, wood or leather golem rotted) being issued at odd
times.  I basically punted on the visibility aspect since the
original logic was strange:  you had to be able to see both the
attacker's and defender's spots and at least one of those two
monsters.  Now mon-attacks-mon visibility requires that you be
able to see one of the two and if you don't see both, the unseen
one will be referred to as "it".  The "may the iron golem rust
in peace" message is independent of that and may be displayed
after "you have a sad feeling", but now that's intentional and
will refer to an unseen pet by name or monster type, not "it".

This needs a lot of testing and hasn't attempted to address
issue #402:  only some attacks that should compeletely destroy
a golem actually do so.  (So a hit by fire elemental against a
paper golem does, but passive fire counterattack when a paper
golem hits a fire elemental doesn't, nor does a wand of fire
or being hit by Firebrand.)

Fixes #401
2020-11-27 02:38:17 -08:00
PatR
8d91a9f764 more options help
"Name of your starting pet when it is a kitten" could be
construed as meaning that it will no longer apply once the
kitten grows into a housecat.  Use "if" instead of "when".

The 'other settings' were in alphabetical order except for
"status condition fields" which presumably started out as
"condition fields".  Move it into proper place for current
description.
2020-11-26 18:47:45 -08:00
nhmall
7c91c76265 remove a comma at the end of an enumerator list 2020-11-26 15:48:56 -05:00
PatR
b2199840cd options help
Add a few missing options to dat/opthelp (without worrying about
"if FOO was set at compile time").  No doubt there are lots of
others still missing.

Reword a few options in dat/opthelp and also in the dynamic help
derived from optlist.h, particuarly catname, dogname, horsename
whose descriptions have always been confusing or maybe confused.
2020-11-26 12:00:00 -08:00
PatR
ec153a27bd options help
The revamped options handling was't doing dynamic help properly.
After listing the booleans, it listed them again amongest the
compound options.  Since their description field is Null, that
could be a big problem.  sprintf(buf,"%s",NULL) on OSX produces
"(null)" but most sprintf()'s would probably crash instead.

The 'other' options (autopickup exceptions, menucolors, &c) were
not listed at all.  (I don't remember whether that was also the
case before the revamp.)  Now they're listed but not explained.

The 'msg_window' description was unhelpful; this replaces it.
A couple of others were longer than necessary so they've been
shortened.  The rest of optlist.h is reformatting wide lines.

Recently added 'safe_wait' option was included in the Guidebook
but not in dat/opthelp; add it.
2020-11-26 02:20:00 -08:00
PatR
2db51cf8bd fix #K3016 - kicking a bag of gold in a shop
Kicking a container that had gold in it took the gold amount
away from hero's credit or added to hero's debt, then didn't
give a refund if the container and its gold landed within the
shop.  Throwing behaved likewise, just less verbosely.

The problem is caused by addtobill() treating gold specially
and then subfrombill() not being able to perform a reverse
operation.  Actually, it may be possible for subfrombill() to
do that, but verifying all its uses is too much work.  This
moves the gold handling for drop+selling into its own routine
and adds calls to that for the throwing and kicking refunds.
The other calls to subfrombill() outside of shk.c appear to be
ok as-is.  (The calls inside that file are the ones that still
need evaluation if the gold handling is to move to there.)

bill_dummy_object() now uses the same o_id assignment for its
dummy object as split_object() does for its new partial stack.
I don't know whether the old code led to any price glitches.
2020-11-25 14:33:14 -08:00
PatR
6df9ebc1af add Guidebook description of rogue level
This is in response to the bug report we got however long ago
about the map display breaking when the [unfamiliar to player]
rogue level was reached.  It probably wouldn't have helped back
then since the subset of players who read the documentation is
about same subset as those who expect the Spanish Inquisition.

I wasn't sure whether appending "'s" to an italicized word
should be italicized itself and made it revert to the regular
font instead.  That should be changed if it's incorrect usage.
2020-11-25 10:21:43 -08:00
PatR
dde70b8d4a Guidebook bit: ascii_map and tiled_map
|ascii_map:
|If NetHack can, it should display an ascii character map if it can.
|tiled_map:
|If NetHack can, it should display a tiled map if it can.

Remove the "if {NetHack,it} can" redundancy and expand a little bit.

Also, alphabetize "tiled_map" as if the underscore were a space
instead of something that happens to collate after letters.

As usual, the Guidebook.tex changes are untested.
2020-11-25 09:15:20 -08:00
nhw_cron
bc7947ed22 This is cron-daily v1-Jan-20-2020. files updated: Files 2020-11-25 11:10:05 -05:00
nhmall
cb5bda40e2 update an old msdos file 2020-11-25 07:53:24 -05:00
nhmall
d5d75a9e38 move an outdated file: sys/unix/README.linux 2020-11-25 07:27:25 -05:00