Commit Graph
89 Commits
Author SHA1 Message Date
Patric Mueller bb040cc2e1 Merge branch 'ars3niy-curses256' into NetHack-5.0
Closes #1561
2026-06-19 16:36:53 +02:00
Patric Mueller 49ac961884 replace NOTPARMDECL with TPARM_WORKAROUND
The old logic used a negative check to emit an extern declaration for
tparm(). This guarded against old platforms whose curses implementations
did not declare their own functions.

If there are still any platforms left that need this declaration, they
can set TPARM_WORKAROUND to get the old behavior back.
2026-06-10 10:16:44 +02:00
Patric Mueller 207db14301 tty: handle indexed colors separately from RGB color space
The terminfo entries from the standard ncurses distribution have
peculiar settings for entries supporting 24 bit colors. The direct
entries mix indexed and RGB values into an incompatible mess.

This commit adds a simple workaround for the tty port.  Colors are
initialised as if only 8 ANSI colors are available.  This does not
affect color customisation from the symsets.

The curses port is affected as well. But I am not yet comfortable to
refactor a large part of the code for an absolute edge case.
2026-05-30 13:53:13 +02:00
Patric Mueller 3a0c6f17c7 fix buffer overflow in update_topl
Buffer overflows could occur when interacting with containers while
inputting or outputting many items.

This commit ensures topline updates do not exceed buffer limits by
checking against TBUFSZ.

Issue reported by k21971 on IRC.
2026-05-15 23:32:14 +02:00
Patric Mueller 60de227615 fix ncurses build on macOS with Homebrew 2026-05-06 09:58:00 +02:00
Patric Mueller 7fc9baa851 Update wall colors for Enhanced symsets
Making the walls in the mines brown and the walls in Fort Ludios
light blue.
2026-04-26 14:47:38 +02:00
Patric Mueller b051ce8fd9 Add Unicode glyphs to Enhanced1 symset comments 2026-04-23 22:51:13 +02:00
Patric Mueller 34b85dbea6 Partly revert changes to Enhanced1 symset
Keep Enhanced1 as a conservative symset that should work everywhere.

Added description on the scope of the different Unicode symsets.
2026-04-23 22:51:13 +02:00
Patric Mueller b844632dfd bump EDITLEVEL for 0447a1f10
Commit 0447a1f10 accidentally broke save compatibility.
2024-07-11 16:35:24 +02:00
Patric Mueller edaf4ac438 Remove doubled definitive article from Monk quest texts 2024-05-03 13:19:32 +02:00
Patric Mueller fb353fff6c Add NULL pointer guards for the crash reports variables
Calling sprintf with NULL string for a %s format identifier seems to be
undefined behavior.  I got some semi persistent crashes while calling
the extend options menu with mO.
2024-03-03 16:14:15 +01:00
Patric Mueller 68f9ef8aa6 Followup to "suicide by wand", remove redundant an() 2022-12-07 15:54:30 +01:00
Patric Mueller 7a90cd3608 Document italic for menu headings and menu colors 2022-09-08 12:39:02 +02:00
Patric Mueller 487f1f7ccc room stocking would put multiple items on the same spot 2022-09-08 09:24:50 +02:00
Patric Mueller 8bf5654eed tty and curses: support italic as text attribute 2022-09-04 22:33:25 +02:00
Patric Mueller 14007e9483 lit candles generated by wishing could have wrong light radius
begin_burn() was called before the quantity of wished lit candles was
restricted which meant that the light source radius could depend on a
larger quantity than the final object actually had.
2022-08-26 21:54:56 +02:00
Patric Mueller b566574d45 curses: revert accidentally removed code block for #saveoptions 2022-08-24 23:41:31 +02:00
Patric Mueller 2deb119ee0 curses: implement a dialog for the windowborders option 2022-08-24 21:03:36 +02:00
Patric Mueller 4aeb3875e2 Fix some coordxy declarations that should be xint16
By temporarily changing the type definition for each of xint16 and
coordxy to int32_t, the compiler was able to find several places where
the type definitions were wrong.
2022-08-23 09:10:17 +02:00
Patric Mueller cb0dd7af3f Enable TTY_PERM_INVENT
The permanent inventory will be automatically shown if the terminal size
allows.
But only output an error message if the player requested it via
perm_invent option.
2022-06-20 18:07:24 +02:00
Patric Mueller 5863d95837 Typo in opthelp 2022-06-17 16:57:03 +02:00
Patric Mueller 193d0c4332 Color check for 256 and 24 bit color output with enhanced symbols
Adding a check for using the 256 or 24 bit color escape sequnces only if
the terminal supports it.
2022-06-13 20:52:58 +02:00
Patric Mueller 1685b5e16b Fix wrong glyph for tuwall in Enhanced1 symset 2022-06-13 20:52:58 +02:00
Patric Mueller ced5c2a92f Curses: fix clipped map crash due to uninitialized memory 2022-05-23 00:03:15 +02:00
Patric Mueller 92bff67a5d Fix compilation with TTY_TILES_ESCCODES for expanded-glyphs 2021-09-26 00:02:58 +02:00
Patric Mueller 456e62ef1f tty: use bright colors directly on supporting terminals
Terminals supporting more than 8 colors can directly display the bright
colors (upper 8 colors of the 16 color palette).

