Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 495a7e7898 Silence a suggested parenthesis warning 2025-02-16 10:50:04 +02:00
Pasi Kallinen 3cb7819c81 Split monster goal coordinate out of mstrategy field
Instead of packing a coordinate into unsigned long, store the goal in
a coord struct, making the code a bit cleaner.  Monster struct is
of course slightly bigger, but that should not really matter.
No change in monster behaviour.

Breaks saves and bones.
2025-02-16 10:46:21 +02:00
Pasi Kallinen 027bf78f28 Sort monsters for mkclass
An assumption of monster generating code is that monsters within a class
appear in increasing order of difficulty.  This wasn't the case with
some monsters, but swapping the monsters around is rather intrusive,
and doesn't really lend to changing monster difficulties when needed.

As a result, for example ghouls would not randomly generate when they
should have at certain level difficulties (where a ghoul is weak enough
to generate but an ettin zombie would be too strong).

Keep a separate array of monster indexes sorted correctly, generate it
when required by mkclass()

Description of this bug via copperwater <aosdict@gmail.com>
2025-02-13 17:17:00 +02:00
Pasi Kallinen d1f0cfce92 No hangup save while in tutorial
Tutorial code doesn't handle saving and reloading the game gracefully,
and manually saving has been disabled in there already.
Also disable automatic saving in the tutorial when the terminal goes away.
2025-02-10 17:48:01 +02:00
Pasi Kallinen 3ffbfc724c Fix another impossible no_charge object
Tame earth elemental picked up a no_charge object from a shop and moved
it out of the shop, causing "no_charge obj not inside tended shop"
impossible.  Non-tame monsters picking up no_charge items cleared that
bit, so make the same happen for pets.
2025-01-28 21:26:10 +02:00
Pasi Kallinen c9abc92dd7 Fix lua.adoc 2025-01-24 19:04:17 +02:00
Pasi Kallinen 991a1dbe43 Fix exploding landmine and boulders next to lava
Same issue as with breaking a wand of digging in commit 7ce0751a
2025-01-20 19:26:12 +02:00
Pasi Kallinen 0c18792916 Fix vision when vault guard clears corridor 2025-01-20 19:24:09 +02:00
Pasi Kallinen 663ab8aa89 Fix wall spines outside map bounds 2025-01-19 21:16:27 +02:00
Pasi Kallinen 7ce0751a6c Fix breaking wand of digging and boulders next to lava
If one or more boulders were next to lava and hero broke a wand of digging
next to that location, the boulder(s) stayed over the lava causing a sanity
checking error.
2025-01-19 19:34:58 +02:00
Pasi Kallinen 7f36a5db3c Fix vision when guard moves a monster 2025-01-18 19:30:10 +02:00
Pasi Kallinen 6df83cb677 Fix pet data being reset when charm monster was cast
Casting charm monster with pets nearby could reset the edog struct.
If the pet ate a mimic corpse and was pretending to be something else
when that edog reset happened, the sanity checking would issue an impossible.
The error happened because meating was reset, but the pet appearance was not,
but the edog struct reset is the part being wrong.  Lets not do that.

To reproduce, turn on sanity checking, create a tame dog, give it a mimic corpse
to eat, #wizcast charm monster next to it.
2025-01-17 17:07:07 +02:00
Pasi Kallinen f0a0a74dcc Hero polyed into slithy monster and sitting 2025-01-12 16:42:33 +02:00
Pasi Kallinen aa12620376 Fix vision with temporary clouds over pools
Vision wasn't cleared correctly when a temporary [poison] cloud
was over a pool and hero was under water while the cloud disappeared.
2025-01-10 15:49:20 +02:00
Pasi Kallinen 0e04988fec Fix another no_charge in untended shop
This time the no_charge object was being carried by a pet.

To trigger, drop an object into shop, decline to sell it,
pick up an object belonging to shopkeeper, decline to buy it,
wait for your pet to pick up the no_charge object you dropped,
teleport out of the shop, wait for shopkeeper to walk out of
the shop.
2025-01-10 15:46:09 +02:00
Pasi Kallinen de38ce2c90 Fix vision: force bolt breaking door with temp cloud 2025-01-09 19:44:21 +02:00
Pasi Kallinen 843b02ec1d Add vision sanity checking, fix more vision
- Add a vision sanity checking routine

