getting knocked off flying steed

I was trying to reproduce the reported "no monster to remove" warning
from remove_monster() when a mounted hero was knocked off jabberwocky
steed but so far haven't been able to.

While trying, I came across a more minor bug.  The hero got knocked
off a flying steed and got feedback of "you fly off" rather than
"you fall off".  Flying capability came from the steed and dismount
feedback is aware of that but calls u_locomotion() which isn't.  This
commit fixes that.

This adds some groundwork (DISMOUNT_KNOCKED) for better dismount
control.  With a map fragment of
|....
|.Du.
|....
I got knocked off my steed by the attacking dragon and ended up with
|..@.
|.Du.
|....
It would be better to prefer spot 1, then the 2s, then 3s, then 4s
(not sure about farther spots if none of those are available)
|.432
|.D@1
|.432
when forced to dismount by knockback.  This does _not_ implement that.
This commit is contained in:
PatR
2022-10-03 15:53:35 -07:00
parent a8bfeb4dca
commit 546fea7db8
3 changed files with 45 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 hack.h $NHDT-Date: 1652861829 2022/05/18 08:17:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.181 $ */
/* NetHack 3.7 hack.h $NHDT-Date: 1664837602 2022/10/03 22:53:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.196 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2017. */
/* NetHack may be freely redistributed. See license for details. */
@@ -75,10 +75,11 @@ enum dismount_types {
DISMOUNT_GENERIC = 0,
DISMOUNT_FELL = 1,
DISMOUNT_THROWN = 2,
DISMOUNT_POLY = 3,
DISMOUNT_ENGULFED = 4,
DISMOUNT_BONES = 5,
DISMOUNT_BYCHOICE = 6
DISMOUNT_KNOCKED = 3, /* hero hit for knockback effect */
DISMOUNT_POLY = 4,
DISMOUNT_ENGULFED = 5,
DISMOUNT_BONES = 6,
DISMOUNT_BYCHOICE = 7
};
/* polyself flags */