Commit Graph
100 Commits
Author SHA1 Message Date
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
Pasi Kallinen e1b01a5d7c Fix segfault when farlooking monster under generic object
A detected cave spider was hiding under a generic spellbook object;
farlooking at it produced a segfault.  OBJ_NAME is null for the generic
objects, so don't try to strcmp it.
2023-02-04 17:48:57 +02:00
Pasi Kallinen 2123602d3e Add chronicle and saveoptions to Guidebook 2023-02-04 15:14:28 +02:00
Pasi Kallinen 1b5414c833 Add some variation to minefill levels
Randomize the number of objects and monsters a little bit,
they're still roughly the same as before.
2023-02-03 19:10:04 +02:00
Pasi Kallinen d95e6adbdd Fix extern def 2023-02-03 17:12:23 +02:00
Pasi Kallinen 0722a5c2dd Fix punishment iron ball yanking hero on top of a monster
When attached iron ball was in a pit (or a pool) with a monster,
and your levitation ended, you were put on top of the monster.

Add a sanity check for hero over monster.
2023-02-03 08:51:48 +02:00
Pasi Kallinen cae29f1dfd Comment typofix 2023-02-02 19:07:56 +02:00
Pasi Kallinen 8535b248c8 Fix ceiling hiders on pools
While fuzzing, I saw a sanity checking error complaining about
a ceiling hider being on top of a pool; the rock piercer was
teleported on top of the pool while it was hiding in the ceiling.

Try to be a bit more consistent when a monster is hiding in ceiling,
and if it's valid for it to be on a pool.
2023-02-02 19:04:51 +02:00
Pasi Kallinen c2a1b97627 Stun from knockback only if not already stunned 2023-02-02 13:50:59 +02:00
Pasi Kallinen 6af26751e6 Monsters never try to pick up ball or chain
Apparently my m_move reorg made it possible for monsters to
pick up the chain attached to hero; explicitly prevent that.
2023-02-01 21:43:26 +02:00
Pasi Kallinen 56f1201e43 Use strchr, not index 2023-02-01 16:10:41 +02:00
Pasi Kallinen df8a0ac654 Split monster looking for items into separate function 2023-02-01 14:37:12 +02:00
Pasi Kallinen 6c9700ab25 Monster movement and object pickup cleanup
Clean up some of the code for monster deciding what objects
to pick up, removing duplicate code.  There should be no real
difference in behaviour, other than monsters now can pick up
one stack of items at a time; previously monster could pick up
gold, then a practical item, followed by a magical item all
in a single turn, although this very rarely mattered.

Not extensively tested.

Code originally from NetHack4.
2023-02-01 10:23:23 +02:00
Pasi Kallinen 4ccee5a177 Use could_reach_item 2023-01-31 19:09:43 +02:00
Pasi Kallinen 97d7a735a4 Separate function for monster safe touch object
Also added the check for touching an artifact to it
2023-01-31 18:44:13 +02:00
Pasi Kallinen fe99bcd591 Hellfill: Lich
Similar to the fake wizard towers.
2023-01-30 18:30:39 +02:00
Pasi Kallinen 71f900f174 Add helltweaks to fake wiz towers 2023-01-30 17:58:51 +02:00
Pasi Kallinen a4c15f23bc Add helltweaks to wizard3 2023-01-30 17:47:21 +02:00
Pasi Kallinen 788492bdcd Add helltweaks to wizard2 2023-01-30 17:43:34 +02:00
Pasi Kallinen 7def7ece92 Add helltweaks to wizard1 2023-01-30 17:31:25 +02:00
Pasi Kallinen 744d64487b Helltweaks: improve lava river
The lava river will now draw another river, until a certain
amount of map locations have been turned into lava, so you don't
get a teensy "river" made out of 2 lava pools.

