From: nethack.rankin Date: Mon, 28 Feb 2011 11:29:27 +0000 (+0000) Subject: one last(?) polyself bit: no control while stunned (trunk only) X-Git-Tag: MOVE2GIT~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c22fd0bc698ac6e312c57ba71c7af8855ca80c2;p=nethack one last(?) polyself bit: no control while stunned (trunk only) Teleport_control is disabled while the hero is Stunned; do the same with Polymorph_control. Also now disabled while unconscious, but that is academic since random polymorphs and were-critter transformations are postponed until multi is non-negative. I included it for completeness. (Reverting to original form can occur while unconscious, but control is not a factor in that situation. Teleporting handles being unconscious differently but does negate control then.) The fixes entry could just as easily have gone into the new features section as into the bug fixes one. The teleport control part actually belongs in fixes34.4 because it is present in the branch, but I didn't feel like spreading this across two different files (and the current diff references ``Unaware'' which doesn't exist in the branch so it isn't trivial to include this patch there). --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index c8acd81d0..f3ac143d1 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -346,6 +346,7 @@ purple worm could end up in wall or solid rock when swallowing ghost or xorn enhance life-saving by preventing subsequent poison from being fatal upon rescue from death due to spiked pit, dart trap, or poisoned missile don't create mail daemons when populating special levels with random demons +teleport control and polymorph control are ineffective while hero is stunned Platform- and/or Interface-Specific Fixes diff --git a/src/polyself.c b/src/polyself.c index e94a71edc..c7010ff40 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -245,7 +245,7 @@ newman() if (Sick) make_sick(0L, (char *) 0, FALSE, SICK_ALL); if (Stoned) make_stoned(0L, (char *)0, 0, (char *)0); if (u.uhp <= 0) { - if (Polymorph_control) { + if (Polymorph_control) { /* even when Stunned || Unaware */ if (u.uhp <= 0) u.uhp = 1; } else { dead: /* we come directly here if their experience level went to 0 or less */ @@ -286,12 +286,14 @@ int psflags; monsterpoly = (psflags == 2), draconian = (uarm && Is_dragon_armor(uarm)), iswere = (u.ulycn >= LOW_PM), - isvamp = (youmonst.data->mlet == S_VAMPIRE); + isvamp = (youmonst.data->mlet == S_VAMPIRE), + controllable_poly = Polymorph_control && !(Stunned || Unaware); if (Unchanging) { pline("You fail to transform!"); return; } + /* being Stunned|Unaware doesn't negate this aspect of Poly_control */ if (!Polymorph_control && !forcecontrol && !draconian && !iswere && !isvamp) { if (rn2(20) > ACURR(A_CON)) { @@ -307,7 +309,7 @@ int psflags; if (monsterpoly && isvamp) goto do_vampyr; - if (Polymorph_control || forcecontrol) { + if (controllable_poly || forcecontrol) { tryct = 5; do { mntmp = NON_PM; @@ -404,7 +406,7 @@ int psflags; mntmp = (youmonst.data != &mons[PM_VAMPIRE] && !rn2(10)) ? PM_WOLF : !rn2(4) ? PM_FOG_CLOUD : PM_VAMPIRE_BAT; - if (Polymorph_control) { + if (controllable_poly) { Sprintf(buf, "Become %s?", an(mons[mntmp].mname)); if (yn(buf) != 'y') return; diff --git a/src/were.c b/src/were.c index ff1875ccf..864ee5fed 100644 --- a/src/were.c +++ b/src/were.c @@ -1,5 +1,4 @@ /* NetHack 3.5 were.c $Date$ $Revision$ */ -/* SCCS Id: @(#)were.c 3.5 2007/06/02 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -157,9 +156,10 @@ void you_were() { char qbuf[QBUFSZ]; + boolean controllable_poly = Polymorph_control && !(Stunned || Unaware); if (Unchanging || (u.umonnum == u.ulycn)) return; - if (Polymorph_control) { + if (controllable_poly) { /* `+4' => skip "were" prefix to get name of beast */ Sprintf(qbuf, "Do you want to change into %s?", an(mons[u.ulycn].mname+4)); @@ -172,12 +172,14 @@ void you_unwere(purify) boolean purify; { + boolean controllable_poly = Polymorph_control && !(Stunned || Unaware); + if (purify) { You_feel("purified."); u.ulycn = NON_PM; /* cure lycanthropy */ } if (!Unchanging && is_were(youmonst.data) && - (!Polymorph_control || yn("Remain in beast form?") == 'n')) + (!controllable_poly || yn("Remain in beast form?") == 'n')) rehumanize(); }