Commit Graph

13272 Commits

Author SHA1 Message Date
PatR
58bc545cc6 \#dotypeinv ('I') - show title for inventory subset
When asking for an inventory subset for one of the meta-classes that
can generate output which spans object classes (so B,U,C,X, and P),
insert a title at the start of the resulting inventory list.  (Iu and
Ix produce alternate output that already includes a title.)

Also, stop handling '$' differently for menustyles traditional and
combination from full and partial.  'I$' was running the '$' command
for the first two styles but just showing the inventory entry for
gold for the last two.  Change to the latter for all styles.
2022-04-10 06:52:39 -07:00
Pasi Kallinen
24d3c96c1d X11: set menu entries to same length
While testing the new mouse action menus, it was quite annoying
to try and hit some shorter entries. Make all the selectable entries
the same maximum length, and with text left justified.
2022-04-10 16:09:43 +03:00
Pasi Kallinen
a1f2000afd Fix castle engraving and scroll
Fixes #723
2022-04-10 14:30:58 +03:00
Pasi Kallinen
ec4fafcf53 Fix erroneous test_move params 2022-04-10 12:52:39 +03:00
PatR
593c3532fc more shop damage repair
Stop attempting to catch up for lost time for shop damage repair
when getlev() loads a previousl visited level.  Normal shopkeeper
behavior will take care of that.

Also, fixes the display related aspects of shop damage repair
interacting with ball and chain.  They don't happen when its done
while the map is being shown.
2022-04-09 15:55:21 -07:00
PatR
dadbea1d8c preliminary fix for github issue #726 - restdamage
Reported by entrez, restoring a saved game runs the shop wall/floor
damage repair routine.  It was taking place before attached ball
and chain were fully restored so the repair routine treated them as
ordinary objects if they happened to be in a wall gap that gets
fixed on the same turn as restore takes place.  They could end up
being moved to a spot that's too far from the hero and then trigger
an impossible "b&c distance".

This restores ball and chain before shop damage repair takes place
so the repair routine deals with them sanely and the impossible won't
occur any more.  However, the repair still happens before the current
level's map has been displayed and that looks pretty strange during
the shopkeeper's message.  Also, if the hero and the ball start on
opposite sides of the gap, after the gap is repaired the ball will
still be shown as a remembered object at its old spot even though it
ends up being located at the hero's feet.

Closes #726

but more work is needed...
2022-04-09 12:02:30 -07:00
PatR
ea15bc05ec formatting attached ball and chain
When punished, the ball gets formatted as
| heavy iron ball (chained to you)
but the chain was just "iron chain".  Since iron golems leave some
of those behind, doname() shouldn't just assume that you know which
chain is locked to your leg.  Change the formatting for uchain to
| iron chain (attached to you)
2022-04-09 11:45:43 -07:00
PatR
daadb53ec0 refine setworn()'s impossible()
If setworn() issues "Setworn: mask = 1234.", format the number in
hexadecimal so that the high bits are easier to decipher.  Noticed
when experimenting with ball and chain where the decimal values of
their worn-masks are beyond the range of powers of 2 I recognize.
2022-04-09 11:40:47 -07:00
nhmall
6670c31f90 try CI build with mingw-w64 release 5 2022-04-09 13:52:41 -04:00
PatR
d52e6732a8 fix github issue #722 - unique monster's corpse
Issue #722 posted by copperwater and commented on by Entrez:  both
shk_your() and the() inserted "the" in front of a unique monster's
corpse, yielding "the Lord Surtur's corpse glows iridescently" and
"the Lord Surtur's corpse drops to the floor."

Teach both of those routines to skip "the" when used for monsters
with personal names.  It now omits "the" for "Medusa's corpse" but
still gives "the Oracle's corpse".

shk_your() operates on an object and can deal explicitly with corpses
of named monsters.  the() operates on text and has to guess whether
it is being used in a similar situation.  Right now the guess is just
"is there an apostrophe present?" and might need further refinement.

