Randomly select a topten entry to mimic */
| 1442 | |
| 1443 | /* Randomly select a topten entry to mimic */ |
| 1444 | int |
| 1445 | tt_doppel(struct monst *mon) { |
| 1446 | struct toptenentry *tt = rn2(13) ? get_rnd_toptenentry() : NULL; |
| 1447 | int ret; |
| 1448 | |
| 1449 | if (!tt) |
| 1450 | ret = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST); |
| 1451 | else { |
| 1452 | if (tt->plgend[0] == 'F') |
| 1453 | mon->female = 1; |
| 1454 | else if (tt->plgend[0] == 'M') |
| 1455 | mon->female = 0; |
| 1456 | ret = classmon(tt->plrole); |
| 1457 | /* Only take on a name if the player can see |
| 1458 | the doppelganger, otherwise we end up with |
| 1459 | named monsters spoiling the fun - Kes */ |
| 1460 | if (canseemon(mon)) |
| 1461 | christen_monst(mon, tt->name); |
| 1462 | } |
| 1463 | return ret; |
| 1464 | } |
| 1465 | |
| 1466 | #ifdef NO_SCAN_BRACK |
| 1467 | /* Lattice scanf isn't up to reading the scorefile. What */ |
no test coverage detected