forked from YusukeKato/RPG
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrpg.c
85 lines (73 loc) · 1.47 KB
/
rpg.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Explanation : This game has created since 1 June.
*
* Title : Happy Story
*
* Writer : Yusuke Kato
* Satosi Simada
* Peko_chan
*
* Player : izumi tyinko-beru
* Naoya Tarumi
*
* Date : June. 1,2,
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <windows.h>
#include <conio.h>
#include <stdarg.h>
#include "file.h"
#include "print_screen.h"
/* Global variable */
struct player p;
void main(void)
{
int con;
start_game:
system("cls");
printf("ゲームを開始します。\n");
if(player_read(&p) != 0) {
make_char:
make_charactor(&p);
printf("キャラクター作成完了!\n");
} else {
printf("キャラクターデータを検出!\nロード中.......\n"
"+----------------------+\n"
"|レベル | %d\n"
"|名前 | %s\n"
"|職業 | %d\n"
"|年齢 | %d\n"
"|性別 | %d\n"
"+----------------------+\n",
p.level, p.name, p.job, p.age, p.sex);
printf("このデータでプレイしますか?\n"
"1: Yes, 0: No > ");
scanf("%d", &con);
if(!con) goto make_char;
}
system("cls");
fflush(stdin);
/* 職業によってストーリーを分岐 */
switch(p.job) {
case 1:
Yusha();
break;
case 7:
Fujiwara();
break;
default:
printf("ストーリーのロードに失敗しました\n\n");
break;
}
printf("どれかキーを押してください...");
_getch();
system("cls");
printf("続ける: 1\n");
printf("やめる: 0\n");
scanf("%d", &con);
if(con == 1) goto start_game;
return 0;
}