Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 41edcdf6d9 Mention italic for status hilites in Guidebook 2024-01-29 16:48:31 +02:00
Pasi Kallinen 74a1caf536 Qt: support italic in menucolors 2024-01-29 14:54:46 +02:00
Pasi Kallinen 5829863be2 petattr also accepts italic 2024-01-28 19:03:45 +02:00
Pasi Kallinen f6fae82633 Remove leftover curses extern definitions 2024-01-28 12:00:22 +02:00
Pasi Kallinen fd8b2b58d1 petattr: Change accepted parameters, add support for tty 2024-01-28 10:05:42 +02:00
Pasi Kallinen c497c14fda Split discovered sort and output lines 2024-01-27 19:47:42 +02:00
Pasi Kallinen 39fb072a92 Simplify rhack and parse
AFAICT, we only used the first char of the "command_line" string.
Just turn it into int to hold the key the main input loop parse() got.

Shouldn't have any functional difference.
2024-01-26 15:19:24 +02:00
Pasi Kallinen 47fa2eb000 Split kicking non-door terrain out of dokick 2024-01-25 21:43:55 +02:00
Pasi Kallinen cc599cb6cd Split up doengrave
doengrave was the largest function by far, so split it up into smaller
ones.  Use a structure to hold the dozens of variables needed all over it.
Should have no difference in behaviour, but I haven't tested everything.
2024-01-25 18:32:05 +02:00
Pasi Kallinen c2ddd2a7c2 Fix some object weight problems
There were few places where the object weight was not updated:

- container when the contents were broken by impact
- starting to eat but getting stopped by rotten food
- using lua, container when putting an object inside it
- when a single egg of a larger stack hatched
2024-01-24 17:58:54 +02:00
Pasi Kallinen cd74a2a99e Fix Juiblex attacking without knowing your location
Juiblex could expel the hero over water, they'd get relocated to
a safe location, but Juiblex was still thinking they were at
the location it expelled them.
2024-01-24 17:50:04 +02:00
Pasi Kallinen 829f9f65f7 Split out harmless-to-monster trap
Also make the code much easier to understand, and
more-or-less match hero trap triggering.
2024-01-23 19:01:34 +02:00
Pasi Kallinen 7fa74d0199 Add LAVAWALL to linedup blocking 2024-01-23 18:37:16 +02:00
Pasi Kallinen 90cc3102f5 Don't use static buffer 2024-01-23 17:56:02 +02:00
Pasi Kallinen a45f07c9b4 Comment typo 2024-01-23 17:32:32 +02:00
Pasi Kallinen 50df01c3e1 Split out empty hands menu option text 2024-01-23 17:27:07 +02:00
Pasi Kallinen 70d8d9e0d1 Unify getting coords or region from lua table 2024-01-23 13:37:16 +02:00
Pasi Kallinen bce7c69e77 Unify wake up and scare a monster by music 2024-01-23 13:23:51 +02:00
Pasi Kallinen 49338ebb0a Split gem color randomization 2024-01-23 13:07:52 +02:00
Pasi Kallinen baeb1d925f Change some ints to coordxy 2024-01-22 17:02:40 +02:00
Pasi Kallinen 96902f4ff0 Split populating a random maze 2024-01-21 22:48:41 +02:00
Pasi Kallinen f889478262 Split ini_inv obj wear/wield/learn 2024-01-21 14:34:21 +02:00
Pasi Kallinen 2f5851e394 Split ini_inv object field adjustments 2024-01-21 14:16:06 +02:00
Pasi Kallinen f1bf2418ff Split ini_inv obj race substitutions 2024-01-21 14:02:09 +02:00
Pasi Kallinen d2e7bfa6cd Split out ini_inv filtered mkobj 2024-01-21 13:46:20 +02:00
Pasi Kallinen 8615401278 Split out initial STR and CON boost if inventory too heavy 2024-01-21 12:51:46 +02:00
Pasi Kallinen 311e82a9cc Split init attr minor variation 2024-01-21 12:45:13 +02:00
Pasi Kallinen 1d4cdf09f6 Split u_init race specific stuff 2024-01-21 12:38:06 +02:00
Pasi Kallinen 2e56598779 Split u_init role specific stuff 2024-01-21 12:34:43 +02:00
Pasi Kallinen a46e41816b Split freeing proto_dungeon data 2024-01-21 12:17:06 +02:00
Pasi Kallinen 0eb96d7ed6 Split special level location fixup 2024-01-21 12:11:22 +02:00
Pasi Kallinen f34a07a3d2 Split out castle tune init 2024-01-21 11:55:29 +02:00
Pasi Kallinen 0e64fddec1 Split out dungeon parsing 2024-01-21 11:51:15 +02:00
Pasi Kallinen 5bf258629a Split up hero attribute init 2024-01-21 10:41:57 +02:00
Pasi Kallinen 414ee6eba7 Split setting up dungeon depth 2024-01-20 16:25:13 +02:00
Pasi Kallinen 1c0662ddd7 Split setting up dungeon entry level 2024-01-20 16:18:06 +02:00
Pasi Kallinen d5fba06837 Split dungeon branch parsing 2024-01-20 16:00:02 +02:00
Pasi Kallinen 57747535af Add m_next2u, analogous to m_next2m and next2u 2024-01-19 21:53:25 +02:00
Pasi Kallinen ce34239885 Zero init the NhRect 2024-01-19 18:19:56 +02:00
Pasi Kallinen 2212cf27ec Lua: Allow creating gas clouds
Use the gas clouds in the Clouds themeroom.
Use the existing visible_region_at() in the vision code.
2024-01-19 17:59:43 +02:00
Pasi Kallinen 5d28e24477 Some lua state allocator fixes
Run GC on the themeroom lua states, as they're not freed
until end of game.

