diff --git a/Main_eng/main.c b/Main_eng/main.c new file mode 100644 index 0000000..8c5dc3c --- /dev/null +++ b/Main_eng/main.c @@ -0,0 +1,124 @@ +#include //¹öÀü 4 +#include +#include +#include +#include "func.h" + +int main() +{ + random_num(); //³­¼ö »ý¼º + + while (1) { + title(); //½ÃÀÛÈ­¸éÀÌ ³ªÅ¸³­´Ù + if (First_select == 1) { //1¹ø. °ÔÀÓ½ÃÀÛ ¼±ÅýÃ.. + while (1) { + choose_character(); //ij¸¯ÅÍ ¼±Åà + if (Character_select == 1) { //1¹ø. Attacker ¼±ÅýÃ.. + set_Attacker(); //Attacker ´É·ÂÄ¡ ¼³Á¤ + break; + } + if (Character_select == 2) { //2¹ø. Defender ¼±ÅýÃ.. + set_Defender(); //Defender ´É·ÂÄ¡ ¼³Á¤ + break; + } + if (Character_select == 3) { //3¹ø. Allrounder ¼±ÅýÃ.. + set_Allrounder(); //Allrounder ´É·ÂÄ¡ ¼³Á¤ + break; + } + else { + printf("\n[Please input retry]\n\n");//´Ù¸¥°É ÀԷ½à + } + } + + story(); //°ÔÀÓ ½ÃÀÛ Àü ½ºÅ丮 + + while (1) { + player_act(); //°ø°Ý¹æ½Ä ¼±Åà + if (Attack_Number == 1) { // 1. ¶§¸®±â ¼±ÅýÃ.. + player_AttackNum_1(); // 1¹ø °ø°Ý + endline_player(); //¸ó½ºÅÍ¿¡°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Attack_Number == 2) { // 2. ÇÒÄû±â ¼±ÅýÃ.. + player_AttackNum_2(); //2¹ø °ø°Ý + if (Scratch_Attack > 5) { //·£´ý¼ýÀÚ°¡ 5º¸´Ù Ŭ½Ã + player_AttackNum_2_Critical(); //Å©¸®Æ¼Äà + } + endline_player(); //¸ó½ºÅÍ¿¡°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Attack_Number == 3) { //3. Â÷±â ¼±ÅýÃ.. <ÃßÈÄ Âù ºÎºÐ Ãæ°ÝÀ¸·Î ÀÎÇØ Áö¼ÓÀûÀÎ µ¥¹ÌÁö¸¦ ³Ö°Ô²û Ãß°¡Çϱâ> + player_AttackNum_3(); //3¹ø °ø°Ý + endline_player();//¸ó½ºÅÍ¿¡°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Attack_Number == 4) { //4. º£±â ¼±ÅýÃ.. + player_AttackNum_4(); //4¹ø °ø°Ý + if (Slash_Attack <= 2) { //·£´ý¼ýÀÚ°¡ 2 ÀÌÇÏÀϽà + player_AttackNum_4_None(); //°ø°Ý ½ÇÆÐ + } + if (Slash_Attack >= 3 && Slash_Attack <= 6) { //·£´ý¼ýÀÚ°¡ 3~6ÀϽà + player_AttackNum_4_Normal(); //°ø°Ý ¼º°ø + } + if (Slash_Attack >= 7 && Slash_Attack <= 9) { //·£´ý¼ýÀÚ°¡ 7~9ÀϽà + player_AttackNum_4_Critical(); //°­·ÂÇÑ °ø°Ý ¼º°ø + } + endline_player();//¸ó½ºÅÍ¿¡°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Player_HP <= 0 || Monster1_HP <= 0) { // [1]°á°ú°è»ê + if (Player_HP <= 0) { //Ç÷¹À̾î ä·ÂÀÌ 0 ÀÌÇÏÀϽà + knockdown_player(); //¸ó½ºÅÍ ½Â¸® ¹®±¸ Ãâ·Â + } + if (Monster1_HP <= 0) { //¸ó½ºÅÍ Ã¤·ÂÀÌ 0 ÀÌÇÏÀϽà + knockdown_monster(); //Ç÷¹ÀÌ¾î ½Â¸® ¹®±¸ Ãâ·Â + } + knockdown_result_turn(); //ÃÑ ÁøÇàµÈ Åϼö Ãâ·Â + break; + } + if (monster_Turn % 2 == 0) { //(ÅÏÀÌ Â¦¼öÀ϶§)¸ó½ºÅÍÀÇ ÅÏ + monster_act(); //¸ó½ºÅÍ ÅÏ ¹®±¸ Ãâ·Â, ·£´ý¼ýÀÚ »ý¼º + if (Monster_Attack <= 1) { // ·£´ý¼ýÀÚ°¡ 1ÀÌÇÏÀ϶§ + monster_Attack_None(); // °ø°Ý ½ÇÆÐ + endline_monster(); // Ç÷¹À̾°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Monster_Attack >= 2 && Monster_Attack <= 7) { //·£´ý¼ýÀÚ°¡ 2~7ÀϽà °ø°Ý ¼º°ø + monster_Attack_Normal(); //°ø°Ý ¼º°ø + endline_monster();//Ç÷¹À̾°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + if (Monster_Attack >= 8 && Monster_Attack <= 9) { //·£´ý¼ýÀÚ°¡ 8~9ÀϽà °­·ÂÇÑ °ø°Ý ¼º°ø + monster_Attack_Critical(); //°­·ÂÇÑ °ø°Ý ¼º°ø + endline_monster();//Ç÷¹À̾°Ô ÀÔÈù µ¥¹ÌÁö, ³²Àº HP Ãâ·Â + } + } + if (Player_HP <= 0 || Monster1_HP <= 0) { // [1]°á°ú°è»ê + if (Player_HP <= 0) { //Ç÷¹À̾î ä·ÂÀÌ 0 ÀÌÇÏÀϽà + knockdown_player(); //¸ó½ºÅÍ ½Â¸® ¹®±¸ Ãâ·Â + } + if (Monster1_HP <= 0) { //¸ó½ºÅÍ Ã¤·ÂÀÌ 0 ÀÌÇÏÀϽà + knockdown_monster(); //Ç÷¹ÀÌ¾î ½Â¸® ¹®±¸ Ãâ·Â + } + knockdown_result_turn(); //ÃÑ ÁøÇàµÈ Åϼö Ãâ·Â + break; + } + } + } + if (First_select == 2) { //2¹ø. µ¥ÀÌÅÍÃʱâÈ­ ½ÃÀÛ + reset_data(); //ÃʱâÈ­ + printf("\nReset success.\n\n\n"); + } + if (First_select == 3) { //3¹ø. ÇÁ·Î±×·¥ Á¾·á + printf("\nProgram exiting...\n"); + break; + } + else { + printf("\n[Please input retry]\n\n"); //ù ¸Þ´º¿¡¼­ À߸ø ÀԷ½à + } + } + printf("\n\n---Thank you for use this program!---\n\n"); + Sleep(2000); //¹®±¸µµ ¸øº¸°í ¹Ù·Î Á¾·áµÇ´Â°É ¹æÁö +} + + +/* + +¸ó½ºÅÍÀÇ °­·ÂÇÑ °ø°Ý °è»ê½Ä ¼öÁ¤Çغ¸±â +»óÅÂÀÌ»ó(µ¶, ¸¶ºñ µî) ±¸ÇöÇϱâ + +*/ \ No newline at end of file