Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 80a8eaf7e6 Prevent calling doaltarobj twice
My change to make items thrown by monsters landing on altar
caused doaltarobj being called twice when hero dropped an item
on it. Call the newer instance only when monsters are moving.
2023-04-23 07:47:46 +03:00
Pasi Kallinen 8a85f1d92c Fix minetn-6 map generation errors
Two error cases with the map generation in minetn-6:

first one was the lregion placement impossible, caused by randomly
generated mines not going past the map either left or right, and
the stair generation being restricted outside the fixed map.

second was one side of the map being unreachable, because the
mines layout joined to the other side right at the edge of map
behind the small room with the "x" mapchars.
2023-04-22 19:05:45 +03:00
Pasi Kallinen 659fc2feb3 Tutorial: travel 2023-04-22 12:17:24 +03:00
Pasi Kallinen a725447d65 Corpse-eating monsters will home in on corpses
Also allow non-tame ghouls to eat corpses.
2023-04-20 18:56:26 +03:00
Pasi Kallinen 200cc21fb3 Allow some monsters to break boulders
... if the boulder is in a position they want to move to.
Shopkeepers, priests, and the quest leader can break one boulder
and then need to take several turns before being able to break
another.  Riders can break a boulder every turn.
2023-04-19 14:37:55 +03:00
Pasi Kallinen b04ab80cad Allow annotating other levels via #overview
Change the #overview to use a menu, so the player can change
the annotations on levels other than where they currently are.
2023-04-18 09:40:12 +03:00
Pasi Kallinen cfe60aed8d Dismounting a trapped steed
Riding a steed into a trap and dismounting also untrapped
the steed. Try to keep the steed in the trap.
2023-04-17 18:47:05 +03:00
Pasi Kallinen 945e65a19f Move bgcolors option to the map section 2023-04-17 17:07:23 +03:00
Pasi Kallinen 0ac9309e1e Simple options menu shows help for each entry 2023-04-17 15:47:50 +03:00
Pasi Kallinen 6fcce6e135 Redo the portal breakage for the fuzzer 2023-04-17 11:09:58 +03:00
Pasi Kallinen d3e48dfad1 Tutorial: going down and up stairs
Adds the second tutorial level, tut-2.lua
2023-04-16 10:46:03 +03:00
Pasi Kallinen 83ed647a3e Fixes entry 2023-04-16 09:46:37 +03:00
Pasi Kallinen 36f1596c02 Shop door entrance placement
If for some reason a shop room has multiple doors, try all of them
to find a good shop door, instead of just the first one, and failing
if it wasn't a good one.

This only matters for wizard-mode with SHOPTYPE environment var.
2023-04-15 14:25:52 +03:00
Pasi Kallinen 51ebfb2f0b Fix tutorial breaking other portals 2023-04-15 13:25:43 +03:00
Pasi Kallinen 25bf9d2a49 Prevent conflicted shopkeeper moving on top of hero
Peaceful, but conflicted, shopkeeper could move on top
of the hero, if hero was standing on the free spot inside shop.
2023-04-13 21:20:29 +03:00
Pasi Kallinen ad4c71fab3 Avoid placing random niches into subroom walls
Wizmode testing shop generation, I encountered impossible
"Where is shopdoor" - the room that was being turned into
a shop had a subroom sharing the outer south wall with
the parent room, with a random niche placed such that it was
actually in the subroom wall. The niche door was still added
to the parent room, and the shop generation was trying to use
that door as the shop entrance.

As random niches are only used in room-and-corridor style
levels, subrooms aren't that common, so I just opted to
skip the niche generation if it was going to be placed
without being directly attached to the room it wanted.

The niche generation could be changed at a later date to actually
add the niche door to the correct room instead, if we ever feel
it's necessary to have random niches in subrooms.

As an interesting side note, I had no idea random niches were
only placed in the south or north walls of rooms, never to
east or west.
2023-04-13 18:50:31 +03:00
Pasi Kallinen 8b32ae98e9 Add petless conduct
Breaks saves.
2023-04-11 14:21:06 +03:00
Pasi Kallinen ffb61612e3 Option to create the character deaf
Allows creating your character permanently deaf,
for that added challenge.

