Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » EXIT DIRS
Forum Rules | Mark all | Recent Posts

EXIT DIRS
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 29, 2004, 4:05 pm   Last edited Nov 18, 2007, 4:20 pm by Samson
Go to the top of the page
Go to the bottom of the page

paradox

GroupMembers
Posts15
JoinedOct 25, 2004

Hey all,

just wondering if there's an easy way to make it set so dirs that aren't set to HIDDEN or SECRET, but are CLOSED and ISDOOR could show up differently. Basically I want , if there was a north exit that was a door, but wasn't hidden/secret to show up like this

Exits: [North]

rather then

Exits: none.

here's my current code for do_exits in case that helps
void do_exits( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    EXIT_DATA *pexit;
    bool found;
    bool fAuto;

    set_char_color( AT_EXITS, ch );
    buf[0] = '�';
    fAuto  = !str_cmp( argument, "auto" );

    if ( !check_blind(ch) )
	return;

    strcpy( buf, fAuto ? "Exits:" : "Obvious exits:\r\n" );

    found = FALSE;
    for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
    {
	if ( pexit->to_room
	&&  !IS_SET(pexit->exit_info, EX_CLOSED)
	&& (!IS_SET(pexit->exit_info, EX_WINDOW)
	||   IS_SET(pexit->exit_info, EX_ISDOOR))
	&&  !IS_SET(pexit->exit_info, EX_HIDDEN) )
	{
	    found = TRUE;
	    if ( fAuto )
	    {
		strcat( buf, " " );
		strcat( buf, dir_name[pexit->vdir] );
	    }
	    else
	    {
		sprintf( buf + strlen(buf), "%-5s - %s\r\n",
		    capitalize( dir_name[pexit->vdir] ),
		    room_is_dark( pexit->to_room )
			?  "Too dark to tell"
			: pexit->to_room->name
		    );
	    }
	}
    }

    if ( !found )
	strcat( buf, fAuto ? " none.\r\n" : "None.\r\n" );
    else
      if ( fAuto )
	strcat( buf, ".\r\n" );
    send_to_char( buf, ch );
    return;
}



thx

-Paradox
       
Post is unread #2 Oct 29, 2004, 5:02 pm   Last edited Nov 18, 2007, 4:22 pm by Samson
Go to the top of the page
Go to the bottom of the page

cynshard

GroupMembers
Posts95
JoinedNov 19, 2003

This is one of the very first things I changed, so it's modified very crudely. It produces and exit listing like in many diku muds.

