Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen f131942dd2 Another tamedog message
Give a different message when a peaceful creature was tamed.
Allow suppressing this and the previous message, when the caller
handles messaging.
2024-03-24 10:48:29 +02:00
Pasi Kallinen 4d206c1c40 Make tamedog give a message
People seemed to be confused when a monster next to them was tame
after stepping on a magic trap; this is also an accessibility issue.
2024-03-23 18:37:12 +02:00
Pasi Kallinen e0cb6e2206 Query menu for putting ring on left or right hand 2024-03-23 13:22:29 +02:00
Pasi Kallinen 720c62c340 Ring of aggravate monster increases level difficulty 2024-03-23 12:35:54 +02:00
Pasi Kallinen a26f3d1838 yn_function menu code cleanup 2024-03-23 11:05:38 +02:00
Pasi Kallinen 82a698f333 Comment typofix 2024-03-23 10:36:00 +02:00
Pasi Kallinen 9a870b5f06 Option to use a menu to answer yes/no prompts
Add a new boolean option 'query_menu'. If on, game will pop up
a menu for specific yes/no questions, instead of using an input prompt.
2024-03-22 19:19:57 +02:00
Pasi Kallinen cbae237d62 Minor CRASHREPORT formatting bit 2024-03-22 17:54:36 +02:00
Pasi Kallinen fe2f58fbad Curses: Fix accessing illegal window id 2024-03-21 16:55:26 +02:00
Pasi Kallinen 8e83fcb1cc Fix returning from tutorial
Removing these two values from the stack seems to prevent calling
the leave_tutorial hook.
2024-03-20 22:44:12 +02:00
Pasi Kallinen 23d1657dca Add walking on traps to default paranoid_confirm 2024-03-20 19:31:09 +02:00
Pasi Kallinen e3ec21c5d3 Curses: avoid redrawing message window for each restored message 2024-03-19 19:19:16 +02:00
Pasi Kallinen 55263050df Doc: windowport putmsghistory 2024-03-19 18:59:23 +02:00
Pasi Kallinen ba7af36bfc Curses: Fix message window unhighlighting
The recent change to allow setting window colors in curses
resulted in PDCurses clearing the message window background color.
2024-03-18 10:02:51 +02:00
Pasi Kallinen 0700f60983 Fix segfault in curses
Curses handles menu and text windows specially; their id numbers
keep going up, so we need to check if the id is for a menu or
text window instead of directly accessing the windows array.
2024-03-17 20:09:43 +02:00
Pasi Kallinen 4030ef13a0 Curses: implement the windowcolors option
Allow changing the curses windows foreground and background colors,
for example:

OPTIONS=windowcolor:menu #8000F0/20F080 message grey/blue
2024-03-17 18:41:52 +02:00
Pasi Kallinen cad4d87101 wishtest fix
left-over bit from testing
2024-03-16 17:09:54 +02:00
Pasi Kallinen 9d97835686 Minor wishing alias improvement
Previously when wishing for "ring of protection from shape shifters",
you got a random ring instead of the protection from shape changers,
because the string matching alias was "protection from shape shifters"
without the object class.  Now, we'll check if the wish matched any
object class, but not existing object or alias, and try matching
the aliases again, but only those of the already matching obj class.

Add an alias for the ring of increase accuracy: "ring of accuracy",
and tests for it.
2024-03-16 16:59:58 +02:00
Pasi Kallinen c91d8d9450 Curses: unnecessary window erasing
When removing a temporary (menu, text, popup) window, the code
was erasing it from memory and then refreshing the screen.
This is unnecessary, as we're refreshing all the windows anyway.
2024-03-16 13:58:28 +02:00
Pasi Kallinen 243f6410d2 Curses: simplify color handling
The map frame (background) colors were all over the place; the
code should be much cleaner now, and still work exactly the same
as before.

