Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 9877e52025 Ring of stealth prevents hero from leaving tracks 2026-03-18 18:04:33 +02:00
Pasi Kallinen 18cb293766 Replace magic number with define 2026-03-18 17:12:01 +02:00
Pasi Kallinen 1c5cf5382b Hellfill variance 2026-03-17 17:29:43 +02:00
Pasi Kallinen 66e7123678 Categorize more commands as general commands
"general commands" tend to be ones which take no game time,
or are non-diegetic.
2026-03-17 13:38:12 +02:00
Pasi Kallinen 13e7d21b93 Replace magic number with define 2026-03-16 15:36:23 +02:00
Pasi Kallinen 619de1ec0e Make monster destroy armor -spell erode armor first
Instead of outright destroying the armor, the spell will instead
first erode the armor.  The spell hits 2-4 times, so if it hits
the same armor 4 times, it will get destroyed.  This does not
hit erodeproof armor.

Also change the scroll of destroy armor, so that blessed one will
destroy a cursed armor, if hero is only wearing that.
2026-03-16 11:24:19 +02:00
Pasi Kallinen 226157004b Make migratemons ignore debug_mongen
Same as wizgenesis, migratemons should create monsters even
when random monster generation is disabled.
2026-03-11 17:35:23 +02:00
Pasi Kallinen fe7b3ce09d Empty tin hallu msg 2026-02-15 17:01:49 +02:00
Pasi Kallinen 78217c3ebd Allow rogues to backstab sleeping or paralyzed monsters 2026-02-13 12:53:21 +02:00
Pasi Kallinen bbc3eea066 Make sure negatively enchanted boomerang hits anything 2026-02-12 14:32:58 +02:00
Pasi Kallinen db36ee35de Fix the healer knife bonus
dmgval is also used for monster attacks; move the healer knife
bonus to actual hero-specific code, and make sure it only
applies to hand-to-hand combat.
2026-02-11 08:22:02 +02:00
Pasi Kallinen 4b30e3fab8 Healers may get tiny damage increase with knives
Styled as anatomy knowledge, a healer attacking a monster in melee
with a knife gets +1 damage per 6 dead monsters of that type,
capped at +3 damage.

Handwaving away the fact we're not keeping track who actually
killed the monsters...

Idea from aosdict.
2026-02-08 18:11:06 +02:00
Pasi Kallinen 3877e142e7 Add more bustle to bustling town 2026-02-08 17:19:53 +02:00
Pasi Kallinen 63dd80f5ec More code style nits 2026-02-07 17:03:54 +02:00
Pasi Kallinen 74390fb690 Split ray bouncing dir into separate function 2026-02-07 14:51:03 +02:00
Pasi Kallinen 79c688cc6b Code style nit 2026-02-06 17:26:54 +02:00
Pasi Kallinen 37168ab188 Boomerangs can hit multiple monsters
The number of monsters it can hit depends on the enchantment.
2026-02-04 22:35:22 +02:00
Pasi Kallinen 27adb7c71d Light-spell is clerical, if playing a priest
Ideally the spell adjustment should be in o_init, but by that time
hero's role has not yet been set.
2026-02-03 12:07:12 +02:00
Pasi Kallinen b34b7e08a4 Fix lua reset_level
The lua des.reset_level() call did not reset the special level
coder, so some values were kept and couldn't be changed.
Adjust the movement tests for this change.
2026-01-28 10:06:58 +02:00
Pasi Kallinen 060c3de8eb Lua tests: code coverage for applying some items
Add a new debug flag prevent_pline, which prevents all messages
from going out to the UI. This prevents the tests from stopping
for -more-.
Add rudimentary tests for applying whistles, camera, and stethoscope.
2026-01-27 17:33:08 +02:00
Pasi Kallinen 11bed1f55b Lua tests: generation of each object
Test generation of every object, both via des.object and obj.new.
Expose FIRST_OBJECT and LAST_OBJECT numbers to lua.
Add lua nh.int_to_objname, a function to convert integer value to
object base name and class.
Allow creating new nethack lua object by specifying id and class.
2026-01-26 18:00:33 +02:00
Pasi Kallinen 2dc95dae42 Actually use the lua argc 2026-01-25 18:38:52 +02:00
Pasi Kallinen 92a8d1dab3 Lua tests: monster creation coverage
Expose constants NUMMONS, LOW_PM, and HIGH_PM to lua.
Allow converting an int to monster type name.
Create one of each type of monster in the lua tests.
2026-01-25 18:32:46 +02:00
Pasi Kallinen f73d9ee704 Expose selection size description to lua 2026-01-25 15:18:51 +02:00
Pasi Kallinen 4bf1fb5c68 Lua tests: more special level code coverage 2026-01-25 14:50:02 +02:00
Pasi Kallinen 8ae3d0f6bc Lua tests: code coverage for selection room and gradient 2026-01-25 14:18:01 +02:00
Pasi Kallinen 68ba3955fd Lua tests: more code coverage for rooms 2026-01-25 13:49:10 +02:00
Pasi Kallinen b5dd0eb894 Lua tests: more code coverage for traps 2026-01-23 18:24:28 +02:00
Pasi Kallinen 3b4ce60df4 Lua tests: more code coverage 2026-01-23 17:43:54 +02:00
Pasi Kallinen c8712fa288 Free the cmdq in getlin 2026-01-22 18:42:11 +02:00
Pasi Kallinen 49a87bd09c Lua pushkey and getlin
Allow lua nh.pushkey to push multiple keys,
make getlin return the keys in the command queue.
2026-01-22 18:16:55 +02:00
Pasi Kallinen b9f8f845fc Test for drawbridge 2026-01-21 20:21:12 +02:00
Pasi Kallinen c5dc08d23a Tests for gas_cloud, exclusion, levregion 2026-01-21 20:15:14 +02:00
Pasi Kallinen e9f57281f8 Expose flip_level to lua 2026-01-20 17:50:27 +02:00
Pasi Kallinen ae452e04b9 Don't discover generic objects
Potion of object detection and then looking at a generic object glyph
on the map would try to "discover" the generic object, and the loop
in discover_object would go too far, overwriting the exclusion_zones
pointer.

