Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen ccaadaa00e Prevent trapdoors and holes dropping you into Sanctum 2022-09-20 12:07:37 +03:00
Pasi Kallinen 2368c59f69 Knockback requires solid physical hit
Exclude unsolid monsters - air, water, and fire elementals.
2022-09-18 17:56:04 +03:00
Pasi Kallinen bb3dc379bc Themerooms: Engraving hints the location of buried treasure
Add two new themeroom functions that are called when generating
the level: pre_themerooms_generate and post_themerooms_generate,
calles before and after themerooms_generate.

Allow the buried treasure -themeroom to put down an engraving
anywhere on the level, hinting at the location of the treasure.

des.object contents function now gets the generated object passed
to it as a parameter.
2022-09-18 12:45:16 +03:00
Pasi Kallinen d4c28b3ab5 Prevent impossible lighting a massive stack of candles 2022-09-16 19:55:49 +03:00
Pasi Kallinen 48bd67a25f Fix CI warning 2022-09-15 18:55:15 +03:00
Pasi Kallinen 3605f18a8e Split themeroom shape from themeroom contents
Previously, the tetris-shaped rooms were always either
normal rooms, or turned into shops or other special rooms
in NetHack core. Now, the themed room lua code first picks
the themed room (which can be a themed or shaped), and some
of those will then pick a random filling (eg. ice floor,
traps, corpses, 3 altars).

Adds a new lua binding to create a selection picking locations
in current room.

The content-function in special level regions now get passed
the room data as a parameter.
2022-09-15 18:09:40 +03:00
Pasi Kallinen 99e45e6daa Allow suppressing debugfuzzer warnings 2022-09-13 13:41:27 +03:00
Pasi Kallinen d7abdb96c4 More damageum return values 2022-09-11 21:52:46 +03:00
Pasi Kallinen a3ba958728 Use define in damageum return value check 2022-09-11 21:30:54 +03:00
Pasi Kallinen a733004912 Remove the per dungeon level door limit
Number of doors in a room-and-corridor style level was fixed
at 120; now the doors-array is dynamically allocated when needed.

Breaks saves and bones.
2022-09-09 19:40:45 +03:00
Pasi Kallinen 82867ccdaf Fix traps generated inside walls
When fuzzing, noticed a trap generated inside a wall. Culprit
was one of the themed rooms that generates a rectangular room and then
puts freestanding wall columns inside.  Note in somexy that it can
return a non-accessible location, and change the places that used
it and absolutely needed a space to somexyspace.
2022-09-09 12:03:12 +03:00
Pasi Kallinen e952f67f2c Add #wizcast command to cast any spell
Wizard-mode command to cast any spell without checks that would
prevent casting, and with no energy use.

Mainly to allow the fuzzer to exercise the spell code paths.
2022-09-06 22:58:28 +03:00
Pasi Kallinen e818395a55 Add tipping a container to herecmdmenu 2022-09-05 23:27:58 +03:00
Pasi Kallinen f58f43bd78 Cannot kick while squeezed on top of a boulder 2022-09-05 11:21:19 +03:00
Pasi Kallinen 601dba5279 Make glorkums emit impossible 2022-09-04 17:43:06 +03:00
Pasi Kallinen f5a9901db1 Special levels: mkmap roomno cleanup and room removal after map
mkmap creates mines-style full-level maps, so it should wipe
out all the room numbers in the level away. Also, it uses
temporary rooms for making sure the map is fully joined together;
those temporary rooms were left on the map, but should've
been cleared away.

