Commit Graph
100 Commits
Author SHA1 Message Date
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
Pasi Kallinen 7b87f7b495 X11: Fix map display for hypothetical huge map
memsets don't work very well when xchar isn't char sized.
2022-01-23 01:14:26 +02:00
Pasi Kallinen d92d5f2268 Fix possibly uninitialized error 2022-01-22 21:53:15 +02:00
Pasi Kallinen 3b542e3cab Fix vision if xchar is defined larger than char 2022-01-22 21:15:44 +02:00
Pasi Kallinen 738a225011 Replace a return value with ECMD define 2022-01-22 16:04:02 +02:00
Pasi Kallinen f698d48ba0 Avoid generating monsters on boulders
... unless the monster can go through walls.
2022-01-22 15:41:18 +02:00
Pasi Kallinen 9d64d135b8 Curses: fix extended command input
The extended command input prompt was behaving in an unintended way:
Typing #a<enter> executed #adjust. Spaces in the entry prevented matching
any command. No error message was given when no command was matched.

Fix all of those, so it behaves more like the tty.

Clean up the tty, curses, and X11 windowport code, so they don't use
the extcmdlist array directly, but query with extcmds_match
and extcmds_getentry.
2022-01-22 14:32:53 +02:00
Pasi Kallinen 2e144e814d Change repeat into extended command 2022-01-17 17:13:59 +02:00
Pasi Kallinen 89cfea0085 Fix up/down movement
I broke these in the recent commit changing the movement commands.
2022-01-16 21:46:46 +02:00
Pasi Kallinen e7fa065203 Change special keys into extended commands
Changes most of the special keys used in the main input loop
into extended commands:

- movement keys are now bound to extended commands, eg.
  #movewest and so on.

- m-prefix is now #reqmenu extended command, still bound to
  the 'm' key.

- run, rush, and fight are now extended commands, still bound
  to the same keys as previously.

- nopickup and runnopickup keys are removed.
  Nopickup was using 'm' key, the same as the m-prefix, so
  allow #reqmenu to modify movement commands to disable pickup.

- multiple prefix commands are allowed. This lets user to
  use #reqmenu, followed by #run, followed by movement to simulate
  runnopickup behaviour. (If necessary, adding runnopickup back
  as an extended command would be easy)
2022-01-16 14:48:24 +02:00
Pasi Kallinen 1f2d16082e Fix shopkeeper Kop summons causing segfault
... if it happened on a level with no downstairs, such as the tourist quest.
2022-01-11 22:55:43 +02:00
Pasi Kallinen e36145082a More "user canceled" extended command return values 2022-01-10 17:37:48 +02:00
Pasi Kallinen 6ffcdac45f Use visctrl like in other places 2022-01-09 19:27:47 +02:00
Pasi Kallinen a990eae8ec perm_invent update when applying a bag of tricks 2022-01-09 16:40:35 +02:00
Pasi Kallinen 68b822e4dc Add "user canceled" as extended command return value
Instead of returning ECMD_OK, the commands now return ECMD_CANCEL
when user declined to pick a direction or an object to act on.

Note that this can be ORed with ECMD_TIME, if the command still
took a turn.

For now this has no gameplay meaning.
2022-01-08 20:04:57 +02:00
Pasi Kallinen bcccfaaeac Remove useless variable 2022-01-08 19:15:02 +02:00
Pasi Kallinen 9176589b59 tty: document the termcap codes
some of the termcap codes were missing document comments.
2022-01-07 17:41:39 +02:00
Pasi Kallinen 4133b6a2b0 Fix a brain fart when ORing MM_NOMSG 2022-01-07 07:24:21 +02:00
Pasi Kallinen a77e1602f1 Apply a wielded bullwhip with fire-command 2022-01-06 17:12:30 +02:00
Pasi Kallinen 5b02ad521d Don't autoquiver aklys
... even though it is a throwing weapon, it's meant to be wielded
and fired instead of fired from quiver.
2022-01-06 14:39:32 +02:00
Pasi Kallinen c300f9f084 Fixes entry 2022-01-06 14:34:33 +02:00
Pasi Kallinen 48bca11d67 Accessibility: give message for created monsters
Always give a message when creating a detected monster
during gameplay (as opposed to during level creation).
To prevent the message, use the MM_NOMSG flag for makemon.

Most places already handled their own messaging, but there
were some, such as bag of tricks, create monster magic
and random monsters created during gameplay that didn't.
2022-01-06 14:06:49 +02:00
Pasi Kallinen 66368d7ea2 Add missing article 2022-01-05 18:00:28 +02:00
Pasi Kallinen e5ee580961 Allocate rects dynamically
... instead of hard-coding them to 50. New allocated value is
(COLNO*ROWNO)/30, which is slightly higher (56), and that formula
seems to work for hypothetical larger maps too.
2022-01-05 17:35:33 +02:00
Pasi Kallinen 7238622621 Fix segfault in hypothetical case of huge COLNO 2022-01-05 13:51:44 +02:00
Pasi Kallinen 84af696627 Fix X11 tombstone string overflow 2022-01-04 22:28:16 +02:00
Pasi Kallinen 07451ca32c Update lua api docs 2022-01-04 21:29:06 +02:00
Pasi Kallinen f065cf01c1 Mark extended commands accepting m-prefix in the command flags 2022-01-04 19:29:18 +02:00
Pasi Kallinen c54c857372 Reuse code to limit look region 2022-01-04 13:10:33 +02:00
Pasi Kallinen 711a12afc3 Add a false rumor 2022-01-04 11:14:12 +02:00
Pasi Kallinen 03b55a6fa0 Make the adventurer ghost asleep 2022-01-04 10:55:09 +02:00
Pasi Kallinen dbd1f7a33b Improve wizmode-only command unavailability reporting 2022-01-03 18:06:11 +02:00
Pasi Kallinen 76381815f3 Add theme room: Ghost of an Adventurer 2022-01-02 19:51:32 +02:00
Pasi Kallinen f405d3bfbc Add few hallu colors 2022-01-02 15:10:32 +02:00
Pasi Kallinen 3e620e06eb Define extra sanity checks if not a release 2022-01-02 01:14:16 +02:00
Pasi Kallinen 1cc31f3cba Init variable just in case 2022-01-01 16:58:34 +02:00
Pasi Kallinen 0f132470c7 Allow tipping container directly into another 2022-01-01 16:15:29 +02:00
Pasi Kallinen 8db18275a6 Define engulfing_u, making clearer code 2021-12-31 21:12:21 +02:00