Take the easy route and just prevent discovery of generic objects;
there are probably other places where the generic objects should
be handled too, but the fuzzer hasn't hit them.
2026-01-16 21:17:19 +02:00
Pasi Kallinen eed952a095 Add more death drops to leather golems
In addition to the leather armor, leather golems can now drop
leather cloaks and saddles.
2026-01-15 19:02:44 +02:00
Pasi Kallinen a4e032762f Rope golems may death drop grappling hooks 2026-01-15 18:44:46 +02:00
Pasi Kallinen d0b9846367 Move item actions into separate src file
Haven't tested compilation on Windows and VMS ...
2026-01-11 14:46:25 +02:00
Pasi Kallinen 96394394b8 Fix comment typo 2026-01-11 11:42:16 +02:00
Pasi Kallinen 40b39c1026 Bigroom 13: Add few more pillar arrangements 2026-01-10 17:47:34 +02:00
Pasi Kallinen e93f0dedbf Make lyncanthropy less crippling
Now, the were-creature instincts will keep the hero from
unintentionally changing shape while next to hostile creatures.
2026-01-10 14:05:06 +02:00
Pasi Kallinen e504d44de2 Add "snake wall" to bigroom variant 1
Also increase the chances of having walls in bigrm-1 from 75% to 80%
2026-01-10 11:19:52 +02:00
Pasi Kallinen 99b893c786 Add a new bigroom variant "pillars"
Some variants have a bigroom variant called "Mines of Moria";
this one is very much that, but has several different arrangements
of the pillars.
2026-01-09 19:39:45 +02:00
Pasi Kallinen b19db444c5 No wish resuming for the fuzzer 2026-01-09 16:13:30 +02:00
Pasi Kallinen 8d87886458 Fix vision when vampire changes form on a door 2026-01-07 13:07:07 +02:00
Pasi Kallinen b9d781e0b2 Fix segfault when carried box explodes
Opening a trapped box in inventory, if the box exploded and was
not destroyed, then temporary variable otmp was pointing to null.
2026-01-06 21:00:33 +02:00
Pasi Kallinen f2cd27551d Just pass a mfndposdata pointer to should_displace 2026-01-04 16:34:28 +02:00
Pasi Kallinen 37df18b59c Use struct to pass data out of mfndpos
Instead of passing two array pointers to mfndpos, fold the data
into a specific struct.
2026-01-04 14:00:43 +02:00
Pasi Kallinen 01928276d5 Monsters use wand of teleportation more 2026-01-03 11:04:13 +02:00
Pasi Kallinen 5b22feb795 Reduce the effect of luck on to-hit
Luck has a massive effect on the to-hit chance; maximum luck alone
(which almost everyone has past the midpoint of the game) gives
10 points to to-hit, so accounts for 50% chance alone, excluding all
other effects.