- Recalc block point when digging a door for temporary clouds

- Add recalc_block_point after cvt_sdoor_to_door, because doorways
  on the Rogue level have no doors, and otherwise the sanity checking
  would complain.  This doesn't actually change how the Rogue level
  vision works, as it uses a different vision system

- Monster using a trap in a secret corridor revealed the corridor,
  but didn't unblock the vision unless you saw the location
2025-01-09 17:28:24 +02:00
Pasi Kallinen c956e3e215 Fix vision when applying a wand of digging 2025-01-08 13:59:50 +02:00
Pasi Kallinen 256b820fe3 Fix impossible no_charge obj in untended shop
Sanity checking was complaining about a no_charge obj in untended shop.

Angry shopkeeper was accepting thrown items as no_charge objects:
To reproduce the impossible, kick down the shop door angering
the shopkeeper. While the shopkeeper is still in their shop,
throw an item they don't want into the shop. Wait for the shopkeeper
to get out of the shop.

Move the anger checking before the sell auto-accept code,
so the shopkeeper will charge for the object.
2025-01-08 12:59:08 +02:00
Pasi Kallinen ae1a86d7be Fix vision when door is destroyed by ray effect
A door was destroyed and vision unblocked without considering
temporary (poison) clouds.
2025-01-07 17:39:46 +02:00
Pasi Kallinen b27c9102f6 Fix vision when opening a door
If a monster or hero opened a door with a temporary (poison) cloud
on it, the location could be seen through even with the cloud.
2025-01-07 15:14:27 +02:00
Pasi Kallinen 108d975694 Fix vision in guard created corridor
... when hero angers the guard, the guard's previous location
didn't get the vision blocking fixed.
2025-01-07 10:52:01 +02:00
Pasi Kallinen f4cd5ed065 Fix vision with pushing a boulder and temp clouds
remove_object cleared the vision when the last boulder was removed
from a location, without considering temporary [poison] clouds.
This particular case happened when pushing a boulder.
2025-01-06 20:22:56 +02:00
Pasi Kallinen 274b15cd77 Fix vision when xorn digs down on a wall
A xorn inside a wall using a wand of digging to dig down, the vision
was still blocked at that location.
2025-01-06 20:11:35 +02:00
Pasi Kallinen 4392f5fa4e Fix vision in some cases with boulder falling into pool
We can't just unconditionally unblock vision for a location when a boulder
falls into a pool, because the location may also have a (poison) cloud on it.
2025-01-06 19:46:38 +02:00
Pasi Kallinen 57bf003c26 Fix rolling boulder not unblocking sight at wall of water
A rolling boulder that destroys a wall of water did not unblock
the vision at that point.
2025-01-05 13:35:21 +02:00
Pasi Kallinen 1ef3167ca0 Steed #monster breath feedback
Using #monster to make the steed use the breath weapon often
failed because the steed did not want to breathe at weak or
too strong monsters.
Make #monster force the steed use the breath, and if there is
no targets available, make the steed make some noise as feedback.
2025-01-04 16:37:14 +02:00
Pasi Kallinen 2ebe8915f6 Prevent melting ice destroying necessary traps
A magic portal ended up on a melting ice.
2025-01-04 16:05:07 +02:00
Pasi Kallinen 9313fb7747 Clear tin-eating struct when object goes away
The tin-eating context was pointing to a non-existent object,
causing an error when the fuzzer somehow managed to continue eating
the freed tin object.
Clear the pointer when the tin leaves inventory or the object
is deleted.
2025-01-03 22:21:14 +02:00
Pasi Kallinen ba731a346b Fix shop steal when teleporting your swallower
Picking up a shop item and not paying it, getting swallowed
by a monster, and then teleporting the monster out of the shop
with you in it, the shopkeeper didn't notice the theft.
But the object was not marked as paid either.

Also prevent giving a message of the swallower disappearing
and appearing when it was teleported.  (Although now there's
no message given, so something should be added ...)
2025-01-03 20:58:26 +02:00
Pasi Kallinen 114f99867e Fix unicorn movement special handling
My commit 82f0b1e8ea to make monsters which had nowhere
to move would panic attack the hero if possible, broke the
special unicorn handling; they avoid being in-line with hero,
so often had nowhere to move...

