Commit Graph

17046 Commits

Author SHA1 Message Date
nhmall
4353ee49d8 sed substitution went too far (wasm cross-compile)
Also, link with hacklib
2024-07-28 12:27:02 -04:00
PatR
2d68ee8f9f fix #K4210 - vampshifter fog clouds
Messaging for vampires changing into fog clouds was inconsistent
in 3.6.x but already fixed in to-be-3.7.

However, maintaining an extra set of shape change messages (one
in newcham(), the other in vamp_shift() which turns out to only be
used when a vampshifter turns into a fog cloud in order to pass
under a closed door) was a nuisance.  Redo vamp_shift() to use
newcham() feedback.  Update that feedback to be accessibility-aware
and also to use "Your <mon>" instead of "The <mon>" when appropriate.

While in there, remove a couple of trailing spaces and eliminate
use of one dynamically constructed format string that necessitated
warning manipulation.
2024-07-27 14:49:17 -07:00
PatR
5adabc07a3 missing comment: YMonnam() variant of x_monnam()
YMonnam() was added three weeks ago but the comment preceding
x_monnam() didn't get updated to list it.
2024-07-26 14:53:33 -07:00
nhkeni
c1d18e03ea add checksum for lua 5.4.7 2024-07-26 15:59:16 -04:00
nhkeni
3913cebdb4 make "make fetch-lua" handle multiple lua versions 2024-07-26 14:47:16 -04:00
PatR
d963c6dd6f github issue #1263 - lich attacks
Issue reported by loggersviii:  monsters killed by liches can
produce corpses which auto-revive as zombies, but liches aren't
able to harm zombies and get stuck in an endless slap fight when
those revive.

Liches have a touch attack for cold damage and they have a spell
casting attack.  They don't use their spell attack in monster vs
monster combat, so cold resistant foes don't receive any damage.
Prevent them from becoming harmless by changing the cold damage to
physical damage if the target resists cold.

Fixes #1263
2024-07-24 11:01:23 -07:00
nhmall
faca234055 follow-up for dig_check changes
Use the is_hole() macro to cover off holes and trapdoors.
2024-07-23 16:22:30 -04:00
PatR
b08fb9fb93 github issue #1262 - #terrain vs gas regions
Issue reported by elunna:  none of the display choices for #terrain
offered a way to show the terrain beneath temporary gas/cloud
regions (except "full map" in wizard mode or explore mode).  That
prevented the command from being used to find stairs and portals
which had been mapped before becoming covered up.

Adding extra menu choices to deal with visible regions would result
in #terrain becoming a mess.  Instead, treat regions as if they were
traps.  Picking a choice that includes traps will show region spots
which are in view as cloud or poison cloud, picking one that excludes
traps will show the underlying terrain.  Region spots which aren't
within view are handled the same as before:  whatever the hero
remembers at their location gets displayed.

The default menu choice excludes traps so will display stairs that are
covered by gas cloud regions, but not portals, same as when no regions
are present.  When showing traps and one is covered by a gas cloud,
the trap will be shown rather than the gas cloud, making it possible
to see known portals.

At the moment the new "#terrain handles regions like traps" feature
hasn't been documented anywhere.  That might get rectified someday.

I'm not sure whether trap detection ought to also detect regions now.
This doesn't attempt to tackle that and I think that I'll pretend
that the idea never occurred to me.

'parnoid_confirm:traps' definitely ought to prompt for confirmation
when entering a visible harmful region.  This doesn't add that.

Bonus fix:  it's possible for a visible region to cover up a not yet
explored location.  Searching next to such a spot wasn't changing the
spot to be marked as explored (unless hero was blind).  Now it will.

Fixes #1262
2024-07-23 10:40:28 -07:00
nhmall
082671ab0d follow-up for digcheck_fail_message() 2024-07-23 10:51:42 -04:00
nhmall
906813f0b2 fixes update
Closes #1245

Previous commit had a typo of 1254 in the reference
2024-07-23 01:11:04 -04:00
nhmall
d5785f287e GitHub issue #1254
> If there's a trap on a no-dig level, the floor beneath it will always be "too hard to dig into", making it impossible to remove the trap.
>
> As you can still dig pits in these levels (just not holes), the floor under the trap itself resisting to become a pit seems inconsistent.
>
> Steps to reproduce:
>
> Go to no-dig level like Mine's End
> Make a trap
> Dig a pit next to it -> works
> Dig on the trap -> does not work