The tty port now only uses bold for displaying bright colors as a fallback to
previous behavior for terminals with 8 colors.
2021-08-07 11:53:36 +02:00
Patric Mueller 4c1f2ffa48 Fix heap-use-after-free when attacking monster with potion
Attacking a monster which has a passive attack (e.g. a red mold) with a
wielded potion that breaks during the attack, the variable weapon would
not be correctly reset and passive() would be called with the pointer to the
freed object.
2021-07-17 13:20:14 +02:00
Patric Mueller 1fbcef304f Merge branch 'hoa-aloha' into NetHack-3.7 2021-07-16 18:07:19 +02:00
Patric Mueller f6632e7ce6 Document "readable" Hawaiian shirt designs in fixes37.0
Closes #407
2021-07-16 18:05:48 +02:00
Patric Mueller 71084bbf61 Fix format-overflow warnings in botl.c 2021-07-16 18:04:28 +02:00
Patric Mueller 5c15ca1002 curses: remove unnecessary special handling for dark gray
On terminals with at least 16 colors there should be no need for special
handling dark gray.

The curses code uses COLORS < 16, COLORS <= 16, COLORS > 16, or COLORS >= 16
at several places although I'm not sure if they are correct or which could
possibly be off-by-one errors.

But realistically in this case, we only need to distinguish between 8 color
terminals and terminals supporting more than 8 colors as this will mean the
terminal supports at least 256 colors.
2021-06-05 14:38:41 +02:00
Patric Mueller 6e7f1bc1f0 curses: don't change the terminal's default colors
The curses port changed some of the basic 8 terminal colors and all 8 bright
colors on terminals supporting changing colors.
2021-06-05 14:38:13 +02:00
Patric Mueller f5904824e2 Hallucinatory liquids for water damage messages 2021-04-20 13:38:34 +02:00
Patric Mueller 921b7b955f Missed adjustment for the increased prefix length of the perm_invent window 2021-04-01 23:07:18 +02:00
Patric Mueller 2805a135a3 Indent items in perm_invent window
Add a space in front of items in the perm_invent window as in the inventory
window.
2021-04-01 21:57:10 +02:00
Patric Mueller 495aaf33f6 Fix menu headings using default text color
Rendering menu headings used the NetHack internal NO_COLOR macro which mapped
to dark gray instead of the default text color.

Fixes #480
2021-04-01 21:49:56 +02:00
Patric Mueller bea69f39f3 Output message when changing fastmove mode while cursor targetting 2021-02-19 10:40:41 +01:00
Patric Mueller 8d7d159be1 Fix spelling error in Samurai quest 2021-02-03 20:31:01 +01:00
Patric Mueller f4e9104957 Bones levels information in xlogfile and enlightenment
- record number of encountered bones levels in xlogfile
  - add bonesless to extended conducts field in xlogfile
  - show bones levels information in enlightenment at end of game or in
    explore and wizmode
2021-01-22 00:22:09 +01:00
Patric Mueller 6a2ac5b446 Add missing flag for count support with drop command
The recent getobj refactoring missed the flag GETOBJ_ALLOWCNT for the drop
command.
2021-01-08 02:12:29 +01:00
Patric Mueller 1d8503a912 Typo in impossible message in spitmm 2020-12-06 00:27:56 +01:00
Patric Mueller 56494d3479 Fix an implicit-fallthrough and maybe-uninitialized warning 2020-11-15 16:07:43 +01:00
Patric Mueller 7086427aaa Enable checkpointing again by default
This was accidentally changed in the options refactoring in commit 68fdc3bbcb.
2020-10-30 20:30:21 +01:00
Patric Mueller 4e1cf071ae List lamps and lanterns in charging prompt
Brass lanterns and oil lamps are always chargeable.
Magic lamps are only listed if they are not yet identified.
2020-10-25 19:25:39 +01:00
Patric Mueller 8cc75bf583 Fix "may be used uninitialized" warning 2020-10-24 11:38:22 +02:00
Patric Mueller 1cc26106bf Tossed upwards objects got two times half physical damage reduction 2020-10-23 11:04:29 +02:00
Patric Mueller 8564ee95b0 Record number of wishes and artifact wishes in xlogfile 2020-06-07 16:39:58 +02:00
Patric Mueller 9372b35c46 Demons summoning other demons only when near hero
Commit 2fbf9573d5 dropped erroneously the range condition for demons summoning
other demons.
2020-05-20 16:40:40 +02:00
Patric Mueller 6fcb3fc0c7 Only generate shop items on solid floor squares
This commit addresses one issue raised in #338 that shop items were generated
on lava squares.
2020-05-10 14:23:34 +02:00
Patric Mueller c00c307d57 Record amount of gold in hero's possession in xlogfile 2020-04-24 23:53:25 +02:00
Patric Mueller 0e4ff07cef Extended achievement and conduct fields for xlogfile
Introducing two new xlogfile fields "achieveX" and "conductX" which encode
achievements and conducts as a series of comma-separated strings which are
more easily parseable and also somewhat interpretable independent from knowing
the source code.