Allocate the exact amount of data we use instead of padding it.

Free our state data after closing the lua state; doing it
the other way is the way to madness, which was kept at bay
by the padded allocation amount.
2024-01-17 17:41:44 +02:00
Pasi Kallinen 1c16ef68eb Fix spot_monsters giving a segfault in some cases 2024-01-15 20:53:24 +02:00
Pasi Kallinen 9745121137 fixes entry for the accessibility options 2024-01-15 11:00:21 +02:00
Pasi Kallinen ccfcc32843 Message location for monster wielding an item 2024-01-14 17:43:27 +02:00
Pasi Kallinen 679c312d4d Message location for monster hurling a potion 2024-01-14 17:21:48 +02:00
Pasi Kallinen 3160112ece Accessibility: Show a message when monster is spotted
Adds a new boolean option, spot_monsters.  If on, every time
the hero notices a monster which was out of sight before,
a message is given.  Combine with accessiblemsg to get the
monster location:

(3north): You see a newt.

Breaks saves and bones.
2024-01-14 13:33:02 +02:00
Pasi Kallinen 32adc3a092 Split #turn undead monster iteration function 2024-01-12 14:43:50 +02:00
Pasi Kallinen 58031920dc Fix monsters using escape items unnecessarily
Monsters were using escape items when they couldn't move due to
being surrounded by other monsters.  This was most evident in
Fort Ludios, where the alarm woke up all the monsters and they
would then read all the teleport scrolls.

Usually this doesn't matter, as special rooms full of monsters
are asleep.

Hardcode this fix for the Ludios only, otherwise you could trap
two monsters next to each other in a boulder fort, and they
would be happy to stay in there...
2024-01-11 19:31:37 +02:00
Pasi Kallinen 9ab4d65431 Make force-fighting a web train the weapon
... and the skill matter a little bit for actually cutting the web.
2024-01-10 17:44:56 +02:00
Pasi Kallinen 8ee7b11ed6 Use TRUE or FALSE for booleans 2024-01-05 17:00:04 +02:00
Pasi Kallinen 7353bf0e69 Message location for monster throwing or shooting at hero 2024-01-04 11:43:13 +02:00
Pasi Kallinen db4a44735e Message locations for Monster creation and teleporting 2024-01-03 10:28:16 +02:00
Pasi Kallinen dc8d9d6cd0 Accessibility: Add location info to messages
Adds a new boolean option, accessiblemsg.  If on, some game messages
are prefixed with direction or location information, for example:

   (west): The newt bites!
   (northwest): You find a hidden door.

