weakening the mysterious force effect

Izchak implemented the mysterious force and as far as I'm concerned,
it's here to stay.  But it can be fine tuned.  This is an experimental
attempt to make it happen less.  Each time it happens, the chance for
it happening again later will usually go down by an amount proportional
to how far it sent the hero back.  So chaotics will be sent back--or
"side to side"--less often than in 3.6.x but the tapering off of such
occurrences will be slower for them.  Lawfuls will also be sent back
less often--still potentially farther down than others--but tapering
off of send backs for them will be quicker.

I'll let somebody else figure out the before and after values for
number of attempts to climb up it takes to finally get out of Gehennom.
The numbers might need tuning.
This commit is contained in:
PatR
2019-12-07 19:26:47 -08:00
parent ba36e7107f
commit e9fab48aeb
3 changed files with 23 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1575245055 2019/12/02 00:04:15 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.196 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1575775597 2019/12/08 03:26:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.216 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1279,15 +1279,22 @@ boolean at_stairs, falling, portal;
* -1 11.46 12.50 12.5
* -2 5.21 4.17 0.0
* -3 2.08 0.0 0.0
*
* 3.7.0: the chance for the "mysterious force" to kick in goes down
* as it kicks in, starting at 25% per climb attempt and dropping off
* gradually but substantially. The drop off is greater when hero is
* sent down farther so benefits lawfuls more than chaotics this time.
*/
if (Inhell && up && u.uhave.amulet && !newdungeon && !portal
&& (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz) - 3)) {
if (!rn2(4)) {
if (!rn2(4 + g.context.mysteryforce)) {
int odds = 3 + (int) u.ualign.type, /* 2..4 */
diff = odds <= 1 ? 0 : rn2(odds); /* paranoia */
diff = (odds <= 1) ? 0 : rn2(odds); /* paranoia */
if (diff != 0) {
assign_rnd_level(newlevel, &u.uz, diff);
/* assign_rnd_level() may have used a value less than diff */
diff = u.uz.dlevel - newlevel->dlevel; /* actual descent */
/* if inside the tower, stay inside */
if (was_in_W_tower && !On_W_tower_level(newlevel))
diff = 0;
@@ -1295,15 +1302,20 @@ boolean at_stairs, falling, portal;
if (diff == 0)
assign_level(newlevel, &u.uz);
new_ledger = ledger_no(newlevel);
pline("A mysterious force momentarily surrounds you...");
/* each time it kicks in, the chance of doing so again may drop;
that drops faster, on average, when being sent down farther so
while the impact is reduced for everybody compared to earlier
versions, it is reduced least for chaotics, most for lawfuls */
g.context.mysteryforce += rn2(diff + 2); /* L:0-4, N:0-3, C:0-2 */
if (on_level(newlevel, &u.uz)) {
(void) safe_teleds(FALSE);
(void) next_to_u();
return;
} else
at_stairs = g.at_ladder = FALSE;
}
new_ledger = ledger_no(newlevel);
at_stairs = g.at_ladder = FALSE;
}
}