Commit Graph

13047 Commits

Author SHA1 Message Date
PatR
a3b52bf6a3 new achievement: drawbridge tune
Use up the last available bit for achievements:
"You learned the tune to open and close the castle's drawbridge."
(More can still be added but xlogfile will need another field to
track a second set of 31 in order to keep its achievement bitmask(s)
within portable size.)

As achievements go, it's not very exciting, but players who normally
destroy the drawbridge have to choose whether to earn an achievement
first since once it's gone, there's no way to find out the tune
(either via prayer reward or successful Mastermind).  I'm guessing
that most will probably decide to ignore this achievement since it
has no effect on the outcome of the game.  However, that might not
be true for future tournament play.

There's no need to bump EDITLEVEL for this; room for recording one
additional achievement is already allocated.
2022-02-27 01:55:25 -08:00
Pasi Kallinen
6a65b41270 Using magic portals and level teleporters stuns for a few turns
It's taxing to teleport long distances.

Yes, this makes the entrance to the planes and the quest more
dangerous, and nerfs portal dancing Fort Ludios.
2022-02-27 11:25:58 +02:00
Pasi Kallinen
1d4d0f4b0e Use more u_locomotion
... and make it autocapitalize the first letter, just like locomotion
2022-02-27 11:07:31 +02:00
Pasi Kallinen
9e666b75f6 Make rope golem have some death drops 2022-02-26 23:46:55 +02:00
Pasi Kallinen
d0f349cbd1 Use find_mid finding the leashed mon 2022-02-26 22:42:37 +02:00
PatR
020d3f76d5 choose_stairs() revisited
Rewrite choose_stairs().  Use of '&& !builds_up()' was a no-op in
normal branches and forced picking the down stairs/ladder in Vlad's
Tower (or Sokoban) rather than reversing the usual up/down choice.

Also, the logic used was backwards:  Kops always surrounded the up
stairs instead of the down stairs as intended.  Non-Kops picked the
opposite direction of what the arguments asked for but since they based
their choice of up versus down on hidden mon->m_id, the reversal wasn't
noticeable.

Extend the choosing so that if nothing in the requested direction can
be found, it tries the opposite direction.  Otherwise when Vlad's m_id
happens to force the direction to be 'up', he has nowhere to teleport
to now that being in his Tower doesn't force 'down' anymore.  He goes
to down ladder when on the top level but if you level teleport to the
next level down and he accompanies you, he might go to either the down
ladder or the up ladder when he tries to get away from you to heal.
2022-02-26 10:15:58 -08:00
Pasi Kallinen
f8cb7ae0b8 Unify shopkeeper/guard/priest bit in m_move 2022-02-26 18:05:43 +02:00
Pasi Kallinen
7523623d95 Make m_move return defines instead of magic numbers 2022-02-26 17:40:17 +02:00
PatR
8c447e6ad5 formatting bits in end.c 2022-02-26 00:24:17 -08:00
PatR
b1d59665d8 Fixes entry for pull request #685 - place_object
From argrath:  in place_object(object, x, y), validate <x,y> before
using them as indices into level.objects[][] instead of after.

Closes #685
2022-02-25 22:44:17 -08:00
SHIRAKATA Kentaro
757139476f move validations before their first use 2022-02-25 22:41:21 -08:00
PatR
7f28a79ae6 fix github issue #686 - dead code
Reported by argrath:  the code in choose_stairs() intended as last
resort wouldn't do anything because the loop's test condition always
started out false.  Fix suggested by entrez.

