Source:NetHack 3.4.3/src/allmain.c

From NetHackWiki
(Redirected from Source:Ref/newgame)
Jump to navigation Jump to search

Below is the full text to src/allmain.c from NetHack 3.4.3. To link to a particular line, write [[allmain.c#line123]], for example.

Top of file

/*	SCCS Id: @(#)allmain.c	3.4	2003/04/02	*/
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed.  See license for details. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

/* various code that was replicated in *main.c */

#include "hack.h"

#ifndef NO_SIGNAL
#include <signal.h>
#endif

#ifdef POSITIONBAR
STATIC_DCL void NDECL(do_positionbar);
#endif

moveloop

#ifdef OVL0

void
moveloop()
{
#if defined(MICRO) || defined(WIN32)
char ch;
int abort_lev;
#endif
int moveamt = 0, wtcap = 0, change = 0;
boolean didmove = FALSE, monscanmove = FALSE;

Initialization

flags.moonphase = phase_of_the_moon();
if(flags.moonphase == FULL_MOON) {
	You("are lucky!  Full moon tonight.");
	change_luck(1);
} else if(flags.moonphase == NEW_MOON) {
	pline("Be careful!  New moon tonight.");
}
flags.friday13 = friday_13th();
if (flags.friday13) {
	pline("Watch out!  Bad things can happen on Friday the 13th.");
	change_luck(-1);
}

The luck adjustments are simply to set initial luck using change_luck. Actual base luck is defined in nh_timeout.

initrack();

initrack initialises the tracking system by which pets (and certain monsters such as leprechauns can follow the player.

/* Note:  these initializers don't do anything except guarantee that
	    we're linked properly.
*/
decl_init();
monst_init();
monstr_init();	/* monster strengths */
objects_init();

decl_init, monst_init, monstr_init, and objects_init are all empty routines used to force the appropriate definitions to compile and be available to the rest of the program.

#ifdef WIZARD
if (wizard) add_debug_extended_commands();

add_debug_extended_commands enables the wizard mode extended commands.

#endif

(void) encumber_msg(); /* in case they auto-picked up something */

encumber_msg recalculates the player's encumbrance and displays an appropriate message if it has changed.

u.uz0.dlevel = u.uz.dlevel;
youmonst.movement = NORMAL_SPEED;	/* give the hero some movement points */

Main loop

for(;;) {
	get_nh_event();
#ifdef POSITIONBAR
	do_positionbar();
#endif

get_nh_event and do_positionbar are routines related to the current interface. get_nh_event invokes any system processing related to window updating and do_positionbar generates information related to a horizontal positoning bar that may be present in the window system.

	didmove = flags.move;

flags.move is set whenever the player has performed an action that requires actual game time (moving, fighting, dropping and picking up objects, etc.).

	if(didmove) {
	    /* actual time passed */
	    youmonst.movement -= NORMAL_SPEED;

Any action that takes time requires NORMAL_SPEED movement points.

	    do { /* hero can't move this turn loop */
		wtcap = encumber_msg();

		flags.mon_moving = TRUE;
		do {
		    monscanmove = movemon();
		    if (youmonst.movement > NORMAL_SPEED)
			break;	/* it's now your turn */
		} while (monscanmove);
		flags.mon_moving = FALSE;

Now that the player has moved, give all monsters at least one chance to move using movemon. If the player does not have sufficient movement points to move any more this turn keep moving monsters; otherwise give monsters only one chance at a move.

		if (!monscanmove && youmonst.movement < NORMAL_SPEED) {

Once-per-turn events

		    /* both you and the monsters are out of steam this round */
		    /* set up for a new turn */

Nothing more can move this turn; therefore prepare to move to the next turn.

		    struct monst *mtmp;
		    mcalcdistress();	/* adjust monsters' trap, blind, etc */

mcalcdistress is responsible for updates of change-of-turn monster data.

		    /* reallocate movement rations to monsters */
		    for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
			mtmp->movement += mcalcmove(mtmp);

This grants movement points to monsters for the coming turn. mcalcmove determines how many points the monster will get.

		    if(!rn2(u.uevent.udemigod ? 25 :
			    (depth(&u.uz) > depth(&stronghold_level)) ? 50 : 70))
			(void) makemon((struct permonst *)0, 0, 0, NO_MM_FLAGS);

This important segment is responsible for all random monster generation. The flag u.uevent.demigod is set after killing the Wizard of Yendor for the first time or on performing the invocation ritual; therefore after these events a monster is generated randomly on the level with a 1/25 chance each turn; otherwise there is a 1/50 chance if you are below the Castle and 1/70 chance if you are not.

		    /* calculate how much time passed. */
#ifdef STEED
		    if (u.usteed && u.umoved) {
			/* your speed doesn't augment steed's speed */
			moveamt = mcalcmove(u.usteed);

If you are mounted, your movement point allocation is that of your steed.

		    } else
#endif
		    {
			moveamt = youmonst.data->mmove;

			if (Very_fast) {	/* speed boots or potion */
			    /* average movement is 1.67 times normal */
			    moveamt += NORMAL_SPEED / 2;
			    if (rn2(3) == 0) moveamt += NORMAL_SPEED / 2;
			} else if (Fast) {
			    /* average movement is 1.33 times normal */
			    if (rn2(3) != 0) moveamt += NORMAL_SPEED / 2;
			}
		    }

		    switch (wtcap) {
			case UNENCUMBERED: break;
			case SLT_ENCUMBER: moveamt -= (moveamt / 4); break;
			case MOD_ENCUMBER: moveamt -= (moveamt / 2); break;
			case HVY_ENCUMBER: moveamt -= ((moveamt * 3) / 4); break;
			case EXT_ENCUMBER: moveamt -= ((moveamt * 7) / 8); break;
			default: break;
		    }

		    youmonst.movement += moveamt;
		    if (youmonst.movement < 0) youmonst.movement = 0;

This segment calculates your movement rate for the turn. It is first set to the normal movement rate of your current form (which of course changes if you are polymorphed). If you are fast, you have a 2/3 chance of earning an extra NORMAL_SPEED / 2 movement points; if you are very fast you are guaranteed at least NORMAL_SPEED / 2 points with a 1/3 chance of another NORMAL_SPEED / 2. (Note that NORMAL_SPEED does not vary if you are polymorphed, so the speed intrinsic is more effective if you are in a very slow form and less effective if you are in a very fast form.) Finally, your speed is adjusted for encumbrance and added to your current movement point total.

		    settrack();

settrack updates your position in the tracking system.

		    monstermoves++;
		    moves++;

Finally, the turn counter is incremented; we are now on a new turn.

		    /********************************/
		    /* once-per-turn things go here */
		    /********************************/

		    if (flags.bypasses) clear_bypasses();

clear_bypasses clears a flag related to whether an object should be hit by a wand zapped at it (amongst other events).

		    if(Glib) glibr();

glibr is the code relating to slippery fingers.

		    nh_timeout();

nh_timeout handles all timeouts related to time-delayed functions such as extrinsics from potions, stoning, sliming, etc.

		    run_regions();

run_regions handles timeouts for area effects, currently only used for stinking clouds.

		    if (u.ublesscnt)  u.ublesscnt--;

Decrements the prayer timeout.

		    if(flags.time && !flags.run)
			flags.botl = 1;

Indicates that the status line needs to be updated if the turn counter is shown in the bottom line.

		    /* One possible result of prayer is healing.  Whether or
		     * not you get healed depends on your current hit points.
		     * If you are allowed to regenerate during the prayer, the
		     * end-of-prayer calculation messes up on this.
		     * Another possible result is rehumanization, which requires
		     * that encumbrance and movement rate be recalculated.
		     */
		    if (u.uinvulnerable) {
			/* for the moment at least, you're in tiptop shape */
			wtcap = UNENCUMBERED;

u.uinvulnerable is set whenever you are being protected by your deity while praying; during this time you are not considered to be encumbered.

		    } else if (Upolyd && youmonst.data->mlet == S_EEL && !is_pool(u.ux,u.uy) && !Is_waterlevel(&u.uz)) {
			if (u.mh > 1) {
			    u.mh--;
			    flags.botl = 1;
			} else if (u.mh < 1)
			    rehumanize();

If you are polymorphed into a sea monster and are out of water, you lose one hit point per turn down to a minimum of one.

		    } else if (Upolyd && u.mh < u.mhmax) {
			if (u.mh < 1)
			    rehumanize();

If you are killed in a polymorphed form, attempt to return the player to their normal form.

			else if (Regeneration ||
				    (wtcap < MOD_ENCUMBER && !(moves%20))) {
			    flags.botl = 1;
			    u.mh++;
			}

If you are in a polymorphed form and are either regenerating or on a twentieth move, regain a hitpoint.

		    } else if (u.uhp < u.uhpmax &&
			 (wtcap < MOD_ENCUMBER || !u.umoved || Regeneration)) {
			if (u.ulevel > 9 && !(moves % 3)) {
			    int heal, Con = (int) ACURR(A_CON);

			    if (Con <= 12) {
				heal = 1;
			    } else {
				heal = rnd(Con);
				if (heal > u.ulevel-9) heal = u.ulevel-9;
			    }
			    flags.botl = 1;
			    u.uhp += heal;
			    if(u.uhp > u.uhpmax)
				u.uhp = u.uhpmax;
			} else if (Regeneration ||
			     (u.ulevel <= 9 &&
			      !(moves % ((MAXULEV+12) / (u.ulevel+2) + 1)))) {
			    flags.botl = 1;
			    u.uhp++;
			}

If you are not polymorphed, regenerate hitpoints. Every third turn if you are level 10 or above, gain an amount of hitpoints equal to a random value up to your current constitution if it is 13 or above, or 1 if your current constitution is below 13. Otherwise gain one hitpoint if you are regenerating, or you are level 9 or less and a certain number of turns related to your current level has passed. This requires that you are not stressed or worse if you are not regenerating.

		    }

		    /* moving around while encumbered is hard work */
		    if (wtcap > MOD_ENCUMBER && u.umoved) {
			if(!(wtcap < EXT_ENCUMBER ? moves%30 : moves%10)) {
			    if (Upolyd && u.mh > 1) {
				u.mh--;
			    } else if (!Upolyd && u.uhp > 1) {
				u.uhp--;
			    } else {
				You("pass out from exertion!");
				exercise(A_CON, FALSE);
				fall_asleep(-10, FALSE);
			    }
			}
		    }

If you are strained or overtaxed, lose hit points from trying to move around; this is every thirty turns if you are strained and every ten if you are overtaxed.

		    if ((u.uen < u.uenmax) &&
			((wtcap < MOD_ENCUMBER &&
			  (!(moves%((MAXULEV + 8 - u.ulevel) *
				    (Role_if(PM_WIZARD) ? 3 : 4) / 6))))
			 || Energy_regeneration)) {
			u.uen += rn1((int)(ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1,1);
			if (u.uen > u.uenmax)  u.uen = u.uenmax;
			flags.botl = 1;
		    }

Regenerate power if you are not stressed or worse on every (38 - current level) * 4 moves if you are not a wizard or * 3 if you are, or have the energy regeneration extrinsic from the Eye of the Aethiopica; you gain from 1 to 1/15th the sum of your current intelligence and wisdom totals.

		    if(!u.uinvulnerable) {
			if(Teleportation && !rn2(85)) {
			    xchar old_ux = u.ux, old_uy = u.uy;
			    tele();
			    if (u.ux != old_ux || u.uy != old_uy) {
				if (!next_to_u()) {
				    check_leash(old_ux, old_uy);
				}
#ifdef REDO
				/* clear doagain keystrokes */
				pushch(0);
				savech(0);
#endif
			    }
			}

This implements teleportitis, if you are not protected while praying; if they have the intrinsic, teleport the player on a 1/85th chance each turn.

			/* delayed change may not be valid anymore */
			if ((change == 1 && !Polymorph) ||
			    (change == 2 && u.ulycn == NON_PM))
			    change = 0;

Polymorphing is delayed while wearing an amulet of unchanging; if such a polymorph is no longer valid cancel it.

			if(Polymorph && !rn2(100))
			    change = 1;

If you have the polymorphing intrinsic (from a ring of polymorph), attempt to polymorph on a 1/100 chance each turn.

			else if (u.ulycn >= LOW_PM && !Upolyd &&
				 !rn2(80 - (20 * night())))
			    change = 2;

If you are a lycanthrope, attempt to change on a 1/80 chance (or 1/60 if it is night) per turn.

			if (change && !Unchanging) {
			    if (multi >= 0) {
				if (occupation)
				    stop_occupation();
				else
				    nomul(0);
				if (change == 1) polyself(FALSE);
				else you_were();
				change = 0;
			    }

Enact the above polymorphs if you are not wearing an amulet of unchanging; otherwise delay it (as above).

			}
		    }

		    if(Searching && multi >= 0) (void) dosearch0(1);

If you have the searching intrinsic, perform the search.

		    dosounds();

dosounds generates the sounds resulting from dungeon features.

		    do_storms();

do_storms generates storm effects for the Plane of Air.

		    gethungry();

gethungry handles normal nutrition depletion and effects.

		    age_spells();

age_spells handles spell timeouts.

		    exerchk();

exerchk checks if attributes have been exercised enough for a change to occur.

		    invault();

invault handles vault guard checks.

		    if (u.uhave.amulet) amulet();

amulet handles turn-to-turn events related to holding the Amulet of Yendor.

		    if (!rn2(40+(int)(ACURR(A_DEX)*3)))
			u_wipe_engr(rnd(3));

This attempts to scuff engravings at your location on a random chance that decreases with dexterity.

		    if (u.uevent.udemigod && !u.uinvulnerable) {
			if (u.udg_cnt) u.udg_cnt--;
			if (!u.udg_cnt) {
			    intervene();
			    u.udg_cnt = rn1(200, 50);
			}
		    }

If you have killed the Wizard of Yendor or performed the invocation ritual, intervene is called every 50-249 turns; this is responsible for the Wizard's interventions and resurrections.

		    restore_attrib();

restore_attrib restores temporary changes of attributes.

		    /* underwater and waterlevel vision are done here */
		    if (Is_waterlevel(&u.uz))
			movebubbles();

movebubbles handles bubble movements on the Plane of Water.

		    else if (Underwater)
			under_water(0);

under_water handles display routines related to being under water.

		    /* vision while buried done here */
		    else if (u.uburied) under_ground(0);

under_ground handles display routines related to being buried (a deferred feature).

		    /* when immobile, count is in turns */
		    if(multi < 0) {
			if (++multi == 0) {	/* finished yet? */
			    unmul((char *)0);
			    /* if unmul caused a level change, take it now */
			    if (u.utotype) deferred_goto();
			}
		    }

If you are immobile, decrement the turn counter for being immobile and handle any effects meant to occur once the timeout for this reaches zero.

		}
	    } while (youmonst.movement<NORMAL_SPEED); /* hero can't move loop */

Once-per-action events

	    /******************************************/
	    /* once-per-hero-took-time things go here */
	    /******************************************/


	} /* actual time passed */

Once-per-input events

	/****************************************/
	/* once-per-player-input things go here */
	/****************************************/

	find_ac();

find_ac calculates and updates the player's armor class.

	if(!flags.mv || Blind) {
	    /* redo monsters if hallu or wearing a helm of telepathy */
	    if (Hallucination) {	/* update screen randomly */
		see_monsters();
		see_objects();
		see_traps();
		if (u.uswallow) swallowed(0);
	    } else if (Unblind_telepat) {
		see_monsters();
	    } else if (Warning || Warn_of_mon)
	     	see_monsters();

see_monsters, see_traps, and traps determine which glyphs to display for those features.

	    if (vision_full_recalc) vision_recalc(0);	/* vision! */

vision_recalc calculates which squares are visible to the player.

	}
	if(flags.botl || flags.botlx) bot();

If the status line needs to be updated, update it with bot.

	flags.move = 1;

Assume that the next player action will require time; if it does not flags.move will be reset at that time.

	if(multi >= 0 && occupation) {

multi is greater than zero if a player has entered in a repeated command or some other interruptible action; occupation is set to whatever function represents this action if this is the case.

#if defined(MICRO) || defined(WIN32)
	    abort_lev = 0;
	    if (kbhit()) {
		if ((ch = Getchar()) == ABORT)
		    abort_lev++;
# ifdef REDO
		else
		    pushch(ch);
# endif /* REDO */
	    }
	    if (!abort_lev && (*occupation)() == 0)
#else
	    if ((*occupation)() == 0)
#endif
		occupation = 0;
	    if(
#if defined(MICRO) || defined(WIN32)
		   abort_lev ||
#endif
		   monster_nearby()) {
		stop_occupation();
		reset_eat();
	    }

If a key has been pressed either when no action is in process or in the middle of an interruptible action, check if that key is ABORT (^A by default); if so, interrupt any current action if possible and if not add the key to the key queue with pushch. Actions will also be interrupted if the player senses a monster (checked with monster_nearby).

#if defined(MICRO) || defined(WIN32)
	    if (!(++occtime % 7))
		display_nhwindow(WIN_MAP, FALSE);
#endif

On some platforms, update the map on a regular basis.

	    continue;
	}

	if ((u.uhave.amulet || Clairvoyant) &&
	    !In_endgame(&u.uz) && !BClairvoyant &&
	    !(moves % 15) && !rn2(2))
		do_vicinity_map();

If it is a fifteenth turn and you are clairvoyant and not in the endgame, on a one half chance generate the clairvoyance map with do_vicinity_map.

	if(u.utrap && u.utraptype == TT_LAVA) {
	    if(!is_lava(u.ux,u.uy))
		u.utrap = 0;
	    else if (!u.uinvulnerable) {
		u.utrap -= 1<<8;
		if(u.utrap < 1<<8) {
		    killer_format = KILLED_BY;
		    killer = "molten lava";
		    You("sink below the surface and die.");
		    done(DISSOLVED);
		} else if(didmove && !u.umoved) {
		    Norep("You sink deeper into the lava.");
		    u.utrap += rnd(4);
		}
	    }
	}

After each player action, when you are in a lava trap, sink into the lava some more. After 11 to 14 actions, kill the player. Note: u.utrap is set at trap.c#line3991.

#ifdef WIZARD
	if (iflags.sanity_check)
	    sanity_check();
#endif

sanity_check performs some debugging checks if a wizard mode player has them enabled.

#ifdef CLIPPING
	/* just before rhack */
	cliparound(u.ux, u.uy);

cliparound is a window system routine meant to ensure the player is centred in the screen (to the extent that is possible with the windowing system).

#endif

	u.umoved = FALSE;

Assume that the player has not entered in a movement command until they actually do so.

	if (multi > 0) {
	    lookaround();
	    if (!multi) {
		/* lookaround may clear multi */
		flags.move = 0;
		if (flags.time) flags.botl = 1;
		continue;
	    }
	    if (flags.mv) {
		if(multi < COLNO && !--multi)
		    flags.travel = iflags.travel1 = flags.mv = flags.run = 0;
		domove();
	    } else {
		--multi;
		rhack(save_cm);
	    }

Repeated command code, also used for interruptible actions. If nothing interrupts the action (checked with lookaround) perform the stored move or command with rhack. Rhack essentially reads the keyboard input and kicks off player actions.

	} else if (multi == 0) {
#ifdef MAIL
	    ckmailstatus();
#endif
	    rhack((char *)0);

If there are no repeated commands or interruptible actions, bring in the mail daemon as necessary with ckmailstatus and then take player input with rhack.

	}
	if (u.utotype)		/* change dungeon level */
	    deferred_goto();	/* after rhack() */

deferred_goto checks if the player has changed levels and takes appropriate action if they have.

	/* !flags.move here: multiple movement command stopped */
	else if (flags.time && (!flags.move || !flags.mv))
	    flags.botl = 1;

	if (vision_full_recalc) vision_recalc(0);	/* vision! */

Recalulate visible tiles if the command just entered necessiates it.

	/* when running in non-tport mode, this gets done through domove() */
	if ((!flags.run || iflags.runmode == RUN_TPORT) &&
		(multi && (!flags.travel ? !(multi % 7) : !(moves % 7L)))) {
	    if (flags.time && flags.run) flags.botl = 1;
	    display_nhwindow(WIN_MAP, FALSE);

Update the map window every seven moves or turns if certain flags are set.

	}
}
}

#endif /* OVL0 */

stop_occupation

#ifdef OVL1

void
stop_occupation()
{
	if(occupation) {
		if (!maybe_finished_meal(TRUE))
		    You("stop %s.", occtxt);
		occupation = 0;
		flags.botl = 1; /* in case u.uhs changed */
/* fainting stops your occupation, there's no reason to sync.
		sync_hunger();
*/
#ifdef REDO
		nomul(0);
		pushch(0);
#endif
	}
}

#endif /* OVL1 */

display_gamewindows

#ifdef OVLB

void
display_gamewindows()
{
WIN_MESSAGE = create_nhwindow(NHW_MESSAGE);
WIN_STATUS = create_nhwindow(NHW_STATUS);
WIN_MAP = create_nhwindow(NHW_MAP);
WIN_INVEN = create_nhwindow(NHW_MENU);

#ifdef MAC
/*
* This _is_ the right place for this - maybe we will
* have to split display_gamewindows into create_gamewindows
* and show_gamewindows to get rid of this ifdef...
*/
	if ( ! strcmp ( windowprocs . name , "mac" ) ) {
	    SanePositions ( ) ;
	}
#endif

/*
* The mac port is not DEPENDENT on the order of these
* displays, but it looks a lot better this way...
*/
display_nhwindow(WIN_STATUS, FALSE);
display_nhwindow(WIN_MESSAGE, FALSE);
clear_glyph_buffer();
display_nhwindow(WIN_MAP, FALSE);
}

newgame

void
newgame()
{
	int i;

#ifdef MFLOPPY
	gameDiskPrompt();
#endif

	flags.ident = 1;

	for (i = 0; i < NUMMONS; i++)
		mvitals[i].mvflags = mons[i].geno & G_NOCORPSE;

	init_objects();		/* must be before u_init() */

	flags.pantheon = -1;	/* role_init() will reset this */
	role_init();		/* must be before init_dungeons(), u_init(),
				 * and init_artifacts() */

	init_dungeons();	/* must be before u_init() to avoid rndmonst()
				 * creating odd monsters for any tins and eggs
				 * in hero's initial inventory */
	init_artifacts();	/* before u_init() in case $WIZKIT specifies
				 * any artifacts */
	u_init();

#ifndef NO_SIGNAL
	(void) signal(SIGINT, (SIG_RET_TYPE) done1);
#endif
#ifdef NEWS
	if(iflags.news) display_file(NEWS, FALSE);
#endif
	load_qtlist();	/* load up the quest text info */
/*	quest_init();*/	/* Now part of role_init() */

	mklev();
	u_on_upstairs();
	vision_reset();		/* set up internals for level (after mklev) */
	check_special_room(FALSE);

	flags.botlx = 1;

	/* Move the monster from under you or else
	 * makedog() will fail when it calls makemon().
	 *			- ucsfcgl!kneller
	 */
	if(MON_AT(u.ux, u.uy)) mnexto(m_at(u.ux, u.uy));
	(void) makedog();
	docrt();

	if (flags.legacy) {
		flush_screen(1);
		com_pager(1);
	}

#ifdef INSURANCE
	save_currentstate();
#endif
	program_state.something_worth_saving++;	/* useful data now exists */

	/* Success! */
	welcome(TRUE);
	return;
}

welcome

/* show "welcome [back] to nethack" message at program startup */
void
welcome(new_game)
boolean new_game;	/* false => restoring an old game */
{
char buf[BUFSZ];
boolean currentgend = Upolyd ? u.mfemale : flags.female;

/*
* The "welcome back" message always describes your innate form
* even when polymorphed or wearing a helm of opposite alignment.
* Alignment is shown unconditionally for new games; for restores
* it's only shown if it has changed from its original value.
* Sex is shown for new games except when it is redundant; for
* restores it's only shown if different from its original value.
*/
*buf = '\0';
if (new_game || u.ualignbase[A_ORIGINAL] != u.ualignbase[A_CURRENT])
	Sprintf(eos(buf), " %s", align_str(u.ualignbase[A_ORIGINAL]));
if (!urole.name.f &&
	    (new_game ? (urole.allow & ROLE_GENDMASK) == (ROLE_MALE|ROLE_FEMALE) :
	     currentgend != flags.initgend))
	Sprintf(eos(buf), " %s", genders[currentgend].adj);

pline(new_game ? "%s %s, welcome to NetHack!  You are a%s %s %s."
		   : "%s %s, the%s %s %s, welcome back to NetHack!",
	  Hello((struct monst *) 0), plname, buf, urace.adj,
	  (currentgend && urole.name.f) ? urole.name.f : urole.name.m);
}

do_positionbar

#ifdef POSITIONBAR
STATIC_DCL void
do_positionbar()
{
	static char pbar[COLNO];
	char *p;
	
	p = pbar;
	/* up stairway */
	if (upstair.sx &&
	   (glyph_to_cmap(level.locations[upstair.sx][upstair.sy].glyph) ==
	    S_upstair ||
	    glyph_to_cmap(level.locations[upstair.sx][upstair.sy].glyph) ==
	    S_upladder)) {
		*p++ = '<';
		*p++ = upstair.sx;
	}
	if (sstairs.sx &&
	   (glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) ==
	    S_upstair ||
	    glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) ==
	    S_upladder)) {
		*p++ = '<';
		*p++ = sstairs.sx;
	}

	/* down stairway */
	if (dnstair.sx &&
	   (glyph_to_cmap(level.locations[dnstair.sx][dnstair.sy].glyph) ==
	    S_dnstair ||
	    glyph_to_cmap(level.locations[dnstair.sx][dnstair.sy].glyph) ==
	    S_dnladder)) {
		*p++ = '>';
		*p++ = dnstair.sx;
	}
	if (sstairs.sx &&
	   (glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) ==
	    S_dnstair ||
	    glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) ==
	    S_dnladder)) {
		*p++ = '>';
		*p++ = sstairs.sx;
	}

	/* hero location */
	if (u.ux) {
		*p++ = '@';
		*p++ = u.ux;
	}
	/* fence post */
	*p = 0;

	update_positionbar(pbar);
}
#endif

#endif /* OVLB */

/*allmain.c*/