From 5daec07300b79055ff4cdbe8ebff6d122e24acdf Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 2 Jul 2023 14:58:11 -0700 Subject: [PATCH] PR #1008 - get doppelganger form from 'record' Pull request from NulCGT: when a doppelganger is choosing to become a fake player, get role from an entry in the high scores file. Use that entry's name too if the doppelganger is within view at the time. I'm not sure how well this will work for a single user score file if the player always runs the same role and name. I've given it a small chance (1/13) to ignore the topten and stay with random role instead. Closes #1008 --- doc/fixes3-7-0.txt | 2 ++ src/topten.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index d2f739e69..1309f215d 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2169,6 +2169,8 @@ preceding #overview with the 'm' prefix brings up the overview display as a shows every level visited rather than just the "interesting" ones include monster size in feedback for wand of probing and stethoscope crystal armor is now subject to cracking damage rather than outright breakage +when a doppelganger takes on mplayer (fake hero) form, usually choose role + from the high scores file; name too if visable at the time Platform- and/or Interface-Specific New Features diff --git a/src/topten.c b/src/topten.c index 992979e0a..24f6e5783 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1435,7 +1435,7 @@ tt_oname(struct obj *otmp) /* Randomly select a topten entry to mimic */ int tt_doppel(struct monst *mon) { - struct toptenentry *tt = get_rnd_toptenentry(); + struct toptenentry *tt = rn2(13) ? get_rnd_toptenentry() : NULL; int ret; if (!tt) @@ -1447,7 +1447,7 @@ tt_doppel(struct monst *mon) { mon->female = 0; ret = classmon(tt->plrole); /* Only take on a name if the player can see - the doppelganger, otherwise we end up with + the doppelganger, otherwise we end up with named monsters spoiling the fun - Kes */ if (canseemon(mon)) christen_monst(mon, tt->name);