Example for a player that died shortly after picking up the luckstone from the
gnomisch mines:
achieveX=entered_the_gnomish_mines,entered_mine_town,entered_a_shop,entered_a_temple,obtained_the_luckstone_from_the_mines
conductX=polyless,polyselfless,wishless,artiwishless,genocideless
2020-04-24 23:41:25 +02:00
Patric Mueller f9f423b385 Allow nurses heal attack when wielding a non-weapon/weaptool
This matches the nurses' hitting behavior with their chatting messages.

Chatting to them suggested that the heal attack would happen but the check in
mhitu.c was just for wielding anything.

This opens up the possibility of a YAFM in MS_NURSE when wielding something
that allos the heal attack to proceed.  But I couldn't come up with a good
one.
2020-04-22 12:00:06 +02:00
Patric Mueller acf6f5fdff Level compiler creates correct novel with supplied name
Before this commit, the name of a novel in the level files was ignored for
setting novelidx. But the name was set nevertheless, so you got a named novel
that showed quotes from a different novel.

Now, 'des.object({ id = "novel", name="Raising Steam"});' will work as
expected.
2020-04-01 22:36:30 +02:00
Patric Mueller 9862d2c934 Use correct archaic form for "thine audience"
Closes GitHub issue #313.
2020-03-16 10:33:31 +01:00
Patric Mueller 16d32b3002 Remove left over NH_DEVEL_STATUS bits from makedefs.c
Left bits from previous version info code caused compilation errors
if NH_DEVEL_STATUS was not set to NH_STATUS_WIP.
2020-02-19 01:43:51 +01:00
Patric Mueller 4b270099ec Stop monsters from interacting with protected items on the floor
This fixes the issue of chests with the wand of wishing on the castle level
being stolen by soldiers.

Commit b12ea03d1 revealed that searches_for_item() didn't check for onscary()
and allowed monsters to pick up items even though they were protected by a
scroll of scare monsters.
2020-02-17 10:41:03 +01:00
Patric Mueller 29da34b799 Adding missing basic taste "umami" as hallucinatory color 2020-02-02 20:16:13 +01:00
Patric Mueller 38fa93df73 Restrict the teleportation notification to actual teleportations
teleds() is used for more than just teleportations, the teleportation message
was also given when mounting a steed.

Trying out a new bit flags method parameter design pattern.
2020-01-11 19:51:54 +01:00
Patric Mueller 2965488525 Unpaid globs showed weight info unconditionally outside of wizmode
globwt() didn't check for wizmode, so unpaid globs would be shown with weight
information even for normal player.

Eliminated globwt() completely and consolidated the output of aum in one place
as we don't really care about the ordering of debug info in wizmode.
2020-01-08 11:34:53 +01:00
Patric Mueller 3a8990b8a0 Merge branch 'copperwater/sokoban_penalties' into NetHack-3.7
Closes #260
2020-01-06 01:00:46 +01:00
Patric Mueller 5267a50c7e Move enhance_tip into context and don't show tip if #enhance has been used before
Breaks save and bones compatibility.
2020-01-06 00:50:32 +01:00
Patric Mueller b55165ed07 Applying a spellbook hints about read charges left
Applying a spellbook allows the player to flip through the pages, providing an
indication of how many reads it has left before turning blank.