Add a lua selection method to count the number of locations
in the selection.
2023-01-30 17:10:39 +02:00
Pasi Kallinen 8eeeec41f5 Avoid repeating the god ray
My recent change to hit and wake monsters caused a recursive
ghod_hitsu -> wakeup -> dobuzz -> buzz -> ghod_hitsu loop.
Don't call the ghod_hitsu again if the priest is already angry.
2023-01-30 12:39:35 +02:00
Pasi Kallinen 77797450f5 Remove obsolete comment 2023-01-29 18:49:58 +02:00
Pasi Kallinen 05f6a33092 Nazgul can see invisible 2023-01-29 18:07:03 +02:00
Pasi Kallinen 394a46ab13 Fix teleported eel hiding in dry land 2023-01-29 14:25:01 +02:00
Pasi Kallinen 7c2c692ee5 Generate random eroded, erodeproof, or greased items
Items in initial hero inventory, or generated via lua in
special levels or themed rooms are not subject to this.

Code via xnethack by copperwater <aosdict@gmail.com>,
with some modifications.
2023-01-29 11:20:03 +02:00
Pasi Kallinen 734dcfdabe Don't let monsters loot Schroedinger's box 2023-01-28 20:27:36 +02:00
Pasi Kallinen 60cbab1130 Fix shopkeeper getting mad when monster triggers a trap
When a monster triggered a rolling boulder trap which buried
a shop item in a pit, the shopkeeper would bill the hero.
(Or get mad at hero, if they were out of the shop)

The fix might not be quite right - should the shopkeeper get
mad at hero when monster triggers a trap created by hero?
Or when an item is buried in a pit created by a hero?
2023-01-28 20:03:23 +02:00
Pasi Kallinen cb81631a38 Fix open showing wrong glyph
Trying to open a location where a pet was removed the glyph
and showed the underlying terrain glyph instead.
Just use newsym - it'll use feel_location when Blind.
2023-01-28 19:12:24 +02:00
Pasi Kallinen 777f53c212 Add hellfill.lua to VMS install 2023-01-27 19:48:13 +02:00
Pasi Kallinen f61e1e8e23 Tiny chance of breaking iron bars with war hammer
Also add some different sounds to hitting the iron bars,
and make it noisy.
2023-01-26 18:21:53 +02:00
Pasi Kallinen d19c92281a Give gremlin the property it stole, if possible 2023-01-25 21:55:11 +02:00
Pasi Kallinen 5b8dc1eff7 Split pet ranged attack into separate function 2023-01-25 11:27:14 +02:00
Pasi Kallinen 84c14982bd Hellfill: Add an angel to the cage 2023-01-25 10:04:56 +02:00
Pasi Kallinen ed7e344f00 Giants occasionally have a weapon 2023-01-24 20:54:39 +02:00
Pasi Kallinen 09fa9a865d Hellfill: Caged monster 2023-01-24 18:06:16 +02:00
Pasi Kallinen 0cbb9899cb Rename variable from tmp to dmg 2023-01-24 17:02:13 +02:00
Pasi Kallinen 2f40a8c9aa Split hmon_hitmon into multiple functions
hmon_hitmon was the biggest function by far; this makes it far more
manageable.

There should be no change in functionality, and although I didn't
test every case, this was just moving chunks of code and changing
variable names until compiler did not complain anymore.
2023-01-24 15:25:35 +02:00
Pasi Kallinen fd25cb177f Lua doc bits 2023-01-24 09:37:32 +02:00
Pasi Kallinen 0bfd6b22f1 Gehennom tweaks: replace some walls with iron bars 2023-01-24 09:00:43 +02:00
Pasi Kallinen 9c21832cf2 Gehennom tweaks: replace some walls with boulders 2023-01-24 08:34:27 +02:00
Pasi Kallinen 1d8c944c5a Eating garlic makes some monsters flee 2023-01-24 06:17:17 +02:00
Pasi Kallinen 3b5c53de86 Add triple nesting theme room 2023-01-23 20:00:21 +02:00
Pasi Kallinen 83eaa85dd8 Fix ancient subroom location bug
Randomly placed subrooms were never generated touching
the right or bottom walls of the parent room.

