Commit Graph

17309 Commits

Author SHA1 Message Date
PatR
1d0b8dfca0 Demonbane revisited
Commit c4a1f298e8 two and a half
months ago gave lawful Angels and Archons a chance to start with
a mace instead of a long sword so that they might get Demonbane.
It was a bit convulted; this redoes it to be more straightforward.
2024-11-26 21:40:19 -08:00
nhmall
70284521e6 follow-up: paste bit 2024-11-27 00:35:27 -05:00
PatR
ea6cdd3f39 Amulet_on() & Amulet_off()
Fix a FIXME in Amulet_off() for removing an amulet of magical
breathing when within a poison gas cloud.

Redo message sequencing for both Amulet_on() and Amulet_off().

Use up an amulet of change if put on while the Unchanging attribute
is active (via #wizintrinsic) instead of wearing it with no effect.

Don't discover amulet of strangulation if put on while already
Strangled (via #wizintrinsic).
2024-11-26 21:20:30 -08:00
PatR
d32ab55b84 new property: BLND_RES
Add enlightenment feedback for Sunsword's blocking of becoming blind
from light flashes.  It uses an extra property so that wizard mode
can report the reason.

EDITLEVEL is being incremented, so existing save and bones files are
invalidated.
2024-11-26 20:57:11 -08:00
nhmall
15e70035d0 Remove unnecessary macro that wasn't ideally named
Also add a comment that states the intent.
2024-11-26 23:27:29 -05:00
PatR
3615b17b62 'O' feedback when toggling 'accessiblemsg'
When accessiblemsg is Off, coordiates supplied for various messages
stayed put after becoming stale.  If you used 'mO' to toggle that
option On, you could see things like
 (2east):'accessiblemsg' option toggled on.
After that, accessibility message coordinates behaved as intended.

Clear a11y.msg_loc.x,y for every pline instead of just when they
are used to augment the current message.

Most players who use accessiblemsg are bound to set it in their
config file rather than toggle it interactively so never noticed.

Misc 1:  option.c doesn't need '#include <ctype.h>' because
cstd.h includes it unconditionally.  Several other src/*.c are in
the same situation but I didn't touch them.

Misc 2:  move set_msg_dir() and set_msg_xy() out of a warning
suppression block that isn't relevant to them.
2024-11-26 19:28:30 -08:00
PatR
1c5b295097 tin consumption edge cases
If eating a tin killed the hero (choked, turned to stone, poly'd into
a new man with new Xp too low to survive) and bones were saved, the
tin remained intact in them.

When hero who is poly'd into metallivore form eats a tin, give a
little extra nutrition for the tin itself.  Also, eat it immediately
by skipping the "It smells like <creature>" message and "Eat it? [yn]"
prompt.  (The message while eating it also reports <creature>, so
skipping the 'smells' one doesn't end up hiding anything.)
2024-11-26 18:01:19 -08:00
Anhijkt
d93704a154 change CHDIR definition conditions 2024-11-23 19:04:12 +02:00
nhmall
37793be6eb more quieting of Qt6 build warnings 2024-11-20 09:56:01 -05:00
nhmall
3e903fd79a quiet warnings on recent Qt, macOS Sequoia 15.1, latest Xcode 2024-11-17 10:03:04 -05:00
nhkeni
4f3c463d69 remove some testing junk that escaped 2024-11-16 17:39:40 -05:00
nhmall
7932497450 follow-up for Makefile.nmake 2024-11-16 10:45:22 -05:00
nhmall
21b495f835 Makefile.nmake build fix when no curses options
Resolves #1325
2024-11-16 10:10:10 -05:00
nhkeni
d493d31aec Remove "*.txt NHSUBST" from .gitattributes because it's too general.
Specifically, it was marking Guidebook.txt for substitution, but
it's a derived file, not a source.
2024-11-15 19:00:31 -05:00
SHIRAKATA Kentaro
aba2bda159 split eval_offering() into a separate function 2024-11-16 04:10:11 +09:00
nhmall
13db1aed0d replace stray tabs that have crept in 2024-11-14 11:54:39 -05:00
Pasi Kallinen
62971c6f09 Qt: add support for the palette config option
Depends on CHANGE_COLOR compile-time option.
2024-11-14 17:25:44 +02:00
nhmall
c7591c0e08 remove redundant zeroing 2024-11-13 17:36:47 -05:00
nhmall
b8083733de some sys.c orphaned pointer prevention 2024-11-13 17:14:47 -05:00
nhmall
7ff17845c6 Windows MSYS2 build fix 2024-11-13 16:14:49 -05:00
nhmall
c16c87a897 Merge branch 'early_return' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-13 14:54:34 -05:00
nhmall
52a9af7278 early_init() was being called twice on Windows GUI 2024-11-13 13:57:18 -05:00
nhmall
fa9210aa65 Windows: free more allocated memory before exit
This gets rid of the final leak complaint on Windows as of Nov 13, 2024
2024-11-13 13:48:50 -05:00
nhmall
c85b5d3e56 rearrange function layout in Windows windmain.c 2024-11-13 13:48:03 -05:00
nhmall
5c28b9e987 fix another memory leak
In sys_early_init(), the values for sysopt.gdbpath and
sysopt.greppath were being assigned by calling dupstr()
without ensuring that a value previously assigned by
dupstr() were free()'d.

Also, the sysopt struct definition is changed to sysopt_s,
not because there's anything wrong with the original
    struct sysopt sysopt;
but because I couldn't convince the debugger to use the
correct thing when trying to track down the leak.
2024-11-13 09:07:10 -05:00
nhmall
277a0e4464 Windows NetHackW.c bit 2024-11-12 19:30:43 -05:00
nhmall
724f8f865c more memory freeing before exit on Windows 2024-11-12 18:51:04 -05:00
nhmall
0e52eac184 update tested versions of Visual Studio 2024-11-12 2024-11-12 18:00:37 -05:00
SHIRAKATA Kentaro
2ee31972a5 unify to early return on offer_corpse()
* remove redundant `else`
 * reduce indent
2024-11-12 22:50:17 +09:00
nhmall
7414b906b2 release some memory before exit under Windows 2024-11-11 16:50:57 -05:00
nhkeni
fd0b67de4d Fix leak in crashreport_init() under Windows 2024-11-11 15:21:59 -05:00
nhkeni
91c38355e7 Merge branch 'keni-gitset2' into NetHack-3.7 2024-11-11 11:27:27 -05:00
nhkeni
36e8d9e6fc nhgitset version 4
To update, run "perl DEVEL/nhgitset.pl"

Fixes:
- "nhcommit -a" has been fixed
- NHDT was hardwired in places
- no longer complain about a missing dat directory outside of the
    NetHack source tree
- make update of gitinfo atomic
- Replace some hardwired directory separators with OS-dependent constructs

Backwards Incompatibilities:
- NH_DATESUB's DATE() is now Date() to match the other variables
- MSYS2 requires an additional Perl package - the MSYS2 docs have
    been updated

New Help System:
- git nhhelp
   This command mirrors "git help" for nh* commands.
- See git nhhelp nhsub for general help on substitution variables

New Substitution Variables:
-Brev()
    An aBREViation of $PREFIX-Branch$:$PREFIX-Revision$ - this
    may help get line length under control in file headers.
-Assert(TYPE=VALUE)
    If TYPE does not match VALUE, do not substitute on this line.
    TYPE P checks VALUE against nethack.substprefix
-Project(arg)
    Returns nethack.projectname if there is no arg and an uppercase
    version if arg is uc.

Other New Features:
- Add nethack.projectname
- Documentation updates - see "git nhhelp nhsub"
- On checkout or merge of a branch, check for nhgitset version updates
  and provide an optional message to the user.
- Move NH_DATESUB substitutions here from cron job to keep dates in sync
- PREFIX-* keywords now available in NH_DATESUB templates
- Support use of nhgitset.pl from a different repo; note that update
  checks will be dependent on keeping the original source repo up-to-date
  and in the same location.
2024-11-11 09:15:49 -05:00
SHIRAKATA Kentaro
93072b8784 shrink scopes of some vars on offer_corpse() 2024-11-11 17:34:32 +09:00
nhmall
e83e04dbb3 fix some memory leaks 2024-11-10 22:24:45 -05:00
nhmall
d428beb8dd remove an unused prototype 2024-11-10 17:58:04 -05:00
nhmall
9a7dcf16a3 rm.h comment update 2024-11-10 17:49:54 -05:00
nhmall
dacad054cc Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-10 10:35:13 -05:00
nhmall
bbcd161e5f follow-up: prompt message bit 2024-11-10 10:19:58 -05:00
nhmall
c87a373b11 more follow-up related to #1320 2024-11-10 10:06:07 -05:00
SHIRAKATA Kentaro
e23095a829 omit return value of offer_corpse(), as it is always ECMD_TIME 2024-11-10 22:46:31 +09:00
nhmall
5cc529efc8 follow-up related to #1320
This is additional groundwork related to
https://github.com/NetHack/NetHack/issues/1320

This additional groundwork just puts some safeguards
in place to make it rather tough to end up with an
instant death from handling a cockatrice corpse in
your inventory without appropriate protection.

At this point, still no actual petrification will occur.
2024-11-09 23:49:10 -05:00
nhmall
a40d85a430 Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-09 14:47:33 -05:00
nhmall
9c554895b1 adjust wish for cockatrice corpse
Wishing is powerful, so if you cannot safely handle a cockatrice
corpse, then have a wish for one result in the corpse materializing
on the floor rather than in your inventory.

Resolves #1320
2024-11-09 14:06:43 -05:00
nhmall
36d8998edb try not including trees when check_pos() returns it's 3rd argument.
Related to #1309
https://github.com/NetHack/NetHack/issues/1309

K2 commented: "This might help - k21971/EvilHack@afed641"

A comment in there states:
"Fix: sections of wall being visible when they shouldn't yet.
This has been a long-standing bug for as long as I can remember, and qt
appears to have figured it out. What was happening: the player would all
of the sudden see a section of wall in an area that they hadn't explored
yet. It was discovered that this was only occurring if that section of
wall had any type of tree up against it."

The fix there attempts to leave trees out of the check_pos non-zero return,
so give that a shot.

I didn't attempt to reproduce the situation myself,
and therefore cannot confirm that this does resolve it.

Feedback on effectiveness or side-effects are welcomed. If someone is
able to confirm that this resolves the issue without creating new
issues, we can close it, otherwise this can be reverted.
2024-11-09 11:40:09 -05:00
nhmall
1dbba0f63b rename IS_ROCK() macro to IS_OBSTRUCTED()
It has included trees since they were added, so give it a
more fitting name.
2024-11-09 11:12:42 -05:00
nhmall
f1743d0e5c more rm.h comment updates 2024-11-09 10:58:58 -05:00
nhmall
a74badd271 rm.h comment updates 2024-11-09 10:53:48 -05:00
SHIRAKATA Kentaro
db460a4fcf split offering a corpse into a separate function 2024-11-09 02:35:19 +09:00
nhmall
aaf324bcb4 comment bit in polyself.c 2024-11-07 16:29:45 -05:00