PatR [Mon, 6 Feb 2023 23:50:39 +0000 (15:50 -0800)]
fix github issue #972 - moving while trapped
Reported by elunna: a monster trapped in a pit or web that was
adjacent to a polymorph trap could enter that trap to change shape.
It would remain flagged as trapped but there's no way to escape
from a polymorph trap so it would be stuck.
Fix supplied by entrez: when a monster is picking MUSE strategy,
don't allow it choose "enter polymorph trap" if it is currently
trapped.
I entered the changes from the diff manually and added a bunch of
minor formatting bits.
PatR [Mon, 6 Feb 2023 19:47:37 +0000 (11:47 -0800)]
attempt to fix github issue #965 - place_object
Issue reported for a hardfought player by k2: dying in a shop wall
produced "place_object: <item> [0] off map <0,0>" when hero's invent
was dropped. It happened in Mine Town where multiple shopkeepers are
present and it is possible to have two shops share a wall.
I could not reprouce the problem, even after setting up--and dying
various times at a gap in--a wall shared by two shops.
paybill() -> inherits() -> set_repo_loc() sets up the destination
prior to disclosure and finish_paybill() -> drop_upon_death() later
places invent at the spot iff bones are going to he saved. inherits()
is convoluted and evidently took at least one path that failed to
call set_repo_loc(). Change it to always call set_repo_loc() when
returning 'True' so that the destination should always be set if
really_done() calls finish_paybill().
Some followups by entrez are probably still useful.
copperwater [Sat, 4 Feb 2023 20:21:23 +0000 (15:21 -0500)]
Fix: default lregion exclusion area occupied real space on the map
The intuitive behavior of des.levregion or des.teleport_region when
"exclude" is left unspecified is that there is no exclusion area.
However, this wasn't actually the case: since l_get_lregion defaulted
the exclusion area to (0,0,0,0) and exclude_islev to 0, this meant that
the 0,0 space on the map would always be excluded from regions. In cases
where a region was specified with its inclusion area constrained to the
0,0 space of the map, this would create a "Couldn't place lregion"
impossible message.
This fixes that issue by defaulting the exclusion area to (-1,-1,-1,-1),
and if the exclusion area is left unspecified, forces exclude_islev=1.
This means that the exclusion zone will be outside the walkable space of
the level where it can't cause any problems.
If a level designer puts negative coordinates in their inclusion or
exclusion parameters, this might not work correctly, but negative region
coordinates aren't currently used anywhere and probably shouldn't be
supported anyway.
PatR [Sat, 4 Feb 2023 23:28:13 +0000 (15:28 -0800)]
up/down level feedback
With sounds on, using #levelchange to drop more than one level only
gave the level-loss sound effect once. Level-gain sound was better
because the more verbose messaging triggered --More-- before moving
on. Have both gain and loss use urgent_pline() in case messages
are being suppressed due to ESC, and have both request --More-- to
make the player acknowledge the message. That has a side-effect of
letting the sound play to conclusion.
PatR [Sat, 4 Feb 2023 20:58:06 +0000 (12:58 -0800)]
depend.awk update
cppregex.cpp recently had `#include "extern.h"' added as the last
quoted include. That gets set to "" while collecting dependencies,
then preceded by a space when output. So the unexpected trailing
space was new and wasn't caused by a change of awk versions as I
was suspecting. This removes it.
Pasi Kallinen [Sat, 4 Feb 2023 15:48:53 +0000 (17:48 +0200)]
Fix segfault when farlooking monster under generic object
A detected cave spider was hiding under a generic spellbook object;
farlooking at it produced a segfault. OBJ_NAME is null for the generic
objects, so don't try to strcmp it.
PatR [Sat, 4 Feb 2023 01:01:49 +0000 (17:01 -0800)]
breaking iron bars with weapon
For strength over 18, A_CURR(A_STR) can return up to 125, giving
the chance to break bars by hitting them with a warhammer a 50:50
chance. Switch to acurrstr() which returns at most 25.
Allow heavy iron balls (wielded or thrown, regardless of whether
they're chained to hero) to have a chance to break bars too. They
are slightly more complicated because they don't use obj->spe like
a weapon but are otherwise straightfoward.
PatR [Fri, 3 Feb 2023 23:48:46 +0000 (15:48 -0800)]
3.7.x 'make depend'
Makefile.src didn't know about 'sndprocs.h' yet.
Something weird is going on with 'make depend'. It has started
adding a trailing space to
|$(TARGETPFX)cppregex.o: ../sys/share/cppregex.cpp $(CONFIG_H)
(actual trailing space omitted here). It's repeatable. I don't
understand it and have not tried to fix it, just removed the space
from the generated Makefile before putting into place as modified
Makefile.src and making this commit.
PatR [Fri, 3 Feb 2023 18:45:59 +0000 (10:45 -0800)]
fix #K3857 - hiding while trapped in a non-pit
sanity_check feedback which occurred after using locking magic to
set off a bear trap at the location of a monster hiding under an
object.
Trivial bit: a recent change made stunning via knockback only occur
when not already stunned but was still adding the current stun time
to the new stun time even though current stun is now always zero.
Pasi Kallinen [Thu, 2 Feb 2023 17:04:48 +0000 (19:04 +0200)]
Fix ceiling hiders on pools
While fuzzing, I saw a sanity checking error complaining about
a ceiling hider being on top of a pool; the rock piercer was
teleported on top of the pool while it was hiding in the ceiling.
Try to be a bit more consistent when a monster is hiding in ceiling,
and if it's valid for it to be on a pool.
Pasi Kallinen [Wed, 1 Feb 2023 08:23:20 +0000 (10:23 +0200)]
Monster movement and object pickup cleanup
Clean up some of the code for monster deciding what objects
to pick up, removing duplicate code. There should be no real
difference in behaviour, other than monsters now can pick up
one stack of items at a time; previously monster could pick up
gold, then a practical item, followed by a magical item all
in a single turn, although this very rarely mattered.
nhmall [Tue, 31 Jan 2023 05:45:27 +0000 (00:45 -0500)]
more windows Makefile tinkering
It looks like the Windows API call for PlaySound using SND_RESOURCE, from a
mingw32 built program, cannot find the resources that are
embeded into the .exe by the mingw32 resource compiler. That works fine
from visual studio.
For now, fall back to not using the SND_RESOURCE flag, use an ordinary
wav file name in the filesystem. Makefile.mingw32 has been modified
to copy the wav files to the binary directory along with the exe.
This probably won't be the final approach, but it will get things
working for now.
nhmall [Mon, 30 Jan 2023 17:07:03 +0000 (12:07 -0500)]
add a master off/on switch for sounds
sounds can be set in the config file or on the fly with the Options menu.
This also adds a mechanism for specifying a terminology preference
for a boolean option in the options menu.
The choices are: Term_False, Term_Off, Term_Disabled
Term_False, the default, will use the terms "false" and "true" in the
Options menu.
Term_Off will use the terms "off" and "on" in the Options menu.
Term_Disabled will use the terms "disabled" and "enabled" in the Options
menu.
I didn't review any of the existing options to see if one of the new
alternative terms might be a better fit. They were all left at the default.
Pasi Kallinen [Mon, 30 Jan 2023 15:07:40 +0000 (17:07 +0200)]
Helltweaks: improve lava river
The lava river will now draw another river, until a certain
amount of map locations have been turned into lava, so you don't
get a teensy "river" made out of 2 lava pools.
Add a lua selection method to count the number of locations
in the selection.
Pasi Kallinen [Mon, 30 Jan 2023 10:39:32 +0000 (12:39 +0200)]
Avoid repeating the god ray
My recent change to hit and wake monsters caused a recursive
ghod_hitsu -> wakeup -> dobuzz -> buzz -> ghod_hitsu loop.
Don't call the ghod_hitsu again if the priest is already angry.
nhmall [Sun, 29 Jan 2023 03:43:48 +0000 (22:43 -0500)]
soundlib in the Makefile hints updated
Move pieces of the Makefile hints sound-related changes that
are not macOS-specific from sys/unix/hints/macOS.370 to some new
include files. The WANT_MACSOUND block stays in
sys/unix/hints/macOS.370 because it is system-specific.
Before this change, the various Makefiles were assembled via
hints files macOS.370 or linux.370. Both were using included
portions from the following files in the sys/unix/hints/include
directory, in this sequence:
After this change, the various Makefiles will still be assembled
via hints files macOS.370 or linux.370. They will continue to use
included portions from the following files in the
sys/unix/hints/include directory, but with three additional
include files related to sound and soundlibs. This is the new
sequence:
The include mechanism continues to allow common portions that can
be shared between macOS and Linux to be maintained in a single
place only, with minimal duplication. Now, that has been extended
to include Makefile lines related to sounds and soundlib.
Pasi Kallinen [Sat, 28 Jan 2023 18:01:07 +0000 (20:01 +0200)]
Fix shopkeeper getting mad when monster triggers a trap
When a monster triggered a rolling boulder trap which buried
a shop item in a pit, the shopkeeper would bill the hero.
(Or get mad at hero, if they were out of the shop)
The fix might not be quite right - should the shopkeeper get
mad at hero when monster triggers a trap created by hero?
Or when an item is buried in a pit created by a hero?
Pasi Kallinen [Sat, 28 Jan 2023 17:11:29 +0000 (19:11 +0200)]
Fix open showing wrong glyph
Trying to open a location where a pet was removed the glyph
and showed the underlying terrain glyph instead.
Just use newsym - it'll use feel_location when Blind.
PatR [Fri, 27 Jan 2023 19:01:24 +0000 (11:01 -0800)]
shop object sanity - buried objects
This fixes the reported sanity check warning about a buried object
within shop boundary staying flagged no_charge after the shopkeeper
leaves the shop. Leaving the shop to pursue the hero moves unpaid
items off the bill to owed-as-robbery and changes no_charge items
to shop-owned but it wasn't doing the latter for buried objects.
I haven't attempted to test on a level with multiple shopkeepers.
If that was working correctly for unpaid items than I think it
ought to work correctly for no_charge items now. I'm not sure how
thoroughly the handling for unpaid items was tested though.