rpg 소스오류점!!
스킬
질문 제목 : rpg 소스오류점!!미숙한 소스많은 태클과 조언과 답변을 바랍니다^^
질문 내용 :
#includestdio.h
#includewindows.h
#includeconio.h
int set;
int Hp; //체력 //
int Mp; //마력 //
int atec; //공격력 // 능력치선언
int protect; //방어력 //
int money; //자본 //
int level; //레벨 //
char 성향[20]; //성향 //
void 상점();
void 초기설정();
int main()
{
system(mode con lines=30 cols=50);
초기설정();
town:
system(cls);
printf(&&&&&&&&&&&&&&&&&&&&&마을&&&&&&&&&&&&&&&&&&&&&&&&&\n);
printf( 1. 상점 2.여관 3.사냥터 \n);
printf( 0.save );
scanf(%d,&set); //건물선택
switch(set)
{
case 1: //상점이동
상점();
default: //다른키입력시 다시 마을
goto town;
}
return 0;
}
void 상점() //상점
store:
system(cls);
printf(&&&&&&&&&&&&&&&&&&&&&상점&&&&&&&&&&&&&&&&&&&&&&&&&\n);
printf( 1.물약상점 2.무기상점 3.방어구상점 \n);
printf( \n);
printf( 0.나가기 \n);
scanf(%d,&set);
switch(set)
{
case 1://물약상점
case 2://무기상점
case 3://방어구 상점
case 0://나가기
goto town;
default:
goto store;
}
void 초기설정()&; //초기설정
{
최초페이지로:
printf( 게임캐릭터 성향을 골라주세요.\n);
printf(\n [1]공격형 [2]방어형\n);
printf( [3]자본형 [4]체력형\n\n);
scanf(%d,&set);
switch(set)
{
case 1:
level=1;
Hp=18;
Mp=10;
atec=20;
protect=8;
money=1000;
strcpy(성향,공격형);
break;
case 2:
level=1;
Hp=20;
Mp=10;
atec=12;
protect=20;
money=1000;
strcpy(성향,방어형);
break;
case 3:
level=1;
Hp=18;
Mp=10;
atec=13;
protect=8;
money=5000;
strcpy(성향,자본형);
break;
case 4:
level=1;
Hp=30;
Mp=10;
atec=13;
protect=10;
money=1000;
strcpy(성향,체력형);
break;
case 77:
level=1;
Hp=40;
Mp=20;
atec=30;
protect=20;
money=3000;
strcpy(성향,히든형);
break;
default:
system(cls);
printf( 잘못된 입력을 하셨습니다.\n\n);
printf( 잠시후 이전 화면으로 돌아갑니다\n\n);
Sleep(1500);
system(cls);
goto 최초페이지로;
}
printf(능력치가 조정중입니다.\n\n);
Sleep(1500);
system(cls);
printf(%s능력치가 설정됩니다.\n\n,성향);
printf(LV : %d\n,level);
printf(Hp : %d\n,Hp);
printf(Mp : %d\n,Mp);
printf(공격력 : %d\n,atec);
printf(방어력 : %d\n,protect);
printf(자본 : %d\n,money);
getch();
system(cls);
}