This bug has been present since at least 3.1.0
2023-01-23 19:50:37 +02:00
Pasi Kallinen 8aff869ef7 Increment editlevel
Commit 0f257ec538 (nhlua.c static analyzer fix) changed
a variable from long to unsigned, but the var is also saved
to the save file, so broke save compat.
2023-01-23 08:05:26 +02:00
Pasi Kallinen 18a77b1c42 Hellfill: Random temples to Moloch 2023-01-22 20:09:26 +02:00
Pasi Kallinen a99c473762 Intelligent peacefuls avoid digging shop or temple walls 2023-01-22 13:28:24 +02:00
Pasi Kallinen 8ec84ea7ff Higher chance of demon gating in Gehennom 2023-01-22 13:03:10 +02:00
Pasi Kallinen 52c98b300d Wrong order of params 2023-01-21 17:15:38 +02:00
Pasi Kallinen 677b32c2a7 Hit and wake sleeping monster makes it growl
Unless you kill the monster with one hit, it'll wake up
cranky and make noise - waking up other sleeping monsters.

This was a bit tricky with all the message sequencing; I tested
all the hit/throw/fire/zap combos I could think of, and it took
a while to get things looking right.
2023-01-21 16:52:23 +02:00
Pasi Kallinen b859288f5c Unify monster-consumes-object
This code was in three different places; pet eating,
monster eating metal, and monster eating other objects.

Other than very minor changes (eg. rustproofing completely
protects pets from bad effects, rustproof items are no longer
giving apport, and monsters eating corpses are healed), it
should behave the same as before... But I haven't exhaustively
gone through every iteration.
2023-01-21 10:13:26 +02:00
Pasi Kallinen b1fd7344e3 Poly into fire elemental, eat flammable items 2023-01-20 18:56:01 +02:00
Pasi Kallinen b998a368c7 Random sink effect: noxious gas cloud 2023-01-20 17:39:04 +02:00
Pasi Kallinen 93d7d79fca Fix mouse menu movement
When using mouse to move to a location next to the hero,
the test_move result was reversed, causing the click to fall
in to the travel case instead of normal movement.
2023-01-20 14:37:01 +02:00
Pasi Kallinen af1bd84766 Add hell_tweaks to Orcus' level 2023-01-20 14:08:34 +02:00
Pasi Kallinen 6e49372d8f Mindless monsters are not scared of music 2023-01-19 22:18:52 +02:00
Pasi Kallinen 242a7ba796 Boomerang hitting a sink is noisy 2023-01-19 19:59:19 +02:00
Pasi Kallinen e260aa5877 Digging is noisy 2023-01-19 19:55:47 +02:00
Pasi Kallinen 1113373892 Fix vibrating square
The Gehennom changes broke the vibrating square, allowing hero to go
down into the Sanctum via stairs without performing the invocation.

Fix this by making the hellfill lua check for invocation level, and
placing down the vibrating square trap, instead of stairs.
2023-01-19 12:15:46 +02:00
Pasi Kallinen bb8656c190 Move familiar level message into function 2023-01-18 23:33:21 +02:00
Pasi Kallinen 2511637169 Make plane of fire hot 2023-01-18 10:50:32 +02:00
Pasi Kallinen bb8c144809 Level temperature
Allow setting a per-level "temperature": hot, cold, or temperate
via special level flags. Currently it only affects some messages
in Gehennom, but it could be expanded to ice melting, water freezing,
or monster generation, for example.

Invalidates saves and bones.
2023-01-17 20:11:45 +02:00
Pasi Kallinen bd267c0c61 Add a cold, watery gehennom filler maze 2023-01-16 19:17:19 +02:00
Pasi Kallinen b5fe7415cf fixes entry 2023-01-16 10:45:23 +02:00
Pasi Kallinen 3ee54d1c4e Fix deleting worn object
When going down stairs while punished, if you had quivered a mirror
and the mirror was dropped because you fell down the stairs, it would
not have been unequiped.
2023-01-16 09:41:43 +02:00
Pasi Kallinen 6abb12aee0 Lua: Persistent variables
Add a way for the lua scripts to set and retrieve variables
that are persistent - saved and restored with the game.

