diff --git a/doc/fixes35.0 b/doc/fixes35.0 index e62c33552..4b1c5a62e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -161,6 +161,7 @@ pushing a boulder onto a level teleporter trap could issue repeat messages if shopkeeper or priest gets teleported while inside his shop or temple, give locations inside that room preference when choosing destination tame/peaceful grabber/engulfer will release hero after conflict ends +any grabber will release hero if it moves away while confused/stunned/afraid make changes in hallucination be reflected by changes in mimickery feedback add Unaware pseudo-property to suppress various messages while unconscious missile which kills engulfer will now be placed prior to hero's return to map diff --git a/src/monmove.c b/src/monmove.c index e15c65016..16533775b 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,5 +1,4 @@ /* NetHack 3.5 monmove.c $Date$ $Revision$ */ -/* SCCS Id: @(#)monmove.c 3.5 2007/08/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -295,9 +294,6 @@ register struct monst *mtmp; register struct permonst *mdat; register int tmp=0; int inrange, nearby, scared; -#ifdef GOLDOBJ - struct obj *ygold = 0, *lepgold = 0; -#endif /* Pre-movement adjustments */ @@ -479,19 +475,14 @@ toofar: /* Now the actual movement phase */ + if(!nearby || mtmp->mflee || scared || + mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || #ifndef GOLDOBJ - if(!nearby || mtmp->mflee || scared || - mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || - (mdat->mlet == S_LEPRECHAUN && !u.ugold && (mtmp->mgold || rn2(2))) || + (mdat->mlet == S_LEPRECHAUN && + !u.ugold && (mtmp->mgold || rn2(2))) || #else - if (mdat->mlet == S_LEPRECHAUN) { - ygold = findgold(invent); - lepgold = findgold(mtmp->minvent); - } - - if(!nearby || mtmp->mflee || scared || - mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || - (mdat->mlet == S_LEPRECHAUN && !ygold && (lepgold || rn2(2))) || + (mdat->mlet == S_LEPRECHAUN && + !findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) || #endif (is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) || (!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) { @@ -534,18 +525,21 @@ toofar: case 1: /* monster moved */ /* Maybe it stepped on a trap and fell asleep... */ if (mtmp->msleeping || !mtmp->mcanmove) return(0); - if(!nearby && - (ranged_attk(mdat) || find_offensive(mtmp))) + /* Monsters can move and then shoot on same turn; + our hero can't. Is that fair? */ + if (!nearby && + (ranged_attk(mdat) || find_offensive(mtmp))) break; - else if(u.uswallow && mtmp == u.ustuck) { + /* engulfer/grabber checks */ + if (mtmp == u.ustuck) { /* a monster that's digesting you can move at the * same time -dlc */ - return(mattacku(mtmp)); - } else - return(0); - /*NOTREACHED*/ - break; + if (u.uswallow) return mattacku(mtmp); + /* if confused grabber has wandered off, let go */ + if (distu(mtmp->mx, mtmp->my) > 2) unstuck(mtmp); + } + return(0); case 2: /* monster died */ return(1); }