PatR [Sat, 5 Dec 2020 20:29:38 +0000 (12:29 -0800)]
readable conical hats
Let tourists read cornuthaum ("WIZZARD") and dunce cap ("DUNCE").
One out of three will have those words, the other two will yield
"you can't find anything to read on this ___" where ___ is either
"conical hat" or "cornuthaum" or "dunce cap" depending upon hat
type and discovery status.
Even when a dunce cap says "DUNCE" it won't become discovered,
just offer the player an opportunity to apply a name.
Other roles still fall through to the "That's a silly thing to
read" feedback.
PatR [Fri, 4 Dec 2020 10:58:03 +0000 (02:58 -0800)]
couple more command tweaks
Rename "seegold" to "showgold". The character to invoke it ('$')
is similar to those for the various "seeXYZ" commands ('[','=',&c)
but unlike them, it isn't part of "seeall" ('*').
Expand or replace the one-line description of several commands
(shell, showgold, showtrap, suspend, versionshort).
Pasi Kallinen [Thu, 3 Dec 2020 14:38:17 +0000 (16:38 +0200)]
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.
PatR [Thu, 3 Dec 2020 00:11:53 +0000 (16:11 -0800)]
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.
PatR [Wed, 2 Dec 2020 22:49:09 +0000 (14:49 -0800)]
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.)
PatR [Wed, 2 Dec 2020 14:29:58 +0000 (06:29 -0800)]
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.
PatR [Tue, 1 Dec 2020 00:16:14 +0000 (16:16 -0800)]
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.
PatR [Mon, 30 Nov 2020 19:40:21 +0000 (11:40 -0800)]
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.
PatR [Mon, 30 Nov 2020 11:18:45 +0000 (03:18 -0800)]
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.
PatR [Mon, 30 Nov 2020 00:58:56 +0000 (16:58 -0800)]
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.
PatR [Sun, 29 Nov 2020 04:15:30 +0000 (20:15 -0800)]
-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;
PatR [Sat, 28 Nov 2020 10:19:28 +0000 (02:19 -0800)]
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.
PatR [Fri, 27 Nov 2020 19:10:44 +0000 (11:10 -0800)]
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.
PatR [Fri, 27 Nov 2020 10:38:17 +0000 (02:38 -0800)]
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.)
PatR [Fri, 27 Nov 2020 02:47:45 +0000 (18:47 -0800)]
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.
PatR [Thu, 26 Nov 2020 20:00:00 +0000 (12:00 -0800)]
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.
PatR [Thu, 26 Nov 2020 10:20:00 +0000 (02:20 -0800)]
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.
PatR [Wed, 25 Nov 2020 22:33:14 +0000 (14:33 -0800)]
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.
PatR [Wed, 25 Nov 2020 18:21:43 +0000 (10:21 -0800)]
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.
PatR [Tue, 24 Nov 2020 18:43:12 +0000 (10:43 -0800)]
wizard mode buglet: simultaneous Lev+Fly timeout
Noticed while working on Qt status highlighting: if levitation
and flying timed out at the same time, first Lev timeout called
float_down() which reported
You have stopped levitating and are now flying.
and then Fly timeout left stale "Fly" on the status line due to
an optimization which got subverted. ('was_flying' flag was
False due to Fly being blocked by Lev; that's correct behavior,
but the flag is effectively a cached value that becomes stale
when the Lev timeout code executes.)
The bug was wizard mode only because #wizintrinsic is the only
way to get timed flying.
PatR [Tue, 24 Nov 2020 17:45:55 +0000 (09:45 -0800)]
today's Qt status update: non-standard conditions
Qt's status highlighting was treating any change to hunger or
to encumbrance as "worse" (shown in red). That's wrong if you
go from weak to just hungry or from stressed to encumbered.
Comparing satiated with other hunger states is tricky. I've
ranked it between hungry and weak but that's fairly arbitrary.
Also, change the highlighting when Lev, Fly, and Ride are new
conditions from red to blue.
Pasi Kallinen [Tue, 24 Nov 2020 17:26:12 +0000 (19:26 +0200)]
Fixes and sanity checks for monster undetected and trapped states
Adds sanity checks for mtrapped and mundetected states.
Fixes cases where those were left in wrong state.
1. Trapped monster (eg. a nymph) teleported out of a trap
2. Monster was hiding under ball or chain, which then got removed
3. While restoring a level, a zombie corpse revived while monster
was hiding under it
4. A general case where the only object was deleted off floor and
a monster was hiding under it
Monsters hiding under ball or chain will now get revealed when
the b or c are moved.
PatR [Tue, 24 Nov 2020 01:45:44 +0000 (17:45 -0800)]
Qt status: highlights when toggling 'showexp'
During status update at the time the 'showexp' option gets toggled
on or off, prevent comparing Xp (level) against Exp (points) when
deciding whether the value has gone up or down. Xp/Exp (when
toggling on) or just Xp (when toggling off) will be highligthed in
blue (changed, neither better nor worse) rather than green or red.
PatR [Tue, 24 Nov 2020 01:39:00 +0000 (17:39 -0800)]
Qt font selection dropdown menu
In "Qt settings" (or "Preferences" for OSX), the current font size
would show "Medium" if that was the current setting. So far, so
good. However, if you clicked on the up/down arrows to get the
dropdown menu, it was truncated to "Mediu" there regardless of
current setting. Force the menu to be wide enough to show "Medium".
PatR [Mon, 23 Nov 2020 09:29:53 +0000 (01:29 -0800)]
Qt status again: unhighlight disabled fields
If 'showscore' has been On and gets toggled Off while Score is
highlighted, remove that highlight immediately instead of letting
it stick around a few turns until it times out.
PatR [Sun, 22 Nov 2020 10:36:10 +0000 (02:36 -0800)]
Qt paperdoll bit
For the tool tips shown if you let the mouse pointer hover over
any of the cells in the paperdoll (inventory subset showing
worn and wielded items), remove the trailing period and add a
leading space and a trailing space. Improves readability.
PatR [Sun, 22 Nov 2020 09:10:52 +0000 (01:10 -0800)]
Qt status bit
When Qt highlights a field that has gotten better, use the same
shade of green as is used for the green range of hitpoint bar.
The old value was too dull, like olive green seen in shadow.