Breaks saves.
2023-04-11 13:23:30 +03:00
Pasi Kallinen 699473e03f Moving to water is not dangerous if already underwater 2023-04-10 12:23:43 +03:00
Pasi Kallinen cb73cbedb7 Tutorial: backup and restore struct you 2023-04-09 18:15:31 +03:00
Pasi Kallinen 79bdab1f03 Tutorial: puton and remove 2023-04-09 18:00:08 +03:00
Pasi Kallinen 3a3be46624 Bigrm-5 may have patches of ice or cloud 2023-04-09 11:56:35 +03:00
Pasi Kallinen 23ef6e558e Make bigrm-4 terrain symmetrical 2023-04-09 11:12:02 +03:00
Pasi Kallinen 82bb61532c Bigrm-4 fix and variation
The "butterfly" shaped bigroom was missing the four fountains
in the corners of the room - this was due to my copy-paste error
when converting the bigrooms from des to lua.

Also add some variation to the bigroom.
2023-04-09 11:09:53 +03:00
Pasi Kallinen b61aa235c7 Items thrown by monsters landing on an altar 2023-04-08 21:24:10 +03:00
Pasi Kallinen ce1f4788cd Angering monsters hit by items from exploding bag of holding 2023-04-08 18:25:45 +03:00
Pasi Kallinen 3296fc729e cmd_from_func prefers printable key over ctrl combination
If command is bound to multiple keys (like #kick), cmd_from_func
prefers to return the key in the printable range over a ctrl-key
combo.
2023-04-08 11:25:07 +03:00
Pasi Kallinen 6c2d7c3695 Tutorial: twoweapon and swap weapons 2023-04-06 19:30:54 +03:00
Pasi Kallinen a39716ae13 Hellfill: multiple prefabs per level 2023-04-06 13:54:40 +03:00
Pasi Kallinen 916aefc78c Hellfill: vertical breaks 2023-04-06 13:30:48 +03:00
Pasi Kallinen 697ef9760c Curses: partial stack unselecting
In curses, selecting a partial stack, then unselecting the entry,
and then selecting it normally, the entry still kept the quantity
from the partial selection. Make it behave like all the other
windowports by resetting the quantity when the entry is unselected.
2023-04-05 19:50:43 +03:00
Pasi Kallinen 12dd5323c8 Tutorial: eating food
Also document the lua timers a bit more.
2023-04-04 13:04:39 +03:00
Pasi Kallinen 201ee8383e Improve m_search_item
Previously when monster was interested to pick up an item,
the code went through the whole object chain, so going through
all the items on the level. This caused problems with some games,
for example where the player created thousands of meatballs
in separate stacks.

Changed the code so it now looks at the map locations inside
the search radius, and the stacks in those map locations,
skipping locations as early as possible.
2023-04-03 21:03:20 +03:00
Pasi Kallinen 48dccdb5cb Split config file line parsing into separate functions
This should have no difference in behavior, except on Amiga;
as it is no longer supported, I removed all the amiga-specific
config-line handling. If anyone steps forward to support
that platform in the future, it shouldn't be too hard to
add those back.
2023-04-02 11:11:03 +03:00
Pasi Kallinen 52f5f6b11a Juiblex level temperature 2023-04-01 17:48:03 +03:00
Pasi Kallinen ba60bfac25 Themeroom: buried zombies
- add a themeroom with random buried zombifying corpses
- disturbing buried zombies makes them revive much faster
- lua des.object() now returns the object it created
2023-04-01 14:05:18 +03:00
Pasi Kallinen dc12f4f86c Protection from shape changers via wizintrinsics
Setting protection from shape changers via wizintrinsics
caused a sanity error on the next turn, if any monsters affected
by it were in changed shaped on the level.

Call rescham after setting the timeout, so the monsters will
immediately revert to their own form.
2023-03-30 19:56:04 +03:00
Pasi Kallinen 4194b01c17 Tutorial: run prefix 2023-03-28 20:30:53 +03:00
Pasi Kallinen 5c39096fd4 Prevent infinite loop making Medusa statues
While fuzzing, the game got stuck here trying to generate
a random stoneable monster for a Medusa level statue.
I didn't investigate deeper why it failed to find a matching
monster type.
2023-03-28 19:55:39 +03:00
Pasi Kallinen 5d3bebd0aa Fix shop closed engraving on secret corridor
The fuzzer stopped due to the "Closed for inventory" shop engraving
being on a secret corridor; ensure that location is either corridor
or room floor.
2023-03-20 11:09:05 +02:00
Pasi Kallinen fa0ae08f94 Lua object generation didn't obey locked state
Defining des.object({ id="large box", locked=false })
was the same as random locked state. Make it actually mean unlocked,
and not defining locked at all means random.
2023-03-19 20:13:47 +02:00
Pasi Kallinen 59fd05dd5e Fix the prot from shape changers test 2023-03-19 19:36:52 +02:00
Pasi Kallinen e29bfcab54 Split eating non-food into separate function 2023-03-19 15:12:08 +02:00
Pasi Kallinen bf3e784798 Swamp rooms did not delete engravings on pools 2023-03-19 13:03:22 +02:00
Pasi Kallinen 083676e21b Protection from shape changers and the Wizard 2023-03-19 13:01:44 +02:00
Pasi Kallinen f3d457dbd4 Split trap victim generation into separate function 2023-03-19 10:06:50 +02:00
Pasi Kallinen 73f1dd2aee Tutorial: blacklist commands
Just block saving.
2023-03-18 19:02:25 +02:00
Pasi Kallinen c4265fb80c Tutorial: add yet another hidden portal 2023-03-18 16:53:26 +02:00
Pasi Kallinen 2a7be0b050 Tutorial: hunger and eating food
Reset hunger when exiting the tutorial.
Add an optional second parameter to lua pline, forcing a more-prompt.
2023-03-18 14:08:13 +02:00
Pasi Kallinen 633487849b Tutorial: looting containers, zapping wands 2023-03-18 12:07:46 +02:00
Pasi Kallinen 20dbd989f1 Tutorial: Firing missiles and quiver 2023-03-18 11:48:19 +02:00
Pasi Kallinen 3f3c275ed5 Tutorial: throwing items 2023-03-18 11:04:27 +02:00
Pasi Kallinen 5ca4e166b1 More fuzzer branch teleporting 2023-03-18 10:46:10 +02:00
Pasi Kallinen 9340197c4c Remove extra full stop 2023-03-18 09:11:18 +02:00
Pasi Kallinen e37428d5cd Fix fuzzer teleporting out of Fort Ludios 2023-03-18 08:51:37 +02:00
Pasi Kallinen f360dee4dd Engraving sanity checking 2023-03-18 07:30:25 +02:00
Pasi Kallinen aa83dadc1e Add stormy level flag
Which makes clouds create lightning bolts at random.
This flag is used on the plane of air.

Breaks saves and bones.
2023-03-17 20:13:32 +02:00
Pasi Kallinen 4799fc937a Add level flag for plane of fire fumaroles
Also reduce the size of the gas clouds.

Breaks saves and bones.
2023-03-17 19:36:00 +02:00
Pasi Kallinen f2b75c3b0e Fuzzer randomly teleports between dungeon branches
Previously the fuzzer usually stayed in the Dungeons of Doom,
only very rarely going to other dungeon branches. Now, it will
randomly choose a dungeon branch and a level in that branch
to level teleport to.
2023-03-17 14:17:23 +02:00
Pasi Kallinen da0a681688 Make lua map and terrain commands use same routine 2023-03-17 13:25:43 +02:00
Pasi Kallinen a5934470dd Fix boulder-on-lava sanity error
Special level creation could make levels with boulders on top
of lava or water; this was caused by mazewalk populating the maze
before the rest of the level was created.

Add a post-level-creation map cleanup routine, where boulders
and traps on liquid terrain are removed.
2023-03-17 13:13:24 +02:00
Pasi Kallinen 90906ed05a Hellfill: Pillars of lava or water 2023-03-16 12:30:45 +02:00
Pasi Kallinen 441d498300 Tutorial: being burdened, dropping items 2023-03-16 07:44:29 +02:00
Pasi Kallinen bf3a5ec3ed Hellfill: Fort 2023-03-15 20:55:38 +02:00
Pasi Kallinen 201874a85a Curses: delete curses window
When NetHack deletes a window, also free the curses window data.
2023-03-14 11:16:13 +02:00
Pasi Kallinen 2db6f20700 Curses: free all perm_invent data 2023-03-14 09:18:32 +02:00
Pasi Kallinen 35273b8a8c Curses: prevent spurious cursor updates
While watching a ttyrec, I noticed strange behaviour in
the cursor updates; it was moved to approximately middle
of the map window every so often, usually when doing ranged
attacks. This wasn't really noticeable in normal gameplay,
as it was moving the cursor there, and then almost immediately
to where it was supposed to be.

I managed to trace it down to the refresh() in curses_delay_output().
That call updates the terminal to match the ncurses stdscr window,
but the stdscr window cursor position wasn't updated by NetHack.
2023-03-12 19:21:51 +02:00
Pasi Kallinen 62476fe101 Stop blinking cursor on hero when farlooking
I happened to notice when looking at a ttyrec that farlooking
with automatic description would blink the cursor on hero for
one frame, and then back on the farlooked map location.
2023-03-10 14:11:56 +02:00
Pasi Kallinen 96587d2acf Fix curses quitting when trying to move
parse_escape_sequence changed getch timeout, but when receiving
a certain escape sequence, it returned without changing the
timeout back. This caused all subsequent getch calls be
non-blocking, and getch returns ERR when there's no input
waiting in that mode.

NetHack interprets ERR as the terminal going away, so performs
an automatic save.
2023-03-08 12:19:57 +02:00
Pasi Kallinen 8e6cf385b1 Fix subroom doors
Doors weren't getting added to the correct subrooms in certain cases.

Also fix one of the themerooms, because doors have to be added
after subrooms; there was a possibility of no door to the subroom(s)
in that themeroom, because the subrooms overwrote the doors in
the parent room.

Test case for the subroom doors:

Large room, with a medium subroom, with a tiny subroom inside that.
The doors go from outermost room <-> tiny innermost room <-> middle room.

des.room({ type = "ordinary", x = 1, y = 1, w = 10, h = 10,
   contents = function()
      des.room({ type = "ordinary", w = 6, h = 6, x = 2, y = 2,
         contents = function()
            des.room({ type = "ordinary", w = 2, h = 2, x = 0, y = 0,
               contents = function()
                  des.door({ state="random", wall="south", pos = 1 });
               end
            });
            des.door({ state="random", wall="north", pos = 1 });
         end
      });
   end
});

Before this fix:

ROOM: ndoors:1, subrooms:1
  SUBROOM: ndoors:1, subrooms:1
    SUBROOM: ndoors:1, subrooms:0

after this fix:

ROOM: ndoors:1, subrooms:1
  SUBROOM: ndoors:1, subrooms:1
    SUBROOM: ndoors:2, subrooms:0
2023-03-07 09:43:44 +02:00
Pasi Kallinen 0b5956ba34 Tutorial: reset inventory letters 2023-03-05 17:54:14 +02:00
Pasi Kallinen c2d6bde9cd More tutorial level
Add more stuff to the tutorial level:
 - closing a door
 - cursed armor
 - taking off armor
 - shuffled descriptions
 - removing curses
 - reading scrolls
2023-03-05 16:38:24 +02:00
Pasi Kallinen db0441bf02 Split level temperature message into function 2023-03-05 12:34:33 +02:00
Pasi Kallinen 3cd6b00ab7 Split stuck-cannot-go-up/down into separate function 2023-03-05 11:58:23 +02:00
Pasi Kallinen ce0d25129e Spell of knock can knock back small monsters
Differentiates the spell from the wand of opening,
and the spell name sounds like it should do that ...
2023-03-04 19:07:34 +02:00
Pasi Kallinen c6a2803f49 Better algo for picking a room to put stairs in 2023-03-04 18:04:38 +02:00
Pasi Kallinen 10df388245 Untrap tip 2023-03-04 11:02:06 +02:00
Pasi Kallinen 08a2a2a1a4 Saving grace
Once per game, if receiving a killing blow from above 90% HP,
allow the hero to survive with 1 HP.
2023-03-03 17:38:48 +02:00
Pasi Kallinen 2c092bb641 Tutorial: pushing boulders 2023-03-03 16:14:22 +02:00
Pasi Kallinen 075c2832a1 Adjust archeologist and valkyrie intrinsics
I felt it was strange that archeologist started out both
fast and stealthy, but didn't gain searching until level 10.
So, archeologists now start with searching, gain stealth at 5,
and fast at 10.

Similarly valkyries starting out stealthy felt odd, so now they'll
get it at level 3.

This leaves only the rogue starting out innately stealthy, which
feels appropriate.
2023-03-03 11:50:44 +02:00
Pasi Kallinen 3b519c7023 Minor tutorial tweak
Remove the autoopen setting, as it alraedy defaults to on.
Add an engraving mentioning some actions may take multiple tries.
2023-03-03 09:57:49 +02:00
Pasi Kallinen 77f241581c Split dungeon.lua level reading to separate function 2023-03-01 18:33:24 +02:00
Pasi Kallinen ea2cd80349 done_hup is compile-time optional for some reason 2023-03-01 17:08:16 +02:00
Pasi Kallinen fc7a32b86e Tutorial level
Add a tutorial level to teach commands to new players.
Very much a WIP.

Breaks save and bones compat.
2023-03-01 14:00:29 +02:00
Pasi Kallinen 00c756ba75 Lua: Traps without victims
Traps may get corpses generated on them on early dungeon levels,
to warn off fragile starting heroes. Allow creating traps in lua
without the corpse.
2023-02-25 18:05:09 +02:00
Pasi Kallinen 4ce149b2cf Lava walls vs cold rays
Lava walls have a small chance of turning into solid stone wall
when hit by a cold ray. Before this they turned to floor, which
was obviously wrong.
2023-02-22 11:55:24 +02:00
Pasi Kallinen 1efdbacd48 Remove extra backslash from EOL 2023-02-21 17:34:06 +02:00
Pasi Kallinen 08ced2a58b Lava walls cover objects
Items landing into a wall of lava are covered up by it.
Kicking behaves the same as wall of water: splashes,
but doesn't move the item.
2023-02-21 17:06:32 +02:00
Pasi Kallinen 5d659cf1f6 Tips and option to disable them
Adds a more general way to handle gameplay tips, and adds
a boolean option "tips", which can be used to disable all
tips.  Adds a helpful longer message when the game goes
into the "farlook" mode.

Also adds a lua binding to easily show multi-line text
in a menu window.

Breaks save compat.
2023-02-19 15:56:18 +02:00
Pasi Kallinen 91dc1ea834 Fix angering monsters with non-hero magic rays
Can't use gc.context.mon_moving to check if the ray was caused
by hero, as some rays can happen while hero is moving in response
to their action - for example a bolt of lightning from a god.
dobuzz() uses positive type values for magic rays caused by hero,
so just use that.
2023-02-15 11:28:09 +02:00
Pasi Kallinen 861fd82926 Fix the part I forgot 2023-02-09 08:33:32 +02:00
Pasi Kallinen 79f3491b21 Fix hero unhiding
maybe_unhide_at tried to handle both a monster and hero, but
hero being hidden is in u.uundetected flag, and the code was
only checking the monster mundetected field.

The code should probably be changed, either to change all uses
of the u.uundetected to gy.youmonster.mundetected, or perhaps
use a macro ... but these changes are all too big for me
to tackle for now.
2023-02-08 17:10:27 +02:00
Pasi Kallinen b51d548b73 Add S_lavawall to Guidebook 2023-02-07 21:32:18 +02:00
Pasi Kallinen 7aeba46690 Pickaxing or whipping a liquid wall 2023-02-07 07:36:51 +02:00
Pasi Kallinen 7401b44fa1 Walls of lava
Add "walls of lava", basically lava which blocks vision and
require a bit more than just levitation or flight to move through.

No levels use this yet, as testing isn't thorough enough.
2023-02-06 19:23:42 +02:00
Pasi Kallinen b85fb2a197 Split itemaction key pushing to separate function 2023-02-05 21:29:19 +02:00
Pasi Kallinen dbfd7879df Split engulfer explosion message into separate function 2023-02-05 20:26:52 +02:00
Pasi Kallinen d3430bed9f Prevent certain items from random erosion
Prevent wished for items (unless specified), artifacts,
armor and weapons of NPC heroes, and ammo from Longbow of Diana
being generated eroded.
2023-02-05 16:46:54 +02:00
Pasi Kallinen ee3daba8c9 Split peaceful responses into separate functions 2023-02-05 08:24:34 +02:00
Pasi Kallinen 9fd87db543 Ceiling hiders on lava pools
Lava pools are perfectly valid locations for ceiling hiders
if they're hiding there - aka hanging from the ceiling.
2023-02-04 19:39:33 +02:00