Return more information about the dig_check() results to caller (was
just a boolean).

Move the messaging that was in dig_check() into a separate
digcheck_fail_message() function that uses the expanded return
information.

Resolves #1254

.
2024-07-23 01:06:24 -04:00
PatR
dfa9d9df3c untested Guidebook.tex fix
A recent change accidentally put a dash where a hyphen (default
value for S_golem) is intended.  I'm not sure whether verbatim is
necessary here, but it ought to work.
2024-07-19 15:34:38 -07:00
PatR
75561da3be zillionth comment typo fix
Plus a bit of reformatting where extending "static" to "staticfn"
on the first segment of a would-have-wrapped line made the other
segment(s) no longer line up.
2024-07-17 13:33:22 -07:00
PatR
5f36d47110 Guidebook.mn comment
"\(ah" transposed the letters; should have been "\(ha", matching
the actual usage on the same line.  Also, the reference to
"circumflex accent" wasn't appropriate since that's the small
caret you get with "^" or "\^".
2024-07-17 07:37:19 -07:00
nhmall
a7240f8689 update tested versions of Visual Studio 2024-07-17 2024-07-17 10:02:25 -04:00
nhmall
e44bfe4eb2 fix sentence structure in Guidebook.tex
Commit 59fbffd1 neglected to include the closing ')'
2024-07-17 08:13:11 -04:00
nhmall
afe0d03678 fix Guidebook.tex 2024-07-17 08:00:46 -04:00
PatR
474edb46f8 more Guidebook map characters
Previous update left out a couple of classes of monsters that are
represented by punctuation.  <space> for ghosts is deliberately not
included.
2024-07-16 19:48:10 -07:00
PatR
59fbffd170 Guidebook update: "Map (rest of screen)"
The description of the default map display was out of date:

Sinks aren't conditional anymore, and were changed from '#' to '{'.
Statues were still listed as '`' but aren't displayed as that.
Room and corridor engravings weren't mentioned.
Wall of water and wall of lava weren't mentioned.
Drawbridge portcullis ('#' when closed) and span ('.' when open)
weren't mentioned.

This splits introductory "- and |" into two entries.

I've forced CR font (similar to TeX's tt font) for the initial
character of all the entries.