Multiple variants do something similar to this, so it is well tested.
This version comes from xNetHack by copperwater <aosdict@gmail.com>,
and allows the +1 or -1 luck adjustments of early game, such as full moon,
to have an effect.
2025-12-31 12:47:20 +02:00
Pasi Kallinen 0dac2b5fa0 TTY: add support for the palette config option
For now, terminal colors are not reset back when exiting NetHack.
Depends on CHANGE_COLOR compile-time option.
2025-12-30 19:26:07 +02:00
Pasi Kallinen 6707d3bfba Safe armor enchantment limits
The safe armor enchantment limit is lowered by one, if the armor
is innately magical.  This takes off 3-7 points of AC from
a typical ascension kit, but should not really have any effect
for early game.

Also clean up the relevant code a bit.
2025-12-27 18:24:26 +02:00
Pasi Kallinen 91cc3e3f12 Replace a weight magic number 2025-12-14 20:23:22 +02:00
Pasi Kallinen 758528f094 Grimtooth and Sunsword invoke can be paid with magic power
If the invoke timeout hasn't run out, the effect will take 25 pw,
the same as a lvl 5 spell.
If hero doesn't have that much, then the invoke fails.
2025-12-14 12:00:30 +02:00
Pasi Kallinen b92cccbbcd A line added, a space removed 2025-12-12 17:57:58 +02:00
Pasi Kallinen e68c5826d3 Remove extra space 2025-12-12 17:44:59 +02:00
Pasi Kallinen e240efa10b Restoring a game can return to the wishing prompt
In TTY or curses, if the terminal goes away while you're in the wishing
prompt, return to the prompt when the game is restored.

Breaks saves.
2025-07-12 18:21:12 +03:00
Pasi Kallinen 8570421449 Create familiar spell can create harder creatures 2025-07-11 13:04:25 +03:00
Pasi Kallinen e5bd185ab5 Tutorial: untrapping traps 2025-07-10 13:48:16 +03:00
Pasi Kallinen 588dc6b73f Tutorial: quaffing potions 2025-07-10 13:40:04 +03:00
Pasi Kallinen 06ab2ce604 Tutorial: Knight jumping 2025-07-10 11:07:45 +03:00
Pasi Kallinen 44b9ffe245 Tutorial: tip containers 2025-07-10 11:01:30 +03:00
Pasi Kallinen 3440193a5a Tutorial: spellcasting
Add some basic spellcasting stuff to the tutorial: read a spellbook,
cast a spell.  If the hero doesn't have enough energy, just adds
a note saying so.

Remove/restore the known spells when entering/leaving the tutorial.
2025-07-09 18:30:58 +03:00
Pasi Kallinen 079dca27f2 Tutorial: clear user-given obj type names 2025-07-07 13:08:07 +03:00
Pasi Kallinen 0da45c1e74 Fix Snickersnee attack
Adding the extra attack to Snickersnee made the weapon always
attack from range, even when it was used in melee.
2025-07-05 19:59:26 +03:00
Pasi Kallinen e2b80cd886 Monsters trapped in pits cannot kick 2025-07-04 17:39:08 +03:00
Pasi Kallinen a0d9c94ece Dwarves can sense buried items under their feet 2025-07-04 17:04:46 +03:00
Pasi Kallinen b8664198da Alchemy smock reduces chances of dipped potions exploding 2025-07-03 21:07:05 +03:00
Pasi Kallinen 76de716d2d Tutorial: squeezing through small gaps 2025-07-03 10:09:51 +03:00
Pasi Kallinen 04e651ca34 Allow kelp in walls of water 2025-07-02 17:24:15 +03:00
Pasi Kallinen 79bbd33675 Add a false rumor
... but is it false?
2025-07-01 21:04:45 +03:00
Pasi Kallinen 47e95a126e Tutorial: wrong secret door
Some first time players have gotten stuck here. Give them a hint.
2025-07-01 16:19:01 +03:00
Pasi Kallinen 751b296e3b Tutorial: boulders and a trapdoor 2025-06-30 18:00:08 +03:00
Pasi Kallinen 20b03ec0c5 Fix wrong key code in binding keys 2025-06-30 17:59:38 +03:00
Pasi Kallinen 2b0530a5ed Tutorial: iron bars to show hidden stairs
Seems like several new players did not find the "hidden" stairs.
Add iron bars to show a glimpse of them - the hero still needs
to find the secret door in to the room.
2025-06-30 12:41:20 +03:00
Pasi Kallinen a89d6b3bae Tutorial: fix non-alt keys shown as alt-combos
Lua doesn't have regexes, and "-" has special meaning in match;
escape the minus with "%", so it actually matches a minus sign.
2025-06-30 12:34:47 +03:00
Pasi Kallinen 8d8867007f Typofix 2025-06-27 00:28:27 +03:00
Pasi Kallinen 7122c0cb0a Add a literary reference to genetic engineer database entry 2025-06-19 12:01:00 +03:00
Pasi Kallinen 15ced6f1ff Fix pet apport value
Fuzzer encountered a case where a pet apport ended up being zero:
the reviving tame troll already had edog structure, so it was not reset.
2025-05-23 17:21:27 +03:00
Pasi Kallinen a4b971c744 Allow monsters to use Snickersnee like a polearm 2025-05-20 20:06:28 +03:00
Pasi Kallinen ab4f70b448 Monsters were bashing with Snickersnee
Side effect of allowing Snickersnee to attack like a polearm,
monsters were bashing with it in melee.
2025-05-20 19:59:28 +03:00
Pasi Kallinen 68ef0b49c1 Split arti_invoke code into smaller functions 2025-05-14 18:30:55 +03:00
Pasi Kallinen 035cd4377f Snickersnee can hit at a distance once per turn for free
Once per turn, Snickersnee can be used to hit at a distance,
similar to a polearm, without taking any time.