Closes #686
2022-02-25 22:35:04 -08:00
Pasi Kallinen
4b6b976e3b Split escaping from sticking monster check out of domove 2022-02-25 22:26:12 +02:00
Pasi Kallinen
f88dce6970 Unify domove and lookaround trap/liquid avoidance code
Nearly same code was in two places - the only difference was
how g.context.run == 1 was handled.  Previously, if you were
blind, and knew about the water or lava, you still ran into it.
Now, we always avoid the dunking if running/rushing.
2022-02-25 21:52:52 +02:00
PatR
54df272f50 remove references to old Qt 'moc' timestamp files
src/moc.qt[56] existed briefly but got replaced by src/Qt[56].h-t
(controlled by hints/include/compiler.370).  The old names were
deliberately left in src/.gitignore and sys/unix/Makefile.src's
'clean' target to give some time for anyone who had generated them
to run 'make clean' to get rid of them.  That time is now up.  It's
only been about three weeks but if I wait any longer I'll probably
forget.
2022-02-25 10:39:45 -08:00
Pasi Kallinen
e57c631ef9 Minor code clarification 2022-02-25 19:48:17 +02:00
Pasi Kallinen
86bc0a2633 Split movement out of bounds check out of domove 2022-02-25 18:33:50 +02:00
Pasi Kallinen
4e11a85fb7 Split carrying too much check out of domove 2022-02-25 18:12:55 +02:00
PatR
ca97f4f3dd more thrown object cleanup
Handle thrown or kicked object that's in transit for hangup save and
panic save in addition to normal end of game.  Affects ball and chain
placement too, if they've been temporarily taken off the map.
2022-02-25 07:10:30 -08:00
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
PatR
1abf723f03 place_object() bit: panic/impossible decl 2022-02-24 18:15:48 -08:00
PatR
20eccf8ead lost objects thrown by monsters
Reported by entrez:  if a monster or explosion kills the hero with an
object that has timers or is a light source, it could trigger a panic
when end of game cleanup can't find it because it has been removed
from the map or monster's inventory and not placed back on the map
yet.  This isn't much different from something thrown by hero which
had a similar situation dealt with a long time ago.  Fix by setting
'thrownobj' for monster-launched and explosion-launched missiles.
That way done_object_cleanup() called from really_done() will place the
missile on the map where saving bones or general cleanup can find it.

It doesn't bother dealing with exploding a lit potion of oil that
kills the hero by missile damage before the potion explodes.  If that
ends up in bones, it should still be lit and might blow up before the
new character reaches it.  (Not verified.)

The code for a hero polymorphed into a unicorn and catching a thrown
gem has been moved into its own routine.  No change in behavior, just
less clutter in the thrown-object-hits-hero section of the monster
throwing routine.
2022-02-24 18:10:52 -08:00
PatR
ab2bcf4dac trap followup
Make the flags argument to dotrap() and mintrap() and the constants
passed to them all have consistent type: unsigned int.
2022-02-24 12:17:21 -08: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
Michael Meyer
1e951db9bc Fix: monster hurtling and liquid
A monster hurtling over liquid would drown immediately the instant it
touched the first square of water, even if normally it would have kept
moving (e.g. hurtling over a short moat).  Additionally, its placement
on liquid would not take into consideration other monsters, so it could
overwrite an existing monster on that spot and lead to an impossible,
and/or two monsters occupying a single position.

Fix these issues, so that liquid effects like drowning only happen if
the monster ends up in liquid at the end of the hurtle, and so that
other monsters in the way will stop it early even if they're floating
over or swimming on a pool/water/lava square.

Also use canspotmon instead of canseemon for the wiztelekinesis debug
command.
2022-02-24 14:53:48 +02:00
Pasi Kallinen
8e91320d2f Use u_at macro 2022-02-23 20:28:55 +02:00
PatR
2635c60280 fix #K3529 - perm_invent not IDing blank scroll
Report was for curses but issue is in the core so any interface
that supports persistent inventory is affected.  Reading a not-yet-
discovered scroll of blank paper wasn't always updating perm_invent
to show change in formatted description when it became discovered.

Would only happen on turn #1 (so the scroll needed to be acquired
via autopickup at starting location or via wizard mode wish so that
it could be read before any game time elapsed) when the object
discovery routine deliberately avoided updating perm_invent.  Fix
by using a different way than moves==1 to decide whether an object
is being discovered because it is part of hero's initial inventory.
2022-02-23 09:50:25 -08: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