Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 2012254c39 Split impaired movement code out of domove 2022-02-25 17:06:25 +02:00
Pasi Kallinen 7733cbe399 Split water turbulence code out of domove 2022-02-25 16:59:52 +02:00
Pasi Kallinen 7a29110514 Split ice fumbling code out of domove 2022-02-25 16:43:09 +02:00
Pasi Kallinen 1cc79b7156 Wizard-mode wishing for (melting) ice 2022-02-25 16:42:08 +02:00
Pasi Kallinen cb5ca657ed Split air turbulence code out of domove 2022-02-25 16:13:27 +02:00
Pasi Kallinen d617875a82 Split force-fighting empty square out of domove 2022-02-25 15:19:51 +02:00
Pasi Kallinen 48cd81dbfd Split swapping places with pet code out of domove 2022-02-25 15:09:56 +02:00
Pasi Kallinen f44a4b0485 Change unknown mintrap result into impossible 2022-02-25 14:57:03 +02:00
Pasi Kallinen 3b521aa955 Split force-fight iron bars code out of domove 2022-02-25 14:54:33 +02:00
Pasi Kallinen 57f55f5ca6 Split some code out of domove
Should have no change in behaviour.
2022-02-25 14:46:45 +02:00
Pasi Kallinen 6fa4fd46f7 Move output delay from walk_path to mhurtle_step
... in case walk_path is ever used for something that
doesn't need the delay.  The hero hurtling already had
delay, so it was done twice.
2022-02-24 19:50:37 +02:00
Pasi Kallinen 0c20bf116c Moving a monster with telekinesis hurles it through the air
... and at the end of the flight, it can't avoid a trap, if it
lands on one.
2022-02-24 19:27:59 +02:00
Pasi Kallinen 9ae2ec1f98 Most traps now require touching the floor to trigger
It was silly how some clearly mechanical traps didn't consider
flight or levitation when to trigger.  Do those checks in dotrap/mintrap
making hero and monster trap triggering match more closely.
2022-02-24 18:55:14 +02:00
Pasi Kallinen 2777f45bd5 Get rid of force_mintrap, allow passing flags to mintrap
It uses the same flags as dotrap, so simulate force_mintrap
by passing FORCETRAP flag.
2022-02-24 17:13:23 +02:00
Pasi Kallinen 9716f22851 Make trap return values more consistent
Instead of returning monster's mtrapped-state, return specific
trap return values.
Add one extra trap return value, for when a monster was
moved by the trap.
2022-02-24 16:24:02 +02:00
Pasi Kallinen 547f6e9244 Remove forced trap activation from mhurtle 2022-02-24 15:18:00 +02:00
Pasi Kallinen 16a8caac97 Allow using #wiztelekinesis on yourself 2022-02-24 15:10:39 +02:00
Pasi Kallinen 8e91320d2f Use u_at macro 2022-02-23 20:28:55 +02:00
Pasi Kallinen 645720d1bc Fix the force_mintrap 2022-02-23 19:11:32 +02:00
Pasi Kallinen 9ad1e7e620 Hurtling monster always triggers a trap 2022-02-23 18:59:57 +02:00
Pasi Kallinen 60642a8876 Wall of water stops monster hurtling 2022-02-23 13:54:07 +02:00
Pasi Kallinen e965f6cf44 Give message trying to hurtle immovable monster
If the monster is too big, stuck to hero, or trapped.
2022-02-23 13:42:08 +02:00
Pasi Kallinen 5786ddadbb Use IS_WATERWALL and is_waterwall 2022-02-23 12:53:09 +02:00
Pasi Kallinen 362cb4a317 Fix comment, mhurtle now handles pools and lava 2022-02-23 11:34:35 +02:00
Pasi Kallinen 4eaa8cd055 Make minliquid handle walls of water 2022-02-23 11:30:51 +02:00
Pasi Kallinen e0a83630e1 Some spell code reorg
Keep the internal spell array index inside spell.c,
and refer to spells outside of it with the otyp id.
2022-02-23 10:52:10 +02:00
Pasi Kallinen 462e13f07b Handle water and lava when hurtling a monster
Also delay the output, showing the hurtle animation.
2022-02-22 16:51:18 +02:00
Pasi Kallinen 268022e5de Add #wiztelekinesis for testing purposes
For testing mhurtle, which is used for jousting or
bare-handed combat.