Fixes #1344
2025-01-01 23:43:15 +02:00
Pasi Kallinen 0a58b7a540 Tweak tourist xp gain from new monsters
Remove the XP gain for tourist seeing a new type of monster
nearby, as it apparently made tourists a bit harder by forcing
early level gains.

Monsters next to hero are still marked as seen close-up, but
fix the code so it doesn't count undetected monsters.

Tourists still gain XP from "taking photos" of new types of monsters,
but only if they haven't seen the monster close up before.
(No actual photos are taken.)
2025-01-01 21:43:31 +02:00
Pasi Kallinen 1282863f5c Fix breaking wand of digging not touching boulders
Applying a wand of digging skipped all the affected locations
with any boulders on them.
2024-12-29 18:17:57 +02:00
Pasi Kallinen 6c895ab6f6 Boulder-over-pit sanity when breaking wand of digging 2024-12-28 20:54:36 +02:00
Pasi Kallinen 5f95831526 Creating a pit in a wall message tweak
"A pit appears in the wall" sounds a bit silly, so change it to
"The wall crumbles into a pit"
2024-12-28 20:52:39 +02:00
Pasi Kallinen 767a20e21f Hacky fix for pline recursion outputting raw_print
When glyph updates are on, pline can be called recursively
when the vision is being fully recalculated.  This caused
the recursively called pline to output raw_pline text.

Not sure if this is the correct way to fix it, but can't really
turn off or block the glyph update notices either ...
2024-12-28 20:41:43 +02:00
Pasi Kallinen 454978fadd Avoid boulder-over-pit sanity when filling empty maze
This shouldn't happen unless doing special level commands in
strange order, but handle it anyway...
2024-12-28 20:33:18 +02:00
Pasi Kallinen 72fb06a40a Unhide monster moving over to teleport trap 2024-12-28 20:31:45 +02:00
Pasi Kallinen d11747899e Fix boulder-over-pit sanity after landmine blows up 2024-12-28 20:30:11 +02:00
Pasi Kallinen 66d0307e95 Impossible timer after vault guard entered
Fuzzer encountered impossible "timer sanity: melt timer on non-ice",
when vault guard entered the vault, changing the vault wall unconditionally
into room floor; in this case the vault wall was ice with a melting timer
attached.

Delete any melting ice timers on that location when turning it into floor.
2024-12-28 19:43:14 +02:00
Pasi Kallinen 6530951fd5 Impossible timer after dipping a lit potion of oil
Dipping a lit potion of oil into another potion could
turn the potion of oil into another potion; this resulted
in "burn_object: unexpected obj" impossible after the lit timer
ran out.

Just make an explosion if trying to dip a lit potion of oil.
2024-12-28 19:39:02 +02:00
Pasi Kallinen 8b11bda6cb Open cavern -style Gehennom filler level 2024-12-22 18:14:12 +02:00
Pasi Kallinen 0079bf87bb fixes update 2024-12-21 18:19:42 +02:00
Pasi Kallinen 6b0e21dc1a Wish alias "tripe" for tripe ration 2024-12-21 14:11:00 +02:00
Pasi Kallinen f7e86aa150 Add a new bigroom variant "two hexagons" 2024-12-21 12:19:26 +02:00
Pasi Kallinen e7a714849e luahelper doc nit 2024-12-21 12:06:20 +02:00
Pasi Kallinen cc31017265 Use NO_MATERIAL instead of a magic number 2024-12-20 19:39:16 +02:00
Pasi Kallinen 5de7f986a0 Forget obj trap known in bones file 2024-12-19 15:29:29 +02:00
Pasi Kallinen 87694e1a95 Hero remembers trapped boxes
After finding a trap on a chest or a large box, remember it
as trapped: "You see here a trapped large box."
Randomly generated chests and boxes can be obviously trapped.
Allow defining obviously trapped containers via lua.