Originally from UnNetHack but code almost completely refactored and updated
for post 3.4 changes like deafness and novels.
2020-01-05 00:27:29 +01:00
Patric Mueller 9110302d42 When hallucinating, see hallucinated currencies instead of bits for an ale 2020-01-05 00:27:29 +01:00
Patric Mueller 49ef111bac Merge branch 'copperwater_consolidated_pull_request_265'
This includes most commits from GitHub pull request #265 with some code
adjustment and documentation in doc/fixes37.0.
2020-01-05 00:27:20 +01:00
Patric Mueller 25a248219a Update fixes37.0 2020-01-04 23:03:45 +01:00
Patric Mueller 0c89eb32f5 Show the teleportation messages only with flags.verbose 2020-01-04 22:54:14 +01:00
Patric Mueller 1acd631766 Candelabrum now reads "(n of 7 candles attached)"
It wasn't obvious enough before that the Candelabrum has seven candle
slots. This makes it show it clearly.
2020-01-04 22:54:14 +01:00
Patric Mueller 18b46449f0 Only output candelabrum tip if candles are in inventory 2020-01-04 22:54:14 +01:00
Patric Mueller 2ae7cf02ea Replace "money" in in-game texts with "gold"
When GOLDOBJ was activated unconditionally, several texts started referencing
"money" instead of "gold".

As we don't have the intention to introduce a complex coin system with
different denominations, change it back and also some other places that
reference "money".
2020-01-01 10:59:24 +01:00
Patric Mueller 9085093338 Fix compilation on platforms that split the ncurses and tinfo libraries
Some platforms compile ncurses in such a way that the tinfo library needs to
be separately linked in (e.g. Gentoo).

The tinfo library is a low-level library being used by and bundled with
ncurses.

Adding '-ltinfo' to WINTTYLIB in the hint files was considered the most robust
solution to this problem.  This still works on systems with ncurses 5.9.
Using pkg-config was ruled out as the default build of ncurses doesn't install
the necessary files.
2019-12-15 20:38:44 +01:00
Patric Mueller cb2e02ef75 Merge branch 'copperwater-vs_teleport' into NetHack-3.7
Closes #252
2019-12-08 20:00:31 +01:00
Patric Mueller b9f3a33ec9 Update depend.awk for the new Qt location and lua headers 2019-12-08 14:41:54 +01:00
Patric Mueller f7a2b9a8dc Merge branch 'NetHack-3.6' into NetHack-3.7 2019-05-26 18:16:22 +02:00
Patric Mueller b7edc7f8e8 Workaround for including stdint.h on older GCC versions
GCC doesn't set __STDC_VERSION__ for older versions. It is verified to
be set by default on 5.3.0.

Older versions set __INT64_MAX__ though (oldest version tested is
4.5.4).

If compilation with older GCC versions is required, set -std=c99. Even
3.4.6 is supported with this setting.
2019-01-29 15:10:01 +01:00
Patric Mueller bd730dbcaa workaround for C89 not supporting inline 2019-01-28 15:00:04 +01:00
Patric Mueller 97b8d0a50b Don't define Rand() if isaac64 is used 2019-01-28 10:02:09 +01:00
Patric Mueller f9433b2a87 integrate isaac64 into nethack
Also removed the float code from isaac64 as they are not used in
NetHack.
2019-01-28 10:02:08 +01:00
Patric Mueller c81db872fd add file for the isaac64 random number generator
This is the version from the Comprehensive C Archive Network, licensed
under the CC0 "No Rights Reserved" Creative Common License.
http://ccodearchive.net/info/isaac.html
2019-01-28 10:02:08 +01:00
Patric Mueller b3fde3eb41 fix check for stdc version in include/integer.h 2019-01-28 10:02:08 +01:00
Patric Mueller 52d4b1a1aa reseed during level change to prevent deduction of rng state
For platforms that read from the system's random number generator,
reseed during level change, before the map of a new level is created and
after level creation has finished.
2019-01-28 10:02:00 +01:00
Patric Mueller 86d694c61b read rng seed from random number source device
Linux and BSD system have random number source devices that can be used
as source for a unguessable seed source.

Other platforms fall back to generate the seed with gettime().
2019-01-28 10:01:45 +01:00
Patric Mueller 19f0a2d3ba Fix missing compilation dependency for cursinit.c 2018-12-28 15:21:33 +01:00
Patric Mueller 7d15535923 Fix always trapped castle chest 2018-12-15 22:40:30 +01:00
Patric Mueller 531ccca7d9 Revert "Revert "Send travis notification mails to mailing list""
This reverts commit 8edaa021d5.
2018-11-24 10:07:38 +01:00
Patric Mueller d60097b286 Send travis notification mails to mailing list 2018-11-23 18:56:25 +01:00
Patric Mueller a7ebb35d5e Adding a travis job for a minimal build 2018-11-23 17:44:31 +01:00
Patric Mueller 4c1a819511 Building tty, X11, and QT5 builds on Travis 2018-11-23 17:44:31 +01:00
Patric Mueller ae61fe6f27 Fix Qt compilation 2018-10-10 03:08:15 +02:00
Patric Mueller f87931a7bf fix typo of the Junethack tournament 2018-09-27 22:14:28 +02:00