diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4a7c0a4a2..657a2cabf 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -377,6 +377,7 @@ when shop prices are adjusted, handle roundoff (integer truncation) better for hero poly'd into a monster form that lacks a weapon attack but has a claw attack, use wielded weapon even when claw attack isn't the very first rename the SLEEPING property and Sleeping attribute to SLEEPY and Sleepy, resp. +give alternate message for " turns to flee" when mon can't move Platform- and/or Interface-Specific Fixes diff --git a/src/fountain.c b/src/fountain.c index 0339b8391..bb0745002 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -1,5 +1,4 @@ /* NetHack 3.5 fountain.c $Date$ $Revision$ */ -/* SCCS Id: @(#)fountain.c 3.5 2009/01/31 */ /* Copyright Scott R. Turner, srt@ucla, 10/27/86 */ /* NetHack may be freely redistributed. See license for details. */ @@ -334,15 +333,17 @@ drinkfountain() dowaternymph(); break; - case 29: /* Scare */ { + case 29: /* Scare */ + { register struct monst *mtmp; pline("This water gives you bad breath!"); - for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if(!DEADMONSTER(mtmp)) - monflee(mtmp, 0, FALSE, FALSE); + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + monflee(mtmp, 0, FALSE, FALSE); } break; + } case 30: /* Gushing forth in this room */ diff --git a/src/monmove.c b/src/monmove.c index 16533775b..45aa8443f 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -221,15 +221,22 @@ boolean fleemsg; if (!fleetime) mtmp->mfleetim = 0; else if (!mtmp->mflee || mtmp->mfleetim) { - fleetime += mtmp->mfleetim; + fleetime += (int)mtmp->mfleetim; /* ensure monster flees long enough to visibly stop fighting */ if (fleetime == 1) fleetime++; - mtmp->mfleetim = min(fleetime, 127); + mtmp->mfleetim = (unsigned)min(fleetime, 127); + } + if (!mtmp->mflee && fleemsg && canseemon(mtmp) && + mtmp->m_ap_type != M_AP_FURNITURE && + mtmp->m_ap_type != M_AP_OBJECT) { + /* unfortunately we can't distinguish between temporary + sleep and temporary paralysis, so both conditions + receive the same alternate message */ + if (!mtmp->mcanmove || !mtmp->data->mmove) + pline("%s seems to flinch.", Adjmonnam(mtmp, "immobile")); + else + pline("%s turns to flee.", Monnam(mtmp)); } - if (!mtmp->mflee && fleemsg && canseemon(mtmp) && !mtmp->mfrozen && - mtmp->m_ap_type != M_AP_FURNITURE && - mtmp->m_ap_type != M_AP_OBJECT) - pline("%s turns to flee!", (Monnam(mtmp))); mtmp->mflee = 1; } } @@ -259,17 +266,13 @@ int *inrange, *nearby, *scared; seescaryx = u.ux; seescaryy = u.uy; } - *scared = (*nearby && (onscary(seescaryx, seescaryy, mtmp) || - (!mtmp->mpeaceful && - in_your_sanctuary(mtmp, 0, 0)))); - - if(*scared) { - if (rn2(7)) - monflee(mtmp, rnd(10), TRUE, TRUE); - else - monflee(mtmp, rnd(100), TRUE, TRUE); - } - + if (*nearby && + (onscary(seescaryx, seescaryy, mtmp) || + (!mtmp->mpeaceful && in_your_sanctuary(mtmp, 0, 0)))) { + *scared = 1; + monflee(mtmp, rnd(rn2(7) ? 10 : 100), TRUE, TRUE); + } else + *scared = 0; } /* perform a special one-time action for a monster; returns -1 if nothing diff --git a/src/pline.c b/src/pline.c index 6d7b9edef..53029c8dc 100644 --- a/src/pline.c +++ b/src/pline.c @@ -1,5 +1,4 @@ /* NetHack 3.5 pline.c $Date$ $Revision$ */ -/* SCCS Id: @(#)pline.c 3.5 2009/01/29 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -386,7 +385,7 @@ register struct monst *mtmp; /* [arbitrary reason why it isn't moving] */ else if (mtmp->mstrategy & STRAT_WAITMASK) Strcat(info, ", meditating"); - else if (mtmp->mflee) Strcat(info, ", scared"); + if (mtmp->mflee) Strcat(info, ", scared"); if (mtmp->mtrapped) Strcat(info, ", trapped"); if (mtmp->mspeed) Strcat(info, mtmp->mspeed == MFAST ? ", fast" : diff --git a/src/uhitm.c b/src/uhitm.c index 9e336f5f6..f2c65bb61 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2622,12 +2622,8 @@ struct obj *otmp; /* source of flash */ } if (mtmp->mhp > 0) { if (!context.mon_moving) setmangry(mtmp); - if (tmp < 9 && !mtmp->isshk && rn2(4)) { - if (rn2(4)) - monflee(mtmp, rnd(100), FALSE, TRUE); - else - monflee(mtmp, 0, FALSE, TRUE); - } + if (tmp < 9 && !mtmp->isshk && rn2(4)) + monflee(mtmp, rn2(4) ? rnd(100) : 0, FALSE, TRUE); mtmp->mcansee = 0; mtmp->mblinded = (tmp < 3) ? 0 : rnd(1 + 50/tmp); }