Invalidates saves.
2023-01-15 10:34:45 +02:00
Pasi Kallinen eacb68666e Deadly afflictions and resistances for safe_wait
Amend the safe_wait so it still waits if you have a deadly property,
even if you have a resistance to it.

External resistances do not protect against already existing
deadly properties, for example becoming deadly ill is not cured
even if you wear a green dragon scale mail.
2023-01-12 23:19:28 +02:00
Pasi Kallinen 698ac27146 Avoid magic numbers in tile2bmp 2023-01-12 17:34:58 +02:00
Pasi Kallinen 9bf6d837ad More Gehennom filler level variance 2023-01-12 12:37:08 +02:00
Pasi Kallinen 4af086be73 More interesting Gehennom levels
Instead of just plain old boring mazes, spice up Gehennom by
occasionally adding lava, iron bars, or even mines-style levels
(with lava, of course).

Of the fixed Gehennom levels, only Asmodeus' lair has been changed
to add some random lava pools.

Also some lua fixes and changes:
- Fixed a selection negation bounding box being wrong.
- Fixed a selection negated and ORed returning wrong results.
- des.map now returns a selection of the map grids it touched.
- When using des.map contents-function the commands following the
  map are not relative to it.
2023-01-10 12:20:21 +02:00
Pasi Kallinen 48ae4f6d30 Another valgrind uninitialized bytes complaint 2023-01-07 17:28:14 +02:00
Pasi Kallinen 8eb3b3d8d1 Silence valgrind uninitialized bytes complaints
Just zero out the allocated memory.

Explicitly setting struct field values isn't enough, because field alignment
means there can be several unused bytes which are written to savefile.
2023-01-07 13:25:07 +02:00
Pasi Kallinen c68b21d735 Fix lua selection logical-or bounds 2023-01-07 10:55:09 +02:00
Pasi Kallinen 27e2c79e12 Free command queues at end of game
At end of game, the disclose prompts put commands into the queue,
but those weren't freed.
2023-01-06 16:40:58 +02:00
Pasi Kallinen 030fc0036a Remove NO_VSNPRINTF
Affects only ancient VMS where vsnprintf wasn't available.
2023-01-06 15:53:06 +02:00
Pasi Kallinen 37f6eee147 Add themeroom filler "Storeroom"
Contains mostly mimics (pretending to be chests), and possibly some chests.
2022-12-22 21:47:13 +02:00
Pasi Kallinen 5e47afed4f Typofix 2022-12-19 18:20:31 +02:00
Pasi Kallinen 32bbf84ee1 Add strangled to safe_wait
... and ignore vomiting from sickness.
2022-12-18 12:36:34 +02:00
Pasi Kallinen d7e90fbae2 Expand safe_wait to deadly status afflictions
Searching or waiting with safe_wait on will now consider
sliming, stoning, or deadly illness to be hazardous and prevent
the command.
2022-12-18 00:40:38 +02:00
Pasi Kallinen 85137bb76a Fix skipping attacks if hero moved away
Recent change by me caused a bug where a monster was trying
to attack after hero was moved away by the previous attacks.
2022-12-07 21:51:50 +02:00
Pasi Kallinen 81fb185cea Recalc mon-hits-you distance variables
When a monster could first knock you back and then grab you,
the game would emit impossible, because the knockback moved you
but the distance variables used for the grab attack were not
updated.

Update the range variables within the loop iterating through
the monster attacks.
2022-12-01 19:57:24 +02:00
Pasi Kallinen 47c194fd56 Avoid segfault when null obj passed to water_damage 2022-12-01 13:29:52 +02:00
Pasi Kallinen 60252cd28b Remove leftover debug pline 2022-10-07 11:44:03 +03:00
Pasi Kallinen ef093d0b30 Fix curses cursor keys
My change to allow fuzzer run in curses caused the cursor keys
to not work (eg. paging through menus with left and right cursor),
so fix that.
2022-09-24 10:40:38 +03:00
Pasi Kallinen fbb32ea7fa Curses: enable debug fuzzer 2022-09-22 13:10:19 +03:00
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