diff --git a/include/extern.h b/include/extern.h index 2c32a0ed5..7bfb13e48 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)extern.h 3.4 2002/01/04 */ +/* SCCS Id: @(#)extern.h 3.4 2002/03/09 */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,7 +34,7 @@ E int NDECL(dojump); E int FDECL(jump, (int)); E int NDECL(number_leashed); E void FDECL(o_unleash, (struct obj *)); -E void FDECL(m_unleash, (struct monst *)); +E void FDECL(m_unleash, (struct monst *,BOOLEAN_P)); E void NDECL(unleash_all); E boolean NDECL(next_to_u); E struct obj *FDECL(get_mleash, (struct monst *)); diff --git a/src/apply.c b/src/apply.c index 50f9ddf19..b11c00e09 100644 --- a/src/apply.c +++ b/src/apply.c @@ -360,11 +360,18 @@ register struct obj *otmp; } void -m_unleash(mtmp) /* mtmp is about to die, or become untame */ +m_unleash(mtmp, feedback) /* mtmp is about to die, or become untame */ register struct monst *mtmp; +boolean feedback; { register struct obj *otmp; + if (feedback) { + if (canseemon(mtmp)) + pline("%s pulls free of %s leash!", Monnam(mtmp), mhis(mtmp)); + else + Your("leash falls slack."); + } for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == LEASH && otmp->leashmon == (int)mtmp->m_id) @@ -542,7 +549,7 @@ register xchar x, y; if(um_dist(mtmp->mx, mtmp->my, 5)) { pline("%s leash snaps loose!", s_suffix(Monnam(mtmp))); - m_unleash(mtmp); + m_unleash(mtmp, FALSE); } else { if(um_dist(mtmp->mx, mtmp->my, 3)) { You("pull on the leash."); diff --git a/src/dog.c b/src/dog.c index ea0133ca5..0811fdcb9 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dog.c 3.4 1999/10/20 */ +/* SCCS Id: @(#)dog.c 3.4 2002/03/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -473,7 +473,7 @@ boolean pets_only; /* true for ascension or final escape */ humanoid(mtmp->data) ? (mtmp->female ? "Her" : "His") : "Its"); - m_unleash(mtmp); + m_unleash(mtmp, FALSE); } continue; } @@ -512,7 +512,7 @@ boolean pets_only; /* true for ascension or final escape */ /* this can happen if your quest leader ejects you from the "home" level while a leashed pet isn't next to you */ pline("%s leash goes slack.", s_suffix(Monnam(mtmp))); - m_unleash(mtmp); + m_unleash(mtmp, FALSE); } } } @@ -554,7 +554,7 @@ migrate_to_level(mtmp, tolev, xyloc, cc) mtmp->nmon = migrating_mons; migrating_mons = mtmp; if (mtmp->mleashed) { - m_unleash(mtmp); + m_unleash(mtmp, FALSE); mtmp->mtame--; pline_The("leash comes off!"); } @@ -833,7 +833,7 @@ struct monst *mtmp; if (!mtmp->mtame && mtmp->mleashed) { pline("%s breaks loose of %s leash!", Monnam(mtmp), mhis(mtmp)); - m_unleash(mtmp); + m_unleash(mtmp, FALSE); } /* don't make a sound if pet is in the middle of leaving the level */ diff --git a/src/dogmove.c b/src/dogmove.c index 333f6cbd9..fcfeb6869 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dogmove.c 3.4 1997/05/25 */ +/* SCCS Id: @(#)dogmove.c 3.4 2002/03/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -717,7 +717,7 @@ newdogpos: if (mtmp->mleashed) { /* play it safe */ pline("%s breaks loose of %s leash!", Monnam(mtmp), mhis(mtmp)); - m_unleash(mtmp); + m_unleash(mtmp, FALSE); } (void) mattacku(mtmp); return(0); diff --git a/src/mon.c b/src/mon.c index 5d01a590b..816370e6b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mon.c 3.4 2002/02/07 */ +/* SCCS Id: @(#)mon.c 3.4 2002/03/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1241,7 +1241,7 @@ m_detach(mtmp, mptr) struct monst *mtmp; struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */ { - if(mtmp->mleashed) m_unleash(mtmp); + if (mtmp->mleashed) m_unleash(mtmp, FALSE); /* to prevent an infinite relobj-flooreffects-hmon-killed loop */ mtmp->mtrapped = 0; mtmp->mhp = 0; /* simplify some tests: force mhp to 0 */ diff --git a/src/teleport.c b/src/teleport.c index 91dc36812..05e2d2a76 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)teleport.c 3.4 2001/12/06 */ +/* SCCS Id: @(#)teleport.c 3.4 2002/03/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -332,7 +332,7 @@ boolean force_it; } else { Your("leash goes slack."); release_it: - m_unleash(mtmp); + m_unleash(mtmp, FALSE); return TRUE; } }