From 2c3964e619aa42aeda2343e03a88d486d59ff046 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 11 Oct 2002 00:46:37 +0000 Subject: [PATCH] #dipping from steed Fix the reported bug of an unskilled rider who is unable to pick items off the floor while mounted still being able to dip into water. There might be other actions which need similar checking; this one only handles the dip into pool/moat case. --- doc/fixes34.1 | 2 ++ include/extern.h | 1 + src/pickup.c | 3 +-- src/potion.c | 11 ++++++++--- src/steed.c | 9 ++++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 90f45c2b5..47d1fbf81 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -270,6 +270,8 @@ class genocide that killed polymorphed self while `Unchanging' reported incomplete cause of death and possibly left rest of class in bones class genocide of @ by human or elf character polymorphed into non-@ gave "you feel dead inside" message twice +unskilled rider who can't reach items on floor also can't dip into moat or + pool from flying steed Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 94191039d..29eb49356 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1876,6 +1876,7 @@ E struct obj *FDECL(findgold, (struct obj *)); /* ### steed.c ### */ #ifdef STEED +E void NDECL(rider_cant_reach); E boolean FDECL(can_saddle, (struct monst *)); E int FDECL(use_saddle, (struct obj *)); E boolean FDECL(can_ride, (struct monst *)); diff --git a/src/pickup.c b/src/pickup.c index 0e6ec20fa..a69f8e25c 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1369,8 +1369,7 @@ int x, y; if (!can_reach_floor()) { #ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) - You("aren't skilled enough to reach from %s.", - mon_nam(u.usteed)); + rider_cant_reach(); /* not skilled enough to reach */ else #endif You("cannot reach the %s.", surface(x, y)); diff --git a/src/potion.c b/src/potion.c index 595f7d121..d6a4c3896 100644 --- a/src/potion.c +++ b/src/potion.c @@ -593,7 +593,7 @@ peffects(otmp) if (Free_action) You("stiffen momentarily."); else { - if (Levitation||Is_airlevel(&u.uz)||Is_waterlevel(&u.uz)) + if (Levitation || Is_airlevel(&u.uz)||Is_waterlevel(&u.uz)) You("are motionlessly suspended."); #ifdef STEED else if (u.usteed) @@ -1546,9 +1546,14 @@ dodip() tmp = (here == POOL) ? "pool" : "moat"; Sprintf(qbuf, "Dip it into the %s?", tmp); if (yn(qbuf) == 'y') { - if (Levitation) + if (Levitation) { floating_above(tmp); - else { +#ifdef STEED + } else if (u.usteed && !is_swimmer(u.usteed->data) && + P_SKILL(P_RIDING) < P_BASIC) { + rider_cant_reach(); /* not skilled enough to reach */ +#endif + } else { (void) get_wet(obj); if (obj->otyp == POT_ACID) useup(obj); } diff --git a/src/steed.c b/src/steed.c index c224f4943..c97d82175 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)steed.c 3.4 2002/09/08 */ +/* SCCS Id: @(#)steed.c 3.4 2002/10/10 */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -14,6 +14,13 @@ static NEARDATA const char steeds[] = { STATIC_DCL boolean FDECL(landing_spot, (coord *, int)); +/* caller has decided that hero can't reach something while mounted */ +void +rider_cant_reach() +{ + You("aren't skilled enough to reach from %s.", y_monnam()); +} + /*** Putting the saddle on ***/ /* Can this monster wear a saddle? */