I added the info to the most common messages, but several are
still missing it.
2024-01-02 18:59:25 +02:00
Pasi Kallinen 95aceb1722 Remove double boom on cancelling a magical trap 2023-12-31 21:06:56 +02:00
Pasi Kallinen 780d30eca9 Wielded quarterstaff gives a small spellcasting bonus
From NetHack Fourk.
2023-12-31 17:53:03 +02:00
Pasi Kallinen 42a6a5df66 Cursed welded quarterstaff doesn't prevent spellcasting 2023-12-31 17:41:04 +02:00
Pasi Kallinen c2fd027669 Typofix 2023-12-30 23:11:50 +02:00
Pasi Kallinen 073b0c90f3 Recalc mapseen when a special room is entered 2023-12-28 18:58:53 +02:00
Pasi Kallinen 5b5e547791 Restful sleep gives a warning message 2023-12-21 09:41:47 +02:00
Pasi Kallinen 5a60c37676 One more NO_NNARGS bit 2023-12-21 07:50:04 +02:00
Pasi Kallinen 488afffcd7 Fix NONNULL for hitting bare handed 2023-12-20 20:09:50 +02:00
Pasi Kallinen 60dc6343e4 Moving monsters disturb buried zombies 2023-12-20 11:17:23 +02:00
Pasi Kallinen 3c94b276a2 Amulet of unchanging cannot be polymorphed 2023-12-19 17:13:52 +02:00
Pasi Kallinen c0fdb2e8c4 Level temperature affects monster generation
Hot levels generate more fire-resistant monsters, cold
levels cold-resistant ones.
2023-12-18 13:43:41 +02:00
Pasi Kallinen e4026d55fb Lazy evaluation of overview info
Callgrind showed recalc_mapseen was three times more expensive (in terms
of instructions read) than anything else in our codebase.  It was being
called in every vision change, re-evaluating the last seen map terrain
type for every map location in sight.

Remove updating the lastseen info in the vision code, and make a small
change so newsym() uses update_lastseentyp.

From my short tests, this seems to work correctly ...
2023-12-18 10:53:18 +02:00
Pasi Kallinen ea1fdc066a Split lastseentyp updating 2023-12-17 15:43:49 +02:00
Pasi Kallinen 9b8272b57f Split counting mapseen features from lastseentyp 2023-12-17 15:21:37 +02:00
Pasi Kallinen a2aa4edd51 Allow SIGINT (Ctrl-C) to stop the fuzzer 2023-12-17 11:28:13 +02:00
Pasi Kallinen 0a8f919ff3 Make monsters not use camera when hero resists blindness 2023-12-16 23:34:16 +02:00
Pasi Kallinen 0099098d35 Silence some nonnull complaints 2023-12-16 14:03:16 +02:00
Pasi Kallinen 3c421da746 Previous hero rising as undead in bones retains intrinsics 2023-12-15 16:03:26 +02:00
Pasi Kallinen d4c0f6bb75 Fix minetn-1 regions
Fuzzer encountered an error because the game couldn't place
a level region; allow placing the stairs to the left or right
edge of the fixed map part, just in case the randomly generated
map didn't extend out of it.

Fix the teleport region preventing falling into the orctown.
2023-12-13 17:55:42 +02:00
Pasi Kallinen b9768ad43a Fix earthquake causing boulder on lava sanity
Before checking if lava or water fills in the pit created by
an earthquake, drop the boulder on the pit into it.
2023-12-13 14:25:28 +02:00
Pasi Kallinen c2802dba2d Demons cannot be frightened by showing them their reflection
From xnethack by copperwater <aosdict@gmail.com>.
2023-12-10 20:11:29 +02:00
Pasi Kallinen aa5ad3e37e Split tip container menu function 2023-12-10 17:32:47 +02:00
Pasi Kallinen 2996e42b79 Redo my clobbered commit 2023-12-09 16:06:07 +02:00
Pasi Kallinen 252e661b72 Prioritize paying shopkeeper next to you even if multiple are detected 2023-12-09 13:24:50 +02:00
Pasi Kallinen 1ceb9d2d91 Show menu when paying items
... and have more than 1 billed item, and using non-traditional
menustyle.

I opted to add an extra field to the bill struct, because
that made the code cleaner.