The formatting of letters for monsters left something to be desired
so I've tried to redo it.  The 'roff edition seems ok (as least when
there's no page break in the middle of it) but I'm not sure how the
LaTeX version will fare.  I didn't try to include the trailing "and"
on the first two lines the way the 'roff version does since I wasn't
sure how to accomplish that.
2024-07-16 14:49:34 -07:00
PatR
ce206b813f a couple more monst food bits
Fix misleading indentation that the polyfood() macro inherited from
the misformated polyfodder() macro.

Fix a case where a non-pet monster would avoid eating a cockatrice
corpse but would eat Medusa's corpse.
2024-07-16 00:01:43 -07:00
PatR
64f6ae6d19 github pull request #1184 - polyfood()
Pull request from entrez:  rename polyfodder() to polyfood() and
use it instead of is_shapeshifter() when deciding whether a pet will
avoid eating a corpse or an egg because of the risk of polymorphing.

The PR was in response to issue #1183 by Umbire:  pets that avoid
eating shapechanger corpses didn't avoid genetic engineer corpses.

polyfodder()/polyfood() includes genetic engineer corpses because
they have an attack for AD_POLY damage.  But pets weren't caring
because is_shapeshifter() doesn't include that.

There's no particular need to rename polyfodder() to polyfood() but
I've used the PR as-is instead of reversing the name change.

Closes #1184
Closes #1183
2024-07-15 23:45:53 -07:00
Michael Meyer
b363b702d7 Make pets unwilling to eat all polyfood() corpses
The previous is_shapeshifter() test meant that pets were still perfectly
willing to eat genetic engineer corpses and be polymorphed.  Use
polyfood() instead.

Fixes #1183.
2024-07-15 23:42:29 -07:00
Michael Meyer
d09a5beab3 Rename polyfodder() to polyfood()
'Polyfodder' is already a term frequently used by players to describe
items which are useful to hang on to specifically to zap polymorph at
(for example, extra unicorn horns, which can be turned into magic
markers).  Using it as the name of a macro which tests whether a food
item will polymorph the creature consuming it is somewhat confusing, and
I think 'polyfood' is a lot clearer.
2024-07-15 23:42:29 -07:00
PatR
61affaed37 fix #K4202 - O/mO for prompted values treated \
player's input as a comma-separated list of option:value settings

Several compound values that aren't amenable to menus prompt for a
line of input and pass it to parseoptions() as if it came from the
run-time configuration file.  That shouldn't be treating commas as
option separators.

The fix is trival, at least for handling the text properly without
introducing new warnings to complain about rejections.  Some options
notice an unwanted comma and complain, others don't notice and the
extra text gets ignored.
2024-07-15 13:13:01 -07:00
PatR
1dc9f7324a fix #K4201 - bhitpos is clobbered by lookat()
The look-at-screen code was setting bhitpos before calling
look_at_monster() but that hasn't been needed for around 25 years.
Fix is trivial.

However, having such a low level routine as show_glyph() call
do_screen_description() seems like a recipe for trouble.
2024-07-14 11:24:49 -07:00
PatR
e3b2fd1818 pull request #1260 - move throwit() cleanup to \
separate function

Pull request from argrath:  remove most goto's from throwit().

Closes #1260
2024-07-13 19:39:48 -07:00
SHIRAKATA Kentaro
82e6eacfbb split returning from throwit() into separate function 2024-07-13 19:38:23 -07:00
nhmall
0eb7f109e0 follow-up, program_state 2024-07-13 16:31:35 -04:00
PatR
72d2b0414c fix github issue #1257 - nymph theft while blind
Issue reported by Meklon2007:  some theft feedback during nymph
attacks refers to the attacker as "she" and others as "it" if hero
is blind.

The "she" references are intentional.  However, mixing them with
"it" references when a series of messages occurs is jarring.  This
changes "it" to "someone", which is still different from "she" but
hopefully enough less so to be tolerable.

That resulted in monkeys also being referred to as "someone" because
they're classified as humanoid.  Change x_monnam()'s AUGMENT_IT
handling, which chooses between "someone" and "something" when the
monster is not seen, to override humanoid for animals (affects 'Y'
class) and for mindless (affects zombies, mummies, and golems).
So an unseen monkey will be "it" again.

The final message for current item was relying on a cached monster
name value.  If an unseen nymph or monkey stole a worn blindfold
so that hero's vision was restored:  "It <stole> item" before the
changes and "Someone|Something <stole> item" after.  So update the
cached name if sight gets regained, to give "<Mon> stole <item>."
(If the item is worn armor and the thief is a nymph, it was and
still is "She stole <item>".)

The message for having any worn item be stolen, which got split
into two parts within the past year, was giving "<Mon> takes off
<alt weapon>".  When not dual-wielded, the alternate weapon isn't
really worn.  Rather than suppress it outright, change the message
for uwep/uswapwep/uquiver to say "disarms" instead of "takes off".
For accessories, change "takes off" to "removes".  Those are more
or less interchangeable these days but "removes" matches R instead
of T.

While testing, my pet evidently killed a nymph (I was blinded and
couldn't see it happen) while she stole my gloves and the next
message I got was "You finish taking off your suit."  The gloves
weren't worn anymore so equipname() defaulted to suit.  Get rid of
equipname() altogether and switch to armor_simple_name() which
doesn't rely on the worn-armor pointers.

Fixes #1257
2024-07-13 12:30:59 -07:00
nhmall
6c0ae092c6 distinguish global variables that get written to savefile
The g? structs had a mix of variables that were written to
the savefile, and those that were not.

For better clarity and to distinguish those that end up in
the savefile, relocate some g? variables that get written
directly to the savefile into different structs.

This updates EDITLEVEL, although technically it probably
didn't need to, since savefile contents are not changing.

Details:

    gb.bases            -> svb.bases
    gb.bbubbles         -> svb.bbubbles
    gb.branches         -> svb.branches
    gc.context          -> svc.context
    gd.disco            -> svd.disco
    gd.dndest           -> svd.dndest
    gd.doors            -> svd.doors
    gd.doors_alloc      -> svd.doors_alloc
    gd.dungeon_topology -> svd.dungeon_topology
    gd.dungeons         -> svd.dungeons
    ge.exclusion_zones  -> sve.exclusion_zones
    gh.hackpid          -> svh.hackpid
    gi.inv_pos          -> svi.inv_pos
    gk.killer           -> svk.killer
    gl.lastseentyp      -> svl.lastseentyp
    gl.level            -> svl.level
    gl.level_info       -> svl.level_info
    gm.mapseenchn       -> svm.mapseenchn
    gm.moves            -> svm.moves
    gm.mvitals          -> svm.mvitals
    gn.n_dgns           -> svn.n_dgns
    gn.n_regions        -> svn.n_regions
    gn.nroom            -> svn.nroom
    go.oracle_cnt       -> svo.oracle_cnt
    gp.pl_character     -> svp.pl_character
    gp.pl_fruit         -> svp.pl_fruit
    gp.plname           -> svp.plname
    gp.program_state    -> svp.program_state
    gq.quest_status     -> svq.quest_status
    gr.rooms            -> svr.rooms
    gs.sp_levchn        -> svs.sp_levchn
    gs.spl_book         -> svs.spl_book
    gt.timer_id         -> svt.timer_id
    gt.tune             -> svt.tune
    gu.updest           -> svu.updest
    gx.xmax             -> svx.xmax
    gx.xmin             -> svx.xmin
    gy.ymax             -> svy.ymax
    gy.ymin             -> svy.ymin

Related note:
There are some pointer variables that are heads of chains that were not
moved from 'g?' to 'sv?', because they are not actually written to the
savefile directly, but the objects/monst/trap/lightsource/timer in the
chains they point to are. That can be changed, if desired.
Examples: gi.invent, gm.migrating_objs, gb.billobjs, gm.migrating_mons,
          gf.ftrap, gl.light_base, gt.timer_base
2024-07-13 14:57:50 -04:00
PatR
0e4083153c another EDITLEVEL increment
Since save and bones files just got clobbered, make another clobbering
change.  The 'queuedpay' field added to shop's ESHK(shkp)->bill[] was
replaced last week by a similar field in the transient itemizing bill.
At the time, the old field was left in place to avoid incrementing
EDITLEVEL.

shkp->mextra->bill[] is saved and restored, so its queuedpay field was
too.  Eliminate that no longer used field.

Unrelated:  bill[]->useup is declared as boolean but being assigned 1
or 0.  Change the assignments to use TRUE or FALSE.
2024-07-11 10:22:40 -07:00
Patric Mueller
b844632dfd bump EDITLEVEL for 0447a1f10
Commit 0447a1f10 accidentally broke save compatibility.
2024-07-11 16:35:24 +02:00
PatR
0b30a7b18a farlook vs "wall of lava"
Implement a couple of missing bits for wall of lava terrain.  It was
immune to being distorted by hallucination, unlike molten lava and
wall of water.  And the presence of wall of lava made molten lava,
after being shortened to "lava", no longer be listed as something
represented by the "}" character.

I started to renumber S_water, which would eliminate some hackery
from farlook's do_screen_description(), but that will require an
EDITLEVEL increment and make it necessary to reorder/renumber the
corresponding tiles so I stopped short.

This adds NHDT tags to the first line of defsym.h.
2024-07-09 15:49:48 -07:00
PatR
a59cd71540 nowrap_add() vs final score
The old nowrap_add() had different semantics from its replacement,
performing an assignment as well as an addition.  Now just does
the addition; its caller needs to perform the assignment.
2024-07-09 12:42:45 -07:00
Pasi Kallinen
cf44c3046e Join wall spines with walls of water and lava 2024-07-09 18:08:19 +03:00
PatR
ee08c05e03 quest leader|guardians seeing hero attack peaceful
If the quest leader observes the hero attacking a peaceful monster,
only become angry if that peaceful monster is a quest guardian.  And
when becoming angry, stop waiting for the hero to approach.

If a quest guardian observes the hero attacking any peaceful monster,
don't run away.
2024-07-09 02:48:05 -07:00
PatR
e6ccd734e5 yn_function() again
The new impossible() was testing for a NUL response incorrectly.
2024-07-09 01:55:55 -07:00
PatR
49a669a863 yn_function() sanity
Add the impossible with slightly less detail.  With any luck paxed's
magic debugger can track down what is happening with the canned
response queue.
2024-07-08 13:50:26 -07:00
PatR
0598880bb5 minor shk.c comment fix 2024-07-08 02:52:40 -07:00
PatR
8073c40477 redo nowrap_add()
Yahoo!'s mailer delivered the report about nowrap_add() to my spam
folder, apparently because it thinks that the signature attachments
"may contain harmful content".  :-(

nowrap_add() checks for signed overflow after the fact, so after
undefined behavior if that happens.

This rewrites nowrap_add() and moves it from end.c to integer.h.

I haven't generated any values big enough to exercise it, but the
algorithm is straightforward so I'll take it on faith.
2024-07-07 17:34:37 -07:00
PatR
0447a1f107 band-aid for fuzzer crash in doclassdisco()
This should prevent the unexplained situation in doclassdisco(the
back-tick command) from triggering a crash, but doesn't solve the
underlying problem.  And the new impossible() will be escalated to
panic() by the fuzzer, so will still cause it to die.

Still no idea why the class input letter 'c' ended up with value
'I', leading to 'oclass' being MAXOCLASSES and going out of array
bounds during during doclassdisco()'s final loop.
2024-07-07 16:43:55 -07:00
nhmall
fbda1183d7 comment bit 2024-07-07 10:40:03 -04:00
PatR
40716b7b0a fix #K4199 - dereference of null firstmatch pointer
Bumping into something (by fuzzer) with mention_walls On crashed
when trying to display output generated by do_screen_description().
I wasn't able to reproduce this but didn't spend much time trying.

Without a test case I'm only guessing that this fix solves the
problem.  If there was a monster phazing at the 'wall' location
or an object embedded there, the screen description wouldn't be
appropriate for trying to describe the terrain.  (I don't think that
the pass-walls monster csse would reach the affected code but the
embedded object case might.)

Use the background glyph calculated for the map, which yields the
intended "stone" instead of "wall" when outside a not-yet-mapped
wall, rather than the displayed glyph.
2024-07-06 17:00:30 -07:00
Pasi Kallinen
d4ac146c5f Pets avoid a possible boulder pushing location in Sokoban 2024-07-06 23:12:19 +03:00
PatR
a33f1edd24 YMonnam(monst)
Replace several upstart(y_monnam(mon)) with new YMonnam(mon) to
produce "Your little dog" and such.

Also change one or two Monnam(mon) to YMonnam(mon) and one pline(...)
to pline_mon(mon, ...).
2024-07-04 14:27:28 -07:00
PatR
0e46439814 fix add_one_tobill() 'fixme'
Not exhaustively tested.
2024-07-04 14:19:40 -07:00
PatR
10c85d68bb fix #K4172 - selling all into container
When using #loot to put items into a shop-owned container on a shop's
floor, you are asked "Sell it? [ynaq] (n)" for each item, but the 'a'
and 'q' choices only worked as y or n for the current item.  By the
next one, the preferred answer had been reset to default and ynaq was
asked again.

Set a flag in use_container() to have in_container() set the sell vs
don't sell state for the first item but not for any others.  Reset
the state at the end of use_container() instead of after each item in
in_container().

This bug was present in 3.6.x, also in 3.4.3, and probably earlier.
2024-07-03 23:28:05 -07:00
PatR
7fa328fda3 redo itemized shop billing for containers
Finish shop changes begun in 2674a9904d.

Fix the longstanding bug where shop paying with itemized buying would
reveal container contents if any unpaid items were inside containers,
regardless of whether the containers' contents were known yet, even
when the container was a locked box/chest or a cursed bag of holding.
Paying by menu made that be more noticeable but it has been present
ever since itemized paying was introduced.  I can't find any old bug
reports for it though.  I did find an old message of mine that claims
it's in bugzilla with a "#Hnnnn" tag.

This changes how buying containers and their contained items behaves.
It's now an all or nothing operation.  Itemized billing will list
the container but not contents, and to buy what is inside you need
to pay for the whole thing as a single unit.  If the container itself
is unpaid then its price is part of that item's total cost.  If it is
hero-owned than it is listed as an item to buy but doesn't increase
the cost derived from its unpaid contents.  (If you decline to pay,
hero will still own the container and still owe for unpaid contents.)
2024-07-02 14:52:49 -07:00
PatR
14d0e48e73 less verbose sanity checking
If the 'sanity_check' option triggers a warning, don't show the
"Program in disorder!  (Save and restore might fix this.)" and
"Report these messages to <devteam>." messages and also don't run
the crash report submission.

Doesn't affect the fuzzer because it escalates impossible() to
panic() before reaching those extra messages.
2024-07-01 00:44:42 -07:00
PatR
dc9d0e279f suppress sanity_check for invalid command ESC
If sanity_check starts spewing out warnings, don't run it again if
player types ESC when the program finally asks for the next command
(rather than --More--).

Also, some reformatting of the main command table.
2024-06-30 17:33:41 -07:00