Breaks saves.
2025-05-12 20:26:53 +03:00
Pasi Kallinen c90cc53ab3 Ogresmasher gives a higher chance of knockback 2025-05-12 10:24:36 +03:00
Pasi Kallinen bd98dda8c1 Unpolyed hero can knockback too
Noticed a strange oversight in knockback: Hero hitting a monster
did not cause knockback, unless polymorphed into a monster.
Add knockback chance if we're using a weapon, not twoweaponing,
and dealing some damage.
2025-05-11 21:23:43 +03:00
Pasi Kallinen 6d374f9306 No knockback with flimsy or non-blunt weapon
Weapons that can do knockback are lucern hammer, bec de corbin,
dwarvish mattock, (silver) mace, morning star, war hammer,
club, quarterstaff, aklys, flail, pick-axe, and grappling hook.
2025-05-11 20:32:29 +03:00
Pasi Kallinen af6c53ac7c m_respond code reorg and splitting 2025-05-10 18:42:42 +03:00
Pasi Kallinen 31e03f1c68 Fix vision on plane of air
We can't just unconditionally unblock vision when the cloud moves,
as there could be a temporary poison cloud at that location.
2025-04-26 20:38:50 +03:00
Pasi Kallinen 079566cad9 Fix memory leak in lua selection iterate
Iterating over a large set of locations in a selection caused a memory leak.
Lua couldn't do garbage collection in the middle of the iterator function,
so it eventually ran out of space, and just quietly dropped stuff.
2025-04-20 20:19:05 +03:00
Pasi Kallinen 3d5b7f1f51 Killing quest leader angers the guardians 2025-04-18 14:40:10 +03:00
Pasi Kallinen f12108c5c5 Fix memory leak when setting autocompletions 2025-04-18 11:40:48 +03:00
Pasi Kallinen 178bd3a988 Wielding Trollsbane grants hungerless regeneration 2025-04-17 17:28:07 +03:00
Pasi Kallinen 86bfb3e2f9 Avoid map accessibility notices when map isn't updated 2025-04-16 18:08:33 +03:00
Pasi Kallinen af3e601ff7 Remove melting ice timer when breaking digging wand 2025-04-15 14:45:51 +03:00
Pasi Kallinen d6dd5c743c Reinstate some of the mind flayer amnesia
When I reworked amnesia to not forget levels or objects, I removed
the forgetting from the mind flayer attacks.  I intended to add
something to replace it, but forgot ...
2025-04-13 20:16:00 +03:00
Pasi Kallinen a185c270bb Expose trap once-field to lua 2025-04-13 17:32:14 +03:00
Pasi Kallinen 85de51a69a Add invocation effect to Fire and Frost Brand
Casts fireball or cone of cold at expert level
2025-04-13 13:13:54 +03:00
Pasi Kallinen 652f8576c0 Cursed magic whistle can teleport you to your pet 2025-04-13 12:48:21 +03:00
Pasi Kallinen 8f7258dc35 Buff Grimtooth with poison
Grimtooth is now permanently poisoned, protects the wielder from
poison, and can be invoked to throw poison.

Permapoison code comes from xNetHack by copperwater <aosdict@gmail.com>.
2025-04-12 19:24:36 +03:00
Pasi Kallinen 7138af00ba Praying on an altar with pet statue on it can revive the pet 2025-04-10 23:38:44 +03:00