Invalidates saves and bones.
2024-12-19 13:11:25 +02:00
Pasi Kallinen faf2267aba Use correct variables, not where we are trying to go 2024-12-18 10:35:54 +02:00
Pasi Kallinen 80a0a309ea Don't advance spell skills when using wizcast 2024-12-17 22:55:22 +02:00
Pasi Kallinen 20c456cbbb Avoid using doopen return value in test_move
We can't rely on doopen_indir return value to
check whether hero moved and opened a door.
Instead, explicitly check whether the door is still
closed, and whether hero moved.
2024-12-17 20:58:02 +02:00
Pasi Kallinen 0381e61624 Fix out-of-bounds in test_move
Hero was on the top-left of an open map at (1,0), and
a monster was trying to knock them back to (0,-1).
2024-12-17 18:23:01 +02:00
Pasi Kallinen e778d95ace Accessibility: more message locations pt 7 2024-12-14 16:37:49 +02:00
Pasi Kallinen 79affad312 Accessibility: more message locations pt 6 2024-12-14 16:28:20 +02:00
Pasi Kallinen 141d24bdeb Accessibility: more message locations pt 5 2024-12-14 16:19:14 +02:00
Pasi Kallinen 1849985214 Accessibility: more message locations pt 4 2024-12-14 15:51:55 +02:00
Pasi Kallinen 369f1ff959 Accessibility: more message locations pt 3 2024-12-14 15:36:05 +02:00
Pasi Kallinen 055c0d5954 Accessibility: more message locations pt 2 2024-12-14 15:30:12 +02:00
Pasi Kallinen 8e186fd5e6 Accessibility: more message locations 2024-12-14 15:24:24 +02:00
Pasi Kallinen 7fa38eb7b3 Use pline_mon instead of pline_xy
Forgot about this function. Whoops.
2024-12-14 15:20:17 +02:00
Pasi Kallinen 4f37795f96 Accessibility: pet message locations 2024-12-14 15:00:46 +02:00
Pasi Kallinen fd23463941 Sparkle shield effect and accessibility
When sparkle is turned off, there are some places where
a monster resisting the effect did not give any message.

This fixes some of those.
2024-12-14 14:34:22 +02:00
Pasi Kallinen cbb0f9079d Wand of striking strikes the ground
... if dropped while levitating/flying.
2024-12-09 14:36:14 +02:00
Pasi Kallinen 57abae29e8 Don't switch away from polearm if monster in range
Using 'f', if hero is wielding a polearm, and a monster is in range,
don't switch away even if we do have ammo in quiver and a launcher
in the inventory.
2024-12-08 22:19:36 +02:00
Pasi Kallinen dafd854993 Gelatinous cubes eat organic objects inside them 2024-12-08 17:57:59 +02:00
Pasi Kallinen 78289a7f83 Archeologists' fedora is lucky 2024-12-08 16:17:35 +02:00
Pasi Kallinen a3f0b54aea Healers gain experience by healing pets 2024-12-07 12:50:59 +02:00
Pasi Kallinen 9d68d171fb Typofix 2024-12-07 11:37:15 +02:00
Pasi Kallinen 863d455e1d Tourists gain experience by using camera flash on monsters
This counts as seeing the monster up close, so the tourist
doesn't need to get next to the monster
2024-12-07 11:24:30 +02:00
Pasi Kallinen 12228cac49 Tourists gain experience by going to new dungeon levels 2024-12-06 22:10:17 +02:00
Pasi Kallinen 89c4c3a722 Tourists gain experience by seeing new types of creatures up close
Experience equivalent to killing a monster is gained when starting a turn
adjacent to and being able to see the monster.

Breaks saves.

Idea and parts of code via dNetHack
2024-12-06 21:30:23 +02:00
Pasi Kallinen 5eb7566eba Prevent two possible ways to die in the tutorial 2024-12-06 17:36:34 +02:00
Pasi Kallinen d318d2a489 Code formatting nit 2024-12-06 16:58:01 +02:00
Pasi Kallinen e23e6ef235 Blessed scroll of destroy armor asks which armor to destroy
via xNetHack with some slight modifications.
2024-12-06 11:09:27 +02:00
Pasi Kallinen 9b4f38eebe Blessed scroll of taming increases tameness of pets 2024-12-05 16:44:05 +02:00
Pasi Kallinen 4b15085bb1 Avoid naming Vlad's entourage if vampires are genocided 2024-12-05 16:16:55 +02:00
Pasi Kallinen b73581b745 Looking around the map in tutorial 2024-12-05 15:42:15 +02:00
Pasi Kallinen 08be1bafdd Explain ctrl-key combos in tutorial
When tutorializing a command that uses a ^X notation, show Ctrl-X
instead.  Also show an explanation of the ^X nearby.

