MCPcopy Index your code
hub / github.com/NetHack/NetHack / check_special_room

Function check_special_room

src/hack.c:3625–3780  ·  view source on GitHub ↗

possibly deliver a one-time room entry message */

Source from the content-addressed store, hash-verified

3623
3624/* possibly deliver a one-time room entry message */
3625void
3626check_special_room(boolean newlev)
3627{
3628 struct monst *mtmp;
3629 char *ptr;
3630
3631 move_update(newlev);
3632
3633 if (*u.ushops0)
3634 u_left_shop(u.ushops_left, newlev);
3635
3636 /*
3637 * Check for attaining 'entered Mine Town' achievement.
3638 * Most of the Mine Town variations have the town in one large room
3639 * containing a bunch of subrooms; we check for entering that large
3640 * room. However, two of the variations cover the whole level rather
3641 * than include a room with subrooms. We need to check for town entry
3642 * before the possible early return for not having entered a room in
3643 * case we have arrived in the town but have not entered any room.
3644 *
3645 * TODO: change the minetn variants which don't include any town
3646 * boundary to have such.
3647 */
3648 if (svl.level.flags.has_town && !svc.context.achieveo.minetn_reached
3649 && In_mines(&u.uz) && in_town(u.ux, u.uy)) {
3650 record_achievement(ACH_TOWN);
3651 svc.context.achieveo.minetn_reached = TRUE;
3652 }
3653
3654 if (!*u.uentered && !*u.ushops_entered) /* implied by newlev */
3655 return; /* no entrance messages necessary */
3656
3657 /* Did we just enter a shop? */
3658 if (*u.ushops_entered)
3659 u_entered_shop(u.ushops_entered);
3660
3661 for (ptr = &u.uentered[0]; *ptr; ptr++) {
3662 int roomno = *ptr - ROOMOFFSET, rt = svr.rooms[roomno].rtype;
3663 boolean msg_given = TRUE;
3664
3665 /* Did we just enter some other special room? */
3666 /* vault.c insists that a vault remain a VAULT,
3667 * and temples should remain TEMPLEs,
3668 * but everything else gives a message only the first time */
3669 switch (rt) {
3670 case ZOO:
3671 pline("Welcome to David's treasure zoo!");
3672 break;
3673 case SWAMP:
3674 pline("It %s rather %s down here.", Blind ? "feels" : "looks",
3675 Blind ? "humid" : "muddy");
3676 break;
3677 case COURT:
3678 You("enter an opulent%s room!",
3679 /* the throne room in Sam quest home level lacks a throne */
3680 !furniture_present(THRONE, roomno) ? "" : " throne");
3681 break;
3682 case LEPREHALL:

Callers 10

newgameFunction · 0.85
rloc_to_coreFunction · 0.85
goto_levelFunction · 0.85
dorecoverFunction · 0.85
pooleffectsFunction · 0.85
spoteffectsFunction · 0.85
hurtle_stepFunction · 0.85
after_shk_moveFunction · 0.85
move_specialFunction · 0.85
makemap_prepostFunction · 0.85

Calls 15

move_updateFunction · 0.85
u_left_shopFunction · 0.85
In_minesFunction · 0.85
in_townFunction · 0.85
record_achievementFunction · 0.85
u_entered_shopFunction · 0.85
YouFunction · 0.85
furniture_presentFunction · 0.85
midnightFunction · 0.85
u_locomotionFunction · 0.85
monstinroomFunction · 0.85
verbalizeFunction · 0.85

Tested by

no test coverage detected