Fixes #722
2022-04-09 10:15:34 -07:00
Pasi Kallinen
e53a4c0abd Context sensitive item usage from inventory
Allow selecting an item from inventory and show a menu of actions
applicable for that particular item. Some of the entries might
be slightly spoilerish (eg. it'll reveal that you can read T-shirts),
but the improved usability for new players is more than worth it.

Generally known as "item actions", this was first implemented
in AceHack by Alex Smith.
2022-04-09 15:28:23 +03:00
PatR
dde1ae2e9b prayer timeout bit
It was theoretically possible to reduce prayer timeout by angering
your god.  I'm not sure whether that could actually happen but add
code to avoid it.
2022-04-08 14:48:55 -07:00
PatR
bd7ed0d343 pull request #725 - detecting mimic as statues
Pull request from entrez makes object detection of statues that are
actually mimics show the statue's monster type instead of always
depicting tengus.

Fixes #725
2022-04-08 10:23:54 -07:00
Michael Meyer
6bf7ba991f Fix: object detection vs mimic statue disguise
Cursed potions of object detection were showing all mimics disguised as
statues as 'i' glyphs, because object_detect used PM_TENGU as the
corpsenm of any mimic disguise.  Instead, use MCORPSENM when available
so that hidden mimics will be mapped with glyphs corresponding to their
actual disguises.
2022-04-08 10:22:14 -07:00
PatR
12185138d2 fixes entry for pull request #724 - fountain \
detecting monsters when none are present

Give some feedback for monster detection if drinking from a fountain
fails to find any monsters.  Potion or spell gives "strange feeling"
feedback in that situation but fountain didn't report anything.

Fixes #724
2022-04-08 10:14:44 -07:00
Michael Meyer
bf53ff9de5 Add message for failed fountain monster detection
When the fountain quaffing monster detection effect was triggered on a
level without any monsters, no message would be printed.  I think this
was the only scenario where drinking from a fountain wouldn't print
anything, so it stood out as unusual.

Print a messsage in the case monster detection fails, to make it
consistent with other fountain effects and ensure it's clear the hero
did still drink from the fountain on that turn.  I used "the water
tastes like nothing" for the (sort of tenuous) connection to there being
nothing living on the level, but there might be a better message to put
in there.
2022-04-08 10:11:20 -07:00
PatR
10d676d274 pull request #721 - reset xstart,ystart
Prevent inconsistent data for #wizloadlua.

Closes #721
2022-04-08 10:06:06 -07:00
copperwater
99715e005f Make sure xstart and ystart are always zero when not in_mklev
Running #wizloadlua to run Lua scripts that use coordinates in any way
would work differently if you were on certain levels for the first time
versus leaving and returning to them. This is because various bits of
level creation routines can leave xstart and ystart set to non-zero
values, which are then zeroed at some point when leaving and returning
to the level.

Since xstart and ystart are only relevant to level creation and lua
commands, this fixes the problem by zeroing them after leaving mklev
routines. (Saving them with the level doesn't work because xstart and
ystart are relative to the last used des.map, of which there could be
multiple, e.g. in Asmodeus's level or if two map-based themed rooms
happen to generate. I can envision a more complex solution in which
every des.map used in the level can be associated with an identifier,
whose xstart and ystart are saved for use by later post-level-creation
lua scripts, but currently I just want to make them consistent between
level visits.)
2022-04-08 10:05:43 -07:00
PatR
835a4e78f5 pull request #720 - specifying monster gender \
in lua code was ignored

I'm taking this one on faith....

Fixes #720
2022-04-08 10:03:42 -07:00
copperwater
d196b37b39 Fix: monster gender could not actually be specified in lua files
Noticed when I tried to create a male monster of a species that permits
both males and females (i.e. not a single-gender or neuter species),
half the time the monster ended up female anyway. This was because
get_table_montype picks a random monster gender for such species, and
lspo_monster just sets it to that, making it impossible to deliberately
have a monster of a certain gender.

This fixes that by defaulting the "female" table argument to random
instead of false, and then checking to see whether the level file set it
to something other than random. If so, it uses that value.

I debated whether this should allow a level designer to make a monster
of a gender that conflicts with their species, such as a male nymph, but
erred on the side of respecting the species. So attempting to specify a
male nymph, etc. will still result in a female one.
2022-04-08 10:03:42 -07:00
Pasi Kallinen
093f7452af Some more therecmdmenu
If on, therecmdmenu handles clicking anywhere on the map,
not just on or next to hero.  Add throwing items to the menu.
2022-04-08 19:48:01 +03:00
PatR
8094a59abb pull request #714 - dosacrifice() change
Move some #offer code into a separate routine to eliminate one 'goto'.

Closes #714
2022-04-08 09:41:27 -07:00
SHIRAKATA Kentaro
8497b1c8ec Separate function for offering too soon 2022-04-08 09:39:30 -07:00
PatR
81a4c2ed4c aligned cleric corpse
I was looking into "The Lord Surtur's corpse" and got side-tracked by
something else:  move a priest hack for avoiding "aligned" in a corpse
description from corpse_xname() to obj_pmname().  The old variation
always picked "priest corpse" over "priestess corpse".  The new one
will use either one of those if the corpse is flagged as such, or use
"cleric corpse" (avoiding "aligned cleric corpse") if it's flagged as
random.
2022-04-08 00:35:13 -07:00
Pasi Kallinen
77cf464836 Add chat and offer to herecmdmenu 2022-04-07 18:06:31 +03:00
Pasi Kallinen
10fd0deab2 When levitating, hide drink and dip from herecmd_menu 2022-04-07 16:44:16 +03:00
PatR
9da36fb03e some options handling cleanup
Hide 'altkeyhandling' from the 'O' menu for !WIN32 builds.  If
present in run-time config file it will be parsed and then ignored.

Instead of showing "unknown" for the value of the 'hilite_status'
compound option, show "none" if there are no highlighting rules, or
a pointer to other option "status highlight rules" when there are.

Deal with a few function parameters that are used for some
combination of build-time config settings and unused for others.
2022-04-06 12:08:58 -07:00
PatR
6d490de39c warning fix
Remove redundant 'if (K)' from there_cmd_menu().  The !K case doesn't
get there and that test's presence fools the compiler (oldish clang)
into warning that 'npick' might be used uninitialized.
2022-04-06 12:06:47 -07:00
Pasi Kallinen
eb9c7d77d4 Improve therecmdmenu
Turning on herecmd_menu and clicking with mouse is now actually
somewhat playable.
2022-04-06 21:23:27 +03:00
PatR
b7d9bed8c5 X11 build fix
The X11 interface wouldn't build if STATUS_HILITES was disabled.
Failure was due to post-3.6.x changes.
2022-04-06 11:18:51 -07:00
PatR
1b4ad3c30d fixes entry typo 2022-04-06 00:41:22 -07:00
PatR
8aa48ecd91 'O' vs msg_window option
Change 'O's sub-menu for selecting new msg_window option setting to
work similar to the one for menustyle:  show a description of what
the values mean with a two-line, two-column menu entry.  Also make
its current value be pre-selected.

msg_window is a bit more complicated than menustyle because only
some interfaces support it and curses only supports two of the four
choices.  It currently has one hard-coded reference to "^P" (in the
tty-specific 'combination' choice).  Changing that is feasible but
seems like more trouble than it'd be worth.
2022-04-05 13:35:23 -07:00
Pasi Kallinen
e260c9ded5 Fix mouse travel and look
Looks like I broke mouse travel and clicklook a while back, and
no-one noticed...
2022-04-05 15:03:20 +03:00
PatR
47cef18a9b life-saved, while helpless
Implement the suggestion by entrez to avoid "while helpless" in the
reason for the second death if hero gets killed, life-saved, and
killed again at the same time.  Life saving sets 'multi' to -1 which
prevents the hero from moving again until next turn and is intended
to make the sequencing of "you survived that attempt on your life"
work if you're being interrupted during some multi-turn activity.

It used to behave differently when the first death occurred while
engaged in some voluntary multi-turn activity.  I've removed that
because I couldn't figure out why; it might need to be put back.
2022-04-04 10:20:28 -07:00
nhmall
303e34e5c6 clear a warning: variable set but not used
makedefs.c:2125:12: warning: variable 'sum' set but not used
[-Wunused-but-set-variable]
    int i, sum = 0;
           ^
    1 warning generated.
2022-04-04 10:35:43 -04:00
Pasi Kallinen
16d813b44a Give a message when stinking cloud is created on top of hero 2022-04-03 20:43:04 +03:00
Pasi Kallinen
92c21b588b Ask to kick a locked door open, if hero has no unlocking tool 2022-04-03 13:58:50 +03:00
PatR
4721ae7154 menuitem_invert_test() comment clarification 2022-04-03 01:32:59 -07:00
Pasi Kallinen
565a3cf0a9 Reverse the unique requirement 2022-04-03 08:55:09 +03:00
nhmall
e74f3c607a Windows build test with Visual Studio 2022 17.1.3 2022-04-02 13:45:04 -04:00
Pasi Kallinen
38a6cee1ab Don't pacify unique monsters when untrapping them from web 2022-04-02 19:38:50 +03:00
Pasi Kallinen
6977aef436 Fix stuck travel for good
My fixes to the travel stuck oscillation did not fix all of them,
and I've even seen a 3-step loop - which my fixes cannot detect.
I guess there could be arbitrary-sized loops too.

To definitely fix this, keep track of all the map locations travel
has moved the hero through, and if it tries to go on a location already
used, stop travel and give the unsure -message.
2022-04-02 18:27:53 +03:00
PatR
fd355d6f6c tty logic error using menuitem_invert_test()
menuitem_invert_test() is intended for invert-all/invert-page/
select-all/select-page but was being called for group accelerators.
In the #wizidentify menu, the 'all' choice specifies ^I as a group
accelerator but that stopped working on tty when it recently became
flagged as skip-invert.
2022-04-02 01:00:09 -07:00
PatR
eea362249c wishing for artifacts
Use 'fuzzymatch(,," -",)' when checking whether the name specified
in a player's wish text matches an artifact name so that extra or
omitted spaces and dashes are ignored.  Wishing for "firebrand" will
yield "Fire Brand" and "demon bane" will yield "Demonbane".
2022-04-02 00:28:48 -07:00
nhmall
d7630ebff8 make zip file contents pathless for msdos pkg 2022-04-01 16:11:30 -04:00
PatR
b1f8c3d5c1 wishing for flint
Allow wishes for quantity up to 20 to be granted when asking for
flint.  Like rocks, flints are mainly useful as sling ammo.

Also, remove the hardcoded assumption that globs weigh 20 when wish
handling computes glob weight based on user-specified count and/or
relative size.
2022-04-01 10:53:19 -07:00
PatR
62bc0c846c glob rot - replace misspelled dissipates with \
dissolves

"The glob of <type> dissippates completely" was misspelled.  Instead
of just fixing the spelling, switch to a different term since
dissipate is also being used for gas clouds and globs aren't gaseous.
2022-04-01 10:47:25 -07:00
PatR
66a64eaf83 pull request #718 - fix 'petrified' typo
Pull request from vultur-cadens to fix a recently introduced typo.

Closes #718
2022-04-01 10:03:37 -07:00
vultur-cadens
3de34c83fe fix "pertrified" typo 2022-04-01 10:02:49 -07:00
PatR
575b76afc3 sengr_at() schizophrenia
sengr_at() is used as a boolean, declared as int, and returns FALSE
if there is no engraving present.  Change the declaration to boolean.

Also, using fuzzymatch() without any list of ignorable characters
just to get case-insensitve matching didn't make sense so switch to
strcmpi().
2022-04-01 05:22:20 -07:00