The only ctrl-key combination that can currently happen in the tutorial,
without rebinding keys, is the kick-command.

Fixes #1327
2024-12-05 15:36:30 +02:00
Pasi Kallinen b96c59e9b1 Angry god may remove an intrinsic 2024-12-04 20:54:47 +02:00
Pasi Kallinen c868119a33 Add missing full stop 2024-12-04 16:46:05 +02:00
Pasi Kallinen 53f43ab00b Qt: show main window normally instead of maximized
Sidenote: The main window size calculations are getting stupid.
It would be better to find out the widget sizes and shift
the splitter up, instead of letting it just take up half of the main window.

Idea and part of the code by Richard Henschel
2024-12-03 19:52:30 +02: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
Pasi Kallinen 945ccff1ff Allow changing command autocompletions via #optionsfull 2024-10-19 14:46:11 +03:00
Pasi Kallinen 696af89299 Change MSGHANDLER from compile-time to sysconf 2024-10-19 10:47:53 +03:00
Pasi Kallinen d35aa35c3f Don't put the unknown command message into history
Even with Norep, it was cluttering the message history buffer.
2024-10-18 17:54:05 +03:00
Pasi Kallinen 0530ca0758 Fix the undiggable/nonpasswall stuff
wall_info (aka flags) is overloaded with other stuff.
2024-10-18 16:52:29 +03:00
Pasi Kallinen c33a6e7c0b Wizmode wishing for undiggable/unphaseable walls 2024-10-18 14:20:24 +03:00
Pasi Kallinen f12635ccd9 Prevent monster generation in the sokoban trap hallway
Makes Sokoban far less tedious when you don't have to worry about
monsters randomly popping up in the trap hallway while you're pushing
the boulder.

Adds a new exclusion zone for monster generation, and the goodpos
routine avoids the zones when GP_AVOID_MONPOS is used.
2024-10-18 13:30:51 +03:00
Pasi Kallinen 9e4b2c121b Improve the exclusion zone code
I forgot to add the code to flip the exclusion zones when implementing them.
Also improve the zone coordinates so they're correct outside of map contents.
2024-10-17 12:34:06 +03:00
Pasi Kallinen d746060d6e Boomerangs should not mulch
I think this is a regression, but I didn't bother compiling an older
version to check.
2024-09-28 17:50:14 +03:00
Pasi Kallinen d126ae9a42 Reduce crystal plate mail weight 2024-09-18 21:39:55 +03:00
Pasi Kallinen 6f64ed90ed Curses: prevent menu search without menu options
First noticed this when watching someone livestream, and managed
to figure it out from there: The window that pops up when looking
at a pile of objects under you by pressing ':' is marked as a menu,
but has no selectable options.  Curses still allowed you to use the
menu-search command (':') on it.

Prevent the menu search command in windows with no selectable entries.
2024-09-08 20:29:58 +03:00
Pasi Kallinen 96fc77cc70 add pauper to fixes 2024-08-30 19:20:31 +03:00
Pasi Kallinen e645c0b4bb Allow starting game as pauper, without any inventory
And also without spells, skills, or preidentified items.
This also implies nudist.

Breaks saves and bones.
2024-08-29 20:51:13 +03:00
Pasi Kallinen cf44c3046e Join wall spines with walls of water and lava 2024-07-09 18:08:19 +03:00
Pasi Kallinen d4ac146c5f Pets avoid a possible boulder pushing location in Sokoban 2024-07-06 23:12:19 +03:00
Pasi Kallinen 078e22be2e Query menu for hide or spin web monster ability 2024-06-17 18:12:12 +03:00
Pasi Kallinen 78bf0db5b3 Fix copypaste error 2024-06-15 19:04:57 +03:00
Pasi Kallinen 89ea47f702 Monsters can track hero through fixed teleport traps
Also make fixed teleport traps always trigger when entered.
2024-06-15 18:44:30 +03:00