I tested this with terminals with 8, 16, and 256 COLORS.
2024-03-15 20:36:56 +02:00
Pasi Kallinen 464d0c9269 Curses: swap the grey and no-color initialization
The grey color was initialized as default foreground color,
and no-color as white.
2024-03-15 11:06:44 +02:00
Pasi Kallinen 6e6c8a7208 Curses: fix message window border
When certain options (eg. legacy at least) were turned off,
the curses message window wasn't redrawn after the character creation.
2024-03-09 22:58:28 +02:00
Pasi Kallinen bb8ac1cded Curses: message window unhilite
The curses message window shows new messages bold, and removes the
bolding from older ones.  The code was calling curses mvwchgat with
attribute and color parameters in the wrong order.  Also change the
code to actually retain the color of the window, so it just removes
the bold attribute.
2024-03-09 18:44:31 +02:00
Pasi Kallinen 8cd8759e04 Walking on ice can make you slide in a random direction 2024-03-07 19:29:09 +02:00
Pasi Kallinen 2de0c8cacb Qt: make all menus modal
This fixes a lot of problems where a menu or a text window was up
and the main window accepted input - for example you could move around,
making another window of the same type pop up ...
2024-03-04 11:39:32 +02:00
Pasi Kallinen 53778ee507 Use single define for max message history
... instead of having every windowport define their own variant.
Affects tty, curses, X11, and Windows GUI.
2024-03-03 11:34:59 +02:00
Pasi Kallinen 140fb7215d Message location for monster going thru trap door 2024-03-02 10:00:38 +02:00
Pasi Kallinen 8588873858 Item destruction and recharging fix
Recharge only handles items carried by hero.
I don't think it really matters that we just skip it, but leave
a FIXME in the code if anyone has enough energy to improve this later.
Fallout from the unified item destruction.
2024-03-02 09:29:55 +02:00
Pasi Kallinen 121cf75d39 Minor changes to mention_map
Disable it during screen redraw.
Always use the message coordinates with it, even if accessiblemsg is off.
2024-02-29 18:29:43 +02:00
Pasi Kallinen 25fa293c81 Accessibility: lookaround command, mention_map option
Adds a new extended command #lookaround, which will describe
the map around the hero they can see or remember.

Adds a new boolean option mention_map, which will give a message
when an interesting map location in sight changes.
2024-02-28 20:53:52 +02:00
Pasi Kallinen dd37c5326a Accessibility: showdamage option
Add a new boolean option showdamage, if on, outputs a message
like "[HP -2, 14 left]" - several variants have something similar,
but I chose the message based on how eSpeak said it, while keeping
it short.
2024-02-24 17:38:46 +02:00
Pasi Kallinen c7e2ebe83c Check inventory protection only when hero is carrying it
TODO and better fix would be to have similar check for
monster inventory.
2024-02-21 11:28:49 +02:00
Pasi Kallinen d42efcd04f Slightly randomize the spellbook in vlad's tower
Replace the guaranteed invisibility with a somewhat high-level
spell sort-of thematical to Vlad or vampires in general
2024-02-21 09:47:47 +02:00
Pasi Kallinen 391295cfdc Move comment 2024-02-21 08:18:40 +02:00
Pasi Kallinen e76ab9558f remove register that snuck in 2024-02-20 22:13:31 +02:00
Pasi Kallinen ea38ddcb13 Fix mplayer weapon weight 2024-02-20 22:11:42 +02:00
Pasi Kallinen a0c28e97da Qt: split menu window color and attr setting 2024-02-18 13:27:47 +02:00
Pasi Kallinen 2952bdab63 No secret doors or corridors on the early levels
New players often get stuck on the first level when they can't
find the secret door or corridor.  Make the first two levels
have no such features.
2024-02-18 11:47:02 +02:00
Pasi Kallinen d511944dda Add missing initializer for field w_what 2024-02-12 12:57:50 +02:00
Pasi Kallinen b37f1408d8 Self-recover for linux
Compile-time option SELF_RECOVER was implemented for Windows;
add it to unix systems too, with it being on by default when
compiling with the linux hints file.
2024-02-08 11:34:59 +02:00
Pasi Kallinen 6b9f411a32 Accessibility: mon_movement
Adds a new boolean option, mon_movement. When hero notices monster
movement, give a message. Use with spot_monsters and accessiblemsg.
2024-02-07 19:50:38 +02:00
Pasi Kallinen 6c874267b8 Correct petattr doc in Guidebook 2024-02-06 08:54:32 +02:00
Pasi Kallinen 8c815d3bfa Init petattr in core, not in curses
My recent change to petattr caused a crash in curses when no
petattr was used in config file - because curses was setting
petattr to curses-specific value.  Init the setting in core
instead.
2024-02-06 08:50:16 +02:00
Pasi Kallinen 0d7fc06eb9 Do garbage collection on luacore
Another lua state that is not freed until end of game,
so clean up the stack and do GC regularly.
2024-02-03 12:55:10 +02:00
Pasi Kallinen e7a7526ea9 Minor code formatting 2024-02-03 10:56:16 +02:00
Pasi Kallinen fc0b61be60 Fix another wall_angle problem
Secret doors also need the correct wall_angle.
2024-02-02 18:41:45 +02:00
Pasi Kallinen 2a5a7160c9 Fix object weight when part of stack burns up on floor 2024-02-01 20:58:22 +02:00
Pasi Kallinen 95e42bf692 Split out random trap type picking 2024-01-29 20:10:07 +02:00
Pasi Kallinen 97678379dc Split picking familiar permonst type 2024-01-29 19:00:25 +02:00
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