When putting down map-parts on the level, don't remove the room
data which would be under that map; the map may have holes in them
(using the "x" map char), so a room may still exist there.
I don't think it matters if there is any room data which doesn't
have any room numbers referring to it in the level.
(Usually the special levels use map right after level_init anyway,
so there wouldn't be any rooms in the level)
2022-09-03 19:10:45 +03:00
Pasi Kallinen c447d091b1 Fixes entry 2022-09-01 17:09:26 +03:00
Pasi Kallinen a9c91d5744 fixes entry 2022-08-28 18:48:01 +03:00
Pasi Kallinen 1acd8fd549 Fix migrating monster throwing a potion
When a monster did something trying to get out of a boulder fort,
it usually meant teleporting or going down stairs or a hole.
The code didn't check for the action return value, and resulted
in a migrating monster being able to throw a potion at hero.
2022-08-28 18:29:21 +03:00
Pasi Kallinen b4c45a4b8e Fix hang when getting an input prompt
When you were busy with an occupation, such as digging with
a pickaxe, and a prompt showed up to ask you enter something,
the game just hung with infinite loop.

Remove the occupation check returning a NUL from the input
function. I didn't notice any side effects, but I would not
be surprised if something comes up ...

I didn't investigate which commit caused this, but I suspect my
rhack or parse changes.
2022-08-28 14:09:09 +03:00
Pasi Kallinen 723ee6d1f6 Expose selection bounds to lua 2022-08-26 13:07:52 +03:00
Pasi Kallinen 5e9ed7a290 Some selection optimizations
- Add bounds, so that we don't process any locations outside
  as those locations are known to be unset
- The bounds are only recalculated if needed
- Replace instances of selection_not where we actually want
  a new selection with all locations set
2022-08-26 12:43:40 +03:00
Pasi Kallinen 36f2dedeb6 Adjust couple therecmdmenu entries
- Don't show attacking a peaceful or tame monster, as
  that is actually swapping places with them - so add that.

- Don't show naming a hostile monster - it's usually not
  wanted, and this way when clicking a hostile monster, the
  only entry is the attack, so will be executed automatically.
  This makes it much more usable.
2022-08-25 18:10:50 +03:00
Pasi Kallinen 51ac21bc88 Make mouse clicklook report only the specific tile
Previously the mouse clicklook mentioned every tile that matched
the character symbol, leading to overload of information and
if playing with tiles, it was mostly useless. Also the most
important bit - the tile info - was last in the text.

Now mouse clicklook only reports the exact tile information
that was clicked on.
2022-08-25 17:17:42 +03:00
Pasi Kallinen 2da4d92751 Fix room array overflowing into subrooms
If the map is big enough so that makerooms generates the maximum
allowed number of rooms for the level, the last room will "overflow"
into the subrooms array.

The rooms array assumes the last entry has hx = -1, and add_room
changes the next room hx to -1 but because the subrooms array
is right after the rooms array, this change actually touches
the first subroom on the level.

This has been present since who knows how long, but because
the levels are normally small enough, the room limit is never hit.
2022-08-24 21:30:46 +03:00
Pasi Kallinen 48db75fabc Add some hallu monsters 2022-08-24 18:40:27 +03:00
Pasi Kallinen 7c8ccb8ccd Prevent getpos queueing mouse commands
My change to allow binding the mouse buttons made getpos
push the mouse commands into a command queue, so when you
were asked for a map location, clicked on it with a mouse,
you'd first get the expected effect, and then (most likely)
immediately traveled there.

Change getpos to clear the commands bound to the mouse buttons,
and restore the binds afterwards.
2022-08-24 14:21:27 +03:00
Pasi Kallinen 282b2a7bbe Make explosions give feedback message
... even when the explosion doesn't hit anything.
2022-08-24 13:26:44 +03:00
Pasi Kallinen 6766943455 Add boulder pushing to therecmdmenu 2022-08-24 12:53:04 +03:00
Pasi Kallinen edae8273b9 Explicitly list the random breath types 2022-08-24 10:29:59 +03:00
Pasi Kallinen 50b91bdcfa Make sink symbol match fountain in IBMgraphics 2022-08-23 23:36:41 +03:00
Pasi Kallinen c42e73fd9c Allow binding mouse buttons
Instead of hardcoding mouse button actions, allow the user to
bind mouse buttons to extended commands.  For example the new
defaults are:

BIND=mouse1:therecmdmenu
BIND=mouse2:clicklook

Currently a bit rudimentary; the defaults should be OK, but
documentation is bit lacking, and in-game binding and option
saving are missing.

Allowed commands to bind are "nothing", "therecmdmenu", "clicklook",
and "mouseaction". Clicklook replaces the "clicklook" boolean option,
and mouseaction does what mouse 1 button used to do - a context sensitive
action.
2022-08-23 23:27:21 +03:00
Pasi Kallinen 3a255e86c4 Some lua selection userdata code cleanup 2022-08-23 17:34:29 +03:00
Pasi Kallinen d39b2f3a23 Remove extra definitions 2022-08-23 16:52:05 +03:00
Pasi Kallinen 4cfefb056a Clear or copy whole selectionvar 2022-08-23 14:39:39 +03:00
Pasi Kallinen 4a84fb5b9d Monsters can blind you with a camera 2022-08-22 13:32:12 +03:00
Pasi Kallinen a9ca23e8f9 Random figurines are of harder monsters 2022-08-21 13:23:16 +03:00
Pasi Kallinen 2b163d89b0 Rename command to #debugfuzzer, add some z and doc 2022-08-21 12:10:08 +03:00
Pasi Kallinen fcf5c1ea50 Monsters see and remember when others trigger traps
No longer will there be a conga line of hill orcs stepping into
the same arrow trap one after another.
2022-08-21 11:51:19 +03:00
Pasi Kallinen 953d43f5ac Monster known traps bit twiddling 2022-08-21 11:36:39 +03:00
Pasi Kallinen b0f3371147 Monsters try to escape from boulder forts
If a monster cannot move, for example because it's being
blocked off by boulders or walls, it will try to escape by some
method - such as a wand or scroll of teleportation.
2022-08-20 21:49:55 +03:00
Pasi Kallinen 54bff58598 Make #wizgenesis ignore debug_mongen blocking
Explicitly creating monsters in wizard-mode should go through
and not get blocked by the debug_mongen flag.
2022-08-20 21:45:26 +03:00
Pasi Kallinen 7ab1ac0a19 Split soldier-finding into separate function 2022-08-20 19:33:53 +03:00
Pasi Kallinen caaa527d45 Fix some #saveoptions issues
The #name default key was 'N', but that gets bound to #runsoutheast
when not using number_pad. Swap around the default #name key to M-n,
and bind the 'N' to it in commands_init instead.

The number_pad option wasn't getting saved because it has a separate
handler - mark the option as changed even if the value did not change
so it will be saved to the config.
2022-08-20 17:09:23 +03:00
Pasi Kallinen 535eb9327a Fix the corpse taste adjectives
Use proper grammar, and just go with randomized, not fixed by corpse type.
2022-08-20 16:35:31 +03:00
Pasi Kallinen ac5aadf0e3 Add #fuzzer wiz-mode command
Move the debug_fuzzer boolean out of the full options menu
and turn it into #fuzzer extended command
2022-08-20 08:34:52 +03:00
Pasi Kallinen c05a6f3199 Expose some debug flags in options
Show and allow changing the debugging flags in options:

debug_fuzzer: turn on the fuzzer
debug_hunger: prevent hunger
debug_mongen: prevent monster generation
debug_overwrite_stairs: allow level generation overwrite stairs

These are wizard-mode only, cannot be set via config file,
and the fuzzer cannot change these either.
2022-08-17 20:17:30 +03:00
Pasi Kallinen 1900a30323 Return early from mon_has_friends 2022-08-16 14:49:25 +03:00
Pasi Kallinen d7d4ed3dfe Monsters using wands of teleportation more
Previously monsters used wands of teleportation at hero, if hero was
standing on top of stairs, or on a scary thing (eg. Elbereth or
scroll of scare monster).

Allow monsters to recognize when hero is behind a chokepoint and
monster has friends with them, hopefully teleporting the hero
out of the chokepoint.
2022-08-16 12:17:58 +03:00
Pasi Kallinen d0b11fd2c0 Change poison instakill to damage with attrib and maxhp loss 2022-08-15 10:51:17 +03:00
Pasi Kallinen f156b0f660 Turn statushilites on automatically if any are defined 2022-08-14 22:32:09 +03:00
Pasi Kallinen 9be2e581b7 Macros for checking is object artifact 2022-08-12 19:37:34 +03:00
Pasi Kallinen fc3729d249 Better feedback for monster falling into a hole
... or a trap door. The trap is immediately identified anyway,
so just name the trap in the message.
2022-08-12 18:17:31 +03:00
Pasi Kallinen 1a5cd08b32 Turn on menucolors automatically if any are defined 2022-08-12 17:34:21 +03:00
Pasi Kallinen d062f4c4d8 Fix repeating untrapping
... or any that use getdir to ask direction.
2022-08-12 12:02:52 +03:00
Pasi Kallinen db1ef8172e Fix Windows compilation 2022-08-11 17:07:43 +03:00
Pasi Kallinen 1952050fae Remove comment 2022-08-11 08:46:20 +03:00
Pasi Kallinen 649fc7f9b3 Monsters "remember" noteleport levels
... using the same hack when zapping themselves: If the level is
no-teleport, the monster will learn of teleport traps, and if
it knows about them, won't try using teleportation again.
2022-08-11 08:43:40 +03:00
Pasi Kallinen c855b04a57 Fixes entries 2022-08-11 08:28:15 +03:00
Pasi Kallinen 121d79ab6b Random item artifact chances
The chance that randomly generated item is an artifact will
now depend on the number of already existing artifacts.
2022-08-10 18:18:18 +03:00
Pasi Kallinen d91915dba3 Migration-safe monster movement iteration
The monster knockback could mess with the monster linked list while
the code was going through it for monster movements. (For example,
a monster knocked back another into a level teleport trap)

Add iter_mons_safe, which first grabs all the monster pointers in
the list into an array, and goes over that array instead of relying
on the "next monster" pointer. This is possible because dead monsters
are not removed from the linked list until after all the monsters
have moved.

Testing is very minimal, and I'm not sure the vault guard check
for migration is correct - it should probably check for more states?

Also the iterator could be improved by not continually allocating
and freeing the monster pointer array.
2022-08-10 11:04:04 +03:00
Pasi Kallinen fd9745f9c6 Command repeating by using cmd queues
This replaces the old pushq/saveq arrays (which were used to save
the keys pressed by the user for repeating a previous command)
with a new command queue.  This means there's no hard-coded limit
to the saved keys, and it can repeat extended commands which are
not bound to any key.
2022-08-09 11:54:45 +03:00
Pasi Kallinen b635160297 Minor ranged attack tweak
Make monsters with magic and gaze attacks avoid hero,
just like spitters and breathers already did.
Some small code cleanup related to the ranged attacks.
2022-08-07 22:33:47 +03:00
Pasi Kallinen 83f8ec1c43 Give pyrolisk a bite attack 2022-08-06 10:55:04 +03:00
Pasi Kallinen 3eb2192d75 Make pyrolisk gaze effect match other fire effects 2022-08-06 10:46:27 +03:00
Pasi Kallinen 0a3d02b9d4 Pyrolisk stops gazing if it sees you resist 2022-08-06 10:45:11 +03:00
Pasi Kallinen 6bc796028d Make hitting with a wielded potion hit you far less
Hitting a monster with a wielded potion of paralysis or sleep
was practically useless, because it almost always also hit you.
Negate the chance and make it depend on your dex.
2022-08-06 08:28:39 +03:00
Pasi Kallinen b01d81277e Increase buffer size for saving menucolors
The '"regex"=color&attr' is max BUFSZ, so prefixing with MENUCOLOR=
and adding a newline overflowed the temp buffer when saving the
menucolors.
2022-08-05 18:19:07 +03:00
Pasi Kallinen 07184c9640 Don't give fake Demonbanes to angels
Demonbane is a mace now, so trying to generate a long sword made
fake Demonbanes. Just don't give Demonbane at all to random angels.
2022-08-05 13:43:39 +03:00
Pasi Kallinen fa1b326e31 Save changed key binds to config file 2022-08-05 13:07:26 +03:00
Pasi Kallinen 45613ea771 Experimental #saveoptions command
Add a #saveoptions extended command, to allow saving configuration
settings from within the game. This is still highly experimental,
and gives plenty of warnings before asking to overwrite the file.

Lack of option saving is one of the biggest complaints new players
have, so this should help with it.  More experienced players with
highly customized config file should not use this feature, as it
completely rewrites the file, removing all comments and non-config
lines.
2022-08-05 10:33:55 +03:00
Pasi Kallinen c8bd39c748 Simple options: guard against boolean being null 2022-08-04 20:08:19 +03:00
Pasi Kallinen b3822cd94d Fix roguesymset substitution in options 2022-08-04 17:05:26 +03:00
Pasi Kallinen 4ff9537b0d Rudimentary key rebinding in game options
Currently shown only in the full options list, as it's not
quite complete. (For example, it doesn't handle movement commands,
or the getpos keys)
2022-08-04 14:42:45 +03:00
Pasi Kallinen b5acfc5c3f New options: swap symset to roguesymset on rogue level 2022-08-04 09:48:58 +03:00
Pasi Kallinen dd28f8b405 Minor tweaks to post-option screen refresh 2022-08-04 09:39:21 +03:00
Pasi Kallinen 691c727d0a Flush screen when toggling map-related option 2022-08-03 19:57:57 +03:00
Pasi Kallinen bfd262ebe8 Add optionsfull extended command
This is the previous, full options list. Adding it as
an extended command, so users can do

BIND=O:optionsfull

to go back to the old behaviour.
2022-08-03 19:18:44 +03:00
Pasi Kallinen f3591ea07d User-friendly options menu
Make the default options menu only show the most important
options, split into categories. The full, traditional menu
can be accessed by using the m-prefix.
2022-08-03 14:08:31 +03:00
Pasi Kallinen f4d0e99fad Reset map x/y start/size in single place 2022-08-02 17:02:25 +03:00
Pasi Kallinen 24e94b70d4 Windows: Default boulder symbol to 0
Set the boulder symbol to 0 in the Windows config template file.
2022-08-02 13:09:25 +03:00
Pasi Kallinen fd3b4384c3 Prevent walking into water or lava by default
Make paranoid_confirmation:swim the default, because it is far more
beginner friendly.
2022-08-02 09:15:32 +03:00
Pasi Kallinen 09cf464816 Potions of healing, extra healing, and lifesaved heal amount
Make potions of healing and extra healing more useful in the early
game, by upping the average amount of health restored.

Make amulet of life saving restore between 60 and 170 health,
depending on constitution. Previously life saving was the best way
to heal back up to full, even if you had thousands of hp.
2022-08-02 01:11:14 +03:00
Pasi Kallinen e5b8fc86eb Make explosions burn monster armor 2022-08-01 22:30:43 +03:00
Pasi Kallinen ac5b92d348 Greased saddle is slippery 2022-07-29 12:27:08 +03:00
Pasi Kallinen cb9044c23f Make failed polearming or jumping return correct value 2022-07-28 22:10:08 +03:00
Pasi Kallinen bae221d0c3 Grappling location feedback 2022-07-28 13:50:57 +03:00
Pasi Kallinen 0517974b6d Spell location feedback
Casting some spells at high enough skill allows picking for
the spell location. Say which locations are out of range
when picking the location.
2022-07-28 13:15:41 +03:00
Pasi Kallinen 05761bada6 Holes and trapdoors have predetermined exit level
Same hole/trapdoor will always take you to the same level.
2022-07-27 22:51:17 +03:00
Pasi Kallinen 543a3c1b9a comment typofix 2022-07-27 13:14:00 +03:00
Pasi Kallinen 0da356c540 Enable migrating mons debugging 2022-07-27 12:21:07 +03:00
Pasi Kallinen 810744a27d Fix knockbacked monster migrating or killed
Fix a case where a monster knocked back another monster into a trap,
and the trap either killed or migrated the monster, then the actual
damage dealing later could try to detach the already detached monster.

If the monster migrated, the monster is gone before the damage from
the hit is dealt to the monster.
2022-07-26 23:20:54 +03:00
Pasi Kallinen f0774e0da4 Fix monster hiding under consumed candle 2022-07-26 22:53:57 +03:00
Pasi Kallinen f07f065f7d Allow cutting a known spider web by force-fighting it
Original code from xNetHack by copperwater <aosdict@gmail.com>.
2022-07-25 18:06:10 +03:00
Pasi Kallinen 63997a6fe5 Call it "danger sense" when warning finds a monster 2022-07-24 19:14:41 +03:00
Pasi Kallinen 82f0b1e8ea Scared hostile monster which cannot move away will attack 2022-07-21 20:21:10 +03:00
Pasi Kallinen 8747d2ddce Sitting on amorphous corpse 2022-07-21 18:27:50 +03:00
Pasi Kallinen 8a52716936 Wielding Giantslayer prevents knockback from monsters 2022-07-20 14:44:15 +03:00
Pasi Kallinen ced920df54 Adjust Demonbane invoke ability
Demon lords and princes have a chance to resist the effect.
Demons in quest when nemesis is alive have a very high chance
of resisting.
When invoked in Gehennom, teleports the demons within the same
level.
2022-07-20 09:42:28 +03:00
Pasi Kallinen b1a5a9c390 Demonbane changes
Demonbane is now a mace, the first sac gift for priests,
and gets an invoke ability to banish demons.
2022-07-19 21:23:26 +03:00