출구 정렬

2007.04.12 13:02

그리움 조회 수:186 추천:56

제 목:[초보] 무한대전 출구 부분...
올린이:muhan (김준식 ) 99/01/05 11:21 읽음:347 관련자료 있음(TL)
-----------------------------------------------------------------------------
/* 무한대전에서의 출구 생성부분 개량
*
* 현재운영중인 무한대전 또는 "무한대전 소스를 수정한 머드"들 중에서
* 상업적으로 사용되는 곳을 제외하면, 누구나 이소스를 사용할수 있습니다.
*
* 설명: 출구 그래프가.. 1바이트에서 2바이트로 나옴...
* 또, 동 서 남 북 위 밑 으로 출구이름이 정열됨... ^^
* 방제목만 가운데로 몰림...
* 설명을 제대로 못드리겠네여... 그냥 추가하시면 알게됨..
*
* 나머지는 각 무한대전에 알맞게 수정하셔서 쓰시면 됩니다.
*
* 1999년 1월 5일 By Muhan.
*/

/**********************************************************************/
/* display_rom */
/**********************************************************************/

void display_rom(ply_ptr, rom_ptr)
creature *ply_ptr;
room *rom_ptr;
{
xtag *xp;
ctag *cp;
otag *op;
creature *crt_ptr;
char str[2048];
int fd, n=0, m, t, light = 0;
int name_check, leng; /* 추가 */
char exit_1[3][6]={ " ", " ", " ", }; /* 추가 */
char exit_2[2][20]={ "", "", }; /* 추가 */
char exit_3[4][4]={ " ", " ", " ", " ", }; /* 추가 */
char exit_4[6][4]={ "", "", "", "", "", "", }; /* 추가 */
int n2;

       /* 생략 */
                
       if(!F_ISSET(ply_ptr, PNORNM)) {
       /* 가운데로 방이름만 정렬 시킴 */
       ANSI(fd, CYAN);
       print(fd, "==");
       leng = strlen(cut_space(rom_ptr->name));

       if(leng < 59) {
       print(fd, " ");

       for(name_check=0; name_check < (59-leng)/2; name_check++) {
       print(fd, " ");
       }

       printa(fd, "%s", cut_space(rom_ptr->name));
                    
       for(name_check=0; name_check < (59-leng)/2; name_check++) {
       print(fd, " ");
       }

       print(fd, " ");
       }

       print(fd, "==");
       ANSI(fd, WHITE);

       /* 생략 */

       else {
       n=n2=0;
       str[0] = 0;
       xp = rom_ptr->first_ext;

       while(xp) {
       if(!F_ISSET(xp->ext, XSECRT) && !F_ISSET(xp->ext, XNOSEE)
&& (F_ISSET(ply_ptr, PDINVI) ? 1 : !F_ISSET(xp->ext, XINVIS))) {

       if(!strcmp(xp->ext->name, "동")) {
       strcpy(exit_3[0], "▷");
       strcpy(exit_4[0], "동 ");
       }

       else
       if(!strcmp(xp->ext->name, "서")) {
       strcpy(exit_3[1], "◁");
       strcpy(exit_4[1], "서 ");
       }

       else
       if(!strcmp(xp->ext->name, "남")) {
       strcpy(exit_3[2], "▽");
       strcpy(exit_4[2], "남 ");
       }

       else
       if(!strcmp(xp->ext->name, "북")) {
       strcpy(exit_3[3], "△");
       strcpy(exit_4[3], "북 ");
       }

       else
       if(!strcmp(xp->ext->name, "위"))
       strcpy(exit_4[4], "위 ");

       else
       if(!strcmp(xp->ext->name, "밑"))
       strcpy(exit_4[5], "밑 ");

       else {
       strcat(str, xp->ext->name);
       strcat(str, " ");
       n++;
       }

       n2++;
       }

       xp = xp->next_tag;
       }

       if(!n2) {
       ANSI(fd, CCCYA);
       print(fd, "\n ○ ");
       ANSI(fd, CCWHI);
       print(fd, " 갈수 있는 방향은");
       ANSI(fd, CCGRE);
       print(fd, " *출구없음* ");
       ANSI(fd, CCWHI);
       print(fd, "입니다.\n");
       }
        
       else {
       ANSI(fd, CCCYA);
       strcpy(exit_1[0], " ");
       strcat(exit_1[0], exit_3[3]);
       strcat(exit_1[0], "");
       print(fd, "%s\n", exit_1[0]);

       strcpy(exit_1[1], exit_3[1]);
       strcat(exit_1[1], "○");
       strcat(exit_1[1], exit_3[0]);
       print(fd, "%s", exit_1[1]);
       strcat(exit_2[0], exit_4[0]);
       strcat(exit_2[0], exit_4[1]);
       strcat(exit_2[0], exit_4[2]);
       strcat(exit_2[0], exit_4[3]);
       strcat(exit_2[0], exit_4[4]);
       strcat(exit_2[0], exit_4[5]);
       strcat(exit_2[0], str);
       ANSI(fd, CCWHI);
       print(fd, " 갈수 있는 출구는");
       ANSI(fd, CCGRE);
       print(fd, " %s", exit_2[0]);
       ANSI(fd, CCWHI);
       print(fd, "입니다.\n");

       ANSI(fd, CCCYA);
       strcpy(exit_1[2], " ");
       strcat(exit_1[2], exit_3[2]);
       strcat(exit_1[2], "");
       print(fd, "%s\n", exit_1[2]);
       ANSI(fd, CCWHI);
       }
       }

       /* 생략 */

       이상입니다.


                                                       ..^^..
                                                       -초보-


홈지기 "그륨"


XE Login