/* Function modified from original form - Samson 1-25-98 */
CMDF do_exits( CHAR_DATA *ch, char *argument )
{
	char buf[MSL], exitbuf[256] = "";
	EXIT_DATA *pexit;
	bool found;
	bool fAuto;
	bool eClosed; /* Used to hold if the exit is saved or not -- Cynshard*/
	int  spaces;  /* Used to format output -- Cynshard */

	buf[0] = '�';
	fAuto  = !str_cmp( argument, "auto" );

	if ( !check_blind(ch) )
  return;

	if( fAuto && MXP_ON( ch ) )
  send_to_char( MXP_TAG_ROOMEXIT, ch );

	set_char_color( AT_EXITS, ch );

	mudstrlcpy( buf, fAuto ? "Obvious exits:\r\n" : "Obvious exits:\r\n", MSL ); /* Changed -- Cynshard */

	found = FALSE;
	for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
	{
  eClosed = ( IS_EXIT_FLAG(pexit, EX_CLOSED) ); /* Grabbing Exit Value -- Cynshard */
  spaces = 6 - strlen (dir_name[pexit->vdir]); /* Initializing Spaces for Output -- Cynshard */
  if (spaces to_room )
  	{
    found = TRUE;
    if ( fAuto )
    {
    	/* Removing initial space -- Cynshard
    	mudstrlcat( buf, " ", MSL );
    	*/
    	if( MXP_ON( ch ) )
      mudstrlcat( buf, "", MSL );
    	/* Formatting Immortal AutoExits to look like the exits arg -- Cynshard */
    	mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );
    	for( int i = 1; i to_room->name, MSL );
    	/* End Immortal AutoExits Format */


    	if( MXP_ON( ch ) )
      mudstrlcat( buf, "", MSL );

    	if ( IS_EXIT_FLAG(pexit, EX_OVERLAND) )
      mudstrlcat( buf, "->(Overland)", MSL );

    	/* New code added to display closed, or otherwise invisible exits to immortals */
    	/* Installed by Samson 1-25-98 */
    	if ( IS_EXIT_FLAG(pexit, EX_CLOSED) )
      mudstrlcat( buf, "->(Closed)", MSL );
    	if ( IS_EXIT_FLAG(pexit, EX_WINDOW) )
      mudstrlcat( buf, "->(Window)", MSL );
    	if ( IS_EXIT_FLAG(pexit, EX_HIDDEN) )
      mudstrlcat( buf, "->(Hidden)", MSL );
    	if( IS_PCFLAG( ch, PCFLAG_SHOWVNUMS ) )
    	{
      snprintf( exitbuf, 256, " &[iface4]&D", pexit->to_room->vnum ? pexit->to_room->vnum : -1 );
      mudstrlcat( buf, exitbuf, MSL );
    	}
    	mudstrlcat( buf, "\r\n", MSL ); /* Puts Each Exit on a New Line */
    } /* END IMMORTAL AUTOLOOK -- Cynshard */
    else /* Begin Immortal Argument Look -- Cynshard */
    {
    	snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s", capitalize( dir_name[pexit->vdir] ), spaces," ", pexit->to_room->name ); /* Changed to Format Exits -- Cynshard*/

    	/* More new code added to display closed, or otherwise invisible exits to immortals */
    	/* Installed by Samson 1-25-98 */
    	if( room_is_dark( pexit->to_room, ch ) )
      mudstrlcat( buf, "->(Dark)", MSL );
    	if( IS_EXIT_FLAG( pexit, EX_CLOSED ) )
      mudstrlcat( buf, "->(Closed)", MSL );
    	if( IS_EXIT_FLAG( pexit, EX_HIDDEN ) )
      mudstrlcat( buf, "->(Hidden)", MSL );
    	if( IS_EXIT_FLAG( pexit, EX_WINDOW ) )
      mudstrlcat( buf, "->(Window)", MSL );
    	if( IS_PCFLAG( ch, PCFLAG_SHOWVNUMS ) )
    	{
      snprintf( exitbuf, 256, " &[iface4]&D", pexit->to_room->vnum ? pexit->to_room->vnum : -1 );
      mudstrlcat( buf, exitbuf, MSL );
    	}

    	mudstrlcat( buf, "\r\n", MSL );

    } /* End Immortal Arg exits -- Cynshard */
  	} /* End pexit->to_room */
  } /* End Immortal Specific Exits -- Cynshard */
  else
  {
  	if ( pexit->to_room
    &&  !IS_EXIT_FLAG(pexit, EX_SECRET)
    && (!IS_EXIT_FLAG(pexit, EX_WINDOW) || IS_EXIT_FLAG(pexit, EX_ISDOOR))
    &&  !IS_EXIT_FLAG(pexit, EX_HIDDEN)
    &&  !IS_EXIT_FLAG(pexit, EX_FORTIFIED) /* Checks for walls, Marcus */
    &&  !IS_EXIT_FLAG(pexit, EX_HEAVY)
    &&  !IS_EXIT_FLAG(pexit, EX_MEDIUM)
    &&  !IS_EXIT_FLAG(pexit, EX_LIGHT)
    &&  !IS_EXIT_FLAG(pexit, EX_CRUMBLING) )
  	{
    found = TRUE;
    if ( fAuto ) /* Begin Mortal AutoExits */
    {
    	/*
    	mudstrlcat( buf, " ", MSL );
    	*/

    	if( MXP_ON( ch ) )
      mudstrlcat( buf, "", MSL );
    	/* Formatting mortal AutoExits to look like the exits arg -- Cynshard */
    	mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );
    	for( int i = 1; i to_room->name, MSL );
    	else if(eClosed)
      mudstrlcat( buf, "Closed", MSL );
    	/* End mortal AutoExits Format */

    	if( MXP_ON( ch ) )
      mudstrlcat( buf, "", MSL );
    	/*
    	if ( IS_EXIT_FLAG(pexit, EX_CLOSED) )
    	mudstrlcat( buf, "->(Closed)", MSL );
    	*/
    	/* New Line ! -- Cynshard*/
    	mudstrlcat( buf, "\r\n", MSL );
    }
    else
    {
    	if(!eClosed)
      snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s\r\n", capitalize( dir_name[pexit->vdir] ), spaces," ", room_is_dark( pexit->to_room, ch ) ? "Too dark to tell" : pexit->to_room->name ); /* Changed to Format Exits -- Cynshard*/
    	else if(eClosed)
      snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s\r\n", capitalize( dir_name[pexit->vdir] ), spaces," ", "Closed";); /* Changed to Format Exits -- Cynshard*/
    	/*
    	snprintf( buf + strlen(buf), MSL - strlen(buf), "%s - %s\r\n", capitalize( dir_name[pexit->vdir] ),
    	room_is_dark( pexit->to_room, ch ) ? "Too dark to tell" : pexit->to_room->name );
    	*/
    }
  	}
  }
	}

	if ( !found )
	{
  mudstrlcat( buf, fAuto ? "none.\r\n" : "None.\r\n", MSL ); /* Changed -- Cynshard */
  if( MXP_ON( ch ) )
  	mudstrlcat( buf, MXP_TAG_ROOMEXIT_CLOSE, MSL );
	}
	else
	{
  if ( fAuto )
  {
  	mudstrlcat( buf, "", MSL ); /* Changed -- Jesse */
  	if( MXP_ON( ch ) )
    mudstrlcat( buf, MXP_TAG_ROOMEXIT_CLOSE, MSL );
  }
	}
	/* Remove the Extra Spaces
	mudstrlcat( buf, "\r\n", MSL );
	*/
	send_to_char( buf, ch );

	return;
}
       
Pages:<< prev 1 next >>