Breaks saves and bones.
2023-12-09 12:43:41 +02:00
Pasi Kallinen ecb3a1a68d Change mind flayers, the Wizard, and the riders to bright magenta 2023-12-08 22:03:54 +02:00
Pasi Kallinen ad833ce02d Add more tile grayscale mappings
Color I added to the warg tiles was missing from the greyscale
mapping when generating statue tiles.  Map the missing greys
to slightly darker shades.
2023-12-08 21:16:02 +02:00
Pasi Kallinen 348f88c726 Walking into a shopkeeper tries to pay the bill 2023-12-08 18:31:16 +02:00
Pasi Kallinen 20b91270ba Fix wrong level flags in mazes below Medusa
The mazes between Medusa and the Castle had couple wrong default
level flags, because those levels don't go through the special
level routines.
2023-12-08 14:10:12 +02:00
Pasi Kallinen d2ae6fd5d2 Split out wizmode monpolycontrol part 2023-12-08 08:32:07 +02:00
Pasi Kallinen 3b2d3eabed Change wolf, werewolf, and warg colors
There were 6 brown 'd' monsters; move wolf and werewolf to grey,
and warg to black, as those colors had no canines.

The wolf tiles are already greyish; changed warg tile to be
slightly darker.
2023-12-07 17:47:21 +02:00
Pasi Kallinen 6e2fa24344 Change hezrou and vrock color to green
There are many red major demons, and hezrous and vrocks
now emit poison gas, so change the symbol color to green.

Also adjust vrock tiles to have green. The hezrou tiles
already are green.
2023-12-07 13:50:51 +02:00
Pasi Kallinen 5dc94f3d83 Macro for picking random entry from array 2023-12-05 10:06:27 +02:00
Pasi Kallinen 1c933d689e Remove leftover debug extern define 2023-12-04 17:57:58 +02:00
Pasi Kallinen d8421aa219 Save and restore hero tracks
The tracks left by hero were cleared when player saved and
restored the game, or changed levels.  Now the tracks are
saved in the dungeon level, so changing levels keeps the tracks
left by hero in that level.

Also increased the length of tracks from 50 to 100, and
simplify the tracking function.

Thing not done: fade out old tracks when returning to a level.

Breaks saves and bones.
2023-12-04 17:50:48 +02:00
Pasi Kallinen a30a205c45 Fix sanity error with migrating monster 2023-12-01 22:15:10 +02:00
Pasi Kallinen e6ea551150 Fix segfault when trying to create tame lights 2023-12-01 22:13:46 +02:00
Pasi Kallinen 94d44e433b Fix sanity error when pet ate a mimic corpse
When a pet ate a mimic corpse and started mimicking a monster,
and the user then used #wizmakemap, the sanity checker complained
about "non-mimic posing as foo" - the code was clearing the
pet eating counter, but didn't clear the appearance.
2023-11-29 12:15:08 +02:00
Pasi Kallinen febda956ee Fix status hilites in curses
TEXTCOLOR removal left one #ifndef line in, breaking
status hilites in curses.
2023-11-27 20:12:29 +02:00
Pasi Kallinen 830168f26e Update comment 2023-11-15 07:26:21 +02:00
Pasi Kallinen d2ca1794df Move other add_menu routines to windows.c 2023-11-13 20:12:47 +02:00
Pasi Kallinen f74f7988ff MSDOS: implement valid location highlighting
... for VGA and VESA tiled map.
2023-11-13 12:40:10 +02:00
Pasi Kallinen dd5ca5b058 Change menu_headings to accept color and attribute
Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:

OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline

Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.

Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.

Tested for tty, curses, x11, qt, and win32
2023-11-13 07:33:56 +02:00
Pasi Kallinen c44906b28e Put random room engravings on room locations only
Another case of engraving going on a cloud.
2023-11-10 20:08:45 +02:00
Pasi Kallinen 2e8adda028 Clouds cannot have engravings in them
... so delete the existing engraving if a cloud is put on the map.
2023-11-09 18:08:00 +02:00
Pasi Kallinen 8dc7a4882a Make spell menu work with repeat command 2023-11-05 13:49:04 +02:00
Pasi Kallinen f720e1e548 Themeroom: Cloud room 2023-11-05 13:08:43 +02:00