Improve mhurtle_step to handle bumping into another monster,
and when the monster gets killed or stuck in a trap.
2022-02-22 16:00:05 +02:00
Pasi Kallinen e5c73d01fe Make wood golem death drops more varied 2022-02-22 14:57:41 +02:00
Pasi Kallinen 4866182a02 Change kitchen sink glyph and color
The default sink glyph is already used for many other things:
iron bars, trees, corridors, drawbridges, and clouds.

Change the glyph to {, and change the color to white.
The glyph is only used for fountains, so it makes "safe"
water-related glyphs match.
2022-02-22 14:41:20 +02:00
Pasi Kallinen cf58d09fa6 Huge monsters easily climb out of pits
Also, give a message when a monster trapped in a pit, a web,
or a bear trap frees itself.
2022-02-22 13:08:03 +02:00
Pasi Kallinen 33556788c3 Start with a level 1 spell and enough power
Ensure the first spell - if any - given to the hero in initial
inventory is level 1 - otherwise you can end up with a situation
where the hero knows level 3 spells, but won't have enough power
to cast them.

If the hero starts out with a spell, ensure enough power (5)
to cast that level 1 spell.
2022-02-22 12:26:06 +02:00
Pasi Kallinen 78f7df9a51 Casting a forgotten spell uses some random amount of power
... in addition to the confusion/stunning it does.
2022-02-22 11:32:08 +02:00
Pasi Kallinen d1dbed95f3 Elves and rangers get alignment penalty for cutting down trees 2022-02-22 11:13:59 +02:00
Pasi Kallinen 51a5550a51 Hobbits getting a sling also get some ammo 2022-02-22 10:01:55 +02:00
Pasi Kallinen 733fc84934 Flint and hard gems break less often when thrown 2022-02-22 10:01:17 +02:00
Pasi Kallinen d452242af4 Adjust sleep spell, and monk starting spell
Tone down sleep level to 3 (hitting a monster does tend to wake
it up), and replace the random monk starting sleep spell with
confuse monster, which fits nicely with monk's bare-handed
fighting style.
2022-02-22 09:13:32 +02:00
Pasi Kallinen ef6a88e1e1 Chargeable rings may get charged when hit with electricity
... instead of being destroyed. Normal charging limits apply.
2022-02-21 21:06:29 +02:00
Pasi Kallinen c73595cc96 Adjust enchantment spell levels
The enchantment spells were skewed towards lower spell levels,
and didn't seem to correspond with the spell effectiveness or
power.  Adjust the spell levels:

- Confuse monster is probably the least powerful enchantment, and
  also requires touch to work, so make it the new level 1 spell.

- Sleep is quite powerful, and ray, bump it to level 4.

- Charm monster is even more powerful so make it level 5.
  (Considering that create familiar is level 6)

                 old   new
sleep             1     4
confuse monster   2     1
slow monster      2     2
cause fear        3     3
charm monster     3     5

Also swap sleep and confuse monster generation probability.
2022-02-21 19:49:04 +02:00
Pasi Kallinen 4a61602436 Illiterate hero will learn spells directly from deity
... instead of receiving a spellbook.
2022-02-20 22:05:33 +02:00
Pasi Kallinen fcdae54173 Fix old-style function def 2022-02-20 21:18:03 +02:00
Pasi Kallinen 038ae7f984 Clean up some spell-related code
Add two helper functions and use those outside of spell.c,
instead of iterating through all the spells.
2022-02-20 21:12:26 +02:00
Pasi Kallinen 041a07468a Always give a message when monster changes form via polytrap
... if the hero can see it.  This was an accessibility issue.
2022-02-20 19:40:55 +02:00
Pasi Kallinen fc19d1b453 Make looting less tedious
I've seen complaints how looting containers is tedious, and
since multiple containers in the same location are now (and have
been for a while) handled with a menu, the yes-no-quit prompt
for a single container doesn't really mean anything.

Remove that prompt, and remove the "open carefully" message too,
so when you're looting a location with a single container, the
command will drop straight into the loot-in-out -menu.  Also
adjust one looting message to explicitly mention the container
if there are other objects on top of it.

Removing the prompt means you can't loot a saddle from a tame
monster with plain loot when standing on a container - you need
to prefix the loot command with 'm' prefix in that case.
2022-02-20 18:39:52 +02:00
Pasi Kallinen 74296c3213 Split sitting code into smaller parts
Split sitting on a throne and laying an egg into their
own functions.  No changes to behaviour.
2022-02-20 17:29:37 +02:00
Pasi Kallinen 928677c810 Engraving with Fire Brand burns the text on the floor 2022-02-20 15:59:33 +02:00
Pasi Kallinen a78419c52a Thrown items can get stuck in webs 2022-02-20 12:23:00 +02:00
Pasi Kallinen 70dafd658d Imps and others cussing the hero wake up nearby monsters 2022-02-19 17:18:07 +02:00
Pasi Kallinen 5e26589fa7 Make killer bee - queen bee transformation apply to hero
if they've polyformed to a killer bee and eat royal jelly.
2022-02-19 17:06:36 +02:00
Pasi Kallinen 26ea5824c1 Reading a magic marker shows the specific red ink color 2022-02-19 13:11:24 +02:00
Pasi Kallinen c434236f1e Allow creating unhidden traps in special levels
des.trap({ type = "rust", seen = true });
2022-02-19 12:38:28 +02:00
Pasi Kallinen a1d5464fa7 Knight quest home level has some saddled warhorses
Also, when creating a saddle in a monster inventory in special
level lua code, automatically saddle the monster, if possible.
2022-02-19 11:51:10 +02:00
Pasi Kallinen 04756b5d34 Towels should weigh more than blindfolds
There's more cloth in a towel than in a blindfold.
2022-02-19 10:32:57 +02:00
Pasi Kallinen 41ae240cad Candy bars are bright blue in text mode
There's lots of brown comestibles, but no bright blue.
2022-02-19 10:28:06 +02:00
Pasi Kallinen cd14456b02 Knights get no caitiff penalty against undead 2022-02-18 21:29:31 +02:00
Pasi Kallinen a9712442dd Use defines for pet hunger limits 2022-02-17 20:03:39 +02:00
Pasi Kallinen 390429545e Wield and swapweapon ext cmd fail return values 2022-02-17 11:06:35 +02:00
Pasi Kallinen 953a534cc5 Fix fire auto-swapweaponing to polearm
When you have a polearm as secondary weapon, have a fireassist on,
and press 'f' to fire, the code tries to swapweapon to the polearm.
This failed badly and got stuck in a loop if you were also wearing
a shield - as polearms are two-handed and shield prevents wielding
those.

Add a new "command failed" result, and clear the command queue
in that case. Also make swapweapon and wield actually return
the ECMD flags back to the rhack loop.
2022-02-17 09:12:07 +02:00
Pasi Kallinen b25138e6d9 Zombies groan 2022-02-16 23:04:02 +02:00
Pasi Kallinen 122634ec9e Hallucinatory rays
When hallucinating, use nonsensical names for the rays
(wands, spells, and breath weapons), and random ray glyphs.

Original code from xNetHack by copperwater <aosdict@gmail.com>,
inspired by a YANI by Kahran042.
2022-02-16 21:09:23 +02:00
Pasi Kallinen d958d032a0 Looting will fall through to force
If you have autounlock on, and don't have unlocking tool, but
are wielding a weapon usable for forcing the lock.
2022-02-16 08:49:16 +02:00
Pasi Kallinen 679f8c11c9 Fix broken fireassist
When I recently refactored the rhack loop, I also broke fireassist,
as rhack was clearing the command queue unconditionally.
2022-02-15 20:16:31 +02:00
Pasi Kallinen e65c921ccb Use grounded macro 2022-02-15 18:44:56 +02:00
Pasi Kallinen f2ea207936 Monster or hero placement should avoid wall of water 2022-02-13 18:06:56 +02:00
Pasi Kallinen c1a6dd40bc Flying should not allow monsters to walk on the wall of water
Also applies to levitating monsters.
2022-02-13 17:54:13 +02:00
Pasi Kallinen 2448ead0c4 Wall of water should block monster lined-up checks
Prevents monsters from eg. throwing items through the water.
2022-02-13 17:22:00 +02:00
Pasi Kallinen 3b2e4d682d Water walking doesn't help in wall of water 2022-02-13 14:38:54 +02:00
Pasi Kallinen 7302b87dd5 Improve avoiding walls of water 2022-02-13 14:19:40 +02:00
Pasi Kallinen d26c7dde44 Fix the "wall of water" and paranoid:swim 2022-02-13 11:00:09 +02:00
Pasi Kallinen 73dbd39d98 Use proper locomotion when avoiding water or lava 2022-02-13 10:56:40 +02:00
Pasi Kallinen 03c715f179 Add paranoid:swim to prevent typoing into water or lava
In the name of accessibility: Prevent moving into dangerous liquids.

Now with themed rooms, water and lava are more common, and it's
unreasonable to expect blind players to check every step for those.
With paranoid:swim, just prevent normal walking into those liquids,
unless you prefix the movement with 'm', or if the liquid would not
harm you.

Doesn't completely prevent an accidental dunking - for example
if the hero is impaired or couldn't see the liquid.

This comes from xNetHack by copperwater <aosdict@gmail.com>
with some changes to the code.
2022-02-12 17:29:32 +02:00
Pasi Kallinen bc456938d7 Should see rusting next to you if underwater
You can see to the adjacent squares, if they're water and you're
underwater - show the item rusting there in that case.
2022-02-12 11:54:50 +02:00
Pasi Kallinen 91e2d3633e Use macro for a location next to hero 2022-02-12 11:05:10 +02:00
Pasi Kallinen 2ca8ac9a80 Make the "wall of water" stop thrown or kicked items 2022-02-11 20:38:29 +02:00
Pasi Kallinen cd797afd0e Don't show rusting of items landing in water
When a thrown item lands in a pool of water, it immediately
rusts - but don't give that message unless the hero is at the same
location and also under the water.  My reasoning: hero can't see items
under water, and by the time the item rusts, it's in the water.
2022-02-11 20:20:24 +02:00
Pasi Kallinen 8ce3e08d00 Give a sound message when thrown item lands in water or lava 2022-02-11 20:05:46 +02:00
Pasi Kallinen c036c59b00 Monsters should growl even if you can't hear it
Call growl even if you are deaf, because growling also
wakes up nearby monsters. Just make growl not show the message
if you can't hear or see the monster.
2022-02-10 13:41:53 +02:00
Pasi Kallinen 1e90f89203 Chronicle of major events, and livelog
Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
2022-02-09 22:49:25 +02:00
Pasi Kallinen bbd5577063 Fix copy-paste error 2022-02-07 13:09:52 +02:00
Pasi Kallinen e2442c395b Make double fight prefix cancel out 2022-02-07 09:14:47 +02:00
Pasi Kallinen 4ee1c66f8f Make solid water behave more consistently
The "water" terrain (as used on the Plane of Water) behaved
strangely outside the plane. Make it behave a bit more consistently,
although it's still not really usable elsewhere.

The rationale here being it's a solid wall of water.

Firstly, disable levitation and flying (which was already done
when moving into the water on the Plane of Water), and moving into
it refers to it as a "wall of water" to make it clear it's a solid
block of water.
2022-02-06 20:38:22 +02:00
Pasi Kallinen 3315a5735e Add unique Rider revival messages
This comes from xNetHack by copperwater <aosdict@gmail.com>
with some changes to the code, although original change is from
SpliceHack.
2022-02-06 20:00:32 +02:00
Pasi Kallinen 82d404ec51 Death attacking a monster does drain life attack 2022-02-06 19:27:20 +02:00
Pasi Kallinen 2bd4386956 Magic traps can toggle intrinsic invisibility
Originally from Sporkhack by Derek Ray
2022-02-06 17:54:09 +02:00
Pasi Kallinen 20054551f9 Don't push unknown boulders when moving
If you're blind and there's a boulder you don't know about,
don't automatically push it. Instead, give a message and show
the boulder on the map.
2022-02-05 11:30:35 +02:00
Pasi Kallinen 8eb00cf593 Fix thinko in drain life attack
Fixes #667
2022-02-05 10:40:45 +02:00
Pasi Kallinen 93db2a8a84 Rejigger the prefix input
Make prefix commands cancel themselves when pressed twice,
with a message saying so.

Hopefully this fixes the problems I introduced.
2022-02-05 10:05:40 +02:00
Pasi Kallinen 8f7f598050 Fix mention_walls distinguishing unseen walls from solid stone
Bumping into an unseen wall reported "a wall" instead of "solid stone",
even though you could not know it was a wall when looking at it.

Use the same method when looking at glyphs on the map instead of
the map location type.

Fixes #318
2022-02-04 14:02:18 +02:00
Pasi Kallinen ac3c005615 Fix fall depth from Castle to the Valley 2022-01-31 20:31:26 +02:00
Pasi Kallinen 2cad4ecec2 Covetous monsters will teleport to downstairs or upstairs
I accidentally swapped the covetous monsters teleport to stairs to heal
but instead of changing it back like it was, now make those monsters
teleport to either upstairs or downstairs - some of them will go up,
others go down.
2022-01-31 19:52:33 +02:00
Pasi Kallinen 218c0d4a3b Stinking clouds block line of sight
... you will also get a message when a seen stinking cloud
or the one surrounding the hero dissipates.

Original feature comes from Fourk, but this version (with some
minor changes) comes from xnethack by copperwater <aosdict@gmail.com>
2022-01-31 19:00:19 +02:00
Pasi Kallinen 9f9551bdb3 Swap running and rushing modes back
I unintentionally swapped the shift and ctrl movement keys
when redoing the movement input - change them back to how
it was earlier.

Also change the number_pad meta-key bindings, and explain
in the comments why: We can't bind shift or ctrl numbers.
Meta (aka alt-key) works with number-pad numbers when
the altmeta-option is on. There was no altmeta in 3.4.3.

Here's a table of the flags.run/g.context.run values,
from 3.4.3 and 3.7 as of this commit:

             | num_pad:0 || num_pad:1
             | 343 | 370 || 343 | 370
-------------------------------------------------
 <dir>       |  0  |  0  ||  0  |  0
 shift-<dir> |  1  |  1  ||  0  | N/A
 ctrl-<dir>  |  3  |  3  ||  0  | N/A
 meta-<dir>  | N/A | N/A || N/A |  1 (with altmeta)
 m-prefix    |  0  |  -  ||  0  |  -
 G-prefix    |  3  |  3  ||  3  |  3
 g-prefix    |  2  |  2  ||  2  |  2
 5-prefix    | N/A | N/A ||  3  |  3
-------------------------------------------------

The m-prefix in 3.7 does not set the run-value, as it can now
be used with any movement key or prefix, which will set the run value.

New input system does not lose functionality when compared to 3.4.3.
Instead, the number_pad users gain the meta-<dir> running.

This doesn't fix the issue of three badly differentiated run values.
2022-01-29 12:58:06 +02:00
Pasi Kallinen af6f9b4594 X11 issue is already fixed 2022-01-28 17:28:54 +02:00
Pasi Kallinen c722962713 Cancellation explodes magical traps 2022-01-28 08:30:08 +02:00
Pasi Kallinen 95acaf2989 Falling through a hole or trap door will cause damage 2022-01-25 14:17:43 +02:00
Pasi Kallinen 61f78318a5 X11: Fix map expose area
The stop_row and stop_col were off-by-one in some cases, leaving
black lines on the map when a window on top was closed.
Simplify the calculation by always going one row/col further,
ensuring previously covered area gets redrawn for sure.
This should not affect speed or resource usage noticeably these days.
2022-01-25 11:26:47 +02:00
Pasi Kallinen 0652f7f774 Mindless monsters shouldn't cringe stepping on squeaky boards 2022-01-24 23:13:36 +02:00
Pasi Kallinen 4130a3a6ae Fix ESC so it cancels the movement prefix commands
My changes to turn the movement and prefix commands into
extended commands broke this.
2022-01-24 19:48:43 +02:00
Pasi Kallinen 6ed315ecf8 Don't stop running next to a peaceful monster
... unless the monster blocks the way.
2022-01-24 18:45:57 +02:00
Pasi Kallinen a6816824c7 Lua: Pass more data to room contents function 2022-01-23 13:27:00 +02:00